react-docs-ui 0.7.6 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/AIChatDialog-C2mEAX2T.js +407 -0
  2. package/dist/{AISelectionTrigger-SLyb8Vep.js → AISelectionTrigger-CWTJRvHo.js} +1 -1
  3. package/dist/{AISettingsPanel-Bsd_wLP4.js → AISettingsPanel-C9Bb_QtE.js} +1 -1
  4. package/dist/{DocsApp-CCFHuucK.js → DocsApp-CTh7Pa9A.js} +3797 -3560
  5. package/dist/{GlobalContextMenu-BtVjQk0v.js → GlobalContextMenu-DAIKsl1l.js} +1 -1
  6. package/dist/{MdxContent-CJydH4kW.js → MdxContent-BAm4izu3.js} +305 -317
  7. package/dist/{MdxContent.lazy-ChT4eAlU.js → MdxContent.lazy-vS9NrZj4.js} +1 -1
  8. package/dist/{SearchDialog-Dh1RvEgs.js → SearchDialog-CLbtpf7I.js} +157 -114
  9. package/dist/{SearchRuntime-wdAGDBv4.js → SearchRuntime--tjedqS6.js} +1 -1
  10. package/dist/{context-menu-BIQsQup7.js → context-menu-DwILPvwC.js} +1 -1
  11. package/dist/{dialog-D8otbqQL.js → dialog-D68sEJBe.js} +1 -1
  12. package/dist/docs-app.es.js +1 -1
  13. package/dist/{mdx-components-BLq-Umts.js → mdx-components-6beJPZgM.js} +2 -2
  14. package/dist/react-docs-ui.css +1 -1
  15. package/dist/react-docs-ui.es.js +10 -10
  16. package/dist/types/components/Breadcrumb.d.ts +14 -0
  17. package/dist/types/components/Breadcrumb.d.ts.map +1 -0
  18. package/dist/types/components/DocsLayout.d.ts.map +1 -1
  19. package/dist/types/components/MdxContent.d.ts.map +1 -1
  20. package/dist/types/components/ReadingProgressBar.d.ts +4 -0
  21. package/dist/types/components/ReadingProgressBar.d.ts.map +1 -0
  22. package/dist/types/components/ReleaseMetaBar.d.ts +1 -1
  23. package/dist/types/components/ReleaseMetaBar.d.ts.map +1 -1
  24. package/dist/types/components/ai/AIChatMessage.d.ts.map +1 -1
  25. package/dist/types/components/search/SearchItem.d.ts.map +1 -1
  26. package/dist/types/hooks/useScrollPosition.d.ts.map +1 -1
  27. package/dist/types/lib/changelog.d.ts +1 -1
  28. package/dist/types/lib/changelog.d.ts.map +1 -1
  29. package/dist/types/lib/config.d.ts +20 -0
  30. package/dist/types/lib/config.d.ts.map +1 -1
  31. package/dist/types/lib/reading-time.d.ts +7 -0
  32. package/dist/types/lib/reading-time.d.ts.map +1 -0
  33. package/dist/types/lib/search/index.d.ts +2 -1
  34. package/dist/types/lib/search/index.d.ts.map +1 -1
  35. package/dist/types/lib/search/runtime/highlighter.d.ts +10 -0
  36. package/dist/types/lib/search/runtime/highlighter.d.ts.map +1 -1
  37. package/dist/types/lib/utils.d.ts +2 -0
  38. package/dist/types/lib/utils.d.ts.map +1 -1
  39. package/dist/utils-KFBtT4Mx.js +25 -0
  40. package/package.json +147 -143
  41. package/scripts/cli.mjs +2 -0
  42. package/scripts/generate-feed.mjs +122 -0
  43. package/scripts/generate-sitemap.mjs +186 -0
  44. package/dist/AIChatDialog-BnAX3dRn.js +0 -418
  45. package/dist/utils-Ct96Mtjw.js +0 -8
@@ -1,14 +1,14 @@
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-BLq-Umts.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 x, ExternalLink as S, Maximize as ee, Minimize as te, RefreshCw as ne, RotateCcw as re, RotateCw as ie, Search as ae, X as oe, ZoomIn as se, ZoomOut as ce } from "lucide-react";
7
- import { Link as le, 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";
1
+ import { n as e, r as t, t as n } from "./utils-KFBtT4Mx.js";
2
+ import { S as r, b as i, c as a, d as o, h as s, l as c, p as l, s as u, t as d, v as f, x as p, y as m } from "./mdx-components-6beJPZgM.js";
3
+ import { t as h } from "./use-toast-DK69oadB.js";
4
+ import { l as g, r as _, t as v, u as y } from "./dialog-D68sEJBe.js";
5
+ import * as b from "react";
6
+ import { Check as ee, Copy as x, Download as te, ExternalLink as S, Maximize as ne, Minimize as re, RefreshCw as ie, RotateCcw as ae, RotateCw as oe, Search as se, X as ce, ZoomIn as le, ZoomOut as ue } from "lucide-react";
7
+ import { Link as C, useParams as w } from "react-router-dom";
8
+ import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
9
+ import O from "remark-gfm";
10
+ import k from "remark-math";
11
+ import de from "react-markdown";
12
12
  import A from "rehype-autolink-headings";
13
13
  import j from "rehype-slug";
14
14
  import M from "rehype-raw";
@@ -73,7 +73,7 @@ var R = {
73
73
  imageLoadError: "Failed to load image"
74
74
  }
75
75
  };
