@docfuse/markdown 0.1.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 (121) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -0
  3. package/README.zh-CN.md +50 -0
  4. package/dist/Markdown-D33gcJbF.js +2116 -0
  5. package/dist/base.css +2 -0
  6. package/dist/client/chunks/client-DIoaSmq2.js +334 -0
  7. package/dist/client/chunks/gallery-BPqV7HsS.js +40 -0
  8. package/dist/client/chunks/image-BGExZy1g.js +36 -0
  9. package/dist/client/chunks/provider-DL6V8F7z.js +841 -0
  10. package/dist/client/chunks/react-runtime-ByABE9MG.js +10571 -0
  11. package/dist/client/chunks/serialized-BvfsNeRQ.js +3464 -0
  12. package/dist/client/chunks/table-DBiKAEbC.js +30 -0
  13. package/dist/client/index.js +4 -0
  14. package/dist/client/nativeBehaviors.d.ts +4 -0
  15. package/dist/client.d.ts +15 -0
  16. package/dist/compiler/analyze.d.ts +27 -0
  17. package/dist/compiler/assets.d.ts +29 -0
  18. package/dist/compiler/ast.d.ts +68 -0
  19. package/dist/compiler/createPipeline.d.ts +18 -0
  20. package/dist/compiler/defaultLabels.d.ts +28 -0
  21. package/dist/compiler/directiveValidation.d.ts +17 -0
  22. package/dist/compiler/highlighter.d.ts +3 -0
  23. package/dist/compiler/mdxModules.d.ts +19 -0
  24. package/dist/compiler/mdxPlugins.d.ts +16 -0
  25. package/dist/compiler/normalizeOptions.d.ts +16 -0
  26. package/dist/compiler/pluginPlan.d.ts +18 -0
  27. package/dist/compiler/plugins/code.d.ts +16 -0
  28. package/dist/compiler/plugins/directives.d.ts +24 -0
  29. package/dist/compiler/plugins/documentBlocks.d.ts +5 -0
  30. package/dist/compiler/plugins/tables.d.ts +5 -0
  31. package/dist/compiler/plugins.d.ts +24 -0
  32. package/dist/compiler/prepareMarkdown.d.ts +11 -0
  33. package/dist/compiler/sanitizeBoundary.d.ts +18 -0
  34. package/dist/compiler/stableJson.d.ts +2 -0
  35. package/dist/compiler/syntaxFeatures.d.ts +10 -0
  36. package/dist/compiler/types.d.ts +177 -0
  37. package/dist/components/blocks/MarkdownCodeBlock.d.ts +10 -0
  38. package/dist/components/blocks/MarkdownCopySnippet.d.ts +10 -0
  39. package/dist/components/blocks/MarkdownHeading.d.ts +13 -0
  40. package/dist/components/blocks/MarkdownImage.d.ts +16 -0
  41. package/dist/components/blocks/MarkdownTable.d.ts +12 -0
  42. package/dist/components/blocks/MarkdownTerminal.d.ts +9 -0
  43. package/dist/components/composite/MarkdownComposite.d.ts +37 -0
  44. package/dist/components/composite/MarkdownFileTree.d.ts +5 -0
  45. package/dist/components/composite/MarkdownTabs.d.ts +6 -0
  46. package/dist/components/gallery/ImageGallery.d.ts +25 -0
  47. package/dist/components/shared/MarkdownActions.d.ts +18 -0
  48. package/dist/components/shared/MarkdownDialog.d.ts +11 -0
  49. package/dist/components/shared/MarkdownFileIcon.d.ts +4 -0
  50. package/dist/components/shared/MarkdownIcon.d.ts +8 -0
  51. package/dist/components/shared/interactionConstants.d.ts +1 -0
  52. package/dist/components/shared/reactText.d.ts +14 -0
  53. package/dist/directiveValidation-BdIao7Yn.js +741 -0
  54. package/dist/file-icons/LICENSE +21 -0
  55. package/dist/file-icons/astro.svg +1 -0
  56. package/dist/file-icons/bun.svg +1 -0
  57. package/dist/file-icons/bun_light.svg +1 -0
  58. package/dist/file-icons/config.svg +1 -0
  59. package/dist/file-icons/console.svg +1 -0
  60. package/dist/file-icons/css.svg +1 -0
  61. package/dist/file-icons/database.svg +1 -0
  62. package/dist/file-icons/deno.svg +1 -0
  63. package/dist/file-icons/deno_light.svg +1 -0
  64. package/dist/file-icons/diff.svg +1 -0
  65. package/dist/file-icons/docker.svg +1 -0
  66. package/dist/file-icons/document.svg +1 -0
  67. package/dist/file-icons/download.svg +1 -0
  68. package/dist/file-icons/environment.svg +1 -0
  69. package/dist/file-icons/excel.svg +1 -0
  70. package/dist/file-icons/git.svg +1 -0
  71. package/dist/file-icons/github-actions.svg +1 -0
  72. package/dist/file-icons/go.svg +1 -0
  73. package/dist/file-icons/javascript.svg +1 -0
  74. package/dist/file-icons/json.svg +1 -0
  75. package/dist/file-icons/markdown.svg +1 -0
  76. package/dist/file-icons/nodejs.svg +1 -0
  77. package/dist/file-icons/npm.svg +1 -0
  78. package/dist/file-icons/pdf.svg +1 -0
  79. package/dist/file-icons/pnpm.svg +1 -0
  80. package/dist/file-icons/pnpm_light.svg +1 -0
  81. package/dist/file-icons/powerpoint.svg +1 -0
  82. package/dist/file-icons/python.svg +1 -0
  83. package/dist/file-icons/react.svg +1 -0
  84. package/dist/file-icons/rust.svg +1 -0
  85. package/dist/file-icons/sass.svg +1 -0
  86. package/dist/file-icons/settings.svg +1 -0
  87. package/dist/file-icons/svelte.svg +1 -0
  88. package/dist/file-icons/typescript.svg +1 -0
  89. package/dist/file-icons/vue.svg +1 -0
  90. package/dist/file-icons/word.svg +1 -0
  91. package/dist/file-icons/yaml.svg +1 -0
  92. package/dist/file-icons/yarn.svg +1 -0
  93. package/dist/index.d.ts +7 -0
  94. package/dist/index.js +6 -0
  95. package/dist/islands/gallery.d.ts +2 -0
  96. package/dist/islands/image.d.ts +2 -0
  97. package/dist/islands/options.d.ts +8 -0
  98. package/dist/islands/provider.d.ts +4 -0
  99. package/dist/islands/serialized.d.ts +4 -0
  100. package/dist/islands/table.d.ts +2 -0
  101. package/dist/islands.d.ts +13 -0
  102. package/dist/plugins-DQ-VUuCT.js +288 -0
  103. package/dist/prepareMarkdown-CHqN2JF5.js +852 -0
  104. package/dist/protocol/serializedNode.d.ts +3 -0
  105. package/dist/react/Markdown.d.ts +54 -0
  106. package/dist/react/componentMap.d.ts +172 -0
  107. package/dist/react/semanticOverrideProps.d.ts +4 -0
  108. package/dist/react/slots.d.ts +39 -0
  109. package/dist/react/urlTransform.d.ts +12 -0
  110. package/dist/server/analyze.d.ts +6 -0
  111. package/dist/server/analyze.js +132 -0
  112. package/dist/server/cache.d.ts +16 -0
  113. package/dist/server/createMarkdownRenderer.d.ts +39 -0
  114. package/dist/server.d.ts +5 -0
  115. package/dist/server.js +137 -0
  116. package/dist/shared/copyText.d.ts +2 -0
  117. package/dist/shared/fileKinds.d.ts +6 -0
  118. package/dist/theme.css +183 -0
  119. package/dist/theme.d.ts +167 -0
  120. package/dist/theme.js +228 -0
  121. package/package.json +110 -0
