@yuku123/z-frontend-common 1.1.2 → 1.1.3

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,8 +1,8 @@
1
- import { jsxs as m, jsx as t, Fragment as Se } from "react/jsx-runtime";
2
- import { useState as A, useRef as M, useEffect as D, useCallback as ke, useMemo as G, useLayoutEffect as we, createElement as le, Fragment as O } from "react";
3
- import { Button as V, Skeleton as _, Input as Ce, Breadcrumb as Re, Space as ae, Tag as se, Card as Te, Table as Ee } from "antd";
4
- import { InboxOutlined as Ie, ExclamationCircleOutlined as ze, ReloadOutlined as re, SearchOutlined as Ae, ReadOutlined as Be } from "@ant-design/icons";
5
- import { useNavigate as he, useInRouterContext as De } from "react-router-dom";
1
+ import { jsxs as m, jsx as t, Fragment as Ce } from "react/jsx-runtime";
2
+ import { useState as z, useRef as H, useEffect as D, useMemo as q, useCallback as be, useLayoutEffect as Re, createElement as ae, Fragment as O } from "react";
3
+ import { Button as V, Skeleton as _, Input as Te, Card as me, Table as ye, Breadcrumb as Ee, Space as se, Tag as ce } from "antd";
4
+ import { InboxOutlined as Ae, ExclamationCircleOutlined as Ie, ReloadOutlined as re, SearchOutlined as ze, ReadOutlined as Be } from "@ant-design/icons";
5
+ import { useNavigate as xe, useInRouterContext as De } from "react-router-dom";
6
6
  const T = {
7
7
  // 主色 (蓝紫) - 顶导/重点按钮/链接
8
8
  primary: "#7c3aed",
@@ -83,15 +83,15 @@ const T = {
83
83
  lg: 16,
84
84
  xl: 20,
85
85
  pill: 999
86
- }, z = {
86
+ }, B = {
87
87
  sm: "0 1px 2px 0 rgba(15, 23, 42, 0.04), 0 1px 3px 0 rgba(15, 23, 42, 0.06)",
88
88
  md: "0 2px 4px -1px rgba(15, 23, 42, 0.04), 0 4px 8px -1px rgba(15, 23, 42, 0.08)",
89
89
  lg: "0 4px 6px -2px rgba(15, 23, 42, 0.05), 0 12px 16px -4px rgba(15, 23, 42, 0.10)",
90
90
  xl: "0 8px 24px -6px rgba(15, 23, 42, 0.10), 0 24px 48px -12px rgba(15, 23, 42, 0.18)"
91
- }, nt = {
92
- rest: z.md,
91
+ }, at = {
92
+ rest: B.md,
93
93
  hover: "0 8px 16px -4px rgba(15, 23, 42, 0.08), 0 20px 32px -8px rgba(15, 23, 42, 0.14)"
94
- }, H = {
94
+ }, N = {
95
95
  1: 4,
96
96
  2: 8,
97
97
  3: 12,
@@ -102,7 +102,7 @@ const T = {
102
102
  10: 40,
103
103
  12: 48,
104
104
  16: 64
105
- }, ce = {
105
+ }, de = {
106
106
  xs: 11,
107
107
  sm: 12,
108
108
  base: 14,
@@ -112,7 +112,7 @@ const T = {
112
112
  "2xl": 24,
113
113
  "3xl": 30,
114
114
  "4xl": 36
115
- }, L = {
115
+ }, M = {
116
116
  token: {
117
117
  // 主色
118
118
  colorPrimary: T.primary,
@@ -141,11 +141,11 @@ const T = {
141
141
  borderRadiusLG: C.lg,
142
142
  borderRadiusSM: C.sm,
143
143
  // 字体
144
- fontSize: ce.base,
144
+ fontSize: de.base,
145
145
  fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif",
146
146
  // 阴影
147
- boxShadow: z.md,
148
- boxShadowSecondary: z.lg
147
+ boxShadow: B.md,
148
+ boxShadowSecondary: B.lg
149
149
  },
150
150
  components: {
151
151
  // Layout: 顶导白底更现代
@@ -169,7 +169,7 @@ const T = {
169
169
  // Card: 更柔和
170
170
  Card: {
171
171
  borderRadiusLG: C.lg,
172
- boxShadowTertiary: z.sm
172
+ boxShadowTertiary: B.sm
173
173
  },
174
174
  // Button: 主按钮圆角统一
175
175
  Button: {
@@ -181,7 +181,7 @@ const T = {
181
181
  Tabs: {
182
182
  itemSelectedColor: T.primary,
183
183
  inkBarColor: T.primary,
184
- titleFontSize: ce.base
184
+ titleFontSize: de.base
185
185
  },
186
186
  // Tag: 更小巧
187
187
  Tag: {
@@ -189,39 +189,39 @@ const T = {
189
189
  }
190
190
  }
191
191
  };
192
- function it({
192
+ function st({
193
193
  icon: e,
194
194
  label: n,
195
195
  value: s,
196
- suffix: l,
196
+ suffix: o,
197
197
  color: c = "blue",
198
198
  trend: a,
199
199
  href: r,
200
- loading: o = !1,
200
+ loading: l = !1,
201
201
  precision: i = 0
202
202
  }) {
203
- const d = E[c] || E.blue, [f, g] = A(0), p = M(0);
203
+ const d = E[c] || E.blue, [f, g] = z(0), p = H(0);
204
204
  D(() => {
205
- if (o || s == null) return;
205
+ if (l || s == null) return;
206
206
  const b = p.current, S = Number(s) || 0;
207
207
  if (b === S) {
208
208
  g(S);
209
209
  return;
210
210
  }
211
- const k = 600, P = performance.now();
212
- let N;
213
- const q = (Y) => {
214
- const j = Math.min(1, (Y - P) / k), J = 1 - Math.pow(1 - j, 3), u = b + (S - b) * J;
215
- g(u), j < 1 ? N = requestAnimationFrame(q) : p.current = S;
211
+ const w = 600, L = performance.now();
212
+ let P;
213
+ const G = (U) => {
214
+ const j = Math.min(1, (U - L) / w), J = 1 - Math.pow(1 - j, 3), u = b + (S - b) * J;
215
+ g(u), j < 1 ? P = requestAnimationFrame(G) : p.current = S;
216
216
  };
217
- return N = requestAnimationFrame(q), () => N && cancelAnimationFrame(N);
218
- }, [s, o]);
217
+ return P = requestAnimationFrame(G), () => P && cancelAnimationFrame(P);
218
+ }, [s, l]);
219
219
  const h = () => {
220
220
  r && typeof window < "u" && (window.location.href = r);
221
- }, w = o ? "--" : Number(f).toLocaleString("zh-CN", {
221
+ }, k = l ? "--" : Number(f).toLocaleString("zh-CN", {
222
222
  minimumFractionDigits: i,
223
223
  maximumFractionDigits: i
224
- }), v = a != null ? Number(a) : null, B = v != null && v >= 0;
224
+ }), v = a != null ? Number(a) : null, A = v != null && v >= 0;
225
225
  return /* @__PURE__ */ m(
226
226
  "div",
227
227
  {
@@ -230,10 +230,10 @@ function it({
230
230
  position: "relative",
231
231
  background: d.gradient,
232
232
  borderRadius: C.lg,
233
- padding: H[5],
233
+ padding: N[5],
234
234
  color: d.fg,
235
235
  cursor: r ? "pointer" : "default",
236
- boxShadow: z.md,
236
+ boxShadow: B.md,
237
237
  overflow: "hidden",
238
238
  transition: "transform 200ms ease, box-shadow 200ms ease",
239
239
  minHeight: 110,
@@ -242,10 +242,10 @@ function it({
242
242
  justifyContent: "space-between"
243
243
  },
244
244
  onMouseEnter: (b) => {
245
- b.currentTarget.style.transform = "translateY(-2px)", b.currentTarget.style.boxShadow = z.lg;
245
+ b.currentTarget.style.transform = "translateY(-2px)", b.currentTarget.style.boxShadow = B.lg;
246
246
  },
247
247
  onMouseLeave: (b) => {
248
- b.currentTarget.style.transform = "translateY(0)", b.currentTarget.style.boxShadow = z.md;
248
+ b.currentTarget.style.transform = "translateY(0)", b.currentTarget.style.boxShadow = B.md;
249
249
  },
250
250
  children: [
251
251
  /* @__PURE__ */ t(
@@ -266,7 +266,7 @@ function it({
266
266
  /* @__PURE__ */ m("div", { style: {
267
267
  display: "flex",
268
268
  alignItems: "center",
269
- gap: H[2],
269
+ gap: N[2],
270
270
  position: "relative"
271
271
  }, children: [
272
272
  /* @__PURE__ */ t("div", { style: {
@@ -289,9 +289,9 @@ function it({
289
289
  /* @__PURE__ */ m("div", { style: {
290
290
  display: "flex",
291
291
  alignItems: "baseline",
292
- gap: H[2],
292
+ gap: N[2],
293
293
  position: "relative",
294
- marginTop: H[3]
294
+ marginTop: N[3]
295
295
  }, children: [
296
296
  /* @__PURE__ */ t("div", { style: {
297
297
  fontSize: 30,
@@ -299,20 +299,20 @@ function it({
299
299
  lineHeight: 1.1,
300
300
  letterSpacing: "-0.02em",
301
301
  fontVariantNumeric: "tabular-nums"
302
- }, children: w }),
303
- l && /* @__PURE__ */ t("div", { style: { fontSize: 14, opacity: 0.85, fontWeight: 500 }, children: l }),
302
+ }, children: k }),
303
+ o && /* @__PURE__ */ t("div", { style: { fontSize: 14, opacity: 0.85, fontWeight: 500 }, children: o }),
304
304
  v != null && /* @__PURE__ */ m("div", { style: {
305
305
  marginLeft: "auto",
306
306
  fontSize: 12,
307
307
  fontWeight: 600,
308
308
  padding: "2px 8px",
309
309
  borderRadius: 999,
310
- background: B ? "rgba(255, 255, 255, 0.22)" : "rgba(0, 0, 0, 0.18)",
310
+ background: A ? "rgba(255, 255, 255, 0.22)" : "rgba(0, 0, 0, 0.18)",
311
311
  display: "flex",
312
312
  alignItems: "center",
313
313
  gap: 2
314
314
  }, children: [
315
- /* @__PURE__ */ t("span", { style: { fontSize: 10 }, children: B ? "▲" : "▼" }),
315
+ /* @__PURE__ */ t("span", { style: { fontSize: 10 }, children: A ? "▲" : "▼" }),
316
316
  Math.abs(v).toFixed(1),
317
317
  "%"
318
318
  ] })
@@ -321,8 +321,8 @@ function it({
321
321
  }
322
322
  );
323
323
  }
324
- function $e({ color: e = "blue", label: n, size: s = 8 }) {
325
- const l = E[e] || E.blue;
324
+ function Le({ color: e = "blue", label: n, size: s = 8 }) {
325
+ const o = E[e] || E.blue;
326
326
  return /* @__PURE__ */ m("span", { style: {
327
327
  display: "inline-flex",
328
328
  alignItems: "center",
@@ -335,18 +335,18 @@ function $e({ color: e = "blue", label: n, size: s = 8 }) {
335
335
  width: s,
336
336
  height: s,
337
337
  borderRadius: "50%",
338
- background: l.bg,
339
- boxShadow: `0 0 0 3px ${l.soft}`,
338
+ background: o.bg,
339
+ boxShadow: `0 0 0 3px ${o.soft}`,
340
340
  flexShrink: 0
341
341
  } }),
342
342
  n && /* @__PURE__ */ t("span", { children: n })
343
343
  ] });
344
344
  }
345
- function ot({
345
+ function ct({
346
346
  color: e = "blue",
347
347
  title: n,
348
348
  subtitle: s,
349
- moreText: l = "全部",
349
+ moreText: o = "全部",
350
350
  moreHref: c,
351
351
  onMore: a
352
352
  }) {
@@ -357,7 +357,7 @@ function ot({
357
357
  marginBottom: 16
358
358
  }, children: [
359
359
  /* @__PURE__ */ m("div", { style: { display: "flex", alignItems: "baseline", gap: 12 }, children: [
360
- /* @__PURE__ */ t($e, { color: e, label: n, size: 10 }),
360
+ /* @__PURE__ */ t(Le, { color: e, label: n, size: 10 }),
361
361
  s && /* @__PURE__ */ t("span", { style: {
362
362
  fontSize: 13,
363
363
  color: "#6b7280",
@@ -388,30 +388,30 @@ function ot({
388
388
  r.currentTarget.style.color = "#6b7280";
389
389
  },
390
390
  children: [
391
- l,
391
+ o,
392
392
  /* @__PURE__ */ t("span", { style: { fontSize: 12 }, children: "›" })
393
393
  ]
394
394
  }
395
395
  )
396
396
  ] });
397
397
  }
398
- function lt({
398
+ function dt({
399
399
  title: e,
400
400
  description: n,
401
401
  icon: s,
402
- cover: l,
402
+ cover: o,
403
403
  color: c = "violet",
404
404
  tags: a = [],
405
405
  meta: r,
406
- href: o,
406
+ href: l,
407
407
  extra: i
408
408
  }) {
409
- const d = E[c] || E.violet, [f, g] = A(!1);
409
+ const d = E[c] || E.violet, [f, g] = z(!1);
410
410
  return /* @__PURE__ */ m(
411
411
  "div",
412
412
  {
413
413
  onClick: () => {
414
- o && typeof window < "u" && (window.location.href = o);
414
+ l && typeof window < "u" && (window.location.href = l);
415
415
  },
416
416
  onMouseEnter: () => g(!0),
417
417
  onMouseLeave: () => g(!1),
@@ -419,8 +419,8 @@ function lt({
419
419
  background: "#ffffff",
420
420
  borderRadius: C.lg,
421
421
  overflow: "hidden",
422
- cursor: o ? "pointer" : "default",
423
- boxShadow: f ? z.lg : z.sm,
422
+ cursor: l ? "pointer" : "default",
423
+ boxShadow: f ? B.lg : B.sm,
424
424
  transform: f ? "translateY(-2px)" : "translateY(0)",
425
425
  transition: "transform 200ms ease, box-shadow 200ms ease",
426
426
  border: "1px solid #f1f5f9",
@@ -431,16 +431,16 @@ function lt({
431
431
  /* @__PURE__ */ m("div", { style: {
432
432
  position: "relative",
433
433
  aspectRatio: "16 / 9",
434
- background: l ? "#f1f5f9" : d.gradient,
434
+ background: o ? "#f1f5f9" : d.gradient,
435
435
  display: "flex",
436
436
  alignItems: "center",
437
437
  justifyContent: "center",
438
438
  overflow: "hidden"
439
439
  }, children: [
440
- l ? /* @__PURE__ */ t(
440
+ o ? /* @__PURE__ */ t(
441
441
  "img",
442
442
  {
443
- src: l,
443
+ src: o,
444
444
  alt: e,
445
445
  style: {
446
446
  width: "100%",
@@ -453,7 +453,7 @@ function lt({
453
453
  color: "rgba(255, 255, 255, 0.9)",
454
454
  display: "flex"
455
455
  }, children: s }),
456
- !l && /* @__PURE__ */ t("div", { style: {
456
+ !o && /* @__PURE__ */ t("div", { style: {
457
457
  position: "absolute",
458
458
  top: -24,
459
459
  right: -24,
@@ -469,17 +469,17 @@ function lt({
469
469
  }, children: i })
470
470
  ] }),
471
471
  /* @__PURE__ */ m("div", { style: {
472
- padding: H[4],
472
+ padding: N[4],
473
473
  display: "flex",
474
474
  flexDirection: "column",
475
- gap: H[2],
475
+ gap: N[2],
476
476
  flex: 1
477
477
  }, children: [
478
478
  a.length > 0 && /* @__PURE__ */ t("div", { style: {
479
479
  display: "flex",
480
480
  flexWrap: "wrap",
481
481
  gap: 6
482
- }, children: a.slice(0, 3).map((h, w) => {
482
+ }, children: a.slice(0, 3).map((h, k) => {
483
483
  const v = E[h.color] || E.blue;
484
484
  return /* @__PURE__ */ t(
485
485
  "span",
@@ -494,7 +494,7 @@ function lt({
494
494
  },
495
495
  children: h.label
496
496
  },
497
- w
497
+ k
498
498
  );
499
499
  }) }),
500
500
  /* @__PURE__ */ t("div", { style: {
@@ -523,7 +523,7 @@ function lt({
523
523
  fontSize: 11,
524
524
  color: "#9ca3af",
525
525
  marginTop: "auto",
526
- paddingTop: H[2],
526
+ paddingTop: N[2],
527
527
  borderTop: "1px dashed #f1f5f9"
528
528
  }, children: r })
529
529
  ] })
@@ -531,11 +531,11 @@ function lt({
531
531
  }
532
532
  );
533
533
  }
534
- function at({
534
+ function ft({
535
535
  tag: e,
536
536
  title: n,
537
537
  description: s,
538
- buttonText: l,
538
+ buttonText: o,
539
539
  buttonHref: c,
540
540
  onButtonClick: a
541
541
  }) {
@@ -546,7 +546,7 @@ function at({
546
546
  background: "linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #312e81 100%)",
547
547
  color: "#ffffff",
548
548
  overflow: "hidden",
549
- boxShadow: z.lg
549
+ boxShadow: B.lg
550
550
  }, children: [
551
551
  /* @__PURE__ */ t("div", { style: {
552
552
  position: "absolute",
@@ -598,7 +598,7 @@ function at({
598
598
  maxWidth: 540
599
599
  }, children: s })
600
600
  ] }),
601
- l && (c || a) && /* @__PURE__ */ m(
601
+ o && (c || a) && /* @__PURE__ */ m(
602
602
  "a",
603
603
  {
604
604
  href: c || "#",
@@ -627,7 +627,7 @@ function at({
627
627
  r.currentTarget.style.transform = "translateY(0)", r.currentTarget.style.boxShadow = "0 4px 12px rgba(16, 185, 129, 0.4)";
628
628
  },
629
629
  children: [
630
- l,
630
+ o,
631
631
  /* @__PURE__ */ t("span", { children: "→" })
632
632
  ]
633
633
  }
@@ -635,23 +635,23 @@ function at({
635
635
  ] })
636
636
  ] });
637
637
  }
638
- function be({
638
+ function ne({
639
639
  icon: e,
640
640
  title: n = "暂无数据",
641
641
  description: s,
642
- actionText: l,
642
+ actionText: o,
643
643
  onAction: c,
644
644
  size: a = "md",
645
645
  style: r
646
646
  }) {
647
- const o = { sm: 24, md: 40, lg: 64 }, i = { sm: 14, md: 16, lg: 20 };
647
+ const l = { sm: 24, md: 40, lg: 64 }, i = { sm: 14, md: 16, lg: 20 };
648
648
  return /* @__PURE__ */ m(
649
649
  "div",
650
650
  {
651
651
  role: "status",
652
652
  "aria-live": "polite",
653
653
  style: {
654
- padding: o[a] || o.md,
654
+ padding: l[a] || l.md,
655
655
  textAlign: "center",
656
656
  background: "#ffffff",
657
657
  borderRadius: C.md,
@@ -670,7 +670,7 @@ function be({
670
670
  marginBottom: 16,
671
671
  fontSize: 28,
672
672
  color: "#9ca3af"
673
- }, children: e || /* @__PURE__ */ t(Ie, {}) }),
673
+ }, children: e || /* @__PURE__ */ t(Ae, {}) }),
674
674
  /* @__PURE__ */ t("div", { style: {
675
675
  fontSize: i[a],
676
676
  fontWeight: 600,
@@ -684,7 +684,7 @@ function be({
684
684
  maxWidth: 360,
685
685
  margin: "0 auto 16px"
686
686
  }, children: s }),
687
- l && c && /* @__PURE__ */ t(
687
+ o && c && /* @__PURE__ */ t(
688
688
  V,
689
689
  {
690
690
  type: "primary",
@@ -694,39 +694,39 @@ function be({
694
694
  border: "none",
695
695
  minHeight: 36
696
696
  },
697
- children: l
697
+ children: o
698
698
  }
699
699
  )
700
700
  ]
701
701
  }
702
702
  );
703
703
  }
704
- function We({
704
+ function $e({
705
705
  error: e,
706
706
  title: n = "加载失败",
707
707
  description: s,
708
- onRetry: l,
708
+ onRetry: o,
709
709
  retryText: c = "重新加载",
710
710
  variant: a = "inline",
711
711
  style: r
712
712
  }) {
713
713
  var p;
714
- const o = a === "full", i = (p = e == null ? void 0 : e.response) == null ? void 0 : p.data, d = i && typeof i == "object" && (typeof i.message == "string" && i.message || typeof i.msg == "string" && i.msg) || null, f = d || (typeof e == "string" ? e : (e == null ? void 0 : e.message) || (e == null ? void 0 : e.msg) || (e ? String(e) : null)), g = s || (d ? `原因: ${d}` : f ? `原因: ${f}。请检查网络或稍后重试。` : "请检查网络或稍后重试。");
714
+ const l = a === "full", i = (p = e == null ? void 0 : e.response) == null ? void 0 : p.data, d = i && typeof i == "object" && (typeof i.message == "string" && i.message || typeof i.msg == "string" && i.msg) || null, f = d || (typeof e == "string" ? e : (e == null ? void 0 : e.message) || (e == null ? void 0 : e.msg) || (e ? String(e) : null)), g = s || (d ? `原因: ${d}` : f ? `原因: ${f}。请检查网络或稍后重试。` : "请检查网络或稍后重试。");
715
715
  return /* @__PURE__ */ m(
716
716
  "div",
717
717
  {
718
718
  role: "alert",
719
719
  "aria-live": "assertive",
720
720
  style: {
721
- padding: o ? "48px 24px" : "20px 24px",
722
- background: o ? "#ffffff" : "#fef2f2",
723
- border: o ? `1px dashed ${x.border}` : "1px solid #fecaca",
721
+ padding: l ? "48px 24px" : "20px 24px",
722
+ background: l ? "#ffffff" : "#fef2f2",
723
+ border: l ? `1px dashed ${x.border}` : "1px solid #fecaca",
724
724
  borderRadius: C.md,
725
- textAlign: o ? "center" : "left",
725
+ textAlign: l ? "center" : "left",
726
726
  display: "flex",
727
- flexDirection: o ? "column" : "row",
728
- alignItems: o ? "center" : "flex-start",
729
- gap: o ? 12 : 16,
727
+ flexDirection: l ? "column" : "row",
728
+ alignItems: l ? "center" : "flex-start",
729
+ gap: l ? 12 : 16,
730
730
  ...r
731
731
  },
732
732
  children: [
@@ -734,17 +734,17 @@ function We({
734
734
  display: "inline-flex",
735
735
  alignItems: "center",
736
736
  justifyContent: "center",
737
- width: o ? 56 : 36,
738
- height: o ? 56 : 36,
737
+ width: l ? 56 : 36,
738
+ height: l ? 56 : 36,
739
739
  borderRadius: "50%",
740
- background: o ? "#fef2f2" : "#ffffff",
740
+ background: l ? "#fef2f2" : "#ffffff",
741
741
  color: "#dc2626",
742
- fontSize: o ? 28 : 18,
742
+ fontSize: l ? 28 : 18,
743
743
  flexShrink: 0
744
- }, children: /* @__PURE__ */ t(ze, {}) }),
744
+ }, children: /* @__PURE__ */ t(Ie, {}) }),
745
745
  /* @__PURE__ */ m("div", { style: { flex: 1, minWidth: 0 }, children: [
746
746
  /* @__PURE__ */ t("div", { style: {
747
- fontSize: o ? 16 : 14,
747
+ fontSize: l ? 16 : 14,
748
748
  fontWeight: 600,
749
749
  color: "#991b1b",
750
750
  marginBottom: 4
@@ -755,14 +755,14 @@ function We({
755
755
  lineHeight: 1.6,
756
756
  wordBreak: "break-word"
757
757
  }, children: g }),
758
- l && /* @__PURE__ */ t(
758
+ o && /* @__PURE__ */ t(
759
759
  V,
760
760
  {
761
761
  type: "primary",
762
762
  danger: !0,
763
763
  icon: /* @__PURE__ */ t(re, {}),
764
- onClick: l,
765
- size: o ? "middle" : "small",
764
+ onClick: o,
765
+ size: l ? "middle" : "small",
766
766
  style: { marginTop: 12 },
767
767
  children: c
768
768
  }
@@ -772,11 +772,11 @@ function We({
772
772
  }
773
773
  );
774
774
  }
775
- function st({
775
+ function gt({
776
776
  variant: e = "cards",
777
777
  rows: n = 4,
778
778
  active: s = !0,
779
- style: l
779
+ style: o
780
780
  }) {
781
781
  return e === "cards" ? /* @__PURE__ */ t(
782
782
  "div",
@@ -788,7 +788,7 @@ function st({
788
788
  display: "grid",
789
789
  gridTemplateColumns: "repeat(auto-fill, minmax(220px, 1fr))",
790
790
  gap: 16,
791
- ...l
791
+ ...o
792
792
  },
793
793
  children: Array.from({ length: n }).map((c, a) => /* @__PURE__ */ m(
794
794
  "div",
@@ -823,11 +823,11 @@ function st({
823
823
  background: "#ffffff",
824
824
  padding: 24,
825
825
  borderRadius: C.md,
826
- ...l
826
+ ...o
827
827
  },
828
828
  children: /* @__PURE__ */ t(_, { active: s, paragraph: { rows: n } })
829
829
  }
830
- ) : e === "list" ? /* @__PURE__ */ t("div", { role: "status", "aria-busy": "true", "aria-label": "加载中", style: l, children: Array.from({ length: n }).map((c, a) => /* @__PURE__ */ m(
830
+ ) : e === "list" ? /* @__PURE__ */ t("div", { role: "status", "aria-busy": "true", "aria-label": "加载中", style: o, children: Array.from({ length: n }).map((c, a) => /* @__PURE__ */ m(
831
831
  "div",
832
832
  {
833
833
  style: {
@@ -853,26 +853,26 @@ function st({
853
853
  background: "#ffffff",
854
854
  padding: 32,
855
855
  borderRadius: C.md,
856
- ...l
856
+ ...o
857
857
  },
858
858
  children: /* @__PURE__ */ t(_, { active: s, title: { width: "40%" }, paragraph: { rows: n } })
859
859
  }
860
860
  );
861
861
  }
862
- function ct({
862
+ function We({
863
863
  value: e,
864
864
  onChange: n,
865
865
  onSearch: s,
866
- placeholder: l = "搜索...",
866
+ placeholder: o = "搜索...",
867
867
  debounceMs: c = 300,
868
868
  width: a = 280,
869
869
  allowClear: r = !0,
870
870
  // antd v6: enterButton 已被废弃,SearchInput 已通过 onKeyDown 自行处理 Enter 键,
871
871
  // 所以从 rest 里过滤掉,避免透传到原生 <input> 报 React 警告。
872
- enterButton: o,
872
+ enterButton: l,
873
873
  ...i
874
874
  }) {
875
- const [d, f] = A(e || ""), g = M(null), p = M(e || "");
875
+ const [d, f] = z(e || ""), g = H(null), p = H(e || "");
876
876
  D(() => {
877
877
  e !== void 0 && e !== d && (f(e || ""), p.current = e || "");
878
878
  }, [e]), D(() => () => {
@@ -880,31 +880,31 @@ function ct({
880
880
  }, []);
881
881
  const h = (S) => {
882
882
  p.current = S, n && n(S);
883
- }, w = (S) => {
884
- const k = S.target.value;
885
- if (f(k), g.current && clearTimeout(g.current), k === "") {
883
+ }, k = (S) => {
884
+ const w = S.target.value;
885
+ if (f(w), g.current && clearTimeout(g.current), w === "") {
886
886
  h("");
887
887
  return;
888
888
  }
889
- g.current = setTimeout(() => h(k), c);
889
+ g.current = setTimeout(() => h(w), c);
890
890
  }, v = (S) => {
891
891
  g.current && clearTimeout(g.current), h(S), s && s(S);
892
892
  };
893
893
  return /* @__PURE__ */ t(
894
- Ce,
894
+ Te,
895
895
  {
896
896
  ...i,
897
897
  value: d,
898
- onChange: w,
898
+ onChange: k,
899
899
  onPressEnter: v,
900
900
  onKeyDown: (S) => {
901
901
  S.key === "Enter" ? (S.preventDefault(), v(d)) : S.key === "Escape" && (f(""), v(""));
902
902
  },
903
- placeholder: l,
903
+ placeholder: o,
904
904
  allowClear: r ? { clearIcon: /* @__PURE__ */ t("span", { onClick: () => {
905
905
  f(""), v("");
906
906
  }, children: "×" }) } : !1,
907
- prefix: /* @__PURE__ */ t(Ae, { style: { color: "#9ca3af" } }),
907
+ prefix: /* @__PURE__ */ t(ze, { style: { color: "#9ca3af" } }),
908
908
  style: {
909
909
  width: a,
910
910
  borderRadius: C.md,
@@ -913,15 +913,91 @@ function ct({
913
913
  }
914
914
  );
915
915
  }
916
- function me({
916
+ function Me(e, n, s) {
917
+ const o = Array.isArray(e) ? e : [], c = String(s ?? "").trim().toLowerCase();
918
+ if (!c) return o;
919
+ const a = (Array.isArray(n) ? n : String(n || "").split(",")).map((r) => String(r || "").trim()).filter(Boolean);
920
+ return a.length ? o.filter((r) => !r || typeof r != "object" ? !1 : a.some((l) => {
921
+ const i = r[l];
922
+ return i == null ? !1 : String(i).toLowerCase().includes(c);
923
+ })) : o;
924
+ }
925
+ function He(e, n) {
926
+ const [s, o] = z(""), c = (Array.isArray(n) ? n.join(",") : String(n || "")).trim(), a = q(
927
+ () => Me(e, c, s),
928
+ [e, c, s]
929
+ ), r = be(() => o(""), []);
930
+ return { keyword: s, setKeyword: o, filtered: a, reset: r };
931
+ }
932
+ const Ne = {
933
+ pageSize: 10,
934
+ showSizeChanger: !0,
935
+ pageSizeOptions: ["10", "20", "50", "100"],
936
+ showTotal: (e) => `共 ${e} 条`
937
+ };
938
+ function ut({
939
+ rows: e,
940
+ columns: n,
941
+ rowKey: s,
942
+ loading: o,
943
+ searchKeys: c,
944
+ searchPlaceholder: a = "过滤",
945
+ searchWidth: r = 220,
946
+ cardTitle: l,
947
+ cardExtra: i,
948
+ emptyTitle: d = "暂无数据",
949
+ emptyDescription: f,
950
+ emptyActionText: g,
951
+ emptyOnAction: p,
952
+ pagination: h = Ne,
953
+ cardProps: k = {},
954
+ tableProps: v = {},
955
+ ...A
956
+ }) {
957
+ const { keyword: b, setKeyword: S, filtered: w } = He(e, c);
958
+ return /* @__PURE__ */ t(me, { title: l, extra: (c ? /* @__PURE__ */ t(
959
+ We,
960
+ {
961
+ allowClear: !0,
962
+ width: r,
963
+ placeholder: a,
964
+ value: b,
965
+ onChange: S
966
+ }
967
+ ) : null) || i, ...k, children: /* @__PURE__ */ t(
968
+ ye,
969
+ {
970
+ rowKey: s,
971
+ columns: n,
972
+ dataSource: w,
973
+ loading: o,
974
+ size: "small",
975
+ pagination: h,
976
+ locale: {
977
+ emptyText: /* @__PURE__ */ t(
978
+ ne,
979
+ {
980
+ title: d,
981
+ description: f,
982
+ actionText: g,
983
+ onAction: p
984
+ }
985
+ )
986
+ },
987
+ ...v,
988
+ ...A
989
+ }
990
+ ) });
991
+ }
992
+ function ve({
917
993
  title: e,
918
994
  subtitle: n,
919
995
  breadcrumb: s,
920
- extra: l,
996
+ extra: o,
921
997
  back: c,
922
998
  onBack: a
923
999
  }) {
924
- const r = he();
1000
+ const r = xe();
925
1001
  return /* @__PURE__ */ t("div", { style: {
926
1002
  marginBottom: 12,
927
1003
  paddingBottom: 10,
@@ -972,7 +1048,7 @@ function me({
972
1048
  }
973
1049
  ),
974
1050
  s && s.length > 0 ? /* @__PURE__ */ t(
975
- Re,
1051
+ Ee,
976
1052
  {
977
1053
  items: s.map((i, d) => {
978
1054
  const f = d === s.length - 1;
@@ -1002,14 +1078,14 @@ function me({
1002
1078
  maxWidth: 360
1003
1079
  }, children: n })
1004
1080
  ] }),
1005
- l && /* @__PURE__ */ t("div", { style: {
1081
+ o && /* @__PURE__ */ t("div", { style: {
1006
1082
  display: "flex",
1007
1083
  gap: 8,
1008
1084
  flexShrink: 0
1009
- }, children: l })
1085
+ }, children: o })
1010
1086
  ] }) });
1011
1087
  }
1012
- function dt({ left: e, right: n, extra: s }) {
1088
+ function pt({ left: e, right: n, extra: s }) {
1013
1089
  return /* @__PURE__ */ m(
1014
1090
  "div",
1015
1091
  {
@@ -1022,8 +1098,8 @@ function dt({ left: e, right: n, extra: s }) {
1022
1098
  flexWrap: "wrap"
1023
1099
  },
1024
1100
  children: [
1025
- /* @__PURE__ */ t(ae, { size: 8, wrap: !0, children: e }),
1026
- /* @__PURE__ */ m(ae, { size: 8, wrap: !0, children: [
1101
+ /* @__PURE__ */ t(se, { size: 8, wrap: !0, children: e }),
1102
+ /* @__PURE__ */ m(se, { size: 8, wrap: !0, children: [
1027
1103
  n,
1028
1104
  s
1029
1105
  ] })
@@ -1031,60 +1107,60 @@ function dt({ left: e, right: n, extra: s }) {
1031
1107
  }
1032
1108
  );
1033
1109
  }
1034
- function ft({ onClick: e, loading: n, title: s = "刷新" }) {
1110
+ function ht({ onClick: e, loading: n, title: s = "刷新" }) {
1035
1111
  return /* @__PURE__ */ t(V, { icon: /* @__PURE__ */ t(re, {}), onClick: e, loading: n, title: s, children: s });
1036
1112
  }
1037
- const Le = {
1113
+ const Pe = {
1038
1114
  0: { label: "待办", color: "default" },
1039
1115
  1: { label: "进行中", color: "blue" },
1040
1116
  2: { label: "已完成", color: "green" }
1041
- }, Me = {
1117
+ }, _e = {
1042
1118
  ACTIVE: { label: "正常", color: "green" },
1043
1119
  INACTIVE: { label: "禁用", color: "red" },
1044
1120
  ENABLED: { label: "启用", color: "green" },
1045
1121
  DISABLED: { label: "禁用", color: "red" }
1046
- }, He = {
1122
+ }, Oe = {
1047
1123
  low: { label: "低", color: "default" },
1048
1124
  medium: { label: "中", color: "orange" },
1049
1125
  high: { label: "高", color: "red" },
1050
1126
  1: { label: "低", color: "default" },
1051
1127
  2: { label: "中", color: "orange" },
1052
1128
  3: { label: "高", color: "red" }
1053
- }, Pe = {
1129
+ }, Fe = {
1054
1130
  PENDING: { label: "待审批", color: "orange" },
1055
1131
  APPROVED: { label: "已通过", color: "green" },
1056
1132
  REJECTED: { label: "已拒绝", color: "red" },
1057
1133
  CANCELLED: { label: "已撤回", color: "default" }
1058
- }, Ne = {
1134
+ }, je = {
1059
1135
  RUNNING: { label: "运行中", color: "green" },
1060
1136
  PAUSED: { label: "已暂停", color: "orange" },
1061
1137
  STOPPED: { label: "已停止", color: "default" },
1062
1138
  FAILED: { label: "失败", color: "red" },
1063
1139
  SUCCESS: { label: "成功", color: "green" }
1064
- }, _e = {
1065
- task: Le,
1066
- model: Me,
1067
- priority: He,
1068
- approval: Pe,
1069
- schedule: Ne
1140
+ }, qe = {
1141
+ task: Pe,
1142
+ model: _e,
1143
+ priority: Oe,
1144
+ approval: Fe,
1145
+ schedule: je
1070
1146
  };
1071
- function gt({ status: e, type: n = "task", mapping: s, ...l }) {
1072
- const a = (s || _e[n] || {})[e];
1073
- return a ? /* @__PURE__ */ t(se, { color: a.color, ...l, children: a.label }) : /* @__PURE__ */ t(se, { ...l, children: String(e) });
1147
+ function bt({ status: e, type: n = "task", mapping: s, ...o }) {
1148
+ const a = (s || qe[n] || {})[e];
1149
+ return a ? /* @__PURE__ */ t(ce, { color: a.color, ...o, children: a.label }) : /* @__PURE__ */ t(ce, { ...o, children: String(e) });
1074
1150
  }
1075
- function ut({ title: e, description: n, load: s, columns: l, rowKey: c = "id", extra: a, expandable: r }) {
1076
- const [o, i] = A([]), [d, f] = A({ current: 1, size: 10, total: null }), [g, p] = A(!1), [h, w] = A(null), v = ke(async (b = d.current, S = d.size) => {
1077
- p(!0), w(null);
1151
+ function mt({ title: e, description: n, load: s, columns: o, rowKey: c = "id", extra: a, expandable: r }) {
1152
+ const [l, i] = z([]), [d, f] = z({ current: 1, size: 10, total: null }), [g, p] = z(!1), [h, k] = z(null), v = be(async (b = d.current, S = d.size) => {
1153
+ p(!0), k(null);
1078
1154
  try {
1079
- const k = await s(b, S);
1080
- if (Array.isArray(k))
1081
- i(k || []), f({ current: b, size: S, total: k.length });
1155
+ const w = await s(b, S);
1156
+ if (Array.isArray(w))
1157
+ i(w || []), f({ current: b, size: S, total: w.length });
1082
1158
  else {
1083
- const P = (k == null ? void 0 : k.records) || [];
1084
- i(P), f({ current: b, size: S, total: (k == null ? void 0 : k.total) == null ? null : Number(k.total) });
1159
+ const L = (w == null ? void 0 : w.records) || [];
1160
+ i(L), f({ current: b, size: S, total: (w == null ? void 0 : w.total) == null ? null : Number(w.total) });
1085
1161
  }
1086
- } catch (k) {
1087
- i([]), w(k);
1162
+ } catch (w) {
1163
+ i([]), k(w);
1088
1164
  } finally {
1089
1165
  p(!1);
1090
1166
  }
@@ -1092,11 +1168,11 @@ function ut({ title: e, description: n, load: s, columns: l, rowKey: c = "id", e
1092
1168
  D(() => {
1093
1169
  v(1);
1094
1170
  }, []);
1095
- const B = d.total != null && d.total > 0;
1171
+ const A = d.total != null && d.total > 0;
1096
1172
  return /* @__PURE__ */ m("div", { children: [
1097
- /* @__PURE__ */ t(me, { title: e, subtitle: n }),
1173
+ /* @__PURE__ */ t(ve, { title: e, subtitle: n }),
1098
1174
  /* @__PURE__ */ m(
1099
- Te,
1175
+ me,
1100
1176
  {
1101
1177
  extra: /* @__PURE__ */ t(
1102
1178
  V,
@@ -1109,24 +1185,24 @@ function ut({ title: e, description: n, load: s, columns: l, rowKey: c = "id", e
1109
1185
  ),
1110
1186
  children: [
1111
1187
  a,
1112
- h ? /* @__PURE__ */ t(We, { error: h, onRetry: () => v(d.current, d.size), type: "inline" }) : /* @__PURE__ */ t(
1113
- Ee,
1188
+ h ? /* @__PURE__ */ t($e, { error: h, onRetry: () => v(d.current, d.size), type: "inline" }) : /* @__PURE__ */ t(
1189
+ ye,
1114
1190
  {
1115
1191
  size: "small",
1116
- columns: l,
1117
- dataSource: o,
1192
+ columns: o,
1193
+ dataSource: l,
1118
1194
  loading: g,
1119
1195
  rowKey: (b) => (b == null ? void 0 : b[c]) ?? (b == null ? void 0 : b.key) ?? JSON.stringify(b).slice(0, 32),
1120
1196
  pagination: {
1121
1197
  current: d.current,
1122
1198
  pageSize: d.size,
1123
- total: B ? d.total : o.length,
1199
+ total: A ? d.total : l.length,
1124
1200
  showSizeChanger: !0,
1125
- showTotal: () => B ? `共 ${d.total} 条` : `本页 ${o.length} 条(接口 total 未返回有效值)`
1201
+ showTotal: () => A ? `共 ${d.total} 条` : `本页 ${l.length} 条(接口 total 未返回有效值)`
1126
1202
  },
1127
1203
  onChange: (b) => v(b.current, b.pageSize),
1128
1204
  expandable: r,
1129
- locale: { emptyText: /* @__PURE__ */ t(be, { title: "暂无数据", description: "接口返回空列表" }) }
1205
+ locale: { emptyText: /* @__PURE__ */ t(ne, { title: "暂无数据", description: "接口返回空列表" }) }
1130
1206
  }
1131
1207
  )
1132
1208
  ]
@@ -1134,104 +1210,104 @@ function ut({ title: e, description: n, load: s, columns: l, rowKey: c = "id", e
1134
1210
  )
1135
1211
  ] });
1136
1212
  }
1137
- const Oe = 240, de = 96, Fe = { behavior: "smooth", block: "start" }, je = `
1213
+ const Ge = 240, fe = 96, Ue = { behavior: "smooth", block: "start" }, Ye = `
1138
1214
  .zfc-doc-table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
1139
1215
  @media (max-width: 800px) { .zfc-doc-table-wrap > table { min-width: 520px; } }
1140
- `, qe = (e) => String(e || "").trim().toLowerCase().replace(/\s+/g, "-").replace(/[^\p{L}\p{N}\p{M}\p{Pc}-]/gu, "").replace(/-+/g, "-").replace(/^-|-$/g, ""), ne = (e) => String(e || "").replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/`([^`]*)`/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/__([^_]+)__/g, "$1").replace(/\*([^*]+)\*/g, "$1").trim(), ye = () => {
1216
+ `, Ke = (e) => String(e || "").trim().toLowerCase().replace(/\s+/g, "-").replace(/[^\p{L}\p{N}\p{M}\p{Pc}-]/gu, "").replace(/-+/g, "-").replace(/^-|-$/g, ""), ie = (e) => String(e || "").replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/`([^`]*)`/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/__([^_]+)__/g, "$1").replace(/\*([^*]+)\*/g, "$1").trim(), Se = () => {
1141
1217
  const e = /* @__PURE__ */ new Map();
1142
1218
  let n = 0;
1143
1219
  return (s) => {
1144
1220
  n += 1;
1145
- const l = qe(s) || `section-${n}`, c = e.get(l) || 0;
1146
- return e.set(l, c + 1), c > 0 ? `${l}-${c}` : l;
1221
+ const o = Ke(s) || `section-${n}`, c = e.get(o) || 0;
1222
+ return e.set(o, c + 1), c > 0 ? `${o}-${c}` : o;
1147
1223
  };
1148
- }, Ye = (e) => {
1149
- const n = [], s = ye();
1150
- let l = !1;
1224
+ }, Ve = (e) => {
1225
+ const n = [], s = Se();
1226
+ let o = !1;
1151
1227
  for (const c of String(e || "").split(`
1152
1228
  `)) {
1153
1229
  const a = c.replace(/\s+$/, "");
1154
1230
  if (/^\s*(```|~~~)/.test(a)) {
1155
- l = !l;
1231
+ o = !o;
1156
1232
  continue;
1157
1233
  }
1158
- if (l) continue;
1234
+ if (o) continue;
1159
1235
  const r = /^(#{1,6})[ \t]+(.+?)[ \t]*#*[ \t]*$/.exec(a);
1160
1236
  if (!r) continue;
1161
- const o = r[1].length;
1162
- if (o > 3) continue;
1163
- const i = ne(r[2]);
1164
- i && n.push({ level: o, text: i, id: s(i) });
1237
+ const l = r[1].length;
1238
+ if (l > 3) continue;
1239
+ const i = ie(r[2]);
1240
+ i && n.push({ level: l, text: i, id: s(i) });
1165
1241
  }
1166
1242
  return n;
1167
- }, X = (e) => e == null || typeof e == "boolean" ? "" : typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(X).join("") : e.props ? X(e.props.children) : "", fe = (e) => String(e).replace(/["\\]/g, "\\$&"), ge = (e, n = Fe) => !e || typeof e.scrollIntoView != "function" ? !1 : (e.scrollIntoView(n), !0), Z = /^\s*(`{3,}|~{3,})\s*([\w+#-]*)\s*$/, ee = /^(#{1,6})\s+(.*?)\s*#*$/, te = /^\s*([-*_])\s*(\1\s*){2,}$/, F = /^(\s*)([-*+]|\d+[.)])(\s+)(.*)$/, U = /^\s*>\s?(.*)$/, Ge = /(!?\[([^\]]*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)|`([^`]+)`|\*\*([^*]+)\*\*|__([^_]+)__|~~([^~]+)~~|\*([^*\n]+)\*|<((?:https?:\/\/|mailto:)[^>\s]+)>)/g, K = (e) => {
1243
+ }, X = (e) => e == null || typeof e == "boolean" ? "" : typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(X).join("") : e.props ? X(e.props.children) : "", ge = (e) => String(e).replace(/["\\]/g, "\\$&"), ue = (e, n = Ue) => !e || typeof e.scrollIntoView != "function" ? !1 : (e.scrollIntoView(n), !0), Z = /^\s*(`{3,}|~{3,})\s*([\w+#-]*)\s*$/, ee = /^(#{1,6})\s+(.*?)\s*#*$/, te = /^\s*([-*_])\s*(\1\s*){2,}$/, F = /^(\s*)([-*+]|\d+[.)])(\s+)(.*)$/, Y = /^\s*>\s?(.*)$/, Je = /(!?\[([^\]]*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)|`([^`]+)`|\*\*([^*]+)\*\*|__([^_]+)__|~~([^~]+)~~|\*([^*\n]+)\*|<((?:https?:\/\/|mailto:)[^>\s]+)>)/g, K = (e) => {
1168
1244
  let n = String(e).trim();
1169
1245
  return n.startsWith("|") && (n = n.slice(1)), n.endsWith("|") && (n = n.slice(0, -1)), n.split("|").map((s) => s.trim());
1170
- }, Ue = (e) => {
1246
+ }, Qe = (e) => {
1171
1247
  if (!String(e).includes("-")) return !1;
1172
1248
  const n = K(e);
1173
1249
  return n.length > 0 && n.every((s) => /^:?-+:?$/.test(s));
1174
- }, Ke = (e) => {
1250
+ }, Xe = (e) => {
1175
1251
  const n = e.startsWith(":"), s = e.endsWith(":");
1176
1252
  return n && s ? "center" : s ? "right" : "left";
1177
- }, Ve = (e, n) => {
1178
- const s = F.exec(e[n]), l = /\d/.test(s[2]), c = [];
1253
+ }, Ze = (e, n) => {
1254
+ const s = F.exec(e[n]), o = /\d/.test(s[2]), c = [];
1179
1255
  let a = n;
1180
1256
  for (; a < e.length; ) {
1181
1257
  const r = F.exec(e[a]);
1182
1258
  if (!r) break;
1183
- const o = r[1].length, i = o + r[2].length + r[3].length, d = [r[4]];
1259
+ const l = r[1].length, i = l + r[2].length + r[3].length, d = [r[4]];
1184
1260
  for (a += 1; a < e.length; ) {
1185
1261
  const f = e[a];
1186
1262
  if (!f.trim()) {
1187
1263
  let h = a;
1188
1264
  for (; h < e.length && !e[h].trim(); ) h += 1;
1189
- const w = h < e.length ? F.exec(e[h]) : null;
1190
- if (w && w[1].length >= o) {
1265
+ const k = h < e.length ? F.exec(e[h]) : null;
1266
+ if (k && k[1].length >= l) {
1191
1267
  a = h;
1192
1268
  continue;
1193
1269
  }
1194
1270
  break;
1195
1271
  }
1196
1272
  const g = /^[ \t]*/.exec(f)[0].length, p = F.exec(f);
1197
- if (p && p[1].length <= o) break;
1273
+ if (p && p[1].length <= l) break;
1198
1274
  if (g >= i) {
1199
1275
  d.push(f.slice(i)), a += 1;
1200
1276
  continue;
1201
1277
  }
1202
- if (g > o) {
1278
+ if (g > l) {
1203
1279
  d.push(f.slice(g)), a += 1;
1204
1280
  continue;
1205
1281
  }
1206
- if (!p && !Z.test(f) && !ee.test(f) && !te.test(f) && !U.test(f)) {
1282
+ if (!p && !Z.test(f) && !ee.test(f) && !te.test(f) && !Y.test(f)) {
1207
1283
  d.push(f.trim()), a += 1;
1208
1284
  continue;
1209
1285
  }
1210
1286
  break;
1211
1287
  }
1212
- c.push({ blocks: xe(d, !0) });
1288
+ c.push({ blocks: we(d, !0) });
1213
1289
  }
1214
- return { block: { type: "list", ordered: l, items: c }, next: a };
1290
+ return { block: { type: "list", ordered: o, items: c }, next: a };
1215
1291
  };
1216
- function xe(e, n = !1) {
1292
+ function we(e, n = !1) {
1217
1293
  const s = [];
1218
- let l = 0;
1219
- for (; l < e.length; ) {
1220
- const c = e[l];
1294
+ let o = 0;
1295
+ for (; o < e.length; ) {
1296
+ const c = e[o];
1221
1297
  if (!c.trim()) {
1222
- l += 1;
1298
+ o += 1;
1223
1299
  continue;
1224
1300
  }
1225
1301
  const a = Z.exec(c);
1226
1302
  if (a) {
1227
1303
  const i = a[1][0], d = a[1].length, f = [];
1228
- for (l += 1; l < e.length; ) {
1229
- const g = e[l];
1304
+ for (o += 1; o < e.length; ) {
1305
+ const g = e[o];
1230
1306
  if (new RegExp(`^\\s*\\${i}{${d},}\\s*$`).test(g)) {
1231
- l += 1;
1307
+ o += 1;
1232
1308
  break;
1233
1309
  }
1234
- f.push(g), l += 1;
1310
+ f.push(g), o += 1;
1235
1311
  }
1236
1312
  s.push({ type: "code", lang: a[2] || "", text: f.join(`
1237
1313
  `) });
@@ -1239,104 +1315,104 @@ function xe(e, n = !1) {
1239
1315
  }
1240
1316
  const r = ee.exec(c);
1241
1317
  if (r) {
1242
- if (l += 1, !ne(r[2]).trim()) continue;
1318
+ if (o += 1, !ie(r[2]).trim()) continue;
1243
1319
  n ? s.push({ type: "paragraph", text: r[2] }) : s.push({ type: "heading", level: r[1].length, text: r[2] });
1244
1320
  continue;
1245
1321
  }
1246
1322
  if (te.test(c)) {
1247
- s.push({ type: "hr" }), l += 1;
1323
+ s.push({ type: "hr" }), o += 1;
1248
1324
  continue;
1249
1325
  }
1250
- if (c.includes("|") && l + 1 < e.length && Ue(e[l + 1])) {
1251
- const i = K(c), d = K(e[l + 1]).map(Ke);
1252
- l += 2;
1326
+ if (c.includes("|") && o + 1 < e.length && Qe(e[o + 1])) {
1327
+ const i = K(c), d = K(e[o + 1]).map(Xe);
1328
+ o += 2;
1253
1329
  const f = [];
1254
- for (; l < e.length && e[l].trim() && e[l].includes("|"); )
1255
- f.push(K(e[l])), l += 1;
1330
+ for (; o < e.length && e[o].trim() && e[o].includes("|"); )
1331
+ f.push(K(e[o])), o += 1;
1256
1332
  s.push({ type: "table", header: i, aligns: d, rows: f });
1257
1333
  continue;
1258
1334
  }
1259
- if (U.test(c)) {
1335
+ if (Y.test(c)) {
1260
1336
  const i = [];
1261
- for (; l < e.length; ) {
1262
- const d = U.exec(e[l]);
1337
+ for (; o < e.length; ) {
1338
+ const d = Y.exec(e[o]);
1263
1339
  if (!d) break;
1264
- i.push(d[1]), l += 1;
1340
+ i.push(d[1]), o += 1;
1265
1341
  }
1266
1342
  s.push({ type: "quote", lines: i });
1267
1343
  continue;
1268
1344
  }
1269
1345
  if (F.test(c)) {
1270
- const i = Ve(e, l);
1271
- s.push(i.block), l = i.next;
1346
+ const i = Ze(e, o);
1347
+ s.push(i.block), o = i.next;
1272
1348
  continue;
1273
1349
  }
1274
- const o = [];
1275
- for (; l < e.length; ) {
1276
- const i = e[l];
1277
- if (!i.trim() || o.length && (Z.test(i) || ee.test(i) || te.test(i) || F.test(i) || U.test(i))) break;
1278
- o.push(i.trim()), l += 1;
1350
+ const l = [];
1351
+ for (; o < e.length; ) {
1352
+ const i = e[o];
1353
+ if (!i.trim() || l.length && (Z.test(i) || ee.test(i) || te.test(i) || F.test(i) || Y.test(i))) break;
1354
+ l.push(i.trim()), o += 1;
1279
1355
  }
1280
- s.push({ type: "paragraph", text: o.join(" ") });
1356
+ s.push({ type: "paragraph", text: l.join(" ") });
1281
1357
  }
1282
1358
  return s;
1283
1359
  }
1284
1360
  const I = (e, n) => {
1285
1361
  const s = [];
1286
- let l = 0, c = 0;
1362
+ let o = 0, c = 0;
1287
1363
  const a = (r) => s.push(/* @__PURE__ */ t(O, { children: r }, `i${c++}`));
1288
- for (const r of e.matchAll(Ge)) {
1289
- if (r.index > l && a(e.slice(l, r.index)), r[1] !== void 0)
1364
+ for (const r of e.matchAll(Je)) {
1365
+ if (r.index > o && a(e.slice(o, r.index)), r[1] !== void 0)
1290
1366
  if (r[0].startsWith("!"))
1291
1367
  a(n.img ? n.img({ src: r[3], alt: r[2] }) : /* @__PURE__ */ t("img", { src: r[3], alt: r[2] || "" }));
1292
1368
  else {
1293
- const o = I(r[2], n);
1294
- a(n.a ? n.a({ href: r[3], children: o }) : /* @__PURE__ */ t("a", { href: r[3], children: o }));
1369
+ const l = I(r[2], n);
1370
+ a(n.a ? n.a({ href: r[3], children: l }) : /* @__PURE__ */ t("a", { href: r[3], children: l }));
1295
1371
  }
1296
1372
  else r[4] !== void 0 ? a(n.code ? n.code({ children: r[4] }) : /* @__PURE__ */ t("code", { children: r[4] })) : r[5] !== void 0 ? a(/* @__PURE__ */ t("strong", { children: I(r[5], n) })) : r[6] !== void 0 ? a(/* @__PURE__ */ t("strong", { children: I(r[6], n) })) : r[7] !== void 0 ? a(/* @__PURE__ */ t("del", { children: I(r[7], n) })) : r[8] !== void 0 ? a(/* @__PURE__ */ t("em", { children: I(r[8], n) })) : r[9] !== void 0 && a(n.a ? n.a({ href: r[9], children: r[9] }) : /* @__PURE__ */ t("a", { href: r[9], children: r[9] }));
1297
- l = r.index + r[0].length;
1373
+ o = r.index + r[0].length;
1298
1374
  }
1299
- return l < e.length && a(e.slice(l)), s;
1300
- }, ve = (e, n, s) => {
1301
- const l = [];
1375
+ return o < e.length && a(e.slice(o)), s;
1376
+ }, ke = (e, n, s) => {
1377
+ const o = [];
1302
1378
  return e.forEach((c, a) => {
1303
- const r = `b${a}`, o = (i) => l.push(/* @__PURE__ */ t(O, { children: i }, r));
1379
+ const r = `b${a}`, l = (i) => o.push(/* @__PURE__ */ t(O, { children: i }, r));
1304
1380
  if (c.type === "heading") {
1305
- const i = Math.min(c.level, 6), d = `h${i}`, f = n[d], g = I(c.text, n), p = i <= 3 ? s(ne(c.text)) : void 0;
1306
- o(f ? f({ children: g, id: p }) : le(d, { id: p }, g));
1381
+ const i = Math.min(c.level, 6), d = `h${i}`, f = n[d], g = I(c.text, n), p = i <= 3 ? s(ie(c.text)) : void 0;
1382
+ l(f ? f({ children: g, id: p }) : ae(d, { id: p }, g));
1307
1383
  } else if (c.type === "paragraph") {
1308
1384
  const i = I(c.text, n);
1309
- o(n.p ? n.p({ children: i }) : /* @__PURE__ */ t("p", { children: i }));
1385
+ l(n.p ? n.p({ children: i }) : /* @__PURE__ */ t("p", { children: i }));
1310
1386
  } else if (c.type === "code") {
1311
1387
  const i = /* @__PURE__ */ t("code", { className: c.lang ? `language-${c.lang}` : void 0, children: c.text });
1312
- o(n.pre ? n.pre({ children: i }) : /* @__PURE__ */ t("pre", { children: i }));
1388
+ l(n.pre ? n.pre({ children: i }) : /* @__PURE__ */ t("pre", { children: i }));
1313
1389
  } else if (c.type === "list") {
1314
1390
  const i = c.ordered ? "ol" : "ul", d = n[i], f = c.items.map((g, p) => {
1315
- const h = ve(g.blocks, n, s), w = n.li ? n.li({ children: h }) : /* @__PURE__ */ t("li", { children: h });
1316
- return /* @__PURE__ */ t(O, { children: w }, `li${p}`);
1391
+ const h = ke(g.blocks, n, s), k = n.li ? n.li({ children: h }) : /* @__PURE__ */ t("li", { children: h });
1392
+ return /* @__PURE__ */ t(O, { children: k }, `li${p}`);
1317
1393
  });
1318
- o(d ? d({ children: f }) : le(i, null, f));
1394
+ l(d ? d({ children: f }) : ae(i, null, f));
1319
1395
  } else if (c.type === "table") {
1320
1396
  const i = /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { children: c.header.map((g, p) => {
1321
1397
  const h = n.th ? n.th({ children: I(g, n), align: c.aligns[p] }) : /* @__PURE__ */ t("th", { children: g });
1322
1398
  return /* @__PURE__ */ t(O, { children: h }, `th${p}`);
1323
- }) }) }, "thead"), d = /* @__PURE__ */ t("tbody", { children: c.rows.map((g, p) => /* @__PURE__ */ t("tr", { children: g.map((h, w) => {
1324
- const v = n.td ? n.td({ children: I(h, n), align: c.aligns[w] }) : /* @__PURE__ */ t("td", { children: h });
1325
- return /* @__PURE__ */ t(O, { children: v }, `td${w}`);
1399
+ }) }) }, "thead"), d = /* @__PURE__ */ t("tbody", { children: c.rows.map((g, p) => /* @__PURE__ */ t("tr", { children: g.map((h, k) => {
1400
+ const v = n.td ? n.td({ children: I(h, n), align: c.aligns[k] }) : /* @__PURE__ */ t("td", { children: h });
1401
+ return /* @__PURE__ */ t(O, { children: v }, `td${k}`);
1326
1402
  }) }, `tr${p}`)) }, "tbody"), f = n.table ? n.table({ children: [i, d] }) : /* @__PURE__ */ t("table", { children: [i, d] });
1327
- o(f);
1403
+ l(f);
1328
1404
  } else if (c.type === "quote") {
1329
1405
  const i = c.lines.filter((d) => d.trim()).map((d, f) => {
1330
1406
  const g = n.p ? n.p({ children: I(d, n) }) : /* @__PURE__ */ t("p", { children: d });
1331
1407
  return /* @__PURE__ */ t(O, { children: g }, `q${f}`);
1332
1408
  });
1333
- o(n.blockquote ? n.blockquote({ children: i }) : /* @__PURE__ */ t("blockquote", { children: i }));
1334
- } else c.type === "hr" && o(n.hr ? n.hr({}) : /* @__PURE__ */ t("hr", {}));
1335
- }), l;
1336
- }, Je = (e, n = {}) => ve(xe(String(e || "").split(`
1337
- `)), n, ye());
1338
- let ue = null;
1339
- const pe = /* @__PURE__ */ new Set(), Qe = ({ navigate: e, Prism: n, oneDark: s, onAnchorClick: l }) => {
1409
+ l(n.blockquote ? n.blockquote({ children: i }) : /* @__PURE__ */ t("blockquote", { children: i }));
1410
+ } else c.type === "hr" && l(n.hr ? n.hr({}) : /* @__PURE__ */ t("hr", {}));
1411
+ }), o;
1412
+ }, et = (e, n = {}) => ke(we(String(e || "").split(`
1413
+ `)), n, Se());
1414
+ let pe = null;
1415
+ const he = /* @__PURE__ */ new Set(), tt = ({ navigate: e, Prism: n, oneDark: s, onAnchorClick: o }) => {
1340
1416
  const c = {
1341
1417
  background: T.primarySoft,
1342
1418
  color: T.primary,
@@ -1346,7 +1422,7 @@ const pe = /* @__PURE__ */ new Set(), Qe = ({ navigate: e, Prism: n, oneDark: s,
1346
1422
  fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace"
1347
1423
  };
1348
1424
  return {
1349
- h1: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("h1", { ...o, style: {
1425
+ h1: ({ node: a, children: r, ...l }) => /* @__PURE__ */ t("h1", { ...l, style: {
1350
1426
  fontSize: 22,
1351
1427
  fontWeight: 700,
1352
1428
  margin: "8px 0 16px",
@@ -1354,56 +1430,56 @@ const pe = /* @__PURE__ */ new Set(), Qe = ({ navigate: e, Prism: n, oneDark: s,
1354
1430
  paddingBottom: 8,
1355
1431
  scrollMarginTop: 16
1356
1432
  }, children: r }),
1357
- h2: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("h2", { ...o, style: {
1433
+ h2: ({ node: a, children: r, ...l }) => /* @__PURE__ */ t("h2", { ...l, style: {
1358
1434
  fontSize: 18,
1359
1435
  fontWeight: 700,
1360
1436
  margin: "24px 0 12px",
1361
1437
  color: x.text,
1362
1438
  scrollMarginTop: 16
1363
1439
  }, children: r }),
1364
- h3: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("h3", { ...o, style: {
1440
+ h3: ({ node: a, children: r, ...l }) => /* @__PURE__ */ t("h3", { ...l, style: {
1365
1441
  fontSize: 15,
1366
1442
  fontWeight: 600,
1367
1443
  margin: "16px 0 8px",
1368
1444
  color: "#334155",
1369
1445
  scrollMarginTop: 16
1370
1446
  }, children: r }),
1371
- p: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("p", { ...o, style: { margin: "8px 0", color: "#1f2937" }, children: r }),
1372
- ul: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("ul", { ...o, style: { margin: "8px 0", paddingLeft: 22 }, children: r }),
1373
- ol: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("ol", { ...o, style: { margin: "8px 0", paddingLeft: 22 }, children: r }),
1374
- li: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("li", { ...o, style: { margin: "4px 0" }, children: r }),
1375
- blockquote: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("blockquote", { ...o, style: {
1447
+ p: ({ node: a, children: r, ...l }) => /* @__PURE__ */ t("p", { ...l, style: { margin: "8px 0", color: "#1f2937" }, children: r }),
1448
+ ul: ({ node: a, children: r, ...l }) => /* @__PURE__ */ t("ul", { ...l, style: { margin: "8px 0", paddingLeft: 22 }, children: r }),
1449
+ ol: ({ node: a, children: r, ...l }) => /* @__PURE__ */ t("ol", { ...l, style: { margin: "8px 0", paddingLeft: 22 }, children: r }),
1450
+ li: ({ node: a, children: r, ...l }) => /* @__PURE__ */ t("li", { ...l, style: { margin: "4px 0" }, children: r }),
1451
+ blockquote: ({ node: a, children: r, ...l }) => /* @__PURE__ */ t("blockquote", { ...l, style: {
1376
1452
  margin: "12px 0",
1377
1453
  padding: "8px 14px",
1378
- borderLeft: `3px solid ${L.token.colorPrimary}`,
1454
+ borderLeft: `3px solid ${M.token.colorPrimary}`,
1379
1455
  background: T.primarySoft,
1380
1456
  color: "#475569",
1381
1457
  borderRadius: 4
1382
1458
  }, children: r }),
1383
1459
  hr: () => /* @__PURE__ */ t("hr", { style: { border: "none", borderTop: `1px solid ${x.border}`, margin: "20px 0" } }),
1384
- img: ({ node: a, src: r, alt: o, ...i }) => /* @__PURE__ */ t("img", { ...i, src: r, alt: o || "", style: { maxWidth: "100%", height: "auto", display: "block" } }),
1385
- table: ({ node: a, children: r, ...o }) => (
1460
+ img: ({ node: a, src: r, alt: l, ...i }) => /* @__PURE__ */ t("img", { ...i, src: r, alt: l || "", style: { maxWidth: "100%", height: "auto", display: "block" } }),
1461
+ table: ({ node: a, children: r, ...l }) => (
1386
1462
  // §7:窄屏表格要能横向滚动,不能把列挤成一团
1387
- /* @__PURE__ */ t("div", { className: "zfc-doc-table-wrap", children: /* @__PURE__ */ t("table", { ...o, style: { width: "100%", borderCollapse: "collapse", fontSize: 13 }, children: r }) })
1463
+ /* @__PURE__ */ t("div", { className: "zfc-doc-table-wrap", children: /* @__PURE__ */ t("table", { ...l, style: { width: "100%", borderCollapse: "collapse", fontSize: 13 }, children: r }) })
1388
1464
  ),
1389
- th: ({ node: a, children: r, align: o, ...i }) => /* @__PURE__ */ t("th", { ...i, style: {
1465
+ th: ({ node: a, children: r, align: l, ...i }) => /* @__PURE__ */ t("th", { ...i, style: {
1390
1466
  padding: "8px 10px",
1391
1467
  background: x.surfaceAlt,
1392
1468
  border: `1px solid ${x.border}`,
1393
- textAlign: o || "left",
1469
+ textAlign: l || "left",
1394
1470
  fontWeight: 600,
1395
1471
  color: "#334155"
1396
1472
  }, children: r }),
1397
- td: ({ node: a, children: r, align: o, ...i }) => /* @__PURE__ */ t("td", { ...i, style: {
1473
+ td: ({ node: a, children: r, align: l, ...i }) => /* @__PURE__ */ t("td", { ...i, style: {
1398
1474
  padding: "8px 10px",
1399
1475
  border: `1px solid ${x.border}`,
1400
- textAlign: o || "left",
1476
+ textAlign: l || "left",
1401
1477
  color: "#1f2937"
1402
1478
  }, children: r }),
1403
1479
  pre: ({ node: a, children: r }) => {
1404
- const o = Array.isArray(r) ? r[0] : r;
1405
- o && o.props && o.props.className;
1406
- const i = X(o).replace(/\n$/, "");
1480
+ const l = Array.isArray(r) ? r[0] : r;
1481
+ l && l.props && l.props.className;
1482
+ const i = X(l).replace(/\n$/, "");
1407
1483
  return /* @__PURE__ */ t("pre", { style: {
1408
1484
  margin: "12px 0",
1409
1485
  padding: "12px 14px",
@@ -1414,8 +1490,8 @@ const pe = /* @__PURE__ */ new Set(), Qe = ({ navigate: e, Prism: n, oneDark: s,
1414
1490
  fontSize: 13
1415
1491
  }, children: /* @__PURE__ */ t("code", { style: { background: "transparent", color: "inherit", padding: 0, fontSize: "inherit" }, children: i }) });
1416
1492
  },
1417
- code: ({ node: a, className: r, children: o, ...i }) => /* @__PURE__ */ t("code", { ...i, className: r, style: c, children: o }),
1418
- a: ({ node: a, href: r, children: o, ...i }) => {
1493
+ code: ({ node: a, className: r, children: l, ...i }) => /* @__PURE__ */ t("code", { ...i, className: r, style: c, children: l }),
1494
+ a: ({ node: a, href: r, children: l, ...i }) => {
1419
1495
  const d = r || "";
1420
1496
  return /^https?:\/\//i.test(d) || d.startsWith("//") ? /* @__PURE__ */ t(
1421
1497
  "a",
@@ -1424,60 +1500,60 @@ const pe = /* @__PURE__ */ new Set(), Qe = ({ navigate: e, Prism: n, oneDark: s,
1424
1500
  href: d,
1425
1501
  target: "_blank",
1426
1502
  rel: "noopener noreferrer",
1427
- style: { color: L.token.colorPrimary },
1428
- children: o
1503
+ style: { color: M.token.colorPrimary },
1504
+ children: l
1429
1505
  }
1430
1506
  ) : d.startsWith("#") ? /* @__PURE__ */ t(
1431
1507
  "a",
1432
1508
  {
1433
1509
  ...i,
1434
1510
  href: d,
1435
- style: { color: L.token.colorPrimary },
1436
- onClick: (g) => l(g, d.slice(1)),
1437
- children: o
1511
+ style: { color: M.token.colorPrimary },
1512
+ onClick: (g) => o(g, d.slice(1)),
1513
+ children: l
1438
1514
  }
1439
1515
  ) : d.startsWith("/") ? /* @__PURE__ */ t(
1440
1516
  "a",
1441
1517
  {
1442
1518
  ...i,
1443
1519
  href: d,
1444
- style: { color: L.token.colorPrimary },
1520
+ style: { color: M.token.colorPrimary },
1445
1521
  onClick: (g) => {
1446
1522
  g.preventDefault(), e ? e(d) : typeof window < "u" && (window.location.href = d);
1447
1523
  },
1448
- children: o
1524
+ children: l
1449
1525
  }
1450
- ) : /* @__PURE__ */ t("a", { ...i, href: d, style: { color: L.token.colorPrimary }, children: o });
1526
+ ) : /* @__PURE__ */ t("a", { ...i, href: d, style: { color: M.token.colorPrimary }, children: l });
1451
1527
  }
1452
1528
  };
1453
1529
  };
1454
- function pt({
1530
+ function yt({
1455
1531
  markdown: e,
1456
1532
  title: n,
1457
- tocWidth: s = Oe,
1458
- tocLevels: l = [2],
1533
+ tocWidth: s = Ge,
1534
+ tocLevels: o = [2],
1459
1535
  height: c = "calc(100vh - 120px)",
1460
1536
  markdownComponents: a,
1461
1537
  renderMarkdown: r
1462
1538
  }) {
1463
- const i = De() ? he() : null, d = M(null), f = M(null), g = M(""), p = M(null), [h, w] = A(""), [v, B] = A(0), b = G(() => Ye(e), [e]), S = G(
1464
- () => b.filter((u) => l.includes(u.level)),
1465
- [b, l]
1539
+ const i = De() ? xe() : null, d = H(null), f = H(null), g = H(""), p = H(null), [h, k] = z(""), [v, A] = z(0), b = q(() => Ve(e), [e]), S = q(
1540
+ () => b.filter((u) => o.includes(u.level)),
1541
+ [b, o]
1466
1542
  );
1467
1543
  D(() => {
1468
- const u = () => B((y) => y + 1);
1469
- return pe.add(u), () => {
1470
- pe.delete(u);
1544
+ const u = () => A((y) => y + 1);
1545
+ return he.add(u), () => {
1546
+ he.delete(u);
1471
1547
  };
1472
1548
  }, []);
1473
- const k = (u) => {
1549
+ const w = (u) => {
1474
1550
  g.current = u, p.current && clearTimeout(p.current), p.current = setTimeout(() => {
1475
1551
  g.current = "";
1476
1552
  }, 700);
1477
1553
  };
1478
1554
  D(() => () => {
1479
1555
  p.current && clearTimeout(p.current);
1480
- }, []), we(() => {
1556
+ }, []), Re(() => {
1481
1557
  const u = d.current;
1482
1558
  if (!u) return;
1483
1559
  const y = Array.from(u.querySelectorAll("h1, h2, h3"));
@@ -1492,14 +1568,14 @@ function pt({
1492
1568
  if (!y.length) return;
1493
1569
  const R = () => {
1494
1570
  const Q = u.getBoundingClientRect().top;
1495
- let ie = y[0];
1496
- for (const oe of y)
1497
- if (oe.getBoundingClientRect().top - Q <= de) ie = oe;
1571
+ let oe = y[0];
1572
+ for (const le of y)
1573
+ if (le.getBoundingClientRect().top - Q <= fe) oe = le;
1498
1574
  else break;
1499
- g.current || w(ie.id);
1575
+ g.current || k(oe.id);
1500
1576
  }, $ = new IntersectionObserver(R, {
1501
1577
  root: u,
1502
- rootMargin: `-${de}px 0px 0px 0px`,
1578
+ rootMargin: `-${fe}px 0px 0px 0px`,
1503
1579
  threshold: 0
1504
1580
  });
1505
1581
  y.forEach((Q) => $.observe(Q)), R();
@@ -1512,40 +1588,40 @@ function pt({
1512
1588
  }, [b, v, r]), D(() => {
1513
1589
  const u = f.current;
1514
1590
  if (!u || !h) return;
1515
- const y = u.querySelector(`[data-toc-id="${fe(h)}"]`);
1591
+ const y = u.querySelector(`[data-toc-id="${ge(h)}"]`);
1516
1592
  if (!y) return;
1517
1593
  const R = u.getBoundingClientRect(), $ = y.getBoundingClientRect();
1518
1594
  ($.top < R.top + 24 || $.bottom > R.bottom - 24) && y.scrollIntoView({ block: "nearest", behavior: "smooth" });
1519
1595
  }, [h]);
1520
- const P = (u) => {
1596
+ const L = (u) => {
1521
1597
  const y = d.current;
1522
- return y && y.querySelector(`[data-anchor="${fe(u)}"]`) || (typeof document < "u" ? document.getElementById(u) : null);
1523
- }, N = (u, y) => {
1524
- u.preventDefault(), k(y), ge(P(y)), w(y);
1525
- }, q = (u, y) => {
1526
- u.preventDefault(), k(y), ge(P(y)), w(y);
1527
- }, Y = G(
1528
- () => Qe({
1598
+ return y && y.querySelector(`[data-anchor="${ge(u)}"]`) || (typeof document < "u" ? document.getElementById(u) : null);
1599
+ }, P = (u, y) => {
1600
+ u.preventDefault(), w(y), ue(L(y)), k(y);
1601
+ }, G = (u, y) => {
1602
+ u.preventDefault(), w(y), ue(L(y)), k(y);
1603
+ }, U = q(
1604
+ () => tt({
1529
1605
  navigate: i,
1530
- Prism: ue,
1531
- oneDark: ue,
1532
- onAnchorClick: q
1606
+ Prism: pe,
1607
+ oneDark: pe,
1608
+ onAnchorClick: G
1533
1609
  }),
1534
1610
  // eslint-disable-next-line react-hooks/exhaustive-deps
1535
1611
  [i, v]
1536
- ), j = G(
1537
- () => ({ ...Y, ...a || {} }),
1538
- [Y, a]
1612
+ ), j = q(
1613
+ () => ({ ...U, ...a || {} }),
1614
+ [U, a]
1539
1615
  ), J = () => !e || !String(e).trim() ? /* @__PURE__ */ t(
1540
- be,
1616
+ ne,
1541
1617
  {
1542
1618
  title: "暂无文档",
1543
1619
  description: "把组件说明写成 DOC.md,用编译期 import 的字符串传给 ComponentDoc 即可"
1544
1620
  }
1545
- ) : r ? r({ markdown: e, components: j }) : /* @__PURE__ */ t(Se, { children: Je(e, j) });
1621
+ ) : r ? r({ markdown: e, components: j }) : /* @__PURE__ */ t(Ce, { children: et(e, j) });
1546
1622
  return /* @__PURE__ */ m("div", { style: { display: "flex", flexDirection: "column", minHeight: 0, flex: 1 }, children: [
1547
- /* @__PURE__ */ t("style", { children: je }),
1548
- n ? /* @__PURE__ */ t(me, { title: n }) : null,
1623
+ /* @__PURE__ */ t("style", { children: Ye }),
1624
+ n ? /* @__PURE__ */ t(ve, { title: n }) : null,
1549
1625
  /* @__PURE__ */ m("div", { style: { display: "flex", gap: 16, alignItems: "flex-start", minHeight: 0 }, children: [
1550
1626
  /* @__PURE__ */ m(
1551
1627
  "aside",
@@ -1583,13 +1659,13 @@ function pt({
1583
1659
  "a",
1584
1660
  {
1585
1661
  href: "#" + u.id,
1586
- onClick: (R) => N(R, u.id),
1662
+ onClick: (R) => P(R, u.id),
1587
1663
  style: {
1588
1664
  display: "block",
1589
1665
  padding: "6px 10px",
1590
- borderLeft: `3px solid ${y ? L.token.colorPrimary : "transparent"}`,
1666
+ borderLeft: `3px solid ${y ? M.token.colorPrimary : "transparent"}`,
1591
1667
  background: y ? T.primarySoft : "transparent",
1592
- color: y ? L.token.colorPrimary : "#475569",
1668
+ color: y ? M.token.colorPrimary : "#475569",
1593
1669
  fontWeight: y ? 600 : 400,
1594
1670
  fontSize: 13,
1595
1671
  lineHeight: 1.5,
@@ -1630,28 +1706,32 @@ function pt({
1630
1706
  ] });
1631
1707
  }
1632
1708
  export {
1633
- $e as C,
1634
- at as D,
1635
- be as E,
1636
- lt as F,
1637
- it as G,
1638
- st as L,
1639
- me as P,
1640
- ft as R,
1641
- ct as S,
1642
- dt as T,
1643
- pt as a,
1644
- We as b,
1645
- ut as c,
1646
- ot as d,
1647
- gt as e,
1648
- L as f,
1649
- T as g,
1650
- ce as h,
1651
- H as i,
1652
- nt as l,
1709
+ Le as C,
1710
+ Ne as D,
1711
+ ne as E,
1712
+ dt as F,
1713
+ st as G,
1714
+ ut as L,
1715
+ ve as P,
1716
+ ht as R,
1717
+ We as S,
1718
+ pt as T,
1719
+ yt as a,
1720
+ ft as b,
1721
+ $e as c,
1722
+ gt as d,
1723
+ mt as e,
1724
+ ct as f,
1725
+ bt as g,
1726
+ M as h,
1727
+ T as i,
1728
+ Me as j,
1729
+ de as k,
1730
+ at as l,
1731
+ N as m,
1653
1732
  x as n,
1654
1733
  E as p,
1655
1734
  C as r,
1656
- z as s
1735
+ B as s,
1736
+ He as u
1657
1737
  };