76
- function ue(e = "zh-cn", t) {
76
+ function fe(e = "zh-cn", t) {
77
77
  return {
78
78
  ...R[e === "en" ? "en" : "zh-cn"],
79
79
  ...t
@@ -81,19 +81,19 @@ function ue(e = "zh-cn", t) {
81
81
  }
82
82
  //#endregion
83
83
  //#region src/components/ImageViewer.tsx
84
- var de = .2, fe = 5, pe = .2;
84
+ var pe = .2, me = 5, he = .2;
85
85
  function z(e) {
86
- return Math.min(fe, Math.max(de, Number(e.toFixed(2))));
86
+ return Math.min(me, Math.max(pe, Number(e.toFixed(2))));
87
87
  }
88
- function me(e, t, n) {
88
+ function ge(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 he(e, t) {
92
+ function _e(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 ge(e) {
96
+ function ve(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,66 +101,66 @@ function ge(e) {
101
101
  return !1;
102
102
  }
103
103
  }
104
- function B({ open: r, onOpenChange: i, src: a, alt: o, title: s, lang: c = "zh-cn", labels: l }) {
105
- let y = v.useMemo(() => ue(c, l), [c, l]), b = v.useRef(null), le = v.useRef(null), [C, w] = v.useState(1), [D, O] = v.useState(0), [k, A] = v.useState("fit"), [j, M] = v.useState(!1), [N, P] = v.useState(!1), [F, I] = v.useState({
104
+ function B({ open: e, onOpenChange: t, src: a, alt: o, title: s, lang: c = "zh-cn", labels: l }) {
105
+ let u = b.useMemo(() => fe(c, l), [c, l]), d = b.useRef(null), ee = b.useRef(null), [x, C] = b.useState(1), [w, T] = b.useState(0), [O, k] = b.useState("fit"), [de, A] = b.useState(!1), [j, M] = b.useState(!1), [N, P] = b.useState({
106
106
  x: 0,
107
107
  y: 0
108
- }), [L, R] = v.useState(!1), B = v.useRef(/* @__PURE__ */ new Map()), V = v.useRef(null), H = v.useRef(null), U = o?.trim() || s?.trim() || y.imageAltFallback, W = v.useCallback(() => {
109
- w(1), O(0), A("fit"), P(!1), I({
108
+ }), [F, I] = b.useState(!1), L = b.useRef(/* @__PURE__ */ new Map()), R = b.useRef(null), B = b.useRef(null), V = o?.trim() || s?.trim() || u.imageAltFallback, H = b.useCallback(() => {
109
+ C(1), T(0), k("fit"), M(!1), P({
110
110
  x: 0,
111
111
  y: 0
112
- }), R(!1), B.current.clear(), V.current = null, H.current = null;
112
+ }), I(!1), L.current.clear(), R.current = null, B.current = null;
113
113
  }, []);
114
- v.useEffect(() => {
115
- if (r) {
116
- W();
114
+ b.useEffect(() => {
115
+ if (e) {
116
+ H();
117
117
  return;
118
118
  }
119
- M(!1);
120
- }, [r, W]), v.useEffect(() => {
121
- document.fullscreenElement || M(!1);
122
- }, [r]), v.useEffect(() => {
119
+ A(!1);
120
+ }, [e, H]), b.useEffect(() => {
121
+ document.fullscreenElement || A(!1);
122
+ }, [e]), b.useEffect(() => {
123
123
  let e = () => {
124
- M(!!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 _e = v.useMemo(() => ({
131
- transform: `translate(${F.x}px, ${F.y}px) scale(${C}) rotate(${D}deg)`,
132
- transition: L ? "none" : "transform 160ms ease",
133
- cursor: N ? "default" : L ? "grabbing" : "grab"
130
+ let U = b.useMemo(() => ({
131
+ transform: `translate(${N.x}px, ${N.y}px) scale(${x}) rotate(${w}deg)`,
132
+ transition: F ? "none" : "transform 160ms ease",
133
+ cursor: j ? "default" : F ? "grabbing" : "grab"
134
134
  }), [
135
- L,
136
- N,
137
- D,
138
- C,
139
- F.x,
140
- F.y
141
- ]), G = v.useCallback(() => {
142
- A("actual"), w((e) => z(e + pe));
143
- }, []), K = v.useCallback(() => {
144
- A("actual"), w((e) => z(e - pe));
145
- }, []), q = v.useCallback(() => {
146
- A("fit"), w(1), I({
135
+ F,
136
+ j,
137
+ w,
138
+ x,
139
+ N.x,
140
+ N.y
141
+ ]), W = b.useCallback(() => {
142
+ k("actual"), C((e) => z(e + he));
143
+ }, []), G = b.useCallback(() => {
144
+ k("actual"), C((e) => z(e - he));
145
+ }, []), K = b.useCallback(() => {
146
+ k("fit"), C(1), P({
147
147
  x: 0,
148
148
  y: 0
149
149
  });
150
- }, []), J = v.useCallback(() => {
151
- A("actual"), w(1), I({
150
+ }, []), q = b.useCallback(() => {
151
+ k("actual"), C(1), P({
152
152
  x: 0,
153
153
  y: 0
154
154
  });
155
- }, []), Y = v.useCallback(() => {
156
- O((e) => e - 90);
157
- }, []), X = v.useCallback(() => {
158
- O((e) => e + 90);
159
- }, []), Z = v.useCallback(async () => {
160
- let e = me(a, s, o), t = null;
155
+ }, []), J = b.useCallback(() => {
156
+ T((e) => e - 90);
157
+ }, []), Y = b.useCallback(() => {
158
+ T((e) => e + 90);
159
+ }, []), X = b.useCallback(async () => {
160
+ let e = ge(a, s, o), t = null;
161
161
  try {
162
- if (ge(a)) {
163
- he(a, e), p({ description: y.downloadSuccess });
162
+ if (ve(a)) {
163
+ _e(a, e), h({ description: u.downloadSuccess });
164
164
  return;
165
165
  }
166
166
  } catch {}
@@ -168,268 +168,268 @@ function B({ open: r, onOpenChange: i, src: a, alt: o, title: s, lang: c = "zh-c
168
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), he(t, e), p({ description: y.downloadSuccess });
171
+ t = URL.createObjectURL(r), _e(t, e), h({ description: u.downloadSuccess });
172
172
  } catch {
173
- p({
173
+ h({
174
174
  variant: "destructive",
175
- description: y.downloadError
175
+ description: u.downloadError
176
176
  });
177
177
  } finally {
178
178
  t && URL.revokeObjectURL(t);
179
179
  }
180
180
  }, [
181
181
  o,
182
- y.downloadError,
183
- y.downloadSuccess,
182
+ u.downloadError,
183
+ u.downloadSuccess,
184
184
  a,
185
185
  s
186
- ]), ve = v.useCallback(() => {
186
+ ]), Z = b.useCallback(() => {
187
187
  try {
188
188
  window.open(a, "_blank", "noopener,noreferrer");
189
189
  } catch {
190
- p({
190
+ h({
191
191
  variant: "destructive",
192
- description: y.openInNewTabError
192
+ description: u.openInNewTabError
193
193
  });
194
194
  }
195
- }, [y.openInNewTabError, a]), Q = v.useCallback(async () => {
196
- let e = b.current;
195
+ }, [u.openInNewTabError, a]), Q = b.useCallback(async () => {
196
+ let e = d.current;
197
197
  if (!e?.requestFullscreen) {
198
- p({ description: y.fullscreenError });
198
+ h({ description: u.fullscreenError });
199
199
  return;
200
200
  }
201
201
  try {
202
202
  document.fullscreenElement ? await document.exitFullscreen() : await e.requestFullscreen();
203
203
  } catch {
204
- p({ description: y.fullscreenError });
204
+ h({ description: u.fullscreenError });
205
205
  }
206
- }, [y.fullscreenError]);
207
- v.useEffect(() => {
208
- if (!r) return;
209
- let e = (e) => {
210
- e.key === "+" ? (e.preventDefault(), G()) : e.key === "-" ? (e.preventDefault(), K()) : e.key === "0" ? (e.preventDefault(), W()) : e.key === "f" || e.key === "F" ? (e.preventDefault(), Q()) : e.key === "[" ? (e.preventDefault(), Y()) : e.key === "]" && (e.preventDefault(), X());
206
+ }, [u.fullscreenError]);
207
+ b.useEffect(() => {
208
+ if (!e) return;
209
+ let t = (e) => {
210
+ e.key === "+" ? (e.preventDefault(), W()) : e.key === "-" ? (e.preventDefault(), G()) : e.key === "0" ? (e.preventDefault(), H()) : e.key === "f" || e.key === "F" ? (e.preventDefault(), Q()) : e.key === "[" ? (e.preventDefault(), J()) : e.key === "]" && (e.preventDefault(), Y());
211
211
  };
212
- return window.addEventListener("keydown", e), () => {
213
- window.removeEventListener("keydown", e);
212
+ return window.addEventListener("keydown", t), () => {
213
+ window.removeEventListener("keydown", t);
214
214
  };
215
215
  }, [
216
216
  Q,
217
- r,
218
- W,
217
+ e,
218
+ H,
219
+ J,
219
220
  Y,
220
- X,
221
- G,
222
- K
221
+ W,
222
+ G
223
223
  ]);
224
- let $ = v.useCallback((e) => {
225
- e.preventDefault(), e.stopPropagation(), e.deltaY < 0 ? G() : K();
226
- }, [G, K]);
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", $);
224
+ let $ = b.useCallback((e) => {
225
+ e.preventDefault(), e.stopPropagation(), e.deltaY < 0 ? W() : G();
226
+ }, [W, G]);
227
+ b.useEffect(() => {
228
+ if (!e) return;
229
+ let t = d.current;
230
+ if (t) return t.addEventListener("wheel", $, { passive: !1 }), () => {
231
+ t.removeEventListener("wheel", $);
232
232
  };
233
- }, [$, r]);
234
- let ye = v.useCallback((e) => {
235
- B.current.set(e.pointerId, {
233
+ }, [$, e]);
234
+ let ye = b.useCallback((e) => {
235
+ L.current.set(e.pointerId, {
236
236
  x: e.clientX,
237
237
  y: e.clientY
238
238
  });
239
- let t = Array.from(B.current.values());
240
- if (t.length === 2 && H.current) {
241
- let [e, n] = t, r = Math.hypot(n.x - e.x, n.y - e.y), i = z(H.current.startScale * (r / H.current.startDistance));
242
- A("actual"), w(i);
239
+ let t = Array.from(L.current.values());
240
+ if (t.length === 2 && B.current) {
241
+ let [e, n] = t, r = Math.hypot(n.x - e.x, n.y - e.y), i = z(B.current.startScale * (r / B.current.startDistance));
242
+ k("actual"), C(i);
243
243
  return;
244
244
  }
245
- let n = V.current;
246
- !n || n.pointerId !== e.pointerId || I({
245
+ let n = R.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 = v.useCallback((e) => {
251
- e && b.current?.hasPointerCapture(e.pointerId) && b.current.releasePointerCapture(e.pointerId), e && B.current.delete(e.pointerId), V.current = null, B.current.size < 2 && (H.current = null), R(!1);
252
- }, []), xe = v.useCallback((e) => {
253
- if (e.button !== 0 || N) return;
254
- e.preventDefault(), e.stopPropagation(), e.currentTarget.setPointerCapture(e.pointerId), B.current.set(e.pointerId, {
250
+ }, []), be = b.useCallback((e) => {
251
+ e && d.current?.hasPointerCapture(e.pointerId) && d.current.releasePointerCapture(e.pointerId), e && L.current.delete(e.pointerId), R.current = null, L.current.size < 2 && (B.current = null), I(!1);
252
+ }, []), xe = b.useCallback((e) => {
253
+ if (e.button !== 0 || j) return;
254
+ e.preventDefault(), e.stopPropagation(), e.currentTarget.setPointerCapture(e.pointerId), L.current.set(e.pointerId, {
255
255
  x: e.clientX,
256
256
  y: e.clientY
257
257
  });
258
- let t = Array.from(B.current.values());
258
+ let t = Array.from(L.current.values());
259
259
  if (t.length === 2) {
260
260
  let [e, n] = t;
261
- H.current = {
261
+ B.current = {
262
262
  startDistance: Math.max(1, Math.hypot(n.x - e.x, n.y - e.y)),
263
- startScale: C
264
- }, V.current = null, R(!1);
263
+ startScale: x
264
+ }, R.current = null, I(!1);
265
265
  return;
266
266
  }
267
- V.current = {
267
+ R.current = {
268
268
  pointerId: e.pointerId,
269
269
  startX: e.clientX,
270
270
  startY: e.clientY,
271
- originX: F.x,
272
- originY: F.y
273
- }, R(!0);
271
+ originX: N.x,
272
+ originY: N.y
273
+ }, I(!0);
274
274
  }, [
275
- N,
276
- C,
277
- F.x,
278
- F.y
275
+ j,
276
+ x,
277
+ N.x,
278
+ N.y
279
279
  ]);
280
- v.useEffect(() => {
281
- if (!r) return;
282
- let e = (e) => {
283
- let t = b.current, n = e.target;
280
+ b.useEffect(() => {
281
+ if (!e) return;
282
+ let t = (e) => {
283
+ let t = d.current, n = e.target;
284
284
  !t || !(n instanceof Node) || !t.contains(n) || !e.ctrlKey || $(e);
285
285
  };
286
- return window.addEventListener("wheel", e, {
286
+ return window.addEventListener("wheel", t, {
287
287
  passive: !1,
288
288
  capture: !0
289
289
  }), () => {
290
- window.removeEventListener("wheel", e, { capture: !0 });
290
+ window.removeEventListener("wheel", t, { capture: !0 });
291
291
  };
292
- }, [$, r]);
293
- let Se = v.useMemo(() => [
292
+ }, [$, e]);
293
+ let Se = b.useMemo(() => [
294
294
  {
295
295
  key: "zoom-in",
296
- label: y.zoomIn,
297
- icon: se,
298
- onClick: G,
299
- disabled: N || C >= fe
296
+ label: u.zoomIn,
297
+ icon: le,
298
+ onClick: W,
299
+ disabled: j || x >= me
300
300
  },
301
301
  {
302
302
  key: "zoom-out",
303
- label: y.zoomOut,
304
- icon: ce,
305
- onClick: K,
306
- disabled: N || C <= de
303
+ label: u.zoomOut,
304
+ icon: ue,
305
+ onClick: G,
306
+ disabled: j || x <= pe
307
307
  },
308
308
  {
309
309
  key: "fit",
310
- label: y.fit,
311
- icon: te,
312
- onClick: q,
313
- disabled: N
310
+ label: u.fit,
311
+ icon: re,
312
+ onClick: K,
313
+ disabled: j
314
314
  },
315
315
  {
316
316
  key: "actual-size",
317
- label: y.actualSize,
318
- icon: ae,
319
- onClick: J,
320
- disabled: N
317
+ label: u.actualSize,
318
+ icon: se,
319
+ onClick: q,
320
+ disabled: j
321
321
  },
322
322
  {
323
323
  key: "reset",
324
- label: y.reset,
325
- icon: ne,
326
- onClick: W,
327
- disabled: N
324
+ label: u.reset,
325
+ icon: ie,
326
+ onClick: H,
327
+ disabled: j
328
328
  },
329
329
  {
330
330
  key: "rotate-left",
331
- label: y.rotateLeft,
332
- icon: re,
333
- onClick: Y,
334
- disabled: N
331
+ label: u.rotateLeft,
332
+ icon: ae,
333
+ onClick: J,
334
+ disabled: j
335
335
  },
336
336
  {
337
337
  key: "rotate-right",
338
- label: y.rotateRight,
339
- icon: ie,
340
- onClick: X,
341
- disabled: N
338
+ label: u.rotateRight,
339
+ icon: oe,
340
+ onClick: Y,
341
+ disabled: j
342
342
  },
343
343
  {
344
344
  key: "fullscreen",
345
- label: y.fullscreen,
346
- icon: ee,
345
+ label: u.fullscreen,
346
+ icon: ne,
347
347
  onClick: () => void Q(),
348
348
  disabled: !1
349
349
  },
350
350
  {
351
351
  key: "download",
352
- label: y.download,
353
- icon: x,
354
- onClick: Z,
355
- disabled: N
352
+ label: u.download,
353
+ icon: te,
354
+ onClick: X,
355
+ disabled: j
356
356
  },
357
357
  {
358
358
  key: "new-tab",
359
- label: y.openInNewTab,
359
+ label: u.openInNewTab,
360
360
  icon: S,
361
- onClick: ve,
361
+ onClick: Z,
362
362
  disabled: !1
363
363
  }
364
364
  ], [
365
- Z,
366
- Q,
367
- ve,
368
- N,
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
- W,
380
- Y,
381
365
  X,
382
- C,
366
+ Q,
367
+ Z,
368
+ j,
369
+ u.actualSize,
370
+ u.download,
371
+ u.fit,
372
+ u.fullscreen,
373
+ u.openInNewTab,
374
+ u.reset,
375
+ u.rotateLeft,
376
+ u.rotateRight,
377
+ u.zoomIn,
378
+ u.zoomOut,
379
+ H,
383
380
  J,
381
+ Y,
382
+ x,
384
383
  q,
385
- G,
386
- K
384
+ K,
385
+ W,
386
+ G
387
387
  ]);
388
- return /* @__PURE__ */ T(g, {
389
- open: r,
390
- onOpenChange: i,
391
- children: /* @__PURE__ */ E(h, {
388
+ return /* @__PURE__ */ E(v, {
389
+ open: e,
390
+ onOpenChange: t,
391
+ children: /* @__PURE__ */ D(_, {
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(_, { children: U }),
396
- /* @__PURE__ */ T(m, { children: y.close }),
397
- /* @__PURE__ */ E(n, {
395
+ /* @__PURE__ */ E(y, { children: V }),
396
+ /* @__PURE__ */ E(g, { children: u.close }),
397
+ /* @__PURE__ */ D(i, {
398
398
  delayDuration: 100,
399
- children: [/* @__PURE__ */ E("div", {
399
+ children: [/* @__PURE__ */ D("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__ */ D("div", {
402
402
  className: "min-w-0",
403
- children: [/* @__PURE__ */ T("p", {
403
+ children: [/* @__PURE__ */ E("p", {
404
404
  className: "truncate text-sm font-medium",
405
- children: U
406
- }), /* @__PURE__ */ E("p", {
405
+ children: V
406
+ }), /* @__PURE__ */ D("p", {
407
407
  className: "text-xs text-zinc-400",
408
408
  children: [
409
- k === "fit" ? y.fit : `${Math.round(C * 100)}%`,
410
- D === 0 ? "" : ` · ${D}deg`,
411
- j ? ` · ${y.fullscreen}` : ""
409
+ O === "fit" ? u.fit : `${Math.round(x * 100)}%`,
410
+ w === 0 ? "" : ` · ${w}deg`,
411
+ de ? ` · ${u.fullscreen}` : ""
412
412
  ]
413
413
  })]
414
- }), /* @__PURE__ */ T(t, {
414
+ }), /* @__PURE__ */ E(r, {
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: () => i(!1),
420
- "aria-label": y.close,
421
- title: y.close,
422
- children: /* @__PURE__ */ T(oe, { className: "h-4 w-4" })
419
+ onClick: () => t(!1),
420
+ "aria-label": u.close,
421
+ title: u.close,
422
+ children: /* @__PURE__ */ E(ce, { className: "h-4 w-4" })
423
423
  })]
424
- }), /* @__PURE__ */ T("div", {
424
+ }), /* @__PURE__ */ E("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__ */ E("div", {
427
427
  className: "flex min-w-max items-center gap-2",
428
428
  children: Se.map((e) => {
429
- let n = e.icon;
430
- return /* @__PURE__ */ E(u, { children: [/* @__PURE__ */ T(d, {
429
+ let t = e.icon;
430
+ return /* @__PURE__ */ D(f, { children: [/* @__PURE__ */ E(p, {
431
431
  asChild: !0,
432
- children: /* @__PURE__ */ T(t, {
432
+ children: /* @__PURE__ */ E(r, {
433
433
  type: "button",
434
434
  size: "icon",
435
435
  variant: "secondary",
@@ -438,43 +438,43 @@ function B({ open: r, onOpenChange: i, src: a, alt: o, title: s, lang: c = "zh-c
438
438
  disabled: e.disabled,
439
439
  "aria-label": e.label,
440
440
  title: e.label,
441
- children: /* @__PURE__ */ T(n, { className: "h-4 w-4" })
441
+ children: /* @__PURE__ */ E(t, { className: "h-4 w-4" })
442
442
  })
443
- }), /* @__PURE__ */ T(f, { children: e.label })] }, e.key);
443
+ }), /* @__PURE__ */ E(m, { children: e.label })] }, e.key);
444
444
  })
445
445
  })
446
446
  })]
447
447
  }),
448
- /* @__PURE__ */ T("div", {
449
- ref: b,
448
+ /* @__PURE__ */ E("div", {
449
+ ref: d,
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: N ? /* @__PURE__ */ E("div", {
455
+ children: j ? /* @__PURE__ */ D("div", {
456
456
  className: "flex flex-col items-center gap-2 text-center",
457
457
  children: [
458
- /* @__PURE__ */ T("div", {
458
+ /* @__PURE__ */ E("div", {
459
459
  className: "rounded-full border border-red-500/40 bg-red-500/10 p-3 text-red-300",
460
- children: /* @__PURE__ */ T(ae, { className: "h-5 w-5" })
460
+ children: /* @__PURE__ */ E(se, { className: "h-5 w-5" })
461
461
  }),
462
- /* @__PURE__ */ T("p", {
462
+ /* @__PURE__ */ E("p", {
463
463
  className: "text-sm font-medium",
464
- children: y.imageLoadError
464
+ children: u.imageLoadError
465
465
  }),
466
- /* @__PURE__ */ T("p", {
466
+ /* @__PURE__ */ E("p", {
467
467
  className: "max-w-md text-xs text-zinc-400",
468
468
  children: a
469
469
  })
470
470
  ]
471
- }) : /* @__PURE__ */ T("img", {
472
- ref: le,
471
+ }) : /* @__PURE__ */ E("img", {
472
+ ref: ee,
473
473
  src: a,
474
- alt: U,
475
- className: e("max-h-full max-w-full select-none rounded-lg object-contain shadow-2xl", k === "fit" ? "h-auto w-auto" : ""),
476
- style: _e,
477
- onError: () => P(!0),
474
+ alt: V,
475
+ className: n("max-h-full max-w-full select-none rounded-lg object-contain shadow-2xl", O === "fit" ? "h-auto w-auto" : ""),
476
+ style: U,
477
+ onError: () => M(!0),
478
478
  draggable: !1
479
479
  })
480
480
  })
@@ -530,7 +530,7 @@ function W(e) {
530
530
  "off"
531
531
  ].includes(t)) return !1;
532
532
  }
533
- function _e(e, t) {
533
+ function G(e, t) {
534
534
  let n = {
535
535
  title: e,
536
536
  width: U(t?.width),
@@ -553,18 +553,18 @@ function _e(e, t) {
553
553
  return t;
554
554
  }), n.title = r.replace(/\s{2,}/g, " ").trim() || void 0, n;
555
555
  }
556
- function G(e) {
556
+ function K(e) {
557
557
  let t = e, n = "";
558
558
  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) => {
559
- let i = K(n), a = t.toLowerCase().replace(/\./g, "-");
559
+ let i = q(n), a = t.toLowerCase().replace(/\./g, "-");
560
560
  return `<${a}${i}>${r}</${a}>`;
561
561
  }).replace(/<([A-Z][a-zA-Z0-9]*(?:\.[A-Z][a-zA-Z0-9]*)*)(\s+[^>]*?)\s*\/>/g, (e, t, n) => {
562
- let r = K(n), i = t.toLowerCase().replace(/\./g, "-");
562
+ let r = q(n), i = t.toLowerCase().replace(/\./g, "-");
563
563
  return `<${i}${r}></${i}>`;
564
564
  });
565
565
  return t;
566
566
  }
567
- function K(e) {
567
+ function q(e) {
568
568
  if (!e) return "";
569
569
  let t = [], n = /(\w+)=(?:{([^}]+)}|"([^"]*)"|'([^']*)')/g, r;
570
570
  for (; (r = n.exec(e)) !== null;) {
@@ -573,7 +573,7 @@ function K(e) {
573
573
  }
574
574
  return t.length > 0 ? " " + t.join(" ") : "";
575
575
  }
576
- function q(e) {
576
+ function J(e) {
577
577
  let t = {};
578
578
  for (let [n, r] of Object.entries(e)) if (n.startsWith("data-")) {
579
579
  let e = n.slice(5);
@@ -596,7 +596,7 @@ function q(e) {
596
596
  }
597
597
  return t;
598
598
  }
599
- var J = {
599
+ var Y = {
600
600
  js: "JavaScript",
601
601
  javascript: "JavaScript",
602
602
  ts: "TypeScript",
@@ -638,10 +638,10 @@ var J = {
638
638
  diff: "Diff",
639
639
  text: "Text"
640
640
  };
641
- function Y({ className: e, children: t, meta: n, codeHighlight: r, shikiBundle: a }) {
642
- 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), x = J[g.toLowerCase()] || g.toUpperCase(), S = v.useMemo(() => {
641
+ function X({ className: n, children: r, meta: i, codeHighlight: a, shikiBundle: s }) {
642
+ let [l, d] = b.useState(""), [f, p] = b.useState(!1), [m, h] = b.useState(!1), g = b.useMemo(() => i?.toLowerCase().includes("showlinenumbers") ?? !1, [i]), _ = /language-(\w+)/.exec(n || ""), v = _ ? _[1] : "text", y = o(v), te = Y[v.toLowerCase()] || v.toUpperCase(), S = b.useMemo(() => {
643
643
  let e = "";
644
- return e = typeof t == "string" ? t : v.Children.count(t) === 1 && typeof t == "string" ? String(t) : v.Children.toArray(t).map((e) => {
644
+ return e = typeof r == "string" ? r : b.Children.count(r) === 1 && typeof r == "string" ? String(r) : b.Children.toArray(r).map((e) => {
645
645
  if (typeof e == "string") return e;
646
646
  if (typeof e == "object" && e && "props" in e) {
647
647
  let t = e.props;
@@ -652,10 +652,10 @@ function Y({ className: e, children: t, meta: n, codeHighlight: r, shikiBundle:
652
652
  }
653
653
  return "";
654
654
  }).join(""), e.replace(/^\n+/, "").replace(/\n+$/, "");
655
- }, [t]);
656
- v.useEffect(() => {
655
+ }, [r]);
656
+ b.useEffect(() => {
657
657
  let e = () => {
658
- d(document.documentElement.classList.contains("dark"));
658
+ p(document.documentElement.classList.contains("dark"));
659
659
  };
660
660
  e();
661
661
  let t = new MutationObserver(() => e());
@@ -663,68 +663,56 @@ function Y({ className: e, children: t, meta: n, codeHighlight: r, shikiBundle:
663
663
  attributes: !0,
664
664
  attributeFilter: ["class"]
665
665
  }), () => t.disconnect();
666
- }, []), v.useEffect(() => {
667
- o(S, {
668
- lang: _,
669
- theme: c(u, r, a),
670
- showLineNumbers: m
671
- }, r, a).then(l);
666
+ }, []), b.useEffect(() => {
667
+ c(S, {
668
+ lang: y,
669
+ theme: u(f, a, s),
670
+ showLineNumbers: g
671
+ }, a, s).then((e) => d(t(e)));
672
672
  }, [
673
673
  S,
674
- _,
675
- u,
676
- m,
677
- r,
678
- a
674
+ y,
675
+ f,
676
+ g,
677
+ a,
678
+ s
679
679
  ]);
680
- let ee = v.useCallback(async () => {
681
- let e = async (e) => {
682
- if (navigator.clipboard && window.isSecureContext) await navigator.clipboard.writeText(e);
683
- else {
684
- let t = document.createElement("textarea");
685
- t.value = e, t.style.position = "fixed", t.style.left = "-9999px", t.style.top = "-9999px", document.body.appendChild(t), t.focus(), t.select();
686
- try {
687
- document.execCommand("copy");
688
- } finally {
689
- document.body.removeChild(t);
690
- }
691
- }
692
- };
680
+ let ne = b.useCallback(async () => {
693
681
  try {
694
- await e(S), p(!0), setTimeout(() => p(!1), 2e3);
682
+ await e(S), h(!0), setTimeout(() => h(!1), 2e3);
695
683
  } catch (e) {
696
684
  console.error("Failed to copy:", e);
697
685
  }
698
686
  }, [S]);
699
- return s ? /* @__PURE__ */ E("div", {
687
+ return l ? /* @__PURE__ */ D("div", {
700
688
  className: "code-block-wrapper",
701
689
  children: [
702
- /* @__PURE__ */ T("span", {
690
+ /* @__PURE__ */ E("span", {
703
691
  className: "code-lang-label",
704
- children: x
692
+ children: te
705
693
  }),
706
- /* @__PURE__ */ T("button", {
694
+ /* @__PURE__ */ E("button", {
707
695
  className: "code-copy-btn",
708
- onClick: ee,
709
- title: f ? "已复制" : "复制代码",
696
+ onClick: ne,
697
+ title: m ? "已复制" : "复制代码",
710
698
  "aria-label": "复制代码",
711
- children: f ? /* @__PURE__ */ T(y, { className: "h-4 w-4 text-green-500" }) : /* @__PURE__ */ T(b, { className: "h-4 w-4" })
699
+ children: m ? /* @__PURE__ */ E(ee, { className: "h-4 w-4 text-green-500" }) : /* @__PURE__ */ E(x, { className: "h-4 w-4" })
712
700
  }),
713
- /* @__PURE__ */ T("pre", {
714
- className: `shiki-code-block${m ? " show-line-numbers" : ""}`,
715
- dangerouslySetInnerHTML: { __html: s }
701
+ /* @__PURE__ */ E("pre", {
702
+ className: `shiki-code-block${g ? " show-line-numbers" : ""}`,
703
+ dangerouslySetInnerHTML: { __html: l }
716
704
  })
717
705
  ]
718
- }) : /* @__PURE__ */ T("div", {
706
+ }) : /* @__PURE__ */ E("div", {
719
707
  className: "code-block-wrapper",
720
- children: /* @__PURE__ */ T("pre", {
708
+ children: /* @__PURE__ */ E("pre", {
721
709
  className: "shiki-code-block",
722
- children: /* @__PURE__ */ T("code", { children: S })
710
+ children: /* @__PURE__ */ E("code", { children: S })
723
711
  })
724
712
  });
725
713
  }
726
- function X({ lang: e, viewerConfig: t, src: n, alt: r, title: i, className: a, node: o, ...s }) {
727
- let [c, l] = v.useState(!1), u = v.useMemo(() => ue(e, t?.labels), [e, t?.labels]), d = v.useMemo(() => _e(i, s), [s, i]), f = d.preview ?? t?.enabled !== !1, p = d.inline === !0, m = !!(d.width || d.height), h = v.useMemo(() => ({
714
+ function Z({ lang: e, viewerConfig: t, src: n, alt: r, title: i, className: a, node: o, ...s }) {
715
+ let [c, l] = b.useState(!1), u = b.useMemo(() => fe(e, t?.labels), [e, t?.labels]), d = b.useMemo(() => G(i, s), [s, i]), f = d.preview ?? t?.enabled !== !1, p = d.inline === !0, m = !!(d.width || d.height), h = b.useMemo(() => ({
728
716
  ...s.style,
729
717
  width: d.width ?? s.style?.width,
730
718
  height: d.height ?? s.style?.height,
@@ -736,13 +724,13 @@ function X({ lang: e, viewerConfig: t, src: n, alt: r, title: i, className: a, n
736
724
  d.width,
737
725
  s.style
738
726
  ]);
739
- return n ? f ? m || p ? /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T("button", {
727
+ return n ? f ? m || p ? /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E("button", {
740
728
  type: "button",
741
729
  className: "not-prose inline-flex max-w-full cursor-zoom-in align-middle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
742
730
  onClick: () => l(!0),
743
731
  "aria-label": u.preview,
744
732
  title: u.preview,
745
- children: /* @__PURE__ */ T("img", {
733
+ children: /* @__PURE__ */ E("img", {
746
734
  ...s,
747
735
  src: n,
748
736
  alt: r || u.imageAltFallback,
@@ -750,7 +738,7 @@ function X({ lang: e, viewerConfig: t, src: n, alt: r, title: i, className: a, n
750
738
  className: a ?? (p ? "inline-block align-middle" : void 0),
751
739
  style: h
752
740
  })
753
- }), /* @__PURE__ */ T(B, {
741
+ }), /* @__PURE__ */ E(B, {
754
742
  open: c,
755
743
  onOpenChange: l,
756
744
  src: n,
@@ -758,15 +746,15 @@ function X({ lang: e, viewerConfig: t, src: n, alt: r, title: i, className: a, n
758
746
  title: d.title,
759
747
  lang: e,
760
748
  labels: t?.labels
761
- })] }) : /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ E("span", {
749
+ })] }) : /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ D("span", {
762
750
  className: "not-prose group relative my-6 block",
763
- children: [/* @__PURE__ */ T("button", {
751
+ children: [/* @__PURE__ */ E("button", {
764
752
  type: "button",
765
753
  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",
766
754
  onClick: () => l(!0),
767
755
  "aria-label": u.preview,
768
756
  title: u.preview,
769
- children: /* @__PURE__ */ T("img", {
757
+ children: /* @__PURE__ */ E("img", {
770
758
  ...s,
771
759
  src: n,
772
760
  alt: r || u.imageAltFallback,
@@ -774,17 +762,17 @@ function X({ lang: e, viewerConfig: t, src: n, alt: r, title: i, className: a, n
774
762
  className: a ?? "h-auto w-full rounded-2xl object-contain",
775
763
  style: h
776
764
  })
777
- }), /* @__PURE__ */ E("button", {
765
+ }), /* @__PURE__ */ D("button", {
778
766
  type: "button",
779
767
  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",
780
768
  onClick: () => l(!0),
781
769
  "aria-label": u.preview,
782
770
  children: [
783
- /* @__PURE__ */ T("span", {
771
+ /* @__PURE__ */ E("span", {
784
772
  className: "sr-only",
785
773
  children: u.preview
786
774
  }),
787
- /* @__PURE__ */ E("svg", {
775
+ /* @__PURE__ */ D("svg", {
788
776
  "aria-hidden": "true",
789
777
  viewBox: "0 0 24 24",
790
778
  className: "h-3.5 w-3.5",
@@ -793,16 +781,16 @@ function X({ lang: e, viewerConfig: t, src: n, alt: r, title: i, className: a, n
793
781
  strokeWidth: "2",
794
782
  strokeLinecap: "round",
795
783
  strokeLinejoin: "round",
796
- 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", {
784
+ children: [/* @__PURE__ */ E("path", { d: "M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6-10-6-10-6Z" }), /* @__PURE__ */ E("circle", {
797
785
  cx: "12",
798
786
  cy: "12",
799
787
  r: "3"
800
788
  })]
801
789
  }),
802
- /* @__PURE__ */ T("span", { children: u.preview })
790
+ /* @__PURE__ */ E("span", { children: u.preview })
803
791
  ]
804
792
  })]
805
- }), /* @__PURE__ */ T(B, {
793
+ }), /* @__PURE__ */ E(B, {
806
794
  open: c,
807
795
  onOpenChange: l,
808
796
  src: n,
@@ -810,7 +798,7 @@ function X({ lang: e, viewerConfig: t, src: n, alt: r, title: i, className: a, n
810
798
  title: d.title,
811
799
  lang: e,
812
800
  labels: t?.labels
813
- })] }) : /* @__PURE__ */ T("img", {
801
+ })] }) : /* @__PURE__ */ E("img", {
814
802
  ...s,
815
803
  src: n,
816
804
  alt: r || u.imageAltFallback,
@@ -819,32 +807,32 @@ function X({ lang: e, viewerConfig: t, src: n, alt: r, title: i, className: a, n
819
807
  style: h
820
808
  }) : null;
821
809
  }
822
- function Z({ source: e, skipFirstH1: t = !1, imageViewer: n, codeHighlight: i, shikiBundle: o }) {
823
- let c = C(), u = c.lang || "zh-cn", d = c.version, f = s();
824
- v.useEffect(() => {
825
- r(i, o);
826
- }, [i, o]);
827
- let p = v.useMemo(() => {
810
+ function Q({ source: e, skipFirstH1: t = !1, imageViewer: n, codeHighlight: r, shikiBundle: i }) {
811
+ let o = w(), c = o.lang || "zh-cn", u = o.version, f = l();
812
+ b.useEffect(() => {
813
+ a(r, i);
814
+ }, [r, i]);
815
+ let p = b.useMemo(() => {
828
816
  if (!t) return e;
829
817
  let n = e.split("\n"), r = !1;
830
818
  return n.filter((e) => !r && e.startsWith("# ") ? (r = !0, !1) : !0).join("\n");
831
- }, [e, t]), m = v.useMemo(() => G(p), [p]), h = v.useMemo(() => {
819
+ }, [e, t]), m = b.useMemo(() => K(p), [p]), h = b.useMemo(() => {
832
820
  let e = /* @__PURE__ */ new Map();
833
821
  return f && Object.entries(f).forEach(([t, n]) => {
834
- let r = v.memo(({ children: e, ...t }) => {
835
- let r = q(t);
836
- return v.createElement(n, r, e);
822
+ let r = b.memo(({ children: e, ...t }) => {
823
+ let r = J(t);
824
+ return b.createElement(n, r, e);
837
825
  });
838
826
  if (e.set(t, r), e.set(t.toLowerCase(), r), t.includes(".")) {
839
827
  let [n, i] = t.split("."), a = `${n.toLowerCase()}-${i.toLowerCase()}`;
840
828
  e.set(a, r);
841
829
  }
842
830
  }), e;
843
- }, [f]), g = v.useMemo(() => Object.fromEntries(h), [h]);
844
- return /* @__PURE__ */ T("div", {
831
+ }, [f]), g = b.useMemo(() => Object.fromEntries(h), [h]);
832
+ return /* @__PURE__ */ E("div", {
845
833
  className: "prose dark:prose-invert max-w-none",
846
- children: /* @__PURE__ */ T(k, {
847
- remarkPlugins: [D, O],
834
+ children: /* @__PURE__ */ E(de, {
835
+ remarkPlugins: [O, k],
848
836
  rehypePlugins: [
849
837
  j,
850
838
  M,
@@ -867,56 +855,56 @@ function Z({ source: e, skipFirstH1: t = !1, imageViewer: n, codeHighlight: i, s
867
855
  components: {
868
856
  ...g,
869
857
  table({ children: e, ...t }) {
870
- return /* @__PURE__ */ T("div", {
858
+ return /* @__PURE__ */ E("div", {
871
859
  className: "overflow-x-auto",
872
- children: /* @__PURE__ */ T("table", {
860
+ children: /* @__PURE__ */ E("table", {
873
861
  ...t,
874
862
  children: e
875
863
  })
876
864
  });
877
865
  },
878
866
  pre({ children: e, ...t }) {
879
- let n = v.Children.toArray(e).find((e) => e?.type === "code" || e?.props?.node?.tagName === "code");
867
+ let n = b.Children.toArray(e).find((e) => e?.type === "code" || e?.props?.node?.tagName === "code");
880
868
  if (n) {
881
- 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"];
882
- u && (c = u);
883
- let d = s?.data?.meta || "";
884
- return a === "mermaid" ? /* @__PURE__ */ T(l, { chart: typeof c == "string" ? c : String(c || "") }) : /* @__PURE__ */ T(Y, {
869
+ let e = n.props, t = e?.className || "", a = /language-(\w+)/.exec(t), o = a ? a[1].toLowerCase() : "text", s = e?.node, c = e?.children, l = e?.["data-raw-value"];
870
+ l && (c = l);
871
+ let u = s?.data?.meta || "";
872
+ return o === "mermaid" ? /* @__PURE__ */ E(d, { chart: typeof c == "string" ? c : String(c || "") }) : /* @__PURE__ */ E(X, {
885
873
  className: t,
886
- meta: d,
887
- codeHighlight: i,
888
- shikiBundle: o,
874
+ meta: u,
875
+ codeHighlight: r,
876
+ shikiBundle: i,
889
877
  children: c
890
878
  });
891
879
  }
892
- return /* @__PURE__ */ T("pre", {
880
+ return /* @__PURE__ */ E("pre", {
893
881
  ...t,
894
882
  children: e
895
883
  });
896
884
  },
897
885
  a({ href: e, children: t, ...n }) {
898
- return e ? e.startsWith("#") ? /* @__PURE__ */ T("a", {
886
+ return e ? e.startsWith("#") ? /* @__PURE__ */ E("a", {
899
887
  href: e,
900
888
  ...n,
901
889
  children: t
902
- }) : /^(https?:)?\/\//i.test(e) || e.startsWith("mailto:") || e.startsWith("tel:") ? /* @__PURE__ */ T("a", {
890
+ }) : /^(https?:)?\/\//i.test(e) || e.startsWith("mailto:") || e.startsWith("tel:") ? /* @__PURE__ */ E("a", {
903
891
  href: e,
904
892
  target: "_blank",
905
893
  rel: "noopener noreferrer",
906
894
  ...n,
907
895
  children: t
908
- }) : /* @__PURE__ */ T(le, {
909
- to: a(u, e.startsWith("/") ? e : `/${e}`, d),
896
+ }) : /* @__PURE__ */ E(C, {
897
+ to: s(c, e.startsWith("/") ? e : `/${e}`, u),
910
898
  ...n,
911
899
  children: t
912
- }) : /* @__PURE__ */ T("a", {
900
+ }) : /* @__PURE__ */ E("a", {
913
901
  ...n,
914
902
  children: t
915
903
  });
916
904
  },
917
905
  img({ src: e, alt: t, title: r, className: i, node: a, ...o }) {
918
- return /* @__PURE__ */ T(X, {
919
- lang: u,
906
+ return /* @__PURE__ */ E(Z, {
907
+ lang: c,
920
908
  viewerConfig: n,
921
909
  src: e,
922
910
  alt: t,
@@ -932,4 +920,4 @@ function Z({ source: e, skipFirstH1: t = !1, imageViewer: n, codeHighlight: i, s
932
920
  });
933
921
  }
934
922
  //#endregion
935
- export { B as n, Z as t };
923
+ export { B as n, Q as t };