react-docs-ui 0.6.17 → 0.6.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/dist/{AIChatDialog-W60DtiEW.js → AIChatDialog-BnAX3dRn.js} +2 -2
  2. package/dist/{AISelectionTrigger-MaBGhxTE.js → AISelectionTrigger-SLyb8Vep.js} +2 -2
  3. package/dist/{AISettingsPanel-aiMnncnQ.js → AISettingsPanel-Bsd_wLP4.js} +3 -3
  4. package/dist/{DocsApp-BN6Bo0YD.js → DocsApp-CybQmyB8.js} +3669 -3285
  5. package/dist/{GlobalContextMenu-DG6x5Y5w.js → GlobalContextMenu-BtVjQk0v.js} +1 -1
  6. package/dist/{MdxContent-CMB8ZbXo.js → MdxContent-CH9GcMIg.js} +310 -306
  7. package/dist/{MdxContent.lazy-C4rcCv4v.js → MdxContent.lazy-D7XJ-ZHl.js} +1 -1
  8. package/dist/{SearchDialog-tUSKKsxW.js → SearchDialog-DWVre6R9.js} +66 -56
  9. package/dist/{SearchRuntime-5fXpxDsi.js → SearchRuntime-D0rSMKV3.js} +6 -5
  10. package/dist/_basePickBy-D8oNWNf8.js +166 -0
  11. package/dist/_baseUniq-DHuXxixa.js +682 -0
  12. package/dist/arc-j69r3jDe.js +80 -0
  13. package/dist/architecture-PBZL5I3N-DvHexcWL.js +3 -0
  14. package/dist/architectureDiagram-2XIMDMQ5-DmhcSwl7.js +4045 -0
  15. package/dist/array-DHiPsILf.js +6 -0
  16. package/dist/blockDiagram-WCTKOSBZ-B6A-w3LB.js +3025 -0
  17. package/dist/c4Diagram-IC4MRINW-AmEpu2Zd.js +2964 -0
  18. package/dist/channel-CqxMgZ5t.js +5 -0
  19. package/dist/chunk-4BX2VUAB-D3p73nhw.js +8 -0
  20. package/dist/chunk-55IACEB6-CLgZJbYv.js +8 -0
  21. package/dist/chunk-7E7YKBS2-CKRA8Egz.js +23 -0
  22. package/dist/chunk-7R4GIKGN-C19ZEV_b.js +2596 -0
  23. package/dist/chunk-C72U2L5F-B6IP-vol.js +23 -0
  24. package/dist/chunk-EGIJ26TM-Cw4ft_Ra.js +23 -0
  25. package/dist/chunk-FMBD7UC4-D-Ronn4l.js +5 -0
  26. package/dist/chunk-GEFDOKGD-8e2771NL.js +1121 -0
  27. package/dist/chunk-GLR3WWYH-ShSppUzV.js +41 -0
  28. package/dist/chunk-HHEYEP7N-CU-ZzGab.js +9 -0
  29. package/dist/chunk-JSJVCQXG-D49UMhzO.js +60 -0
  30. package/dist/chunk-KX2RTZJC-BDcxmH0D.js +25 -0
  31. package/dist/chunk-KYZI473N-B9L8Kk83.js +3434 -0
  32. package/dist/chunk-L3YUKLVL-CEVeJJT9.js +23 -0
  33. package/dist/chunk-MX3YWQON-CVZUx3EI.js +80 -0
  34. package/dist/chunk-NBPlniwU.js +23 -0
  35. package/dist/chunk-NQ4KR5QH-BWRGvKed.js +2002 -0
  36. package/dist/chunk-O4XLMI2P-BlC0d_Zr.js +511 -0
  37. package/dist/chunk-OZEHJAEY-BuORg3qI.js +64 -0
  38. package/dist/chunk-PQ6SQG4A-BggLWIDB.js +67 -0
  39. package/dist/chunk-PU5JKC2W-CeOPBYeP.js +1885 -0
  40. package/dist/chunk-QZHKN3VN-3LiJhn2O.js +15 -0
  41. package/dist/chunk-R5LLSJPH-B8KdhC9h.js +35 -0
  42. package/dist/chunk-WL4C6EOR-DLbU3P3W.js +3194 -0
  43. package/dist/chunk-XIRO2GV7-Bv7JEVD4.js +30 -0
  44. package/dist/chunk-XPW4576I-Bu03pPNP.js +1146 -0
  45. package/dist/chunk-XZSTWKYB-CpQJcKKv.js +15797 -0
  46. package/dist/chunk-YBOYWFTD-BAPGCoDq.js +32 -0
  47. package/dist/classDiagram-VBA2DB6C-D4y64v83.js +29 -0
  48. package/dist/classDiagram-v2-RAHNMMFH-DXkt0Wd4.js +29 -0
  49. package/dist/clone-B2fVtDap.js +8 -0
  50. package/dist/cose-bilkent-S5V4N54A-BX63fiTJ.js +2250 -0
  51. package/dist/cytoscape.esm-D1tmL96B.js +18100 -0
  52. package/dist/dagre-BM10A37c.js +1483 -0
  53. package/dist/dagre-KLK3FWXG-BkGeaeJf.js +294 -0
  54. package/dist/defaultLocale-CS9riXxY.js +201 -0
  55. package/dist/diagram-E7M64L7V-BCpOexcP.js +527 -0
  56. package/dist/diagram-IFDJBPK2-lSNeST-Z.js +213 -0
  57. package/dist/diagram-P4PSJMXO-Dd8HMHpS.js +133 -0
  58. package/dist/dist-DeXxBykG.js +50 -0
  59. package/dist/docs-app.es.js +1 -1
  60. package/dist/erDiagram-INFDFZHY-DjNq2UqZ.js +1666 -0
  61. package/dist/flowDiagram-PKNHOUZH-AUeVhXRc.js +4161 -0
  62. package/dist/ganttDiagram-A5KZAMGK-DZIM1zx8.js +3072 -0
  63. package/dist/gitGraph-HDMCJU4V-BiirFMfI.js +3 -0
  64. package/dist/gitGraphDiagram-K3NZZRJ6-CpR0vINe.js +625 -0
  65. package/dist/graphlib-DOjl69i0.js +225 -0
  66. package/dist/info-3K5VOQVL-CfGgZztt.js +3 -0
  67. package/dist/infoDiagram-LFFYTUFH-DAJ9foHI.js +19 -0
  68. package/dist/init-B4NvJPDj.js +15 -0
  69. package/dist/isArrayLikeObject-DLIYDRni.js +578 -0
  70. package/dist/isEmpty-DhbfzuZy.js +35 -0
  71. package/dist/ishikawaDiagram-PHBUUO56-B7xss2de.js +717 -0
  72. package/dist/journeyDiagram-4ABVD52K-BbX80Gcw.js +883 -0
  73. package/dist/kanban-definition-K7BYSVSG-BQ87hifQ.js +971 -0
  74. package/dist/line-DfLnhEwA.js +34 -0
  75. package/dist/linear-CWB56ned.js +289 -0
  76. package/dist/math-DHDNczAo.js +10 -0
  77. package/dist/{shiki-highlighter-BmQSSJpS.js → mdx-components-m1cGPhc8.js} +1437 -1338
  78. package/dist/mermaid-parser.core-l4wHnGuN.js +59 -0
  79. package/dist/mermaid.core-CtkJeRVj.js +919 -0
  80. package/dist/mindmap-definition-YRQLILUH-Cnl-qPDR.js +964 -0
  81. package/dist/ordinal-CD64W6lf.js +65 -0
  82. package/dist/packet-RMMSAZCW-DfA9M99B.js +3 -0
  83. package/dist/path-BjiRrKY7.js +85 -0
  84. package/dist/pie-UPGHQEXC-Bujrkgkt.js +3 -0
  85. package/dist/pieDiagram-SKSYHLDU-xow4mVuZ.js +165 -0
  86. package/dist/quadrantDiagram-337W2JSQ-CV2tMWXO.js +1974 -0
  87. package/dist/radar-KQ55EAFF-DEzDT04F.js +3 -0
  88. package/dist/react-docs-ui.css +1 -1
  89. package/dist/react-docs-ui.es.js +19 -19
  90. package/dist/requirementDiagram-Z7DCOOCP-Bx6NAgqy.js +2201 -0
  91. package/dist/rough.esm-BOvWpVpy.js +1352 -0
  92. package/dist/sankeyDiagram-WA2Y5GQK-CvTU-CXN.js +920 -0
  93. package/dist/sequenceDiagram-2WXFIKYE-1wYHvZEI.js +4109 -0
  94. package/dist/src-DI0MZP4m.js +2146 -0
  95. package/dist/stateDiagram-RAJIS63D-DFmbSHPX.js +217 -0
  96. package/dist/stateDiagram-v2-FVOUBMTO-TjYtTjLB.js +27 -0
  97. package/dist/timeline-definition-YZTLITO2-BAK411Yg.js +830 -0
  98. package/dist/treemap-KZPCXAKY-DThdSsPR.js +3 -0
  99. package/dist/types/components/AnnouncementBar.d.ts +12 -0
  100. package/dist/types/components/AnnouncementBar.d.ts.map +1 -0
  101. package/dist/types/components/DocsLayout.d.ts +10 -2
  102. package/dist/types/components/DocsLayout.d.ts.map +1 -1
  103. package/dist/types/components/HeaderNav.d.ts +17 -1
  104. package/dist/types/components/HeaderNav.d.ts.map +1 -1
  105. package/dist/types/components/MdxContent.d.ts.map +1 -1
  106. package/dist/types/components/MobileSidebar.d.ts +2 -1
  107. package/dist/types/components/MobileSidebar.d.ts.map +1 -1
  108. package/dist/types/components/PageFeedback.d.ts +11 -0
  109. package/dist/types/components/PageFeedback.d.ts.map +1 -0
  110. package/dist/types/components/PageMetaActions.d.ts +15 -0
  111. package/dist/types/components/PageMetaActions.d.ts.map +1 -0
  112. package/dist/types/components/PageNavigation.d.ts +2 -1
  113. package/dist/types/components/PageNavigation.d.ts.map +1 -1
  114. package/dist/types/components/SearchLauncher.d.ts +2 -1
  115. package/dist/types/components/SearchLauncher.d.ts.map +1 -1
  116. package/dist/types/components/SidebarNav.d.ts +2 -1
  117. package/dist/types/components/SidebarNav.d.ts.map +1 -1
  118. package/dist/types/components/mdx-components/Mermaid.d.ts +6 -0
  119. package/dist/types/components/mdx-components/Mermaid.d.ts.map +1 -0
  120. package/dist/types/components/mdx-components/Tabs.d.ts +13 -0
  121. package/dist/types/components/mdx-components/Tabs.d.ts.map +1 -0
  122. package/dist/types/components/mdx-components/index.d.ts +2 -0
  123. package/dist/types/components/mdx-components/index.d.ts.map +1 -1
  124. package/dist/types/components/search/SearchProvider.d.ts +2 -1
  125. package/dist/types/components/search/SearchProvider.d.ts.map +1 -1
  126. package/dist/types/components/search/SearchRuntime.d.ts +2 -1
  127. package/dist/types/components/search/SearchRuntime.d.ts.map +1 -1
  128. package/dist/types/lib/component-scanner.d.ts.map +1 -1
  129. package/dist/types/lib/config.d.ts +52 -0
  130. package/dist/types/lib/config.d.ts.map +1 -1
  131. package/dist/types/lib/navigation.d.ts +1 -1
  132. package/dist/types/lib/navigation.d.ts.map +1 -1
  133. package/dist/types/lib/page-meta.d.ts +16 -0
  134. package/dist/types/lib/page-meta.d.ts.map +1 -0
  135. package/dist/types/lib/search/build/index-generator.d.ts.map +1 -1
  136. package/dist/types/lib/search/build/types.d.ts +1 -0
  137. package/dist/types/lib/search/build/types.d.ts.map +1 -1
  138. package/dist/types/lib/search/runtime/search-engine.d.ts.map +1 -1
  139. package/dist/types/lib/search/runtime/types.d.ts +1 -0
  140. package/dist/types/lib/search/runtime/types.d.ts.map +1 -1
  141. package/dist/types/lib/versioning.d.ts +6 -0
  142. package/dist/types/lib/versioning.d.ts.map +1 -0
  143. package/dist/vennDiagram-LZ73GAT5-B7dft0U9.js +1858 -0
  144. package/dist/xychartDiagram-JWTSCODW-CXtfEnJM.js +2041 -0
  145. package/package.json +6 -2
  146. /package/dist/{AIProvider-C1_b1iKH.js → AIProvider-niZNPSGi.js} +0 -0
  147. /package/dist/{context-menu-CB7erSoV.js → context-menu-BIQsQup7.js} +0 -0
  148. /package/dist/{dialog-DQ6nkP0y.js → dialog-D8otbqQL.js} +0 -0
  149. /package/dist/{mdx-components-Dxpipc50.js → mdx-components-TEc3uhbY.js} +0 -0
  150. /package/dist/{use-toast-d9VPBjMn.js → use-toast-DK69oadB.js} +0 -0