@@ -0,0 +1,2116 @@
1
+ import { jsx as d, jsxs as L, Fragment as U } from "react/jsx-runtime";
2
+ import { toJsxRuntime as ht } from "hast-util-to-jsx-runtime";
3
+ import { createContext as Ye, createElement as C, useContext as Qe, useState as B, useEffect as Z, isValidElement as F, Children as O, useMemo as de, useRef as _, cloneElement as R, useId as yt, version as vt, Fragment as wt } from "react";
4
+ import { ChevronRight as Ct, ChevronLeft as kt, X as Lt, Link2 as Dt, Workflow as Nt, FileText as St, Folder as xt, Table2 as It, ChevronsUpDown as Mt, RotateCcw as Tt, Plus as Ft, Minus as At, Maximize2 as zt, Code2 as $t, Download as Pt, Copy as Ot, Check as Rt, ChevronDown as Et, CheckCircle2 as jt, TriangleAlert as Bt, CircleAlert as _t, Info as Wt } from "lucide-react";
5
+ import { createPortal as Gt } from "react-dom";
6
+ import { e as Ut, f as Kt, s as Vt } from "./plugins-DQ-VUuCT.js";
7
+ const S = {
8
+ copyCode: "Copy code",
9
+ copyFailed: "Copy failed",
10
+ copySnippet: "Copy snippet",
11
+ copyTerminal: "Copy terminal output",
12
+ terminalTitle: "Terminal",
13
+ tabsTitle: "Tabs",
14
+ tabItem: "Tab {index}",
15
+ codeGroupTitle: "Code group",
16
+ codeGroupItem: "Code {index}",
17
+ taskCompleted: "Completed task",
18
+ taskIncomplete: "Incomplete task",
19
+ copySectionLink: "Copy section link",
20
+ tableTitle: "table",
21
+ copyTableCsv: "Copy table as CSV",
22
+ downloadTableCsv: "Download table as CSV",
23
+ zoomTable: "Zoom table",
24
+ closeTablePreview: "Close table preview",
25
+ sortTableColumn: "Sort table by column {column}",
26
+ zoomImage: "Zoom image",
27
+ closeImagePreview: "Close image preview",
28
+ imageGallery: "Image gallery",
29
+ closeImageGallery: "Close gallery",
30
+ previousGalleryImage: "Previous image",
31
+ nextGalleryImage: "Next image",
32
+ galleryThumbnails: "Gallery thumbnails",
33
+ galleryImage: "image"
34
+ };
35
+ async function et(e) {
36
+ if (typeof navigator < "u" && navigator.clipboard)
37
+ try {
38
+ return await navigator.clipboard.writeText(e), !0;
39
+ } catch {
40
+ }
41
+ if (typeof document > "u" || typeof document.execCommand != "function") return !1;
42
+ const t = document.createElement("textarea");
43
+ t.value = e, t.setAttribute("readonly", ""), t.style.position = "fixed", t.style.inset = "0 auto auto 0", t.style.opacity = "0", document.body.appendChild(t), t.select();
44
+ try {
45
+ return document.execCommand("copy");
46
+ } finally {
47
+ t.remove();
48
+ }
49
+ }
50
+ const Ht = {
51
+ copy: "CopyIcon",
52
+ download: "DownloadIcon",
53
+ code: "CodeIcon",
54
+ maximize: "MaximizeIcon",
55
+ minus: "MinusIcon",
56
+ plus: "PlusIcon",
57
+ reset: "ResetIcon",
58
+ sort: "SortIcon",
59
+ table: "TableIcon",
60
+ folder: "FolderIcon",
61
+ file: "FileIcon",
62
+ workflow: "WorkflowIcon",
63
+ link: "LinkIcon",
64
+ close: "CloseIcon",
65
+ previous: "PreviousIcon",
66
+ next: "NextIcon"
67
+ }, tt = Object.freeze({}), at = Ye(tt);
68
+ function Zt({ slots: e, children: t }) {
69
+ return C(at.Provider, { value: e ?? tt }, t);
70
+ }
71
+ function ot() {
72
+ return Qe(at);
73
+ }
74
+ function nt(e, t) {
75
+ const a = e?.[Ht[t]];
76
+ return a ? (o) => C(a, { ...o, name: t }) : void 0;
77
+ }
78
+ function rt(e) {
79
+ return e?.ImageCaption;
80
+ }
81
+ const qt = {
82
+ copy: Ot,
83
+ download: Pt,
84
+ code: $t,
85
+ maximize: zt,
86
+ minus: At,
87
+ plus: Ft,
88
+ reset: Tt,
89
+ sort: Mt,
90
+ table: It,
91
+ folder: xt,
92
+ file: St,
93
+ workflow: Nt,
94
+ link: Dt,
95
+ close: Lt,
96
+ previous: kt,
97
+ next: Ct
98
+ };
99
+ function E({
100
+ name: e,
101
+ size: t = 16,
102
+ className: a
103
+ }) {
104
+ const o = nt(ot(), e);
105
+ if (o) return /* @__PURE__ */ d(o, { size: t, className: a, "aria-hidden": "true" });
106
+ const n = qt[e];
107
+ return /* @__PURE__ */ d(n, { className: a, size: t, strokeWidth: 2, "aria-hidden": "true" });
108
+ }
109
+ const it = 1500;
110
+ function me({
111
+ value: e,
112
+ label: t,
113
+ action: a,
114
+ className: o = "df-block-button",
115
+ icon: n = "copy",
116
+ failureLabel: i = S.copyFailed
117
+ }) {
118
+ const [r, l] = B("idle");
119
+ Z(() => {
120
+ if (r === "idle") return;
121
+ const f = setTimeout(() => l("idle"), it);
122
+ return () => clearTimeout(f);
123
+ }, [r]);
124
+ const s = r === "success" ? `${t} ✓` : r === "error" ? i : t;
125
+ return /* @__PURE__ */ L(
126
+ "button",
127
+ {
128
+ className: `${o}${r === "success" ? " df-action-success" : ""}${r === "error" ? " df-action-error" : ""}`,
129
+ type: "button",
130
+ "data-df-action": a,
131
+ "data-df-copied": r === "success" ? "true" : void 0,
132
+ "data-df-copy-error": r === "error" ? "true" : void 0,
133
+ "aria-label": s,
134
+ title: s,
135
+ onClick: async () => {
136
+ try {
137
+ l(await et(e) ? "success" : "error");
138
+ } catch {
139
+ l("error");
140
+ }
141
+ },
142
+ children: [
143
+ /* @__PURE__ */ d("span", { className: "df-action-icon df-action-icon-copy", "aria-hidden": "true", children: /* @__PURE__ */ d(E, { name: n }) }),
144
+ /* @__PURE__ */ d("span", { className: "df-action-icon df-action-icon-success", "aria-hidden": "true", children: /* @__PURE__ */ d(Rt, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) }),
145
+ /* @__PURE__ */ d("span", { className: "df-sr-only", "aria-live": "polite", "aria-atomic": "true", children: r === "idle" ? "" : s })
146
+ ]
147
+ }
148
+ );
149
+ }
150
+ function Jt({
151
+ value: e,
152
+ filename: t,
153
+ label: a,
154
+ action: o,
155
+ className: n = "df-block-button",
156
+ contentType: i = "text/plain;charset=utf-8"
157
+ }) {
158
+ const [r, l] = B();
159
+ return Z(() => {
160
+ if (typeof URL > "u" || typeof URL.createObjectURL != "function") return;
161
+ const s = URL.createObjectURL(new Blob([e], { type: i }));
162
+ return l(s), () => URL.revokeObjectURL(s);
163
+ }, [i, e]), /* @__PURE__ */ d(
164
+ "a",
165
+ {
166
+ className: n,
167
+ href: r ?? "#",
168
+ download: t,
169
+ "data-df-action": o,
170
+ "aria-disabled": r ? void 0 : "true",
171
+ "aria-label": a,
172
+ title: a,
173
+ tabIndex: r ? void 0 : -1,
174
+ onClick: (s) => {
175
+ r || s.preventDefault();
176
+ },
177
+ children: /* @__PURE__ */ d(E, { name: "download" })
178
+ }
179
+ );
180
+ }
181
+ function Xt({ filename: e, language: t }) {
182
+ const a = Ut(e, t), o = Kt(e, t);
183
+ return /* @__PURE__ */ d(
184
+ "span",
185
+ {
186
+ className: "df-code-file-icon",
187
+ "data-df-file-icon": o,
188
+ "data-df-file-kind": a,
189
+ "aria-hidden": "true"
190
+ }
191
+ );
192
+ }
193
+ function j(e) {
194
+ return typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(j).join("") : F(e) ? j(e.props.children) : !e || typeof e != "object" ? "" : e.type === "text" ? String(e.value ?? "") : j(e.children);
195
+ }
196
+ function Q(e) {
197
+ return O.toArray(e).filter((t) => F(t));
198
+ }
199
+ function W(e) {
200
+ if (typeof e.type == "string") return e.type;
201
+ const a = e.type.displayName;
202
+ return a?.startsWith("Markdown") ? a.slice(8).toLowerCase() : "";
203
+ }
204
+ function fe(e, ...t) {
205
+ const a = e;
206
+ for (const o of t)
207
+ if (a[o] !== void 0 && a[o] !== null) return a[o];
208
+ }
209
+ function p(e, ...t) {
210
+ const a = fe(e, ...t);
211
+ return typeof a == "string" ? a : "";
212
+ }
213
+ const Yt = /* @__PURE__ */ new Set([
214
+ "id",
215
+ "className",
216
+ "style",
217
+ "title",
218
+ "role",
219
+ "tabIndex",
220
+ "hidden",
221
+ "dir",
222
+ "lang",
223
+ "slot",
224
+ "draggable",
225
+ "contentEditable",
226
+ "spellCheck",
227
+ "open",
228
+ "href",
229
+ "target",
230
+ "rel",
231
+ "download",
232
+ "src",
233
+ "alt",
234
+ "width",
235
+ "height",
236
+ "loading",
237
+ "srcSet",
238
+ "sizes",
239
+ "type",
240
+ "name",
241
+ "value",
242
+ "checked",
243
+ "disabled",
244
+ "controls",
245
+ "loop",
246
+ "muted",
247
+ "autoPlay",
248
+ "poster",
249
+ "preload",
250
+ "colSpan",
251
+ "rowSpan",
252
+ "scope",
253
+ "dateTime"
254
+ ]);
255
+ function J(e, t = []) {
256
+ const a = /* @__PURE__ */ new Set(["node", ...t]);
257
+ return Object.fromEntries(
258
+ Object.entries(e).filter(
259
+ ([o]) => !a.has(o) && !o.startsWith("dataDf") && !o.startsWith("data-df-") && (Yt.has(o) || o.startsWith("aria-") || o.startsWith("data-") && !o.startsWith("data-df-") || /^on[A-Z]/.test(o))
260
+ )
261
+ );
262
+ }
263
+ function V(e, t) {
264
+ const a = typeof t == "string" ? t.split(/\s+/) : [];
265
+ return [...new Set([...e.split(/\s+/), ...a].filter(Boolean))].join(" ");
266
+ }
267
+ function Qt(e) {
268
+ const t = Q(e).find((a) => W(a) === "pre");
269
+ return j(t ? t.props.children : e);
270
+ }
271
+ function ve({
272
+ children: e,
273
+ source: t,
274
+ language: a,
275
+ filename: o,
276
+ copyLabel: n,
277
+ copyFailureLabel: i,
278
+ ...r
279
+ }) {
280
+ const l = r, s = t ?? (p(l, "data-df-source", "dataDfSource") || Qt(e)), f = a ?? (p(l, "data-df-language", "dataDfLanguage") || "text"), b = o ?? (p(l, "data-df-filename", "dataDfFilename") || void 0), c = n ?? (p(l, "data-df-copy-label", "dataDfCopyLabel") || S.copyCode), y = i ?? (p(l, "data-df-copy-failure-label", "dataDfCopyFailureLabel") || S.copyFailed), m = V("df-code", l.className), { className: v, ...w } = J(l);
281
+ return /* @__PURE__ */ L("figure", { ...w, className: m, "data-df-component": "code-block", "data-df-slot": "root", children: [
282
+ /* @__PURE__ */ d(
283
+ ea,
284
+ {
285
+ source: s,
286
+ language: f,
287
+ filename: b,
288
+ copyLabel: c,
289
+ copyFailureLabel: y
290
+ }
291
+ ),
292
+ e
293
+ ] });
294
+ }
295
+ function ea({
296
+ source: e,
297
+ language: t,
298
+ filename: a,
299
+ copyLabel: o = S.copyCode,
300
+ copyFailureLabel: n = S.copyFailed
301
+ }) {
302
+ return /* @__PURE__ */ d(
303
+ "div",
304
+ {
305
+ className: "df-code-bar",
306
+ "data-df-slot": "toolbar",
307
+ "data-df-behavior": "code-toolbar",
308
+ "data-df-language": t,
309
+ "data-df-filename": a,
310
+ "data-df-copy-label": o,
311
+ "data-df-copy-failure-label": n,
312
+ children: /* @__PURE__ */ L(U, { children: [
313
+ a ? /* @__PURE__ */ L("span", { className: "df-code-file", "data-df-slot": "title", "data-df-language": t, children: [
314
+ /* @__PURE__ */ d(Xt, { filename: a, language: t }),
315
+ /* @__PURE__ */ d("span", { className: "df-code-file-name", children: a })
316
+ ] }) : /* @__PURE__ */ d("span", { className: "df-code-lang", "data-df-slot": "title", children: t }),
317
+ /* @__PURE__ */ d("div", { className: "df-block-actions", "data-df-slot": "actions", children: /* @__PURE__ */ d(
318
+ me,
319
+ {
320
+ value: e,
321
+ label: o,
322
+ failureLabel: n,
323
+ action: "copy-code"
324
+ }
325
+ ) })
326
+ ] })
327
+ }
328
+ );
329
+ }
330
+ function we({
331
+ children: e,
332
+ value: t,
333
+ copyLabel: a,
334
+ copyFailureLabel: o,
335
+ className: n,
336
+ inner: i = !1,
337
+ ...r
338
+ }) {
339
+ const l = t ?? (p(r, "data-df-value", "dataDfValue") || j(e)), s = a || p(r, "data-df-copy-label", "dataDfCopyLabel") || S.copySnippet, f = o || p(r, "data-df-copy-failure-label", "dataDfCopyFailureLabel") || S.copyFailed, b = V("df-copy-snippet", n), { className: c, ...y } = J(r), m = /* @__PURE__ */ L(U, { children: [
340
+ /* @__PURE__ */ d("code", { "data-df-slot": "content", children: e ?? l }),
341
+ /* @__PURE__ */ d(
342
+ me,
343
+ {
344
+ value: l,
345
+ label: s,
346
+ action: "copy-snippet",
347
+ className: "df-copy-snippet-button",
348
+ failureLabel: f
349
+ }
350
+ )
351
+ ] });
352
+ return i ? m : /* @__PURE__ */ d(
353
+ "span",
354
+ {
355
+ ...y,
356
+ className: b,
357
+ "data-df-component": "copy-snippet",
358
+ "data-df-slot": "root",
359
+ "data-df-behavior": "copy-snippet",
360
+ "data-df-value": l,
361
+ "data-df-copy-label": s,
362
+ "data-df-copy-failure-label": f,
363
+ children: m
364
+ }
365
+ );
366
+ }
367
+ function Ce(e) {
368
+ return e.type === "root" ? ["r", e.children.map(Ce)] : e.type === "element" ? ["e", e.tagName, e.properties, e.children.map(Ce)] : e.type === "comment" ? ["c", e.value] : ["t", "value" in e ? String(e.value) : ""];
369
+ }
370
+ function ta(e) {
371
+ try {
372
+ return !e || typeof e != "object" || typeof e.type != "string" ? void 0 : JSON.stringify(Ce(e));
373
+ } catch {
374
+ return;
375
+ }
376
+ }
377
+ const aa = [
378
+ "a[href]",
379
+ "button:not([disabled])",
380
+ "input:not([disabled])",
381
+ "select:not([disabled])",
382
+ "textarea:not([disabled])",
383
+ '[tabindex]:not([tabindex="-1"])'
384
+ ].join(",");
385
+ function Ee({ children: e }) {
386
+ return typeof document > "u" ? null : Gt(e, document.body);
387
+ }
388
+ function je({
389
+ open: e,
390
+ close: t,
391
+ dialogRef: a,
392
+ initialFocusRef: o,
393
+ triggerRef: n
394
+ }) {
395
+ return Z(() => {
396
+ if (!e) return;
397
+ const i = document.body.style.overflow;
398
+ return document.body.style.overflow = "hidden", o.current?.focus(), () => {
399
+ document.body.style.overflow = i, n.current?.focus();
400
+ };
401
+ }, [o, e, n]), (i) => {
402
+ if (i.key === "Escape") {
403
+ i.preventDefault(), t();
404
+ return;
405
+ }
406
+ if (i.key !== "Tab") return;
407
+ const r = Array.from(
408
+ a.current?.querySelectorAll(aa) ?? []
409
+ ).filter(
410
+ (f) => !f.hidden && !f.closest("[hidden], [inert]") && f.getAttribute("aria-hidden") !== "true"
411
+ );
412
+ if (!r.length) {
413
+ i.preventDefault(), a.current?.focus();
414
+ return;
415
+ }
416
+ const l = r[0], s = r.at(-1);
417
+ !l || !s || (i.shiftKey && document.activeElement === l ? (i.preventDefault(), s.focus()) : !i.shiftKey && document.activeElement === s && (i.preventDefault(), l.focus()));
418
+ };
419
+ }
420
+ const lt = Ye(void 0), oa = /^(?:https?|ircs?|mailto|tel|xmpp)$/i;
421
+ function na(e) {
422
+ const t = e.indexOf(":"), a = e.indexOf("/"), o = e.indexOf("?"), n = e.indexOf("#");
423
+ if (t === -1 || a !== -1 && t > a || o !== -1 && t > o || n !== -1 && t > n)
424
+ return e;
425
+ const i = e.slice(0, t).replace(/[\u0000-\u0020]/g, "");
426
+ return oa.test(i) ? e : void 0;
427
+ }
428
+ function Be(e, t, a) {
429
+ return na(a ? a(e, t) : e);
430
+ }
431
+ function ra({
432
+ transform: e,
433
+ children: t
434
+ }) {
435
+ const a = de(
436
+ () => (o, n) => Be(o, n, e) ?? "",
437
+ [e]
438
+ );
439
+ return C(lt.Provider, { value: a, children: t });
440
+ }
441
+ function dt() {
442
+ return Qe(lt);
443
+ }
444
+ function ia(e) {
445
+ const t = [];
446
+ let a = 0;
447
+ for (; a < e.length; ) {
448
+ for (; a < e.length && /[\t\n\f\r ,]/.test(e[a] ?? ""); ) a += 1;
449
+ if (a >= e.length) break;
450
+ const o = a;
451
+ for (; a < e.length && !/[\t\n\f\r ]/.test(e[a] ?? ""); ) a += 1;
452
+ let n = e.slice(o, a), i = 0;
453
+ for (; n.endsWith(","); )
454
+ n = n.slice(0, -1), i += 1;
455
+ if (i > 0) {
456
+ t.push({ url: n, descriptor: "" });
457
+ continue;
458
+ }
459
+ for (; a < e.length && /[\t\n\f\r ]/.test(e[a] ?? ""); ) a += 1;
460
+ const r = a;
461
+ for (; a < e.length && e[a] !== ","; ) a += 1;
462
+ const l = e.slice(r, a).trim();
463
+ e[a] === "," && (a += 1), t.push({ url: n, descriptor: l });
464
+ }
465
+ return t;
466
+ }
467
+ function _e(e, t) {
468
+ return ia(e).flatMap(({ url: a, descriptor: o }) => {
469
+ const n = Be(a, "srcSet", t);
470
+ return n ? [`${n}${o ? ` ${o}` : ""}`] : [];
471
+ }).join(", ");
472
+ }
473
+ function ke(e, t) {
474
+ let a = e;
475
+ const o = () => (a === e && (a = { ...e }), a);
476
+ for (const n of ["href", "src", "poster"]) {
477
+ const i = e[n];
478
+ if (typeof i != "string") continue;
479
+ const r = Be(i, n, t);
480
+ r === void 0 ? delete o()[n] : r !== i && (o()[n] = r);
481
+ }
482
+ for (const n of ["srcSet", "srcset"]) {
483
+ const i = e[n];
484
+ if (typeof i != "string") continue;
485
+ const r = _e(i, t);
486
+ r ? r !== i && (o()[n] = r) : delete o()[n];
487
+ }
488
+ return a;
489
+ }
490
+ function Le({
491
+ children: e,
492
+ node: t,
493
+ src: a,
494
+ alt: o,
495
+ caption: n,
496
+ title: i,
497
+ width: r,
498
+ height: l,
499
+ loading: s,
500
+ srcSet: f,
501
+ sizes: b,
502
+ zoomLabel: c,
503
+ closeLabel: y,
504
+ inner: m = !1,
505
+ ...v
506
+ }) {
507
+ const w = v, x = dt(), g = a && x ? x(a, "src") : a, M = f && x ? _e(f, x) : f, h = rt(ot()), k = O.toArray(e).find(
508
+ (X) => F(X) && W(X) === "img"
509
+ ), A = O.toArray(e).find((X) => {
510
+ if (!F(X)) return !1;
511
+ const oe = X;
512
+ return W(oe) === "figcaption" || oe.props["data-df-slot"] === "caption";
513
+ }), T = c || p(w, "data-df-zoom-label", "dataDfZoomLabel") || S.zoomImage, z = y || p(w, "data-df-close-label", "dataDfCloseLabel") || S.closeImagePreview, [I, G] = B(!1), $ = _(null), u = _(null), N = _(null), K = () => G(!1), te = je({
514
+ open: I,
515
+ close: K,
516
+ dialogRef: N,
517
+ initialFocusRef: u,
518
+ triggerRef: $
519
+ }), re = k ?? (g ? /* @__PURE__ */ d(
520
+ "img",
521
+ {
522
+ src: g,
523
+ alt: o ?? "",
524
+ title: i,
525
+ width: r,
526
+ height: l,
527
+ loading: s,
528
+ srcSet: M,
529
+ sizes: b,
530
+ "data-df-element": "image"
531
+ }
532
+ ) : null), Y = A ?? (n ? /* @__PURE__ */ d("figcaption", { "data-df-slot": "caption", children: n }) : null), ae = V("df-media-frame", w.className), { className: ce, ...se } = J(w);
533
+ if (!re)
534
+ return m ? /* @__PURE__ */ d(U, { children: e }) : /* @__PURE__ */ d("figure", { ...se, className: ae, "data-df-component": "image", "data-df-slot": "root", children: e });
535
+ const he = /* @__PURE__ */ L(U, { children: [
536
+ /* @__PURE__ */ d(
537
+ "button",
538
+ {
539
+ ref: $,
540
+ className: "df-media-zoom",
541
+ type: "button",
542
+ "data-df-action": "zoom-image",
543
+ "data-df-slot": "action",
544
+ "aria-label": T,
545
+ "aria-haspopup": "dialog",
546
+ title: T,
547
+ onClick: () => G(!0),
548
+ children: re
549
+ }
550
+ ),
551
+ Y ? h ? /* @__PURE__ */ d(h, { ...Y.props, "data-df-slot": "caption", children: Y.props.children }) : /* @__PURE__ */ d("figcaption", { "data-df-slot": "caption", children: Y.props.children }) : null,
552
+ I ? /* @__PURE__ */ d(Ee, { children: /* @__PURE__ */ L(
553
+ "div",
554
+ {
555
+ ref: N,
556
+ className: "df-image-lightbox",
557
+ "data-df-slot": "lightbox",
558
+ role: "dialog",
559
+ "aria-modal": "true",
560
+ "aria-label": T,
561
+ tabIndex: -1,
562
+ onKeyDown: te,
563
+ children: [
564
+ /* @__PURE__ */ d(
565
+ "div",
566
+ {
567
+ className: "df-image-lightbox-backdrop",
568
+ "data-df-action": "close-image",
569
+ "aria-hidden": "true",
570
+ onClick: K
571
+ }
572
+ ),
573
+ /* @__PURE__ */ L("div", { className: "df-image-lightbox-card", children: [
574
+ /* @__PURE__ */ d(
575
+ "button",
576
+ {
577
+ ref: u,
578
+ className: "df-icon-button df-image-lightbox-close",
579
+ type: "button",
580
+ "data-df-action": "close-image",
581
+ "data-df-slot": "close",
582
+ "aria-label": z,
583
+ onClick: K,
584
+ children: /* @__PURE__ */ d(E, { name: "close" })
585
+ }
586
+ ),
587
+ R(re, { loading: "eager" }),
588
+ Y ? /* @__PURE__ */ d("p", { children: j(Y.props.children) }) : null
589
+ ] })
590
+ ]
591
+ }
592
+ ) }) : null
593
+ ] });
594
+ return m ? he : /* @__PURE__ */ d(
595
+ "figure",
596
+ {
597
+ ...se,
598
+ className: ae,
599
+ "data-df-component": "image",
600
+ "data-df-slot": "root",
601
+ "data-df-island": "image",
602
+ "data-df-zoom-label": T,
603
+ "data-df-close-label": z,
604
+ "data-df-island-data": ta(t),
605
+ children: he
606
+ }
607
+ );
608
+ }
609
+ function la(e) {
610
+ return Q(e).find((t) => W(t) === "table");
611
+ }
612
+ function De(e) {
613
+ return e ? Q(e.props.children).filter((t) => W(t) === "tr") : [];
614
+ }
615
+ function ue(e) {
616
+ return Q(e.props.children).filter(
617
+ (t) => W(t) === "th" || W(t) === "td"
618
+ );
619
+ }
620
+ function Ve(e, t) {
621
+ return Q(e.props.children).find(
622
+ (a) => W(a) === t
623
+ );
624
+ }
625
+ function da(e) {
626
+ return /[",\n]/.test(e) ? `"${e.replace(/"/g, '""')}"` : e;
627
+ }
628
+ function ca(e) {
629
+ return e ? Q(e.props.children).filter(
630
+ (a) => W(a) === "thead" || W(a) === "tbody"
631
+ ).flatMap(
632
+ (a) => De(a).map(
633
+ (o) => ue(o).map((n) => da(j(n.props.children))).join(",")
634
+ )
635
+ ).join(`
636
+ `) : "";
637
+ }
638
+ function sa(e, t, a, o) {
639
+ if (!e) return null;
640
+ const n = Ve(e, "thead"), i = Ve(e, "tbody"), r = De(n), l = r[0] ? ue(r[0]).map((b, c) => {
641
+ const y = t?.column === c, m = y ? t.direction : void 0;
642
+ return R(b, {
643
+ "aria-sort": y ? m === "asc" ? "ascending" : "descending" : void 0,
644
+ children: /* @__PURE__ */ L(
645
+ "button",
646
+ {
647
+ className: "df-sort-button",
648
+ type: "button",
649
+ "data-df-action": "sort-table",
650
+ "data-column": String(c),
651
+ "data-sort": m,
652
+ "aria-pressed": y ? "true" : "false",
653
+ "aria-label": a.replace("{column}", String(c + 1)),
654
+ title: a.replace("{column}", String(c + 1)),
655
+ onClick: () => o?.(c),
656
+ children: [
657
+ /* @__PURE__ */ d("span", { className: "df-sort-label", children: b.props.children }),
658
+ /* @__PURE__ */ d("span", { className: "df-sort-icon", "aria-hidden": "true", children: /* @__PURE__ */ d(E, { name: "sort", direction: m }) })
659
+ ]
660
+ }
661
+ )
662
+ });
663
+ }) : [], s = i ? De(i).slice().sort((b, c) => {
664
+ if (!t) return 0;
665
+ const y = j(ue(b)[t.column]?.props.children), m = j(ue(c)[t.column]?.props.children), v = y.localeCompare(m, void 0, { numeric: !0, sensitivity: "base" });
666
+ return t.direction === "asc" ? v : -v;
667
+ }) : [], f = Q(e.props.children).map((b) => W(b) === "thead" && r[0] ? R(b, {
668
+ children: r.map(
669
+ (c, y) => y === 0 ? R(c, { children: l }) : c
670
+ )
671
+ }) : W(b) === "tbody" && i && t ? R(b, { children: s }) : b);
672
+ return R(e, { children: f });
673
+ }
674
+ function Ne({
675
+ children: e,
676
+ tableTitle: t,
677
+ copyLabel: a,
678
+ copyFailureLabel: o,
679
+ downloadLabel: n,
680
+ zoomLabel: i,
681
+ closeLabel: r,
682
+ sortLabel: l,
683
+ serializedTable: s,
684
+ inner: f = !1,
685
+ ...b
686
+ }) {
687
+ const c = b, y = la(e), m = de(() => ca(y), [y]), [v, w] = B(null), [x, g] = B(!1), M = _(null), h = _(null), k = _(null), A = t || p(c, "data-df-table-title", "dataDfTableTitle") || S.tableTitle, T = a || p(c, "data-df-copy-label", "dataDfCopyLabel") || S.copyTableCsv, z = o || p(c, "data-df-copy-failure-label", "dataDfCopyFailureLabel") || S.copyFailed, I = n || p(c, "data-df-download-label", "dataDfDownloadLabel") || S.downloadTableCsv, G = i || p(c, "data-df-zoom-label", "dataDfZoomLabel") || S.zoomTable, $ = r || p(c, "data-df-close-label", "dataDfCloseLabel") || S.closeTablePreview, u = l || p(c, "data-df-sort-label", "dataDfSortLabel") || S.sortTableColumn, N = s ?? p(c, "data-df-table", "dataDfTable"), K = V("df-table-window", c.className), { className: te, ...re } = J(c), ae = sa(y, v, u, (oe) => w(
688
+ (Ke) => Ke?.column === oe ? Ke.direction === "asc" ? { column: oe, direction: "desc" } : null : { column: oe, direction: "asc" }
689
+ )), ce = () => g(!1), se = je({
690
+ open: x,
691
+ close: ce,
692
+ dialogRef: k,
693
+ initialFocusRef: k,
694
+ triggerRef: M
695
+ }), X = /* @__PURE__ */ L(U, { children: [
696
+ /* @__PURE__ */ L("div", { className: "df-block-toolbar", "data-df-slot": "toolbar", children: [
697
+ /* @__PURE__ */ L("span", { className: "df-block-title", "data-df-slot": "title", children: [
698
+ /* @__PURE__ */ d(E, { name: "table" }),
699
+ /* @__PURE__ */ d("span", { children: A })
700
+ ] }),
701
+ /* @__PURE__ */ L("div", { className: "df-block-actions", "data-df-slot": "actions", children: [
702
+ /* @__PURE__ */ d(
703
+ me,
704
+ {
705
+ value: m,
706
+ label: T,
707
+ failureLabel: z,
708
+ action: "copy-table"
709
+ }
710
+ ),
711
+ /* @__PURE__ */ d(
712
+ Jt,
713
+ {
714
+ value: m,
715
+ filename: "table.csv",
716
+ label: I,
717
+ action: "download-table",
718
+ contentType: "text/csv;charset=utf-8"
719
+ }
720
+ ),
721
+ /* @__PURE__ */ d(
722
+ "button",
723
+ {
724
+ ref: M,
725
+ className: "df-block-button",
726
+ type: "button",
727
+ "data-df-action": "zoom-table",
728
+ "aria-label": G,
729
+ title: G,
730
+ "aria-haspopup": "dialog",
731
+ onClick: () => g(!0),
732
+ children: /* @__PURE__ */ d(E, { name: "maximize" })
733
+ }
734
+ )
735
+ ] })
736
+ ] }),
737
+ /* @__PURE__ */ d("div", { className: "df-data-table", "data-df-slot": "content", children: ae ?? e }),
738
+ x && ae ? /* @__PURE__ */ d(Ee, { children: /* @__PURE__ */ L(
739
+ "div",
740
+ {
741
+ ref: k,
742
+ className: "df-table-preview",
743
+ "data-df-slot": "preview",
744
+ role: "dialog",
745
+ "aria-modal": "true",
746
+ "aria-label": A,
747
+ tabIndex: -1,
748
+ onKeyDown: se,
749
+ children: [
750
+ /* @__PURE__ */ d(
751
+ "div",
752
+ {
753
+ className: "df-table-preview-backdrop",
754
+ "data-df-action": "close-table",
755
+ "aria-hidden": "true",
756
+ onClick: ce
757
+ }
758
+ ),
759
+ /* @__PURE__ */ L("div", { className: "df-table-preview-card", children: [
760
+ /* @__PURE__ */ L("div", { className: "df-table-preview-head", children: [
761
+ /* @__PURE__ */ d("strong", { children: A }),
762
+ /* @__PURE__ */ d(
763
+ "button",
764
+ {
765
+ ref: h,
766
+ className: "df-icon-button",
767
+ type: "button",
768
+ "data-df-action": "close-table",
769
+ "data-df-slot": "close",
770
+ "aria-label": $,
771
+ onClick: ce,
772
+ children: /* @__PURE__ */ d(E, { name: "close" })
773
+ }
774
+ )
775
+ ] }),
776
+ /* @__PURE__ */ d("div", { className: "df-table-preview-body", children: /* @__PURE__ */ d("div", { className: "df-table-window", children: /* @__PURE__ */ d("div", { className: "df-data-table", children: ae }) }) })
777
+ ] })
778
+ ]
779
+ }
780
+ ) }) : null
781
+ ] });
782
+ return f ? X : /* @__PURE__ */ d(
783
+ "figure",
784
+ {
785
+ ...re,
786
+ className: K,
787
+ "data-df-component": "table",
788
+ "data-df-slot": "root",
789
+ "data-df-island": "table",
790
+ "data-df-table-title": A,
791
+ "data-df-copy-label": T,
792
+ "data-df-copy-failure-label": z,
793
+ "data-df-download-label": I,
794
+ "data-df-zoom-label": G,
795
+ "data-df-close-label": $,
796
+ "data-df-sort-label": u,
797
+ "data-df-table": N || void 0,
798
+ children: X
799
+ }
800
+ );
801
+ }
802
+ function fa(e) {
803
+ return e.replace(/\r\n?/g, `
804
+ `).split(`
805
+ `).map((t, a, o) => {
806
+ const n = t.match(/^(\s*)([$>])(\s*)/), i = n ? null : t.match(/^(\s*)([✓✔✕✖!→•])(\s*)/), r = n ? /* @__PURE__ */ L(U, { children: [
807
+ /* @__PURE__ */ d("span", { className: "df-terminal-prompt", children: `${n[1]}${n[2]}` }),
808
+ n[3] || " ",
809
+ t.slice(n[0].length)
810
+ ] }) : i ? /* @__PURE__ */ L(U, { children: [
811
+ /* @__PURE__ */ d("span", { className: "df-terminal-status", children: `${i[1]}${i[2]}` }),
812
+ i[3] || " ",
813
+ t.slice(i[0].length)
814
+ ] }) : /* @__PURE__ */ d("span", { className: "df-terminal-output", children: t });
815
+ return /* @__PURE__ */ L("span", { children: [
816
+ r,
817
+ a < o.length - 1 ? `
818
+ ` : null
819
+ ] }, `${a}-${t}`);
820
+ });
821
+ }
822
+ function pe({
823
+ children: e,
824
+ node: t,
825
+ title: a,
826
+ source: o,
827
+ copyLabel: n,
828
+ copyFailureLabel: i,
829
+ ...r
830
+ }) {
831
+ const l = r, s = a || p(l, "data-df-title", "dataDfTitle") || S.terminalTitle, f = o ?? p(l, "data-df-source", "dataDfSource"), b = n || p(l, "data-df-copy-label", "dataDfCopyLabel") || S.copyTerminal, c = i || p(l, "data-df-copy-failure-label", "dataDfCopyFailureLabel") || S.copyFailed, y = V("df-terminal", l.className), { className: m, ...v } = J(l);
832
+ return /* @__PURE__ */ L("div", { ...v, className: y, "data-df-component": "terminal", "data-df-slot": "root", children: [
833
+ /* @__PURE__ */ d(
834
+ ua,
835
+ {
836
+ title: s,
837
+ source: f,
838
+ copyLabel: b,
839
+ copyFailureLabel: c
840
+ }
841
+ ),
842
+ /* @__PURE__ */ d("pre", { "data-df-slot": "content", children: fa(f) })
843
+ ] });
844
+ }
845
+ function ua({
846
+ title: e,
847
+ source: t,
848
+ copyLabel: a = S.copyTerminal,
849
+ copyFailureLabel: o = S.copyFailed,
850
+ inner: n = !1
851
+ }) {
852
+ const i = /* @__PURE__ */ L(U, { children: [
853
+ /* @__PURE__ */ d("span", { children: e }),
854
+ /* @__PURE__ */ d(
855
+ me,
856
+ {
857
+ value: t,
858
+ label: a,
859
+ action: "copy-terminal",
860
+ className: "df-copy-snippet-button",
861
+ failureLabel: o
862
+ }
863
+ )
864
+ ] });
865
+ return n ? i : /* @__PURE__ */ d(
866
+ "div",
867
+ {
868
+ className: "df-terminal-head",
869
+ "data-df-slot": "toolbar",
870
+ "data-df-behavior": "terminal-toolbar",
871
+ "data-df-title": e,
872
+ "data-df-copy-label": a,
873
+ "data-df-copy-failure-label": o,
874
+ children: i
875
+ }
876
+ );
877
+ }
878
+ function Se(e, t) {
879
+ return O.toArray(e).find((a) => F(a) ? a.type === t : !1);
880
+ }
881
+ function pa(e) {
882
+ return O.toArray(e).flatMap((t) => {
883
+ if (!F(t) || t.type !== "figure") return [];
884
+ const a = t.props, o = Se(a.children, "img");
885
+ if (!o || typeof o.props.src != "string") return [];
886
+ const n = Se(a.children, "figcaption");
887
+ return [
888
+ {
889
+ src: o.props.src,
890
+ alt: typeof o.props.alt == "string" ? o.props.alt : "",
891
+ caption: n ? j(n.props.children) : void 0,
892
+ title: typeof o.props.title == "string" ? o.props.title : void 0,
893
+ srcSet: typeof o.props.srcSet == "string" ? o.props.srcSet : void 0,
894
+ sizes: typeof o.props.sizes == "string" ? o.props.sizes : void 0,
895
+ width: typeof o.props.width == "number" || typeof o.props.width == "string" ? o.props.width : void 0,
896
+ height: typeof o.props.height == "number" || typeof o.props.height == "string" ? o.props.height : void 0
897
+ }
898
+ ];
899
+ });
900
+ }
901
+ function ba(e) {
902
+ return O.toArray(e).filter((t) => {
903
+ if (!F(t)) return !0;
904
+ const a = t.props;
905
+ if (t.type === "figure") {
906
+ const o = Se(a.children, "img");
907
+ return !o || typeof o.props.src != "string";
908
+ }
909
+ return We({ children: [a.node] }).length === 0;
910
+ });
911
+ }
912
+ function We(e) {
913
+ return !e || typeof e != "object" ? [] : (Array.isArray(e.children) ? e.children : []).flatMap((a) => {
914
+ if (!a || typeof a != "object" || a.tagName !== "figure")
915
+ return [];
916
+ const o = Array.isArray(a.children) ? a.children : [], n = o.find(
917
+ (r) => r && typeof r == "object" && r.tagName === "img"
918
+ );
919
+ if (!n?.properties || typeof n.properties.src != "string") return [];
920
+ const i = o.find(
921
+ (r) => r && typeof r == "object" && r.tagName === "figcaption"
922
+ );
923
+ return [
924
+ {
925
+ src: n.properties.src,
926
+ alt: typeof n.properties.alt == "string" ? n.properties.alt : "",
927
+ caption: i ? j(i) : void 0,
928
+ title: typeof n.properties.title == "string" ? n.properties.title : void 0,
929
+ srcSet: typeof n.properties.srcSet == "string" ? n.properties.srcSet : void 0,
930
+ sizes: typeof n.properties.sizes == "string" ? n.properties.sizes : void 0,
931
+ width: typeof n.properties.width == "number" || typeof n.properties.width == "string" ? n.properties.width : void 0,
932
+ height: typeof n.properties.height == "number" || typeof n.properties.height == "string" ? n.properties.height : void 0
933
+ }
934
+ ];
935
+ });
936
+ }
937
+ function ct(e, t, a) {
938
+ if (e?.length) return e;
939
+ const o = We(t);
940
+ return o.length ? o : pa(a);
941
+ }
942
+ function ma(e, t) {
943
+ return {
944
+ gallery: e?.gallery ?? (p(t, "data-df-gallery-label", "dataDfGalleryLabel") || S.imageGallery),
945
+ close: e?.close ?? (p(t, "data-df-close-label", "dataDfCloseLabel") || S.closeImageGallery),
946
+ previous: e?.previous ?? (p(t, "data-df-previous-label", "dataDfPreviousLabel") || S.previousGalleryImage),
947
+ next: e?.next ?? (p(t, "data-df-next-label", "dataDfNextLabel") || S.nextGalleryImage),
948
+ thumbnails: e?.thumbnails ?? (p(t, "data-df-thumbnails-label", "dataDfThumbnailsLabel") || S.galleryThumbnails),
949
+ image: e?.image ?? (p(t, "data-df-image-label", "dataDfImageLabel") || S.galleryImage)
950
+ };
951
+ }
952
+ function xe({
953
+ children: e,
954
+ items: t,
955
+ className: a,
956
+ role: o = "group",
957
+ labels: n,
958
+ node: i,
959
+ inner: r = !1,
960
+ ...l
961
+ }) {
962
+ const s = l, f = dt(), b = We(i), c = ct(t, i, e).map((u) => ({
963
+ ...u,
964
+ src: f ? f(u.src, "src") : u.src,
965
+ srcSet: u.srcSet && f ? _e(u.srcSet, f) : u.srcSet
966
+ })), y = JSON.stringify(c), m = c.length && b.length === 0 ? ba(e) : [], [v, w] = B(null), x = v === null ? void 0 : c[v], g = _(null), M = _(null), h = _(null), k = ma(n, s), A = (u, N) => {
967
+ g.current = N, w(u);
968
+ }, T = () => w(null), z = je({
969
+ open: !!x,
970
+ close: T,
971
+ dialogRef: h,
972
+ initialFocusRef: M,
973
+ triggerRef: g
974
+ });
975
+ Z(() => {
976
+ v !== null && !x && w(null);
977
+ }, [v, x]);
978
+ const I = (u) => {
979
+ c.length && w(
980
+ (N) => N === null ? 0 : (N + u + c.length) % c.length
981
+ );
982
+ }, G = (u) => {
983
+ z(u), !u.defaultPrevented && (u.key === "ArrowLeft" || u.key === "ArrowRight") && (u.preventDefault(), I(u.key === "ArrowLeft" ? -1 : 1));
984
+ }, $ = /* @__PURE__ */ L(U, { children: [
985
+ c.length ? c.map((u, N) => /* @__PURE__ */ L("figure", { "data-df-slot": "item", children: [
986
+ /* @__PURE__ */ d(
987
+ "button",
988
+ {
989
+ className: "df-gallery-trigger",
990
+ type: "button",
991
+ "data-df-action": "open-gallery",
992
+ "aria-label": `${u.alt || k.image} ${N + 1}`,
993
+ "aria-haspopup": "dialog",
994
+ onClick: (K) => A(N, K.currentTarget),
995
+ children: /* @__PURE__ */ d(
996
+ "img",
997
+ {
998
+ src: u.src,
999
+ alt: u.alt,
1000
+ title: u.title,
1001
+ srcSet: u.srcSet,
1002
+ sizes: u.sizes,
1003
+ width: u.width,
1004
+ height: u.height,
1005
+ loading: "lazy"
1006
+ }
1007
+ )
1008
+ }
1009
+ ),
1010
+ u.caption ? /* @__PURE__ */ d("figcaption", { children: u.caption }) : null
1011
+ ] }, `${u.src}-${N}`)) : e,
1012
+ m,
1013
+ v !== null && x ? /* @__PURE__ */ d(Ee, { children: /* @__PURE__ */ L(
1014
+ "div",
1015
+ {
1016
+ ref: h,
1017
+ className: "df-gallery-lightbox",
1018
+ "data-df-slot": "lightbox",
1019
+ role: "dialog",
1020
+ "aria-modal": "true",
1021
+ "aria-label": k.gallery,
1022
+ tabIndex: -1,
1023
+ onKeyDown: G,
1024
+ children: [
1025
+ /* @__PURE__ */ d(
1026
+ "div",
1027
+ {
1028
+ className: "df-gallery-backdrop",
1029
+ "data-df-action": "close-gallery",
1030
+ "aria-hidden": "true",
1031
+ onClick: T
1032
+ }
1033
+ ),
1034
+ /* @__PURE__ */ L("div", { className: "df-gallery-dialog", children: [
1035
+ /* @__PURE__ */ L("div", { className: "df-gallery-dialog-head", children: [
1036
+ /* @__PURE__ */ d("span", { children: k.gallery }),
1037
+ /* @__PURE__ */ d(
1038
+ "button",
1039
+ {
1040
+ ref: M,
1041
+ className: "df-icon-button",
1042
+ type: "button",
1043
+ "data-df-action": "close-gallery",
1044
+ "aria-label": k.close,
1045
+ title: k.close,
1046
+ onClick: T,
1047
+ children: /* @__PURE__ */ d(E, { name: "close", size: 20 })
1048
+ }
1049
+ )
1050
+ ] }),
1051
+ /* @__PURE__ */ L("div", { className: "df-gallery-stage", children: [
1052
+ c.length > 1 ? /* @__PURE__ */ d(
1053
+ "button",
1054
+ {
1055
+ className: "df-gallery-nav df-gallery-prev",
1056
+ type: "button",
1057
+ "data-df-action": "previous-gallery-image",
1058
+ "aria-label": k.previous,
1059
+ title: k.previous,
1060
+ onClick: () => I(-1),
1061
+ children: /* @__PURE__ */ d(E, { name: "previous", size: 20 })
1062
+ }
1063
+ ) : null,
1064
+ /* @__PURE__ */ L("figure", { children: [
1065
+ /* @__PURE__ */ d(
1066
+ "img",
1067
+ {
1068
+ src: x.src,
1069
+ alt: x.alt,
1070
+ title: x.title,
1071
+ srcSet: x.srcSet,
1072
+ sizes: x.sizes,
1073
+ width: x.width,
1074
+ height: x.height
1075
+ }
1076
+ ),
1077
+ /* @__PURE__ */ L("figcaption", { children: [
1078
+ /* @__PURE__ */ d("span", { className: "df-gallery-caption", children: x.caption || x.alt }),
1079
+ /* @__PURE__ */ L(
1080
+ "small",
1081
+ {
1082
+ className: "df-gallery-count",
1083
+ "data-df-gallery-count": "",
1084
+ "aria-live": "polite",
1085
+ "aria-atomic": "true",
1086
+ children: [
1087
+ v + 1,
1088
+ " / ",
1089
+ c.length
1090
+ ]
1091
+ }
1092
+ )
1093
+ ] })
1094
+ ] }),
1095
+ c.length > 1 ? /* @__PURE__ */ d(
1096
+ "button",
1097
+ {
1098
+ className: "df-gallery-nav df-gallery-next",
1099
+ type: "button",
1100
+ "data-df-action": "next-gallery-image",
1101
+ "aria-label": k.next,
1102
+ title: k.next,
1103
+ onClick: () => I(1),
1104
+ children: /* @__PURE__ */ d(E, { name: "next", size: 20 })
1105
+ }
1106
+ ) : null
1107
+ ] }),
1108
+ c.length > 1 ? /* @__PURE__ */ d("div", { className: "df-gallery-thumbs", role: "group", "aria-label": k.thumbnails, children: c.map((u, N) => /* @__PURE__ */ d(
1109
+ "button",
1110
+ {
1111
+ className: N === v ? "is-current" : void 0,
1112
+ type: "button",
1113
+ "data-df-action": "select-gallery-image",
1114
+ "aria-current": N === v ? "true" : void 0,
1115
+ "aria-label": `${u.alt || k.image} ${N + 1}`,
1116
+ onClick: () => w(N),
1117
+ children: /* @__PURE__ */ d("img", { src: u.src, alt: "", loading: "lazy" })
1118
+ },
1119
+ `${u.src}-thumb-${N}`
1120
+ )) }) : null
1121
+ ] })
1122
+ ]
1123
+ }
1124
+ ) }) : null
1125
+ ] });
1126
+ return r ? $ : /* @__PURE__ */ d(
1127
+ "div",
1128
+ {
1129
+ ...J(s),
1130
+ className: ["df-image-gallery", a].filter(Boolean).join(" "),
1131
+ "data-df-component": "gallery",
1132
+ "data-df-slot": "root",
1133
+ "data-df-island": "gallery",
1134
+ "data-df-gallery-items": y,
1135
+ "data-df-gallery-label": k.gallery,
1136
+ "data-df-close-label": k.close,
1137
+ "data-df-previous-label": k.previous,
1138
+ "data-df-next-label": k.next,
1139
+ "data-df-thumbnails-label": k.thumbnails,
1140
+ "data-df-image-label": k.image,
1141
+ role: o,
1142
+ "aria-label": k.gallery,
1143
+ children: $
1144
+ }
1145
+ );
1146
+ }
1147
+ function Ge(e, t, a) {
1148
+ const o = e;
1149
+ return o[t] ?? o[a];
1150
+ }
1151
+ function ie(e) {
1152
+ return F(e);
1153
+ }
1154
+ function st(e) {
1155
+ return String(Ge(e.props, "data-df-tab", "dataDfTab") ?? "");
1156
+ }
1157
+ function ga(e) {
1158
+ return String(Ge(e.props, "data-df-tab-panel", "dataDfTabPanel") ?? "");
1159
+ }
1160
+ function Ie(e) {
1161
+ return O.toArray(e.props.children).filter(ie);
1162
+ }
1163
+ function Me(e) {
1164
+ return e.props.disabled === !0 || e.props["aria-disabled"] === "true";
1165
+ }
1166
+ function ha(e) {
1167
+ return e.props["aria-selected"] === !0 || e.props["aria-selected"] === "true";
1168
+ }
1169
+ function He(e) {
1170
+ return Number.parseInt(vt, 10) >= 19 ? e.props.ref : e.ref;
1171
+ }
1172
+ function ya(e, t, a = "smooth") {
1173
+ if (typeof e.scrollTo != "function") return;
1174
+ const o = t.offsetLeft, n = o + t.offsetWidth;
1175
+ o < e.scrollLeft ? e.scrollTo({ left: o, behavior: a }) : n > e.scrollLeft + e.clientWidth && e.scrollTo({ left: n - e.clientWidth, behavior: a });
1176
+ }
1177
+ function va(e, t, a, o, n, i) {
1178
+ const r = O.toArray(e), l = r.findIndex((g) => ie(g) && g.props.role === "tablist");
1179
+ if (l < 0) return e;
1180
+ const s = r[l], f = Ie(s);
1181
+ if (!f.length) return e;
1182
+ const b = f.map((g, M) => st(g) || `tab-${M + 1}`), c = f.flatMap((g, M) => Me(g) ? [] : [M]), y = (g, M = !1) => {
1183
+ g && (a(g), queueMicrotask(() => {
1184
+ const h = o.current[g];
1185
+ h && (ya(n.current ?? h.parentElement ?? h, h), M && h.focus());
1186
+ }));
1187
+ }, m = (g, M) => {
1188
+ if (!["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End"].includes(g.key)) return;
1189
+ const h = c.indexOf(M);
1190
+ if (h < 0 || c.length === 0) return;
1191
+ g.preventDefault(), g.stopPropagation();
1192
+ const k = g.key === "Home" ? c[0] : g.key === "End" ? c.at(-1) : c[(h + (g.key === "ArrowRight" || g.key === "ArrowDown" ? 1 : -1) + c.length) % c.length];
1193
+ if (k === void 0) return;
1194
+ const A = b[k];
1195
+ A && y(A, !0);
1196
+ }, v = f.map((g, M) => {
1197
+ const h = b[M] ?? `tab-${M + 1}`, k = h === t, A = g.props.onClick, T = g.props.onKeyDown, z = He(g);
1198
+ return R(g, {
1199
+ id: `${i}-tab-${M + 1}`,
1200
+ "aria-controls": `${i}-panel-${M + 1}`,
1201
+ "aria-selected": k ? "true" : "false",
1202
+ tabIndex: k ? 0 : -1,
1203
+ ref: (I) => {
1204
+ o.current[h] = I, typeof z == "function" ? z(I) : z && "current" in z && (z.current = I);
1205
+ },
1206
+ onClick: (I) => {
1207
+ A?.(I), !I.defaultPrevented && (I.stopPropagation(), y(h));
1208
+ },
1209
+ onKeyDown: (I) => {
1210
+ T?.(I), I.defaultPrevented || m(I, M);
1211
+ }
1212
+ });
1213
+ }), w = He(s), x = R(s, {
1214
+ children: v,
1215
+ ref: (g) => {
1216
+ n.current = g, typeof w == "function" ? w(g) : w && "current" in w && (w.current = g);
1217
+ }
1218
+ });
1219
+ return r.map((g, M) => {
1220
+ if (M === l) return x;
1221
+ if (!ie(g) || g.props.role !== "tabpanel") return g;
1222
+ const h = r.filter((A) => ie(A) && A.props.role === "tabpanel").indexOf(g), k = ga(g) || b[h] || "";
1223
+ return R(g, {
1224
+ id: `${i}-panel-${h + 1}`,
1225
+ "aria-labelledby": `${i}-tab-${h + 1}`,
1226
+ hidden: k !== t
1227
+ });
1228
+ });
1229
+ }
1230
+ function le({
1231
+ children: e,
1232
+ kind: t = "tabs",
1233
+ component: a,
1234
+ ...o
1235
+ }) {
1236
+ const i = O.toArray(e).find(
1237
+ (u) => ie(u) && u.props.role === "tablist"
1238
+ ), r = i ? Ie(i).map((u, N) => st(u) || `tab-${N + 1}`) : [], l = i ? Ie(i) : [], s = l.findIndex(
1239
+ (u) => ha(u) && !Me(u)
1240
+ ), f = l.findIndex((u) => !Me(u)), b = r[s >= 0 ? s : f] ?? "", [c, y] = B(b), m = r.includes(c) ? c : b, v = _({}), w = _(null), [x, g] = B(!1), [M, h] = B(!1), k = yt().replace(/:/g, ""), T = String(Ge(o, "data-df-tabs-id", "dataDfTabsId") ?? "") || `df-tabs-${k}`, z = va(e, m, y, v, w, T);
1241
+ Z(() => {
1242
+ if (t !== "code-group") return;
1243
+ const u = w.current;
1244
+ if (!u) return;
1245
+ const N = () => {
1246
+ const te = Math.max(0, u.scrollWidth - u.clientWidth);
1247
+ g(te > 1 && u.scrollLeft > 1), h(te > 1 && u.scrollLeft < te - 1);
1248
+ };
1249
+ N(), u.addEventListener("scroll", N, { passive: !0 });
1250
+ const K = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(N);
1251
+ return K?.observe(u), () => {
1252
+ u.removeEventListener("scroll", N), K?.disconnect();
1253
+ };
1254
+ }, [e, t]);
1255
+ const I = (u) => {
1256
+ const N = w.current;
1257
+ !N || typeof N.scrollBy != "function" || N.scrollBy({
1258
+ left: u * Math.max(180, N.clientWidth * 0.72),
1259
+ behavior: "smooth"
1260
+ });
1261
+ }, G = J(o), $ = V(
1262
+ t === "code-group" ? "df-tabs df-code-group" : "df-tabs",
1263
+ o.className
1264
+ );
1265
+ return a ? /* @__PURE__ */ d(
1266
+ a,
1267
+ {
1268
+ ...G,
1269
+ className: $,
1270
+ kind: t,
1271
+ "data-df-component": t,
1272
+ "data-df-slot": "root",
1273
+ "data-df-behavior": "tabs",
1274
+ "data-df-tabs-id": T,
1275
+ children: z
1276
+ }
1277
+ ) : /* @__PURE__ */ L(
1278
+ "div",
1279
+ {
1280
+ ...G,
1281
+ className: $,
1282
+ "data-df-component": t,
1283
+ "data-df-slot": "root",
1284
+ "data-df-behavior": "tabs",
1285
+ "data-df-tabs-id": T,
1286
+ children: [
1287
+ t === "code-group" ? /* @__PURE__ */ d(
1288
+ "button",
1289
+ {
1290
+ type: "button",
1291
+ className: "df-code-tabs-scroll df-code-tabs-scroll-start",
1292
+ "data-df-action": "scroll-code-tabs",
1293
+ "data-df-direction": "-1",
1294
+ "aria-label": "Previous code files",
1295
+ hidden: !x,
1296
+ onClick: () => I(-1),
1297
+ children: /* @__PURE__ */ d(E, { name: "previous", size: 18 })
1298
+ }
1299
+ ) : null,
1300
+ z,
1301
+ t === "code-group" ? /* @__PURE__ */ d(
1302
+ "button",
1303
+ {
1304
+ type: "button",
1305
+ className: "df-code-tabs-scroll df-code-tabs-scroll-end",
1306
+ "data-df-action": "scroll-code-tabs",
1307
+ "data-df-direction": "1",
1308
+ "aria-label": "Next code files",
1309
+ hidden: !M,
1310
+ onClick: () => I(1),
1311
+ children: /* @__PURE__ */ d(E, { name: "next", size: 18 })
1312
+ }
1313
+ ) : null
1314
+ ]
1315
+ }
1316
+ );
1317
+ }
1318
+ function Ze(e) {
1319
+ if (typeof e.type == "string") return e.type;
1320
+ const t = e.type.displayName ?? "";
1321
+ return t.startsWith("Markdown") ? t.slice(8).toLowerCase() : "";
1322
+ }
1323
+ function ft(e) {
1324
+ return typeof e == "string" && !e.trim();
1325
+ }
1326
+ function Te(e, t, a, o) {
1327
+ if (!F(e)) return e;
1328
+ const n = e, i = O.toArray(n.props.children).filter((h) => !ft(h)), r = n.props["data-df-file-tree-file"] !== void 0 || n.props.dataDfFileTreeFile !== void 0, l = n.props["data-df-file-tree-branch"] !== void 0 || n.props.dataDfFileTreeBranch !== void 0, s = n.props["aria-current"] === "page" || n.props["aria-current"] === !0 || n.props["data-df-current"] !== void 0 || n.props.dataDfCurrent !== void 0, f = l ? i.findIndex(
1329
+ (h) => F(h) && Ze(h) === "button"
1330
+ ) : -1, b = l ? i.findIndex(
1331
+ (h) => F(h) && Ze(h) === "ul"
1332
+ ) : -1, c = String(
1333
+ n.props["data-df-file-tree-path"] ?? n.props.dataDfFileTreePath ?? ""
1334
+ ), y = f >= 0 ? j(i[f].props.children) : "", m = c || `${t}:${y.trim().toLowerCase()}`, v = f >= 0 ? i[f].props["aria-expanded"] : void 0, w = l ? a[m] ?? (v !== !1 && v !== "false") : !0, x = i.map((h, k) => {
1335
+ const A = `${t}.${k}`;
1336
+ if (l && k === f && F(h)) {
1337
+ const T = h, z = T.props.onClick, I = O.toArray(T.props.children), G = I.some(
1338
+ ($) => F($) && ($.props["data-df-slot"] === "folder-icon" || $.props.dataDfSlot === "folder-icon")
1339
+ );
1340
+ return R(T, {
1341
+ className: V("df-file-tree-folder", T.props.className),
1342
+ "data-df-action": "toggle-file-tree",
1343
+ "data-df-file-tree-toggle": "",
1344
+ "aria-expanded": String(w),
1345
+ children: G ? I : [
1346
+ /* @__PURE__ */ d("span", { className: "df-file-tree-folder-icon", "data-df-slot": "folder-icon", children: /* @__PURE__ */ d(E, { name: "folder" }) }, "folder-icon"),
1347
+ ...I
1348
+ ],
1349
+ onClick: ($) => {
1350
+ typeof z == "function" && z($), $.defaultPrevented || o(m, !w);
1351
+ }
1352
+ });
1353
+ }
1354
+ if (l && k === b && F(h)) {
1355
+ const T = Te(h, A, a, o);
1356
+ return /* @__PURE__ */ d(
1357
+ "div",
1358
+ {
1359
+ className: "df-file-tree-children",
1360
+ "data-df-state": w ? "expanded" : "collapsed",
1361
+ "aria-hidden": w ? void 0 : "true",
1362
+ inert: w ? void 0 : !0,
1363
+ children: T
1364
+ },
1365
+ `${m}-children`
1366
+ );
1367
+ }
1368
+ return Te(h, A, a, o);
1369
+ }), g = i.some(
1370
+ (h) => F(h) && (h.props["data-df-slot"] === "file-icon" || h.props.dataDfSlot === "file-icon")
1371
+ ), M = r && !g ? [
1372
+ /* @__PURE__ */ d("span", { className: "df-file-tree-file-icon", "data-df-slot": "file-icon", children: /* @__PURE__ */ d(E, { name: "file" }) }, "file-icon"),
1373
+ ...x
1374
+ ] : x;
1375
+ return R(n, {
1376
+ ...r || l ? {
1377
+ className: V(
1378
+ [
1379
+ r ? "df-file-tree-file" : "",
1380
+ l ? "df-file-tree-branch" : "",
1381
+ s ? "df-file-tree-current" : ""
1382
+ ].filter(Boolean).join(" "),
1383
+ n.props.className
1384
+ )
1385
+ } : {},
1386
+ ...l ? {
1387
+ "data-df-state": w ? "expanded" : "collapsed",
1388
+ "data-df-file-tree-path": m
1389
+ } : {},
1390
+ children: M
1391
+ });
1392
+ }
1393
+ function Fe({ children: e, ...t }) {
1394
+ const [a, o] = B({}), n = O.toArray(e).filter((l) => !ft(l)).map(
1395
+ (l, s) => Te(
1396
+ l,
1397
+ String(s),
1398
+ a,
1399
+ (f, b) => o((c) => ({ ...c, [f]: b }))
1400
+ )
1401
+ ), i = O.map(
1402
+ n,
1403
+ (l) => F(l) ? R(l, { "data-df-slot": "content" }) : l
1404
+ ), r = J(t);
1405
+ return /* @__PURE__ */ d(
1406
+ "div",
1407
+ {
1408
+ ...r,
1409
+ className: V("df-file-tree", t.className),
1410
+ "data-df-component": "file-tree",
1411
+ "data-df-slot": "root",
1412
+ "data-df-behavior": "file-tree",
1413
+ children: i
1414
+ }
1415
+ );
1416
+ }
1417
+ function ee(e, t, a) {
1418
+ return {
1419
+ ...J(e),
1420
+ ...a ? { className: V(a, e.className) } : {},
1421
+ "data-df-component": t,
1422
+ "data-df-slot": "root"
1423
+ };
1424
+ }
1425
+ function be({ children: e, ...t }) {
1426
+ const a = String(
1427
+ t["data-callout"] ?? t.dataCallout ?? "info"
1428
+ ), o = a === "tip" ? jt : a === "warning" ? Bt : a === "danger" ? _t : Wt, n = O.map(e, (i) => {
1429
+ if (!F(i)) return i;
1430
+ const r = i;
1431
+ return r.props["data-df-slot"] === "title" || r.props.dataDfSlot === "title" ? R(r, {
1432
+ children: /* @__PURE__ */ L(U, { children: [
1433
+ /* @__PURE__ */ d(o, { className: "df-callout-icon", size: 17, strokeWidth: 2, "aria-hidden": "true" }),
1434
+ r.props.children
1435
+ ] })
1436
+ }) : i;
1437
+ });
1438
+ return C("div", ee(t, "callout", "df-callout"), n);
1439
+ }
1440
+ function Ae({ children: e, ...t }) {
1441
+ return C("ol", ee(t, "steps", "df-steps"), e);
1442
+ }
1443
+ function wa(e) {
1444
+ const t = O.toArray(e), a = t.findIndex(
1445
+ (o) => F(o) && W(o) === "summary"
1446
+ );
1447
+ return a < 0 ? { summary: void 0, content: t } : {
1448
+ summary: t[a],
1449
+ content: t.filter(
1450
+ (o, n) => n !== a && !(typeof o == "string" && o.trim().length === 0)
1451
+ )
1452
+ };
1453
+ }
1454
+ function ze({ children: e, onToggle: t, ...a }) {
1455
+ const o = a.open === !0, [n, i] = B(o), [r, l] = B(!1), s = _(null), { summary: f, content: b } = wa(e), c = F(f) ? (() => {
1456
+ const m = f, v = m.props.onClick;
1457
+ return R(m, {
1458
+ children: /* @__PURE__ */ L(U, { children: [
1459
+ m.props.children,
1460
+ /* @__PURE__ */ d(Et, { className: "df-details-chevron", size: 17, strokeWidth: 2, "aria-hidden": "true" })
1461
+ ] }),
1462
+ onClick: (w) => {
1463
+ if (v?.(w), w.defaultPrevented) return;
1464
+ const x = w.currentTarget.closest("details");
1465
+ queueMicrotask(() => i(x?.open ?? !1));
1466
+ }
1467
+ });
1468
+ })() : f;
1469
+ Z(() => {
1470
+ l(!0);
1471
+ }, []);
1472
+ const y = /* @__PURE__ */ L(U, { children: [
1473
+ c,
1474
+ /* @__PURE__ */ d(
1475
+ "div",
1476
+ {
1477
+ ref: s,
1478
+ className: "df-details-content",
1479
+ "data-df-slot": "content",
1480
+ inert: r && !n ? !0 : void 0,
1481
+ children: /* @__PURE__ */ d("div", { className: "df-details-content-inner", children: b.map((m, v) => /* @__PURE__ */ d(wt, { children: m }, F(m) && m.key !== null ? m.key : `details-${v}`)) })
1482
+ }
1483
+ )
1484
+ ] });
1485
+ return /* @__PURE__ */ d(
1486
+ "details",
1487
+ {
1488
+ ...ee(a, "details"),
1489
+ "data-df-behavior": "details",
1490
+ "data-df-enhanced": r ? "true" : void 0,
1491
+ onToggle: (m) => {
1492
+ i(m.currentTarget.open), t?.(m);
1493
+ },
1494
+ children: y
1495
+ }
1496
+ );
1497
+ }
1498
+ function ut(e, t) {
1499
+ return O.map(e, (a) => F(a) ? R(a, { "data-df-slot": t }) : a);
1500
+ }
1501
+ function $e({ children: e, ...t }) {
1502
+ return /* @__PURE__ */ d("div", { ...ee(t, "card-grid", "df-card-grid"), children: ut(e, "card") });
1503
+ }
1504
+ function Pe({ children: e, ...t }) {
1505
+ return /* @__PURE__ */ d("section", { ...ee(t, "api", "df-api-block"), children: ut(e, "section") });
1506
+ }
1507
+ function Oe({ children: e, ...t }) {
1508
+ return /* @__PURE__ */ d("aside", { ...ee(t, "aside", "df-aside"), children: e });
1509
+ }
1510
+ function Re({ children: e, ...t }) {
1511
+ const a = ee(t, "badge", "df-badge");
1512
+ return /* @__PURE__ */ d("span", { ...a, "data-df-slot": "label", children: e });
1513
+ }
1514
+ function Ca({
1515
+ anchor: e,
1516
+ anchorLabel: t,
1517
+ copyFailureLabel: a = S.copyFailed
1518
+ }) {
1519
+ const [o, n] = B("idle");
1520
+ Z(() => {
1521
+ if (o === "idle") return;
1522
+ const s = setTimeout(() => n("idle"), it);
1523
+ return () => clearTimeout(s);
1524
+ }, [o]);
1525
+ const i = async () => {
1526
+ const s = typeof window > "u" ? e : `${window.location.origin}${window.location.pathname}${window.location.search}${e}`;
1527
+ try {
1528
+ n(await et(s) ? "success" : "error");
1529
+ } catch {
1530
+ n("error");
1531
+ }
1532
+ }, r = t || S.copySectionLink, l = o === "success" ? `${r} ✓` : o === "error" ? a : r;
1533
+ return /* @__PURE__ */ L(
1534
+ "button",
1535
+ {
1536
+ className: `df-anchor${o === "success" ? " df-action-success" : ""}${o === "error" ? " df-action-error" : ""}`,
1537
+ type: "button",
1538
+ "data-anchor": e,
1539
+ "data-df-action": "copy-section-link",
1540
+ "data-df-anchor-label": r,
1541
+ "data-df-copy-error": o === "error" ? "true" : void 0,
1542
+ "aria-label": l,
1543
+ title: l,
1544
+ onClick: i,
1545
+ children: [
1546
+ /* @__PURE__ */ d(E, { name: "link" }),
1547
+ /* @__PURE__ */ d("span", { className: "df-sr-only", "aria-live": "polite", "aria-atomic": "true", children: o === "idle" ? "" : l })
1548
+ ]
1549
+ }
1550
+ );
1551
+ }
1552
+ function ka({
1553
+ level: e,
1554
+ as: t,
1555
+ id: a,
1556
+ anchor: o,
1557
+ anchorLabel: n,
1558
+ copyFailureLabel: i,
1559
+ children: r,
1560
+ className: l,
1561
+ ...s
1562
+ }) {
1563
+ const f = t ?? `h${e}`, b = l?.split(/\s+/).filter(Boolean) ?? [], c = b.some((v) => v === "sr-only" || v === "df-sr-only"), y = e > 1 && !!o && !c;
1564
+ c && !b.includes("df-sr-only") && b.push("df-sr-only"), y && b.push("df-heading-with-anchor");
1565
+ const m = b.join(" ");
1566
+ return /* @__PURE__ */ L(f, { ...s, id: a, className: m || void 0, children: [
1567
+ r,
1568
+ y && o ? /* @__PURE__ */ d(
1569
+ "span",
1570
+ {
1571
+ className: "df-anchor-island",
1572
+ "data-df-behavior": "heading",
1573
+ "data-df-anchor": o,
1574
+ "data-df-anchor-label": n || S.copySectionLink,
1575
+ "data-df-copy-failure-label": i || S.copyFailed,
1576
+ children: /* @__PURE__ */ d(
1577
+ Ca,
1578
+ {
1579
+ anchor: o,
1580
+ anchorLabel: n,
1581
+ copyFailureLabel: i
1582
+ }
1583
+ )
1584
+ }
1585
+ ) : null
1586
+ ] });
1587
+ }
1588
+ function qe(e, t) {
1589
+ return O.toArray(e).find((a) => {
1590
+ if (!F(a)) return !1;
1591
+ const o = a;
1592
+ return W(o) === t || t === "figcaption" && (o.props["data-df-slot"] === "caption" || o.props.dataDfSlot === "caption");
1593
+ });
1594
+ }
1595
+ function pt(e, t, a) {
1596
+ const o = { ...t, children: a };
1597
+ if (e === "code-block")
1598
+ return {
1599
+ ...o,
1600
+ source: p(t, "data-df-source", "dataDfSource") || j(a),
1601
+ language: p(t, "data-df-language", "dataDfLanguage") || "text",
1602
+ copyLabel: p(t, "data-df-copy-label", "dataDfCopyLabel") || void 0,
1603
+ copyFailureLabel: p(t, "data-df-copy-failure-label", "dataDfCopyFailureLabel") || void 0
1604
+ };
1605
+ if (e === "copy-snippet")
1606
+ return {
1607
+ ...o,
1608
+ value: p(t, "data-df-value", "dataDfValue") || j(a),
1609
+ copyLabel: p(t, "data-df-copy-label", "dataDfCopyLabel") || void 0,
1610
+ copyFailureLabel: p(t, "data-df-copy-failure-label", "dataDfCopyFailureLabel") || void 0
1611
+ };
1612
+ if (e === "table")
1613
+ return {
1614
+ ...o,
1615
+ tableTitle: p(t, "data-df-table-title", "dataDfTableTitle") || void 0,
1616
+ copyLabel: p(t, "data-df-copy-label", "dataDfCopyLabel") || void 0,
1617
+ copyFailureLabel: p(t, "data-df-copy-failure-label", "dataDfCopyFailureLabel") || void 0,
1618
+ downloadLabel: p(t, "data-df-download-label", "dataDfDownloadLabel") || void 0,
1619
+ zoomLabel: p(t, "data-df-zoom-label", "dataDfZoomLabel") || void 0,
1620
+ closeLabel: p(t, "data-df-close-label", "dataDfCloseLabel") || void 0,
1621
+ sortLabel: p(t, "data-df-sort-label", "dataDfSortLabel") || void 0
1622
+ };
1623
+ if (e === "image") {
1624
+ const n = qe(a, "img"), i = qe(a, "figcaption"), r = n ? fe(n.props, "width") : void 0, l = n ? fe(n.props, "height") : void 0, s = n ? fe(n.props, "loading") : void 0;
1625
+ return {
1626
+ ...o,
1627
+ src: n && p(n.props, "src") || void 0,
1628
+ alt: n ? p(n.props, "alt") : void 0,
1629
+ caption: i ? j(i.props.children) : void 0,
1630
+ title: n && p(n.props, "title") || void 0,
1631
+ width: typeof r == "string" || typeof r == "number" ? r : void 0,
1632
+ height: typeof l == "string" || typeof l == "number" ? l : void 0,
1633
+ loading: s === "eager" || s === "lazy" ? s : void 0,
1634
+ srcSet: n && p(n.props, "srcSet", "srcset") || void 0,
1635
+ sizes: n && p(n.props, "sizes") || void 0,
1636
+ zoomLabel: p(t, "data-df-zoom-label", "dataDfZoomLabel") || void 0,
1637
+ closeLabel: p(t, "data-df-close-label", "dataDfCloseLabel") || void 0
1638
+ };
1639
+ }
1640
+ return e === "terminal" ? {
1641
+ ...o,
1642
+ title: p(t, "data-df-title", "dataDfTitle") || void 0,
1643
+ source: p(t, "data-df-source", "dataDfSource"),
1644
+ copyLabel: p(t, "data-df-copy-label", "dataDfCopyLabel") || void 0,
1645
+ copyFailureLabel: p(t, "data-df-copy-failure-label", "dataDfCopyFailureLabel") || void 0
1646
+ } : e === "gallery" ? {
1647
+ ...o,
1648
+ items: ct(void 0, t.node, a),
1649
+ labels: {
1650
+ gallery: p(t, "data-df-gallery-label", "dataDfGalleryLabel") || void 0,
1651
+ close: p(t, "data-df-close-label", "dataDfCloseLabel") || void 0,
1652
+ previous: p(t, "data-df-previous-label", "dataDfPreviousLabel") || void 0,
1653
+ next: p(t, "data-df-next-label", "dataDfNextLabel") || void 0,
1654
+ thumbnails: p(t, "data-df-thumbnails-label", "dataDfThumbnailsLabel") || void 0,
1655
+ image: p(t, "data-df-image-label", "dataDfImageLabel") || void 0
1656
+ }
1657
+ } : o;
1658
+ }
1659
+ function La(e) {
1660
+ return Array.isArray(e) ? e.join(" ") : typeof e == "string" ? e : "";
1661
+ }
1662
+ function P(e, t) {
1663
+ const a = [La(e), t].filter(Boolean);
1664
+ return a.length ? a.join(" ") : void 0;
1665
+ }
1666
+ const Ue = {
1667
+ callout: { className: "callout", override: "Callout" },
1668
+ tabs: { className: "tabs", override: "Tabs" },
1669
+ "code-group": { className: "tabs", override: "CodeGroup" },
1670
+ steps: { className: "steps", override: "Steps" },
1671
+ "code-block": { className: "codeBlock", override: "CodeBlock" },
1672
+ "copy-snippet": { className: "copySnippet", override: "CopySnippet" },
1673
+ table: { className: "table", override: "Table" },
1674
+ image: { className: "image", override: "Image" },
1675
+ terminal: { className: "terminal", override: "Terminal" },
1676
+ details: { className: "details", override: "Details" },
1677
+ "file-tree": { className: "fileTree", override: "FileTree" },
1678
+ gallery: { className: "gallery", override: "Gallery" },
1679
+ "card-grid": { className: "cardGrid", override: "CardGrid" },
1680
+ api: { className: "api", override: "Api" },
1681
+ aside: { className: "aside", override: "Aside" },
1682
+ badge: { className: "badge", override: "Badge" }
1683
+ };
1684
+ function Je(e) {
1685
+ const t = typeof e == "string" ? e : "";
1686
+ return Object.hasOwn(Ue, t) ? t : void 0;
1687
+ }
1688
+ function ge(e) {
1689
+ return Je(e["data-df-component"]) ?? Je(e.dataDfComponent);
1690
+ }
1691
+ function Da(e, t) {
1692
+ return t[Ue[e].className];
1693
+ }
1694
+ function ne(e, t) {
1695
+ return e[Ue[t].override];
1696
+ }
1697
+ function q(e, t) {
1698
+ return e[t];
1699
+ }
1700
+ function bt(e, t, a, o, n, i) {
1701
+ const r = P(t.className, Da(e, o)), l = ne(n, e);
1702
+ if (l) {
1703
+ const s = pt(e, { ...t, className: r }, a);
1704
+ return C(l, mt(e, s, i));
1705
+ }
1706
+ if (e === "file-tree") return C(Fe, { ...t, className: r, children: a });
1707
+ if (e === "gallery") return C(xe, { ...t, className: r, children: a });
1708
+ if (e === "terminal") return C(pe, { ...t, className: r, children: a });
1709
+ if (e === "copy-snippet")
1710
+ return C(we, { ...t, className: r, children: a });
1711
+ if (e === "card-grid") return C($e, { ...t, className: r, children: a });
1712
+ if (e === "api") return C(Pe, { ...t, className: r, children: a });
1713
+ if (e === "aside") return C(Oe, { ...t, className: r, children: a });
1714
+ if (e === "badge") return C(Re, { ...t, className: r, children: a });
1715
+ }
1716
+ function mt(e, t, a) {
1717
+ const o = ke(t, a);
1718
+ return e !== "gallery" || !Array.isArray(o.items) ? o : {
1719
+ ...o,
1720
+ items: o.items.map(
1721
+ (n) => n && typeof n == "object" ? ke(n, a) : n
1722
+ )
1723
+ };
1724
+ }
1725
+ function D(e, t, a, o, n) {
1726
+ const i = t.replace(/[A-Z]/g, (l) => `-${l.toLowerCase()}`);
1727
+ function r({ children: l, node: s, ...f }) {
1728
+ const b = q(o, e) ?? e, c = ke(f, n);
1729
+ if (t === "heading" && /^h[1-6]$/.test(e)) {
1730
+ const y = f["data-df-anchor"] ?? f.dataDfAnchor, m = f["data-df-anchor-label"] ?? f.dataDfAnchorLabel, v = f["data-df-copy-failure-label"] ?? f.dataDfCopyFailureLabel;
1731
+ return C(ka, {
1732
+ ...c,
1733
+ as: b,
1734
+ level: Number(e.slice(1)),
1735
+ anchor: typeof y == "string" ? y : void 0,
1736
+ anchorLabel: typeof m == "string" ? m : void 0,
1737
+ copyFailureLabel: typeof v == "string" ? v : void 0,
1738
+ className: P(c.className, a[t]),
1739
+ "data-df-element": i,
1740
+ children: l
1741
+ });
1742
+ }
1743
+ return C(
1744
+ b,
1745
+ {
1746
+ ...c,
1747
+ className: P(c.className, a[t]),
1748
+ "data-df-element": i
1749
+ },
1750
+ l
1751
+ );
1752
+ }
1753
+ return r.displayName = `Markdown${e.charAt(0).toUpperCase()}${e.slice(1)}`, r;
1754
+ }
1755
+ function Na(e, t) {
1756
+ return function({ children: o, node: n, ...i }) {
1757
+ const r = i["data-df-icon"] ?? i.dataDfIcon, l = typeof r == "string" ? nt(e, r) : void 0;
1758
+ if (l)
1759
+ return C(l, {
1760
+ size: Number(i.width ?? 16),
1761
+ className: typeof i.className == "string" ? i.className : void 0,
1762
+ "aria-hidden": i["aria-hidden"]
1763
+ });
1764
+ const { ["data-df-icon"]: s, dataDfIcon: f, ...b } = i;
1765
+ return C(q(t, "svg") ?? "svg", b, o);
1766
+ };
1767
+ }
1768
+ function Sa(e, t) {
1769
+ return function({ children: o, node: n, ...i }) {
1770
+ const r = i["data-df-slot"] === "caption" ? rt(e) : void 0;
1771
+ return r ? C(r, {
1772
+ children: o,
1773
+ className: typeof i.className == "string" ? i.className : void 0,
1774
+ "data-df-slot": typeof i["data-df-slot"] == "string" ? i["data-df-slot"] : void 0
1775
+ }) : C(q(t, "figcaption") ?? "figcaption", i, o);
1776
+ };
1777
+ }
1778
+ function xa(e, t, a) {
1779
+ return function({ children: n, node: i, ...r }) {
1780
+ const l = ge(r), s = l ? ne(t, l) : void 0;
1781
+ if (l === "callout")
1782
+ return C(s ?? be, {
1783
+ ...r,
1784
+ className: P(r.className, e.callout),
1785
+ children: n
1786
+ });
1787
+ if (l === "tabs" || l === "code-group")
1788
+ return C(le, {
1789
+ ...r,
1790
+ className: P(r.className, e.tabs),
1791
+ kind: l,
1792
+ component: s,
1793
+ children: n
1794
+ });
1795
+ const f = l && bt(l, { ...r, node: i }, n, e, t, a);
1796
+ return f || C(
1797
+ q(t, "div") ?? "div",
1798
+ {
1799
+ ...r,
1800
+ ...l ? { "data-df-component": l } : {}
1801
+ },
1802
+ n
1803
+ );
1804
+ };
1805
+ }
1806
+ function ye(e, t, a, o) {
1807
+ return function({ children: i, node: r, ...l }) {
1808
+ const s = ge(l), f = s ? ne(a, s) : void 0;
1809
+ if (s === "callout")
1810
+ return C(f ?? be, {
1811
+ ...l,
1812
+ className: P(l.className, t.callout),
1813
+ children: i
1814
+ });
1815
+ if (s === "tabs" || s === "code-group")
1816
+ return C(le, {
1817
+ ...l,
1818
+ className: P(l.className, t.tabs),
1819
+ kind: s,
1820
+ component: f,
1821
+ children: i
1822
+ });
1823
+ const b = s && bt(s, { ...l, node: r }, i, t, a, o);
1824
+ if (b) return b;
1825
+ const c = e === "section" && (l["data-df-element"] === "footnotes" || l.dataDfElement === "footnotes");
1826
+ return C(
1827
+ q(a, e) ?? e,
1828
+ {
1829
+ ...l,
1830
+ className: c ? P(l.className, t.footnotes) : l.className,
1831
+ ...c ? { "data-df-element": "footnotes" } : {},
1832
+ ...s ? { "data-df-component": s } : {}
1833
+ },
1834
+ i
1835
+ );
1836
+ };
1837
+ }
1838
+ function Ia(e, t, a) {
1839
+ return function({ children: n, node: i, ...r }) {
1840
+ const l = ge(r);
1841
+ if (l && ["code-block", "table", "image", "terminal"].includes(l)) {
1842
+ const f = e[l === "code-block" ? "codeBlock" : l], b = ne(t, l);
1843
+ if (b) {
1844
+ const c = pt(
1845
+ l,
1846
+ { ...r, className: P(r.className, f) },
1847
+ n
1848
+ );
1849
+ return C(b, mt(l, c, a));
1850
+ }
1851
+ return l === "code-block" ? C(ve, {
1852
+ ...r,
1853
+ className: P(r.className, f),
1854
+ children: n
1855
+ }) : l === "table" ? C(Ne, {
1856
+ ...r,
1857
+ className: P(r.className, f),
1858
+ children: n
1859
+ }) : l === "image" ? C(Le, {
1860
+ ...r,
1861
+ className: P(r.className, f),
1862
+ children: n
1863
+ }) : l === "terminal" ? C(pe, {
1864
+ ...r,
1865
+ node: i,
1866
+ className: P(r.className, f),
1867
+ children: n
1868
+ }) : C(
1869
+ q(t, "figure") ?? "figure",
1870
+ { ...r, className: P(r.className, f), "data-df-component": l },
1871
+ n
1872
+ );
1873
+ }
1874
+ return C(
1875
+ q(t, "figure") ?? "figure",
1876
+ {
1877
+ ...r,
1878
+ ...l ? { "data-df-component": l } : {}
1879
+ },
1880
+ n
1881
+ );
1882
+ };
1883
+ }
1884
+ function Ma(e, t) {
1885
+ return function({ children: o, node: n, ...i }) {
1886
+ const r = ge(i);
1887
+ if (r === "steps") {
1888
+ const l = ne(t, r) ?? Ae;
1889
+ return C(l, {
1890
+ ...i,
1891
+ className: P(i.className, e.steps),
1892
+ children: o
1893
+ });
1894
+ }
1895
+ return C(
1896
+ q(t, "ol") ?? "ol",
1897
+ {
1898
+ ...i,
1899
+ className: P(i.className, e.list),
1900
+ ...r ? { "data-df-component": r } : {}
1901
+ },
1902
+ o
1903
+ );
1904
+ };
1905
+ }
1906
+ function Ta(e, t) {
1907
+ return function({ children: o, node: n, ...i }) {
1908
+ const r = ne(t, "details") ?? q(t, "details") ?? ze;
1909
+ return C(r, {
1910
+ ...i,
1911
+ node: n,
1912
+ className: P(i.className, e.details),
1913
+ children: o
1914
+ });
1915
+ };
1916
+ }
1917
+ function gt(e = {}, t = {}, a = {}, o) {
1918
+ return {
1919
+ h1: D("h1", "heading", e, a, o),
1920
+ h2: D("h2", "heading", e, a, o),
1921
+ h3: D("h3", "heading", e, a, o),
1922
+ h4: D("h4", "heading", e, a, o),
1923
+ h5: D("h5", "heading", e, a, o),
1924
+ h6: D("h6", "heading", e, a, o),
1925
+ p: D("p", "paragraph", e, a, o),
1926
+ a: D("a", "link", e, a, o),
1927
+ ul: D("ul", "list", e, a, o),
1928
+ ol: Ma(e, a),
1929
+ li: D("li", "listItem", e, a, o),
1930
+ blockquote: D("blockquote", "blockquote", e, a),
1931
+ hr: D("hr", "horizontalRule", e, a),
1932
+ strong: D("strong", "strong", e, a),
1933
+ em: D("em", "emphasis", e, a),
1934
+ del: D("del", "strikethrough", e, a),
1935
+ mark: D("mark", "highlight", e, a),
1936
+ kbd: D("kbd", "keyboard", e, a),
1937
+ sup: D("sup", "superscript", e, a),
1938
+ sub: D("sub", "subscript", e, a),
1939
+ code: D("code", "inlineCode", e, a),
1940
+ div: xa(e, a, o),
1941
+ aside: ye("aside", e, a, o),
1942
+ section: ye("section", e, a, o),
1943
+ span: ye("span", e, a, o),
1944
+ pre: D("pre", "code", e, a),
1945
+ table: D("table", "table", e, a),
1946
+ thead: D("thead", "tableHead", e, a),
1947
+ tbody: D("tbody", "tableBody", e, a),
1948
+ tr: D("tr", "tableRow", e, a),
1949
+ th: D("th", "tableHeader", e, a),
1950
+ td: D("td", "tableCell", e, a),
1951
+ input: D("input", "taskCheckbox", e, a),
1952
+ figure: Ia(e, a, o),
1953
+ img: D("img", "image", e, a, o),
1954
+ video: D("video", "video", e, a, o),
1955
+ audio: D("audio", "audio", e, a, o),
1956
+ iframe: D("iframe", "embed", e, a, o),
1957
+ dl: D("dl", "definitionList", e, a),
1958
+ dt: D("dt", "definitionTerm", e, a),
1959
+ dd: D("dd", "definitionDescription", e, a),
1960
+ summary: D("summary", "summary", e, a),
1961
+ figcaption: Sa(t, a),
1962
+ svg: Na(t, a),
1963
+ details: Ta(e, a),
1964
+ MarkdownCallout: be,
1965
+ MarkdownTabs: le,
1966
+ MarkdownSteps: Ae,
1967
+ MarkdownCodeBlock: ve,
1968
+ MarkdownCopySnippet: we,
1969
+ MarkdownTable: Ne,
1970
+ MarkdownImage: Le,
1971
+ MarkdownDetails: ze,
1972
+ MarkdownTerminal: pe,
1973
+ MarkdownFileTree: Fe,
1974
+ MarkdownGallery: xe,
1975
+ MarkdownCardGrid: $e,
1976
+ MarkdownApiBlock: Pe,
1977
+ MarkdownAside: Oe,
1978
+ MarkdownBadge: Re,
1979
+ Callout: be,
1980
+ Tabs: le,
1981
+ CodeGroup: le,
1982
+ Steps: Ae,
1983
+ CodeBlock: ve,
1984
+ CopySnippet: we,
1985
+ Table: Ne,
1986
+ Image: Le,
1987
+ Details: ze,
1988
+ Terminal: pe,
1989
+ FileTree: Fe,
1990
+ Gallery: xe,
1991
+ CardGrid: $e,
1992
+ Api: Pe,
1993
+ Aside: Oe,
1994
+ Badge: Re
1995
+ };
1996
+ }
1997
+ function Ga(e = {}, t = {}, a = {}, o) {
1998
+ const n = gt(e, t, a, o);
1999
+ for (const [i, r] of Object.entries(a))
2000
+ /^[A-Z]/.test(i) && (n[i] = r);
2001
+ return n;
2002
+ }
2003
+ function Fa(...e) {
2004
+ return e.filter(Boolean).join(" ");
2005
+ }
2006
+ function Aa({
2007
+ as: e = "div",
2008
+ className: t,
2009
+ classNames: a,
2010
+ slots: o,
2011
+ urlTransform: n,
2012
+ children: i,
2013
+ "data-df-root": r = "markdown",
2014
+ ...l
2015
+ }) {
2016
+ return C(ra, {
2017
+ transform: n,
2018
+ children: C(Zt, {
2019
+ slots: o,
2020
+ children: C(
2021
+ e,
2022
+ {
2023
+ ...l,
2024
+ className: Fa("df-content", a?.root, t),
2025
+ "data-df-root": r,
2026
+ "data-df-runtime": l["data-df-runtime"] ?? "react",
2027
+ "data-df-component": "markdown"
2028
+ },
2029
+ i
2030
+ )
2031
+ })
2032
+ });
2033
+ }
2034
+ function Xe({
2035
+ document: e,
2036
+ classNames: t,
2037
+ components: a,
2038
+ slots: o,
2039
+ urlTransform: n,
2040
+ ...i
2041
+ }) {
2042
+ const r = de(
2043
+ () => gt(t, o, a, n),
2044
+ [t, a, o, n]
2045
+ ), l = de(
2046
+ () => ht(e, {
2047
+ Fragment: U,
2048
+ jsx: d,
2049
+ jsxs: L,
2050
+ components: r,
2051
+ passNode: !0
2052
+ }),
2053
+ [r, e]
2054
+ );
2055
+ return /* @__PURE__ */ d(Aa, { ...i, classNames: t, slots: o, urlTransform: n, children: l });
2056
+ }
2057
+ function za(e) {
2058
+ return Vt(e ?? {});
2059
+ }
2060
+ const H = /* @__PURE__ */ new Map(), $a = 32;
2061
+ function Pa(e, t) {
2062
+ return t === void 0 ? void 0 : `${t.length}:${t}\0${e}`;
2063
+ }
2064
+ async function Oa(e, t, a) {
2065
+ const o = () => import("./prepareMarkdown-CHqN2JF5.js").then((l) => l.b).then(({ prepareMarkdown: l }) => l(e, t)), n = Pa(e, a);
2066
+ if (n === void 0) return o();
2067
+ const i = H.get(n);
2068
+ if (i)
2069
+ return H.delete(n), H.set(n, i), i;
2070
+ const r = o().catch((l) => {
2071
+ throw H.get(n) === r && H.delete(n), l;
2072
+ });
2073
+ for (H.set(n, r); H.size > $a; ) {
2074
+ const l = H.keys().next().value;
2075
+ if (l === void 0) break;
2076
+ H.delete(l);
2077
+ }
2078
+ return r;
2079
+ }
2080
+ function Ua({
2081
+ source: e,
2082
+ options: t,
2083
+ onError: a,
2084
+ onReady: o,
2085
+ fallback: n = null,
2086
+ retainPrevious: i = !1,
2087
+ ...r
2088
+ }) {
2089
+ const l = de(() => za(t), [t]), s = l ?? t ?? null, f = _(a);
2090
+ f.current = a;
2091
+ const b = _(o);
2092
+ b.current = o;
2093
+ const [c, y] = B({});
2094
+ Z(() => {
2095
+ let v = !0;
2096
+ return i || y({ source: e, optionsIdentity: s }), Oa(e, t, l).then((w) => {
2097
+ v && y({ source: e, optionsIdentity: s, prepared: w });
2098
+ }).catch((w) => {
2099
+ v && (f.current?.(w), i || y({ source: e, optionsIdentity: s }));
2100
+ }), () => {
2101
+ v = !1;
2102
+ };
2103
+ }, [e, s, i]);
2104
+ const m = c.source === e && Object.is(c.optionsIdentity, s) && !!c.prepared;
2105
+ return Z(() => {
2106
+ m && b.current?.();
2107
+ }, [m, c.prepared]), m ? c.prepared ? /* @__PURE__ */ d(Xe, { document: c.prepared.document, "data-df-runtime": "react", ...r }) : n : i && c.prepared ? /* @__PURE__ */ d(Xe, { document: c.prepared.document, "data-df-runtime": "react", ...r }) : n;
2108
+ }
2109
+ export {
2110
+ S as D,
2111
+ Ua as M,
2112
+ Aa as a,
2113
+ Xe as b,
2114
+ Ga as c,
2115
+ ta as s
2116
+ };