@q1travel/design-system 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { jsxs as i, jsx as e, Fragment as J } from "react/jsx-runtime";
2
- import { forwardRef as ot, createElement as Be, createContext as it, useContext as ct, useState as I, useRef as q, useCallback as Ne, useEffect as P, useLayoutEffect as fe, useMemo as oe, useId as K, isValidElement as Ze, Fragment as Qe, cloneElement as Tt } from "react";
1
+ import { jsxs as i, jsx as e, Fragment as ee } from "react/jsx-runtime";
2
+ import { forwardRef as ot, createElement as Be, createContext as it, useContext as ct, useState as A, useRef as q, useCallback as Ne, useEffect as O, useLayoutEffect as fe, useMemo as ie, useId as P, isValidElement as Ze, Fragment as Qe, cloneElement as Tt } from "react";
3
3
  import { createPortal as dt } from "react-dom";
4
4
  const zt = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), ut = (...t) => t.filter((n, r, a) => !!n && n.trim() !== "" && a.indexOf(n) === r).join(" ").trim();
5
5
  var Rt = {
@@ -41,7 +41,7 @@ const Lt = ot(
41
41
  ]
42
42
  )
43
43
  );
44
- const L = (t, n) => {
44
+ const W = (t, n) => {
45
45
  const r = ot(
46
46
  ({ className: a, ...s }, l) => Be(Lt, {
47
47
  ref: l,
@@ -52,69 +52,69 @@ const L = (t, n) => {
52
52
  );
53
53
  return r.displayName = `${t}`, r;
54
54
  };
55
- const Wt = L("ArrowLeft", [
55
+ const Wt = W("ArrowLeft", [
56
56
  ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
57
57
  ["path", { d: "M19 12H5", key: "x3x0zl" }]
58
58
  ]);
59
- const mt = L("ArrowRight", [
59
+ const mt = W("ArrowRight", [
60
60
  ["path", { d: "M5 12h14", key: "1ays0h" }],
61
61
  ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
62
62
  ]);
63
- const Ft = L("Calendar", [
63
+ const Ft = W("Calendar", [
64
64
  ["path", { d: "M8 2v4", key: "1cmpym" }],
65
65
  ["path", { d: "M16 2v4", key: "4m81vk" }],
66
66
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
67
67
  ["path", { d: "M3 10h18", key: "8toen8" }]
68
68
  ]);
69
- const ie = L("Check", [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]);
70
- const ae = L("ChevronDown", [
69
+ const ce = W("Check", [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]);
70
+ const ae = W("ChevronDown", [
71
71
  ["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]
72
72
  ]);
73
- const Ue = L("ChevronLeft", [
73
+ const Ue = W("ChevronLeft", [
74
74
  ["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]
75
75
  ]);
76
- const ue = L("ChevronRight", [
76
+ const me = W("ChevronRight", [
77
77
  ["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
78
78
  ]);
79
- const ht = L("ChevronUp", [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]]);
80
- const Ve = L("CircleAlert", [
79
+ const ht = W("ChevronUp", [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]]);
80
+ const Ve = W("CircleAlert", [
81
81
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
82
82
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
83
83
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
84
84
  ]);
85
- const pt = L("CircleCheck", [
85
+ const pt = W("CircleCheck", [
86
86
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
87
87
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
88
88
  ]);
89
- const ft = L("CircleX", [
89
+ const ft = W("CircleX", [
90
90
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
91
91
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
92
92
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
93
93
  ]);
94
- const Kt = L("Clock", [
94
+ const Kt = W("Clock", [
95
95
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
96
96
  ["polyline", { points: "12 6 12 12 16 14", key: "68esgv" }]
97
97
  ]);
98
- const we = L("Copy", [
98
+ const we = W("Copy", [
99
99
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
100
100
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
101
101
  ]);
102
- const _t = L("Ellipsis", [
102
+ const _t = W("Ellipsis", [
103
103
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
104
104
  ["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
105
105
  ["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
106
106
  ]);
107
- const Je = L("FileCode", [
107
+ const Je = W("FileCode", [
108
108
  ["path", { d: "M10 12.5 8 15l2 2.5", key: "1tg20x" }],
109
109
  ["path", { d: "m14 12.5 2 2.5-2 2.5", key: "yinavb" }],
110
110
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
111
111
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z", key: "1mlx9k" }]
112
112
  ]);
113
- const Pt = L("File", [
113
+ const Pt = W("File", [
114
114
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
115
115
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }]
116
116
  ]);
117
- const Ot = L("FolderOpen", [
117
+ const Ot = W("FolderOpen", [
118
118
  [
119
119
  "path",
120
120
  {
@@ -123,7 +123,7 @@ const Ot = L("FolderOpen", [
123
123
  }
124
124
  ]
125
125
  ]);
126
- const Bt = L("Folder", [
126
+ const Bt = W("Folder", [
127
127
  [
128
128
  "path",
129
129
  {
@@ -132,13 +132,13 @@ const Bt = L("Folder", [
132
132
  }
133
133
  ]
134
134
  ]);
135
- const Ht = L("Frown", [
135
+ const Ht = W("Frown", [
136
136
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
137
137
  ["path", { d: "M16 16s-1.5-2-4-2-4 2-4 2", key: "epbg0q" }],
138
138
  ["line", { x1: "9", x2: "9.01", y1: "9", y2: "9", key: "yxxnd0" }],
139
139
  ["line", { x1: "15", x2: "15.01", y1: "9", y2: "9", key: "1p4y9e" }]
140
140
  ]);
141
- const jt = L("Heart", [
141
+ const jt = W("Heart", [
142
142
  [
143
143
  "path",
144
144
  {
@@ -147,41 +147,41 @@ const jt = L("Heart", [
147
147
  }
148
148
  ]
149
149
  ]);
150
- const qe = L("Info", [
150
+ const qe = W("Info", [
151
151
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
152
152
  ["path", { d: "M12 16v-4", key: "1dtifu" }],
153
153
  ["path", { d: "M12 8h.01", key: "e9boi3" }]
154
154
  ]);
155
- const ve = L("LoaderCircle", [
155
+ const ve = W("LoaderCircle", [
156
156
  ["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
157
157
  ]);
158
- const Ut = L("Lock", [
158
+ const Ut = W("Lock", [
159
159
  ["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
160
160
  ["path", { d: "M7 11V7a5 5 0 0 1 10 0v4", key: "fwvmzm" }]
161
161
  ]);
162
- const Vt = L("Meh", [
162
+ const Vt = W("Meh", [
163
163
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
164
164
  ["line", { x1: "8", x2: "16", y1: "15", y2: "15", key: "1xb1d9" }],
165
165
  ["line", { x1: "9", x2: "9.01", y1: "9", y2: "9", key: "yxxnd0" }],
166
166
  ["line", { x1: "15", x2: "15.01", y1: "9", y2: "9", key: "1p4y9e" }]
167
167
  ]);
168
- const Gt = L("Monitor", [
168
+ const Gt = W("Monitor", [
169
169
  ["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
170
170
  ["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
171
171
  ["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
172
172
  ]);
173
- const Yt = L("Moon", [
173
+ const Yt = W("Moon", [
174
174
  ["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
175
175
  ]);
176
- const Xt = L("RotateCw", [
176
+ const Xt = W("RotateCw", [
177
177
  ["path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8", key: "1p45f6" }],
178
178
  ["path", { d: "M21 3v5h-5", key: "1q7to0" }]
179
179
  ]);
180
- const Ie = L("Search", [
180
+ const Ie = W("Search", [
181
181
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
182
182
  ["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
183
183
  ]);
184
- const Zt = L("ShieldCheck", [
184
+ const Zt = W("ShieldCheck", [
185
185
  [
186
186
  "path",
187
187
  {
@@ -191,13 +191,13 @@ const Zt = L("ShieldCheck", [
191
191
  ],
192
192
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
193
193
  ]);
194
- const Qt = L("Smile", [
194
+ const Qt = W("Smile", [
195
195
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
196
196
  ["path", { d: "M8 14s1.5 2 4 2 4-2 4-2", key: "1y1vjs" }],
197
197
  ["line", { x1: "9", x2: "9.01", y1: "9", y2: "9", key: "yxxnd0" }],
198
198
  ["line", { x1: "15", x2: "15.01", y1: "9", y2: "9", key: "1p4y9e" }]
199
199
  ]);
200
- const Jt = L("Sun", [
200
+ const Jt = W("Sun", [
201
201
  ["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
202
202
  ["path", { d: "M12 2v2", key: "tus03m" }],
203
203
  ["path", { d: "M12 20v2", key: "1lh1kg" }],
@@ -208,7 +208,7 @@ const Jt = L("Sun", [
208
208
  ["path", { d: "m6.34 17.66-1.41 1.41", key: "1m8zz5" }],
209
209
  ["path", { d: "m19.07 4.93-1.41 1.41", key: "1shlcs" }]
210
210
  ]);
211
- const Ae = L("TriangleAlert", [
211
+ const Ae = W("TriangleAlert", [
212
212
  [
213
213
  "path",
214
214
  {
@@ -219,7 +219,7 @@ const Ae = L("TriangleAlert", [
219
219
  ["path", { d: "M12 9v4", key: "juzpu7" }],
220
220
  ["path", { d: "M12 17h.01", key: "p32p05" }]
221
221
  ]);
222
- const _e = L("X", [
222
+ const _e = W("X", [
223
223
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
224
224
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
225
225
  ]), en = {
@@ -234,13 +234,13 @@ function tn() {
234
234
  return t;
235
235
  }
236
236
  function jn({ children: t }) {
237
- const [n, r] = I([]), a = q(0), s = q(/* @__PURE__ */ new Map()), l = q(!1), o = q(null), [u, d] = I(!1), p = Ne((g) => {
238
- const k = s.current.get(g);
239
- k && (window.clearTimeout(k.handle), s.current.delete(g)), r((b) => b.filter((y) => y.id !== g));
237
+ const [n, r] = A([]), a = q(0), s = q(/* @__PURE__ */ new Map()), l = q(!1), o = q(null), [u, d] = A(!1), p = Ne((g) => {
238
+ const w = s.current.get(g);
239
+ w && (window.clearTimeout(w.handle), s.current.delete(g)), r((b) => b.filter((N) => N.id !== g));
240
240
  }, []), c = Ne(
241
- ({ tone: g = "default", title: k, description: b, actionLabel: y, preserve: v, duration: D = 4e3 }) => {
241
+ ({ tone: g = "default", title: w, description: b, actionLabel: N, preserve: v, duration: D = 4e3 }) => {
242
242
  const C = a.current += 1;
243
- if (r((h) => [...h, { id: C, tone: g, title: k, description: b, actionLabel: y, preserve: v }]), !v) {
243
+ if (r((h) => [...h, { id: C, tone: g, title: w, description: b, actionLabel: N, preserve: v }]), !v) {
244
244
  const h = l.current ? 0 : window.setTimeout(() => p(C), D);
245
245
  s.current.set(C, { remaining: D, start: Date.now(), handle: h });
246
246
  }
@@ -251,19 +251,19 @@ function jn({ children: t }) {
251
251
  if (l.current) return;
252
252
  l.current = !0;
253
253
  const g = Date.now();
254
- s.current.forEach((k) => {
255
- window.clearTimeout(k.handle), k.remaining = Math.max(0, k.remaining - (g - k.start));
254
+ s.current.forEach((w) => {
255
+ window.clearTimeout(w.handle), w.remaining = Math.max(0, w.remaining - (g - w.start));
256
256
  });
257
257
  }
258
258
  function _() {
259
259
  if (!l.current) return;
260
260
  l.current = !1;
261
261
  const g = Date.now();
262
- s.current.forEach((k, b) => {
263
- k.start = g, k.handle = window.setTimeout(() => p(b), k.remaining);
262
+ s.current.forEach((w, b) => {
263
+ w.start = g, w.handle = window.setTimeout(() => p(b), w.remaining);
264
264
  });
265
265
  }
266
- P(
266
+ O(
267
267
  () => () => {
268
268
  s.current.forEach((g) => window.clearTimeout(g.handle));
269
269
  },
@@ -271,16 +271,16 @@ function jn({ children: t }) {
271
271
  ), fe(() => {
272
272
  const g = o.current;
273
273
  if (!g) return;
274
- const k = [...g.querySelectorAll(".q1-toast")], b = 12, y = 14;
274
+ const w = [...g.querySelectorAll(".q1-toast")], b = 12, N = 14;
275
275
  let v = 0, D = 0;
276
- for (let x = k.length - 1; x >= 0; x -= 1) {
277
- const N = k[x], w = k.length - 1 - x;
278
- w === 0 && (D = N.offsetHeight), N.style.setProperty("--depth", String(w)), N.style.setProperty("--y", `${-v}px`), N.style.zIndex = String(100 + x), v += N.offsetHeight + b;
276
+ for (let x = w.length - 1; x >= 0; x -= 1) {
277
+ const y = w[x], k = w.length - 1 - x;
278
+ k === 0 && (D = y.offsetHeight), y.style.setProperty("--depth", String(k)), y.style.setProperty("--y", `${-v}px`), y.style.zIndex = String(100 + x), v += y.offsetHeight + b;
279
279
  }
280
- const C = D + Math.min(k.length - 1, 2) * y, h = k.length === 0 ? 0 : u ? Math.max(v - b, 0) : C;
280
+ const C = D + Math.min(w.length - 1, 2) * N, h = w.length === 0 ? 0 : u ? Math.max(v - b, 0) : C;
281
281
  g.style.setProperty("--toast-stack-h", `${h}px`);
282
282
  }, [n, u]);
283
- const m = oe(() => ({ push: c, dismiss: p }), [c, p]);
283
+ const m = ie(() => ({ push: c, dismiss: p }), [c, p]);
284
284
  return /* @__PURE__ */ i(bt.Provider, { value: m, children: [
285
285
  t,
286
286
  /* @__PURE__ */ e(
@@ -305,9 +305,9 @@ function jn({ children: t }) {
305
305
  g.currentTarget.contains(g.relatedTarget) || (d(!1), _());
306
306
  },
307
307
  children: n.map((g) => {
308
- const k = g.tone === "default" ? null : en[g.tone];
308
+ const w = g.tone === "default" ? null : en[g.tone];
309
309
  return /* @__PURE__ */ i("div", { className: `q1-toast q1-toast--${g.tone}`, "aria-atomic": "true", children: [
310
- k ? /* @__PURE__ */ e(k, { className: "q1-toast__icon", size: 16, strokeWidth: 2, "aria-hidden": "true" }) : null,
310
+ w ? /* @__PURE__ */ e(w, { className: "q1-toast__icon", size: 16, strokeWidth: 2, "aria-hidden": "true" }) : null,
311
311
  /* @__PURE__ */ i("div", { className: "q1-toast__body", children: [
312
312
  /* @__PURE__ */ e("p", { className: "q1-toast__title", children: g.title }),
313
313
  g.description ? /* @__PURE__ */ e("p", { className: "q1-toast__description", children: g.description }) : null
@@ -339,7 +339,7 @@ async function gt(t) {
339
339
  }
340
340
  }
341
341
  function Se() {
342
- const [t, n] = I(!1), r = q(void 0), { push: a } = tn(), s = Ne(
342
+ const [t, n] = A(!1), r = q(void 0), { push: a } = tn(), s = Ne(
343
343
  async (o, u = "已复制到剪贴板") => {
344
344
  try {
345
345
  await gt(o), n(!0), r.current && clearTimeout(r.current), r.current = setTimeout(() => n(!1), 1500), a({ title: u });
@@ -368,7 +368,7 @@ function Un({
368
368
  className: s ? `copy-button ${s}` : "copy-button",
369
369
  "aria-label": n,
370
370
  onClick: () => o(t, r),
371
- children: l ? /* @__PURE__ */ e(ie, { size: a, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(we, { size: a, strokeWidth: 2, "aria-hidden": "true" })
371
+ children: l ? /* @__PURE__ */ e(ce, { size: a, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(we, { size: a, strokeWidth: 2, "aria-hidden": "true" })
372
372
  }
373
373
  );
374
374
  }
@@ -416,7 +416,7 @@ function Nt({
416
416
  suffix: s,
417
417
  shortcut: l
418
418
  }) {
419
- return /* @__PURE__ */ i(J, { children: [
419
+ return /* @__PURE__ */ i(ee, { children: [
420
420
  t ? /* @__PURE__ */ i("span", { role: "status", children: [
421
421
  /* @__PURE__ */ e(ve, { className: "button__spinner", size: 14, strokeWidth: 1.8, "aria-hidden": "true" }),
422
422
  /* @__PURE__ */ e("span", { className: "q1-sr-only", children: n || "加载中…" })
@@ -428,41 +428,62 @@ function Nt({
428
428
  }
429
429
  function kt(t) {
430
430
  const {
431
- loading: n,
432
- loadingLabel: r,
433
- disabled: a,
434
- type: s = "button",
435
- shortcut: l,
436
- children: o,
437
- prefix: u,
438
- suffix: d,
439
- onClick: p,
440
- "aria-label": c,
441
- ariaLabel: f,
442
- ariaKeyshortcuts: _,
443
- "aria-describedby": m,
444
- onFocus: g,
445
- onBlur: k,
446
- onKeyDown: b,
447
- ref: y
448
- } = t, v = yt(t), D = c ?? f, C = n && !a;
431
+ variant: n,
432
+ size: r,
433
+ svgOnly: a,
434
+ iconOnly: s,
435
+ circle: l,
436
+ rounded: o,
437
+ loading: u,
438
+ loadingLabel: d,
439
+ disabled: p,
440
+ type: c = "button",
441
+ shortcut: f,
442
+ className: _,
443
+ children: m,
444
+ prefix: g,
445
+ suffix: w,
446
+ onClick: b,
447
+ "aria-label": N,
448
+ ariaLabel: v,
449
+ ariaKeyshortcuts: D,
450
+ "aria-keyshortcuts": C,
451
+ "aria-describedby": h,
452
+ "aria-disabled": x,
453
+ tabIndex: y,
454
+ onFocus: k,
455
+ onBlur: $,
456
+ onKeyDown: I,
457
+ ref: S,
458
+ ...L
459
+ } = t, F = yt({
460
+ variant: n,
461
+ size: r,
462
+ svgOnly: a,
463
+ iconOnly: s,
464
+ circle: l,
465
+ rounded: o,
466
+ loading: u,
467
+ className: _
468
+ }), G = N ?? v, X = C ?? D, V = u && !p;
449
469
  return /* @__PURE__ */ e(
450
470
  "button",
451
471
  {
452
- ref: y,
453
- type: s,
454
- className: v,
455
- disabled: a || void 0,
456
- "aria-disabled": C ? !0 : void 0,
457
- tabIndex: C ? 0 : void 0,
458
- "aria-label": D,
459
- "aria-keyshortcuts": _,
460
- "aria-describedby": m,
461
- onClick: n ? (h) => h.preventDefault() : p,
462
- onFocus: g,
463
- onBlur: k,
464
- onKeyDown: b,
465
- children: Nt({ loading: n, loadingLabel: r, prefix: u, children: o, suffix: d, shortcut: l })
472
+ ...L,
473
+ ref: S,
474
+ type: c,
475
+ className: F,
476
+ disabled: p || void 0,
477
+ "aria-disabled": V ? !0 : x,
478
+ tabIndex: V ? 0 : y,
479
+ "aria-label": G,
480
+ "aria-keyshortcuts": X,
481
+ "aria-describedby": h,
482
+ onClick: u ? (re) => re.preventDefault() : b,
483
+ onFocus: k,
484
+ onBlur: $,
485
+ onKeyDown: I,
486
+ children: Nt({ loading: u, loadingLabel: d, prefix: g, children: m, suffix: w, shortcut: f })
466
487
  }
467
488
  );
468
489
  }
@@ -482,9 +503,9 @@ function Vn(t) {
482
503
  ariaLabel: _,
483
504
  ariaKeyshortcuts: m,
484
505
  "aria-describedby": g,
485
- onFocus: k,
506
+ onFocus: w,
486
507
  onBlur: b,
487
- onKeyDown: y,
508
+ onKeyDown: N,
488
509
  ref: v
489
510
  } = t, D = yt(t), C = s || r;
490
511
  return /* @__PURE__ */ e(
@@ -499,15 +520,16 @@ function Vn(t) {
499
520
  "aria-keyshortcuts": m,
500
521
  "aria-describedby": g,
501
522
  onClick: C ? (x) => x.preventDefault() : c,
502
- onFocus: k,
523
+ onFocus: w,
503
524
  onBlur: b,
504
- onKeyDown: y,
525
+ onKeyDown: N,
505
526
  children: Nt({ loading: r, loadingLabel: a, prefix: d, children: u, suffix: p, shortcut: o })
506
527
  }
507
528
  );
508
529
  }
509
530
  function Gn({ "aria-label": t, ariaLabel: n, ...r }) {
510
- return /* @__PURE__ */ e(kt, { ...r, svgOnly: !0, "aria-label": t ?? n });
531
+ const a = t ?? n;
532
+ return a?.trim() || console.warn("IconButton: 缺少 aria-label,纯图标按钮必须提供可访问名称。"), /* @__PURE__ */ e(kt, { ...r, svgOnly: !0, "aria-label": a });
511
533
  }
512
534
  function xe(t, n) {
513
535
  return `${t}-${n ? "message" : "description"}`;
@@ -548,7 +570,7 @@ function Ye(...t) {
548
570
  };
549
571
  }
550
572
  function Xe(t, n, r) {
551
- P(() => {
573
+ O(() => {
552
574
  }, [n, t, r]);
553
575
  }
554
576
  function Yn({
@@ -567,21 +589,21 @@ function Yn({
567
589
  wide: _,
568
590
  size: m = "md",
569
591
  className: g,
570
- ...k
592
+ ...w
571
593
  }) {
572
- const b = K(), y = t ?? b, v = n === void 0, D = q(null), C = oe(() => Ye(D, o), [o]);
594
+ const b = P(), N = t ?? b, v = n === void 0, D = q(null), C = ie(() => Ye(D, o), [o]);
573
595
  Xe("Input", v, D);
574
- const h = r || a ? xe(y, !!a) : void 0, x = T("form-control", m !== "md" ? `form-control--${m}` : "", g ?? ""), N = T("input-control", f ? "input-control--rounded" : ""), w = /* @__PURE__ */ e(
596
+ const h = r || a ? xe(N, !!a) : void 0, x = T("form-control", m !== "md" ? `form-control--${m}` : "", g ?? ""), y = T("input-control", f ? "input-control--rounded" : ""), k = /* @__PURE__ */ e(
575
597
  "input",
576
598
  {
577
599
  ref: C,
578
- id: y,
600
+ id: N,
579
601
  className: x,
580
602
  "aria-describedby": wt(l, h),
581
603
  "aria-invalid": s || a ? !0 : void 0,
582
- ...k
604
+ ...w
583
605
  }
584
- ), E = u || d || f ? /* @__PURE__ */ i("span", { className: N, children: [
606
+ ), $ = u || d || f ? /* @__PURE__ */ i("span", { className: y, children: [
585
607
  u ? /* @__PURE__ */ e(
586
608
  "span",
587
609
  {
@@ -590,7 +612,7 @@ function Yn({
590
612
  children: u
591
613
  }
592
614
  ) : null,
593
- w,
615
+ k,
594
616
  d ? /* @__PURE__ */ e(
595
617
  "span",
596
618
  {
@@ -599,11 +621,11 @@ function Yn({
599
621
  children: d
600
622
  }
601
623
  ) : null
602
- ] }) : w;
603
- return v ? E : /* @__PURE__ */ e(Ge, { controlId: y, label: n, description: r, error: a, wide: _, children: E });
624
+ ] }) : k;
625
+ return v ? $ : /* @__PURE__ */ e(Ge, { controlId: N, label: n, description: r, error: a, wide: _, children: $ });
604
626
  }
605
627
  function vt(t = "", n) {
606
- const [r, a] = I(t), s = q(null), l = () => {
628
+ const [r, a] = A(t), s = q(null), l = () => {
607
629
  a(""), s.current?.focus(), n?.();
608
630
  };
609
631
  return { value: r, setValue: a, inputRef: s, clear: l, onKeyDown: (u) => {
@@ -694,38 +716,38 @@ function Qn({
694
716
  onInput: f,
695
717
  ..._
696
718
  }) {
697
- const m = K(), g = t ?? m, k = n === void 0, b = q(null), y = oe(() => Ye(b, o), [o]);
698
- Xe("Textarea", k, b);
699
- const [v, D] = I(
719
+ const m = P(), g = t ?? m, w = n === void 0, b = q(null), N = ie(() => Ye(b, o), [o]);
720
+ Xe("Textarea", w, b);
721
+ const [v, D] = A(
700
722
  () => typeof _.defaultValue == "string" ? _.defaultValue.length : 0
701
- ), C = typeof _.value == "string" ? _.value.length : v, h = c !== void 0, x = !k && (r || a) ? xe(g, !!a) : void 0, N = T(
723
+ ), C = typeof _.value == "string" ? _.value.length : v, h = c !== void 0, x = !w && (r || a) ? xe(g, !!a) : void 0, y = T(
702
724
  "form-control",
703
725
  "form-control--textarea",
704
726
  d !== "md" ? `form-control--${d}` : "",
705
727
  p ?? ""
706
- ), w = /* @__PURE__ */ e(
728
+ ), k = /* @__PURE__ */ e(
707
729
  "textarea",
708
730
  {
709
731
  id: g,
710
- ref: y,
711
- className: N,
732
+ ref: N,
733
+ className: y,
712
734
  maxLength: c,
713
735
  "aria-describedby": wt(l, x),
714
736
  "aria-invalid": s || a ? !0 : void 0,
715
- onInput: h ? (A) => {
716
- D(A.currentTarget.value.length), f?.(A);
737
+ onInput: h ? (I) => {
738
+ D(I.currentTarget.value.length), f?.(I);
717
739
  } : f,
718
740
  ..._
719
741
  }
720
- ), E = h ? /* @__PURE__ */ i("span", { className: "textarea-control", children: [
721
- w,
742
+ ), $ = h ? /* @__PURE__ */ i("span", { className: "textarea-control", children: [
743
+ k,
722
744
  /* @__PURE__ */ i("span", { className: "textarea-control__count", "aria-live": "polite", children: [
723
745
  C,
724
746
  "/",
725
747
  c
726
748
  ] })
727
- ] }) : w;
728
- return k ? E : /* @__PURE__ */ e(Ge, { controlId: g, label: n, description: r, error: a, wide: u, children: E });
749
+ ] }) : k;
750
+ return w ? $ : /* @__PURE__ */ e(Ge, { controlId: g, label: n, description: r, error: a, wide: u, children: $ });
729
751
  }
730
752
  function Jn({
731
753
  id: t,
@@ -777,14 +799,14 @@ function xt({
777
799
  type: o,
778
800
  ...u
779
801
  }) {
780
- const d = K(), p = t ?? d, c = n === void 0, f = o === "radio", _ = !f && (r || a) ? xe(p, !!a) : void 0, m = f ? "control-option__visual control-option__visual--radio" : "control-option__visual", g = q(null), k = oe(() => Ye(g, l), [l]);
781
- Xe(f ? "Radio" : "Checkbox", c, g), P(() => {
802
+ const d = P(), p = t ?? d, c = n === void 0, f = o === "radio", _ = !f && (r || a) ? xe(p, !!a) : void 0, m = f ? "control-option__visual control-option__visual--radio" : "control-option__visual", g = q(null), w = ie(() => Ye(g, l), [l]);
803
+ Xe(f ? "Radio" : "Checkbox", c, g), O(() => {
782
804
  g.current && (g.current.indeterminate = !f && !!s);
783
805
  }, [s, f]);
784
806
  const b = /* @__PURE__ */ e(
785
807
  "input",
786
808
  {
787
- ref: k,
809
+ ref: w,
788
810
  id: p,
789
811
  type: o,
790
812
  "aria-describedby": _,
@@ -827,7 +849,7 @@ function aa({ type: t, label: n, description: r, extra: a, className: s, ...l })
827
849
  r ? /* @__PURE__ */ e("span", { className: "choicebox__description", children: r }) : null,
828
850
  a ? /* @__PURE__ */ e("span", { className: "choicebox__extra", children: a }) : null
829
851
  ] }),
830
- /* @__PURE__ */ e("span", { className: "choicebox__indicator", "aria-hidden": "true", children: t === "checkbox" ? /* @__PURE__ */ e(ie, { className: "choicebox__check", size: 12, strokeWidth: 3 }) : null })
852
+ /* @__PURE__ */ e("span", { className: "choicebox__indicator", "aria-hidden": "true", children: t === "checkbox" ? /* @__PURE__ */ e(ce, { className: "choicebox__check", size: 12, strokeWidth: 3 }) : null })
831
853
  ] });
832
854
  }
833
855
  function ra({
@@ -846,38 +868,38 @@ function ra({
846
868
  id: _,
847
869
  className: m,
848
870
  name: g,
849
- inputMode: k,
871
+ inputMode: w,
850
872
  spellCheck: b,
851
- "aria-label": y,
873
+ "aria-label": N,
852
874
  "aria-labelledby": v,
853
875
  ref: D,
854
876
  ...C
855
877
  }) {
856
- const [h, x] = I(""), [N, w] = I(!1), [E, A] = I(0), S = q(null), W = q(null), O = K(), V = `${O}-list`, ee = `${O}-err`, G = n ?? "", me = G === "" ? void 0 : t.find((M) => M.value === G), B = !l && !o, Y = N && B, U = h === "" ? t : t.filter((M) => M.label.toLowerCase().includes(h.toLowerCase())), Z = Y && U[E] ? `${O}-opt-${E}` : void 0, he = !!p, Ce = !!u || he, ze = [d, he ? ee : null].filter(Boolean).join(" ") || void 0, De = {};
878
+ const [h, x] = A(""), [y, k] = A(!1), [$, I] = A(0), S = q(null), L = q(null), F = P(), G = `${F}-list`, X = `${F}-err`, V = n ?? "", re = V === "" ? void 0 : t.find((M) => M.value === V), B = !l && !o, Y = y && B, U = h === "" ? t : t.filter((M) => M.label.toLowerCase().includes(h.toLowerCase())), Q = Y && U[$] ? `${F}-opt-${$}` : void 0, he = !!p, Ce = !!u || he, ze = [d, he ? X : null].filter(Boolean).join(" ") || void 0, De = {};
857
879
  for (const [M, R] of Object.entries(C))
858
880
  M.startsWith("data-") && (De[M] = R);
859
- const $ = Ne(
881
+ const E = Ne(
860
882
  (M) => {
861
- W.current = M;
883
+ L.current = M;
862
884
  const R = typeof D == "function" ? D(M) : void 0;
863
885
  return D && typeof D != "function" && (D.current = M), () => {
864
- W.current = null, typeof R == "function" ? R() : typeof D == "function" ? D(null) : D && (D.current = null);
886
+ L.current = null, typeof R == "function" ? R() : typeof D == "function" ? D(null) : D && (D.current = null);
865
887
  };
866
888
  },
867
889
  [D]
868
890
  );
869
- P(() => {
870
- }, [y, v]), P(() => {
871
- if (!N) return;
891
+ O(() => {
892
+ }, [N, v]), O(() => {
893
+ if (!y) return;
872
894
  function M(R) {
873
- S.current && !S.current.contains(R.target) && w(!1);
895
+ S.current && !S.current.contains(R.target) && k(!1);
874
896
  }
875
897
  return document.addEventListener("mousedown", M), () => document.removeEventListener("mousedown", M);
876
- }, [N]), P(() => {
877
- B || w(!1);
898
+ }, [y]), O(() => {
899
+ B || k(!1);
878
900
  }, [B]);
879
901
  function z(M, R = 0) {
880
- const j = M.findIndex((X) => !X.disabled);
902
+ const j = M.findIndex((Z) => !Z.disabled);
881
903
  return j === -1 ? R : j;
882
904
  }
883
905
  function H(M, R = 0) {
@@ -888,47 +910,47 @@ function ra({
888
910
  function te(M, R) {
889
911
  if (U.length === 0) return 0;
890
912
  let j = M;
891
- for (let X = 0; X < U.length; X++)
913
+ for (let Z = 0; Z < U.length; Z++)
892
914
  if (j = (j + R + U.length) % U.length, !U[j].disabled) return j;
893
915
  return M;
894
916
  }
895
917
  function ne() {
896
- const M = G === "" ? -1 : t.findIndex((R) => R.value === G);
897
- x(""), A(M === -1 ? z(t) : M), w(!0);
918
+ const M = V === "" ? -1 : t.findIndex((R) => R.value === V);
919
+ x(""), I(M === -1 ? z(t) : M), k(!0);
898
920
  }
899
- function Q(M) {
900
- !B || M.disabled || (r?.(M.value, M), w(!1), W.current?.focus());
921
+ function J(M) {
922
+ !B || M.disabled || (r?.(M.value, M), k(!1), L.current?.focus());
901
923
  }
902
- function re() {
903
- r?.("", void 0), x(""), w(!1), W.current?.focus();
924
+ function le() {
925
+ r?.("", void 0), x(""), k(!1), L.current?.focus();
904
926
  }
905
927
  function Re(M) {
906
928
  if (!M.nativeEvent.isComposing && B) {
907
- if (!N) {
908
- M.key === "ArrowDown" || M.key === "Enter" ? (M.preventDefault(), ne()) : M.key === "Escape" && f && G !== "" && re();
929
+ if (!y) {
930
+ M.key === "ArrowDown" || M.key === "Enter" ? (M.preventDefault(), ne()) : M.key === "Escape" && f && V !== "" && le();
909
931
  return;
910
932
  }
911
933
  if (M.key === "ArrowDown")
912
- M.preventDefault(), A((R) => te(R, 1));
934
+ M.preventDefault(), I((R) => te(R, 1));
913
935
  else if (M.key === "ArrowUp")
914
- M.preventDefault(), A((R) => te(R, -1));
936
+ M.preventDefault(), I((R) => te(R, -1));
915
937
  else if (M.key === "Home")
916
- M.preventDefault(), A((R) => z(U, R));
938
+ M.preventDefault(), I((R) => z(U, R));
917
939
  else if (M.key === "End")
918
- M.preventDefault(), A((R) => H(U, R));
940
+ M.preventDefault(), I((R) => H(U, R));
919
941
  else if (M.key === "Enter")
920
- M.preventDefault(), U[E] && Q(U[E]);
942
+ M.preventDefault(), U[$] && J(U[$]);
921
943
  else if (M.key === "Escape")
922
- M.preventDefault(), w(!1);
944
+ M.preventDefault(), k(!1);
923
945
  else if (M.key === "Tab") {
924
946
  const R = S.current?.querySelector(
925
947
  '.combobox__empty a[href], .combobox__empty button:not([disabled]), .combobox__empty input:not([disabled]), .combobox__empty select:not([disabled]), .combobox__empty textarea:not([disabled]), .combobox__empty [tabindex]:not([tabindex="-1"])'
926
948
  );
927
- R && !M.shiftKey ? (M.preventDefault(), R.focus()) : w(!1);
949
+ R && !M.shiftKey ? (M.preventDefault(), R.focus()) : k(!1);
928
950
  }
929
951
  }
930
952
  }
931
- const le = T(
953
+ const se = T(
932
954
  "combobox",
933
955
  s !== "md" ? `combobox--${s}` : "",
934
956
  Ce ? "combobox--error" : "",
@@ -939,13 +961,13 @@ function ra({
939
961
  return /* @__PURE__ */ i(
940
962
  "div",
941
963
  {
942
- className: le,
964
+ className: se,
943
965
  ref: S,
944
966
  onBlur: (M) => {
945
- M.currentTarget.contains(M.relatedTarget) || w(!1);
967
+ M.currentTarget.contains(M.relatedTarget) || k(!1);
946
968
  },
947
969
  onKeyDown: (M) => {
948
- M.key !== "Escape" || M.target === W.current || !Y || (M.preventDefault(), w(!1), W.current?.focus());
970
+ M.key !== "Escape" || M.target === L.current || !Y || (M.preventDefault(), k(!1), L.current?.focus());
949
971
  },
950
972
  ...De,
951
973
  children: [
@@ -954,62 +976,62 @@ function ra({
954
976
  /* @__PURE__ */ e(
955
977
  "input",
956
978
  {
957
- ref: $,
958
- id: _ ?? `${O}-input`,
979
+ ref: E,
980
+ id: _ ?? `${F}-input`,
959
981
  type: "text",
960
982
  role: "combobox",
961
983
  className: "combobox__input",
962
984
  placeholder: a,
963
- value: Y ? h : me?.label ?? "",
985
+ value: Y ? h : re?.label ?? "",
964
986
  disabled: l,
965
987
  readOnly: o,
966
988
  name: g,
967
- inputMode: k,
989
+ inputMode: w,
968
990
  spellCheck: b,
969
- "aria-label": y,
991
+ "aria-label": N,
970
992
  "aria-labelledby": v,
971
993
  "aria-expanded": Y,
972
- "aria-controls": V,
994
+ "aria-controls": G,
973
995
  "aria-autocomplete": "list",
974
- "aria-activedescendant": Z,
996
+ "aria-activedescendant": Q,
975
997
  "aria-invalid": Ce ? !0 : void 0,
976
998
  "aria-describedby": ze,
977
999
  onChange: (M) => {
978
1000
  if (!B) return;
979
- const R = M.target.value, j = R === "" ? t : t.filter((X) => X.label.toLowerCase().includes(R.toLowerCase()));
980
- x(R), A(z(j)), w(!0);
1001
+ const R = M.target.value, j = R === "" ? t : t.filter((Z) => Z.label.toLowerCase().includes(R.toLowerCase()));
1002
+ x(R), I(z(j)), k(!0);
981
1003
  },
982
- onFocus: () => B && !N && ne(),
983
- onMouseDown: () => B && !N && ne(),
1004
+ onFocus: () => B && !y && ne(),
1005
+ onMouseDown: () => B && !y && ne(),
984
1006
  onKeyDown: Re
985
1007
  }
986
1008
  ),
987
- f && G !== "" && B ? /* @__PURE__ */ e("button", { type: "button", className: "combobox__clear", "aria-label": "清除选择", onClick: re, children: /* @__PURE__ */ e(_e, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) }) : null
1009
+ f && V !== "" && B ? /* @__PURE__ */ e("button", { type: "button", className: "combobox__clear", "aria-label": "清除选择", onClick: le, children: /* @__PURE__ */ e(_e, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) }) : null
988
1010
  ] }),
989
1011
  Y ? /* @__PURE__ */ i("div", { className: "combobox__popup", children: [
990
- /* @__PURE__ */ e("ul", { className: "combobox__listbox", id: V, role: "listbox", "aria-label": a, children: U.map((M, R) => {
991
- const j = G !== "" && M.value === G;
1012
+ /* @__PURE__ */ e("ul", { className: "combobox__listbox", id: G, role: "listbox", "aria-label": a, children: U.map((M, R) => {
1013
+ const j = V !== "" && M.value === V;
992
1014
  return /* @__PURE__ */ i(
993
1015
  "li",
994
1016
  {
995
- id: `${O}-opt-${R}`,
1017
+ id: `${F}-opt-${R}`,
996
1018
  role: "option",
997
1019
  "aria-selected": j,
998
1020
  "aria-disabled": M.disabled || void 0,
999
1021
  className: T(
1000
1022
  "combobox__option",
1001
- R === E && "combobox__option--active",
1023
+ R === $ && "combobox__option--active",
1002
1024
  M.disabled && "combobox__option--disabled"
1003
1025
  ),
1004
- onMouseEnter: () => !M.disabled && A(R),
1005
- onMouseDown: (X) => {
1006
- X.preventDefault(), Q(M);
1026
+ onMouseEnter: () => !M.disabled && I(R),
1027
+ onMouseDown: (Z) => {
1028
+ Z.preventDefault(), J(M);
1007
1029
  },
1008
1030
  children: [
1009
1031
  M.prefix ? /* @__PURE__ */ e("span", { className: "combobox__option-prefix", "aria-hidden": "true", children: M.prefix }) : null,
1010
1032
  /* @__PURE__ */ e("span", { className: "combobox__option-label", children: M.label }),
1011
1033
  M.suffix ? /* @__PURE__ */ e("span", { className: "combobox__option-suffix", "aria-hidden": "true", children: M.suffix }) : null,
1012
- j ? /* @__PURE__ */ e(ie, { className: "combobox__option-check", size: 14, strokeWidth: 2, "aria-hidden": "true" }) : null
1034
+ j ? /* @__PURE__ */ e(ce, { className: "combobox__option-check", size: 14, strokeWidth: 2, "aria-hidden": "true" }) : null
1013
1035
  ]
1014
1036
  },
1015
1037
  M.value
@@ -1017,7 +1039,7 @@ function ra({
1017
1039
  }) }),
1018
1040
  U.length === 0 ? /* @__PURE__ */ e("div", { className: "combobox__empty", role: "status", "aria-live": "polite", children: c }) : null
1019
1041
  ] }) : null,
1020
- he ? /* @__PURE__ */ e("p", { className: "combobox__error-text", id: ee, children: p }) : null
1042
+ he ? /* @__PURE__ */ e("p", { className: "combobox__error-text", id: X, children: p }) : null
1021
1043
  ]
1022
1044
  }
1023
1045
  );
@@ -1032,7 +1054,7 @@ function la({
1032
1054
  fullWidth: o = !1,
1033
1055
  iconOnly: u = !1
1034
1056
  }) {
1035
- const d = K();
1057
+ const d = P();
1036
1058
  if (t.length === 0) return null;
1037
1059
  const p = r ?? d, c = t.find((_) => _.value === a && !_.disabled) ?? t.find((_) => !_.disabled) ?? t[0], f = T("switch-control", `switch-control--${l}`, o ? "switch-control--full" : "");
1038
1060
  return /* @__PURE__ */ e("div", { className: f, role: "radiogroup", "aria-label": n, children: t.map((_) => /* @__PURE__ */ i("label", { className: "switch-control__option", title: _.tooltip, children: [
@@ -1064,7 +1086,7 @@ function sa({
1064
1086
  labelSide: d = "right",
1065
1087
  ariaLabel: p
1066
1088
  }) {
1067
- const [c, f] = I(n), _ = t !== void 0, m = _ ? t : c, g = K(), k = K(), b = l ? { "--toggle-on": l } : void 0;
1089
+ const [c, f] = A(n), _ = t !== void 0, m = _ ? t : c, g = P(), w = P(), b = l ? { "--toggle-on": l } : void 0;
1068
1090
  return /* @__PURE__ */ i(
1069
1091
  "button",
1070
1092
  {
@@ -1073,17 +1095,17 @@ function sa({
1073
1095
  "aria-checked": m,
1074
1096
  "aria-label": o ? void 0 : p,
1075
1097
  "aria-labelledby": o ? g : void 0,
1076
- "aria-describedby": o && u ? k : void 0,
1098
+ "aria-describedby": o && u ? w : void 0,
1077
1099
  disabled: a,
1078
1100
  className: `toggle-field toggle-field--${d}`,
1079
1101
  onClick: () => {
1080
- const y = !m;
1081
- _ || f(y), r?.(y);
1102
+ const N = !m;
1103
+ _ || f(N), r?.(N);
1082
1104
  },
1083
1105
  children: [
1084
1106
  o ? /* @__PURE__ */ i("span", { className: "toggle-field__text", children: [
1085
1107
  /* @__PURE__ */ e("span", { className: "toggle-field__label", id: g, children: o }),
1086
- u ? /* @__PURE__ */ e("span", { className: "toggle-field__description", id: k, children: u }) : null
1108
+ u ? /* @__PURE__ */ e("span", { className: "toggle-field__description", id: w, children: u }) : null
1087
1109
  ] }) : null,
1088
1110
  /* @__PURE__ */ e("span", { className: `toggle toggle--${s}`, style: b, "aria-hidden": "true", children: /* @__PURE__ */ e("span", { className: "toggle__thumb" }) })
1089
1111
  ]
@@ -1091,7 +1113,7 @@ function sa({
1091
1113
  );
1092
1114
  }
1093
1115
  function Ct({ tokens: t }) {
1094
- return /* @__PURE__ */ e(J, { children: t.map(
1116
+ return /* @__PURE__ */ e(ee, { children: t.map(
1095
1117
  (n, r) => n.type ? /* @__PURE__ */ e("span", { className: `tok-${n.type}`, children: n.text }, r) : /* @__PURE__ */ e("span", { children: n.text }, r)
1096
1118
  ) });
1097
1119
  }
@@ -1102,7 +1124,7 @@ function ia({ children: t }) {
1102
1124
  return /* @__PURE__ */ e("code", { className: "code-inline", children: t });
1103
1125
  }
1104
1126
  function ca(t) {
1105
- const { lineNumbers: n = !0 } = t, { copied: r, copy: a, reset: s } = Se(), [l, o] = I(0), u = t.tabs ? t.tabs[l] ?? t.tabs[0] : void 0, d = u ? u.lines : t.lines ?? [], p = u ? u.filename : t.filename, c = d.map((_) => _.tokens.map((m) => m.text).join("")).join(`
1127
+ const { lineNumbers: n = !0 } = t, { copied: r, copy: a, reset: s } = Se(), [l, o] = A(0), u = t.tabs ? t.tabs[l] ?? t.tabs[0] : void 0, d = u ? u.lines : t.lines ?? [], p = u ? u.filename : t.filename, c = d.map((_) => _.tokens.map((m) => m.text).join("")).join(`
1106
1128
  `);
1107
1129
  let f = 0;
1108
1130
  return /* @__PURE__ */ i("div", { className: "codeblock", children: [
@@ -1131,7 +1153,7 @@ function ca(t) {
1131
1153
  className: "codeblock__copy",
1132
1154
  "aria-label": "复制代码",
1133
1155
  onClick: () => a(c, "已复制代码"),
1134
- children: r ? /* @__PURE__ */ e(ie, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(we, { size: 14, strokeWidth: 2, "aria-hidden": "true" })
1156
+ children: r ? /* @__PURE__ */ e(ce, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(we, { size: 14, strokeWidth: 2, "aria-hidden": "true" })
1135
1157
  }
1136
1158
  )
1137
1159
  ] }),
@@ -1161,7 +1183,7 @@ function da({
1161
1183
  ariaLabel: n,
1162
1184
  variant: r = "default"
1163
1185
  }) {
1164
- const a = K(), s = t.find((c) => !c.disabled), [l, o] = I(s?.id ?? ""), u = t.find((c) => c.id === l), d = q(/* @__PURE__ */ new Map());
1186
+ const a = P(), s = t.find((c) => !c.disabled), [l, o] = A(s?.id ?? ""), u = t.find((c) => c.id === l), d = q(/* @__PURE__ */ new Map());
1165
1187
  function p(c) {
1166
1188
  const f = t.filter((g) => !g.disabled);
1167
1189
  if (f.length === 0) return;
@@ -1241,7 +1263,7 @@ function da({
1241
1263
  }
1242
1264
  const Dt = it(null);
1243
1265
  function ua({ multiple: t, children: n }) {
1244
- const [r, a] = I(null);
1266
+ const [r, a] = A(null);
1245
1267
  return /* @__PURE__ */ e("div", { className: "collapse-group", children: /* @__PURE__ */ e(Dt.Provider, { value: t ? null : { openId: r, setOpenId: a }, children: n }) });
1246
1268
  }
1247
1269
  function ma({
@@ -1250,7 +1272,7 @@ function ma({
1250
1272
  small: r,
1251
1273
  children: a
1252
1274
  }) {
1253
- const s = ct(Dt), l = K(), [o, u] = I(n ?? !1);
1275
+ const s = ct(Dt), l = P(), [o, u] = A(n ?? !1);
1254
1276
  fe(() => {
1255
1277
  s && n && s.setOpenId(l);
1256
1278
  }, []);
@@ -1268,7 +1290,7 @@ function ma({
1268
1290
  },
1269
1291
  children: [
1270
1292
  /* @__PURE__ */ e("span", { className: "collapse__title", children: p }),
1271
- /* @__PURE__ */ e(ue, { className: "collapse__chevron", size: 16, strokeWidth: 2, "aria-hidden": "true" })
1293
+ /* @__PURE__ */ e(me, { className: "collapse__chevron", size: 16, strokeWidth: 2, "aria-hidden": "true" })
1272
1294
  ]
1273
1295
  }
1274
1296
  ),
@@ -1276,46 +1298,46 @@ function ma({
1276
1298
  ] });
1277
1299
  }
1278
1300
  function ha({ sections: t, triggerLabel: n = "打开命令面板", hotkey: r }) {
1279
- const [a, s] = I(!1), [l, o] = I(""), [u, d] = I(0), p = q(null), c = q(null), f = q(null), _ = q(null), m = oe(() => {
1301
+ const [a, s] = A(!1), [l, o] = A(""), [u, d] = A(0), p = q(null), c = q(null), f = q(null), _ = q(null), m = ie(() => {
1280
1302
  const b = l.trim().toLowerCase();
1281
- let y = 0;
1303
+ let N = 0;
1282
1304
  return t.map((v) => ({
1283
1305
  heading: v.heading,
1284
- items: v.items.filter((D) => b.length === 0 || D.label.toLowerCase().includes(b)).map((D) => ({ item: D, flatIndex: y++ }))
1306
+ items: v.items.filter((D) => b.length === 0 || D.label.toLowerCase().includes(b)).map((D) => ({ item: D, flatIndex: N++ }))
1285
1307
  })).filter((v) => v.items.length > 0);
1286
- }, [t, l]), g = m.reduce((b, y) => b + y.items.length, 0);
1287
- P(() => {
1308
+ }, [t, l]), g = m.reduce((b, N) => b + N.items.length, 0);
1309
+ O(() => {
1288
1310
  if (!a) return;
1289
1311
  o(""), d(0);
1290
1312
  const b = document.activeElement;
1291
1313
  _.current = b && b !== document.body ? b : p.current;
1292
- const y = window.setTimeout(() => f.current?.focus(), 0);
1314
+ const N = window.setTimeout(() => f.current?.focus(), 0);
1293
1315
  return document.body.style.overflow = "hidden", () => {
1294
- window.clearTimeout(y), document.body.style.overflow = "";
1316
+ window.clearTimeout(N), document.body.style.overflow = "";
1295
1317
  const v = _.current;
1296
1318
  (v && document.contains(v) ? v : p.current)?.focus();
1297
1319
  };
1298
- }, [a]), P(() => {
1320
+ }, [a]), O(() => {
1299
1321
  if (!r) return;
1300
- function b(y) {
1301
- y.repeat || (y.metaKey || y.ctrlKey) && y.key.toLowerCase() === "k" && (y.preventDefault(), s((v) => !v));
1322
+ function b(N) {
1323
+ N.repeat || (N.metaKey || N.ctrlKey) && N.key.toLowerCase() === "k" && (N.preventDefault(), s((v) => !v));
1302
1324
  }
1303
1325
  return document.addEventListener("keydown", b), () => document.removeEventListener("keydown", b);
1304
1326
  }, [r]);
1305
- function k(b) {
1327
+ function w(b) {
1306
1328
  if (!b.nativeEvent.isComposing) {
1307
1329
  if (b.key === "Escape")
1308
1330
  b.preventDefault(), s(!1);
1309
1331
  else if (b.key === "ArrowDown")
1310
- b.preventDefault(), d((y) => Math.max(Math.min(y + 1, g - 1), 0));
1332
+ b.preventDefault(), d((N) => Math.max(Math.min(N + 1, g - 1), 0));
1311
1333
  else if (b.key === "ArrowUp")
1312
- b.preventDefault(), d((y) => Math.max(y - 1, 0));
1334
+ b.preventDefault(), d((N) => Math.max(N - 1, 0));
1313
1335
  else if (b.key === "Enter" && g > 0)
1314
1336
  b.preventDefault(), s(!1);
1315
1337
  else if (b.key === "Tab") {
1316
- const y = Array.from(
1338
+ const N = Array.from(
1317
1339
  c.current?.querySelectorAll("button:not([disabled]), input") ?? []
1318
- ), v = y[0], D = y[y.length - 1];
1340
+ ), v = N[0], D = N[N.length - 1];
1319
1341
  b.shiftKey && document.activeElement === v ? (b.preventDefault(), D?.focus()) : !b.shiftKey && document.activeElement === D && (b.preventDefault(), v?.focus());
1320
1342
  }
1321
1343
  }
@@ -1326,7 +1348,7 @@ function ha({ sections: t, triggerLabel: n = "打开命令面板", hotkey: r })
1326
1348
  n,
1327
1349
  /* @__PURE__ */ e("kbd", { className: "command-palette__hint", children: "⌘K" })
1328
1350
  ] }),
1329
- a ? /* @__PURE__ */ i("div", { className: "command-palette", role: "dialog", "aria-modal": "true", "aria-label": "命令面板", onKeyDown: k, children: [
1351
+ a ? /* @__PURE__ */ i("div", { className: "command-palette", role: "dialog", "aria-modal": "true", "aria-label": "命令面板", onKeyDown: w, children: [
1330
1352
  /* @__PURE__ */ e(
1331
1353
  "button",
1332
1354
  {
@@ -1359,7 +1381,7 @@ function ha({ sections: t, triggerLabel: n = "打开命令面板", hotkey: r })
1359
1381
  g,
1360
1382
  " 个结果"
1361
1383
  ] }),
1362
- /* @__PURE__ */ e("div", { className: "command-palette__body", id: "command-palette-list", role: "listbox", "aria-label": "命令", children: m.length > 0 ? m.map((b, y) => (
1384
+ /* @__PURE__ */ e("div", { className: "command-palette__body", id: "command-palette-list", role: "listbox", "aria-label": "命令", children: m.length > 0 ? m.map((b, N) => (
1363
1385
  // 相邻组间的分隔线由 CSS(.command-palette__group + .command-palette__group)天然提供,
1364
1386
  // heading 缺省的段即呈现为"只有分隔线、没有标题"。
1365
1387
  /* @__PURE__ */ i("section", { className: "command-palette__group", children: [
@@ -1382,7 +1404,7 @@ function ha({ sections: t, triggerLabel: n = "打开命令面板", hotkey: r })
1382
1404
  },
1383
1405
  v.label
1384
1406
  ))
1385
- ] }, b.heading ?? `divider-${y}`)
1407
+ ] }, b.heading ?? `divider-${N}`)
1386
1408
  )) : /* @__PURE__ */ e("p", { className: "command-palette__empty", children: `没有匹配「${l}」的命令` }) })
1387
1409
  ] })
1388
1410
  ] }) : null
@@ -1400,15 +1422,15 @@ function pa({
1400
1422
  loading: d,
1401
1423
  onConfirm: p
1402
1424
  }) {
1403
- const [c, f] = I(""), [_, m] = I(null), g = q(null), k = q(null), b = K(), y = K(), v = c === o && !d;
1404
- if (P(() => {
1425
+ const [c, f] = A(""), [_, m] = A(null), g = q(null), w = q(null), b = P(), N = P(), v = c === o && !d;
1426
+ if (O(() => {
1405
1427
  if (!t) return;
1406
1428
  f(""), m(null);
1407
1429
  const h = document.body.style.overflow;
1408
1430
  document.body.style.overflow = "hidden";
1409
1431
  const x = window.setTimeout(() => {
1410
- const N = k.current;
1411
- (N && !N.disabled ? N : g.current)?.focus();
1432
+ const y = w.current;
1433
+ (y && !y.disabled ? y : g.current)?.focus();
1412
1434
  }, 0);
1413
1435
  return () => {
1414
1436
  window.clearTimeout(x), document.body.style.overflow = h;
@@ -1432,8 +1454,8 @@ function pa({
1432
1454
  h.preventDefault();
1433
1455
  return;
1434
1456
  }
1435
- const N = x[0], w = x[x.length - 1];
1436
- h.shiftKey && document.activeElement === N ? (h.preventDefault(), w.focus()) : !h.shiftKey && document.activeElement === w && (h.preventDefault(), N.focus());
1457
+ const y = x[0], k = x[x.length - 1];
1458
+ h.shiftKey && document.activeElement === y ? (h.preventDefault(), k.focus()) : !h.shiftKey && document.activeElement === k && (h.preventDefault(), y.focus());
1437
1459
  }
1438
1460
  }
1439
1461
  return /* @__PURE__ */ i("div", { className: "modal", onKeyDown: C, children: [
@@ -1464,7 +1486,7 @@ function pa({
1464
1486
  ] }),
1465
1487
  /* @__PURE__ */ i("div", { className: "modal__body", children: [
1466
1488
  /* @__PURE__ */ e("p", { children: a }),
1467
- /* @__PURE__ */ i("label", { className: "destructive-modal__prompt", id: y, htmlFor: `${y}-input`, children: [
1489
+ /* @__PURE__ */ i("label", { className: "destructive-modal__prompt", id: N, htmlFor: `${N}-input`, children: [
1468
1490
  "若要确认,请输入",
1469
1491
  l,
1470
1492
  "「",
@@ -1474,10 +1496,10 @@ function pa({
1474
1496
  /* @__PURE__ */ e(
1475
1497
  "input",
1476
1498
  {
1477
- ref: k,
1478
- id: `${y}-input`,
1499
+ ref: w,
1500
+ id: `${N}-input`,
1479
1501
  className: "modal-input",
1480
- "aria-labelledby": y,
1502
+ "aria-labelledby": N,
1481
1503
  "aria-invalid": _ ? !0 : void 0,
1482
1504
  disabled: d,
1483
1505
  value: c,
@@ -1525,40 +1547,40 @@ function fa({
1525
1547
  footer: s,
1526
1548
  height: l
1527
1549
  }) {
1528
- const o = q(null), u = K(), [d, p] = I(0), c = q(null), f = q(!1);
1529
- if (P(() => {
1550
+ const o = q(null), u = P(), [d, p] = A(0), c = q(null), f = q(!1);
1551
+ if (O(() => {
1530
1552
  if (!t) return;
1531
- const y = document.body.style.overflow;
1553
+ const N = document.body.style.overflow;
1532
1554
  document.body.style.overflow = "hidden";
1533
1555
  const v = window.setTimeout(
1534
1556
  () => o.current?.querySelector("button, input, [tabindex]")?.focus(),
1535
1557
  0
1536
1558
  );
1537
1559
  return () => {
1538
- window.clearTimeout(v), document.body.style.overflow = y, p(0);
1560
+ window.clearTimeout(v), document.body.style.overflow = N, p(0);
1539
1561
  };
1540
1562
  }, [t]), !t) return null;
1541
- function _(y) {
1542
- if (y.key === "Escape")
1543
- y.preventDefault(), n();
1544
- else if (y.key === "Tab") {
1563
+ function _(N) {
1564
+ if (N.key === "Escape")
1565
+ N.preventDefault(), n();
1566
+ else if (N.key === "Tab") {
1545
1567
  const v = Array.from(
1546
1568
  o.current?.querySelectorAll("button:not([disabled]), input:not([disabled]), select") ?? []
1547
1569
  );
1548
1570
  if (v.length === 0) return;
1549
1571
  const D = v[0], C = v[v.length - 1];
1550
- y.shiftKey && document.activeElement === D ? (y.preventDefault(), C.focus()) : !y.shiftKey && document.activeElement === C && (y.preventDefault(), D.focus());
1572
+ N.shiftKey && document.activeElement === D ? (N.preventDefault(), C.focus()) : !N.shiftKey && document.activeElement === C && (N.preventDefault(), D.focus());
1551
1573
  }
1552
1574
  }
1553
- function m(y) {
1554
- c.current = y.clientY, f.current = !1, y.target.setPointerCapture(y.pointerId);
1575
+ function m(N) {
1576
+ c.current = N.clientY, f.current = !1, N.target.setPointerCapture(N.pointerId);
1555
1577
  }
1556
- function g(y) {
1578
+ function g(N) {
1557
1579
  if (c.current === null) return;
1558
- const v = Math.max(0, y.clientY - c.current);
1580
+ const v = Math.max(0, N.clientY - c.current);
1559
1581
  v > 4 && (f.current = !0), p(v);
1560
1582
  }
1561
- function k() {
1583
+ function w() {
1562
1584
  c.current !== null && d > 80 ? n() : p(0), c.current = null;
1563
1585
  }
1564
1586
  function b() {
@@ -1587,7 +1609,7 @@ function fa({
1587
1609
  "aria-label": "关闭抽屉",
1588
1610
  onPointerDown: m,
1589
1611
  onPointerMove: g,
1590
- onPointerUp: k,
1612
+ onPointerUp: w,
1591
1613
  onPointerCancel: b,
1592
1614
  onClick: () => {
1593
1615
  f.current || n(), f.current = !1;
@@ -1675,22 +1697,22 @@ function Na({
1675
1697
  inline: a,
1676
1698
  topics: s
1677
1699
  }) {
1678
- const [l, o] = I(!!a), [u, d] = I(null), [p, c] = I(!1), f = q(null), _ = q([]), m = K(), g = K();
1679
- function k() {
1700
+ const [l, o] = A(!!a), [u, d] = A(null), [p, c] = A(!1), f = q(null), _ = q([]), m = P(), g = P();
1701
+ function w() {
1680
1702
  o(!1), f.current?.focus();
1681
1703
  }
1682
- function b(N) {
1683
- N.preventDefault(), c(!0), a || (o(!1), f.current?.focus());
1704
+ function b(y) {
1705
+ y.preventDefault(), c(!0), a || (o(!1), f.current?.focus());
1684
1706
  }
1685
- const y = ke.findIndex((N) => N.value === u), v = y === -1 ? 0 : y;
1686
- function D(N) {
1687
- d(N), c(!1);
1707
+ const N = ke.findIndex((y) => y.value === u), v = N === -1 ? 0 : N;
1708
+ function D(y) {
1709
+ d(y), c(!1);
1688
1710
  }
1689
- function C(N, w) {
1690
- const E = N.key === "ArrowRight" || N.key === "ArrowDown", A = N.key === "ArrowLeft" || N.key === "ArrowUp";
1691
- if (!E && !A) return;
1692
- N.preventDefault();
1693
- const S = (w + (E ? 1 : ke.length - 1)) % ke.length;
1711
+ function C(y, k) {
1712
+ const $ = y.key === "ArrowRight" || y.key === "ArrowDown", I = y.key === "ArrowLeft" || y.key === "ArrowUp";
1713
+ if (!$ && !I) return;
1714
+ y.preventDefault();
1715
+ const S = (k + ($ ? 1 : ke.length - 1)) % ke.length;
1694
1716
  D(ke[S].value), _.current[S]?.focus();
1695
1717
  }
1696
1718
  const h = /* @__PURE__ */ i(
@@ -1699,36 +1721,36 @@ function Na({
1699
1721
  className: "feedback__panel",
1700
1722
  id: m,
1701
1723
  onSubmit: b,
1702
- onKeyDown: (N) => {
1703
- !a && N.key === "Escape" && k();
1724
+ onKeyDown: (y) => {
1725
+ !a && y.key === "Escape" && w();
1704
1726
  },
1705
1727
  children: [
1706
1728
  /* @__PURE__ */ i("div", { className: "feedback__head", children: [
1707
1729
  /* @__PURE__ */ e("span", { className: "feedback__prompt", id: g, children: n }),
1708
- /* @__PURE__ */ e("div", { className: "feedback__emotions", role: "radiogroup", "aria-labelledby": g, children: ke.map(({ value: N, label: w, Icon: E }, A) => /* @__PURE__ */ e(
1730
+ /* @__PURE__ */ e("div", { className: "feedback__emotions", role: "radiogroup", "aria-labelledby": g, children: ke.map(({ value: y, label: k, Icon: $ }, I) => /* @__PURE__ */ e(
1709
1731
  "button",
1710
1732
  {
1711
1733
  ref: (S) => {
1712
- _.current[A] = S;
1734
+ _.current[I] = S;
1713
1735
  },
1714
1736
  type: "button",
1715
1737
  role: "radio",
1716
1738
  className: "feedback__emotion",
1717
- "aria-label": w,
1718
- "aria-checked": u === N,
1719
- tabIndex: A === v ? 0 : -1,
1720
- onClick: () => D(N),
1721
- onKeyDown: (S) => C(S, A),
1722
- children: /* @__PURE__ */ e(E, { size: 16, strokeWidth: 1.8, "aria-hidden": "true" })
1739
+ "aria-label": k,
1740
+ "aria-checked": u === y,
1741
+ tabIndex: I === v ? 0 : -1,
1742
+ onClick: () => D(y),
1743
+ onKeyDown: (S) => C(S, I),
1744
+ children: /* @__PURE__ */ e($, { size: 16, strokeWidth: 1.8, "aria-hidden": "true" })
1723
1745
  },
1724
- N
1746
+ y
1725
1747
  )) })
1726
1748
  ] }),
1727
1749
  s ? /* @__PURE__ */ i("label", { className: "feedback__field", children: [
1728
1750
  /* @__PURE__ */ e("span", { className: "q1-sr-only", children: "反馈主题" }),
1729
1751
  /* @__PURE__ */ i("select", { className: "feedback__select", defaultValue: "", children: [
1730
1752
  /* @__PURE__ */ e("option", { value: "", disabled: !0, children: "选择主题…" }),
1731
- s.map((N) => /* @__PURE__ */ e("option", { value: N, children: N }, N))
1753
+ s.map((y) => /* @__PURE__ */ e("option", { value: y, children: y }, y))
1732
1754
  ] })
1733
1755
  ] }) : null,
1734
1756
  /* @__PURE__ */ i("label", { className: "feedback__field", children: [
@@ -1796,7 +1818,7 @@ function wa({
1796
1818
  label: n = "项目目录",
1797
1819
  defaultExpanded: r = []
1798
1820
  }) {
1799
- const [a, s] = I(() => new Set(r)), [l, o] = I(() => t.length ? `/${t[0].name}` : ""), u = q(/* @__PURE__ */ new Map()), d = oe(() => {
1821
+ const [a, s] = A(() => new Set(r)), [l, o] = A(() => t.length ? `/${t[0].name}` : ""), u = q(/* @__PURE__ */ new Map()), d = ie(() => {
1800
1822
  const m = [];
1801
1823
  return $t(t, 1, "", a, m), m;
1802
1824
  }, [t, a]), p = d.some((m) => m.path === l) ? l : d[0]?.path ?? "";
@@ -1804,19 +1826,19 @@ function wa({
1804
1826
  o(m), window.requestAnimationFrame(() => u.current.get(m)?.focus());
1805
1827
  }
1806
1828
  function f(m, g) {
1807
- s((k) => {
1808
- const b = new Set(k);
1829
+ s((w) => {
1830
+ const b = new Set(w);
1809
1831
  return g ?? !b.has(m) ? b.add(m) : b.delete(m), b;
1810
1832
  });
1811
1833
  }
1812
1834
  function _(m) {
1813
1835
  const g = d.findIndex((b) => b.path === p);
1814
1836
  if (g === -1) return;
1815
- const k = d[g];
1816
- m.key === "ArrowDown" ? (m.preventDefault(), g < d.length - 1 && c(d[g + 1].path)) : m.key === "ArrowUp" ? (m.preventDefault(), g > 0 && c(d[g - 1].path)) : m.key === "ArrowRight" ? (m.preventDefault(), k.hasChildren && !a.has(k.path) ? f(k.path, !0) : k.hasChildren && g < d.length - 1 && c(d[g + 1].path)) : m.key === "ArrowLeft" ? (m.preventDefault(), k.hasChildren && a.has(k.path) ? f(k.path, !1) : k.parentPath && c(k.parentPath)) : m.key === "Home" ? (m.preventDefault(), c(d[0].path)) : m.key === "End" ? (m.preventDefault(), c(d[d.length - 1].path)) : (m.key === "Enter" || m.key === " ") && (m.preventDefault(), k.hasChildren && f(k.path));
1837
+ const w = d[g];
1838
+ m.key === "ArrowDown" ? (m.preventDefault(), g < d.length - 1 && c(d[g + 1].path)) : m.key === "ArrowUp" ? (m.preventDefault(), g > 0 && c(d[g - 1].path)) : m.key === "ArrowRight" ? (m.preventDefault(), w.hasChildren && !a.has(w.path) ? f(w.path, !0) : w.hasChildren && g < d.length - 1 && c(d[g + 1].path)) : m.key === "ArrowLeft" ? (m.preventDefault(), w.hasChildren && a.has(w.path) ? f(w.path, !1) : w.parentPath && c(w.parentPath)) : m.key === "Home" ? (m.preventDefault(), c(d[0].path)) : m.key === "End" ? (m.preventDefault(), c(d[d.length - 1].path)) : (m.key === "Enter" || m.key === " ") && (m.preventDefault(), w.hasChildren && f(w.path));
1817
1839
  }
1818
1840
  return /* @__PURE__ */ e("ul", { className: "file-tree", role: "tree", "aria-label": n, onKeyDown: _, children: d.map((m) => {
1819
- const g = a.has(m.path), k = g ? Ot : Bt;
1841
+ const g = a.has(m.path), w = g ? Ot : Bt;
1820
1842
  return /* @__PURE__ */ e(
1821
1843
  "li",
1822
1844
  {
@@ -1836,8 +1858,8 @@ function wa({
1836
1858
  b.stopPropagation(), o(m.path), m.hasChildren && f(m.path);
1837
1859
  },
1838
1860
  children: /* @__PURE__ */ i("span", { className: "file-tree__row", children: [
1839
- m.hasChildren ? /* @__PURE__ */ e(ue, { className: `file-tree__chevron${g ? " file-tree__chevron--open" : ""}`, size: 14, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e("span", { className: "file-tree__chevron-spacer", "aria-hidden": "true" }),
1840
- m.type === "folder" ? /* @__PURE__ */ e(k, { className: "file-tree__icon", size: 15, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(Pt, { className: "file-tree__icon", size: 15, strokeWidth: 2, "aria-hidden": "true" }),
1861
+ m.hasChildren ? /* @__PURE__ */ e(me, { className: `file-tree__chevron${g ? " file-tree__chevron--open" : ""}`, size: 14, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e("span", { className: "file-tree__chevron-spacer", "aria-hidden": "true" }),
1862
+ m.type === "folder" ? /* @__PURE__ */ e(w, { className: "file-tree__icon", size: 15, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(Pt, { className: "file-tree__icon", size: 15, strokeWidth: 2, "aria-hidden": "true" }),
1841
1863
  /* @__PURE__ */ e("span", { className: "file-tree__name", children: m.name })
1842
1864
  ] })
1843
1865
  },
@@ -1860,7 +1882,7 @@ function xa({
1860
1882
  }) {
1861
1883
  return /* @__PURE__ */ i("label", { className: "label", htmlFor: t, children: [
1862
1884
  r,
1863
- n ? /* @__PURE__ */ i(J, { children: [
1885
+ n ? /* @__PURE__ */ i(ee, { children: [
1864
1886
  /* @__PURE__ */ e("span", { className: "label__required", "aria-hidden": "true", children: "*" }),
1865
1887
  /* @__PURE__ */ e("span", { className: "q1-sr-only", children: "(必填)" })
1866
1888
  ] }) : null
@@ -1871,8 +1893,8 @@ function Te({
1871
1893
  getText: n,
1872
1894
  onClose: r
1873
1895
  }) {
1874
- const [a, s] = I(-1), l = q([]), o = q({ buffer: "", timer: 0 });
1875
- P(() => () => window.clearTimeout(o.current.timer), []);
1896
+ const [a, s] = A(-1), l = q([]), o = q({ buffer: "", timer: 0 });
1897
+ O(() => () => window.clearTimeout(o.current.timer), []);
1876
1898
  function u(c) {
1877
1899
  s(c), l.current[c]?.focus();
1878
1900
  }
@@ -1907,7 +1929,7 @@ function Ca({
1907
1929
  entries: n,
1908
1930
  children: r
1909
1931
  }) {
1910
- const [a, s] = I(null), l = q(null), o = q(null), u = q(0), d = K(), p = a !== null, c = n.flatMap((h, x) => rn(h) ? [x] : []), { itemRefs: f, focusItem: _, reset: m, onMenuKeyDown: g } = Te({
1932
+ const [a, s] = A(null), l = q(null), o = q(null), u = q(0), d = P(), p = a !== null, c = n.flatMap((h, x) => rn(h) ? [x] : []), { itemRefs: f, focusItem: _, reset: m, onMenuKeyDown: g } = Te({
1911
1933
  focusableIndices: c,
1912
1934
  getText: (h) => {
1913
1935
  const x = n[h];
@@ -1915,7 +1937,7 @@ function Ca({
1915
1937
  },
1916
1938
  onClose: () => b()
1917
1939
  });
1918
- function k(h, x) {
1940
+ function w(h, x) {
1919
1941
  s({ x: h, y: x }), window.requestAnimationFrame(() => _(c[0]));
1920
1942
  }
1921
1943
  function b(h = !0) {
@@ -1924,35 +1946,35 @@ function Ca({
1924
1946
  fe(() => {
1925
1947
  if (!a || !o.current) return;
1926
1948
  const h = o.current.getBoundingClientRect();
1927
- let { x, y: N } = a;
1928
- x + h.width > window.innerWidth - 8 && (x = Math.max(8, x - h.width)), N + h.height > window.innerHeight - 8 && (N = Math.max(8, N - h.height)), (x !== a.x || N !== a.y) && s({ x, y: N });
1929
- }, [a]), P(() => {
1949
+ let { x, y } = a;
1950
+ x + h.width > window.innerWidth - 8 && (x = Math.max(8, x - h.width)), y + h.height > window.innerHeight - 8 && (y = Math.max(8, y - h.height)), (x !== a.x || y !== a.y) && s({ x, y });
1951
+ }, [a]), O(() => {
1930
1952
  if (!p) return;
1931
1953
  function h(x) {
1932
1954
  o.current && !o.current.contains(x.target) && b(!1);
1933
1955
  }
1934
1956
  return document.addEventListener("mousedown", h), () => document.removeEventListener("mousedown", h);
1935
1957
  }, [p]);
1936
- function y(h) {
1937
- h.preventDefault(), k(h.clientX, h.clientY);
1958
+ function N(h) {
1959
+ h.preventDefault(), w(h.clientX, h.clientY);
1938
1960
  }
1939
1961
  function v(h) {
1940
1962
  if (h.shiftKey && h.key === "F10" || h.key === "ContextMenu") {
1941
1963
  h.preventDefault();
1942
1964
  const x = l.current.getBoundingClientRect();
1943
- k(x.left + 16, x.top + 16);
1965
+ w(x.left + 16, x.top + 16);
1944
1966
  }
1945
1967
  }
1946
1968
  function D(h) {
1947
1969
  const x = h.touches[0];
1948
1970
  u.current = window.setTimeout(() => {
1949
- x && k(x.clientX, x.clientY);
1971
+ x && w(x.clientX, x.clientY);
1950
1972
  }, 500);
1951
1973
  }
1952
1974
  function C() {
1953
1975
  window.clearTimeout(u.current);
1954
1976
  }
1955
- return /* @__PURE__ */ i(J, { children: [
1977
+ return /* @__PURE__ */ i(ee, { children: [
1956
1978
  /* @__PURE__ */ e(
1957
1979
  "div",
1958
1980
  {
@@ -1962,7 +1984,7 @@ function Ca({
1962
1984
  role: "button",
1963
1985
  "aria-haspopup": "menu",
1964
1986
  "aria-label": `${t}(右键或 Shift+F10 打开菜单)`,
1965
- onContextMenu: y,
1987
+ onContextMenu: N,
1966
1988
  onKeyDown: v,
1967
1989
  onTouchStart: D,
1968
1990
  onTouchEnd: C,
@@ -1982,15 +2004,15 @@ function Ca({
1982
2004
  children: n.map((h, x) => h.type === "separator" ? /* @__PURE__ */ e("div", { className: "menu__separator", role: "separator" }, `sep-${x}`) : h.type === "link" ? /* @__PURE__ */ i(
1983
2005
  "a",
1984
2006
  {
1985
- ref: (N) => {
1986
- f.current[x] = N;
2007
+ ref: (y) => {
2008
+ f.current[x] = y;
1987
2009
  },
1988
2010
  role: "menuitem",
1989
2011
  tabIndex: -1,
1990
2012
  href: h.href,
1991
2013
  className: "menu__item",
1992
- onClick: (N) => {
1993
- N.preventDefault(), b();
2014
+ onClick: (y) => {
2015
+ y.preventDefault(), b();
1994
2016
  },
1995
2017
  children: [
1996
2018
  h.icon ? /* @__PURE__ */ e("span", { className: "menu__item-icon", children: h.icon }) : null,
@@ -2002,8 +2024,8 @@ function Ca({
2002
2024
  ) : /* @__PURE__ */ i(
2003
2025
  "button",
2004
2026
  {
2005
- ref: (N) => {
2006
- f.current[x] = N;
2027
+ ref: (y) => {
2028
+ f.current[x] = y;
2007
2029
  },
2008
2030
  type: "button",
2009
2031
  role: "menuitem",
@@ -2030,28 +2052,28 @@ function Da({
2030
2052
  disabled: r,
2031
2053
  align: a = "end"
2032
2054
  }) {
2033
- const [s, l] = I(!1), o = q(null), u = K(), d = t.flatMap((b, y) => b.disabled ? [] : [y]), { itemRefs: p, focusItem: c, reset: f, onMenuKeyDown: _ } = Te({
2055
+ const [s, l] = A(!1), o = q(null), u = P(), d = t.flatMap((b, N) => b.disabled ? [] : [N]), { itemRefs: p, focusItem: c, reset: f, onMenuKeyDown: _ } = Te({
2034
2056
  focusableIndices: d,
2035
2057
  getText: (b) => t[b].label,
2036
2058
  onClose: () => g()
2037
2059
  });
2038
2060
  function m(b) {
2039
2061
  l(!0);
2040
- const y = b === "first" ? d[0] : d[d.length - 1];
2041
- window.requestAnimationFrame(() => c(y));
2062
+ const N = b === "first" ? d[0] : d[d.length - 1];
2063
+ window.requestAnimationFrame(() => c(N));
2042
2064
  }
2043
2065
  function g(b = !0) {
2044
2066
  l(!1), f(), b && o.current?.focus();
2045
2067
  }
2046
- P(() => {
2068
+ O(() => {
2047
2069
  if (!s) return;
2048
- function b(y) {
2070
+ function b(N) {
2049
2071
  const v = o.current?.closest(".dots-menu");
2050
- v && !v.contains(y.target) && g(!1);
2072
+ v && !v.contains(N.target) && g(!1);
2051
2073
  }
2052
2074
  return document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
2053
2075
  }, [s]);
2054
- function k(b) {
2076
+ function w(b) {
2055
2077
  b.key === "ArrowDown" || b.key === "Enter" || b.key === " " ? (b.preventDefault(), m("first")) : b.key === "ArrowUp" && (b.preventDefault(), m("last"));
2056
2078
  }
2057
2079
  return /* @__PURE__ */ i("div", { className: "dots-menu", children: [
@@ -2067,7 +2089,7 @@ function Da({
2067
2089
  "aria-controls": s ? u : void 0,
2068
2090
  disabled: r,
2069
2091
  onClick: () => s ? g() : m("first"),
2070
- onKeyDown: k,
2092
+ onKeyDown: w,
2071
2093
  children: /* @__PURE__ */ e(_t, { size: n === "sm" ? 14 : n === "lg" ? 20 : 16, strokeWidth: 2, "aria-hidden": "true" })
2072
2094
  }
2073
2095
  ),
@@ -2079,11 +2101,11 @@ function Da({
2079
2101
  "aria-label": "更多操作",
2080
2102
  className: `menu__popup menu__popup--${a}`,
2081
2103
  onKeyDown: _,
2082
- children: t.map((b, y) => /* @__PURE__ */ e(
2104
+ children: t.map((b, N) => /* @__PURE__ */ e(
2083
2105
  "button",
2084
2106
  {
2085
2107
  ref: (v) => {
2086
- p.current[y] = v;
2108
+ p.current[N] = v;
2087
2109
  },
2088
2110
  type: "button",
2089
2111
  role: "menuitem",
@@ -2156,13 +2178,13 @@ function qa({ title: t, children: n, tone: r, icon: a, action: s, onDismiss: l,
2156
2178
  u
2157
2179
  ), f = /* @__PURE__ */ i("p", { className: "banner__content", children: [
2158
2180
  /* @__PURE__ */ e("span", { className: "banner__title", children: t }),
2159
- n != null ? /* @__PURE__ */ i(J, { children: [
2181
+ n != null ? /* @__PURE__ */ i(ee, { children: [
2160
2182
  " — ",
2161
2183
  n
2162
2184
  ] }) : null
2163
2185
  ] }), _ = s ? p ? /* @__PURE__ */ e("a", { className: "banner__cta", href: s.href, children: s.label }) : /* @__PURE__ */ i("a", { className: "banner__action", href: s.href, children: [
2164
2186
  s.label,
2165
- /* @__PURE__ */ e(ue, { "aria-hidden": "true", size: 16, strokeWidth: 2 })
2187
+ /* @__PURE__ */ e(me, { "aria-hidden": "true", size: 16, strokeWidth: 2 })
2166
2188
  ] }) : null, m = !p && l ? /* @__PURE__ */ e("button", { className: "banner__close", type: "button", "aria-label": "关闭横幅", onClick: l, children: /* @__PURE__ */ e(_e, { "aria-hidden": "true", size: 16, strokeWidth: 2 }) }) : null;
2167
2189
  if (o) {
2168
2190
  const g = Number.isFinite(o.value) ? Math.min(100, Math.max(0, o.value)) : 0;
@@ -2219,9 +2241,9 @@ function Ia(t) {
2219
2241
  hover: _,
2220
2242
  secondary: m,
2221
2243
  divided: g,
2222
- direction: k,
2244
+ direction: w,
2223
2245
  shadow: b,
2224
- bordered: y,
2246
+ bordered: N,
2225
2247
  className: v,
2226
2248
  children: D,
2227
2249
  ...C
@@ -2263,7 +2285,7 @@ function Sa({ className: t, ...n }) {
2263
2285
  return /* @__PURE__ */ e("nav", { className: T("q1-navigation", t), ...n });
2264
2286
  }
2265
2287
  function Ta({ label: t, action: n, children: r, className: a, ...s }) {
2266
- const l = K(), o = t !== void 0;
2288
+ const l = P(), o = t !== void 0;
2267
2289
  return /* @__PURE__ */ i(
2268
2290
  "section",
2269
2291
  {
@@ -2286,7 +2308,7 @@ function za(t) {
2286
2308
  n && "q1-navigation__item--active",
2287
2309
  r && "q1-navigation__item--disabled",
2288
2310
  d
2289
- ), _ = /* @__PURE__ */ i(J, { children: [
2311
+ ), _ = /* @__PURE__ */ i(ee, { children: [
2290
2312
  a ? /* @__PURE__ */ e("span", { className: "q1-navigation__item-icon", "aria-hidden": "true", children: a }) : null,
2291
2313
  /* @__PURE__ */ i("span", { className: "q1-navigation__item-content", children: [
2292
2314
  /* @__PURE__ */ e("span", { className: "q1-navigation__item-label", children: u }),
@@ -2303,7 +2325,7 @@ function za(t) {
2303
2325
  href: r ? void 0 : p,
2304
2326
  "aria-disabled": r || void 0,
2305
2327
  "aria-current": n ? "page" : void 0,
2306
- onClick: r ? (k) => k.preventDefault() : m.onClick,
2328
+ onClick: r ? (w) => w.preventDefault() : m.onClick,
2307
2329
  children: _
2308
2330
  }
2309
2331
  ) : /* @__PURE__ */ e("button", { type: "button", className: f, disabled: r, ...c, children: _ }),
@@ -2318,7 +2340,7 @@ function Ra({
2318
2340
  onExpandedChange: s,
2319
2341
  children: l
2320
2342
  }) {
2321
- const o = K(), [u, d] = I(a), p = r !== void 0, c = p ? r : u;
2343
+ const o = P(), [u, d] = A(a), p = r !== void 0, c = p ? r : u;
2322
2344
  return /* @__PURE__ */ i("div", { className: "q1-navigation__group", children: [
2323
2345
  /* @__PURE__ */ i(
2324
2346
  "button",
@@ -2334,25 +2356,25 @@ function Ra({
2334
2356
  children: [
2335
2357
  n ? /* @__PURE__ */ e("span", { className: "q1-navigation__group-icon", "aria-hidden": "true", children: n }) : null,
2336
2358
  /* @__PURE__ */ e("span", { className: "q1-navigation__group-label", children: t }),
2337
- /* @__PURE__ */ e(ue, { className: "q1-navigation__group-chevron", size: 16, strokeWidth: 2, "aria-hidden": "true" })
2359
+ /* @__PURE__ */ e(me, { className: "q1-navigation__group-chevron", size: 16, strokeWidth: 2, "aria-hidden": "true" })
2338
2360
  ]
2339
2361
  }
2340
2362
  ),
2341
2363
  /* @__PURE__ */ e("div", { className: "q1-navigation__group-content", id: o, role: "group", hidden: !c, children: l })
2342
2364
  ] });
2343
2365
  }
2344
- const se = 8, tt = 8, We = typeof document > "u" ? P : fe;
2345
- let ce = null, $e = 0, He = !1;
2366
+ const oe = 8, tt = 8, We = typeof document > "u" ? O : fe;
2367
+ let de = null, $e = 0, He = !1;
2346
2368
  function un() {
2347
2369
  if (typeof document > "u") return null;
2348
- if (!ce || ce.parentElement !== document.body) {
2370
+ if (!de || de.parentElement !== document.body) {
2349
2371
  const t = document.body.querySelector(':scope > [data-q1-portal="context-switcher"]');
2350
- ce = t ?? document.createElement("div"), He = !t, t || (ce.setAttribute("data-q1-portal", "context-switcher"), document.body.append(ce));
2372
+ de = t ?? document.createElement("div"), He = !t, t || (de.setAttribute("data-q1-portal", "context-switcher"), document.body.append(de));
2351
2373
  }
2352
- return $e += 1, ce;
2374
+ return $e += 1, de;
2353
2375
  }
2354
2376
  function mn() {
2355
- $e = Math.max(0, $e - 1), !($e > 0) && (He && ce?.remove(), ce = null, He = !1);
2377
+ $e = Math.max(0, $e - 1), !($e > 0) && (He && de?.remove(), de = null, He = !1);
2356
2378
  }
2357
2379
  function La({
2358
2380
  currentContext: t,
@@ -2367,109 +2389,109 @@ function La({
2367
2389
  onFooterAction: p,
2368
2390
  label: c
2369
2391
  }) {
2370
- const [f, _] = I(a), [m, g] = I(null), [k, b] = I({
2392
+ const [f, _] = A(a), [m, g] = A(null), [w, b] = A({
2371
2393
  align: "start",
2372
2394
  side: "bottom",
2373
2395
  direction: "ltr",
2374
- left: se,
2375
- top: se
2376
- }), y = r !== void 0, v = y ? r : f, D = c ? `${c} ${t.textValue}` : t.textValue, C = q(null), h = q(null), x = q(null), N = q("selected"), w = q(!1), E = q("trigger"), A = q(v), S = K();
2377
- function W($) {
2378
- y || _($), s?.($);
2396
+ left: oe,
2397
+ top: oe
2398
+ }), N = r !== void 0, v = N ? r : f, D = c ? `${c} ${t.textValue}` : t.textValue, C = q(null), h = q(null), x = q(null), y = q("selected"), k = q(!1), $ = q("trigger"), I = q(v), S = P();
2399
+ function L(E) {
2400
+ N || _(E), s?.(E);
2379
2401
  }
2380
- const O = oe(() => [
2381
- ...n.flatMap(($) => $.items.map((z) => ({ kind: "item", group: $, item: z }))),
2382
- ...(d ?? []).map(($) => ({ kind: "action", action: $ }))
2383
- ], [d, n]), V = oe(() => O.flatMap(
2384
- ($, z) => $.kind === "item" ? !$.item.disabled && $.item.id !== o ? [z] : [] : $.action.disabled ? [] : [z]
2385
- ), [O, o]), ee = ($) => O[$]?.kind === "item" ? O[$].item.textValue : O[$]?.action.textValue ?? "", G = oe(() => {
2386
- for (const $ of n) {
2387
- const z = O.findIndex(
2388
- (H) => H.kind === "item" && H.group.id === $.id && H.item.id === $.selectedId && !H.item.disabled && H.item.id !== o
2402
+ const F = ie(() => [
2403
+ ...n.flatMap((E) => E.items.map((z) => ({ kind: "item", group: E, item: z }))),
2404
+ ...(d ?? []).map((E) => ({ kind: "action", action: E }))
2405
+ ], [d, n]), G = ie(() => F.flatMap(
2406
+ (E, z) => E.kind === "item" ? !E.item.disabled && E.item.id !== o ? [z] : [] : E.action.disabled ? [] : [z]
2407
+ ), [F, o]), X = (E) => F[E]?.kind === "item" ? F[E].item.textValue : F[E]?.action.textValue ?? "", V = ie(() => {
2408
+ for (const E of n) {
2409
+ const z = F.findIndex(
2410
+ (H) => H.kind === "item" && H.group.id === E.id && H.item.id === E.selectedId && !H.item.disabled && H.item.id !== o
2389
2411
  );
2390
2412
  if (z >= 0) return z;
2391
2413
  }
2392
- return V[0];
2393
- }, [O, V, n, o]), { itemRefs: me, focusItem: B, reset: Y, onMenuKeyDown: U } = Te({
2394
- focusableIndices: V,
2395
- getText: ee,
2396
- onClose: () => Z(!0)
2414
+ return G[0];
2415
+ }, [F, G, n, o]), { itemRefs: re, focusItem: B, reset: Y, onMenuKeyDown: U } = Te({
2416
+ focusableIndices: G,
2417
+ getText: X,
2418
+ onClose: () => Q(!0)
2397
2419
  });
2398
- function Z($) {
2399
- E.current = $ ? "trigger" : "preserve", W(!1), Y(), w.current = !1, $ && C.current?.focus();
2420
+ function Q(E) {
2421
+ $.current = E ? "trigger" : "preserve", L(!1), Y(), k.current = !1, E && C.current?.focus();
2400
2422
  }
2401
- function he($) {
2402
- N.current = $, E.current = "trigger", w.current = !1, W(!0);
2423
+ function he(E) {
2424
+ y.current = E, $.current = "trigger", k.current = !1, L(!0);
2403
2425
  }
2404
- P(() => {
2405
- const $ = un();
2406
- return g($), () => mn();
2426
+ O(() => {
2427
+ const E = un();
2428
+ return g(E), () => mn();
2407
2429
  }, []), We(() => {
2408
- const $ = A.current;
2409
- if (A.current = v, !$ && v) {
2410
- E.current = "trigger";
2430
+ const E = I.current;
2431
+ if (I.current = v, !E && v) {
2432
+ $.current = "trigger";
2411
2433
  return;
2412
2434
  }
2413
- !$ || v || (Y(), w.current = !1, E.current === "trigger" && C.current?.focus());
2435
+ !E || v || (Y(), k.current = !1, $.current === "trigger" && C.current?.focus());
2414
2436
  }, [v, Y]), We(() => {
2415
- if (!v || !m || w.current) return;
2416
- const $ = window.requestAnimationFrame(() => {
2417
- if (w.current) return;
2418
- if (w.current = !0, V.length === 0) {
2437
+ if (!v || !m || k.current) return;
2438
+ const E = window.requestAnimationFrame(() => {
2439
+ if (k.current) return;
2440
+ if (k.current = !0, G.length === 0) {
2419
2441
  x.current?.focus();
2420
2442
  return;
2421
2443
  }
2422
- const z = N.current === "last" ? V[V.length - 1] : G;
2444
+ const z = y.current === "last" ? G[G.length - 1] : V;
2423
2445
  z !== void 0 && B(z);
2424
2446
  });
2425
- return () => window.cancelAnimationFrame($);
2426
- }, [B, V, v, m, G]), We(() => {
2447
+ return () => window.cancelAnimationFrame(E);
2448
+ }, [B, G, v, m, V]), We(() => {
2427
2449
  if (!v || !m) return;
2428
- function $() {
2429
- const ne = C.current, Q = x.current;
2430
- if (!ne || !Q) return;
2431
- const re = ne.getBoundingClientRect(), Re = h.current?.getBoundingClientRect(), le = Q.getBoundingClientRect(), M = window.innerWidth, R = window.innerHeight, j = getComputedStyle(ne).direction === "rtl" ? "rtl" : "ltr";
2432
- let X = "start";
2433
- const At = j === "rtl" ? re.right - le.width : re.left, St = j === "rtl" ? re.left : re.right - le.width;
2450
+ function E() {
2451
+ const ne = C.current, J = x.current;
2452
+ if (!ne || !J) return;
2453
+ const le = ne.getBoundingClientRect(), Re = h.current?.getBoundingClientRect(), se = J.getBoundingClientRect(), M = window.innerWidth, R = window.innerHeight, j = getComputedStyle(ne).direction === "rtl" ? "rtl" : "ltr";
2454
+ let Z = "start";
2455
+ const At = j === "rtl" ? le.right - se.width : le.left, St = j === "rtl" ? le.left : le.right - se.width;
2434
2456
  let pe = At;
2435
- (pe < se || pe + le.width > M - se) && (X = "end", pe = St), pe = Math.max(se, Math.min(pe, M - le.width - se));
2436
- let Le = "bottom", be = (Re?.bottom ?? re.bottom) + tt;
2437
- be + le.height > R - se && (Le = "top", be = re.top - le.height - tt), be = Math.max(se, Math.min(be, R - le.height - se)), b(
2438
- (ge) => ge.align === X && ge.side === Le && ge.direction === j && ge.left === pe && ge.top === be ? ge : { align: X, side: Le, direction: j, left: pe, top: be }
2457
+ (pe < oe || pe + se.width > M - oe) && (Z = "end", pe = St), pe = Math.max(oe, Math.min(pe, M - se.width - oe));
2458
+ let Le = "bottom", be = (Re?.bottom ?? le.bottom) + tt;
2459
+ be + se.height > R - oe && (Le = "top", be = le.top - se.height - tt), be = Math.max(oe, Math.min(be, R - se.height - oe)), b(
2460
+ (ge) => ge.align === Z && ge.side === Le && ge.direction === j && ge.left === pe && ge.top === be ? ge : { align: Z, side: Le, direction: j, left: pe, top: be }
2439
2461
  );
2440
2462
  }
2441
2463
  let z = 0;
2442
2464
  function H() {
2443
2465
  z || (z = window.requestAnimationFrame(() => {
2444
- z = 0, $();
2466
+ z = 0, E();
2445
2467
  }));
2446
2468
  }
2447
- $();
2469
+ E();
2448
2470
  const te = typeof ResizeObserver > "u" ? null : new ResizeObserver(H);
2449
2471
  return x.current && te?.observe(x.current), h.current && te?.observe(h.current), window.addEventListener("resize", H), window.addEventListener("scroll", H, !0), () => {
2450
2472
  window.removeEventListener("resize", H), window.removeEventListener("scroll", H, !0), te?.disconnect(), z && window.cancelAnimationFrame(z);
2451
2473
  };
2452
- }, [u, v, m]), P(() => {
2474
+ }, [u, v, m]), O(() => {
2453
2475
  if (!v) return;
2454
- function $(z) {
2476
+ function E(z) {
2455
2477
  const H = z.target;
2456
- !C.current?.contains(H) && !x.current?.contains(H) && Z(!1);
2478
+ !C.current?.contains(H) && !x.current?.contains(H) && Q(!1);
2457
2479
  }
2458
- return document.addEventListener("pointerdown", $), () => document.removeEventListener("pointerdown", $);
2480
+ return document.addEventListener("pointerdown", E), () => document.removeEventListener("pointerdown", E);
2459
2481
  }, [v]);
2460
- function Ce($) {
2461
- $.key === "ArrowDown" || $.key === "Enter" || $.key === " " ? ($.preventDefault(), v || he("selected")) : $.key === "ArrowUp" ? ($.preventDefault(), v || he("last")) : $.key === "Escape" && v && ($.preventDefault(), Z(!0));
2482
+ function Ce(E) {
2483
+ E.key === "ArrowDown" || E.key === "Enter" || E.key === " " ? (E.preventDefault(), v || he("selected")) : E.key === "ArrowUp" ? (E.preventDefault(), v || he("last")) : E.key === "Escape" && v && (E.preventDefault(), Q(!0));
2462
2484
  }
2463
- function ze($) {
2464
- if ($.key === "Tab") {
2465
- C.current?.focus(), Z(!1);
2485
+ function ze(E) {
2486
+ if (E.key === "Tab") {
2487
+ C.current?.focus(), Q(!1);
2466
2488
  return;
2467
2489
  }
2468
- if (V.length === 0 && ($.key === "ArrowDown" || $.key === "ArrowUp" || $.key === "Home" || $.key === "End" || $.key.length === 1 && /\S/.test($.key))) {
2469
- $.preventDefault();
2490
+ if (G.length === 0 && (E.key === "ArrowDown" || E.key === "ArrowUp" || E.key === "Home" || E.key === "End" || E.key.length === 1 && /\S/.test(E.key))) {
2491
+ E.preventDefault();
2470
2492
  return;
2471
2493
  }
2472
- U($);
2494
+ U(E);
2473
2495
  }
2474
2496
  const De = v && m ? dt(
2475
2497
  /* @__PURE__ */ i(
@@ -2481,41 +2503,41 @@ function La({
2481
2503
  tabIndex: -1,
2482
2504
  className: "q1-context-switcher__popup",
2483
2505
  "aria-label": c ?? t.textValue,
2484
- dir: k.direction,
2485
- "data-align": k.align,
2486
- "data-side": k.side,
2487
- style: { left: k.left, top: k.top },
2506
+ dir: w.direction,
2507
+ "data-align": w.align,
2508
+ "data-side": w.side,
2509
+ style: { left: w.left, top: w.top },
2488
2510
  onKeyDown: ze,
2489
2511
  children: [
2490
- /* @__PURE__ */ e("div", { className: "q1-context-switcher__groups", children: n.map(($) => /* @__PURE__ */ i(
2512
+ /* @__PURE__ */ e("div", { className: "q1-context-switcher__groups", children: n.map((E) => /* @__PURE__ */ i(
2491
2513
  "div",
2492
2514
  {
2493
2515
  className: "q1-context-switcher__group",
2494
2516
  role: "group",
2495
- "aria-label": $.textValue,
2517
+ "aria-label": E.textValue,
2496
2518
  children: [
2497
- /* @__PURE__ */ e("div", { className: "q1-context-switcher__group-label", "aria-hidden": "true", children: $.label }),
2498
- $.items.map((z) => {
2499
- const H = O.findIndex(
2500
- (Q) => Q.kind === "item" && Q.group.id === $.id && Q.item.id === z.id
2519
+ /* @__PURE__ */ e("div", { className: "q1-context-switcher__group-label", "aria-hidden": "true", children: E.label }),
2520
+ E.items.map((z) => {
2521
+ const H = F.findIndex(
2522
+ (J) => J.kind === "item" && J.group.id === E.id && J.item.id === z.id
2501
2523
  ), te = z.id === o, ne = !!(z.disabled || te);
2502
2524
  return /* @__PURE__ */ i(
2503
2525
  "button",
2504
2526
  {
2505
- ref: (Q) => {
2506
- me.current[H] = Q;
2527
+ ref: (J) => {
2528
+ re.current[H] = J;
2507
2529
  },
2508
2530
  type: "button",
2509
2531
  role: "menuitemradio",
2510
2532
  tabIndex: -1,
2511
2533
  className: "q1-context-switcher__item",
2512
2534
  "aria-label": z.textValue,
2513
- "aria-checked": $.selectedId === z.id,
2535
+ "aria-checked": E.selectedId === z.id,
2514
2536
  "aria-disabled": ne || void 0,
2515
2537
  "aria-busy": te || void 0,
2516
2538
  "data-context-id": z.id,
2517
2539
  onClick: () => {
2518
- ne || (E.current = "trigger", l(z), y || Z(!0));
2540
+ ne || ($.current = "trigger", l(z), N || Q(!0));
2519
2541
  },
2520
2542
  children: [
2521
2543
  z.avatar ? /* @__PURE__ */ e("span", { className: "q1-context-switcher__avatar", "aria-hidden": "true", children: z.avatar }) : null,
@@ -2523,7 +2545,7 @@ function La({
2523
2545
  /* @__PURE__ */ e("span", { className: "q1-context-switcher__item-label", children: z.label }),
2524
2546
  z.description ? /* @__PURE__ */ e("span", { className: "q1-context-switcher__description", children: z.description }) : null
2525
2547
  ] }),
2526
- te ? /* @__PURE__ */ e(ve, { className: "q1-context-switcher__pending", size: 16, strokeWidth: 2, "aria-hidden": "true" }) : $.selectedId === z.id ? /* @__PURE__ */ e(ie, { className: "q1-context-switcher__check", size: 16, strokeWidth: 2, "aria-hidden": "true" }) : null
2548
+ te ? /* @__PURE__ */ e(ve, { className: "q1-context-switcher__pending", size: 16, strokeWidth: 2, "aria-hidden": "true" }) : E.selectedId === z.id ? /* @__PURE__ */ e(ce, { className: "q1-context-switcher__check", size: 16, strokeWidth: 2, "aria-hidden": "true" }) : null
2527
2549
  ]
2528
2550
  },
2529
2551
  z.id
@@ -2531,33 +2553,33 @@ function La({
2531
2553
  })
2532
2554
  ]
2533
2555
  },
2534
- $.id
2556
+ E.id
2535
2557
  )) }),
2536
- d?.length ? /* @__PURE__ */ e("div", { className: "q1-context-switcher__footer", children: d.map(($) => {
2537
- const z = O.findIndex((H) => H.kind === "action" && H.action.id === $.id);
2558
+ d?.length ? /* @__PURE__ */ e("div", { className: "q1-context-switcher__footer", children: d.map((E) => {
2559
+ const z = F.findIndex((H) => H.kind === "action" && H.action.id === E.id);
2538
2560
  return /* @__PURE__ */ i(
2539
2561
  "button",
2540
2562
  {
2541
2563
  ref: (H) => {
2542
- me.current[z] = H;
2564
+ re.current[z] = H;
2543
2565
  },
2544
2566
  type: "button",
2545
2567
  role: "menuitem",
2546
2568
  tabIndex: -1,
2547
2569
  className: "q1-context-switcher__action",
2548
- "aria-label": $.textValue,
2549
- "aria-disabled": $.disabled || void 0,
2550
- disabled: $.disabled,
2551
- "data-context-action-id": $.id,
2570
+ "aria-label": E.textValue,
2571
+ "aria-disabled": E.disabled || void 0,
2572
+ disabled: E.disabled,
2573
+ "data-context-action-id": E.id,
2552
2574
  onClick: () => {
2553
- E.current = "trigger", p?.($), y || Z(!0);
2575
+ $.current = "trigger", p?.(E), N || Q(!0);
2554
2576
  },
2555
2577
  children: [
2556
- $.icon ? /* @__PURE__ */ e("span", { className: "q1-context-switcher__action-icon", "aria-hidden": "true", children: $.icon }) : null,
2557
- /* @__PURE__ */ e("span", { className: "q1-context-switcher__item-label", children: $.label })
2578
+ E.icon ? /* @__PURE__ */ e("span", { className: "q1-context-switcher__action-icon", "aria-hidden": "true", children: E.icon }) : null,
2579
+ /* @__PURE__ */ e("span", { className: "q1-context-switcher__item-label", children: E.label })
2558
2580
  ]
2559
2581
  },
2560
- $.id
2582
+ E.id
2561
2583
  );
2562
2584
  }) }) : null
2563
2585
  ]
@@ -2576,7 +2598,7 @@ function La({
2576
2598
  "aria-expanded": v,
2577
2599
  "aria-controls": S,
2578
2600
  "aria-label": D,
2579
- onClick: () => v ? Z(!0) : he("selected"),
2601
+ onClick: () => v ? Q(!0) : he("selected"),
2580
2602
  onKeyDown: Ce,
2581
2603
  children: [
2582
2604
  t.avatar ? /* @__PURE__ */ e("span", { className: "q1-context-switcher__avatar", "aria-hidden": "true", children: t.avatar }) : null,
@@ -2603,34 +2625,34 @@ function hn({
2603
2625
  tip: o = !0,
2604
2626
  center: u = !1
2605
2627
  }) {
2606
- const [d, p] = I(!1), [c, f] = I({
2628
+ const [d, p] = A(!1), [c, f] = A({
2607
2629
  p: n,
2608
2630
  left: 0,
2609
2631
  top: 0,
2610
2632
  caret: 0
2611
- }), _ = q(null), m = q(null), g = q(null), k = K(), b = Ne(() => {
2612
- const N = m.current, w = g.current;
2613
- if (!N || !w) return;
2614
- const E = 8, A = 8, S = N.getBoundingClientRect(), W = w.offsetWidth, O = w.offsetHeight, V = document.documentElement.clientWidth, ee = document.documentElement.clientHeight, G = S.left + S.width / 2, me = S.top + S.height / 2;
2633
+ }), _ = q(null), m = q(null), g = q(null), w = P(), b = Ne(() => {
2634
+ const y = m.current, k = g.current;
2635
+ if (!y || !k) return;
2636
+ const $ = 8, I = 8, S = y.getBoundingClientRect(), L = k.offsetWidth, F = k.offsetHeight, G = document.documentElement.clientWidth, X = document.documentElement.clientHeight, V = S.left + S.width / 2, re = S.top + S.height / 2;
2615
2637
  let B = n;
2616
- n === "top" && S.top - A - O < E && S.bottom + A + O <= ee - E ? B = "bottom" : n === "bottom" && S.bottom + A + O > ee - E && S.top - A - O >= E ? B = "top" : n === "left" && S.left - A - W < E && S.right + A + W <= V - E ? B = "right" : n === "right" && S.right + A + W > V - E && S.left - A - W >= E && (B = "left");
2638
+ n === "top" && S.top - I - F < $ && S.bottom + I + F <= X - $ ? B = "bottom" : n === "bottom" && S.bottom + I + F > X - $ && S.top - I - F >= $ ? B = "top" : n === "left" && S.left - I - L < $ && S.right + I + L <= G - $ ? B = "right" : n === "right" && S.right + I + L > G - $ && S.left - I - L >= $ && (B = "left");
2617
2639
  let Y, U;
2618
- B === "top" || B === "bottom" ? (Y = l === "start" ? S.left : l === "end" ? S.right - W : G - W / 2, U = B === "top" ? S.top - A - O : S.bottom + A) : (U = l === "start" ? S.top : l === "end" ? S.bottom - O : me - O / 2, Y = B === "left" ? S.left - A - W : S.right + A), Y = Math.max(E, Math.min(Y, V - E - W)), U = Math.max(E, Math.min(U, ee - E - O));
2619
- const Z = B === "top" || B === "bottom" ? Math.max(12, Math.min(W - 12, G - Y)) : Math.max(12, Math.min(O - 12, me - U));
2620
- f({ p: B, left: Y, top: U, caret: Z });
2640
+ B === "top" || B === "bottom" ? (Y = l === "start" ? S.left : l === "end" ? S.right - L : V - L / 2, U = B === "top" ? S.top - I - F : S.bottom + I) : (U = l === "start" ? S.top : l === "end" ? S.bottom - F : re - F / 2, Y = B === "left" ? S.left - I - L : S.right + I), Y = Math.max($, Math.min(Y, G - $ - L)), U = Math.max($, Math.min(U, X - $ - F));
2641
+ const Q = B === "top" || B === "bottom" ? Math.max(12, Math.min(L - 12, V - Y)) : Math.max(12, Math.min(F - 12, re - U));
2642
+ f({ p: B, left: Y, top: U, caret: Q });
2621
2643
  }, [n, l]);
2622
2644
  fe(() => {
2623
2645
  if (d)
2624
2646
  return b(), window.addEventListener("scroll", b, !0), window.addEventListener("resize", b), () => {
2625
2647
  window.removeEventListener("scroll", b, !0), window.removeEventListener("resize", b);
2626
2648
  };
2627
- }, [d, b]), P(
2649
+ }, [d, b]), O(
2628
2650
  () => () => {
2629
2651
  _.current && clearTimeout(_.current);
2630
2652
  },
2631
2653
  []
2632
2654
  );
2633
- function y() {
2655
+ function N() {
2634
2656
  _.current && clearTimeout(_.current), _.current = setTimeout(() => p(!0), r);
2635
2657
  }
2636
2658
  function v() {
@@ -2647,39 +2669,39 @@ function hn({
2647
2669
  o ? "" : "q1-tooltip__bubble--no-tip",
2648
2670
  u ? "q1-tooltip__bubble--center" : ""
2649
2671
  );
2650
- function h(N) {
2651
- N.key === "Escape" && v();
2672
+ function h(y) {
2673
+ y.key === "Escape" && v();
2652
2674
  }
2653
2675
  s && (!Ze(s) || s.type === Qe) && console.warn(
2654
2676
  `Tooltip:children 必须是单个合法元素/组件(不能是纯文本、Fragment 或多个子节点),已回退为默认触发器${a ? `(文案:"${a}")` : "——但没有传 triggerLabel,会渲染成一个看不出用途的空文案按钮"}。`
2655
2677
  );
2656
2678
  const x = s && Ze(s) && s.type !== Qe ? Tt(s, {
2657
- "aria-describedby": k,
2658
- onFocus: (N) => {
2659
- s.props.onFocus?.(N), y();
2679
+ "aria-describedby": w,
2680
+ onFocus: (y) => {
2681
+ s.props.onFocus?.(y), N();
2660
2682
  },
2661
- onBlur: (N) => {
2662
- s.props.onBlur?.(N), v();
2683
+ onBlur: (y) => {
2684
+ s.props.onBlur?.(y), v();
2663
2685
  },
2664
- onKeyDown: (N) => {
2665
- s.props.onKeyDown?.(N), h(N);
2686
+ onKeyDown: (y) => {
2687
+ s.props.onKeyDown?.(y), h(y);
2666
2688
  }
2667
2689
  }) : /* @__PURE__ */ e(
2668
2690
  "button",
2669
2691
  {
2670
2692
  type: "button",
2671
2693
  className: "q1-tooltip__trigger",
2672
- "aria-describedby": k,
2673
- onFocus: y,
2694
+ "aria-describedby": w,
2695
+ onFocus: N,
2674
2696
  onBlur: v,
2675
2697
  onKeyDown: h,
2676
2698
  children: a
2677
2699
  }
2678
2700
  );
2679
- return /* @__PURE__ */ i("span", { ref: m, className: "q1-tooltip", onMouseEnter: y, onMouseLeave: v, children: [
2701
+ return /* @__PURE__ */ i("span", { ref: m, className: "q1-tooltip", onMouseEnter: N, onMouseLeave: v, children: [
2680
2702
  x,
2681
2703
  dt(
2682
- /* @__PURE__ */ e("span", { ref: g, role: "tooltip", id: k, className: C, style: D, children: t }),
2704
+ /* @__PURE__ */ e("span", { ref: g, role: "tooltip", id: w, className: C, style: D, children: t }),
2683
2705
  document.body
2684
2706
  )
2685
2707
  ] });
@@ -2709,7 +2731,7 @@ function Fa({
2709
2731
  align: l = "start",
2710
2732
  children: o
2711
2733
  }) {
2712
- const [u, d] = I(!1), p = T(
2734
+ const [u, d] = A(!1), p = T(
2713
2735
  "context-card-wrap",
2714
2736
  `context-card-wrap--${s}`,
2715
2737
  l !== "start" ? `context-card-wrap--align-${l}` : "",
@@ -2769,13 +2791,13 @@ function Ka({
2769
2791
  ...a ? { "--book-band": a } : null,
2770
2792
  ...s ? { "--book-text": s } : null,
2771
2793
  ...m ? { "--book-width": m } : null
2772
- }, k = l ? /* @__PURE__ */ e("span", { className: "book__icon", "aria-hidden": "true", children: l }) : null;
2794
+ }, w = l ? /* @__PURE__ */ e("span", { className: "book__icon", "aria-hidden": "true", children: l }) : null;
2773
2795
  return /* @__PURE__ */ e("div", { className: _, style: g, ...f, children: /* @__PURE__ */ i("div", { className: "book__inner", children: [
2774
2796
  /* @__PURE__ */ i("div", { className: "book__cover", children: [
2775
2797
  o ? /* @__PURE__ */ e("span", { className: "book__illustration", "aria-hidden": "true", children: o }) : null,
2776
- n === "stripe" && !o ? /* @__PURE__ */ e("span", { className: "book__band", "aria-hidden": "true", children: k }) : null,
2798
+ n === "stripe" && !o ? /* @__PURE__ */ e("span", { className: "book__band", "aria-hidden": "true", children: w }) : null,
2777
2799
  /* @__PURE__ */ i("span", { className: "book__label", children: [
2778
- n === "simple" || o ? k : null,
2800
+ n === "simple" || o ? w : null,
2779
2801
  /* @__PURE__ */ e("span", { className: "book__title", children: t })
2780
2802
  ] }),
2781
2803
  /* @__PURE__ */ e("span", { className: "book__gutter", "aria-hidden": "true" })
@@ -2799,8 +2821,8 @@ function fn({ className: t } = {}) {
2799
2821
  ] });
2800
2822
  }
2801
2823
  function _n({ address: t, className: n }) {
2802
- const r = t.lastIndexOf("/"), a = r > 0 ? t.slice(0, r) : t, s = r > 0 ? t.slice(r) : "", [l, o] = I(!1), u = q(void 0);
2803
- P(() => () => clearTimeout(u.current), []);
2824
+ const r = t.lastIndexOf("/"), a = r > 0 ? t.slice(0, r) : t, s = r > 0 ? t.slice(r) : "", [l, o] = A(!1), u = q(void 0);
2825
+ O(() => () => clearTimeout(u.current), []);
2804
2826
  const d = async () => {
2805
2827
  try {
2806
2828
  await gt(t), o(!0), clearTimeout(u.current), u.current = setTimeout(() => o(!1), 1500);
@@ -2812,7 +2834,7 @@ function _n({ address: t, className: n }) {
2812
2834
  /* @__PURE__ */ e("span", { className: "browser__url-head", children: a }),
2813
2835
  s ? /* @__PURE__ */ e("span", { className: "browser__url-tail", children: s }) : null
2814
2836
  ] }),
2815
- /* @__PURE__ */ e("button", { type: "button", className: "browser__address-copy", onClick: d, "aria-label": "复制网址", children: l ? /* @__PURE__ */ e(ie, { className: "browser__address-icon", size: 12, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(we, { className: "browser__address-icon", size: 12, strokeWidth: 2, "aria-hidden": "true" }) }),
2837
+ /* @__PURE__ */ e("button", { type: "button", className: "browser__address-copy", onClick: d, "aria-label": "复制网址", children: l ? /* @__PURE__ */ e(ce, { className: "browser__address-icon", size: 12, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(we, { className: "browser__address-icon", size: 12, strokeWidth: 2, "aria-hidden": "true" }) }),
2816
2838
  /* @__PURE__ */ e("span", { className: "q1-sr-only", role: "status", "aria-live": "polite", children: l ? "已复制网址" : "" })
2817
2839
  ] });
2818
2840
  }
@@ -2849,8 +2871,8 @@ const Et = (t) => t !== void 0 && Number.isFinite(t) && t > 0 ? t : void 0, Mt =
2849
2871
  return n ? new RegExp("\\p{Script=Han}", "u").test(n[0]) ? n[0] : n.split(/\s+/).slice(0, 2).map((r) => r[0]).join("").toUpperCase() : "";
2850
2872
  };
2851
2873
  function yn({ title: t, src: n, letter: r, glyph: a, placeholder: s = !1, icon: l, iconColor: o, size: u, className: d }) {
2852
- const [p, c] = I(null), f = Et(u), _ = !!n && p !== n, m = t.trim() || "头像", g = r ? { variant: "avatar--letter", node: r } : a ? { variant: "avatar--glyph", node: a } : { variant: "avatar--letter", node: gn(t) }, k = s ? "avatar--placeholder" : _ ? "avatar--image" : g.variant, b = s ? { "aria-hidden": !0 } : _ ? {} : { role: "img", "aria-label": m };
2853
- return /* @__PURE__ */ i("span", { className: T("avatar", k, d), style: Mt(f), ...b, children: [
2874
+ const [p, c] = A(null), f = Et(u), _ = !!n && p !== n, m = t.trim() || "头像", g = r ? { variant: "avatar--letter", node: r } : a ? { variant: "avatar--glyph", node: a } : { variant: "avatar--letter", node: gn(t) }, w = s ? "avatar--placeholder" : _ ? "avatar--image" : g.variant, b = s ? { "aria-hidden": !0 } : _ ? {} : { role: "img", "aria-label": m };
2875
+ return /* @__PURE__ */ i("span", { className: T("avatar", w, d), style: Mt(f), ...b, children: [
2854
2876
  _ ? /* @__PURE__ */ e(
2855
2877
  "img",
2856
2878
  {
@@ -2882,11 +2904,11 @@ function Ba({
2882
2904
  reverse: l = !1,
2883
2905
  className: o
2884
2906
  }) {
2885
- const u = Et(r), d = u ?? 32, p = a !== void 0 && Number.isFinite(a) && a >= 0 ? Math.floor(a) : void 0, c = p !== void 0 && t.length > p ? t.slice(0, p) : t, f = t.length - c.length, _ = c.length + (f > 0 ? 1 : 0), m = s !== "auto" && Number.isFinite(s) ? Math.max(0, s) : Math.round(d * 0.3), g = { ...Mt(u), "--q1-avatar-overlap": `${m}px` }, k = (y) => l ? void 0 : _ - 1 - y, b = n ? { role: "group", "aria-label": n } : {};
2907
+ const u = Et(r), d = u ?? 32, p = a !== void 0 && Number.isFinite(a) && a >= 0 ? Math.floor(a) : void 0, c = p !== void 0 && t.length > p ? t.slice(0, p) : t, f = t.length - c.length, _ = c.length + (f > 0 ? 1 : 0), m = s !== "auto" && Number.isFinite(s) ? Math.max(0, s) : Math.round(d * 0.3), g = { ...Mt(u), "--q1-avatar-overlap": `${m}px` }, w = (N) => l ? void 0 : _ - 1 - N, b = n ? { role: "group", "aria-label": n } : {};
2886
2908
  return /* @__PURE__ */ i("span", { className: T("avatar-group", o), style: g, ...b, children: [
2887
- c.map((y, v) => (
2909
+ c.map((N, v) => (
2888
2910
  // 成员不再 aria-hidden——每个 Avatar 自带 aria-label(名字),读屏逐个念。
2889
- /* @__PURE__ */ e("span", { className: "avatar-group__item", style: { zIndex: k(v) }, children: /* @__PURE__ */ e(yn, { ...y, size: u }) }, `${y.title}-${v}`)
2911
+ /* @__PURE__ */ e("span", { className: "avatar-group__item", style: { zIndex: w(v) }, children: /* @__PURE__ */ e(yn, { ...N, size: u }) }, `${N.title}-${v}`)
2890
2912
  )),
2891
2913
  f > 0 ? (
2892
2914
  // +N 独立可访问名「还有 N 位成员」,不再 aria-hidden。
@@ -2894,7 +2916,7 @@ function Ba({
2894
2916
  "span",
2895
2917
  {
2896
2918
  className: "avatar avatar--overflow avatar-group__item",
2897
- style: { zIndex: k(c.length) },
2919
+ style: { zIndex: w(c.length) },
2898
2920
  role: "img",
2899
2921
  "aria-label": `还有 ${f} 位成员`,
2900
2922
  children: [
@@ -2913,7 +2935,7 @@ function Ha({
2913
2935
  className: a,
2914
2936
  children: s
2915
2937
  }) {
2916
- if (s && r) return /* @__PURE__ */ e(J, { children: s });
2938
+ if (s && r) return /* @__PURE__ */ e(ee, { children: s });
2917
2939
  const l = T(
2918
2940
  "skeleton",
2919
2941
  `skeleton--${t}`,
@@ -3012,7 +3034,7 @@ function Ya({
3012
3034
  className: "twc__copy",
3013
3035
  "aria-label": `复制${t}`,
3014
3036
  onClick: () => l(o, r),
3015
- children: s ? /* @__PURE__ */ e(ie, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(we, { size: 14, strokeWidth: 2, "aria-hidden": "true" })
3037
+ children: s ? /* @__PURE__ */ e(ce, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(we, { size: 14, strokeWidth: 2, "aria-hidden": "true" })
3016
3038
  }
3017
3039
  )
3018
3040
  ] });
@@ -3044,7 +3066,7 @@ function Xa({
3044
3066
  u(s ?? d.join(`
3045
3067
  `), "已复制命令"), l?.();
3046
3068
  },
3047
- children: o ? /* @__PURE__ */ e(ie, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(we, { size: 14, strokeWidth: 2, "aria-hidden": "true" })
3069
+ children: o ? /* @__PURE__ */ e(ce, { size: 14, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(we, { size: 14, strokeWidth: 2, "aria-hidden": "true" })
3048
3070
  }
3049
3071
  )
3050
3072
  ] });
@@ -3077,7 +3099,7 @@ function Za({
3077
3099
  label: l,
3078
3100
  indeterminate: o = !1
3079
3101
  }) {
3080
- const { boxPx: u, radius: d, strokeWidth: p, valueFontSize: c } = vn[n], f = 2 * Math.PI * d, _ = Math.min(100, Math.max(0, t ?? 0)), m = 50, g = o ? 25 : _, k = o ? 0 : Cn(_, p, f), b = o ? 0 : Math.max(0, 100 - _ - k), y = -90 + (g + k / 2) / 100 * 360, v = o ? "primary" : Dn(_, s, a);
3102
+ const { boxPx: u, radius: d, strokeWidth: p, valueFontSize: c } = vn[n], f = 2 * Math.PI * d, _ = Math.min(100, Math.max(0, t ?? 0)), m = 50, g = o ? 25 : _, w = o ? 0 : Cn(_, p, f), b = o ? 0 : Math.max(0, 100 - _ - w), N = -90 + (g + w / 2) / 100 * 360, v = o ? "primary" : Dn(_, s, a);
3081
3103
  return /* @__PURE__ */ i(
3082
3104
  "span",
3083
3105
  {
@@ -3100,7 +3122,7 @@ function Za({
3100
3122
  fill: "none",
3101
3123
  strokeLinecap: "round",
3102
3124
  strokeDasharray: `${b / 100 * f} ${f}`,
3103
- transform: `rotate(${y} ${m} ${m})`
3125
+ transform: `rotate(${N} ${m} ${m})`
3104
3126
  }
3105
3127
  ),
3106
3128
  /* @__PURE__ */ e(
@@ -3220,7 +3242,7 @@ function er({ previous: t, next: n }) {
3220
3242
  /* @__PURE__ */ e("span", { className: "pagination__label", children: "下一页" }),
3221
3243
  /* @__PURE__ */ i("span", { className: "pagination__title-frame", children: [
3222
3244
  /* @__PURE__ */ e("span", { className: "pagination__title", children: n.title }),
3223
- /* @__PURE__ */ e("span", { className: "pagination__chevron-slot", "aria-hidden": "true", children: /* @__PURE__ */ e(ue, { className: "pagination__chevron", size: 20, strokeWidth: 2 }) })
3245
+ /* @__PURE__ */ e("span", { className: "pagination__chevron-slot", "aria-hidden": "true", children: /* @__PURE__ */ e(me, { className: "pagination__chevron", size: 20, strokeWidth: 2 }) })
3224
3246
  ] })
3225
3247
  ]
3226
3248
  }
@@ -3233,7 +3255,7 @@ function tr({
3233
3255
  noBorder: r,
3234
3256
  initialExpanded: a = !1
3235
3257
  }) {
3236
- const [s, l] = I(a), o = K(), u = s ? t : t.slice(0, n), d = t.length - n;
3258
+ const [s, l] = A(a), o = P(), u = s ? t : t.slice(0, n), d = t.length - n;
3237
3259
  return /* @__PURE__ */ i("div", { className: "show-more", children: [
3238
3260
  /* @__PURE__ */ e("ul", { className: "show-more__list", id: o, children: u.map((p) => /* @__PURE__ */ e("li", { className: "show-more__row", children: p }, p)) }),
3239
3261
  d > 0 ? /* @__PURE__ */ e("div", { className: `show-more__trigger-row${r ? " show-more__trigger-row--no-border" : ""}`, children: /* @__PURE__ */ i(
@@ -3389,8 +3411,8 @@ function Ke(t) {
3389
3411
  a && s && a.setAttribute("content", s);
3390
3412
  }
3391
3413
  function An() {
3392
- const [t, n] = I(lt);
3393
- return P(() => {
3414
+ const [t, n] = A(lt);
3415
+ return O(() => {
3394
3416
  Ke(t);
3395
3417
  const a = window.matchMedia("(prefers-color-scheme: dark)"), s = () => t === "system" && Ke("system"), l = () => n(lt());
3396
3418
  return a.addEventListener("change", s), window.addEventListener(Fe, l), window.addEventListener("storage", l), () => {
@@ -3406,7 +3428,7 @@ const Sn = [
3406
3428
  { mode: "dark", label: "深色", Icon: Yt }
3407
3429
  ];
3408
3430
  function or({ small: t, disabled: n }) {
3409
- const r = K(), [a, s] = An();
3431
+ const r = P(), [a, s] = An();
3410
3432
  return /* @__PURE__ */ i(
3411
3433
  "fieldset",
3412
3434
  {
@@ -3450,14 +3472,14 @@ function cr({
3450
3472
  function o(u) {
3451
3473
  const d = s.current;
3452
3474
  if (!d) return;
3453
- const p = Array.from(d.children), c = l ? d.scrollLeft : d.scrollTop, f = l ? d.clientWidth : d.clientHeight, _ = c + (u === 1 ? f : 0), m = (D) => l ? D.offsetLeft : D.offsetTop, g = (D) => l ? D.offsetLeft + D.offsetWidth : D.offsetTop + D.offsetHeight, k = u === 1 ? p.find((D) => g(D) > _ + 1) : [...p].reverse().find((D) => m(D) < c - 1);
3454
- if (!k) return;
3475
+ const p = Array.from(d.children), c = l ? d.scrollLeft : d.scrollTop, f = l ? d.clientWidth : d.clientHeight, _ = c + (u === 1 ? f : 0), m = (D) => l ? D.offsetLeft : D.offsetTop, g = (D) => l ? D.offsetLeft + D.offsetWidth : D.offsetTop + D.offsetHeight, w = u === 1 ? p.find((D) => g(D) > _ + 1) : [...p].reverse().find((D) => m(D) < c - 1);
3476
+ if (!w) return;
3455
3477
  const b = qt() ? "auto" : "smooth";
3456
3478
  if (l) {
3457
- k.scrollIntoView({ behavior: b, inline: "start", block: "nearest" });
3479
+ w.scrollIntoView({ behavior: b, inline: "start", block: "nearest" });
3458
3480
  return;
3459
3481
  }
3460
- const y = parseFloat(getComputedStyle(d).paddingTop) || 0, v = k.getBoundingClientRect().top - d.getBoundingClientRect().top - y;
3482
+ const N = parseFloat(getComputedStyle(d).paddingTop) || 0, v = w.getBoundingClientRect().top - d.getBoundingClientRect().top - N;
3461
3483
  d.scrollTo({ top: d.scrollTop + v, behavior: b });
3462
3484
  }
3463
3485
  return /* @__PURE__ */ i("div", { className: l ? "scroller-buttons" : "scroller-buttons scroller-buttons--vertical", children: [
@@ -3479,13 +3501,13 @@ function cr({
3479
3501
  className: "scroller-buttons__control",
3480
3502
  "aria-label": `${l ? "向右滚动" : "向下滚动"}${n}`,
3481
3503
  onClick: () => o(1),
3482
- children: l ? /* @__PURE__ */ e(ue, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(ae, { size: 16, strokeWidth: 2, "aria-hidden": "true" })
3504
+ children: l ? /* @__PURE__ */ e(me, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) : /* @__PURE__ */ e(ae, { size: 16, strokeWidth: 2, "aria-hidden": "true" })
3483
3505
  }
3484
3506
  )
3485
3507
  ] });
3486
3508
  }
3487
3509
  function dr({ label: t, unit: n, min: r = 0, max: a = 100, step: s = 1, defaultValue: l }) {
3488
- const [o, u] = I(l), d = K(), p = (o - r) / (a - r) * 100;
3510
+ const [o, u] = A(l), d = P(), p = (o - r) / (a - r) * 100;
3489
3511
  return /* @__PURE__ */ i("div", { className: "slider-field", children: [
3490
3512
  /* @__PURE__ */ i("div", { className: "slider-field__head", children: [
3491
3513
  /* @__PURE__ */ e("label", { className: "slider-field__label", htmlFor: d, children: t }),
@@ -3511,7 +3533,7 @@ function dr({ label: t, unit: n, min: r = 0, max: a = 100, step: s = 1, defaultV
3511
3533
  ] });
3512
3534
  }
3513
3535
  function ur({ min: t = 0, max: n = 100, step: r = 1, defaultLow: a, defaultHigh: s, disabled: l }) {
3514
- const [o, u] = I(a), [d, p] = I(s), c = K(), f = K(), _ = (o - t) / (n - t) * 100, m = (d - t) / (n - t) * 100, g = (b) => u(Math.min(b, d)), k = (b) => p(Math.max(b, o));
3536
+ const [o, u] = A(a), [d, p] = A(s), c = P(), f = P(), _ = (o - t) / (n - t) * 100, m = (d - t) / (n - t) * 100, g = (b) => u(Math.min(b, d)), w = (b) => p(Math.max(b, o));
3515
3537
  return /* @__PURE__ */ i("div", { className: `range-slider${l ? " range-slider--disabled" : ""}`, children: [
3516
3538
  /* @__PURE__ */ e("label", { className: "q1-sr-only", htmlFor: c, children: "区间下限" }),
3517
3539
  /* @__PURE__ */ e(
@@ -3556,7 +3578,7 @@ function ur({ min: t = 0, max: n = 100, step: r = 1, defaultLow: a, defaultHigh:
3556
3578
  step: r,
3557
3579
  value: d,
3558
3580
  disabled: l,
3559
- onChange: (b) => k(Number(b.target.value))
3581
+ onChange: (b) => w(Number(b.target.value))
3560
3582
  }
3561
3583
  )
3562
3584
  ] }),
@@ -3572,20 +3594,20 @@ function ur({ min: t = 0, max: n = 100, step: r = 1, defaultLow: a, defaultHigh:
3572
3594
  step: r,
3573
3595
  value: d,
3574
3596
  disabled: l,
3575
- onChange: (b) => k(Number(b.target.value))
3597
+ onChange: (b) => w(Number(b.target.value))
3576
3598
  }
3577
3599
  )
3578
3600
  ] });
3579
3601
  }
3580
3602
  function Ee({ crumb: t }) {
3581
- const n = /* @__PURE__ */ i(J, { children: [
3603
+ const n = /* @__PURE__ */ i(ee, { children: [
3582
3604
  t.icon ? /* @__PURE__ */ e("span", { className: "breadcrumb__icon", "aria-hidden": "true", children: t.icon }) : null,
3583
3605
  t.label
3584
3606
  ] });
3585
3607
  return t.isCurrent ? /* @__PURE__ */ e("span", { className: "breadcrumb__link breadcrumb__link--current", "aria-current": "page", children: n }) : t.isDisabled ? /* @__PURE__ */ e("span", { className: "breadcrumb__link breadcrumb__link--disabled", "aria-disabled": "true", children: n }) : /* @__PURE__ */ e("a", { className: "breadcrumb__link", href: t.href ?? "#breadcrumb", children: n });
3586
3608
  }
3587
3609
  function Me() {
3588
- return /* @__PURE__ */ e(ue, { className: "breadcrumb__separator", "aria-hidden": "true", size: 16, strokeWidth: 2 });
3610
+ return /* @__PURE__ */ e(me, { className: "breadcrumb__separator", "aria-hidden": "true", size: 16, strokeWidth: 2 });
3589
3611
  }
3590
3612
  function mr({
3591
3613
  items: t,
@@ -3599,7 +3621,7 @@ function mr({
3599
3621
  ] }, s.label)) }) });
3600
3622
  }
3601
3623
  function hr({ items: t, label: n }) {
3602
- const [r, a] = I(!1), s = t[0], l = t[t.length - 1], o = t.slice(1, -1);
3624
+ const [r, a] = A(!1), s = t[0], l = t[t.length - 1], o = t.slice(1, -1);
3603
3625
  return /* @__PURE__ */ e("nav", { className: "breadcrumb", "aria-label": n, "data-expanded": r ? "true" : "false", children: /* @__PURE__ */ i("ol", { className: "breadcrumb__list", children: [
3604
3626
  /* @__PURE__ */ i("li", { className: "breadcrumb__item", children: [
3605
3627
  /* @__PURE__ */ e(Ee, { crumb: s }),
@@ -3627,8 +3649,8 @@ function hr({ items: t, label: n }) {
3627
3649
  ] }) });
3628
3650
  }
3629
3651
  function pr({ open: t, onClose: n, title: r, side: a = "right", children: s, footer: l }) {
3630
- const o = q(null), u = K();
3631
- if (P(() => {
3652
+ const o = q(null), u = P();
3653
+ if (O(() => {
3632
3654
  if (!t) return;
3633
3655
  const p = window.setTimeout(
3634
3656
  () => o.current?.querySelector("button, input, [tabindex]")?.focus(),
@@ -3648,7 +3670,7 @@ function pr({ open: t, onClose: n, title: r, side: a = "right", children: s, foo
3648
3670
  p.shiftKey && document.activeElement === f ? (p.preventDefault(), _.focus()) : !p.shiftKey && document.activeElement === _ && (p.preventDefault(), f.focus());
3649
3671
  }
3650
3672
  }
3651
- return /* @__PURE__ */ i(J, { children: [
3673
+ return /* @__PURE__ */ i(ee, { children: [
3652
3674
  /* @__PURE__ */ e("div", { className: "sheet__backdrop", "aria-hidden": "true", onMouseDown: (p) => p.preventDefault() }),
3653
3675
  /* @__PURE__ */ i(
3654
3676
  "div",
@@ -3672,11 +3694,11 @@ function pr({ open: t, onClose: n, title: r, side: a = "right", children: s, foo
3672
3694
  ] });
3673
3695
  }
3674
3696
  function fr({ label: t, entries: n, variant: r = "default", size: a = "md", align: s = "start", menuButtonLabel: l, icon: o }) {
3675
- const [u, d] = I(!1), [p, c] = I(-1), f = q(null), _ = q([]), m = q({ buffer: "", timer: 0 }), g = K(), k = n.map((h, x) => x);
3697
+ const [u, d] = A(!1), [p, c] = A(-1), f = q(null), _ = q([]), m = q({ buffer: "", timer: 0 }), g = P(), w = n.map((h, x) => x);
3676
3698
  function b(h) {
3677
3699
  c(h), _.current[h]?.focus();
3678
3700
  }
3679
- function y(h) {
3701
+ function N(h) {
3680
3702
  d(!0);
3681
3703
  const x = h === "first" ? 0 : n.length - 1;
3682
3704
  window.requestAnimationFrame(() => b(x));
@@ -3684,23 +3706,23 @@ function fr({ label: t, entries: n, variant: r = "default", size: a = "md", alig
3684
3706
  function v(h = !0) {
3685
3707
  d(!1), c(-1), h && f.current?.focus();
3686
3708
  }
3687
- P(() => {
3709
+ O(() => {
3688
3710
  if (!u) return;
3689
3711
  function h(x) {
3690
- const N = f.current?.closest(".split-button");
3691
- N && !N.contains(x.target) && v(!1);
3712
+ const y = f.current?.closest(".split-button");
3713
+ y && !y.contains(x.target) && v(!1);
3692
3714
  }
3693
3715
  return document.addEventListener("mousedown", h), () => document.removeEventListener("mousedown", h);
3694
3716
  }, [u]);
3695
3717
  function D(h) {
3696
- h.key === "ArrowDown" || h.key === "Enter" || h.key === " " ? (h.preventDefault(), y("first")) : h.key === "ArrowUp" && (h.preventDefault(), y("last"));
3718
+ h.key === "ArrowDown" || h.key === "Enter" || h.key === " " ? (h.preventDefault(), N("first")) : h.key === "ArrowUp" && (h.preventDefault(), N("last"));
3697
3719
  }
3698
3720
  function C(h) {
3699
- const x = k.indexOf(p);
3721
+ const x = w.indexOf(p);
3700
3722
  if (h.key === "ArrowDown")
3701
- h.preventDefault(), b(k[(x + 1) % k.length]);
3723
+ h.preventDefault(), b(w[(x + 1) % w.length]);
3702
3724
  else if (h.key === "ArrowUp")
3703
- h.preventDefault(), b(k[(x - 1 + k.length) % k.length]);
3725
+ h.preventDefault(), b(w[(x - 1 + w.length) % w.length]);
3704
3726
  else if (h.key === "Home")
3705
3727
  h.preventDefault(), b(0);
3706
3728
  else if (h.key === "End")
@@ -3709,8 +3731,8 @@ function fr({ label: t, entries: n, variant: r = "default", size: a = "md", alig
3709
3731
  h.preventDefault(), v();
3710
3732
  else if (h.key.length === 1 && /\S/.test(h.key)) {
3711
3733
  window.clearTimeout(m.current.timer), m.current.buffer += h.key.toLowerCase(), m.current.timer = window.setTimeout(() => m.current.buffer = "", 500);
3712
- const N = k.find((w) => n[w].label.toLowerCase().startsWith(m.current.buffer));
3713
- N !== void 0 && b(N);
3734
+ const y = w.find((k) => n[k].label.toLowerCase().startsWith(m.current.buffer));
3735
+ y !== void 0 && b(y);
3714
3736
  }
3715
3737
  }
3716
3738
  return /* @__PURE__ */ i("div", { className: `split-button split-button--${r} split-button--${a}`, children: [
@@ -3728,7 +3750,7 @@ function fr({ label: t, entries: n, variant: r = "default", size: a = "md", alig
3728
3750
  "aria-haspopup": "menu",
3729
3751
  "aria-expanded": u,
3730
3752
  "aria-controls": u ? g : void 0,
3731
- onClick: () => u ? v() : y("first"),
3753
+ onClick: () => u ? v() : N("first"),
3732
3754
  onKeyDown: D,
3733
3755
  children: /* @__PURE__ */ e(ae, { size: a === "sm" ? 14 : 16, strokeWidth: 2, "aria-hidden": "true" })
3734
3756
  }
@@ -3744,8 +3766,8 @@ function fr({ label: t, entries: n, variant: r = "default", size: a = "md", alig
3744
3766
  children: n.map((h, x) => /* @__PURE__ */ i(
3745
3767
  "button",
3746
3768
  {
3747
- ref: (N) => {
3748
- _.current[x] = N;
3769
+ ref: (y) => {
3770
+ _.current[x] = y;
3749
3771
  },
3750
3772
  type: "button",
3751
3773
  role: "menuitem",
@@ -3765,20 +3787,20 @@ function fr({ label: t, entries: n, variant: r = "default", size: a = "md", alig
3765
3787
  }
3766
3788
  const Tn = (t) => t.type === "item" && !t.disabled && !t.locked || t.type === "link";
3767
3789
  function _r({ label: t, entries: n, withChevron: r, align: a = "start", triggerContent: s }) {
3768
- const [l, o] = I(!1), [u, d] = I({
3790
+ const [l, o] = A(!1), [u, d] = A({
3769
3791
  align: a,
3770
3792
  side: "bottom"
3771
- }), p = q(null), c = q(null), f = K();
3793
+ }), p = q(null), c = q(null), f = P();
3772
3794
  fe(() => {
3773
3795
  if (!l) return;
3774
3796
  function C() {
3775
- const N = p.current, w = c.current;
3776
- if (!N || !w) return;
3777
- const E = N.getBoundingClientRect(), A = w.getBoundingClientRect();
3797
+ const y = p.current, k = c.current;
3798
+ if (!y || !k) return;
3799
+ const $ = y.getBoundingClientRect(), I = k.getBoundingClientRect();
3778
3800
  let S = a;
3779
- a === "start" && E.left + A.width > window.innerWidth ? S = "end" : a === "end" && E.right - A.width < 0 && (S = "start");
3780
- const W = E.bottom + A.height > window.innerHeight ? "top" : "bottom";
3781
- d({ align: S, side: W });
3801
+ a === "start" && $.left + I.width > window.innerWidth ? S = "end" : a === "end" && $.right - I.width < 0 && (S = "start");
3802
+ const L = $.bottom + I.height > window.innerHeight ? "top" : "bottom";
3803
+ d({ align: S, side: L });
3782
3804
  }
3783
3805
  let h = 0;
3784
3806
  function x() {
@@ -3790,7 +3812,7 @@ function _r({ label: t, entries: n, withChevron: r, align: a = "start", triggerC
3790
3812
  window.removeEventListener("resize", x), h && window.cancelAnimationFrame(h);
3791
3813
  };
3792
3814
  }, [l, a]);
3793
- const _ = n.flatMap((C, h) => Tn(C) ? [h] : []), { itemRefs: m, focusItem: g, reset: k, onMenuKeyDown: b } = Te({
3815
+ const _ = n.flatMap((C, h) => Tn(C) ? [h] : []), { itemRefs: m, focusItem: g, reset: w, onMenuKeyDown: b } = Te({
3794
3816
  focusableIndices: _,
3795
3817
  getText: (C) => {
3796
3818
  const h = n[C];
@@ -3798,15 +3820,15 @@ function _r({ label: t, entries: n, withChevron: r, align: a = "start", triggerC
3798
3820
  },
3799
3821
  onClose: () => v()
3800
3822
  });
3801
- function y(C) {
3823
+ function N(C) {
3802
3824
  o(!0);
3803
3825
  const h = C === "first" ? _[0] : _[_.length - 1];
3804
3826
  window.requestAnimationFrame(() => g(h));
3805
3827
  }
3806
3828
  function v(C = !0) {
3807
- o(!1), k(), d({ align: a, side: "bottom" }), C && p.current?.focus();
3829
+ o(!1), w(), d({ align: a, side: "bottom" }), C && p.current?.focus();
3808
3830
  }
3809
- P(() => {
3831
+ O(() => {
3810
3832
  if (!l) return;
3811
3833
  function C(h) {
3812
3834
  const x = m.current[0]?.closest(".menu");
@@ -3815,7 +3837,7 @@ function _r({ label: t, entries: n, withChevron: r, align: a = "start", triggerC
3815
3837
  return document.addEventListener("mousedown", C), () => document.removeEventListener("mousedown", C);
3816
3838
  }, [l]);
3817
3839
  function D(C) {
3818
- C.key === "ArrowDown" || C.key === "Enter" || C.key === " " ? (C.preventDefault(), y("first")) : C.key === "ArrowUp" && (C.preventDefault(), y("last"));
3840
+ C.key === "ArrowDown" || C.key === "Enter" || C.key === " " ? (C.preventDefault(), N("first")) : C.key === "ArrowUp" && (C.preventDefault(), N("last"));
3819
3841
  }
3820
3842
  return /* @__PURE__ */ i("div", { className: "menu", children: [
3821
3843
  /* @__PURE__ */ i(
@@ -3828,7 +3850,7 @@ function _r({ label: t, entries: n, withChevron: r, align: a = "start", triggerC
3828
3850
  "aria-expanded": l,
3829
3851
  "aria-controls": l ? f : void 0,
3830
3852
  "aria-label": s ? t : void 0,
3831
- onClick: () => l ? v() : y("first"),
3853
+ onClick: () => l ? v() : N("first"),
3832
3854
  onKeyDown: D,
3833
3855
  children: [
3834
3856
  s ?? t,
@@ -3854,15 +3876,15 @@ function _r({ label: t, entries: n, withChevron: r, align: a = "start", triggerC
3854
3876
  return /* @__PURE__ */ i(
3855
3877
  "a",
3856
3878
  {
3857
- ref: (w) => {
3858
- m.current[h] = w;
3879
+ ref: (k) => {
3880
+ m.current[h] = k;
3859
3881
  },
3860
3882
  role: "menuitem",
3861
3883
  tabIndex: -1,
3862
3884
  href: C.href,
3863
3885
  className: "menu__item",
3864
- onClick: (w) => {
3865
- w.preventDefault(), v();
3886
+ onClick: (k) => {
3887
+ k.preventDefault(), v();
3866
3888
  },
3867
3889
  children: [
3868
3890
  C.icon ? /* @__PURE__ */ e("span", { className: "menu__item-icon", children: C.icon }) : null,
@@ -3872,12 +3894,12 @@ function _r({ label: t, entries: n, withChevron: r, align: a = "start", triggerC
3872
3894
  },
3873
3895
  C.label
3874
3896
  );
3875
- const x = !C.disabled && !C.locked, N = C.suffix ?? (C.locked ? /* @__PURE__ */ e(Ut, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) : null);
3897
+ const x = !C.disabled && !C.locked, y = C.suffix ?? (C.locked ? /* @__PURE__ */ e(Ut, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) : null);
3876
3898
  return /* @__PURE__ */ i(
3877
3899
  "button",
3878
3900
  {
3879
- ref: (w) => {
3880
- m.current[h] = w;
3901
+ ref: (k) => {
3902
+ m.current[h] = k;
3881
3903
  },
3882
3904
  type: "button",
3883
3905
  role: "menuitem",
@@ -3889,7 +3911,7 @@ function _r({ label: t, entries: n, withChevron: r, align: a = "start", triggerC
3889
3911
  children: [
3890
3912
  C.icon ? /* @__PURE__ */ e("span", { className: "menu__item-icon", children: C.icon }) : null,
3891
3913
  /* @__PURE__ */ e("span", { className: "menu__item-label", children: C.label }),
3892
- N ? /* @__PURE__ */ e("span", { className: "menu__item-suffix", children: N }) : null
3914
+ y ? /* @__PURE__ */ e("span", { className: "menu__item-suffix", children: y }) : null
3893
3915
  ]
3894
3916
  },
3895
3917
  C.label
@@ -3900,44 +3922,44 @@ function _r({ label: t, entries: n, withChevron: r, align: a = "start", triggerC
3900
3922
  ] });
3901
3923
  }
3902
3924
  function br({ options: t, defaultSelected: n = [], placeholder: r, onChange: a }) {
3903
- const [s, l] = I(!1), [o, u] = I(n), [d, p] = I({ row: 0, col: 0 }), c = q(null), f = q(null), _ = q([]);
3904
- function m(w) {
3905
- u(w), a?.(w);
3925
+ const [s, l] = A(!1), [o, u] = A(n), [d, p] = A({ row: 0, col: 0 }), c = q(null), f = q(null), _ = q([]);
3926
+ function m(k) {
3927
+ u(k), a?.(k);
3906
3928
  }
3907
- const g = (w) => o.includes(w);
3908
- function k(w) {
3909
- m(g(w) ? o.filter((E) => E !== w) : [...o, w]);
3929
+ const g = (k) => o.includes(k);
3930
+ function w(k) {
3931
+ m(g(k) ? o.filter(($) => $ !== k) : [...o, k]);
3910
3932
  }
3911
- function b(w) {
3912
- m([w]);
3933
+ function b(k) {
3934
+ m([k]);
3913
3935
  }
3914
- function y() {
3936
+ function N() {
3915
3937
  m([...t]);
3916
3938
  }
3917
- function v(w) {
3918
- return g(w) ? o.length === t.length ? { label: "仅选此项", run: () => b(w) } : { label: "全选", run: () => y() } : o.length === 0 ? { label: "勾选", run: () => k(w) } : { label: "仅选此项", run: () => b(w) };
3939
+ function v(k) {
3940
+ return g(k) ? o.length === t.length ? { label: "仅选此项", run: () => b(k) } : { label: "全选", run: () => N() } : o.length === 0 ? { label: "勾选", run: () => w(k) } : { label: "仅选此项", run: () => b(k) };
3919
3941
  }
3920
- function D(w, E) {
3921
- p({ row: w, col: E }), window.requestAnimationFrame(() => _.current[w]?.[E]?.focus());
3942
+ function D(k, $) {
3943
+ p({ row: k, col: $ }), window.requestAnimationFrame(() => _.current[k]?.[$]?.focus());
3922
3944
  }
3923
3945
  function C() {
3924
3946
  l(!0), window.requestAnimationFrame(() => D(0, 0));
3925
3947
  }
3926
- function h(w = !0) {
3927
- l(!1), w && f.current?.focus();
3948
+ function h(k = !0) {
3949
+ l(!1), k && f.current?.focus();
3928
3950
  }
3929
- P(() => {
3951
+ O(() => {
3930
3952
  if (!s) return;
3931
- function w(E) {
3932
- c.current && !c.current.contains(E.target) && h(!1);
3953
+ function k($) {
3954
+ c.current && !c.current.contains($.target) && h(!1);
3933
3955
  }
3934
- return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
3956
+ return document.addEventListener("mousedown", k), () => document.removeEventListener("mousedown", k);
3935
3957
  }, [s]);
3936
- function x(w) {
3937
- const { row: E, col: A } = d;
3938
- w.key === "ArrowDown" ? (w.preventDefault(), D(Math.min(E + 1, t.length - 1), A)) : w.key === "ArrowUp" ? (w.preventDefault(), D(Math.max(E - 1, 0), A)) : w.key === "ArrowRight" ? (w.preventDefault(), D(E, 1)) : w.key === "ArrowLeft" ? (w.preventDefault(), D(E, 0)) : w.key === "Home" ? (w.preventDefault(), D(0, A)) : w.key === "End" ? (w.preventDefault(), D(t.length - 1, A)) : w.key === "Escape" && (w.preventDefault(), h());
3958
+ function x(k) {
3959
+ const { row: $, col: I } = d;
3960
+ k.key === "ArrowDown" ? (k.preventDefault(), D(Math.min($ + 1, t.length - 1), I)) : k.key === "ArrowUp" ? (k.preventDefault(), D(Math.max($ - 1, 0), I)) : k.key === "ArrowRight" ? (k.preventDefault(), D($, 1)) : k.key === "ArrowLeft" ? (k.preventDefault(), D($, 0)) : k.key === "Home" ? (k.preventDefault(), D(0, I)) : k.key === "End" ? (k.preventDefault(), D(t.length - 1, I)) : k.key === "Escape" && (k.preventDefault(), h());
3939
3961
  }
3940
- const N = o.length === 0 ? r : o.length === 1 ? o[0] : `已选 ${o.length} 项`;
3962
+ const y = o.length === 0 ? r : o.length === 1 ? o[0] : `已选 ${o.length} 项`;
3941
3963
  return /* @__PURE__ */ i("div", { className: "multi-select", ref: c, children: [
3942
3964
  /* @__PURE__ */ i(
3943
3965
  "button",
@@ -3949,7 +3971,7 @@ function br({ options: t, defaultSelected: n = [], placeholder: r, onChange: a }
3949
3971
  "aria-expanded": s,
3950
3972
  onClick: () => s ? h() : C(),
3951
3973
  children: [
3952
- /* @__PURE__ */ e("span", { className: o.length === 0 ? "multi-select__placeholder" : void 0, children: N }),
3974
+ /* @__PURE__ */ e("span", { className: o.length === 0 ? "multi-select__placeholder" : void 0, children: y }),
3953
3975
  /* @__PURE__ */ e(ae, { size: 16, strokeWidth: 2, "aria-hidden": "true" })
3954
3976
  ]
3955
3977
  }
@@ -3961,7 +3983,7 @@ function br({ options: t, defaultSelected: n = [], placeholder: r, onChange: a }
3961
3983
  {
3962
3984
  type: "button",
3963
3985
  className: "multi-select__bulk-button",
3964
- onClick: () => o.length === t.length ? m([]) : y(),
3986
+ onClick: () => o.length === t.length ? m([]) : N(),
3965
3987
  children: o.length === t.length ? "全部清除" : "全选"
3966
3988
  }
3967
3989
  ),
@@ -3971,53 +3993,53 @@ function br({ options: t, defaultSelected: n = [], placeholder: r, onChange: a }
3971
3993
  t.length
3972
3994
  ] })
3973
3995
  ] }),
3974
- t.map((w, E) => {
3975
- _.current[E] = _.current[E] ?? [];
3976
- const A = g(w), S = v(w);
3996
+ t.map((k, $) => {
3997
+ _.current[$] = _.current[$] ?? [];
3998
+ const I = g(k), S = v(k);
3977
3999
  return /* @__PURE__ */ i("div", { className: "multi-select__row", role: "presentation", children: [
3978
4000
  /* @__PURE__ */ i(
3979
4001
  "button",
3980
4002
  {
3981
- ref: (W) => {
3982
- W && (_.current[E][0] = W);
4003
+ ref: (L) => {
4004
+ L && (_.current[$][0] = L);
3983
4005
  },
3984
4006
  type: "button",
3985
4007
  role: "option",
3986
- "aria-selected": A,
3987
- "aria-label": `选择 ${w}`,
3988
- tabIndex: d.row === E && d.col === 0 ? 0 : -1,
4008
+ "aria-selected": I,
4009
+ "aria-label": `选择 ${k}`,
4010
+ tabIndex: d.row === $ && d.col === 0 ? 0 : -1,
3989
4011
  className: "multi-select__option",
3990
- onFocus: () => p({ row: E, col: 0 }),
3991
- onClick: () => k(w),
4012
+ onFocus: () => p({ row: $, col: 0 }),
4013
+ onClick: () => w(k),
3992
4014
  children: [
3993
- /* @__PURE__ */ e("span", { className: `multi-select__check${A ? " multi-select__check--on" : ""}`, "aria-hidden": "true", children: A ? /* @__PURE__ */ e(ie, { size: 12, strokeWidth: 3 }) : null }),
3994
- /* @__PURE__ */ e("span", { className: "multi-select__option-label", children: w })
4015
+ /* @__PURE__ */ e("span", { className: `multi-select__check${I ? " multi-select__check--on" : ""}`, "aria-hidden": "true", children: I ? /* @__PURE__ */ e(ce, { size: 12, strokeWidth: 3 }) : null }),
4016
+ /* @__PURE__ */ e("span", { className: "multi-select__option-label", children: k })
3995
4017
  ]
3996
4018
  }
3997
4019
  ),
3998
4020
  /* @__PURE__ */ e(
3999
4021
  "button",
4000
4022
  {
4001
- ref: (W) => {
4002
- W && (_.current[E][1] = W);
4023
+ ref: (L) => {
4024
+ L && (_.current[$][1] = L);
4003
4025
  },
4004
4026
  type: "button",
4005
- "aria-label": `${S.label}:${w}`,
4006
- tabIndex: d.row === E && d.col === 1 ? 0 : -1,
4027
+ "aria-label": `${S.label}:${k}`,
4028
+ tabIndex: d.row === $ && d.col === 1 ? 0 : -1,
4007
4029
  className: "multi-select__only",
4008
- onFocus: () => p({ row: E, col: 1 }),
4030
+ onFocus: () => p({ row: $, col: 1 }),
4009
4031
  onClick: S.run,
4010
4032
  children: S.label
4011
4033
  }
4012
4034
  )
4013
- ] }, w);
4035
+ ] }, k);
4014
4036
  })
4015
4037
  ] }) : null
4016
4038
  ] });
4017
4039
  }
4018
4040
  function gr({ open: t, onClose: n, title: r, children: a, footer: s, initialFocusRef: l, dismissable: o = !0, sticky: u = !1 }) {
4019
- const d = q(null), p = K();
4020
- if (P(() => {
4041
+ const d = q(null), p = P();
4042
+ if (O(() => {
4021
4043
  if (!t) return;
4022
4044
  const f = document.body.style.overflow;
4023
4045
  document.body.style.overflow = "hidden";
@@ -4027,7 +4049,7 @@ function gr({ open: t, onClose: n, title: r, children: a, footer: s, initialFocu
4027
4049
  return () => {
4028
4050
  window.clearTimeout(_), document.body.style.overflow = f;
4029
4051
  };
4030
- }, [t, l]), P(() => {
4052
+ }, [t, l]), O(() => {
4031
4053
  if (!t || !o) return;
4032
4054
  function f(_) {
4033
4055
  _.key === "Escape" && (d.current?.contains(document.activeElement) || (_.preventDefault(), n()));
@@ -4040,8 +4062,8 @@ function gr({ open: t, onClose: n, title: r, children: a, footer: s, initialFocu
4040
4062
  else if (f.key === "Tab") {
4041
4063
  const _ = 'button:not([disabled]), input:not([disabled]), [tabindex="0"]', m = Array.from(d.current?.querySelectorAll(_) ?? []);
4042
4064
  if (m.length === 0) return;
4043
- const g = m[0], k = m[m.length - 1], b = document.querySelector(".q1-toast-region")?.lastElementChild, y = Array.from(b?.querySelectorAll(_) ?? []);
4044
- f.shiftKey && document.activeElement === g ? (f.preventDefault(), (y.length > 0 ? y[y.length - 1] : k).focus()) : !f.shiftKey && document.activeElement === k && (f.preventDefault(), (y.length > 0 ? y[0] : g).focus());
4065
+ const g = m[0], w = m[m.length - 1], b = document.querySelector(".q1-toast-region")?.lastElementChild, N = Array.from(b?.querySelectorAll(_) ?? []);
4066
+ f.shiftKey && document.activeElement === g ? (f.preventDefault(), (N.length > 0 ? N[N.length - 1] : w).focus()) : !f.shiftKey && document.activeElement === w && (f.preventDefault(), (N.length > 0 ? N[0] : g).focus());
4045
4067
  }
4046
4068
  }
4047
4069
  return /* @__PURE__ */ i("div", { className: "modal", onKeyDown: c, children: [
@@ -4076,11 +4098,11 @@ function yr({ children: t }) {
4076
4098
  return /* @__PURE__ */ e("div", { className: "modal__inset", children: t });
4077
4099
  }
4078
4100
  const zn = ["日", "一", "二", "三", "四", "五", "六"];
4079
- function F(t) {
4101
+ function K(t) {
4080
4102
  const n = String(t.getMonth() + 1).padStart(2, "0"), r = String(t.getDate()).padStart(2, "0");
4081
4103
  return `${t.getFullYear()}-${n}-${r}`;
4082
4104
  }
4083
- function de(t, n) {
4105
+ function ue(t, n) {
4084
4106
  return new Date(t.getFullYear(), t.getMonth(), t.getDate() + n);
4085
4107
  }
4086
4108
  function Pe(t, n) {
@@ -4090,23 +4112,23 @@ function je(t) {
4090
4112
  return new Date(t.getFullYear(), t.getMonth(), 1);
4091
4113
  }
4092
4114
  function ye(t, n) {
4093
- return !!t && !!n && F(t) === F(n);
4115
+ return !!t && !!n && K(t) === K(n);
4094
4116
  }
4095
4117
  function Rn(t, n) {
4096
4118
  return Math.round((n.getTime() - t.getTime()) / 864e5) + 1;
4097
4119
  }
4098
4120
  function Ln(t) {
4099
- const n = je(t), r = de(n, -n.getDay());
4121
+ const n = je(t), r = ue(n, -n.getDay());
4100
4122
  return Array.from({ length: 42 }, (a, s) => {
4101
- const l = de(r, s);
4123
+ const l = ue(r, s);
4102
4124
  return { date: l, inMonth: l.getMonth() === n.getMonth() };
4103
4125
  });
4104
4126
  }
4105
4127
  function Oe(t, n, r) {
4106
- return !!(n && F(t) < F(n) || r && F(t) > F(r));
4128
+ return !!(n && K(t) < K(n) || r && K(t) > K(r));
4107
4129
  }
4108
4130
  function st(t, n, r) {
4109
- return n && F(t) < F(n) ? n : r && F(t) > F(r) ? r : t;
4131
+ return n && K(t) < K(n) ? n : r && K(t) > K(r) ? r : t;
4110
4132
  }
4111
4133
  function Wn({
4112
4134
  value: t,
@@ -4116,65 +4138,65 @@ function Wn({
4116
4138
  maxValue: s,
4117
4139
  today: l = /* @__PURE__ */ new Date()
4118
4140
  }) {
4119
- const [o, u] = I(
4141
+ const [o, u] = A(
4120
4142
  () => je(st(t.start ?? l, a, s))
4121
- ), [d, p] = I(null), [c, f] = I(() => st(t.start ?? l, a, s)), [_, m] = I(""), g = q(/* @__PURE__ */ new Map()), k = q(null), b = Ln(o);
4122
- P(() => {
4123
- if (!k.current) return;
4124
- const N = g.current.get(k.current);
4125
- k.current = null, N?.focus();
4143
+ ), [d, p] = A(null), [c, f] = A(() => st(t.start ?? l, a, s)), [_, m] = A(""), g = q(/* @__PURE__ */ new Map()), w = q(null), b = Ln(o);
4144
+ O(() => {
4145
+ if (!w.current) return;
4146
+ const y = g.current.get(w.current);
4147
+ w.current = null, y?.focus();
4126
4148
  });
4127
- const y = t.start && !t.end && d ? F(d) < F(t.start) ? { start: d, end: t.start } : { start: t.start, end: d } : t;
4128
- function v(N) {
4149
+ const N = t.start && !t.end && d ? K(d) < K(t.start) ? { start: d, end: t.start } : { start: t.start, end: d } : t;
4150
+ function v(y) {
4129
4151
  if (!t.start || t.end) {
4130
- n({ start: N, end: null }), m(`开始日期 ${F(N)},请选择结束日期`);
4152
+ n({ start: y, end: null }), m(`开始日期 ${K(y)},请选择结束日期`);
4131
4153
  return;
4132
4154
  }
4133
- const [w, E] = F(N) < F(t.start) ? [N, t.start] : [t.start, N];
4134
- n({ start: w, end: E }), m(`已选择 ${F(w)} 至 ${F(E)},共 ${Rn(w, E)} 天`);
4155
+ const [k, $] = K(y) < K(t.start) ? [y, t.start] : [t.start, y];
4156
+ n({ start: k, end: $ }), m(`已选择 ${K(k)} 至 ${K($)},共 ${Rn(k, $)} 天`);
4135
4157
  }
4136
- function D(N) {
4137
- Oe(N, a, s) || ((N.getMonth() !== o.getMonth() || N.getFullYear() !== o.getFullYear()) && u(je(N)), f(N), k.current = F(N));
4158
+ function D(y) {
4159
+ Oe(y, a, s) || ((y.getMonth() !== o.getMonth() || y.getFullYear() !== o.getFullYear()) && u(je(y)), f(y), w.current = K(y));
4138
4160
  }
4139
- function C(N) {
4140
- let w = null;
4141
- switch (N.key) {
4161
+ function C(y) {
4162
+ let k = null;
4163
+ switch (y.key) {
4142
4164
  case "ArrowLeft":
4143
- w = de(c, N.shiftKey ? -7 : -1);
4165
+ k = ue(c, y.shiftKey ? -7 : -1);
4144
4166
  break;
4145
4167
  case "ArrowRight":
4146
- w = de(c, N.shiftKey ? 7 : 1);
4168
+ k = ue(c, y.shiftKey ? 7 : 1);
4147
4169
  break;
4148
4170
  case "ArrowUp":
4149
- w = de(c, -7);
4171
+ k = ue(c, -7);
4150
4172
  break;
4151
4173
  case "ArrowDown":
4152
- w = de(c, 7);
4174
+ k = ue(c, 7);
4153
4175
  break;
4154
4176
  case "Home":
4155
- w = de(c, -c.getDay());
4177
+ k = ue(c, -c.getDay());
4156
4178
  break;
4157
4179
  case "End":
4158
- w = de(c, 6 - c.getDay());
4180
+ k = ue(c, 6 - c.getDay());
4159
4181
  break;
4160
4182
  case "PageUp":
4161
- w = Pe(c, -1);
4183
+ k = Pe(c, -1);
4162
4184
  break;
4163
4185
  case "PageDown":
4164
- w = Pe(c, 1);
4186
+ k = Pe(c, 1);
4165
4187
  break;
4166
4188
  case "Enter":
4167
4189
  case " ":
4168
- N.preventDefault(), Oe(c, a, s) || v(c);
4190
+ y.preventDefault(), Oe(c, a, s) || v(c);
4169
4191
  return;
4170
4192
  default:
4171
4193
  return;
4172
4194
  }
4173
- N.preventDefault(), w && D(w);
4195
+ y.preventDefault(), k && D(k);
4174
4196
  }
4175
- function h(N) {
4176
- const w = Pe(o, N);
4177
- u(w), f(w);
4197
+ function h(y) {
4198
+ const k = Pe(o, y);
4199
+ u(k), f(k);
4178
4200
  }
4179
4201
  const x = `${o.getFullYear()} 年 ${o.getMonth() + 1} 月`;
4180
4202
  return /* @__PURE__ */ i("div", { className: `calendar calendar--${r}`, children: [
@@ -4198,45 +4220,45 @@ function Wn({
4198
4220
  className: "calendar__nav-btn",
4199
4221
  "aria-label": "下一月",
4200
4222
  onClick: () => h(1),
4201
- children: /* @__PURE__ */ e(ue, { size: 16, strokeWidth: 2 })
4223
+ children: /* @__PURE__ */ e(me, { size: 16, strokeWidth: 2 })
4202
4224
  }
4203
4225
  )
4204
4226
  ] })
4205
4227
  ] }),
4206
- /* @__PURE__ */ e("div", { className: "calendar__weekdays", "aria-hidden": "true", children: zn.map((N, w) => /* @__PURE__ */ e("span", { className: "calendar__weekday", children: N }, `${N}-${w}`)) }),
4207
- /* @__PURE__ */ e("div", { className: "calendar__grid", role: "grid", "aria-label": x, onKeyDown: C, children: b.map(({ date: N, inMonth: w }) => {
4208
- const E = !w || Oe(N, a, s), A = ye(N, y.start), S = ye(N, y.end), W = !!y.start && !!y.end && !ye(y.start, y.end), O = W && F(N) > F(y.start) && F(N) < F(y.end), V = T(
4228
+ /* @__PURE__ */ e("div", { className: "calendar__weekdays", "aria-hidden": "true", children: zn.map((y, k) => /* @__PURE__ */ e("span", { className: "calendar__weekday", children: y }, `${y}-${k}`)) }),
4229
+ /* @__PURE__ */ e("div", { className: "calendar__grid", role: "grid", "aria-label": x, onKeyDown: C, children: b.map(({ date: y, inMonth: k }) => {
4230
+ const $ = !k || Oe(y, a, s), I = ye(y, N.start), S = ye(y, N.end), L = !!N.start && !!N.end && !ye(N.start, N.end), F = L && K(y) > K(N.start) && K(y) < K(N.end), G = T(
4209
4231
  "calendar__cell",
4210
- O ? "calendar__cell--in-range" : "",
4211
- W && A ? "calendar__cell--range-start" : "",
4212
- W && S ? "calendar__cell--range-end" : ""
4213
- ), ee = T(
4232
+ F ? "calendar__cell--in-range" : "",
4233
+ L && I ? "calendar__cell--range-start" : "",
4234
+ L && S ? "calendar__cell--range-end" : ""
4235
+ ), X = T(
4214
4236
  "calendar__day",
4215
- w ? "" : "calendar__day--outside",
4216
- A && y.start ? "calendar__day--start" : "",
4217
- S && W ? "calendar__day--end" : "",
4218
- w && !E && ye(N, l) ? "calendar__day--today" : ""
4237
+ k ? "" : "calendar__day--outside",
4238
+ I && N.start ? "calendar__day--start" : "",
4239
+ S && L ? "calendar__day--end" : "",
4240
+ k && !$ && ye(y, l) ? "calendar__day--today" : ""
4219
4241
  );
4220
- return /* @__PURE__ */ e("div", { className: V, role: "gridcell", children: /* @__PURE__ */ e(
4242
+ return /* @__PURE__ */ e("div", { className: G, role: "gridcell", children: /* @__PURE__ */ e(
4221
4243
  "button",
4222
4244
  {
4223
4245
  type: "button",
4224
- ref: (G) => {
4225
- G ? g.current.set(F(N), G) : g.current.delete(F(N));
4246
+ ref: (V) => {
4247
+ V ? g.current.set(K(y), V) : g.current.delete(K(y));
4226
4248
  },
4227
- className: ee,
4228
- tabIndex: w && !E && ye(N, c) ? 0 : -1,
4229
- disabled: E,
4230
- "aria-disabled": E || void 0,
4231
- "aria-selected": (A || S) && y.start ? !0 : void 0,
4232
- "aria-current": w && ye(N, l) ? "date" : void 0,
4233
- onClick: () => !E && v(N),
4234
- onMouseEnter: () => p(N),
4249
+ className: X,
4250
+ tabIndex: k && !$ && ye(y, c) ? 0 : -1,
4251
+ disabled: $,
4252
+ "aria-disabled": $ || void 0,
4253
+ "aria-selected": (I || S) && N.start ? !0 : void 0,
4254
+ "aria-current": k && ye(y, l) ? "date" : void 0,
4255
+ onClick: () => !$ && v(y),
4256
+ onMouseEnter: () => p(y),
4235
4257
  onMouseLeave: () => p(null),
4236
- onFocus: () => f(N),
4237
- children: N.getDate()
4258
+ onFocus: () => f(y),
4259
+ children: y.getDate()
4238
4260
  }
4239
- ) }, F(N));
4261
+ ) }, K(y));
4240
4262
  }) }),
4241
4263
  /* @__PURE__ */ e("span", { className: "q1-sr-only", "aria-live": "polite", children: _ })
4242
4264
  ] });
@@ -4251,14 +4273,14 @@ function Fn({
4251
4273
  /* @__PURE__ */ i("div", { className: "cal-inputs__field", children: [
4252
4274
  /* @__PURE__ */ e("span", { className: "cal-inputs__label", children: "开始" }),
4253
4275
  /* @__PURE__ */ i("div", { className: "cal-inputs__row", children: [
4254
- /* @__PURE__ */ e("span", { className: "cal-inputs__value", children: t.start ? F(t.start) : "请选择" }),
4276
+ /* @__PURE__ */ e("span", { className: "cal-inputs__value", children: t.start ? K(t.start) : "请选择" }),
4255
4277
  n ? /* @__PURE__ */ e("span", { className: "cal-inputs__time", children: "00:00" }) : null
4256
4278
  ] })
4257
4279
  ] }),
4258
4280
  /* @__PURE__ */ i("div", { className: "cal-inputs__field", children: [
4259
4281
  /* @__PURE__ */ e("span", { className: "cal-inputs__label", children: "结束" }),
4260
4282
  /* @__PURE__ */ i("div", { className: "cal-inputs__row", children: [
4261
- /* @__PURE__ */ e("span", { className: "cal-inputs__value", children: t.end ? F(t.end) : "请选择" }),
4283
+ /* @__PURE__ */ e("span", { className: "cal-inputs__value", children: t.end ? K(t.end) : "请选择" }),
4262
4284
  n ? /* @__PURE__ */ e("span", { className: "cal-inputs__time", children: "23:59" }) : null
4263
4285
  ] })
4264
4286
  ] }),
@@ -4283,15 +4305,15 @@ function Nr({
4283
4305
  value: u,
4284
4306
  onChange: d
4285
4307
  }) {
4286
- const [p, c] = I(!1), f = q(null), _ = q(null);
4287
- P(() => {
4308
+ const [p, c] = A(!1), f = q(null), _ = q(null);
4309
+ O(() => {
4288
4310
  if (!p) return;
4289
- const y = f.current?.querySelector(".cal-popover"), v = () => y ? [
4290
- ...y.querySelectorAll(
4311
+ const N = f.current?.querySelector(".cal-popover"), v = () => N ? [
4312
+ ...N.querySelectorAll(
4291
4313
  'button:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled])'
4292
4314
  )
4293
4315
  ].filter((x) => x.offsetParent !== null) : [];
4294
- (y?.querySelector('.calendar__day[tabindex="0"]') ?? v()[0])?.focus();
4316
+ (N?.querySelector('.calendar__day[tabindex="0"]') ?? v()[0])?.focus();
4295
4317
  function C(x) {
4296
4318
  f.current && !f.current.contains(x.target) && c(!1);
4297
4319
  }
@@ -4300,18 +4322,18 @@ function Nr({
4300
4322
  c(!1), _.current?.focus();
4301
4323
  return;
4302
4324
  }
4303
- if (x.key === "Tab" && y) {
4304
- const N = v();
4305
- if (N.length === 0) return;
4306
- const w = N[0], E = N[N.length - 1], A = document.activeElement;
4307
- y.contains(A) ? x.shiftKey && A === w ? (x.preventDefault(), E.focus()) : !x.shiftKey && A === E && (x.preventDefault(), w.focus()) : (x.preventDefault(), (x.shiftKey ? E : w).focus());
4325
+ if (x.key === "Tab" && N) {
4326
+ const y = v();
4327
+ if (y.length === 0) return;
4328
+ const k = y[0], $ = y[y.length - 1], I = document.activeElement;
4329
+ N.contains(I) ? x.shiftKey && I === k ? (x.preventDefault(), $.focus()) : !x.shiftKey && I === $ && (x.preventDefault(), k.focus()) : (x.preventDefault(), (x.shiftKey ? $ : k).focus());
4308
4330
  }
4309
4331
  }
4310
4332
  return document.addEventListener("mousedown", C), document.addEventListener("keydown", h), () => {
4311
4333
  document.removeEventListener("mousedown", C), document.removeEventListener("keydown", h);
4312
4334
  };
4313
4335
  }, [p]);
4314
- const m = !!u.start && !!u.end, g = m ? `${F(u.start)} ~ ${F(u.end)}` : "选择日期区间", k = /* @__PURE__ */ e(Wn, { value: u, onChange: d, size: r, minValue: a, maxValue: s, today: o }), b = /* @__PURE__ */ e(
4336
+ const m = !!u.start && !!u.end, g = m ? `${K(u.start)} ~ ${K(u.end)}` : "选择日期区间", w = /* @__PURE__ */ e(Wn, { value: u, onChange: d, size: r, minValue: a, maxValue: s, today: o }), b = /* @__PURE__ */ e(
4315
4337
  Fn,
4316
4338
  {
4317
4339
  value: u,
@@ -4340,7 +4362,7 @@ function Nr({
4340
4362
  className: "cal-field__trigger",
4341
4363
  "aria-haspopup": "dialog",
4342
4364
  "aria-expanded": p,
4343
- onClick: () => c((y) => !y),
4365
+ onClick: () => c((N) => !N),
4344
4366
  children: [
4345
4367
  /* @__PURE__ */ e(Ft, { size: 15, strokeWidth: 2, "aria-hidden": "true" }),
4346
4368
  /* @__PURE__ */ e("span", { className: "cal-field__label", children: g })
@@ -4353,7 +4375,7 @@ function Nr({
4353
4375
  type: "button",
4354
4376
  className: "cal-field__caret",
4355
4377
  "aria-label": "展开日历",
4356
- onClick: () => c((y) => !y),
4378
+ onClick: () => c((N) => !N),
4357
4379
  children: /* @__PURE__ */ e(ae, { size: 15, strokeWidth: 2 })
4358
4380
  }
4359
4381
  ) : m ? /* @__PURE__ */ e(
@@ -4376,12 +4398,12 @@ function Nr({
4376
4398
  role: "dialog",
4377
4399
  "aria-modal": "true",
4378
4400
  "aria-label": "选择日期区间",
4379
- children: t === "horizontal" ? /* @__PURE__ */ i(J, { children: [
4380
- k,
4401
+ children: t === "horizontal" ? /* @__PURE__ */ i(ee, { children: [
4402
+ w,
4381
4403
  b
4382
- ] }) : /* @__PURE__ */ i(J, { children: [
4404
+ ] }) : /* @__PURE__ */ i(ee, { children: [
4383
4405
  b,
4384
- k
4406
+ w
4385
4407
  ] })
4386
4408
  }
4387
4409
  ) : null
@@ -4393,8 +4415,8 @@ function kr({
4393
4415
  activeLabel: n,
4394
4416
  onPick: r
4395
4417
  }) {
4396
- const [a, s] = I(!1), l = q(null);
4397
- return P(() => {
4418
+ const [a, s] = A(!1), l = q(null);
4419
+ return O(() => {
4398
4420
  if (!a) return;
4399
4421
  function o(u) {
4400
4422
  l.current && !l.current.contains(u.target) && s(!1);
@@ -4535,7 +4557,7 @@ export {
4535
4557
  sa as Toggle,
4536
4558
  hn as Tooltip,
4537
4559
  lr as Video,
4538
- de as addDays,
4560
+ ue as addDays,
4539
4561
  Se as useCopy,
4540
4562
  na as useRadio,
4541
4563
  tn as useToast