@@ -1,29 +1,29 @@
1
- import { a as e, c as t, d as n, f as r, l as i, n as a, r as o, s, t as c, u as l } from "./shiki-highlighter-BmQSSJpS.js";
2
- import { t as u } from "./utils-Ct96Mtjw.js";
3
- import { t as d } from "./use-toast-d9VPBjMn.js";
4
- import { l as f, r as p, t as m, u as h } from "./dialog-DQ6nkP0y.js";
5
- import * as g from "react";
6
- import { Check as _, Copy as v, Download as y, ExternalLink as b, Maximize as ee, Minimize as x, RefreshCw as te, RotateCcw as ne, RotateCw as re, Search as ie, X as ae, ZoomIn as oe, ZoomOut as se } from "lucide-react";
7
- import { Link as S, useParams as C } from "react-router-dom";
8
- import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
9
- import D from "remark-gfm";
10
- import O from "remark-math";
11
- import k from "react-markdown";
12
- import A from "rehype-autolink-headings";
13
- import j from "rehype-slug";
14
- import M from "rehype-raw";
15
- import ce from "rehype-katex";
16
- import { SKIP as N, visit as P } from "unist-util-visit";
17
- import F from "katex-physics";
1
+ import { t as e } from "./utils-Ct96Mtjw.js";
2
+ import { S as t, b as n, c as r, d as i, h as a, l as o, p as s, s as c, t as l, v as u, x as d, y as f } from "./mdx-components-m1cGPhc8.js";
3
+ import { t as p } from "./use-toast-DK69oadB.js";
4
+ import { l as m, r as h, t as g, u as _ } from "./dialog-D8otbqQL.js";
5
+ import * as v from "react";
6
+ import { Check as y, Copy as b, Download as ee, ExternalLink as x, Maximize as te, Minimize as ne, RefreshCw as re, RotateCcw as ie, RotateCw as ae, Search as oe, X as se, ZoomIn as ce, ZoomOut as le } from "lucide-react";
7
+ import { Link as ue, useParams as S } from "react-router-dom";
8
+ import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
9
+ import E from "remark-gfm";
10
+ import D from "remark-math";
11
+ import O from "react-markdown";
12
+ import k from "rehype-autolink-headings";
13
+ import de from "rehype-slug";
14
+ import A from "rehype-raw";
15
+ import j from "rehype-katex";
16
+ import { SKIP as M, visit as N } from "unist-util-visit";
17
+ import P from "katex-physics";
18
18
  //#region src/lib/rehype-component.ts
19
- function I(e) {
19
+ function F(e) {
20
20
  let t = /* @__PURE__ */ new Map();
21
21
  for (let [n] of Object.entries(e)) {
22
22
  let e = n.toLowerCase(), r = e.replace(/\./g, "-");
23
23
  t.set(e, n), t.set(r, n);
24
24
  }
25
25
  return () => (e) => {
26
- P(e, "element", (e) => {
26
+ N(e, "element", (e) => {
27
27
  let n = e.tagName.toLowerCase(), r = t.get(n);
28
28
  r && (e.tagName = r, e.properties = e.properties || {}, e.properties.isComponent = !0);
29
29
  });
@@ -31,7 +31,7 @@ function I(e) {
31
31
  }
32
32
  //#endregion
33
33
  //#region src/lib/image-viewer.ts
34
- var L = {
34
+ var I = {
35
35
  "zh-cn": {
36
36
  preview: "预览图片",
37
37
  zoomIn: "放大",
@@ -73,27 +73,27 @@ var L = {
73
73
  imageLoadError: "Failed to load image"
74
74
  }
75
75
  };
76
- function le(e = "zh-cn", t) {
76
+ function L(e = "zh-cn", t) {
77
77
  return {
78
- ...L[e === "en" ? "en" : "zh-cn"],
78
+ ...I[e === "en" ? "en" : "zh-cn"],
79
79
  ...t
80
80
  };
81
81
  }
82
82
  //#endregion
83
83
  //#region src/components/ImageViewer.tsx
84
- var ue = .2, R = 5, de = .2;
85
- function z(e) {
86
- return Math.min(R, Math.max(ue, Number(e.toFixed(2))));
84
+ var R = .2, z = 5, fe = .2;
85
+ function B(e) {
86
+ return Math.min(z, Math.max(R, Number(e.toFixed(2))));
87
87
  }
88
- function fe(e, t, n) {
88
+ function pe(e, t, n) {
89
89
  let r = (t || n || "image").trim().split("").map((e) => e.charCodeAt(0) < 32 || "<>:\"/\\|?*".includes(e) ? "-" : e).join("");
90
90
  return (e.split("?")[0]?.split("#")[0] ?? e).split("/").pop()?.trim() || r || "image";
91
91
  }
92
- function B(e, t) {
92
+ function me(e, t) {
93
93
  let n = document.createElement("a");
94
94
  n.href = e, n.download = t, n.rel = "noopener noreferrer", document.body.appendChild(n), n.click(), document.body.removeChild(n);
95
95
  }
96
- function pe(e) {
96
+ function he(e) {
97
97
  if (e.startsWith("blob:") || e.startsWith("data:")) return !0;
98
98
  try {
99
99
  return new URL(e, window.location.href).origin === window.location.origin;
@@ -101,263 +101,263 @@ function pe(e) {
101
101
  return !1;
102
102
  }
103
103
  }
104
- function V({ open: e, onOpenChange: a, src: o, alt: s, title: c, lang: _ = "zh-cn", labels: v }) {
105
- let S = g.useMemo(() => le(_, v), [_, v]), C = g.useRef(null), w = g.useRef(null), [D, O] = g.useState(1), [k, A] = g.useState(0), [j, M] = g.useState("fit"), [ce, N] = g.useState(!1), [P, F] = g.useState(!1), [I, L] = g.useState({
104
+ function V({ open: r, onOpenChange: i, src: a, alt: o, title: s, lang: c = "zh-cn", labels: l }) {
105
+ let y = v.useMemo(() => L(c, l), [c, l]), b = v.useRef(null), ue = v.useRef(null), [S, C] = v.useState(1), [E, D] = v.useState(0), [O, k] = v.useState("fit"), [de, A] = v.useState(!1), [j, M] = v.useState(!1), [N, P] = v.useState({
106
106
  x: 0,
107
107
  y: 0
108
- }), [V, H] = g.useState(!1), U = g.useRef(/* @__PURE__ */ new Map()), W = g.useRef(null), G = g.useRef(null), K = s?.trim() || c?.trim() || S.imageAltFallback, q = g.useCallback(() => {
109
- O(1), A(0), M("fit"), F(!1), L({
108
+ }), [F, I] = v.useState(!1), V = v.useRef(/* @__PURE__ */ new Map()), H = v.useRef(null), U = v.useRef(null), W = o?.trim() || s?.trim() || y.imageAltFallback, G = v.useCallback(() => {
109
+ C(1), D(0), k("fit"), M(!1), P({
110
110
  x: 0,
111
111
  y: 0
112
- }), H(!1), U.current.clear(), W.current = null, G.current = null;
112
+ }), I(!1), V.current.clear(), H.current = null, U.current = null;
113
113
  }, []);
114
- g.useEffect(() => {
115
- if (e) {
116
- q();
114
+ v.useEffect(() => {
115
+ if (r) {
116
+ G();
117
117
  return;
118
118
  }
119
- N(!1);
120
- }, [e, q]), g.useEffect(() => {
121
- document.fullscreenElement || N(!1);
122
- }, [e]), g.useEffect(() => {
119
+ A(!1);
120
+ }, [r, G]), v.useEffect(() => {
121
+ document.fullscreenElement || A(!1);
122
+ }, [r]), v.useEffect(() => {
123
123
  let e = () => {
124
- N(!!document.fullscreenElement);
124
+ A(!!document.fullscreenElement);
125
125
  };
126
126
  return document.addEventListener("fullscreenchange", e), () => {
127
127
  document.removeEventListener("fullscreenchange", e);
128
128
  };
129
129
  }, []);
130
- let me = g.useMemo(() => ({
131
- transform: `translate(${I.x}px, ${I.y}px) scale(${D}) rotate(${k}deg)`,
132
- transition: V ? "none" : "transform 160ms ease",
133
- cursor: P ? "default" : V ? "grabbing" : "grab"
130
+ let ge = v.useMemo(() => ({
131
+ transform: `translate(${N.x}px, ${N.y}px) scale(${S}) rotate(${E}deg)`,
132
+ transition: F ? "none" : "transform 160ms ease",
133
+ cursor: j ? "default" : F ? "grabbing" : "grab"
134
134
  }), [
135
- V,
136
- P,
137
- k,
138
- D,
139
- I.x,
140
- I.y
141
- ]), J = g.useCallback(() => {
142
- M("actual"), O((e) => z(e + de));
143
- }, []), Y = g.useCallback(() => {
144
- M("actual"), O((e) => z(e - de));
145
- }, []), he = g.useCallback(() => {
146
- M("fit"), O(1), L({
135
+ F,
136
+ j,
137
+ E,
138
+ S,
139
+ N.x,
140
+ N.y
141
+ ]), K = v.useCallback(() => {
142
+ k("actual"), C((e) => B(e + fe));
143
+ }, []), q = v.useCallback(() => {
144
+ k("actual"), C((e) => B(e - fe));
145
+ }, []), J = v.useCallback(() => {
146
+ k("fit"), C(1), P({
147
147
  x: 0,
148
148
  y: 0
149
149
  });
150
- }, []), ge = g.useCallback(() => {
151
- M("actual"), O(1), L({
150
+ }, []), Y = v.useCallback(() => {
151
+ k("actual"), C(1), P({
152
152
  x: 0,
153
153
  y: 0
154
154
  });
155
- }, []), X = g.useCallback(() => {
156
- A((e) => e - 90);
157
- }, []), Z = g.useCallback(() => {
158
- A((e) => e + 90);
159
- }, []), _e = g.useCallback(async () => {
160
- let e = fe(o, c, s), t = null;
155
+ }, []), X = v.useCallback(() => {
156
+ D((e) => e - 90);
157
+ }, []), Z = v.useCallback(() => {
158
+ D((e) => e + 90);
159
+ }, []), _e = v.useCallback(async () => {
160
+ let e = pe(a, s, o), t = null;
161
161
  try {
162
- if (pe(o)) {
163
- B(o, e), d({ description: S.downloadSuccess });
162
+ if (he(a)) {
163
+ me(a, e), p({ description: y.downloadSuccess });
164
164
  return;
165
165
  }
166
166
  } catch {}
167
167
  try {
168
- let n = await fetch(o, { mode: "cors" });
168
+ let n = await fetch(a, { mode: "cors" });
169
169
  if (!n.ok) throw Error(`Failed to fetch image: ${n.status}`);
170
170
  let r = await n.blob();
171
- t = URL.createObjectURL(r), B(t, e), d({ description: S.downloadSuccess });
171
+ t = URL.createObjectURL(r), me(t, e), p({ description: y.downloadSuccess });
172
172
  } catch {
173
- d({
173
+ p({
174
174
  variant: "destructive",
175
- description: S.downloadError
175
+ description: y.downloadError
176
176
  });
177
177
  } finally {
178
178
  t && URL.revokeObjectURL(t);
179
179
  }
180
180
  }, [
181
- s,
182
- S.downloadError,
183
- S.downloadSuccess,
184
181
  o,
185
- c
186
- ]), ve = g.useCallback(() => {
182
+ y.downloadError,
183
+ y.downloadSuccess,
184
+ a,
185
+ s
186
+ ]), ve = v.useCallback(() => {
187
187
  try {
188
- window.open(o, "_blank", "noopener,noreferrer");
188
+ window.open(a, "_blank", "noopener,noreferrer");
189
189
  } catch {
190
- d({
190
+ p({
191
191
  variant: "destructive",
192
- description: S.openInNewTabError
192
+ description: y.openInNewTabError
193
193
  });
194
194
  }
195
- }, [S.openInNewTabError, o]), Q = g.useCallback(async () => {
196
- let e = C.current;
195
+ }, [y.openInNewTabError, a]), Q = v.useCallback(async () => {
196
+ let e = b.current;
197
197
  if (!e?.requestFullscreen) {
198
- d({ description: S.fullscreenError });
198
+ p({ description: y.fullscreenError });
199
199
  return;
200
200
  }
201
201
  try {
202
202
  document.fullscreenElement ? await document.exitFullscreen() : await e.requestFullscreen();
203
203
  } catch {
204
- d({ description: S.fullscreenError });
204
+ p({ description: y.fullscreenError });
205
205
  }
206
- }, [S.fullscreenError]);
207
- g.useEffect(() => {
208
- if (!e) return;
209
- let t = (e) => {
210
- e.key === "+" ? (e.preventDefault(), J()) : e.key === "-" ? (e.preventDefault(), Y()) : e.key === "0" ? (e.preventDefault(), q()) : e.key === "f" || e.key === "F" ? (e.preventDefault(), Q()) : e.key === "[" ? (e.preventDefault(), X()) : e.key === "]" && (e.preventDefault(), Z());
206
+ }, [y.fullscreenError]);
207
+ v.useEffect(() => {
208
+ if (!r) return;
209
+ let e = (e) => {
210
+ e.key === "+" ? (e.preventDefault(), K()) : e.key === "-" ? (e.preventDefault(), q()) : e.key === "0" ? (e.preventDefault(), G()) : e.key === "f" || e.key === "F" ? (e.preventDefault(), Q()) : e.key === "[" ? (e.preventDefault(), X()) : e.key === "]" && (e.preventDefault(), Z());
211
211
  };
212
- return window.addEventListener("keydown", t), () => {
213
- window.removeEventListener("keydown", t);
212
+ return window.addEventListener("keydown", e), () => {
213
+ window.removeEventListener("keydown", e);
214
214
  };
215
215
  }, [
216
216
  Q,
217
- e,
218
- q,
217
+ r,
218
+ G,
219
219
  X,
220
220
  Z,
221
- J,
222
- Y
221
+ K,
222
+ q
223
223
  ]);
224
- let $ = g.useCallback((e) => {
225
- e.preventDefault(), e.stopPropagation(), e.deltaY < 0 ? J() : Y();
226
- }, [J, Y]);
227
- g.useEffect(() => {
228
- if (!e) return;
229
- let t = C.current;
230
- if (t) return t.addEventListener("wheel", $, { passive: !1 }), () => {
231
- t.removeEventListener("wheel", $);
224
+ let $ = v.useCallback((e) => {
225
+ e.preventDefault(), e.stopPropagation(), e.deltaY < 0 ? K() : q();
226
+ }, [K, q]);
227
+ v.useEffect(() => {
228
+ if (!r) return;
229
+ let e = b.current;
230
+ if (e) return e.addEventListener("wheel", $, { passive: !1 }), () => {
231
+ e.removeEventListener("wheel", $);
232
232
  };
233
- }, [$, e]);
234
- let ye = g.useCallback((e) => {
235
- U.current.set(e.pointerId, {
233
+ }, [$, r]);
234
+ let ye = v.useCallback((e) => {
235
+ V.current.set(e.pointerId, {
236
236
  x: e.clientX,
237
237
  y: e.clientY
238
238
  });
239
- let t = Array.from(U.current.values());
240
- if (t.length === 2 && G.current) {
241
- let [e, n] = t, r = Math.hypot(n.x - e.x, n.y - e.y), i = z(G.current.startScale * (r / G.current.startDistance));
242
- M("actual"), O(i);
239
+ let t = Array.from(V.current.values());
240
+ if (t.length === 2 && U.current) {
241
+ let [e, n] = t, r = Math.hypot(n.x - e.x, n.y - e.y), i = B(U.current.startScale * (r / U.current.startDistance));
242
+ k("actual"), C(i);
243
243
  return;
244
244
  }
245
- let n = W.current;
246
- !n || n.pointerId !== e.pointerId || L({
245
+ let n = H.current;
246
+ !n || n.pointerId !== e.pointerId || P({
247
247
  x: n.originX + (e.clientX - n.startX),
248
248
  y: n.originY + (e.clientY - n.startY)
249
249
  });
250
- }, []), be = g.useCallback((e) => {
251
- e && C.current?.hasPointerCapture(e.pointerId) && C.current.releasePointerCapture(e.pointerId), e && U.current.delete(e.pointerId), W.current = null, U.current.size < 2 && (G.current = null), H(!1);
252
- }, []), xe = g.useCallback((e) => {
253
- if (e.button !== 0 || P) return;
254
- e.preventDefault(), e.stopPropagation(), e.currentTarget.setPointerCapture(e.pointerId), U.current.set(e.pointerId, {
250
+ }, []), be = v.useCallback((e) => {
251
+ e && b.current?.hasPointerCapture(e.pointerId) && b.current.releasePointerCapture(e.pointerId), e && V.current.delete(e.pointerId), H.current = null, V.current.size < 2 && (U.current = null), I(!1);
252
+ }, []), xe = v.useCallback((e) => {
253
+ if (e.button !== 0 || j) return;
254
+ e.preventDefault(), e.stopPropagation(), e.currentTarget.setPointerCapture(e.pointerId), V.current.set(e.pointerId, {
255
255
  x: e.clientX,
256
256
  y: e.clientY
257
257
  });
258
- let t = Array.from(U.current.values());
258
+ let t = Array.from(V.current.values());
259
259
  if (t.length === 2) {
260
260
  let [e, n] = t;
261
- G.current = {
261
+ U.current = {
262
262
  startDistance: Math.max(1, Math.hypot(n.x - e.x, n.y - e.y)),
263
- startScale: D
264
- }, W.current = null, H(!1);
263
+ startScale: S
264
+ }, H.current = null, I(!1);
265
265
  return;
266
266
  }
267
- W.current = {
267
+ H.current = {
268
268
  pointerId: e.pointerId,
269
269
  startX: e.clientX,
270
270
  startY: e.clientY,
271
- originX: I.x,
272
- originY: I.y
273
- }, H(!0);
271
+ originX: N.x,
272
+ originY: N.y
273
+ }, I(!0);
274
274
  }, [
275
- P,
276
- D,
277
- I.x,
278
- I.y
275
+ j,
276
+ S,
277
+ N.x,
278
+ N.y
279
279
  ]);
280
- g.useEffect(() => {
281
- if (!e) return;
282
- let t = (e) => {
283
- let t = C.current, n = e.target;
280
+ v.useEffect(() => {
281
+ if (!r) return;
282
+ let e = (e) => {
283
+ let t = b.current, n = e.target;
284
284
  !t || !(n instanceof Node) || !t.contains(n) || !e.ctrlKey || $(e);
285
285
  };
286
- return window.addEventListener("wheel", t, {
286
+ return window.addEventListener("wheel", e, {
287
287
  passive: !1,
288
288
  capture: !0
289
289
  }), () => {
290
- window.removeEventListener("wheel", t, { capture: !0 });
290
+ window.removeEventListener("wheel", e, { capture: !0 });
291
291
  };
292
- }, [$, e]);
293
- let Se = g.useMemo(() => [
292
+ }, [$, r]);
293
+ let Se = v.useMemo(() => [
294
294
  {
295
295
  key: "zoom-in",
296
- label: S.zoomIn,
297
- icon: oe,
298
- onClick: J,
299
- disabled: P || D >= R
296
+ label: y.zoomIn,
297
+ icon: ce,
298
+ onClick: K,
299
+ disabled: j || S >= z
300
300
  },
301
301
  {
302
302
  key: "zoom-out",
303
- label: S.zoomOut,
304
- icon: se,
305
- onClick: Y,
306
- disabled: P || D <= ue
303
+ label: y.zoomOut,
304
+ icon: le,
305
+ onClick: q,
306
+ disabled: j || S <= R
307
307
  },
308
308
  {
309
309
  key: "fit",
310
- label: S.fit,
311
- icon: x,
312
- onClick: he,
313
- disabled: P
310
+ label: y.fit,
311
+ icon: ne,
312
+ onClick: J,
313
+ disabled: j
314
314
  },
315
315
  {
316
316
  key: "actual-size",
317
- label: S.actualSize,
318
- icon: ie,
319
- onClick: ge,
320
- disabled: P
317
+ label: y.actualSize,
318
+ icon: oe,
319
+ onClick: Y,
320
+ disabled: j
321
321
  },
322
322
  {
323
323
  key: "reset",
324
- label: S.reset,
325
- icon: te,
326
- onClick: q,
327
- disabled: P
324
+ label: y.reset,
325
+ icon: re,
326
+ onClick: G,
327
+ disabled: j
328
328
  },
329
329
  {
330
330
  key: "rotate-left",
331
- label: S.rotateLeft,
332
- icon: ne,
331
+ label: y.rotateLeft,
332
+ icon: ie,
333
333
  onClick: X,
334
- disabled: P
334
+ disabled: j
335
335
  },
336
336
  {
337
337
  key: "rotate-right",
338
- label: S.rotateRight,
339
- icon: re,
338
+ label: y.rotateRight,
339
+ icon: ae,
340
340
  onClick: Z,
341
- disabled: P
341
+ disabled: j
342
342
  },
343
343
  {
344
344
  key: "fullscreen",
345
- label: S.fullscreen,
346
- icon: ee,
345
+ label: y.fullscreen,
346
+ icon: te,
347
347
  onClick: () => void Q(),
348
348
  disabled: !1
349
349
  },
350
350
  {
351
351
  key: "download",
352
- label: S.download,
353
- icon: y,
352
+ label: y.download,
353
+ icon: ee,
354
354
  onClick: _e,
355
- disabled: P
355
+ disabled: j
356
356
  },
357
357
  {
358
358
  key: "new-tab",
359
- label: S.openInNewTab,
360
- icon: b,
359
+ label: y.openInNewTab,
360
+ icon: x,
361
361
  onClick: ve,
362
362
  disabled: !1
363
363
  }
@@ -365,71 +365,71 @@ function V({ open: e, onOpenChange: a, src: o, alt: s, title: c, lang: _ = "zh-c
365
365
  _e,
366
366
  Q,
367
367
  ve,
368
- P,
369
- S.actualSize,
370
- S.download,
371
- S.fit,
372
- S.fullscreen,
373
- S.openInNewTab,
374
- S.reset,
375
- S.rotateLeft,
376
- S.rotateRight,
377
- S.zoomIn,
378
- S.zoomOut,
379
- q,
368
+ j,
369
+ y.actualSize,
370
+ y.download,
371
+ y.fit,
372
+ y.fullscreen,
373
+ y.openInNewTab,
374
+ y.reset,
375
+ y.rotateLeft,
376
+ y.rotateRight,
377
+ y.zoomIn,
378
+ y.zoomOut,
379
+ G,
380
380
  X,
381
381
  Z,
382
- D,
383
- ge,
384
- he,
382
+ S,
383
+ Y,
385
384
  J,
386
- Y
385
+ K,
386
+ q
387
387
  ]);
388
- return /* @__PURE__ */ T(m, {
389
- open: e,
390
- onOpenChange: a,
391
- children: /* @__PURE__ */ E(p, {
388
+ return /* @__PURE__ */ w(g, {
389
+ open: r,
390
+ onOpenChange: i,
391
+ children: /* @__PURE__ */ T(h, {
392
392
  showCloseButton: !1,
393
393
  className: "flex h-[min(94vh,980px)] w-[calc(100vw-0.75rem)] sm:w-[40rem] md:w-[52rem] lg:w-[64rem] xl:w-[74rem] 2xl:w-[86rem] max-w-[calc(100vw-0.75rem)] flex-col gap-3 border-zinc-800 bg-zinc-950 p-3 text-zinc-50 sm:max-w-[calc(100vw-2rem)] sm:p-4",
394
394
  children: [
395
- /* @__PURE__ */ T(h, { children: K }),
396
- /* @__PURE__ */ T(f, { children: S.close }),
397
- /* @__PURE__ */ E(l, {
395
+ /* @__PURE__ */ w(_, { children: W }),
396
+ /* @__PURE__ */ w(m, { children: y.close }),
397
+ /* @__PURE__ */ T(n, {
398
398
  delayDuration: 100,
399
- children: [/* @__PURE__ */ E("div", {
399
+ children: [/* @__PURE__ */ T("div", {
400
400
  className: "flex items-center justify-between gap-3 rounded-lg border border-zinc-800 bg-zinc-900/80 px-3 py-2",
401
- children: [/* @__PURE__ */ E("div", {
401
+ children: [/* @__PURE__ */ T("div", {
402
402
  className: "min-w-0",
403
- children: [/* @__PURE__ */ T("p", {
403
+ children: [/* @__PURE__ */ w("p", {
404
404
  className: "truncate text-sm font-medium",
405
- children: K
406
- }), /* @__PURE__ */ E("p", {
405
+ children: W
406
+ }), /* @__PURE__ */ T("p", {
407
407
  className: "text-xs text-zinc-400",
408
408
  children: [
409
- j === "fit" ? S.fit : `${Math.round(D * 100)}%`,
410
- k === 0 ? "" : ` · ${k}deg`,
411
- ce ? ` · ${S.fullscreen}` : ""
409
+ O === "fit" ? y.fit : `${Math.round(S * 100)}%`,
410
+ E === 0 ? "" : ` · ${E}deg`,
411
+ de ? ` · ${y.fullscreen}` : ""
412
412
  ]
413
413
  })]
414
- }), /* @__PURE__ */ T(r, {
414
+ }), /* @__PURE__ */ w(t, {
415
415
  type: "button",
416
416
  size: "icon",
417
417
  variant: "ghost",
418
418
  className: "h-9 w-9 shrink-0 text-zinc-100 hover:bg-zinc-800 hover:text-white",
419
- onClick: () => a(!1),
420
- "aria-label": S.close,
421
- title: S.close,
422
- children: /* @__PURE__ */ T(ae, { className: "h-4 w-4" })
419
+ onClick: () => i(!1),
420
+ "aria-label": y.close,
421
+ title: y.close,
422
+ children: /* @__PURE__ */ w(se, { className: "h-4 w-4" })
423
423
  })]
424
- }), /* @__PURE__ */ T("div", {
424
+ }), /* @__PURE__ */ w("div", {
425
425
  className: "overflow-x-auto rounded-lg border border-zinc-800 bg-zinc-900/80 px-2 py-2",
426
- children: /* @__PURE__ */ T("div", {
426
+ children: /* @__PURE__ */ w("div", {
427
427
  className: "flex min-w-max items-center gap-2",
428
428
  children: Se.map((e) => {
429
- let a = e.icon;
430
- return /* @__PURE__ */ E(t, { children: [/* @__PURE__ */ T(n, {
429
+ let n = e.icon;
430
+ return /* @__PURE__ */ T(u, { children: [/* @__PURE__ */ w(d, {
431
431
  asChild: !0,
432
- children: /* @__PURE__ */ T(r, {
432
+ children: /* @__PURE__ */ w(t, {
433
433
  type: "button",
434
434
  size: "icon",
435
435
  variant: "secondary",
@@ -438,43 +438,43 @@ function V({ open: e, onOpenChange: a, src: o, alt: s, title: c, lang: _ = "zh-c
438
438
  disabled: e.disabled,
439
439
  "aria-label": e.label,
440
440
  title: e.label,
441
- children: /* @__PURE__ */ T(a, { className: "h-4 w-4" })
441
+ children: /* @__PURE__ */ w(n, { className: "h-4 w-4" })
442
442
  })
443
- }), /* @__PURE__ */ T(i, { children: e.label })] }, e.key);
443
+ }), /* @__PURE__ */ w(f, { children: e.label })] }, e.key);
444
444
  })
445
445
  })
446
446
  })]
447
447
  }),
448
- /* @__PURE__ */ T("div", {
449
- ref: C,
448
+ /* @__PURE__ */ w("div", {
449
+ ref: b,
450
450
  className: "relative flex min-h-0 flex-1 items-center justify-center overflow-hidden rounded-xl border border-zinc-800 bg-[radial-gradient(circle_at_top,_rgba(255,255,255,0.08),_transparent_40%),linear-gradient(180deg,_rgba(24,24,27,0.9),_rgba(9,9,11,1))] p-4 touch-none",
451
451
  onPointerDown: xe,
452
452
  onPointerMove: ye,
453
453
  onPointerUp: be,
454
454
  onPointerCancel: be,
455
- children: P ? /* @__PURE__ */ E("div", {
455
+ children: j ? /* @__PURE__ */ T("div", {
456
456
  className: "flex flex-col items-center gap-2 text-center",
457
457
  children: [
458
- /* @__PURE__ */ T("div", {
458
+ /* @__PURE__ */ w("div", {
459
459
  className: "rounded-full border border-red-500/40 bg-red-500/10 p-3 text-red-300",
460
- children: /* @__PURE__ */ T(ie, { className: "h-5 w-5" })
460
+ children: /* @__PURE__ */ w(oe, { className: "h-5 w-5" })
461
461
  }),
462
- /* @__PURE__ */ T("p", {
462
+ /* @__PURE__ */ w("p", {
463
463
  className: "text-sm font-medium",
464
- children: S.imageLoadError
464
+ children: y.imageLoadError
465
465
  }),
466
- /* @__PURE__ */ T("p", {
466
+ /* @__PURE__ */ w("p", {
467
467
  className: "max-w-md text-xs text-zinc-400",
468
- children: o
468
+ children: a
469
469
  })
470
470
  ]
471
- }) : /* @__PURE__ */ T("img", {
472
- ref: w,
473
- src: o,
474
- alt: K,
475
- className: u("max-h-full max-w-full select-none rounded-lg object-contain shadow-2xl", j === "fit" ? "h-auto w-auto" : ""),
476
- style: me,
477
- onError: () => F(!0),
471
+ }) : /* @__PURE__ */ w("img", {
472
+ ref: ue,
473
+ src: a,
474
+ alt: W,
475
+ className: e("max-h-full max-w-full select-none rounded-lg object-contain shadow-2xl", O === "fit" ? "h-auto w-auto" : ""),
476
+ style: ge,
477
+ onError: () => M(!0),
478
478
  draggable: !1
479
479
  })
480
480
  })
@@ -486,7 +486,7 @@ function V({ open: e, onOpenChange: a, src: o, alt: s, title: c, lang: _ = "zh-c
486
486
  //#region src/components/MdxContent.tsx
487
487
  function H() {
488
488
  return (e) => {
489
- P(e, "element", (e, t, n) => {
489
+ N(e, "element", (e, t, n) => {
490
490
  if (e.tagName === "p" && n && typeof t == "number" && e.children.some((e) => e.type === "element" && (U(e) || e.tagName === "pre"))) {
491
491
  let r = [], i = [], a = () => {
492
492
  i.length > 0 && (r.push({
@@ -497,7 +497,7 @@ function H() {
497
497
  }), i = []);
498
498
  };
499
499
  for (let t of e.children) t.type === "element" && (U(t) || t.tagName === "pre") ? (a(), r.push(t)) : i.push(t);
500
- return a(), n.children.splice(t, 1, ...r), [N, t];
500
+ return a(), n.children.splice(t, 1, ...r), [M, t];
501
501
  }
502
502
  });
503
503
  };
@@ -508,13 +508,15 @@ function U(e) {
508
508
  return t.charAt(0) === t.charAt(0).toUpperCase() && t.charAt(0) !== t.charAt(0).toLowerCase();
509
509
  }
510
510
  function W(e) {
511
- return e.replace(/<([A-Z][a-zA-Z0-9]*(?:\.[A-Z][a-zA-Z0-9]*)*)(\s+[^>]*)>([\s\S]*?)<\/\1>/g, (e, t, n, r) => {
511
+ let t = e, n = "";
512
+ for (; t !== n;) n = t, t = t.replace(/<([A-Z][a-zA-Z0-9]*(?:\.[A-Z][a-zA-Z0-9]*)*)(\s+[^>]*)>([\s\S]*?)<\/\1>/g, (e, t, n, r) => {
512
513
  let i = G(n), a = t.toLowerCase().replace(/\./g, "-");
513
514
  return `<${a}${i}>${r}</${a}>`;
514
515
  }).replace(/<([A-Z][a-zA-Z0-9]*(?:\.[A-Z][a-zA-Z0-9]*)*)(\s+[^>]*?)\s*\/>/g, (e, t, n) => {
515
516
  let r = G(n), i = t.toLowerCase().replace(/\./g, "-");
516
517
  return `<${i}${r}></${i}>`;
517
518
  });
519
+ return t;
518
520
  }
519
521
  function G(e) {
520
522
  if (!e) return "";
@@ -525,7 +527,7 @@ function G(e) {
525
527
  }
526
528
  return t.length > 0 ? " " + t.join(" ") : "";
527
529
  }
528
- function K(e) {
530
+ function ge(e) {
529
531
  let t = {};
530
532
  for (let [n, r] of Object.entries(e)) if (n.startsWith("data-")) {
531
533
  let e = n.slice(5);
@@ -548,7 +550,7 @@ function K(e) {
548
550
  }
549
551
  return t;
550
552
  }
551
- var q = {
553
+ var K = {
552
554
  js: "JavaScript",
553
555
  javascript: "JavaScript",
554
556
  ts: "TypeScript",
@@ -590,10 +592,10 @@ var q = {
590
592
  diff: "Diff",
591
593
  text: "Text"
592
594
  };
593
- function me({ className: t, children: n, meta: r, codeHighlight: i, shikiBundle: a }) {
594
- let [s, l] = g.useState(""), [u, d] = g.useState(!1), [f, p] = g.useState(!1), m = g.useMemo(() => r?.toLowerCase().includes("showlinenumbers") ?? !1, [r]), h = /language-(\w+)/.exec(t || ""), y = h ? h[1] : "text", b = e(y), ee = q[y.toLowerCase()] || y.toUpperCase(), x = g.useMemo(() => {
595
+ function q({ className: e, children: t, meta: n, codeHighlight: r, shikiBundle: a }) {
596
+ let [s, l] = v.useState(""), [u, d] = v.useState(!1), [f, p] = v.useState(!1), m = v.useMemo(() => n?.toLowerCase().includes("showlinenumbers") ?? !1, [n]), h = /language-(\w+)/.exec(e || ""), g = h ? h[1] : "text", _ = i(g), ee = K[g.toLowerCase()] || g.toUpperCase(), x = v.useMemo(() => {
595
597
  let e = "";
596
- return e = typeof n == "string" ? n : g.Children.count(n) === 1 && typeof n == "string" ? String(n) : g.Children.toArray(n).map((e) => {
598
+ return e = typeof t == "string" ? t : v.Children.count(t) === 1 && typeof t == "string" ? String(t) : v.Children.toArray(t).map((e) => {
597
599
  if (typeof e == "string") return e;
598
600
  if (typeof e == "object" && e && "props" in e) {
599
601
  let t = e.props;
@@ -604,8 +606,8 @@ function me({ className: t, children: n, meta: r, codeHighlight: i, shikiBundle:
604
606
  }
605
607
  return "";
606
608
  }).join(""), e.replace(/^\n+/, "").replace(/\n+$/, "");
607
- }, [n]);
608
- g.useEffect(() => {
609
+ }, [t]);
610
+ v.useEffect(() => {
609
611
  let e = () => {
610
612
  d(document.documentElement.classList.contains("dark"));
611
613
  };
@@ -615,21 +617,21 @@ function me({ className: t, children: n, meta: r, codeHighlight: i, shikiBundle:
615
617
  attributes: !0,
616
618
  attributeFilter: ["class"]
617
619
  }), () => t.disconnect();
618
- }, []), g.useEffect(() => {
620
+ }, []), v.useEffect(() => {
619
621
  o(x, {
620
- lang: b,
621
- theme: c(u, i, a),
622
+ lang: _,
623
+ theme: c(u, r, a),
622
624
  showLineNumbers: m
623
- }, i, a).then(l);
625
+ }, r, a).then(l);
624
626
  }, [
625
627
  x,
626
- b,
628
+ _,
627
629
  u,
628
630
  m,
629
- i,
631
+ r,
630
632
  a
631
633
  ]);
632
- let te = g.useCallback(async () => {
634
+ let te = v.useCallback(async () => {
633
635
  let e = async (e) => {
634
636
  if (navigator.clipboard && window.isSecureContext) await navigator.clipboard.writeText(e);
635
637
  else {
@@ -648,67 +650,67 @@ function me({ className: t, children: n, meta: r, codeHighlight: i, shikiBundle:
648
650
  console.error("Failed to copy:", e);
649
651
  }
650
652
  }, [x]);
651
- return s ? /* @__PURE__ */ E("div", {
653
+ return s ? /* @__PURE__ */ T("div", {
652
654
  className: "code-block-wrapper",
653
655
  children: [
654
- /* @__PURE__ */ T("span", {
656
+ /* @__PURE__ */ w("span", {
655
657
  className: "code-lang-label",
656
658
  children: ee
657
659
  }),
658
- /* @__PURE__ */ T("button", {
660
+ /* @__PURE__ */ w("button", {
659
661
  className: "code-copy-btn",
660
662
  onClick: te,
661
663
  title: f ? "已复制" : "复制代码",
662
664
  "aria-label": "复制代码",
663
- children: f ? /* @__PURE__ */ T(_, { className: "h-4 w-4 text-green-500" }) : /* @__PURE__ */ T(v, { className: "h-4 w-4" })
665
+ children: f ? /* @__PURE__ */ w(y, { className: "h-4 w-4 text-green-500" }) : /* @__PURE__ */ w(b, { className: "h-4 w-4" })
664
666
  }),
665
- /* @__PURE__ */ T("pre", {
667
+ /* @__PURE__ */ w("pre", {
666
668
  className: `shiki-code-block${m ? " show-line-numbers" : ""}`,
667
669
  dangerouslySetInnerHTML: { __html: s }
668
670
  })
669
671
  ]
670
- }) : /* @__PURE__ */ T("div", {
672
+ }) : /* @__PURE__ */ w("div", {
671
673
  className: "code-block-wrapper",
672
- children: /* @__PURE__ */ T("pre", {
674
+ children: /* @__PURE__ */ w("pre", {
673
675
  className: "shiki-code-block",
674
- children: /* @__PURE__ */ T("code", { children: x })
676
+ children: /* @__PURE__ */ w("code", { children: x })
675
677
  })
676
678
  });
677
679
  }
678
680
  function J({ lang: e, viewerConfig: t, src: n, alt: r, title: i, className: a, node: o, ...s }) {
679
- let [c, l] = g.useState(!1), u = g.useMemo(() => le(e, t?.labels), [e, t?.labels]);
680
- return n ? t?.enabled === !1 ? /* @__PURE__ */ T("img", {
681
+ let [c, l] = v.useState(!1), u = v.useMemo(() => L(e, t?.labels), [e, t?.labels]);
682
+ return n ? t?.enabled === !1 ? /* @__PURE__ */ w("img", {
681
683
  src: n,
682
684
  alt: r || u.imageAltFallback,
683
685
  title: i,
684
686
  className: a,
685
687
  ...s
686
- }) : /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ E("span", {
688
+ }) : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ T("span", {
687
689
  className: "not-prose group relative my-6 block",
688
- children: [/* @__PURE__ */ T("button", {
690
+ children: [/* @__PURE__ */ w("button", {
689
691
  type: "button",
690
692
  className: "block w-full cursor-zoom-in overflow-hidden rounded-2xl border border-border/60 bg-muted/20 shadow-sm transition duration-200 hover:-translate-y-0.5 hover:shadow-xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
691
693
  onClick: () => l(!0),
692
694
  "aria-label": u.preview,
693
695
  title: u.preview,
694
- children: /* @__PURE__ */ T("img", {
696
+ children: /* @__PURE__ */ w("img", {
695
697
  src: n,
696
698
  alt: r || u.imageAltFallback,
697
699
  title: i,
698
700
  className: a ?? "h-auto w-full rounded-2xl object-contain",
699
701
  ...s
700
702
  })
701
- }), /* @__PURE__ */ E("button", {
703
+ }), /* @__PURE__ */ T("button", {
702
704
  type: "button",
703
705
  className: "absolute right-3 top-3 inline-flex items-center gap-2 rounded-full border border-white/20 bg-black/65 px-3 py-1.5 text-xs font-medium text-white opacity-0 shadow-lg transition group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/70",
704
706
  onClick: () => l(!0),
705
707
  "aria-label": u.preview,
706
708
  children: [
707
- /* @__PURE__ */ T("span", {
709
+ /* @__PURE__ */ w("span", {
708
710
  className: "sr-only",
709
711
  children: u.preview
710
712
  }),
711
- /* @__PURE__ */ E("svg", {
713
+ /* @__PURE__ */ T("svg", {
712
714
  "aria-hidden": "true",
713
715
  viewBox: "0 0 24 24",
714
716
  className: "h-3.5 w-3.5",
@@ -717,16 +719,16 @@ function J({ lang: e, viewerConfig: t, src: n, alt: r, title: i, className: a, n
717
719
  strokeWidth: "2",
718
720
  strokeLinecap: "round",
719
721
  strokeLinejoin: "round",
720
- children: [/* @__PURE__ */ T("path", { d: "M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6-10-6-10-6Z" }), /* @__PURE__ */ T("circle", {
722
+ children: [/* @__PURE__ */ w("path", { d: "M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6-10-6-10-6Z" }), /* @__PURE__ */ w("circle", {
721
723
  cx: "12",
722
724
  cy: "12",
723
725
  r: "3"
724
726
  })]
725
727
  }),
726
- /* @__PURE__ */ T("span", { children: u.preview })
728
+ /* @__PURE__ */ w("span", { children: u.preview })
727
729
  ]
728
730
  })]
729
- }), /* @__PURE__ */ T(V, {
731
+ }), /* @__PURE__ */ w(V, {
730
732
  open: c,
731
733
  onOpenChange: l,
732
734
  src: n,
@@ -736,39 +738,39 @@ function J({ lang: e, viewerConfig: t, src: n, alt: r, title: i, className: a, n
736
738
  labels: t?.labels
737
739
  })] }) : null;
738
740
  }
739
- function Y({ source: e, skipFirstH1: t = !1, imageViewer: n, codeHighlight: r, shikiBundle: i }) {
740
- let o = C().lang || "zh-cn", c = s();
741
- g.useEffect(() => {
742
- a(r, i);
743
- }, [r, i]);
744
- let l = g.useMemo(() => {
741
+ function Y({ source: e, skipFirstH1: t = !1, imageViewer: n, codeHighlight: i, shikiBundle: o }) {
742
+ let c = S(), u = c.lang || "zh-cn", d = c.version, f = s();
743
+ v.useEffect(() => {
744
+ r(i, o);
745
+ }, [i, o]);
746
+ let p = v.useMemo(() => {
745
747
  if (!t) return e;
746
748
  let n = e.split("\n"), r = !1;
747
749
  return n.filter((e) => !r && e.startsWith("# ") ? (r = !0, !1) : !0).join("\n");
748
- }, [e, t]), u = g.useMemo(() => W(l), [l]), d = g.useMemo(() => {
750
+ }, [e, t]), m = v.useMemo(() => W(p), [p]), h = v.useMemo(() => {
749
751
  let e = /* @__PURE__ */ new Map();
750
- return c && Object.entries(c).forEach(([t, n]) => {
751
- let r = g.memo(({ children: e, ...t }) => {
752
- let r = K(t);
753
- return g.createElement(n, r, e);
752
+ return f && Object.entries(f).forEach(([t, n]) => {
753
+ let r = v.memo(({ children: e, ...t }) => {
754
+ let r = ge(t);
755
+ return v.createElement(n, r, e);
754
756
  });
755
757
  if (e.set(t, r), t.includes(".")) {
756
758
  let [n, i] = t.split("."), a = `${n.toLowerCase()}-${i.toLowerCase()}`;
757
759
  e.set(a, r);
758
760
  }
759
761
  }), e;
760
- }, [c]), f = g.useMemo(() => Object.fromEntries(d), [d]);
761
- return /* @__PURE__ */ T("div", {
762
+ }, [f]), g = v.useMemo(() => Object.fromEntries(h), [h]);
763
+ return /* @__PURE__ */ w("div", {
762
764
  className: "prose dark:prose-invert max-w-none",
763
- children: /* @__PURE__ */ T(k, {
764
- remarkPlugins: [D, O],
765
+ children: /* @__PURE__ */ w(O, {
766
+ remarkPlugins: [E, D],
765
767
  rehypePlugins: [
766
- j,
767
- M,
768
- I(f),
768
+ de,
769
+ A,
770
+ F(g),
769
771
  H,
770
- [A, { behavior: "append" }],
771
- [ce, {
772
+ [k, { behavior: "append" }],
773
+ [j, {
772
774
  strict: !1,
773
775
  trust: !0,
774
776
  macros: {
@@ -777,72 +779,74 @@ function Y({ source: e, skipFirstH1: t = !1, imageViewer: n, codeHighlight: r, s
777
779
  "\\Z": "\\mathbb{Z}",
778
780
  "\\Q": "\\mathbb{Q}",
779
781
  "\\C": "\\mathbb{C}",
780
- ...F
782
+ ...P
781
783
  }
782
784
  }]
783
785
  ],
784
786
  components: {
785
- ...f,
787
+ ...g,
786
788
  table({ children: e, ...t }) {
787
- return /* @__PURE__ */ T("div", {
789
+ return /* @__PURE__ */ w("div", {
788
790
  className: "overflow-x-auto",
789
- children: /* @__PURE__ */ T("table", {
791
+ children: /* @__PURE__ */ w("table", {
790
792
  ...t,
791
793
  children: e
792
794
  })
793
795
  });
794
796
  },
795
797
  pre({ children: e, ...t }) {
796
- let n = g.Children.toArray(e).find((e) => e?.type === "code" || e?.props?.node?.tagName === "code");
798
+ let n = v.Children.toArray(e).find((e) => e?.type === "code" || e?.props?.node?.tagName === "code");
797
799
  if (n) {
798
- let e = n.props, t = e?.className || "", a = e?.node, o = e?.children, s = e?.["data-raw-value"];
799
- return s && (o = s), /* @__PURE__ */ T(me, {
800
+ let e = n.props, t = e?.className || "", r = /language-(\w+)/.exec(t), a = r ? r[1].toLowerCase() : "text", s = e?.node, c = e?.children, u = e?.["data-raw-value"];
801
+ u && (c = u);
802
+ let d = s?.data?.meta || "";
803
+ return a === "mermaid" ? /* @__PURE__ */ w(l, { chart: typeof c == "string" ? c : String(c || "") }) : /* @__PURE__ */ w(q, {
800
804
  className: t,
801
- meta: a?.data?.meta || "",
802
- codeHighlight: r,
803
- shikiBundle: i,
804
- children: o
805
+ meta: d,
806
+ codeHighlight: i,
807
+ shikiBundle: o,
808
+ children: c
805
809
  });
806
810
  }
807
- return /* @__PURE__ */ T("pre", {
811
+ return /* @__PURE__ */ w("pre", {
808
812
  ...t,
809
813
  children: e
810
814
  });
811
815
  },
812
816
  a({ href: e, children: t, ...n }) {
813
- return e ? e.startsWith("#") ? /* @__PURE__ */ T("a", {
817
+ return e ? e.startsWith("#") ? /* @__PURE__ */ w("a", {
814
818
  href: e,
815
819
  ...n,
816
820
  children: t
817
- }) : /^(https?:)?\/\//i.test(e) || e.startsWith("mailto:") || e.startsWith("tel:") ? /* @__PURE__ */ T("a", {
821
+ }) : /^(https?:)?\/\//i.test(e) || e.startsWith("mailto:") || e.startsWith("tel:") ? /* @__PURE__ */ w("a", {
818
822
  href: e,
819
823
  target: "_blank",
820
824
  rel: "noopener noreferrer",
821
825
  ...n,
822
826
  children: t
823
- }) : /* @__PURE__ */ T(S, {
824
- to: `/${o}${e.startsWith("/") ? e : `/${e}`}`,
827
+ }) : /* @__PURE__ */ w(ue, {
828
+ to: a(u, e.startsWith("/") ? e : `/${e}`, d),
825
829
  ...n,
826
830
  children: t
827
- }) : /* @__PURE__ */ T("a", {
831
+ }) : /* @__PURE__ */ w("a", {
828
832
  ...n,
829
833
  children: t
830
834
  });
831
835
  },
832
- img({ src: e, alt: t, title: r, className: i, node: a, ...s }) {
833
- return /* @__PURE__ */ T(J, {
834
- lang: o,
836
+ img({ src: e, alt: t, title: r, className: i, node: a, ...o }) {
837
+ return /* @__PURE__ */ w(J, {
838
+ lang: u,
835
839
  viewerConfig: n,
836
840
  src: e,
837
841
  alt: t,
838
842
  title: r,
839
843
  className: i,
840
844
  node: a,
841
- ...s
845
+ ...o
842
846
  });
843
847
  }
844
848
  },
845
- children: u
849
+ children: m
846
850
  })
847
851
  });
848
852
  }