@mcp-use/inspector 20.0.0-beta.1 → 20.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/README.md +5 -0
  2. package/dist/cdn/{AnimatePresence-B4HhIdgq.js → AnimatePresence-Dcw-FOy8.js} +50 -50
  3. package/dist/cdn/ChatTab-BS5Tlm2y.js +6744 -0
  4. package/dist/cdn/{CheckboxIndicator-BF2cKfbA.js → CheckboxIndicator-Bt4IICtv.js} +77 -77
  5. package/dist/cdn/{ConnectionSettingsForm-BNS6bOMD.js → ConnectionSettingsForm-BFsZpwK4.js} +348 -292
  6. package/dist/cdn/ConnectionSettingsTab-DDk06dhT.js +150 -0
  7. package/dist/cdn/{ElicitationTab-upPXq2q7.js → ElicitationTab-CL1KJ0bz.js} +39 -39
  8. package/dist/cdn/{FormContext-Cl51-7O7.js → FormContext-tmgN_Vdr.js} +1 -1
  9. package/dist/cdn/{InspectorContext-DzXtgyTx.js → InspectorContext-UjtEbNod.js} +1 -21
  10. package/dist/cdn/{JSONDisplay-D3RcyO9z.js → JSONDisplay-BFxf5oEu.js} +18 -18
  11. package/dist/cdn/{ListTabHeader-8lULn-90.js → ListTabHeader-Cv-GmtGF.js} +19 -19
  12. package/dist/cdn/{ManufactOAuthCallback-DEM8mhWD.js → ManufactOAuthCallback-B98kSYCj.js} +1 -1
  13. package/dist/cdn/MarkdownRenderer-_aYcof42.js +3610 -0
  14. package/dist/cdn/{NotificationsTab-CWopTIzT.js → NotificationsTab-CeImSrhx.js} +13 -13
  15. package/dist/cdn/{OAuthCallback-k3oeLtIC.js → OAuthCallback-C4n2hqKU.js} +1 -1
  16. package/dist/cdn/PromptsTab-BajHFLa3.js +901 -0
  17. package/dist/cdn/{ResourcesTab-KfamsM6-.js → ResourcesTab-BgeMlTdR.js} +35 -55
  18. package/dist/cdn/{SamplingTab-vcufuK24.js → SamplingTab-CnJB229N.js} +35 -35
  19. package/dist/cdn/{ServerMetadataTab-DS0eiyyD.js → ServerMetadataTab-CvrKX8fz.js} +12 -12
  20. package/dist/cdn/{StatusIcon-BGXOEU2u.js → StatusIcon-D0-ARyOh.js} +6 -6
  21. package/dist/cdn/{ToolsTab-DRjcZnpu.js → ToolsTab-ACLxPxR6.js} +103 -137
  22. package/dist/cdn/{ViewPreview-B_onhcUB.js → ViewPreview-DsPwZAwO.js} +2 -2
  23. package/dist/cdn/{WidgetWrapper-D29YDxIu.js → WidgetWrapper-CwlpDv17.js} +529 -530
  24. package/dist/cdn/card-DgiYnSg-.js +41 -0
  25. package/dist/cdn/{checkbox-B4oUG6Rr.js → checkbox-By0FklhG.js} +6 -6
  26. package/dist/cdn/{dialog-Dnl-pZsY.js → dialog-BsDpuJd3.js} +151 -151
  27. package/dist/cdn/{dist-mRDqCgKU.js → dist-B0eL32Gb.js} +114 -113
  28. package/dist/cdn/{dist-DjXr_YO3.js → dist-DaMB0Su9.js} +1 -1
  29. package/dist/cdn/{index-browser-CVUwR-Bu.js → index-browser-QDjRGsPo.js} +1 -1
  30. package/dist/cdn/{input-BLxOA7V-.js → input-C2OBd4PJ.js} +4787 -2842
  31. package/dist/cdn/inspector.css +1 -1
  32. package/dist/cdn/inspector.js +7419 -7445
  33. package/dist/cdn/{label-CBvG613A.js → label-B9Jmm9be.js} +10 -10
  34. package/dist/cdn/{manufact-auth-0TVxpeTA.js → manufact-auth-BQMHhbLV.js} +142 -106
  35. package/dist/cdn/{not-found-BcNNsTjS.js → not-found-DEtSM_Wd.js} +7 -7
  36. package/dist/cdn/providerMeta-BQIfHuNL.js +379 -0
  37. package/dist/cdn/{react-BxO-uEDZ.js → react-Dn8PWXwP.js} +1 -1
  38. package/dist/cdn/{select-BZ_IoKxg.js → select-DDdiIPR2.js} +726 -726
  39. package/dist/cdn/{shared-uMiV6Fx1.js → shared-DaILIQPP.js} +29 -29
  40. package/dist/cdn/{popover-C_SSrXT0.js → sheet-Br_l2kry.js} +694 -622
  41. package/dist/cdn/{spinner-CWcJhIY_.js → spinner-jQtC7EBj.js} +5 -5
  42. package/dist/cdn/{switch-DtQOLb9R.js → switch-C3IyQuid.js} +104 -104
  43. package/dist/cdn/{tabs-subtle-C5cy35sY.js → tabs-subtle-CkdI6Mac.js} +147 -147
  44. package/dist/cdn/{telemetry-Ct6pVkM1.js → telemetry-gHF-tMli.js} +3 -3
  45. package/dist/cdn/{textarea-Bj-CT7hC.js → textarea-DSbwcFVt.js} +6 -6
  46. package/dist/cdn/{useAriaLabelledBy-Bm9qHGK6.js → useAriaLabelledBy-DqAdnppm.js} +1 -1
  47. package/dist/cdn/{useCompositeItem-CNJ6MXdi.js → useCompositeItem-BRqEzYh-.js} +2 -2
  48. package/dist/cdn/{useConfig-CwxZ6Quj.js → useConfig-BWcNCqwi.js} +73 -46
  49. package/dist/cdn/{useViewHostProps-Dr6W2ooF.js → useViewHostProps-DIIlz3tJ.js} +1 -1
  50. package/dist/cli.js +27 -13
  51. package/dist/client/auth/manufact-auth.d.ts +3 -1
  52. package/dist/client/auth/manufact-auth.d.ts.map +1 -1
  53. package/dist/client/components/ChatTab.d.ts +1 -8
  54. package/dist/client/components/ChatTab.d.ts.map +1 -1
  55. package/dist/client/components/ResourcesTab.d.ts.map +1 -1
  56. package/dist/client/components/chat/ChatHeader.d.ts +7 -2
  57. package/dist/client/components/chat/ChatHeader.d.ts.map +1 -1
  58. package/dist/client/components/chat/ChatLandingForm.d.ts +4 -2
  59. package/dist/client/components/chat/ChatLandingForm.d.ts.map +1 -1
  60. package/dist/client/components/chat/ChatManagedNotice.d.ts +10 -0
  61. package/dist/client/components/chat/ChatManagedNotice.d.ts.map +1 -0
  62. package/dist/client/components/chat/ChatScrollTopFade.d.ts +7 -0
  63. package/dist/client/components/chat/ChatScrollTopFade.d.ts.map +1 -0
  64. package/dist/client/components/chat/ConfigurationDialog.d.ts +11 -9
  65. package/dist/client/components/chat/ConfigurationDialog.d.ts.map +1 -1
  66. package/dist/client/components/chat/ConfigureEmptyState.d.ts +1 -6
  67. package/dist/client/components/chat/ConfigureEmptyState.d.ts.map +1 -1
  68. package/dist/client/components/chat/StreamingAssistantContent.d.ts.map +1 -1
  69. package/dist/client/components/chat/chatModeStorage.d.ts +11 -0
  70. package/dist/client/components/chat/chatModeStorage.d.ts.map +1 -0
  71. package/dist/client/components/chat/managedChatNotice.d.ts +16 -0
  72. package/dist/client/components/chat/managedChatNotice.d.ts.map +1 -0
  73. package/dist/client/components/chat/providerMeta.d.ts +11 -0
  74. package/dist/client/components/chat/providerMeta.d.ts.map +1 -1
  75. package/dist/client/components/chat/useChatMessages.d.ts +7 -5
  76. package/dist/client/components/chat/useChatMessages.d.ts.map +1 -1
  77. package/dist/client/components/chat/useChatMessagesClientSide.d.ts +4 -6
  78. package/dist/client/components/chat/useChatMessagesClientSide.d.ts.map +1 -1
  79. package/dist/client/components/chat/useChatScrollToBottom.d.ts +1 -0
  80. package/dist/client/components/chat/useChatScrollToBottom.d.ts.map +1 -1
  81. package/dist/client/components/chat/useConfig.d.ts +1 -1
  82. package/dist/client/components/chat/useConfig.d.ts.map +1 -1
  83. package/dist/client/components/chat/useHostedChatMode.d.ts +1 -1
  84. package/dist/client/components/chat/useHostedChatMode.d.ts.map +1 -1
  85. package/dist/client/components/shared/MarkdownRenderer.d.ts +2 -1
  86. package/dist/client/components/shared/MarkdownRenderer.d.ts.map +1 -1
  87. package/dist/client/components/tools/useToolsTabNavigation.d.ts.map +1 -1
  88. package/dist/client/components/ui/MeshGradientCanvas.d.ts +13 -0
  89. package/dist/client/components/ui/MeshGradientCanvas.d.ts.map +1 -0
  90. package/dist/client/components/ui/chat-message.d.ts +1 -1
  91. package/dist/client/components/ui/chat-message.d.ts.map +1 -1
  92. package/dist/client/components/ui/file-thumbnail.d.ts.map +1 -1
  93. package/dist/client/components/ui/mesh-tab-background.d.ts +3 -1
  94. package/dist/client/components/ui/mesh-tab-background.d.ts.map +1 -1
  95. package/dist/client/context/InspectorContext.d.ts.map +1 -1
  96. package/dist/client/index.js +2577 -2165
  97. package/dist/client/telemetry/utils.d.ts.map +1 -1
  98. package/dist/server/asset-urls.d.ts +4 -0
  99. package/dist/server/asset-urls.d.ts.map +1 -1
  100. package/dist/server/asset-urls.js +7 -3
  101. package/dist/server/cdn-shell.d.ts.map +1 -1
  102. package/dist/server/cdn-shell.js +3 -3
  103. package/dist/server/{chunk-KBVKS4J5.js → chunk-H6ZCIKBS.js} +10 -0
  104. package/dist/server/{chunk-Y2GBQOQW.js → chunk-H7UBATRR.js} +2 -9
  105. package/dist/server/{chunk-VDUV6LR6.js → chunk-HGPQON3P.js} +15 -4
  106. package/dist/server/{chunk-K2V2SDQD.js → chunk-OWR2BIBW.js} +1 -1
  107. package/dist/server/{chunk-5B3SXGZP.js → chunk-UJLXHNQP.js} +1 -1
  108. package/dist/server/{chunk-IXYK6ZOY.js → chunk-W3PVQLOP.js} +2 -2
  109. package/dist/server/{chunk-6XWDZEFF.js → chunk-XCNS5CIW.js} +8 -3
  110. package/dist/server/cli.js +5 -5
  111. package/dist/server/create-dev-api-app.js +3 -3
  112. package/dist/server/dev-callback-redirect.d.ts +3 -0
  113. package/dist/server/dev-callback-redirect.d.ts.map +1 -0
  114. package/dist/server/dev-callback-redirect.js +18 -0
  115. package/dist/server/index.js +6 -6
  116. package/dist/server/middleware.js +6 -6
  117. package/dist/server/proxy/index.js +1 -1
  118. package/dist/server/proxy/mcp-proxy.d.ts +2 -0
  119. package/dist/server/proxy/mcp-proxy.d.ts.map +1 -1
  120. package/dist/server/proxy/mcp-proxy.js +3 -1
  121. package/dist/server/proxy-routes.js +2 -2
  122. package/dist/server/server.js +3 -3
  123. package/dist/server/version.js +1 -1
  124. package/dist/server/vite-dev-api-plugin.js +3 -3
  125. package/dist/web/assets/{AnimatePresence-CthXziG2.js → AnimatePresence-C5p0yiY1.js} +2 -2
  126. package/dist/web/assets/ChatTab-C2FtENBM.js +18 -0
  127. package/dist/web/assets/ConnectionSettingsTab-B2sUjytG.js +1 -0
  128. package/dist/web/assets/ElicitationTab-DwH08kDC.js +1 -0
  129. package/dist/web/assets/{FormContext-Cqc_A12u.js → FormContext-DH2caWKO.js} +1 -1
  130. package/dist/web/assets/ListTabHeader-R17w_JsB.js +1 -0
  131. package/dist/web/assets/{ManufactOAuthCallback-DCLbW-mz.js → ManufactOAuthCallback-Btu4B6u6.js} +1 -1
  132. package/dist/web/assets/MarkdownRenderer-DpIEt9wb.js +47 -0
  133. package/dist/web/assets/{NotificationsTab-JevzvJTg.js → NotificationsTab-CHB8mtSz.js} +1 -1
  134. package/dist/web/assets/{OAuthCallback-BjcRxLh5.js → OAuthCallback-DV4MgX4Z.js} +1 -1
  135. package/dist/web/assets/PromptsTab-0GIapoSs.js +15 -0
  136. package/dist/web/assets/ResourcesTab-N9xjsI_b.js +2 -0
  137. package/dist/web/assets/SamplingTab-Dw0vpi4t.js +1 -0
  138. package/dist/web/assets/ServerMetadataTab-D-eQpLBF.js +1 -0
  139. package/dist/web/assets/ToolsTab-BMrMJ5JV.js +8 -0
  140. package/dist/web/assets/ViewPreview-N_cpEO0W.js +1 -0
  141. package/dist/web/assets/WidgetWrapper-pDgNVq9y.js +34 -0
  142. package/dist/web/assets/checkbox-CrnXSMh2.js +1 -0
  143. package/dist/web/assets/dist-CeWSydFI.js +21 -0
  144. package/dist/web/assets/index-Cfuv_gb3.js +475 -0
  145. package/dist/web/assets/index-fBX3akc8.css +1 -0
  146. package/dist/web/assets/input-CLYhA7PK.js +1 -0
  147. package/dist/web/assets/{label-B5Q_Zr8M.js → label-Cdim77Jw.js} +1 -1
  148. package/dist/web/assets/select-CJ57-Bor.js +1 -0
  149. package/dist/web/assets/shared-B1GD9FMm.js +1 -0
  150. package/dist/web/assets/{tabs-subtle-AkJZvdxS.js → tabs-subtle-CG5cjC_N.js} +1 -1
  151. package/dist/web/assets/textarea-DLAmNVf_.js +1 -0
  152. package/dist/web/assets/useConfig-BTp15Lle.js +1 -0
  153. package/dist/web/assets/{useViewHostProps-DXAD1g7g.js → useViewHostProps-BQlaFC2Q.js} +1 -1
  154. package/dist/web/index.html +8 -9
  155. package/package.json +5 -12
  156. package/dist/cdn/ChatTab-D8uwCHAf.js +0 -13218
  157. package/dist/cdn/ConnectionSettingsTab-B97gPPJW.js +0 -145
  158. package/dist/cdn/PromptsTab-Cspfnl6n.js +0 -4400
  159. package/dist/cdn/bundle-mjs-B0nmHDtp.js +0 -1953
  160. package/dist/cdn/card-DqjqAq0o.js +0 -41
  161. package/dist/cdn/chunk-BO2N2NFS-Cy167e0X.js +0 -17500
  162. package/dist/cdn/highlighted-body-OFNGDK62-CoReNbTX.js +0 -36
  163. package/dist/cdn/mermaid-GHXKKRXX-DgVIbk-D.js +0 -2
  164. package/dist/cdn/pdf-CxFT9FER.js +0 -16291
  165. package/dist/cdn/sheet-CerCdhxz.js +0 -78
  166. package/dist/cdn/useHostedSession-BA39Aegc.js +0 -153
  167. package/dist/cdn/useMCPPrompts-D3_Hla_z.js +0 -104
  168. package/dist/client/components/chat/streamdown-code-slim.d.ts +0 -4
  169. package/dist/client/components/chat/streamdown-code-slim.d.ts.map +0 -1
  170. package/dist/web/assets/ChatTab-Cy8eyFYI.js +0 -460
  171. package/dist/web/assets/ConnectionSettingsTab-sDZGaUJn.js +0 -1
  172. package/dist/web/assets/ElicitationTab-wDKgU1qL.js +0 -1
  173. package/dist/web/assets/ListTabHeader-G-nQX18m.js +0 -1
  174. package/dist/web/assets/PromptsTab-DsQVOjKH.js +0 -61
  175. package/dist/web/assets/ResourcesTab-Bw8_p6M1.js +0 -2
  176. package/dist/web/assets/SamplingTab-BrcF1zJF.js +0 -1
  177. package/dist/web/assets/ServerMetadataTab-Bydeh1Po.js +0 -1
  178. package/dist/web/assets/ToolsTab-DJWF7Q_x.js +0 -8
  179. package/dist/web/assets/ViewPreview-jgeU7bY9.js +0 -1
  180. package/dist/web/assets/WidgetWrapper-B_vJU9uF.js +0 -34
  181. package/dist/web/assets/bundle-mjs-8puS6ou7.js +0 -1
  182. package/dist/web/assets/checkbox-BA-XURSj.js +0 -1
  183. package/dist/web/assets/chunk-BO2N2NFS-CGbd3eLY.js +0 -131
  184. package/dist/web/assets/dist-BcAQZluc.js +0 -21
  185. package/dist/web/assets/highlighted-body-OFNGDK62-BBJFbIMp.js +0 -1
  186. package/dist/web/assets/index-BjH-Qp85.css +0 -1
  187. package/dist/web/assets/index-D2UxaT9v.js +0 -475
  188. package/dist/web/assets/input-CjmxOFr6.js +0 -1
  189. package/dist/web/assets/mermaid-GHXKKRXX-B4MKVODA.js +0 -1
  190. package/dist/web/assets/pdf-CuwKm9zO.js +0 -54
  191. package/dist/web/assets/select-C0xlfLAa.js +0 -1
  192. package/dist/web/assets/shared-DQE60Op-.js +0 -1
  193. package/dist/web/assets/sheet-7TIkLdpr.js +0 -1
  194. package/dist/web/assets/textarea-Ci09-en6.js +0 -1
  195. package/dist/web/assets/useConfig-Qglo4xs1.js +0 -1
  196. package/dist/web/assets/useMCPPrompts-USLYc1I4.js +0 -1
@@ -0,0 +1,3610 @@
1
+ import { s as e, t } from "./react-BIs9pQ3H.js";
2
+ import { Rr as n } from "./input-C2OBd4PJ.js";
3
+ import { t as r } from "./jsx-runtime-CIxvMpEo.js";
4
+ import { a as i, i as a, t as o } from "./browser-CbQIH4w2.js";
5
+ import { t as s, u as c } from "./telemetry-gHF-tMli.js";
6
+ import { t as l } from "./checkbox-By0FklhG.js";
7
+ //#region src/client/hooks/useMCPPrompts.ts
8
+ var u = /* @__PURE__ */ e(t(), 1);
9
+ function d({ prompts: e, callPrompt: t, serverId: n }) {
10
+ let [r, i] = (0, u.useState)(null), [a, o] = (0, u.useState)({}), [l, d] = (0, u.useState)([]), [f, p] = (0, u.useState)(!1), [m, h] = (0, u.useState)(""), g = (0, u.useMemo)(() => {
11
+ if (!m.trim()) return e;
12
+ let t = m.toLowerCase();
13
+ return e.filter((e) => e.name.toLowerCase().includes(t) || e.description?.toLowerCase().includes(t));
14
+ }, [e, m]), _ = (0, u.useCallback)((e) => {
15
+ i(e);
16
+ let t = {};
17
+ e.arguments && e.arguments.forEach((e) => {
18
+ t[e.name] = "";
19
+ }), o(t);
20
+ }, []), v = (0, u.useCallback)((e, t) => {
21
+ o((n) => ({
22
+ ...n,
23
+ [e]: t
24
+ }));
25
+ }, []), y = (0, u.useCallback)(async (e, r) => {
26
+ if (f) return;
27
+ p(!0);
28
+ let i = Date.now();
29
+ try {
30
+ let a = await t(e.name, r), o = Date.now() - i;
31
+ s(new c({
32
+ promptName: e.name,
33
+ serverId: n,
34
+ success: !0
35
+ })).catch(() => {}), d((t) => [{
36
+ promptName: e.name,
37
+ args: r,
38
+ result: a,
39
+ timestamp: i,
40
+ duration: o
41
+ }, ...t]);
42
+ } catch (t) {
43
+ s(new c({
44
+ promptName: e.name,
45
+ serverId: n,
46
+ success: !1,
47
+ error: t instanceof Error ? t.message : "Unknown error"
48
+ })).catch(() => {});
49
+ let a = t instanceof Error ? t.message : String(t), o = {
50
+ promptName: e.name,
51
+ args: r,
52
+ result: {
53
+ error: a,
54
+ isError: !0
55
+ },
56
+ error: a,
57
+ timestamp: i,
58
+ duration: Date.now() - i
59
+ };
60
+ d((e) => [o, ...e]);
61
+ } finally {
62
+ p(!1);
63
+ }
64
+ }, [
65
+ f,
66
+ t,
67
+ n
68
+ ]), b = (0, u.useCallback)((e) => {
69
+ d((t) => t.filter((t, n) => n !== e));
70
+ }, []), x = (0, u.useCallback)(() => {
71
+ d([]);
72
+ }, []);
73
+ return (0, u.useEffect)(() => {
74
+ if (r) {
75
+ let t = e.find((e) => e.name === r.name);
76
+ if (!t) {
77
+ i(null);
78
+ return;
79
+ }
80
+ t !== r && (JSON.stringify(t.arguments) !== JSON.stringify(r.arguments) || t.description !== r.description) && i(t);
81
+ }
82
+ }, [e, r]), {
83
+ filteredPrompts: g,
84
+ selectedPrompt: r,
85
+ setSelectedPrompt: i,
86
+ results: l,
87
+ handleDeleteResult: b,
88
+ promptArgs: a,
89
+ setPromptArgs: o,
90
+ isExecuting: f,
91
+ handlePromptSelect: _,
92
+ handleArgChange: v,
93
+ executePrompt: y,
94
+ executeSelectedPrompt: (0, u.useCallback)(async () => {
95
+ !r || f || y(r, a);
96
+ }, [
97
+ r,
98
+ a,
99
+ f,
100
+ y
101
+ ]),
102
+ searchQuery: m,
103
+ setSearchQuery: h,
104
+ clearPromptResults: x
105
+ };
106
+ }
107
+ //#endregion
108
+ //#region ../../node_modules/.pnpm/markdown-to-jsx@9.7.5_react@19.2.4/node_modules/markdown-to-jsx/dist/entities.browser.js
109
+ var f;
110
+ function p(e) {
111
+ if (!f) if (typeof document < "u") f = document.createElement("textarea");
112
+ else return;
113
+ var t = "&" + e + ";";
114
+ f.innerHTML = t;
115
+ var n = f.value;
116
+ return n === t ? void 0 : n;
117
+ }
118
+ //#endregion
119
+ //#region ../../node_modules/.pnpm/markdown-to-jsx@9.7.5_react@19.2.4/node_modules/markdown-to-jsx/dist/index.js
120
+ var m = 32, h = 9, g = 13, _ = 10, v = 96, y = 126, b = 91, x = 94, S = 62, C = 35, w = 36, T = 37, E = 45, D = 61, O = 92, k = 42, A = 95, j = 60, M = 64, N = 93, P = 33, F = 38, I = 58, L = 70, R = 102, ee = 104, te = 119, z = 116, ne = 112, re = 115, ie = 160, ae = 12, oe = 44, se = 59, ce = 63, le = 46, ue = 47, de = 39, fe = 34, pe = 43, B = 124, me = 123, he = 125, ge = 40, _e = 41, ve = 30, ye = 31, V = 48, H = 57, U = 65, W = 90, G = 97, K = 122, be = 128, q = 32, J = {
121
+ blockQuote: 0,
122
+ breakLine: 1,
123
+ breakThematic: 2,
124
+ codeBlock: 3,
125
+ codeInline: 4,
126
+ footnote: 5,
127
+ footnoteReference: 6,
128
+ frontmatter: 7,
129
+ gfmTask: 8,
130
+ heading: 9,
131
+ htmlBlock: 10,
132
+ htmlComment: 11,
133
+ htmlSelfClosing: 12,
134
+ image: 13,
135
+ link: 14,
136
+ orderedList: 15,
137
+ paragraph: 16,
138
+ ref: 17,
139
+ refCollection: 18,
140
+ table: 19,
141
+ text: 20,
142
+ textFormatted: 21,
143
+ unorderedList: 22
144
+ };
145
+ function xe(e) {
146
+ if (!Ne(e, "---")) return null;
147
+ let t = 3;
148
+ for (; t < e.length && (e[t] === " " || e[t] === " ");) t++;
149
+ if (t < e.length && e[t] === "\r" && t++, t >= e.length || e[t] !== "\n") return null;
150
+ t++;
151
+ let n = !1;
152
+ for (; t < e.length;) {
153
+ let r = t;
154
+ for (; t < e.length && e[t] !== "\n" && e[t] !== "\r";) t++;
155
+ if (t >= e.length) break;
156
+ let i = t;
157
+ if (e[t] === "\r" && t++, t < e.length && e[t] === "\n" && t++, Ne(e, "---", r)) return {
158
+ endPos: t,
159
+ hasValidYaml: n
160
+ };
161
+ let a = e.indexOf(":", r);
162
+ a !== -1 && a < i && (n = !0);
163
+ }
164
+ return null;
165
+ }
166
+ var Se = /&([a-zA-Z0-9]+|#[0-9]{1,7}|#x[0-9a-fA-F]{1,6});/gi, Ce = {
167
+ class: "className",
168
+ for: "htmlFor",
169
+ allowfullscreen: "allowFullScreen",
170
+ allowtransparency: "allowTransparency",
171
+ autocomplete: "autoComplete",
172
+ autofocus: "autoFocus",
173
+ autoplay: "autoPlay",
174
+ cellpadding: "cellPadding",
175
+ cellspacing: "cellSpacing",
176
+ charset: "charSet",
177
+ classid: "classId",
178
+ colspan: "colSpan",
179
+ contenteditable: "contentEditable",
180
+ contextmenu: "contextMenu",
181
+ crossorigin: "crossOrigin",
182
+ enctype: "encType",
183
+ formaction: "formAction",
184
+ formenctype: "formEncType",
185
+ formmethod: "formMethod",
186
+ formnovalidate: "formNoValidate",
187
+ formtarget: "formTarget",
188
+ frameborder: "frameBorder",
189
+ hreflang: "hrefLang",
190
+ inputmode: "inputMode",
191
+ keyparams: "keyParams",
192
+ keytype: "keyType",
193
+ marginheight: "marginHeight",
194
+ marginwidth: "marginWidth",
195
+ maxlength: "maxLength",
196
+ mediagroup: "mediaGroup",
197
+ minlength: "minLength",
198
+ novalidate: "noValidate",
199
+ radiogroup: "radioGroup",
200
+ readonly: "readOnly",
201
+ rowspan: "rowSpan",
202
+ spellcheck: "spellCheck",
203
+ srcdoc: "srcDoc",
204
+ srclang: "srcLang",
205
+ srcset: "srcSet",
206
+ tabindex: "tabIndex",
207
+ usemap: "useMap",
208
+ viewbox: "viewBox"
209
+ };
210
+ function we(e) {
211
+ var t = {};
212
+ for (var n in e) {
213
+ var r = Ce[n.toLowerCase()];
214
+ if (r) t[r] = e[n];
215
+ else {
216
+ var i = n.indexOf(":");
217
+ i === -1 ? t[n] = e[n] : t[n.slice(0, i) + n[i + 1].toUpperCase() + n.slice(i + 2)] = e[n];
218
+ }
219
+ }
220
+ return t;
221
+ }
222
+ var Te = /(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s|^<(div|p|h[1-6]|ul|ol|li|blockquote|pre|table|thead|tbody|tr|td|th|dl|dt|dd|hr|address|article|aside|details|dialog|figure|figcaption|footer|form|header|main|menu|nav|section|summary|textarea|fieldset|legend|center|dir|hgroup|marquee|search|output|template)\b)/i;
223
+ function Y(e) {
224
+ return e.indexOf("&") === -1 ? e : e.replace(Se, (e, t) => {
225
+ var n = p(t);
226
+ if (n) return n;
227
+ if (t[0] === "#") {
228
+ var r = t[1] === "x" || t[1] === "X" ? parseInt(t.slice(2), 16) : parseInt(t.slice(1), 10);
229
+ return r === 0 || r >= 55296 && r <= 57343 || r > 1114111 ? "�" : r <= 65535 ? String.fromCharCode(r) : String.fromCharCode(55296 + (r - 65536 >> 10), 56320 + (r - 65536 & 1023));
230
+ }
231
+ return e;
232
+ });
233
+ }
234
+ var Ee = /(javascript|vbscript|data(?!:image)):/i;
235
+ function De(e) {
236
+ if (Ee.test(e)) return null;
237
+ if (e.indexOf("%") === -1) return e;
238
+ try {
239
+ let t = decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g, "");
240
+ if (Ee.test(t)) return null;
241
+ } catch {
242
+ return null;
243
+ }
244
+ return e;
245
+ }
246
+ var Oe = {}, ke, Ae;
247
+ for (ke = [
248
+ 192,
249
+ 193,
250
+ 194,
251
+ 195,
252
+ 196,
253
+ 197,
254
+ 224,
255
+ 225,
256
+ 226,
257
+ 227,
258
+ 228,
259
+ 229,
260
+ 230,
261
+ 198
262
+ ], Ae = 0; Ae < ke.length; Ae++) Oe[ke[Ae]] = "a";
263
+ for (Oe[231] = Oe[199] = "c", Oe[240] = Oe[208] = "d", ke = [
264
+ 200,
265
+ 201,
266
+ 202,
267
+ 203,
268
+ 233,
269
+ 232,
270
+ 234,
271
+ 235
272
+ ], Ae = 0; Ae < ke.length; Ae++) Oe[ke[Ae]] = "e";
273
+ for (ke = [
274
+ 207,
275
+ 239,
276
+ 206,
277
+ 238,
278
+ 205,
279
+ 237,
280
+ 204,
281
+ 236
282
+ ], Ae = 0; Ae < ke.length; Ae++) Oe[ke[Ae]] = "i";
283
+ for (Oe[209] = Oe[241] = "n", ke = [
284
+ 248,
285
+ 216,
286
+ 339,
287
+ 338,
288
+ 213,
289
+ 245,
290
+ 212,
291
+ 244,
292
+ 211,
293
+ 243,
294
+ 210,
295
+ 242
296
+ ], Ae = 0; Ae < ke.length; Ae++) Oe[ke[Ae]] = "o";
297
+ for (ke = [
298
+ 220,
299
+ 252,
300
+ 219,
301
+ 251,
302
+ 218,
303
+ 250,
304
+ 217,
305
+ 249
306
+ ], Ae = 0; Ae < ke.length; Ae++) Oe[ke[Ae]] = "u";
307
+ Oe[376] = Oe[255] = Oe[221] = Oe[253] = "y";
308
+ function je(e) {
309
+ return e < be && (qe[e] & (Re | ze)) !== 0;
310
+ }
311
+ function Me(e) {
312
+ for (var t = "", n = -1, r = 0; r < e.length; r++) {
313
+ var i = e.charCodeAt(r);
314
+ if (je(i)) i >= U && i <= W ? (n >= 0 && (t += e.slice(n, r), n = -1), t += String.fromCharCode(i + q)) : n < 0 && (n = r);
315
+ else if (i === m || i === E) n >= 0 && (t += e.slice(n, r), n = -1), t += "-";
316
+ else {
317
+ n >= 0 && (t += e.slice(n, r), n = -1);
318
+ var a = Oe[i];
319
+ a && (t += a);
320
+ }
321
+ }
322
+ return n >= 0 && (t += e.slice(n)), t;
323
+ }
324
+ function Ne(e, t, n) {
325
+ return e.startsWith(t, n);
326
+ }
327
+ var Pe = new Set([
328
+ "area",
329
+ "base",
330
+ "br",
331
+ "col",
332
+ "embed",
333
+ "hr",
334
+ "img",
335
+ "input",
336
+ "link",
337
+ "meta",
338
+ "param",
339
+ "source",
340
+ "track",
341
+ "wbr",
342
+ "circle",
343
+ "ellipse",
344
+ "line",
345
+ "path",
346
+ "polygon",
347
+ "polyline",
348
+ "rect",
349
+ "use",
350
+ "stop",
351
+ "animate",
352
+ "set"
353
+ ]);
354
+ function Fe(e) {
355
+ let t = e.toLowerCase();
356
+ if (Pe.has(t)) return !0;
357
+ let n = t.indexOf(":");
358
+ return n === -1 ? !1 : (t = t.slice(n + 1), Pe.has(t));
359
+ }
360
+ var Ie = 1, Le = 2, Re = 4, ze = 8, Be = 16, Ve = 32, He = 64, Ue = 1, We = 2, Ge = 3, Ke = 4, qe = (function() {
361
+ let e = new Uint8Array(128), t;
362
+ for (e[h] = Ie | Ve, e[_] = Ie | Be, e[ae] = Ie, e[g] = Ie | Be, e[m] = Ie | Ve, t = P; t <= ue; t++) e[t] = Le;
363
+ for (t = I; t <= M; t++) e[t] = Le;
364
+ for (t = b; t <= v; t++) e[t] = Le;
365
+ for (t = me; t <= y; t++) e[t] = Le;
366
+ for (t = V; t <= H; t++) e[t] = ze;
367
+ for (t = U; t <= W; t++) e[t] = Re | He;
368
+ for (t = G; t <= K; t++) e[t] = Re;
369
+ return e;
370
+ })();
371
+ (function() {
372
+ let e = new Uint8Array(128);
373
+ return e[O] = We, e[b] = Ke, e[k] = e[A] = e[y] = e[D] = Ge, e[v] = e[j] = e[M] = e[N] = e[_] = e[m] = e[P] = Ue, e[R] = e[ee] = e[te] = Ue, e;
374
+ })();
375
+ var Je = [];
376
+ function Ye(e) {
377
+ var t = e.indexOf("\r"), n = e.indexOf("\0");
378
+ if (t === -1 && n === -1) return e;
379
+ var r = e.length;
380
+ Je.length = 0;
381
+ var i = 0, a = 0;
382
+ for (a = t === -1 ? n : n === -1 || t < n ? t : n; a < r; a++) {
383
+ var o = e.charCodeAt(a);
384
+ o === g ? (i < a && Je.push(e.slice(i, a)), a + 1 < r && e.charCodeAt(a + 1) === _ && a++, Je.push("\n"), i = a + 1) : o === 0 && (i < a && Je.push(e.slice(i, a)), Je.push("�"), i = a + 1);
385
+ }
386
+ return i < r && Je.push(e.slice(i)), Je.join("");
387
+ }
388
+ function Xe(e, t, n) {
389
+ for (var r = e, i = t.split("."), a = 0; a < i.length && (r = r?.[i[a]], r !== void 0);) a++;
390
+ return r || n;
391
+ }
392
+ function Ze(e) {
393
+ for (var t = !1, n = 0; n < e.length; n++) {
394
+ var r = e.charCodeAt(n);
395
+ if (r <= m || r === fe || r === T || r === j || r === S || r === b || r === O || r === N || r === x || r === v || r >= 123) {
396
+ t = !0;
397
+ break;
398
+ }
399
+ }
400
+ if (!t) return e;
401
+ for (var i = "", n = 0; n < e.length; n++) {
402
+ var r = e.charCodeAt(n);
403
+ if (r === T && n + 2 < e.length) {
404
+ var a = e.charCodeAt(n + 1), o = e.charCodeAt(n + 2);
405
+ if ((a >= V && a <= H || a >= U && a <= L || a >= G && a <= R) && (o >= V && o <= H || o >= U && o <= L || o >= G && o <= R)) {
406
+ i += e[n] + e[n + 1] + e[n + 2], n += 2;
407
+ continue;
408
+ }
409
+ }
410
+ i += encodeURI(e[n]);
411
+ }
412
+ return i;
413
+ }
414
+ function Qe(...e) {
415
+ return e.filter(Boolean).join(" ");
416
+ }
417
+ var $e = new Set([
418
+ "title",
419
+ "textarea",
420
+ "style",
421
+ "xmp",
422
+ "iframe",
423
+ "noembed",
424
+ "noframes",
425
+ "script",
426
+ "plaintext"
427
+ ]), et = /<(\/?)(title|textarea|style|xmp|iframe|noembed|noframes|script|plaintext)(\s|>|\/)/gi;
428
+ function tt(e) {
429
+ return $e.has(e.toLowerCase());
430
+ }
431
+ function nt(e) {
432
+ return et.lastIndex = 0, et.test(e);
433
+ }
434
+ function rt(e) {
435
+ return et.lastIndex = 0, e.replace(et, function(e, t, n, r) {
436
+ return "&lt;" + t + n + r;
437
+ });
438
+ }
439
+ var it = /^<([a-zA-Z][a-zA-Z0-9-]*)\s[^>]*>/, at = /^<[A-Z]/, ot = [
440
+ "script",
441
+ "pre",
442
+ "style",
443
+ "textarea"
444
+ ], st = new Set(ot), ct = /<(?:pre|script|style|textarea)\b/i, lt = new Set([
445
+ "table",
446
+ "thead",
447
+ "tbody",
448
+ "tfoot",
449
+ "tr",
450
+ "td",
451
+ "th"
452
+ ]), ut = new Uint8Array(128);
453
+ (function() {
454
+ for (var e = [
455
+ v,
456
+ k,
457
+ A,
458
+ y,
459
+ D,
460
+ b,
461
+ P,
462
+ j,
463
+ O,
464
+ ye,
465
+ ee,
466
+ te,
467
+ R
468
+ ], t = 0; t < e.length; t++) ut[e[t]] = 1;
469
+ })();
470
+ var dt = /([a-zA-Z_][a-zA-Z0-9_-]*)=(?:"([^"]*)"|'([^']*)')/g;
471
+ function ft(e) {
472
+ return st.has(e);
473
+ }
474
+ function pt(e) {
475
+ return ct.test(e);
476
+ }
477
+ function mt(e, t, n) {
478
+ for (var r = t, i = n; r < i && (e.charCodeAt(r) === m || e.charCodeAt(r) === h);) r++;
479
+ if (r >= i) return !1;
480
+ e.charCodeAt(r) === B && r++;
481
+ for (var a = 0; r < i;) {
482
+ for (; r < i && (e.charCodeAt(r) === m || e.charCodeAt(r) === h);) r++;
483
+ if (r >= i) break;
484
+ if (e.charCodeAt(r) === B && a > 0) {
485
+ for (var o = r + 1; o < i && (e.charCodeAt(o) === m || e.charCodeAt(o) === h);) o++;
486
+ if (o >= i) return !0;
487
+ }
488
+ if (e.charCodeAt(r) === I && r++, r >= i || e.charCodeAt(r) !== E) return !1;
489
+ for (; r < i && e.charCodeAt(r) === E;) r++;
490
+ for (r < i && e.charCodeAt(r) === I && r++, a++; r < i && (e.charCodeAt(r) === m || e.charCodeAt(r) === h);) r++;
491
+ if (r < i) if (e.charCodeAt(r) === B) r++;
492
+ else return !1;
493
+ }
494
+ return a > 0;
495
+ }
496
+ function ht(e, t) {
497
+ if (e.charCodeAt(t) !== j) return null;
498
+ let n = t + 1, r = e.length, i = !1;
499
+ e.charCodeAt(n) === ue && (n++, i = !0);
500
+ let a = n, o = e.charCodeAt(n);
501
+ if (!(o >= G && o <= K || o >= U && o <= W)) return null;
502
+ for (; n < r && (e.charCodeAt(n) >= G && e.charCodeAt(n) <= K || e.charCodeAt(n) >= U && e.charCodeAt(n) <= W || e.charCodeAt(n) >= V && e.charCodeAt(n) <= H || e.charCodeAt(n) === E);) n++;
503
+ let s = e.slice(a, n);
504
+ if (!s) return null;
505
+ let c = n;
506
+ for (; n < r && (e.charCodeAt(n) === m || e.charCodeAt(n) === h || e.charCodeAt(n) === _);) n++;
507
+ let l = e.slice(c, n);
508
+ if (n === c && n < r) {
509
+ var u = e.charCodeAt(n);
510
+ if (u !== S && u !== ue) return null;
511
+ }
512
+ let d = n, f = {}, p = !1;
513
+ for (; n < r;) {
514
+ let t = e.charCodeAt(n);
515
+ if (t === S) {
516
+ let t = e.slice(d, n);
517
+ return {
518
+ tag: s,
519
+ attrs: f,
520
+ selfClosing: !1,
521
+ end: n + 1,
522
+ rawAttrs: t,
523
+ whitespaceBeforeAttrs: l,
524
+ isClosing: i,
525
+ hasSpaceBeforeSlash: p
526
+ };
527
+ }
528
+ if (t === m || t === h || t === _) {
529
+ n++;
530
+ continue;
531
+ }
532
+ if (t === ue && n + 1 < r && e.charCodeAt(n + 1) === S) {
533
+ let t = e.slice(d, n);
534
+ return p = n > d && e.charCodeAt(n - 1) === m, {
535
+ tag: s,
536
+ attrs: f,
537
+ selfClosing: !0,
538
+ end: n + 2,
539
+ rawAttrs: t,
540
+ whitespaceBeforeAttrs: l,
541
+ isClosing: i,
542
+ hasSpaceBeforeSlash: p
543
+ };
544
+ }
545
+ var g = n, y = e.charCodeAt(n);
546
+ if (!(y >= G && y <= K || y >= U && y <= W || y === A || y === I)) return null;
547
+ for (n++; n < r;) {
548
+ var b = e.charCodeAt(n);
549
+ if (b >= G && b <= K || b >= U && b <= W || b >= V && b <= H || b === A || b === le || b === I || b === E) n++;
550
+ else break;
551
+ }
552
+ for (var x = e.slice(g, n); n < r && (e.charCodeAt(n) === m || e.charCodeAt(n) === h);) n++;
553
+ if (e.charCodeAt(n) !== D) {
554
+ f[x] = "";
555
+ continue;
556
+ }
557
+ for (n++; n < r && (e.charCodeAt(n) === m || e.charCodeAt(n) === h);) n++;
558
+ var C = e.charCodeAt(n);
559
+ if (C === fe || C === de) {
560
+ n++;
561
+ for (var w = n; n < r && e.charCodeAt(n) !== C;) n++;
562
+ if (n >= r) return null;
563
+ if (f[x] = e.slice(w, n), n++, n < r) {
564
+ var T = e.charCodeAt(n);
565
+ if (T !== m && T !== h && T !== _ && T !== S && T !== ue) return null;
566
+ }
567
+ } else if (C === me) {
568
+ var O = 1, w = n;
569
+ for (n++; n < r && O > 0;) {
570
+ var b = e.charCodeAt(n);
571
+ b === me ? O++ : b === he && O--, n++;
572
+ }
573
+ f[x] = e.slice(w, n);
574
+ } else {
575
+ for (var w = n; n < r;) {
576
+ var k = e.charCodeAt(n);
577
+ if (k === m || k === h || k === S || k === _ || k === fe || k === de || k === D || k === j || k === v) break;
578
+ n++;
579
+ }
580
+ if (n === w) return null;
581
+ f[x] = e.slice(w, n);
582
+ }
583
+ }
584
+ return null;
585
+ }
586
+ function gt(e, t, n) {
587
+ for (var r = 0, i = e.length, a = !1; r < i;) {
588
+ for (var o = e.indexOf("\n", r), s = o < 0 ? i : o, c = r, l = 0; c < s && l < 4;) if (e.charCodeAt(c) === m) l++, c++;
589
+ else if (e.charCodeAt(c) === h) l += 4, c++;
590
+ else break;
591
+ if (c >= s) {
592
+ a = !1, r = o < 0 ? i : o + 1;
593
+ continue;
594
+ }
595
+ if (l < 4) {
596
+ var u = e.charCodeAt(c);
597
+ if (u === v || u === y) {
598
+ for (var d = u, f = 0, p = c; p < s && e.charCodeAt(p) === d;) f++, p++;
599
+ if (f >= 3) {
600
+ a = !1;
601
+ for (var g = o < 0 ? i : o + 1; g < i;) {
602
+ for (var w = g, T = 0; w < i && T < 4;) {
603
+ var D = e.charCodeAt(w);
604
+ if (D === m) T++, w++;
605
+ else if (D === h) T += 4, w++;
606
+ else break;
607
+ }
608
+ if (T < 4 && w < i && e.charCodeAt(w) === d) {
609
+ for (var O = 0; w < i && e.charCodeAt(w) === d;) O++, w++;
610
+ if (O >= f) {
611
+ for (; w < i && (e.charCodeAt(w) === m || e.charCodeAt(w) === h);) w++;
612
+ if (w >= i || e.charCodeAt(w) === _) {
613
+ r = w >= i ? i : w + 1;
614
+ break;
615
+ }
616
+ }
617
+ }
618
+ for (; g < i && e.charCodeAt(g) !== _;) g++;
619
+ g < i && g++;
620
+ }
621
+ g >= i && (r = i);
622
+ continue;
623
+ }
624
+ }
625
+ }
626
+ for (var j = c; j < s && e.charCodeAt(j) === S;) {
627
+ j++, j < s && e.charCodeAt(j) === m && j++;
628
+ for (var M = 0; j < s && M < 4;) if (e.charCodeAt(j) === m) M++, j++;
629
+ else if (e.charCodeAt(j) === h) M += 4, j++;
630
+ else break;
631
+ if (M >= 4) break;
632
+ a = !1;
633
+ }
634
+ if (!a && l < 4 && j < s && e.charCodeAt(j) === b && !(j + 1 < i && e.charCodeAt(j + 1) === x)) {
635
+ var N = _t(e, j, t);
636
+ if (N) {
637
+ r = N, a = !1;
638
+ continue;
639
+ }
640
+ }
641
+ var P = e.charCodeAt(c);
642
+ if (P === C && l < 4) a = !1;
643
+ else if (l < 4 && (P === E || P === k || P === A)) {
644
+ for (var F = c, I = 0; F < s;) {
645
+ var L = e.charCodeAt(F);
646
+ if (L === P) I++;
647
+ else if (L !== m && L !== h) break;
648
+ F++;
649
+ }
650
+ a = !(I >= 3 && F >= s);
651
+ } else a = !0;
652
+ r = o < 0 ? i : o + 1;
653
+ }
654
+ }
655
+ function _t(e, t, n) {
656
+ let r = e.length;
657
+ if (e.charCodeAt(t) !== b) return null;
658
+ let i = t + 1 < r && e.charCodeAt(t + 1) === x, a = t + 1;
659
+ for (; a < r;) {
660
+ var o = e.charCodeAt(a);
661
+ if (o === N) {
662
+ a++;
663
+ break;
664
+ }
665
+ if (o === b) return null;
666
+ o === O && a + 1 < r && a++, a++;
667
+ }
668
+ if (a > r || e.charCodeAt(a - 1) !== N) return null;
669
+ let s = e.slice(t + 1, a - 1);
670
+ if (s.length > 999) return null;
671
+ let c = Tt(s);
672
+ if (!c || a >= r || e.charCodeAt(a) !== I) return null;
673
+ a++;
674
+ let l = !1;
675
+ for (; a < r;) {
676
+ let t = e.charCodeAt(a);
677
+ if (t === m || t === h) a++;
678
+ else if (t === _ && !l) l = !0, a++;
679
+ else break;
680
+ }
681
+ if (i) {
682
+ let t = e.indexOf("\n", a), i = t < 0 ? r : t;
683
+ return n[c] = {
684
+ target: e.slice(a, i).trim(),
685
+ title: void 0
686
+ }, t < 0 ? r : t + 1;
687
+ }
688
+ var u;
689
+ if (a < r && e.charCodeAt(a) === j) {
690
+ a++;
691
+ for (var d = a; a < r && e.charCodeAt(a) !== S && e.charCodeAt(a) !== _;) e.charCodeAt(a) === O && a + 1 < r && a++, a++;
692
+ if (a >= r || e.charCodeAt(a) !== S) return null;
693
+ u = e.slice(d, a), a++;
694
+ for (var f = e.indexOf("\n", a), p = f < 0 ? r : f, g = a; g < p && (e.charCodeAt(g) === m || e.charCodeAt(g) === h);) g++;
695
+ if (g < p) {
696
+ if (g === a) return null;
697
+ var v = e.charCodeAt(g);
698
+ if (v !== fe && v !== de && v !== ge) return null;
699
+ }
700
+ } else {
701
+ for (var d = a, y = 0; a < r;) {
702
+ var o = e.charCodeAt(a);
703
+ if (o === ge) y++;
704
+ else if (o === _e) {
705
+ if (y === 0) break;
706
+ y--;
707
+ } else {
708
+ if (o === m || o === h || o === _) break;
709
+ o === O && a + 1 < r && a++;
710
+ }
711
+ a++;
712
+ }
713
+ if (u = e.slice(d, a), !u) return null;
714
+ }
715
+ for (; a < r && (e.charCodeAt(a) === m || e.charCodeAt(a) === h);) a++;
716
+ var C = e.indexOf("\n", a), w = C < 0 ? r : C, T, E = !1, D = a, k = a;
717
+ if (a === w && a < r) for (k = a + 1; k < r && (e.charCodeAt(k) === m || e.charCodeAt(k) === h);) k++;
718
+ if (k < r) {
719
+ var A = e.charCodeAt(k);
720
+ if (A === fe || A === de || A === ge) {
721
+ for (var M = A === ge ? 41 : A, P = k + 1, F = P; P < r;) {
722
+ var L = e.charCodeAt(P);
723
+ if (L === M) {
724
+ for (var R = P + 1; R < r && (e.charCodeAt(R) === m || e.charCodeAt(R) === h);) R++;
725
+ (R >= r || e.charCodeAt(R) === _) && (T = e.slice(F, P), E = !0, D = R < r ? R + 1 : r);
726
+ break;
727
+ }
728
+ if (L === O && P + 1 < r) {
729
+ P += 2;
730
+ continue;
731
+ }
732
+ if (L === _ && P + 1 < r && e.charCodeAt(P + 1) === _) break;
733
+ P++;
734
+ }
735
+ if (!E && k === a) return null;
736
+ }
737
+ }
738
+ if (E) return n[c] || (n[c] = {
739
+ target: Dt(u),
740
+ title: T === void 0 ? T : Y(Dt(T))
741
+ }), D;
742
+ for (; a < w && (e.charCodeAt(a) === m || e.charCodeAt(a) === h);) a++;
743
+ return a < w ? null : (n[c] || (n[c] = {
744
+ target: Dt(u),
745
+ title: T
746
+ }), C < 0 ? r : C + 1);
747
+ }
748
+ var vt = 1, yt = 2, X = 4, bt = 8, xt = 16, St = 32, Ct = 64, Z = new Uint8Array(128);
749
+ Z[m] = vt, Z[h] = vt, Z[_] = vt | yt, Z[g] = vt | yt, Z[C] = St | X, Z[S] = St | X, Z[E] = St | Ct | X, Z[pe] = St | X, Z[k] = St | Ct | X, Z[A] = St | Ct | X, Z[v] = St | Ct | X, Z[y] = St | Ct | X, Z[j] = St | Ct | X, Z[b] = Ct | X, Z[P] = Ct | X, Z[B] = St | X;
750
+ for (let e = V; e <= H; e++) Z[e] = xt | St;
751
+ for (let e = U; e <= W; e++) Z[e] = bt;
752
+ for (let e = G; e <= K; e++) Z[e] = bt;
753
+ Z[O] = X, Z[N] = X, Z[ge] = X, Z[_e] = X, Z[I] = X, Z[fe] = X, Z[de] = X, Z[F] = X, Z[D] = X, Z[w] = X, Z[T] = X, Z[oe] = X, Z[le] = X, Z[ue] = X, Z[se] = X, Z[ce] = X, Z[M] = X, Z[x] = X, Z[me] = X, Z[he] = X;
754
+ function wt(e) {
755
+ if (e.indexOf("[") < 0 && e.indexOf("]") < 0) return !1;
756
+ for (var t = 0; t < e.length; t++) {
757
+ if (e.charCodeAt(t) === O) {
758
+ t++;
759
+ continue;
760
+ }
761
+ if (e.charCodeAt(t) === b || e.charCodeAt(t) === N) return !0;
762
+ }
763
+ return !1;
764
+ }
765
+ function Tt(e) {
766
+ var t = e.replace(/\s+/g, " ").trim();
767
+ return t.indexOf("ẞ") === -1 ? t.toLowerCase() : t.replace(/\u1E9E/g, "ss").toLowerCase();
768
+ }
769
+ function Et(e) {
770
+ return e < be ? Z[e] : e === ie ? vt : 0;
771
+ }
772
+ function Dt(e) {
773
+ return e.replace(/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g, "$1");
774
+ }
775
+ function Ot(e, t) {
776
+ var n = e.indexOf("\n", t);
777
+ return n < 0 ? e.length : n;
778
+ }
779
+ function Q(e, t) {
780
+ let n = Ot(e, t);
781
+ return n < e.length ? n + 1 : n;
782
+ }
783
+ function kt(e, t, n) {
784
+ for (; t < n;) {
785
+ let n = e.charCodeAt(t);
786
+ if (n !== m && n !== h) break;
787
+ t++;
788
+ }
789
+ return t;
790
+ }
791
+ function At(e, t) {
792
+ let n = Q(e, t);
793
+ for (; n < e.length;) {
794
+ let t = Ot(e, n);
795
+ if (Ft(e, n, t)) return n;
796
+ n = Q(e, n);
797
+ }
798
+ return e.length;
799
+ }
800
+ function jt(e, t, n, r) {
801
+ let i = 0;
802
+ for (; t + i < n && e.charCodeAt(t + i) === r;) i++;
803
+ return i;
804
+ }
805
+ var Mt = 0, Nt = 0;
806
+ function Pt(e, t, n) {
807
+ for (Mt = 0, Nt = 0; t + Nt < n;) {
808
+ let n = e.charCodeAt(t + Nt);
809
+ if (n === h) Mt += 4 - Mt % 4;
810
+ else if (n === m) Mt++;
811
+ else break;
812
+ Nt++;
813
+ }
814
+ }
815
+ function Ft(e, t, n) {
816
+ return kt(e, t, n) >= n;
817
+ }
818
+ function It(e, t, n, r) {
819
+ let i = Ot(e, t);
820
+ if (Pt(e, t, i), Mt > 3) return null;
821
+ let a = t + Nt;
822
+ if (e.charCodeAt(a) !== C) return null;
823
+ let o = jt(e, a, i, 35);
824
+ if (o < 1 || o > 6 || (a += o, a < i && e.charCodeAt(a) !== m && e.charCodeAt(a) !== h)) return null;
825
+ a = kt(e, a, i);
826
+ for (var s = i; s > a && e.charCodeAt(s - 1) === m;) s--;
827
+ for (var c = s; s > a && e.charCodeAt(s - 1) === C;) s--;
828
+ if (s < c) if (s === a || e.charCodeAt(s - 1) === m) for (; s > a && e.charCodeAt(s - 1) === m;) s--;
829
+ else s = c;
830
+ let l = e.slice(a, s), u = On(l, 0, l.length, n, r), d = (r?.slugify || Me)(l);
831
+ return {
832
+ node: {
833
+ type: J.heading,
834
+ level: o,
835
+ children: u,
836
+ id: d
837
+ },
838
+ end: Q(e, i)
839
+ };
840
+ }
841
+ function Lt(e, t) {
842
+ let n = Ot(e, t);
843
+ if (Pt(e, t, n), Mt > 3) return null;
844
+ let r = t + Nt, i = e.charCodeAt(r);
845
+ if (i !== E && i !== k && i !== A) return null;
846
+ let a = 0;
847
+ for (; r < n;) {
848
+ let t = e.charCodeAt(r);
849
+ if (t === i) a++;
850
+ else if (t !== m && t !== h) return null;
851
+ r++;
852
+ }
853
+ return a < 3 ? null : {
854
+ node: { type: J.breakThematic },
855
+ end: Q(e, n)
856
+ };
857
+ }
858
+ function Rt(e, t, n) {
859
+ let r = Ot(e, t);
860
+ if (Pt(e, t, r), Mt > 3) return null;
861
+ let i = Mt, a = t + Nt, o = e.charCodeAt(a);
862
+ if (o !== v && o !== y) return null;
863
+ let s = jt(e, a, r, o);
864
+ if (s < 3) return null;
865
+ a += s;
866
+ let c = kt(e, a, r), l = r;
867
+ if (o === v) {
868
+ for (let t = c; t < r; t++) if (e.charCodeAt(t) === v) return null;
869
+ }
870
+ for (; l > c && (e.charCodeAt(l - 1) === m || e.charCodeAt(l - 1) === h);) l--;
871
+ let u = e.slice(c, l), d = "", f = "", p = u.indexOf(" ");
872
+ p === -1 ? d = u : (d = u.slice(0, p), f = u.slice(p + 1).trim()), d = Dt(d);
873
+ var g = void 0;
874
+ if (f) {
875
+ dt.lastIndex = 0;
876
+ for (var b; (b = dt.exec(f)) !== null;) g ||= {}, g[b[1]] = b[2] === void 0 ? b[3] : b[2];
877
+ }
878
+ let x = Q(e, r), S = x, C = e.length;
879
+ for (; S < e.length;) {
880
+ let t = Ot(e, S);
881
+ if (Pt(e, S, t), Mt < 4) {
882
+ let n = S + Nt;
883
+ var w = jt(e, n, t, o);
884
+ if (w >= s && Ft(e, n + w, t)) {
885
+ C = Q(e, t);
886
+ break;
887
+ }
888
+ }
889
+ S = Q(e, t);
890
+ }
891
+ var T;
892
+ if (i === 0) T = S > x && e.charCodeAt(S - 1) === _ ? e.slice(x, S - 1) : e.slice(x, S);
893
+ else {
894
+ T = "";
895
+ for (var E = x; E < S;) {
896
+ var D = Ot(e, E);
897
+ Pt(e, E, D);
898
+ var O = Math.min(Nt, i);
899
+ T += e.slice(E + O, D) + "\n", E = Q(e, D);
900
+ }
901
+ T.length > 0 && T.charCodeAt(T.length - 1) === _ && (T = T.slice(0, -1));
902
+ }
903
+ return {
904
+ node: {
905
+ type: J.codeBlock,
906
+ lang: d || void 0,
907
+ text: T,
908
+ infoString: f || void 0,
909
+ attrs: g
910
+ },
911
+ end: C
912
+ };
913
+ }
914
+ function zt(e, t) {
915
+ if (Pt(e, t, Ot(e, t)), Mt < 4) return null;
916
+ let n = "", r = t;
917
+ for (; r < e.length;) {
918
+ let t = Ot(e, r);
919
+ if (Pt(e, r, t), Ft(e, r, t)) {
920
+ for (var i = 0, a = Q(e, t); a < e.length;) {
921
+ var o = Ot(e, a);
922
+ if (Ft(e, a, o)) {
923
+ i++, a = Q(e, o);
924
+ continue;
925
+ }
926
+ if (Pt(e, a, o), Mt >= 4) {
927
+ for (var s = 0; s <= i; s++) n += "\n";
928
+ r = a;
929
+ break;
930
+ }
931
+ break;
932
+ }
933
+ if (r !== a) break;
934
+ continue;
935
+ }
936
+ if (Mt < 4) break;
937
+ let f = 0, p = 0;
938
+ var c = 0;
939
+ for (let n = r; n < t && p < 4; n++) {
940
+ if (e.charCodeAt(n) === h) {
941
+ var l = 4 - p % 4;
942
+ p + l > 4 && (c = p + l - 4), p += l;
943
+ } else p++;
944
+ f++;
945
+ }
946
+ var u = "";
947
+ if (c > 0) for (var d = 0; d < c; d++) u += " ";
948
+ u += e.slice(r + f, t), n += u + "\n", r = Q(e, t);
949
+ }
950
+ for (; n.length > 0 && n.charCodeAt(n.length - 1) === _;) n = n.slice(0, -1);
951
+ for (; n.length > 0 && n.charCodeAt(n.length - 1) === _;) n = n.slice(0, -1);
952
+ return n ? {
953
+ node: {
954
+ type: J.codeBlock,
955
+ text: n
956
+ },
957
+ end: r
958
+ } : null;
959
+ }
960
+ function Bt(e, t, n, r) {
961
+ if (Pt(e, t, Ot(e, t)), Mt > 3) return null;
962
+ let i = t + Nt;
963
+ if (e.charCodeAt(i) !== S) return null;
964
+ let a = "", o = t, s, c = !1, l = !1, u = !1;
965
+ for (; o < e.length;) {
966
+ let t = Ot(e, o);
967
+ Pt(e, o, t);
968
+ let n = o + Nt;
969
+ if (e.charCodeAt(n) === S) {
970
+ let r = n + 1;
971
+ var d = Mt + 1, f = !1;
972
+ if (r < t) {
973
+ var p = e.charCodeAt(r);
974
+ p === m ? (r++, d++, f = !0) : p === h && (f = !0);
975
+ }
976
+ for (var g = "", _ = !1, b = r; b < t; b++) if (e.charCodeAt(b) === h) {
977
+ _ = !0;
978
+ break;
979
+ }
980
+ if (_) {
981
+ var x = d;
982
+ if (f && r < t && e.charCodeAt(r) === h) {
983
+ for (var w = 4 - x % 4, T = 0; T < w - 1; T++) g += " ";
984
+ x += w, r++;
985
+ }
986
+ for (var D = r; D < t; D++) if (e.charCodeAt(D) === h) {
987
+ for (var O = 4 - x % 4, M = 0; M < O; M++) g += " ";
988
+ x += O;
989
+ } else g += e[D], x++;
990
+ } else g = e.slice(r, t);
991
+ if (!a && !s) {
992
+ let n = g.match(/^\[!([A-Za-z]+)\]\s*$/);
993
+ if (n) {
994
+ s = n[1].toUpperCase(), o = Q(e, t);
995
+ continue;
996
+ }
997
+ }
998
+ a += g + "\n";
999
+ var N = g.trimStart();
1000
+ N.startsWith("```") || N.startsWith("~~~") ? u = !u : g.startsWith(" ") || g.startsWith(" ") ? u = !0 : N.length > 0 && !u && (u = !1), l = N.length > 0, o = Q(e, t);
1001
+ } else if (a && !Ft(e, o, t) && l) {
1002
+ if (Mt < 4) {
1003
+ var P = o + Nt, F = P < t ? e.charCodeAt(P) : 0;
1004
+ if (F === C || F === S || F === v || F === y || F === j || (F === E || F === k || F === A) && Lt(e, o) || (F === E || F === k || F === pe) && P + 1 < t && (e.charCodeAt(P + 1) === m || e.charCodeAt(P + 1) === h)) break;
1005
+ if (F >= V && F <= H) {
1006
+ for (var I = P; I < t && e.charCodeAt(I) >= V && e.charCodeAt(I) <= H;) I++;
1007
+ if (I < t && (e.charCodeAt(I) === le || e.charCodeAt(I) === _e)) break;
1008
+ }
1009
+ }
1010
+ if (u) break;
1011
+ a += e.slice(o, t) + "\n", c = !0, o = Q(e, t);
1012
+ } else break;
1013
+ }
1014
+ if (!a && !s) return null;
1015
+ var { inBlockQuote: L, f: R } = n;
1016
+ n.inBlockQuote = !0, c && (n.f = !0);
1017
+ let ee = An(a || "", n, r);
1018
+ n.inBlockQuote = L, n.f = R;
1019
+ let te = {
1020
+ type: J.blockQuote,
1021
+ children: ee
1022
+ };
1023
+ return s && (te.alert = s), {
1024
+ node: te,
1025
+ end: o
1026
+ };
1027
+ }
1028
+ function Vt(e, t, n) {
1029
+ for (var r = 0, i = t; i < n; i++) e.charCodeAt(i) === h ? r += 4 - r % 4 : r++;
1030
+ return r;
1031
+ }
1032
+ function Ht(e, t, n) {
1033
+ if (Pt(e, t, n), Mt > 3) return null;
1034
+ var r = t + Nt;
1035
+ if (r >= n) return null;
1036
+ var i = e.charCodeAt(r), a = Mt, o = r;
1037
+ if (i === E || i === k || i === pe) {
1038
+ if (o = r + 1, o < n && e.charCodeAt(o) !== m && e.charCodeAt(o) !== h && e.charCodeAt(o) !== _) return null;
1039
+ } else if (i >= V && i <= H) {
1040
+ for (var s = r; s < n && s - r < 9;) {
1041
+ var c = e.charCodeAt(s);
1042
+ if (c < V || c > H) break;
1043
+ s++;
1044
+ }
1045
+ if (s > r && s < n) {
1046
+ var l = e.charCodeAt(s);
1047
+ if (l === le || l === _e) {
1048
+ if (o = s + 1, o < n && e.charCodeAt(o) !== m && e.charCodeAt(o) !== h && e.charCodeAt(o) !== _) return null;
1049
+ } else return null;
1050
+ } else return null;
1051
+ } else return null;
1052
+ var u = o, d = Vt(e, t, o), f = 0, p = u, g = d;
1053
+ if (u >= n) return {
1054
+ ordered: i >= V && i <= H,
1055
+ marker: i >= V && i <= H ? e[s] : e[r],
1056
+ start: i >= V && i <= H ? parseInt(e.slice(r, s), 10) : void 0,
1057
+ contentStart: u,
1058
+ contentCol: d + 1,
1059
+ markerCol: a,
1060
+ isEmpty: !0
1061
+ };
1062
+ for (; p < n && (e.charCodeAt(p) === m || e.charCodeAt(p) === h);) {
1063
+ if (e.charCodeAt(p) === h) {
1064
+ var v = 4 - g % 4;
1065
+ g += v;
1066
+ } else g++;
1067
+ p++, f++;
1068
+ }
1069
+ var y = p >= n, b = g - d;
1070
+ return y || b > 4 ? (g = d + 1, p = u + 1, f = 1) : f === 0 && (g = d + 1, p = u, f = 1), {
1071
+ ordered: i >= V && i <= H,
1072
+ marker: i >= V && i <= H ? e[s] : e[r],
1073
+ start: i >= V && i <= H ? parseInt(e.slice(r, s), 10) : void 0,
1074
+ contentStart: p,
1075
+ contentCol: g,
1076
+ markerCol: a,
1077
+ isEmpty: y
1078
+ };
1079
+ }
1080
+ var Ut = 0;
1081
+ function Wt(e, t, n, r) {
1082
+ var i = 0, a = t;
1083
+ for (Ut = 0; a < n && i < r;) {
1084
+ var o = e.charCodeAt(a);
1085
+ if (o === h) {
1086
+ var s = 4 - i % 4;
1087
+ if (i + s > r) {
1088
+ Ut = i + s - r, a++, i = r;
1089
+ break;
1090
+ }
1091
+ i += s;
1092
+ } else if (o === m) i++;
1093
+ else break;
1094
+ a++;
1095
+ }
1096
+ return a;
1097
+ }
1098
+ function Gt(e, t, n, r) {
1099
+ var i = Ot(e, t), a = Ht(e, t, i);
1100
+ if (!a) return null;
1101
+ var o = [], s = t, c = a.contentCol, l = "", u = a.isEmpty, d = !1, f = !1;
1102
+ if (!a.isEmpty) {
1103
+ for (var p = !1, x = a.contentStart; x < i; x++) if (e.charCodeAt(x) === h) {
1104
+ p = !0;
1105
+ break;
1106
+ }
1107
+ if (p) {
1108
+ var w = "", T = Vt(e, t, a.contentStart), D = T - a.contentCol;
1109
+ if (D > 0) for (var O = 0; O < D; O++) w += " ";
1110
+ for (var M = a.contentStart; M < i; M++) if (e.charCodeAt(M) === h) {
1111
+ for (var P = 4 - T % 4, F = 0; F < P; F++) w += " ";
1112
+ T += P;
1113
+ } else w += e[M], T++;
1114
+ l = w + "\n";
1115
+ } else l = e.slice(a.contentStart, i) + "\n";
1116
+ }
1117
+ for (s = Q(e, i); s < e.length;) {
1118
+ var I = Ot(e, s);
1119
+ Pt(e, s, I);
1120
+ var L = e.charCodeAt(s + Nt);
1121
+ if (Mt < c && (L === E || L === k || L === A) && Mt <= 3 && Lt(e, s)) break;
1122
+ var R = Ht(e, s, I);
1123
+ if (R && R.ordered === a.ordered && R.marker === a.marker && R.markerCol < c) {
1124
+ o.push({
1125
+ contentCol: c,
1126
+ raw: l,
1127
+ hasBlankAfter: d,
1128
+ isEmpty: u
1129
+ }), d && (f = !0), c = R.contentCol, u = R.isEmpty, d = !1, l = R.isEmpty ? "" : e.slice(R.contentStart, I) + "\n", s = Q(e, I);
1130
+ continue;
1131
+ }
1132
+ if (Ft(e, s, I)) {
1133
+ l += "\n", s = Q(e, I);
1134
+ for (var ee = !1, te = 0; te < l.length; te++) {
1135
+ var z = l.charCodeAt(te);
1136
+ if (z !== _ && z !== g && z !== m && z !== h) {
1137
+ ee = !0;
1138
+ break;
1139
+ }
1140
+ }
1141
+ if (u && !ee) if (s < e.length) {
1142
+ var ne = Ot(e, s), re = Ht(e, s, ne);
1143
+ if (!re || re.ordered !== a.ordered || re.marker !== a.marker) break;
1144
+ d = !0;
1145
+ } else break;
1146
+ if (s < e.length) {
1147
+ var ie = Ot(e, s);
1148
+ Pt(e, s, ie);
1149
+ var ae = e.charCodeAt(s + Nt);
1150
+ if ((ae === E || ae === k || ae === A) && Mt <= 3 && Lt(e, s)) break;
1151
+ var oe = Ht(e, s, ie);
1152
+ if (oe && oe.ordered === a.ordered && oe.marker === a.marker && oe.markerCol < c) {
1153
+ d = !0;
1154
+ continue;
1155
+ }
1156
+ if (!Ft(e, s, ie) && Mt < c) break;
1157
+ }
1158
+ continue;
1159
+ }
1160
+ if (Mt >= c) {
1161
+ var se = Wt(e, s, I, c);
1162
+ if (Ut > 0) {
1163
+ for (var ce = "", le = c, ue = 0; ue < Ut; ue++) ce += " ", le++;
1164
+ for (var de = se; de < I; de++) if (e.charCodeAt(de) === h) {
1165
+ for (var fe = 4 - le % 4, B = 0; B < fe; B++) ce += " ";
1166
+ le += fe;
1167
+ } else ce += e[de], le++;
1168
+ l += ce + "\n";
1169
+ } else l += e.slice(se, I) + "\n";
1170
+ s = Q(e, I);
1171
+ continue;
1172
+ }
1173
+ for (var me = !1, he = 0; he < l.length; he++) {
1174
+ var ge = l.charCodeAt(he);
1175
+ if (ge !== _ && ge !== g && ge !== m && ge !== h) {
1176
+ me = !0;
1177
+ break;
1178
+ }
1179
+ }
1180
+ if (!d && me && !u) {
1181
+ var _e = s + Nt, ve = e.charCodeAt(_e);
1182
+ if (!(ve === C || ve === S || ve === j || ve === v || ve === y || (ve === E || ve === k || ve === A || ve === pe) && (Lt(e, s) !== null || Ht(e, s, I) !== null) || ve >= V && ve <= H && Ht(e, s, I) !== null)) {
1183
+ l += "" + e.slice(_e, I) + "\n", s = Q(e, I);
1184
+ continue;
1185
+ }
1186
+ }
1187
+ break;
1188
+ }
1189
+ if (o.push({
1190
+ contentCol: c,
1191
+ raw: l,
1192
+ hasBlankAfter: d,
1193
+ isEmpty: u
1194
+ }), o.length === 0) return null;
1195
+ var ye = f;
1196
+ if (!ye) for (var U = 0; U < o.length; U++) {
1197
+ if (o[U].hasBlankAfter && U < o.length - 1) {
1198
+ ye = !0;
1199
+ break;
1200
+ }
1201
+ if (!o[U].isEmpty) {
1202
+ for (var W = o[U].raw, G = W.length, K = 0, be = !1, q = !1, xe = !1, Se = !1, Ce = 0, we = 0, Te = -1; K < G;) {
1203
+ var Y = W.indexOf("\n", K);
1204
+ if (Y < 0 && (Y = G), Se) {
1205
+ Pt(W, K, Y);
1206
+ for (var Ee = W.slice(K + Nt, Y), De = 0; De < Ee.length && Ee.charCodeAt(De) === Ce;) De++;
1207
+ De >= we && Ee.slice(De).trim() === "" && (Se = !1), K = Y < G ? Y + 1 : G;
1208
+ continue;
1209
+ }
1210
+ if (Ft(W, K, Y)) {
1211
+ Te >= 0 ? xe = !0 : be && (q = !0), K = Y < G ? Y + 1 : G;
1212
+ continue;
1213
+ }
1214
+ if (Pt(W, K, Y), Te >= 0) {
1215
+ if (Mt >= Te) {
1216
+ K = Y < G ? Y + 1 : G;
1217
+ continue;
1218
+ }
1219
+ var Oe = Ht(W, K, Y);
1220
+ if (Oe && Oe.markerCol < Te && Oe.contentCol <= Te) {
1221
+ K = Y < G ? Y + 1 : G;
1222
+ continue;
1223
+ }
1224
+ if (Oe) {
1225
+ K = Y < G ? Y + 1 : G;
1226
+ continue;
1227
+ }
1228
+ Te = -1, xe &&= (q = !0, !1);
1229
+ }
1230
+ var ke = W.slice(K + Nt, Y), Ae = ke.charCodeAt(0);
1231
+ if ((Ae === v || Ae === y) && Mt <= 3) {
1232
+ for (var je = 0; je < ke.length && ke.charCodeAt(je) === Ae;) je++;
1233
+ if (je >= 3) {
1234
+ if (q && be) {
1235
+ ye = !0;
1236
+ break;
1237
+ }
1238
+ Se = !0, Ce = Ae, we = je, be = !0, K = Y < G ? Y + 1 : G;
1239
+ continue;
1240
+ }
1241
+ }
1242
+ var Me = Mt <= 3 ? Ht(W, K, Y) : null;
1243
+ if (Me && be) {
1244
+ if (q) {
1245
+ ye = !0;
1246
+ break;
1247
+ }
1248
+ Te = Me.contentCol, xe = !1, K = Y < G ? Y + 1 : G, be = !0;
1249
+ continue;
1250
+ }
1251
+ if (q) {
1252
+ ye = !0;
1253
+ break;
1254
+ }
1255
+ be = !0, K = Y < G ? Y + 1 : G;
1256
+ }
1257
+ if (ye) break;
1258
+ }
1259
+ }
1260
+ for (var Ne = [], Pe = 0; Pe < o.length; Pe++) {
1261
+ for (var Fe = o[Pe], Ie = Fe.raw, Le = Ie.length; Le > 0 && Ie.charCodeAt(Le - 1) === _;) Le--;
1262
+ var Re = Le < Ie.length ? Ie.slice(0, Le) : Ie, ze = null;
1263
+ if (Re.length >= 3 && Re.charCodeAt(0) === b) {
1264
+ var Be = Re[1];
1265
+ (Be === " " || Be === "x" || Be === "X") && Re.charCodeAt(2) === N && (ze = {
1266
+ type: J.gfmTask,
1267
+ completed: Be === "x" || Be === "X"
1268
+ }, Re = Re.slice(3));
1269
+ }
1270
+ var Ve;
1271
+ if (Fe.isEmpty && Re.trim() === "") Ve = [];
1272
+ else if (ye) {
1273
+ var He = n.inList;
1274
+ n.inList = !0, Ve = An(Re, n, r), n.inList = He;
1275
+ } else {
1276
+ var Ue = n.inList;
1277
+ if (n.inList = !0, Ve = An(Re, n, r), n.inList = Ue, Ve.length === 1 && Ve[0].type === J.paragraph) Ve = Ve[0].children;
1278
+ else {
1279
+ for (var We = [], Ge = 0; Ge < Ve.length; Ge++) if (Ve[Ge].type === J.paragraph) for (var Ke = Ve[Ge].children, qe = 0; qe < Ke.length; qe++) We.push(Ke[qe]);
1280
+ else We.push(Ve[Ge]);
1281
+ Ve = We;
1282
+ }
1283
+ }
1284
+ ze ? Ne.push([
1285
+ ze,
1286
+ {
1287
+ type: J.text,
1288
+ text: " "
1289
+ },
1290
+ ...Ve
1291
+ ]) : Ne.push(Ve);
1292
+ }
1293
+ return {
1294
+ node: {
1295
+ type: a.ordered ? J.orderedList : J.unorderedList,
1296
+ start: a.ordered ? a.start : void 0,
1297
+ items: Ne
1298
+ },
1299
+ end: s
1300
+ };
1301
+ }
1302
+ var Kt = new Set(/* @__PURE__ */ "address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul".split("."));
1303
+ function qt(e, t, n) {
1304
+ let r = {};
1305
+ for (let [o, s] of Object.entries(e)) {
1306
+ let e = o, c = o.toLowerCase();
1307
+ if (c === "style" && typeof s == "string") {
1308
+ let t = {}, n = [], i = 0, a = 0;
1309
+ for (let e = 0; e < s.length; e++) {
1310
+ let t = s.charCodeAt(e);
1311
+ t === ge ? i++ : t === _e ? i-- : t === se && i === 0 && (n.push(s.slice(a, e)), a = e + 1);
1312
+ }
1313
+ a < s.length && n.push(s.slice(a));
1314
+ let o = !1;
1315
+ n.forEach((e) => {
1316
+ let n = e.indexOf(":");
1317
+ if (n === -1) return;
1318
+ let r = e.slice(0, n).trim(), i = e.slice(n + 1).trim();
1319
+ if (r && i) {
1320
+ if (/url\s*\(\s*(javascript|vbscript|data:(?!image\/))/i.test(i)) {
1321
+ o = !0;
1322
+ return;
1323
+ }
1324
+ let e = r.indexOf("-") === -1 ? r : r.replace(/-([a-z])/g, (e, t) => t.toUpperCase());
1325
+ t[e] = i;
1326
+ }
1327
+ }), !o && Object.keys(t).length > 0 && (r[e] = t);
1328
+ } else if ((c === "href" || c === "src") && n?.sanitizer) {
1329
+ let i = n.sanitizer(s, t, c);
1330
+ i !== null && (r[e] = i);
1331
+ } else if (s === "") r[e] = !0;
1332
+ else if (s.length >= 2 && s.charCodeAt(0) === me && s.charCodeAt(s.length - 1) === he) {
1333
+ var i = s.slice(1, -1);
1334
+ if (i.length > 0) {
1335
+ var a = i.charCodeAt(0);
1336
+ if (a === b || a === me) try {
1337
+ r[e] = JSON.parse(i);
1338
+ continue;
1339
+ } catch {}
1340
+ }
1341
+ if (i === "true") {
1342
+ r[e] = !0;
1343
+ continue;
1344
+ }
1345
+ if (i === "false") {
1346
+ r[e] = !1;
1347
+ continue;
1348
+ }
1349
+ if (n?.evalUnserializableExpressions) try {
1350
+ r[e] = (0, eval)("(" + i + ")");
1351
+ continue;
1352
+ } catch {}
1353
+ r[e] = i;
1354
+ } else r[e] = s;
1355
+ }
1356
+ return r;
1357
+ }
1358
+ function Jt(e, t, n) {
1359
+ let r = t.length;
1360
+ var i = t.charCodeAt(0);
1361
+ i >= U && i <= W && (i += q);
1362
+ for (let o = n; o <= e.length - r; o++) {
1363
+ var a = e.charCodeAt(o);
1364
+ if (a >= U && a <= W && (a += q), a !== i) continue;
1365
+ let n = !0;
1366
+ for (let i = 1; i < r; i++) {
1367
+ let r = e.charCodeAt(o + i), a = t.charCodeAt(i);
1368
+ if (r >= U && r <= W && (r += q), a >= U && a <= W && (a += q), r !== a) {
1369
+ n = !1;
1370
+ break;
1371
+ }
1372
+ }
1373
+ if (n) return o;
1374
+ }
1375
+ return -1;
1376
+ }
1377
+ function Yt(e, t, n) {
1378
+ let r = t.length;
1379
+ var i = t.charCodeAt(0);
1380
+ i >= U && i <= W && (i += q);
1381
+ for (let o = Math.min(n, e.length - r); o >= 0; o--) {
1382
+ var a = e.charCodeAt(o);
1383
+ if (a >= U && a <= W && (a += q), a !== i) continue;
1384
+ let n = !0;
1385
+ for (let i = 1; i < r; i++) {
1386
+ let r = e.charCodeAt(o + i), a = t.charCodeAt(i);
1387
+ if (r >= U && r <= W && (r += q), a >= U && a <= W && (a += q), r !== a) {
1388
+ n = !1;
1389
+ break;
1390
+ }
1391
+ }
1392
+ if (n) return o;
1393
+ }
1394
+ return -1;
1395
+ }
1396
+ var Xt = -1;
1397
+ function Zt(e, t, n) {
1398
+ let r = n.toLowerCase(), i = "<" + r, a = "</" + r, o = 1, s = t, c = e.length;
1399
+ for (Xt = -1; s < c && o > 0;) {
1400
+ let t = Jt(e, i, s), n = Jt(e, a, s);
1401
+ if (n === -1) return -1;
1402
+ if (t !== -1 && t < n) {
1403
+ let n = ht(e, t);
1404
+ n ? (n.tag.toLowerCase() === r && !n.isClosing && !n.selfClosing && !Fe(n.tag) && o++, s = n.end) : s = t + 1;
1405
+ } else {
1406
+ var l = n + a.length, u = l < c ? e.charCodeAt(l) : 62;
1407
+ if ((u === S || u === m || u === h || u === _) && (o--, o === 0)) {
1408
+ Xt = n;
1409
+ let t = n + a.length;
1410
+ for (; t < c && e.charCodeAt(t) !== S;) t++;
1411
+ return t + 1;
1412
+ }
1413
+ s = n + 1;
1414
+ }
1415
+ }
1416
+ return -1;
1417
+ }
1418
+ function Qt(e, t, n, r) {
1419
+ if (r.ignoreHTMLBlocks || r.disableParsingRawHTML) return null;
1420
+ var i = Ot(e, t);
1421
+ if (Pt(e, t, i), Mt > 3 && !n.inHTML) return null;
1422
+ var a = t + Nt;
1423
+ if (e.charCodeAt(a) !== j) return null;
1424
+ var o = e.indexOf(">", a + 1);
1425
+ if (o !== -1 && o < i) {
1426
+ var s = e.slice(a + 1, o);
1427
+ if (/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(s) || /^[^\s@]+@[^\s@]+$/.test(s)) return null;
1428
+ }
1429
+ var c = $t(e, a);
1430
+ if (c >= 1 && c <= 5) {
1431
+ var l = e.length;
1432
+ if (c === 1) {
1433
+ for (var u = e.length, d = 0; d < ot.length; d++) {
1434
+ var f = Jt(e, "</" + ot[d] + ">", a);
1435
+ f >= 0 && f < u && (u = f);
1436
+ }
1437
+ if (u < e.length) {
1438
+ var p = e.indexOf(">", u);
1439
+ l = p >= 0 ? Q(e, p + 1) : e.length;
1440
+ }
1441
+ } else {
1442
+ var g = c === 2 ? "-->" : c === 3 ? "?>" : c === 4 ? ">" : "]]>", v = e.indexOf(g, a);
1443
+ v >= 0 && (l = Q(e, v + g.length));
1444
+ }
1445
+ var y = e.slice(a, l);
1446
+ if (c >= 2) return {
1447
+ node: {
1448
+ type: J.htmlComment,
1449
+ text: y,
1450
+ raw: !0,
1451
+ endPos: l
1452
+ },
1453
+ end: l
1454
+ };
1455
+ var b = "div", x = y.match(/^<\/?([a-zA-Z][a-zA-Z0-9-]*)/);
1456
+ x && (b = x[1]);
1457
+ var C = ht(e, a), w = {}, T;
1458
+ C && !C.isClosing && (w = qt(C.attrs, b, r), T = C.whitespaceBeforeAttrs + C.rawAttrs);
1459
+ var E = [], D = Jt(y, "</" + b.toLowerCase(), 0), O = y, k = "";
1460
+ if (C && C.isClosing) for (O = y.slice(C.end - a); O.length > 0 && O.charCodeAt(O.length - 1) === _;) O = O.slice(0, -1);
1461
+ else if (C && !C.isClosing) {
1462
+ var A = C.end - a;
1463
+ if (D !== -1) for (O = y.slice(A), O.charCodeAt(0) === _ && (O = O.slice(1)); O.length > 0 && O.charCodeAt(O.length - 1) === _;) O = O.slice(0, -1);
1464
+ else for (O = y; O.length > 0 && O.charCodeAt(O.length - 1) === _;) O = O.slice(0, -1);
1465
+ D !== -1 && (k = y.slice(A, D).trim());
1466
+ }
1467
+ var M = C ? C.isClosing : !1;
1468
+ return {
1469
+ node: {
1470
+ type: J.htmlBlock,
1471
+ tag: b,
1472
+ attrs: w,
1473
+ e: T,
1474
+ children: E,
1475
+ a: O,
1476
+ text: k,
1477
+ d: !0,
1478
+ b: M,
1479
+ endPos: l,
1480
+ canInterruptParagraph: !0
1481
+ },
1482
+ end: l
1483
+ };
1484
+ }
1485
+ if (c === 6 || c === 7) {
1486
+ var N = At(e, t), P = N < e.length ? N : e.length, F = e.slice(a, P), I = N < e.length ? Q(e, N) : e.length, L = ht(e, a);
1487
+ if (L) {
1488
+ var R = L.tag, ee = R.toLowerCase();
1489
+ if (L.isClosing) {
1490
+ var te = e.slice(L.end, P);
1491
+ return {
1492
+ node: {
1493
+ type: J.htmlBlock,
1494
+ tag: R,
1495
+ attrs: {},
1496
+ children: [],
1497
+ a: te,
1498
+ text: te,
1499
+ d: !0,
1500
+ b: !0,
1501
+ endPos: P,
1502
+ canInterruptParagraph: c === 6
1503
+ },
1504
+ end: I
1505
+ };
1506
+ }
1507
+ var z = n.c || 0, ne = e.slice(a, P), re = -1, ie = -1;
1508
+ if (!L.selfClosing && !Fe(R) && z < 10) {
1509
+ for (var ae = "</" + ee, oe = L.end - a, se = 1, ce = oe; ce < ne.length && se > 0;) {
1510
+ var le = Jt(ne, "<" + ee, ce), de = Jt(ne, ae, ce);
1511
+ if (de === -1) break;
1512
+ if (le !== -1 && le < de) {
1513
+ var fe = le + ee.length + 1;
1514
+ if (fe < ne.length) {
1515
+ var pe = ne.charCodeAt(fe);
1516
+ (pe === m || pe === h || pe === _ || pe === S || pe === ue) && se++;
1517
+ }
1518
+ ce = le + 1;
1519
+ } else {
1520
+ var B = de + ae.length;
1521
+ if (B < ne.length) {
1522
+ var me = ne.charCodeAt(B);
1523
+ if ((me === S || me === m || me === h || me === _) && (se--, se === 0)) {
1524
+ re = de;
1525
+ for (var he = B; he < ne.length && ne.charCodeAt(he) !== S;) he++;
1526
+ ie = he + 1;
1527
+ break;
1528
+ }
1529
+ } else if (se--, se === 0) {
1530
+ re = de, ie = ne.length;
1531
+ break;
1532
+ }
1533
+ ce = de + 1;
1534
+ }
1535
+ }
1536
+ var ge = !1;
1537
+ if (re === -1 && c === 6 && !L.isClosing && !lt.has(ee)) {
1538
+ var _e = e.slice(L.end), ve = Jt(_e, ae, 0);
1539
+ if (ve !== -1 && _e.slice(0, ve).indexOf("\n\n") !== -1) {
1540
+ for (var ye = L.end + ve, V = ye + ae.length; V < e.length && e.charCodeAt(V) !== S;) V++;
1541
+ if (V < e.length && e.charCodeAt(V) === S) {
1542
+ var H = V + 1, G = Ot(e, H);
1543
+ P = G, I = Q(e, G), ne = e.slice(a, P), F = e.slice(a, P), re = ye - a, ie = H - a, ge = !0;
1544
+ }
1545
+ }
1546
+ }
1547
+ }
1548
+ var K = L.rawAttrs.indexOf("\n") !== -1 || L.whitespaceBeforeAttrs.indexOf("\n") !== -1, be = !1;
1549
+ re !== -1 && (be = ne.slice(ie).trim().length === 0);
1550
+ var q = !1, xe = P, Se = I;
1551
+ if (re !== -1) {
1552
+ var Ce = a + ie, we = Ot(e, Ce - 1);
1553
+ if (Ce < we) {
1554
+ for (var Te = Ce; Te < we && (e.charCodeAt(Te) === m || e.charCodeAt(Te) === h);) Te++;
1555
+ if (Te < we && e.charCodeAt(Te) === j) {
1556
+ var Y = ht(e, Te);
1557
+ Y && !Y.isClosing && (q = !0, xe = Ce, Se = Ce, be = !0);
1558
+ }
1559
+ }
1560
+ if (!q) {
1561
+ var Ee = Q(e, we);
1562
+ if (Ee < P) {
1563
+ for (var De = Ee; De < P && (e.charCodeAt(De) === m || e.charCodeAt(De) === h);) De++;
1564
+ De < P && e.charCodeAt(De) === j && ht(e, De) && (q = !0, xe = we, Se = Ee, be = !0);
1565
+ }
1566
+ }
1567
+ !q && n.inHTML && (q = !0, xe = we, Se = Q(e, we), be = e.slice(Ce, we).trim().length === 0);
1568
+ }
1569
+ var Oe = [], ke = "";
1570
+ if (re !== -1) {
1571
+ ke = ne.slice(L.end - a, re);
1572
+ var Ae = ke.trim();
1573
+ if (Ae) {
1574
+ var { inline: je, inHTML: Me, c: Ne } = n;
1575
+ if (n.inHTML = !0, n.c = z + 1, ee === "p") n.inline = !0, Oe = On(Ae, 0, Ae.length, n, r);
1576
+ else {
1577
+ var Pe = ke.indexOf("\n\n") !== -1, Ie = /^(\s{0,3}#[#\s]|\s{0,3}[-*+]\s|\s{0,3}\d+\.\s|\s{0,3}>\s|\s{0,3}```)/m.test(Ae), Le = /^<([a-z][^ >/\n\r]*) ?([^>]*?)>/im.test(Ae);
1578
+ Pe || Ie || n.inHTML && Le || Le ? (n.inline = !1, Oe = An(ke, n, r)) : (n.inline = !0, Oe = On(Ae, 0, Ae.length, n, r));
1579
+ }
1580
+ n.inline = je, n.inHTML = Me, n.c = Ne;
1581
+ }
1582
+ }
1583
+ var Re = !1;
1584
+ if (c === 6 && re !== -1 && !n.inHTML && !K) {
1585
+ var ze = ke, Be = /<[a-zA-Z][^>]*>/.test(ze), Ve = /\n\n/.test(ze) || /^(\s{0,3}#[#\s]|\s{0,3}[-*+]\s|\s{0,3}\d+\.\s|\s{0,3}>\s|\s{0,3}```)/m.test(ze);
1586
+ Be && !Ve && (Re = !0);
1587
+ }
1588
+ if (n.inHTML || c === 7 || K || !be || Re) {
1589
+ var He;
1590
+ if (re !== -1 && q) {
1591
+ var Ue = !1;
1592
+ if (n.inHTML && ie < ne.length) {
1593
+ for (var We = ie; We < ne.length && ne.charCodeAt(We) !== _;) We++;
1594
+ var Ge = ne.slice(ie, We).trim();
1595
+ Ue = Ge.length > 1 && Ge.charCodeAt(0) === j && Ge.charCodeAt(1) !== ue;
1596
+ }
1597
+ He = Ue ? ne.slice(L.end - a) : ke;
1598
+ } else (c === 7 || n.inHTML) && re !== -1 ? (He = ne.slice(L.end - a), He.charCodeAt(0) === _ && (He = He.slice(1))) : q ? He = e.slice(a, xe) : K ? He = F : (He = ne.slice(L.end - a), He.charCodeAt(0) === _ && (He = He.slice(1)));
1599
+ return {
1600
+ node: {
1601
+ type: J.htmlBlock,
1602
+ tag: R,
1603
+ attrs: qt(L.attrs, R, r),
1604
+ e: L.whitespaceBeforeAttrs + L.rawAttrs,
1605
+ children: Oe,
1606
+ a: He,
1607
+ text: He,
1608
+ d: !0,
1609
+ b: !1,
1610
+ endPos: xe,
1611
+ canInterruptParagraph: c === 6
1612
+ },
1613
+ end: Se
1614
+ };
1615
+ }
1616
+ return {
1617
+ node: {
1618
+ type: J.htmlBlock,
1619
+ tag: R,
1620
+ attrs: qt(L.attrs, R, r),
1621
+ e: L.whitespaceBeforeAttrs + L.rawAttrs,
1622
+ children: Oe,
1623
+ a: ge ? "" : ke,
1624
+ text: ke,
1625
+ d: !1,
1626
+ b: !1,
1627
+ endPos: xe,
1628
+ canInterruptParagraph: c === 6
1629
+ },
1630
+ end: Se
1631
+ };
1632
+ }
1633
+ var Ke = F.match(/^<(\/?)([a-zA-Z][a-zA-Z0-9-]*)/), qe = Ke ? Ke[2] : "div", Je = Ke ? Ke[1] === "/" : !1, Ye = F;
1634
+ if (Je) {
1635
+ var Xe = F.indexOf(">");
1636
+ Xe !== -1 && (Ye = F.slice(Xe + 1));
1637
+ }
1638
+ return {
1639
+ node: {
1640
+ type: J.htmlBlock,
1641
+ tag: qe,
1642
+ attrs: {},
1643
+ children: [],
1644
+ a: Ye,
1645
+ text: Ye,
1646
+ d: !0,
1647
+ b: Je,
1648
+ endPos: P,
1649
+ canInterruptParagraph: c === 6
1650
+ },
1651
+ end: I
1652
+ };
1653
+ }
1654
+ var Ze = ht(e, a);
1655
+ if (!Ze) return null;
1656
+ var Qe = Ze.tag, $e = Qe.toLowerCase(), et = Qe.charCodeAt(0), tt = et >= U && et <= W;
1657
+ if (!tt && !Kt.has($e) && !st.has($e) && !$e.includes("-")) return null;
1658
+ if (Ze.isClosing) return {
1659
+ node: {
1660
+ type: J.htmlSelfClosing,
1661
+ tag: Qe,
1662
+ attrs: {},
1663
+ endPos: Ze.end,
1664
+ b: !0,
1665
+ a: e.slice(a, Ze.end)
1666
+ },
1667
+ end: Ze.end
1668
+ };
1669
+ var nt = Zt(e, Ze.end, Qe), rt = [];
1670
+ if (nt !== -1) {
1671
+ var it = Xt, at = e.slice(Ze.end, it), ct = at.trim();
1672
+ if (ct) {
1673
+ var ut = at.indexOf("\n\n") !== -1, dt = /^(\s{0,3}#[#\s]|\s{0,3}[-*+]\s|\s{0,3}\d+\.\s|\s{0,3}>\s|\s{0,3}```)/m.test(ct), ft = /^<([a-z][^ >/\n\r]*) ?([^>]*?)>/im.test(ct), pt = n.inline, mt = n.inHTML, gt = n.c;
1674
+ n.inHTML = !0, n.c = (n.c || 0) + 1, ut || dt || ft ? (n.inline = !1, rt = An(at, n, r)) : (n.inline = !0, rt = On(ct, 0, ct.length, n, r)), n.inline = pt, n.inHTML = mt, n.c = gt;
1675
+ }
1676
+ var _t = Ot(e, nt), vt = e.slice(nt, _t).trim() ? nt : Q(e, nt), yt = tt ? e.slice(a, nt) : e.slice(a, vt), X = tt ? nt : vt;
1677
+ return {
1678
+ node: {
1679
+ type: J.htmlBlock,
1680
+ tag: Qe,
1681
+ attrs: qt(Ze.attrs, Qe, r),
1682
+ e: Ze.whitespaceBeforeAttrs + Ze.rawAttrs,
1683
+ children: rt,
1684
+ a: yt,
1685
+ text: tt ? at : yt,
1686
+ d: !0,
1687
+ b: !1,
1688
+ endPos: X,
1689
+ canInterruptParagraph: !1
1690
+ },
1691
+ end: vt
1692
+ };
1693
+ }
1694
+ var bt = At(e, Ze.end), xt = bt < e.length ? Q(e, bt) : bt, St = e.slice(Ze.end, bt);
1695
+ if (St.trim()) {
1696
+ var { inline: Ct, inHTML: Z, c: wt } = n;
1697
+ n.inline = !1, n.inHTML = !0, n.c = (n.c || 0) + 1, rt = An(St, n, r), n.inline = Ct, n.inHTML = Z, n.c = wt;
1698
+ }
1699
+ var Tt = e.slice(Ze.end, bt);
1700
+ return {
1701
+ node: {
1702
+ type: J.htmlBlock,
1703
+ tag: Qe,
1704
+ attrs: qt(Ze.attrs, Qe, r),
1705
+ e: Ze.whitespaceBeforeAttrs + Ze.rawAttrs,
1706
+ children: rt,
1707
+ a: Tt,
1708
+ text: St,
1709
+ d: !0,
1710
+ b: !1,
1711
+ endPos: bt,
1712
+ canInterruptParagraph: !1
1713
+ },
1714
+ end: xt
1715
+ };
1716
+ }
1717
+ function $t(e, t) {
1718
+ if (e.charCodeAt(t) !== j) return 0;
1719
+ var n = t + 1, r = e.length;
1720
+ if (e.charCodeAt(n) === P && e.charCodeAt(n + 1) === E && e.charCodeAt(n + 2) === E) return 2;
1721
+ if (e.charCodeAt(n) === ce) return 3;
1722
+ if (e.charCodeAt(n) === P) {
1723
+ var i = e.charCodeAt(n + 1);
1724
+ if (i >= U && i <= W) return 4;
1725
+ if (e.slice(n + 1, n + 8) === "[CDATA[") return 5;
1726
+ }
1727
+ for (var a = e.charCodeAt(n) === ue, o = a ? n + 1 : n, s = o; s < r;) {
1728
+ var c = e.charCodeAt(s);
1729
+ if (c >= U && c <= W || c >= G && c <= K || c >= V && c <= H || c === E) s++;
1730
+ else break;
1731
+ }
1732
+ if (s === o) return 0;
1733
+ var l = e.slice(o, s);
1734
+ if (st.has(l.toLowerCase())) {
1735
+ if (a) return 0;
1736
+ var u = e.charCodeAt(s);
1737
+ return +(u === m || u === h || u === S || u === _ || s >= r);
1738
+ }
1739
+ if (Kt.has(l.toLowerCase())) {
1740
+ if (a) {
1741
+ for (var d = s; d < r && (e.charCodeAt(d) === m || e.charCodeAt(d) === h);) d++;
1742
+ return d < r && e.charCodeAt(d) === S ? 6 : 0;
1743
+ }
1744
+ var f = s < r ? e.charCodeAt(s) : -1;
1745
+ return f === m || f === h || f === S || f === _ || f === ue || f === -1 ? 6 : 0;
1746
+ }
1747
+ if (a) {
1748
+ for (var p = s; p < r && (e.charCodeAt(p) === m || e.charCodeAt(p) === h);) p++;
1749
+ if (p < r && e.charCodeAt(p) === S) {
1750
+ var g = Ot(e, t);
1751
+ if (e.slice(p + 1, g).trim() === "") return 7;
1752
+ }
1753
+ } else {
1754
+ var v = Ot(e, t), y = ht(e, t);
1755
+ if (y && y.end <= v && e.slice(y.end, v).trim() === "") return 7;
1756
+ }
1757
+ return 0;
1758
+ }
1759
+ function en(e, t, n) {
1760
+ for (var r = 0, i = e.length; r < i && (e.charCodeAt(r) === m || e.charCodeAt(r) === h);) r++;
1761
+ for (; i > r && (e.charCodeAt(i - 1) === m || e.charCodeAt(i - 1) === h);) i--;
1762
+ r < i && e.charCodeAt(r) === B && r++, i > r && e.charCodeAt(i - 1) === B && (i - 2 < r || e.charCodeAt(i - 2) !== O) && i--;
1763
+ for (var a = [], o = r, s = !1, c = [], l = r; l < i;) {
1764
+ var u = e.charCodeAt(l);
1765
+ if (u === O && l + 1 < i) {
1766
+ e.charCodeAt(l + 1) === B ? (s || (s = !0, c = []), c.push(e.slice(o, l)), c.push("|"), l += 2, o = l) : l += 2;
1767
+ continue;
1768
+ }
1769
+ if (u === v) {
1770
+ for (var d = 0; l < i && e.charCodeAt(l) === v;) d++, l++;
1771
+ for (var f = !1; l < i && !f;) {
1772
+ for (var p = 0; l < i && e.charCodeAt(l) === v;) p++, l++;
1773
+ p === d ? f = !0 : p === 0 && l++;
1774
+ }
1775
+ continue;
1776
+ }
1777
+ if (u === B) {
1778
+ var g = s ? (c.push(e.slice(o, l)), c.join("")) : e.slice(o, l);
1779
+ a.push(g.trim()), l++, o = l, s = !1, c = [];
1780
+ continue;
1781
+ }
1782
+ l++;
1783
+ }
1784
+ var _ = s ? (c.push(e.slice(o, i)), c.join("")) : e.slice(o, i);
1785
+ return a.push(_.trim()), a.map(function(e) {
1786
+ var r = e.indexOf("\\|") === -1 ? e : e.replace(/\\\|/g, "|");
1787
+ return On(r, 0, r.length, t, n);
1788
+ });
1789
+ }
1790
+ function tn(e, t, n, r) {
1791
+ let i = Ot(e, t);
1792
+ var a = e.indexOf("|", t);
1793
+ if (a < 0 || a >= i) return null;
1794
+ let o = Q(e, i);
1795
+ if (o >= e.length) return null;
1796
+ let s = Ot(e, o);
1797
+ if (!mt(e, o, s)) return null;
1798
+ let c = e.slice(t, i), l = e.slice(o, s);
1799
+ for (var u = [], d = 0, f = l.length; d < f && (l.charCodeAt(d) === m || l.charCodeAt(d) === h);) d++;
1800
+ for (d < f && l.charCodeAt(d) === B && d++; d < f;) {
1801
+ for (; d < f && (l.charCodeAt(d) === m || l.charCodeAt(d) === h);) d++;
1802
+ if (d >= f || l.charCodeAt(d) === B) break;
1803
+ var p = l.charCodeAt(d) === I;
1804
+ for (p && d++; d < f && l.charCodeAt(d) === E;) d++;
1805
+ var g = d < f && l.charCodeAt(d) === I;
1806
+ for (g && d++, u.push(p && g ? "center" : g ? "right" : p ? "left" : null); d < f && (l.charCodeAt(d) === m || l.charCodeAt(d) === h);) d++;
1807
+ d < f && l.charCodeAt(d) === B && d++;
1808
+ }
1809
+ let _ = en(c, n, r);
1810
+ if (u.length !== _.length) return null;
1811
+ let b = [], x = Q(e, s);
1812
+ for (; x < e.length;) {
1813
+ let t = Ot(e, x), i = e.slice(x, t);
1814
+ if (Ft(e, x, t)) break;
1815
+ if (Pt(e, x, t), Mt < 4) {
1816
+ var w = e.charCodeAt(x + Nt);
1817
+ if (w === S || w === C || (w === E || w === k || w === A) && Lt(e, x)) break;
1818
+ if (w === v || w === y) {
1819
+ for (var T = x + Nt, D = 0; T < t && e.charCodeAt(T) === w;) D++, T++;
1820
+ if (D >= 3) break;
1821
+ }
1822
+ }
1823
+ b.push(en(i, n, r)), x = Q(e, t);
1824
+ }
1825
+ if ((r.streaming || r.optimizeForStreaming) && b.length === 0) return null;
1826
+ for (var O = _.length, j = 0; j < b.length; j++) if (b[j].length < O) for (; b[j].length < O;) b[j].push([]);
1827
+ else b[j].length > O && (b[j].length = O);
1828
+ return {
1829
+ node: {
1830
+ type: J.table,
1831
+ header: _,
1832
+ cells: b,
1833
+ align: u
1834
+ },
1835
+ end: x
1836
+ };
1837
+ }
1838
+ function nn(e, t, n) {
1839
+ if (Pt(e, t, Ot(e, t)), Mt > 3) return null;
1840
+ var r = t + Nt;
1841
+ if (e.charCodeAt(r) !== b) return null;
1842
+ if (r + 1 < e.length && e.charCodeAt(r + 1) === x) return rn(e, r, n) || null;
1843
+ n.refs ||= {};
1844
+ var i = _t(e, r, n.refs);
1845
+ return i === null ? null : {
1846
+ node: { type: J.refCollection },
1847
+ end: i
1848
+ };
1849
+ }
1850
+ function rn(e, t, n) {
1851
+ var r = e.length;
1852
+ if (e.charCodeAt(t) !== b || t + 1 >= r || e.charCodeAt(t + 1) !== x) return null;
1853
+ for (var i = t + 2, a = i; i < r && e.charCodeAt(i) !== N;) {
1854
+ if (e.charCodeAt(i) === _) return null;
1855
+ i++;
1856
+ }
1857
+ if (i >= r) return null;
1858
+ var o = ("^" + e.slice(a, i)).toLowerCase();
1859
+ if (i++, i >= r || e.charCodeAt(i) !== I) return null;
1860
+ for (i++; i < r && (e.charCodeAt(i) === m || e.charCodeAt(i) === h);) i++;
1861
+ if (i < r && e.charCodeAt(i) === _) for (i++; i < r && (e.charCodeAt(i) === m || e.charCodeAt(i) === h);) i++;
1862
+ var s = e.indexOf("\n", i);
1863
+ s < 0 && (s = r);
1864
+ for (var c = e.slice(i, s).trim(), l = s < r ? s + 1 : r; l < r;) {
1865
+ var u = Ot(e, l);
1866
+ if (Pt(e, l, u), Mt >= 2 && !Ft(e, l, u)) c += "\n" + e.slice(l, u), l = Q(e, u);
1867
+ else if (Ft(e, l, u)) {
1868
+ var d = Q(e, u);
1869
+ if (d < r && (Pt(e, d, Ot(e, d)), Mt >= 2)) {
1870
+ c += "\n", l = Q(e, u);
1871
+ continue;
1872
+ }
1873
+ break;
1874
+ } else break;
1875
+ }
1876
+ return n.refs[o] || (n.refs[o] = {
1877
+ target: c,
1878
+ title: void 0
1879
+ }), {
1880
+ node: { type: J.footnote },
1881
+ end: l
1882
+ };
1883
+ }
1884
+ function an(e, t, n, r) {
1885
+ let i = t, a = 0, o = 0, s = -1;
1886
+ for (; i < e.length;) {
1887
+ let t = s >= 0 ? s : Ot(e, i);
1888
+ if (s = -1, Ft(e, i, t)) break;
1889
+ if (Pt(e, i, t), Mt < 4 && o > 0 && !n.f) {
1890
+ let n = e.charCodeAt(i + Nt);
1891
+ if (n === D || n === E) {
1892
+ let r = i + Nt;
1893
+ for (; r < t && e.charCodeAt(r) === n;) r++;
1894
+ for (; r < t && (e.charCodeAt(r) === m || e.charCodeAt(r) === h);) r++;
1895
+ if (r >= t) {
1896
+ a = n === D ? 1 : 2, i = Q(e, t);
1897
+ break;
1898
+ }
1899
+ }
1900
+ }
1901
+ o = t;
1902
+ let g = Q(e, t);
1903
+ if (g < e.length) {
1904
+ if (e.charCodeAt(g) === ve) {
1905
+ var c = Ot(e, g);
1906
+ i = Q(e, c), o = c;
1907
+ continue;
1908
+ }
1909
+ let t = Ot(e, g);
1910
+ if (s = t, Pt(e, g, t), Mt < 4) {
1911
+ let a = e.charCodeAt(g + Nt);
1912
+ if (a === S) {
1913
+ i = g;
1914
+ break;
1915
+ }
1916
+ if (a === C && It(e, g, n, r)) {
1917
+ i = g;
1918
+ break;
1919
+ }
1920
+ if (a === v || a === y) {
1921
+ for (var l = g + Nt, u = 0; l < t && e.charCodeAt(l) === a;) u++, l++;
1922
+ if (u >= 3) {
1923
+ i = g;
1924
+ break;
1925
+ }
1926
+ }
1927
+ if (a === j) {
1928
+ var d = g + Nt + 1, f = d < t ? e.charCodeAt(d) : 0, p = f === P || f === ce;
1929
+ if (!p && f === ue) {
1930
+ for (var b = d + 1, x = b; x < t && (e.charCodeAt(x) >= U && e.charCodeAt(x) <= W || e.charCodeAt(x) >= G && e.charCodeAt(x) <= K || e.charCodeAt(x) >= V && e.charCodeAt(x) <= H || e.charCodeAt(x) === E);) x++;
1931
+ x > b && (p = Kt.has(e.slice(b, x).toLowerCase()));
1932
+ } else if (!p) {
1933
+ for (var w = d; w < t && (e.charCodeAt(w) >= U && e.charCodeAt(w) <= W || e.charCodeAt(w) >= G && e.charCodeAt(w) <= K || e.charCodeAt(w) >= V && e.charCodeAt(w) <= H || e.charCodeAt(w) === E);) w++;
1934
+ if (w > d) {
1935
+ var T = e.slice(d, w).toLowerCase();
1936
+ p = Kt.has(T) || st.has(T);
1937
+ }
1938
+ }
1939
+ if (p && Qt(e, g, n, r)) {
1940
+ i = g;
1941
+ break;
1942
+ }
1943
+ }
1944
+ if (a === E || a === k || a === pe) {
1945
+ let n = g + Nt + 1;
1946
+ if (n < t && (e.charCodeAt(n) === m || e.charCodeAt(n) === h) && kt(e, n, t) < t && !Lt(e, g)) {
1947
+ i = g;
1948
+ break;
1949
+ }
1950
+ }
1951
+ if (a >= V && a <= H) {
1952
+ let n = g + Nt;
1953
+ for (; n < t && e.charCodeAt(n) >= V && e.charCodeAt(n) <= H;) n++;
1954
+ if (n < t && (e.charCodeAt(n) === le || e.charCodeAt(n) === _e) && n - (g + Nt) === 1 && e.charCodeAt(g + Nt) === 49) {
1955
+ var O = n + 1;
1956
+ if (O < t && (e.charCodeAt(O) === m || e.charCodeAt(O) === h) && kt(e, O, t) < t) {
1957
+ i = g;
1958
+ break;
1959
+ }
1960
+ }
1961
+ }
1962
+ if (a === B) {
1963
+ let n = Q(e, t);
1964
+ if (n < e.length && mt(e, n, Ot(e, n))) {
1965
+ i = g;
1966
+ break;
1967
+ }
1968
+ }
1969
+ if ((a === E || a === k || a === A) && Lt(e, g)) {
1970
+ if (a !== E) {
1971
+ i = g;
1972
+ break;
1973
+ }
1974
+ let n = 0, r = g + Nt;
1975
+ for (; r < t && e.charCodeAt(r) === E;) n++, r++;
1976
+ for (; r < t && (e.charCodeAt(r) === m || e.charCodeAt(r) === h);) r++;
1977
+ if (r < t) {
1978
+ i = g;
1979
+ break;
1980
+ }
1981
+ }
1982
+ }
1983
+ }
1984
+ i = Q(e, t);
1985
+ }
1986
+ for (var M = a ? o : i; M > t && (e.charCodeAt(M - 1) === _ || e.charCodeAt(M - 1) === g || e.charCodeAt(M - 1) === m || e.charCodeAt(M - 1) === h);) M--;
1987
+ for (var N = t; N < M && (e.charCodeAt(N) === m || e.charCodeAt(N) === h);) N++;
1988
+ if (N >= M) return null;
1989
+ for (var F = !1, I = N; I < M; I++) if (e.charCodeAt(I) === ve) {
1990
+ F = !0;
1991
+ break;
1992
+ }
1993
+ var L = F ? e.slice(N, M).replace(/\u001E/g, "") : e.slice(N, M);
1994
+ if (!L) return null;
1995
+ let R = on(L, 0, L.length, n, r);
1996
+ if (a) {
1997
+ let e = (r?.slugify || Me)(L);
1998
+ return {
1999
+ node: {
2000
+ type: J.heading,
2001
+ level: a,
2002
+ children: R,
2003
+ id: e
2004
+ },
2005
+ end: i
2006
+ };
2007
+ }
2008
+ return {
2009
+ node: {
2010
+ type: J.paragraph,
2011
+ children: R
2012
+ },
2013
+ end: i
2014
+ };
2015
+ }
2016
+ function on(e, t, n, r, i) {
2017
+ var a = e.indexOf("\n", t);
2018
+ if (a < 0 || a >= n) return On(e, t, n, r, i);
2019
+ for (var o = "", s = t, c = t; c < n;) {
2020
+ var l = e.charCodeAt(c);
2021
+ if (l === v) {
2022
+ var u = cn(e, c, n);
2023
+ if (u > c) {
2024
+ for (var d = !1, f = c; f < u; f++) if (e.charCodeAt(f) === _) {
2025
+ d = !0;
2026
+ break;
2027
+ }
2028
+ d && (o += e.slice(s, c), o += e.slice(c, u).replace(/\n/g, " "), s = u), c = u;
2029
+ continue;
2030
+ }
2031
+ }
2032
+ if (l === j) {
2033
+ var p = ln(e, c, n);
2034
+ if (p > c) {
2035
+ c = p;
2036
+ continue;
2037
+ }
2038
+ }
2039
+ if (l === _) {
2040
+ var h = !1, g = 0;
2041
+ if (c > t && e.charCodeAt(c - 1) === O) h = !0, g = 1;
2042
+ else {
2043
+ for (var y = 0, b = c - 1; b >= t && e.charCodeAt(b) === m;) y++, b--;
2044
+ y >= 2 && (h = !0, g = y);
2045
+ }
2046
+ for (h ? (o += e.slice(s, c - g), o += "") : o += e.slice(s, c + 1), c++; c < n && e.charCodeAt(c) === m;) c++;
2047
+ s = c;
2048
+ continue;
2049
+ }
2050
+ c++;
2051
+ }
2052
+ return s < n && (o += e.slice(s, n)), On(o, 0, o.length, r, i);
2053
+ }
2054
+ function sn(e, t, n) {
2055
+ if (e.charCodeAt(t) !== v) return null;
2056
+ let r = jt(e, t, n, 96), i = t + r;
2057
+ for (; i < n;) {
2058
+ let a = e.indexOf("`", i);
2059
+ if (a < 0 || a >= n) return null;
2060
+ let o = jt(e, a, n, 96);
2061
+ if (o === r) {
2062
+ let n = e.slice(t + r, a);
2063
+ return n = n.replace(/\n/g, " "), n.length > 0 && n[0] === " " && n[n.length - 1] === " " && n.trim().length > 0 && (n = n.slice(1, -1)), {
2064
+ node: {
2065
+ type: J.codeInline,
2066
+ text: n
2067
+ },
2068
+ end: a + o
2069
+ };
2070
+ }
2071
+ i = a + o;
2072
+ }
2073
+ return null;
2074
+ }
2075
+ function cn(e, t, n) {
2076
+ if (e.charCodeAt(t) !== v) return t;
2077
+ let r = jt(e, t, n, 96), i = t + r;
2078
+ for (; i < n;) {
2079
+ let a = e.indexOf("`", i);
2080
+ if (a < 0 || a >= n) return t;
2081
+ let o = jt(e, a, n, 96);
2082
+ if (o === r) return a + o;
2083
+ i = a + o;
2084
+ }
2085
+ return t;
2086
+ }
2087
+ function ln(e, t, n) {
2088
+ if (e.charCodeAt(t) !== j) return t;
2089
+ if (t + 1 < n && e.charCodeAt(t + 1) === ue) {
2090
+ let r = t + 2;
2091
+ for (; r < n && e.charCodeAt(r) !== S;) r++;
2092
+ return r < n ? r + 1 : t;
2093
+ }
2094
+ if (t + 3 < n && e.charCodeAt(t + 1) === P && e.charCodeAt(t + 2) === E && e.charCodeAt(t + 3) === E) {
2095
+ let n = e.indexOf("-->", t + 4);
2096
+ return n >= 0 ? n + 3 : t;
2097
+ }
2098
+ let r = t + 1, i = r;
2099
+ for (; r < n;) {
2100
+ let t = e.charCodeAt(r);
2101
+ if (t >= U && t <= W || t >= G && t <= K || t >= V && t <= H || t === E) r++;
2102
+ else break;
2103
+ }
2104
+ if (r === i) return t;
2105
+ let a = e.slice(i, r).toLowerCase(), o = !1;
2106
+ for (; r < n;) {
2107
+ let i = e.charCodeAt(r);
2108
+ if (i === S) {
2109
+ r++;
2110
+ break;
2111
+ }
2112
+ if (i === ue && r + 1 < n && e.charCodeAt(r + 1) === S) {
2113
+ r += 2, o = !0;
2114
+ break;
2115
+ }
2116
+ if (i === fe || i === de) {
2117
+ var s = i;
2118
+ for (r++; r < n && e.charCodeAt(r) !== s;) r++;
2119
+ r < n && r++;
2120
+ continue;
2121
+ }
2122
+ if (i === _) return t;
2123
+ r++;
2124
+ }
2125
+ if (o || Fe(a)) return r;
2126
+ let c = 1;
2127
+ for (; r < n && c > 0;) if (e.charCodeAt(r) === j) if (r + 1 < n && e.charCodeAt(r + 1) === ue) {
2128
+ let t = r + 2, i = t;
2129
+ for (; i < n && (e.charCodeAt(i) >= U && e.charCodeAt(i) <= W || e.charCodeAt(i) >= G && e.charCodeAt(i) <= K);) i++;
2130
+ if (e.slice(t, i).toLowerCase() === a) {
2131
+ for (; i < n && e.charCodeAt(i) !== S;) i++;
2132
+ if (i < n && i++, c--, c === 0) return i;
2133
+ }
2134
+ r = i;
2135
+ } else {
2136
+ let t = r + 1, i = t;
2137
+ for (; i < n && (e.charCodeAt(i) >= U && e.charCodeAt(i) <= W || e.charCodeAt(i) >= G && e.charCodeAt(i) <= K);) i++;
2138
+ e.slice(t, i).toLowerCase() === a && c++, r++;
2139
+ }
2140
+ else r++;
2141
+ return r;
2142
+ }
2143
+ function un(e, t, n, r, i) {
2144
+ if (e.charCodeAt(t) !== y || t + 1 >= n || e.charCodeAt(t + 1) !== y) return null;
2145
+ let a = t + 2;
2146
+ for (; a + 1 < n;) {
2147
+ let o = e.charCodeAt(a);
2148
+ if (o === v) {
2149
+ let t = cn(e, a, n);
2150
+ if (t > a) {
2151
+ a = t;
2152
+ continue;
2153
+ }
2154
+ }
2155
+ if (o === y && e.charCodeAt(a + 1) === y) {
2156
+ let n = e.slice(t + 2, a), o = On(n, 0, n.length, r, i);
2157
+ return {
2158
+ node: {
2159
+ type: J.textFormatted,
2160
+ tag: "del",
2161
+ children: o
2162
+ },
2163
+ end: a + 2
2164
+ };
2165
+ }
2166
+ o === O && a + 1 < n && a++, a++;
2167
+ }
2168
+ return null;
2169
+ }
2170
+ function dn(e, t, n, r, i) {
2171
+ if (e.charCodeAt(t) !== D || t + 1 >= n || e.charCodeAt(t + 1) !== D) return null;
2172
+ let a = t + 2;
2173
+ for (; a + 1 < n;) {
2174
+ let o = e.charCodeAt(a);
2175
+ if (o === v) {
2176
+ let t = cn(e, a, n);
2177
+ if (t > a) {
2178
+ a = t;
2179
+ continue;
2180
+ }
2181
+ }
2182
+ if (o === D && e.charCodeAt(a + 1) === D && a > t + 2) {
2183
+ let n = e.slice(t + 2, a), o = On(n, 0, n.length, r, i);
2184
+ return {
2185
+ node: {
2186
+ type: J.textFormatted,
2187
+ tag: "mark",
2188
+ children: o
2189
+ },
2190
+ end: a + 2
2191
+ };
2192
+ }
2193
+ o === O && a + 1 < n && a++, a++;
2194
+ }
2195
+ return null;
2196
+ }
2197
+ var fn = /[\p{P}\p{S}]/u;
2198
+ function pn(e, t, n) {
2199
+ return e < be ? !!(Et(e) & X) : fn.test(t[n]);
2200
+ }
2201
+ function mn(e, t, n) {
2202
+ return e < be ? !!(Et(e) & vt) : /\p{Zs}/u.test(t[n]);
2203
+ }
2204
+ function hn(e, t, n) {
2205
+ var r = e.charCodeAt(t);
2206
+ if (r !== k && r !== A) return null;
2207
+ var i = jt(e, t, n, r);
2208
+ if (i === 0) return null;
2209
+ var a = t > 0 ? e.charCodeAt(t - 1) : 32, o = t + i < n ? e.charCodeAt(t + i) : 32, s = mn(a, e, t - 1), c = mn(o, e, t + i), l = t > 0 ? pn(a, e, t - 1) : !1, u = t + i < n ? pn(o, e, t + i) : !1, d = !c && (!u || s || l), f = !s && (!l || c || u), p, m;
2210
+ return r === k ? (p = d, m = f) : (p = d && (!f || l), m = f && (!d || u)), {
2211
+ len: i,
2212
+ canOpen: p,
2213
+ canClose: m
2214
+ };
2215
+ }
2216
+ function gn(e, t, n, r) {
2217
+ if (t.length !== 0) {
2218
+ for (var i = [], a = 0; a < 12; a++) i[a] = -1;
2219
+ for (var o = 0; o < t.length;) {
2220
+ var s = t[o];
2221
+ if (!s.active || !s.canClose) {
2222
+ o++;
2223
+ continue;
2224
+ }
2225
+ for (var c = (s.ch === k ? 0 : 1) * 6 + s.len % 3 * 2 + +!!s.canOpen, l = i[c] === void 0 ? -1 : i[c], u = -1, d = o - 1; d > l; d--) {
2226
+ var f = t[d];
2227
+ if (!(!f.active || f.ch !== s.ch || !f.canOpen) && !((s.canOpen || f.canClose) && (f.len + s.len) % 3 == 0 && f.len % 3 != 0)) {
2228
+ u = d;
2229
+ break;
2230
+ }
2231
+ }
2232
+ if (u < 0) {
2233
+ i[c] = o - 1, !s.canOpen && (s.active = !1), o++;
2234
+ continue;
2235
+ }
2236
+ var p = t[u], m = p.len >= 2 && s.len >= 2, h = m ? 2 : 1;
2237
+ p.len -= h, s.len -= h;
2238
+ var g = e[p.idx], _ = e[s.idx];
2239
+ g.text = g.text.slice(0, g.text.length - h), _.text = _.text.slice(h);
2240
+ var v = p.idx + 1, y = s.idx, b = e.slice(v, y), x = {
2241
+ type: J.textFormatted,
2242
+ tag: m ? "strong" : "em",
2243
+ children: b
2244
+ };
2245
+ e.splice(v, y - v, x);
2246
+ for (var S = y - v - 1, C = 0; C < t.length; C++) t[C].idx > p.idx && (t[C].idx -= S);
2247
+ for (var w = u + 1; w < o; w++) t[w].active = !1;
2248
+ if (p.len === 0 && (p.active = !1, g.text === "")) {
2249
+ e.splice(p.idx, 1);
2250
+ for (var T = 0; T < t.length; T++) t[T].idx > p.idx ? t[T].idx-- : t[T].idx === p.idx && (t[T].idx = -1);
2251
+ }
2252
+ if (s.len === 0) {
2253
+ s.active = !1;
2254
+ var E = s.idx;
2255
+ if (_.text === "") {
2256
+ e.splice(E, 1);
2257
+ for (var D = 0; D < t.length; D++) t[D].idx > E ? t[D].idx-- : t[D].idx === E && (t[D].idx = -1);
2258
+ }
2259
+ } else continue;
2260
+ o++;
2261
+ }
2262
+ for (var O = 0, A = 0; A < e.length; A++) {
2263
+ var j = e[A];
2264
+ if (j.type === J.text) {
2265
+ var M = j;
2266
+ if (M.text === "") continue;
2267
+ if (O > 0 && e[O - 1].type === J.text) {
2268
+ e[O - 1].text += M.text;
2269
+ continue;
2270
+ }
2271
+ }
2272
+ e[O++] = j;
2273
+ }
2274
+ e.length = O;
2275
+ }
2276
+ }
2277
+ function _n(e, t, n, r, i) {
2278
+ let a = e.charCodeAt(t) === P, o = a ? t + 1 : t;
2279
+ if (e.charCodeAt(o) !== b) return null;
2280
+ var s = e.indexOf("]", o + 1);
2281
+ if (s < 0 || s >= n) return null;
2282
+ for (var c = o + 1, l = 1; c < n && l > 0;) {
2283
+ var u = e.charCodeAt(c);
2284
+ if (u === O && c + 1 < n) {
2285
+ c += 2;
2286
+ continue;
2287
+ }
2288
+ if (u === v) {
2289
+ var d = cn(e, c, n);
2290
+ if (d > c) {
2291
+ c = d;
2292
+ continue;
2293
+ }
2294
+ }
2295
+ if (u === j) {
2296
+ var f = vn(e, c, n);
2297
+ if (f) {
2298
+ c = f.end;
2299
+ continue;
2300
+ }
2301
+ var p = ln(e, c, n);
2302
+ if (p > c) {
2303
+ c = p;
2304
+ continue;
2305
+ }
2306
+ }
2307
+ u === b ? l++ : u === N && l--, c++;
2308
+ }
2309
+ if (l !== 0) return null;
2310
+ var h = c - 1, g = e.slice(o + 1, h), y = c < n ? e.charCodeAt(c) : 0, x = !1;
2311
+ if (y === ge) {
2312
+ var C = !0;
2313
+ for (c++; c < n && (e.charCodeAt(c) === m || e.charCodeAt(c) === _);) c++;
2314
+ var w = "", T = c;
2315
+ if (c < n && e.charCodeAt(c) === j) {
2316
+ for (c++, T = c; T < n && e.charCodeAt(T) !== S;) {
2317
+ if (e.charCodeAt(T) === O && T + 1 < n) {
2318
+ T += 2;
2319
+ continue;
2320
+ }
2321
+ if (e.charCodeAt(T) === _) {
2322
+ C = !1;
2323
+ break;
2324
+ }
2325
+ T++;
2326
+ }
2327
+ C && (T >= n || e.charCodeAt(T) !== S) && (C = !1), C && (w = e.slice(c, T), T++);
2328
+ } else if (C) {
2329
+ for (var E = 0; T < n;) {
2330
+ var D = e.charCodeAt(T);
2331
+ if (D === O && T + 1 < n) {
2332
+ T += 2;
2333
+ continue;
2334
+ }
2335
+ if (D === ge) E++;
2336
+ else if (D === _e) {
2337
+ if (E === 0) break;
2338
+ E--;
2339
+ } else if (D === m || D === _) break;
2340
+ T++;
2341
+ }
2342
+ w = e.slice(c, T);
2343
+ }
2344
+ if (C) {
2345
+ for (c = T; c < n && (e.charCodeAt(c) === m || e.charCodeAt(c) === _);) c++;
2346
+ var k;
2347
+ if (c < n) {
2348
+ var A = e.charCodeAt(c);
2349
+ if (A === fe || A === de || A === ge) {
2350
+ var M = A === ge ? 41 : A;
2351
+ c++;
2352
+ for (var F = c; c < n && e.charCodeAt(c) !== M;) e.charCodeAt(c) === O && c + 1 < n && c++, c++;
2353
+ c >= n ? C = !1 : (k = e.slice(F, c), c++);
2354
+ }
2355
+ }
2356
+ if (C) {
2357
+ for (; c < n && (e.charCodeAt(c) === m || e.charCodeAt(c) === _);) c++;
2358
+ (c >= n || e.charCodeAt(c) !== _e) && (C = !1);
2359
+ }
2360
+ }
2361
+ if (C) {
2362
+ c++, w = Dt(w), k !== void 0 && (k = Y(Dt(k)));
2363
+ var I = (i?.sanitizer || De)(w, a ? "img" : "a", a ? "src" : "href") === null ? null : w;
2364
+ if (a) {
2365
+ var L = Cn(On(g, 0, g.length, r, i));
2366
+ return {
2367
+ node: {
2368
+ type: J.image,
2369
+ target: I,
2370
+ alt: L,
2371
+ title: k
2372
+ },
2373
+ end: c
2374
+ };
2375
+ } else {
2376
+ var R = r.inAnchor;
2377
+ r.inAnchor = !0;
2378
+ var ee = R ? [{
2379
+ type: J.text,
2380
+ text: g
2381
+ }] : On(g, 0, g.length, r, i);
2382
+ return r.inAnchor = R, !r.inAnchor && Sn(ee) ? null : {
2383
+ node: {
2384
+ type: J.link,
2385
+ target: I,
2386
+ title: k,
2387
+ children: ee
2388
+ },
2389
+ end: c
2390
+ };
2391
+ }
2392
+ } else c = h + 1, x = !0;
2393
+ }
2394
+ var te = "", z = c;
2395
+ if (!x && y === b) {
2396
+ var ne = c + 1;
2397
+ z = ne;
2398
+ for (var re = !1; z < n && e.charCodeAt(z) !== N;) {
2399
+ if (e.charCodeAt(z) === O && z + 1 < n) {
2400
+ z += 2;
2401
+ continue;
2402
+ }
2403
+ if (e.charCodeAt(z) === b) {
2404
+ re = !0;
2405
+ break;
2406
+ }
2407
+ z++;
2408
+ }
2409
+ if (re || z >= n) return null;
2410
+ var ie = e.slice(ne, z);
2411
+ if (ie.trim()) te = Tt(ie);
2412
+ else {
2413
+ if (wt(g)) return null;
2414
+ te = Tt(g);
2415
+ }
2416
+ z += 1;
2417
+ } else {
2418
+ if (wt(g)) return null;
2419
+ te = Tt(g);
2420
+ }
2421
+ var ae = r.refs[te];
2422
+ if (!ae) return null;
2423
+ if (a) return {
2424
+ node: {
2425
+ type: J.image,
2426
+ target: ae.target,
2427
+ alt: Cn(On(g, 0, g.length, r, i)),
2428
+ title: ae.title
2429
+ },
2430
+ end: z
2431
+ };
2432
+ var oe = r.inAnchor;
2433
+ r.inAnchor = !0;
2434
+ var ee = oe ? [{
2435
+ type: J.text,
2436
+ text: g
2437
+ }] : On(g, 0, g.length, r, i);
2438
+ return r.inAnchor = oe, !r.inAnchor && Sn(ee) ? null : {
2439
+ node: {
2440
+ type: J.link,
2441
+ target: ae.target,
2442
+ title: ae.title,
2443
+ children: ee
2444
+ },
2445
+ end: z
2446
+ };
2447
+ }
2448
+ function vn(e, t, n) {
2449
+ if (e.charCodeAt(t) !== j) return null;
2450
+ for (var r = t + 1; r < n;) {
2451
+ var i = e.charCodeAt(r);
2452
+ if (i === S) break;
2453
+ if (i === m || i === _ || i === g || i === j) return null;
2454
+ r++;
2455
+ }
2456
+ if (r >= n || e.charCodeAt(r) !== S) return null;
2457
+ var a = e.slice(t + 1, r);
2458
+ return a.match(/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^\x00-\x20]*)$/) ? {
2459
+ node: {
2460
+ type: J.link,
2461
+ target: a,
2462
+ children: [{
2463
+ type: J.text,
2464
+ text: a
2465
+ }]
2466
+ },
2467
+ end: r + 1
2468
+ } : a.indexOf("@") !== -1 && /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a) ? {
2469
+ node: {
2470
+ type: J.link,
2471
+ target: "mailto:" + a,
2472
+ children: [{
2473
+ type: J.text,
2474
+ text: a
2475
+ }]
2476
+ },
2477
+ end: r + 1
2478
+ } : null;
2479
+ }
2480
+ function yn(e, t, n, r) {
2481
+ if (e.charCodeAt(t) !== b || t + 1 >= n || e.charCodeAt(t + 1) !== x) return null;
2482
+ let i = t + 2;
2483
+ for (; i < n && e.charCodeAt(i) !== N && e.charCodeAt(i) !== _;) i++;
2484
+ if (i >= n || e.charCodeAt(i) !== N) return null;
2485
+ let a = e.slice(t + 2, i);
2486
+ return a ? {
2487
+ node: {
2488
+ type: J.footnoteReference,
2489
+ target: "#" + Me(a),
2490
+ text: a
2491
+ },
2492
+ end: i + 1
2493
+ } : null;
2494
+ }
2495
+ function bn(e, t, n, r) {
2496
+ if (r.disableBareUrls) return null;
2497
+ var i = "", a = !1, o = e.charCodeAt(t);
2498
+ if (o === ee || o === 72 ? t + 8 <= n && e.charCodeAt(t + 1) === z && e.charCodeAt(t + 2) === z && e.charCodeAt(t + 3) === ne && (e.charCodeAt(t + 4) === re && e.charCodeAt(t + 5) === I && e.charCodeAt(t + 6) === ue && e.charCodeAt(t + 7) === ue ? i = "https://" : e.charCodeAt(t + 4) === I && e.charCodeAt(t + 5) === ue && e.charCodeAt(t + 6) === ue && (i = "http://")) : o === R || o === 70 ? t + 6 <= n && e.charCodeAt(t + 1) === z && e.charCodeAt(t + 2) === ne && e.charCodeAt(t + 3) === I && e.charCodeAt(t + 4) === ue && e.charCodeAt(t + 5) === ue && (i = "ftp://") : (o === te || o === 87) && t + 4 <= n && e.charCodeAt(t + 1) === te && e.charCodeAt(t + 2) === te && e.charCodeAt(t + 3) === le && (i = "www.", a = !0), !i) return null;
2499
+ let s = t + i.length;
2500
+ for (; s < n;) {
2501
+ let t = e.charCodeAt(s);
2502
+ if (t === m || t === _ || t === h || t === g || t === j || t === S) break;
2503
+ s++;
2504
+ }
2505
+ for (var c = 0, l = 0, u = t; u < s; u++) {
2506
+ var d = e.charCodeAt(u);
2507
+ d === ge ? c++ : d === _e && l++;
2508
+ }
2509
+ let f = s;
2510
+ for (; f > t + i.length;) {
2511
+ let n = e.charCodeAt(f - 1);
2512
+ if (n === le || n === oe || n === I || n === P || n === ce || n === _e) {
2513
+ if (n === _e) {
2514
+ if (c >= l) break;
2515
+ l--;
2516
+ }
2517
+ f--;
2518
+ } else if (n === se) {
2519
+ for (var p = f - 2; p > t && (e.charCodeAt(p) >= U && e.charCodeAt(p) <= W || e.charCodeAt(p) >= G && e.charCodeAt(p) <= K || e.charCodeAt(p) >= V && e.charCodeAt(p) <= H);) p--;
2520
+ p >= t && e.charCodeAt(p) === F ? f = p : f--;
2521
+ } else break;
2522
+ }
2523
+ if (f <= t + i.length) return null;
2524
+ var v = t + (a ? 4 : i.length), y = e.indexOf("/", v);
2525
+ if ((y < 0 || y > f) && (y = f), a && e.indexOf(".", v) === -1) return null;
2526
+ for (var b = -1, x = -1, C = y - 1; C >= v; C--) if (e.charCodeAt(C) === le) if (b < 0) b = C;
2527
+ else {
2528
+ x = C;
2529
+ break;
2530
+ }
2531
+ for (var C = x >= 0 ? x + 1 : v; C < y; C++) if (e.charCodeAt(C) === A) return null;
2532
+ var w = e.slice(t, f), T = a ? "http://" + w : w;
2533
+ return {
2534
+ node: {
2535
+ type: J.link,
2536
+ target: T,
2537
+ children: [{
2538
+ type: J.text,
2539
+ text: w
2540
+ }]
2541
+ },
2542
+ end: f
2543
+ };
2544
+ }
2545
+ function xn(e, t, n, r) {
2546
+ if (r.disableBareUrls) return null;
2547
+ for (var i = t, a = i; i < n;) {
2548
+ var o = e.charCodeAt(i);
2549
+ if (o >= U && o <= W || o >= G && o <= K || o >= V && o <= H || o === le || o === P || o === C || o === 36 || o === T || o === F || o === de || o === k || o === pe || o === ue || o === D || o === ce || o === x || o === A || o === v || o === me || o === B || o === he || o === y || o === E) i++;
2550
+ else break;
2551
+ }
2552
+ if (i === a || i >= n || e.charCodeAt(i) !== M) return null;
2553
+ i++;
2554
+ for (var s = i, c = -1, l = i; i < n;) {
2555
+ var o = e.charCodeAt(i);
2556
+ if (o >= U && o <= W || o >= G && o <= K || o >= V && o <= H) i++;
2557
+ else if ((o === E || o === A) && i > s) i++;
2558
+ else if (o === le) {
2559
+ if (i === s) break;
2560
+ var u = e.charCodeAt(i - 1);
2561
+ if (u === E || u === A || i - l > 63) break;
2562
+ if (i + 1 < n) {
2563
+ var d = e.charCodeAt(i + 1);
2564
+ if (d >= U && d <= W || d >= G && d <= K || d >= V && d <= H) c = i, l = i + 1, i++;
2565
+ else break;
2566
+ } else break;
2567
+ } else break;
2568
+ }
2569
+ if (i - l > 63 || c < 0) return null;
2570
+ var f = e.charCodeAt(i - 1);
2571
+ if (!(f >= U && f <= W || f >= G && f <= K || f >= V && f <= H) || i <= c + 1) return null;
2572
+ for (var p = -1, m = c - 1; m >= s; m--) if (e.charCodeAt(m) === le) {
2573
+ p = m;
2574
+ break;
2575
+ }
2576
+ for (var m = p >= 0 ? p + 1 : s; m < i; m++) if (e.charCodeAt(m) === A) return null;
2577
+ var h = e.slice(t, i);
2578
+ return {
2579
+ node: {
2580
+ type: J.link,
2581
+ target: "mailto:" + h,
2582
+ children: [{
2583
+ type: J.text,
2584
+ text: h
2585
+ }]
2586
+ },
2587
+ end: i
2588
+ };
2589
+ }
2590
+ function Sn(e) {
2591
+ for (var t = 0; t < e.length; t++) if (e[t].type === J.link || "children" in e[t] && Array.isArray(e[t].children) && Sn(e[t].children)) return !0;
2592
+ return !1;
2593
+ }
2594
+ function Cn(e) {
2595
+ for (var t = "", n = 0; n < e.length; n++) {
2596
+ var r = e[n];
2597
+ r.type === J.text ? t += r.text : r.type === J.breakLine ? t += " " : r.type === J.codeInline ? t += r.text : "children" in r && Array.isArray(r.children) ? t += Cn(r.children) : r.type === J.image ? t += r.alt || "" : r.type === J.link && (t += Cn(r.children));
2598
+ }
2599
+ return t;
2600
+ }
2601
+ function wn(e) {
2602
+ let t = e.includes("&") ? Y(e) : e;
2603
+ return {
2604
+ type: J.text,
2605
+ text: t
2606
+ };
2607
+ }
2608
+ function Tn(e, t, n, r, i) {
2609
+ if (e.charCodeAt(t) !== j) return null;
2610
+ var a = t + 1;
2611
+ if (a >= n) return null;
2612
+ var o = e.charCodeAt(a);
2613
+ if (o === P && a + 1 < n && e.charCodeAt(a + 1) === E && a + 2 < n && e.charCodeAt(a + 2) === E) {
2614
+ var s = a + 3;
2615
+ if (s < n && e.charCodeAt(s) === S) return {
2616
+ node: {
2617
+ type: J.htmlComment,
2618
+ text: "",
2619
+ endsWithGreaterThan: !0
2620
+ },
2621
+ end: s + 1
2622
+ };
2623
+ if (s + 1 < n && e.charCodeAt(s) === E && e.charCodeAt(s + 1) === S) return {
2624
+ node: {
2625
+ type: J.htmlComment,
2626
+ text: "-",
2627
+ endsWithGreaterThan: !0
2628
+ },
2629
+ end: s + 2
2630
+ };
2631
+ var c = e.indexOf("-->", s);
2632
+ return c !== -1 && c <= n - 3 ? {
2633
+ node: {
2634
+ type: J.htmlComment,
2635
+ text: e.slice(t + 4, c)
2636
+ },
2637
+ end: c + 3
2638
+ } : null;
2639
+ }
2640
+ if (o === ce) {
2641
+ var l = e.indexOf("?>", a + 1);
2642
+ return l !== -1 && l < n ? {
2643
+ node: {
2644
+ type: J.htmlSelfClosing,
2645
+ tag: "?",
2646
+ attrs: {},
2647
+ a: e.slice(t, l + 2)
2648
+ },
2649
+ end: l + 2
2650
+ } : null;
2651
+ }
2652
+ if (o === P && a + 1 < n) {
2653
+ var u = e.charCodeAt(a + 1);
2654
+ if (u === b && e.slice(a + 1, a + 8) === "[CDATA[") {
2655
+ var d = e.indexOf("]]>", a + 8);
2656
+ return d !== -1 && d < n ? {
2657
+ node: {
2658
+ type: J.htmlSelfClosing,
2659
+ tag: "![CDATA[",
2660
+ attrs: {},
2661
+ a: e.slice(t, d + 3)
2662
+ },
2663
+ end: d + 3
2664
+ } : null;
2665
+ }
2666
+ if (u >= U && u <= W) {
2667
+ var f = e.indexOf(">", a + 2);
2668
+ return f !== -1 && f < n ? {
2669
+ node: {
2670
+ type: J.htmlSelfClosing,
2671
+ tag: "!" + e.slice(a + 1, f),
2672
+ attrs: {},
2673
+ a: e.slice(t, f + 1)
2674
+ },
2675
+ end: f + 1
2676
+ } : null;
2677
+ }
2678
+ }
2679
+ if (o === ue) {
2680
+ var p = a + 1;
2681
+ if (p >= n) return null;
2682
+ var g = e.charCodeAt(p);
2683
+ if (!(g >= U && g <= W || g >= G && g <= K)) return null;
2684
+ for (p++; p < n;) {
2685
+ var v = e.charCodeAt(p);
2686
+ if (v >= U && v <= W || v >= G && v <= K || v >= V && v <= H || v === E) p++;
2687
+ else break;
2688
+ }
2689
+ for (; p < n && (e.charCodeAt(p) === m || e.charCodeAt(p) === h || e.charCodeAt(p) === _);) p++;
2690
+ if (p < n && e.charCodeAt(p) === S) {
2691
+ var y = e.slice(a + 1, p).trim();
2692
+ return {
2693
+ node: {
2694
+ type: J.htmlSelfClosing,
2695
+ tag: y,
2696
+ attrs: {},
2697
+ a: e.slice(t, p + 1),
2698
+ b: !0
2699
+ },
2700
+ end: p + 1
2701
+ };
2702
+ }
2703
+ return null;
2704
+ }
2705
+ if (!(o >= U && o <= W || o >= G && o <= K)) return null;
2706
+ var x = ht(e, t);
2707
+ if (!x) return null;
2708
+ var C = x.tag, w = C.toLowerCase();
2709
+ if (x.selfClosing || Fe(C)) return {
2710
+ node: {
2711
+ type: J.htmlSelfClosing,
2712
+ tag: C,
2713
+ attrs: qt(x.attrs, C, i),
2714
+ a: e.slice(t, x.end)
2715
+ },
2716
+ end: x.end
2717
+ };
2718
+ var T = st.has(w), D = Zt(e.slice(0, n), x.end, C);
2719
+ if (D === -1) return {
2720
+ node: {
2721
+ type: J.htmlSelfClosing,
2722
+ tag: C,
2723
+ attrs: qt(x.attrs, C, i),
2724
+ a: e.slice(t, x.end)
2725
+ },
2726
+ end: x.end
2727
+ };
2728
+ var O = Yt(e, "</" + w, D), k = e.slice(x.end, O), A = [];
2729
+ if (T) k.trim() && (A = [{
2730
+ type: J.text,
2731
+ text: k
2732
+ }]);
2733
+ else {
2734
+ var M = k.trim();
2735
+ if (M) {
2736
+ var { inAnchor: N, inline: F } = r;
2737
+ w === "a" && (r.inAnchor = !0), M.indexOf("\n\n") !== -1 || /^#{1,6}\s/.test(M) ? (r.inline = !1, A = An(M, r, i)) : A = On(M, 0, M.length, r, i), r.inAnchor = N, r.inline = F;
2738
+ }
2739
+ }
2740
+ return {
2741
+ node: {
2742
+ type: J.htmlBlock,
2743
+ tag: C,
2744
+ attrs: qt(x.attrs, C, i),
2745
+ e: x.rawAttrs,
2746
+ children: A,
2747
+ text: k,
2748
+ d: !1
2749
+ },
2750
+ end: D
2751
+ };
2752
+ }
2753
+ var En = 200, Dn = 0;
2754
+ function On(e, t, n, r, i) {
2755
+ if (Dn++, Dn > En) return Dn--, [{
2756
+ type: J.text,
2757
+ text: e.slice(t, n)
2758
+ }];
2759
+ let a = r;
2760
+ if (i.streaming || i.optimizeForStreaming) {
2761
+ let r = function(e, t) {
2762
+ for (var n = 1, r = t + 1; r < e.length; r++) {
2763
+ var i = e.charCodeAt(r);
2764
+ if (i === b) n++;
2765
+ else if (i === N && (n--, n === 0)) return r;
2766
+ }
2767
+ return -1;
2768
+ }, i = e.slice(t, n), a = i;
2769
+ for (var o = 0, s = 0, c = 0, l = 0, u = 0, d = -1, f = -1, p = -1, m = -1, h = -1, g = 0; g < i.length; g++) {
2770
+ var _ = i.charCodeAt(g);
2771
+ _ === k ? g + 1 < i.length && i.charCodeAt(g + 1) === k ? (o++, d = g, g++) : (s++, f = g) : _ === A ? g + 1 < i.length && i.charCodeAt(g + 1) === A ? (c++, p = g, g++) : (l++, m = g) : _ === y && g + 1 < i.length && i.charCodeAt(g + 1) === y && (u++, h = g, g++);
2772
+ }
2773
+ var S = [];
2774
+ u % 2 == 1 && h >= 0 && S.push([h, 2]), c % 2 == 1 && p >= 0 && S.push([p, 2]), l % 2 == 1 && m >= 0 && S.push([m, 1]), o % 2 == 1 && d >= 0 && S.push([d, 2]), s % 2 == 1 && f >= 0 && S.push([f, 1]), S.sort(function(e, t) {
2775
+ return t[0] - e[0];
2776
+ });
2777
+ for (var C = 0; C < S.length; C++) {
2778
+ var w = S[C][0], T = S[C][1];
2779
+ i = i.slice(0, w) + i.slice(w + T);
2780
+ }
2781
+ let x = 0, D = -1;
2782
+ for (let e = 0; e < i.length; e++) i.charCodeAt(e) === v && (x++, D = e);
2783
+ if (x % 2 == 1 && D !== -1) {
2784
+ let e = !1, t = -1, n = 0;
2785
+ for (; n < i.length;) i.charCodeAt(n) === v && (e ? (e = !1, t = -1) : (t = n, e = !0)), n++;
2786
+ e && t !== -1 && (i = i.slice(0, t));
2787
+ }
2788
+ for (var E = !0; E;) {
2789
+ E = !1;
2790
+ for (var M = -1, F = -1, I = -1, L = !1, z = 0; z < i.length; z++) if (i.charCodeAt(z) === b && (z === 0 || i.charCodeAt(z - 1) !== O)) {
2791
+ var ne = z > 0 && i.charCodeAt(z - 1) === P, re = ne ? z - 1 : z, ie = r(i, z);
2792
+ if (ie === -1) M = re, L = ne, F = z + 1, I = i.length;
2793
+ else {
2794
+ var ae = ie + 1;
2795
+ if (ae >= i.length) M = re, L = ne, F = z + 1, I = ie;
2796
+ else if (i.charCodeAt(ae) === ge) {
2797
+ var oe = i.indexOf(")", ae + 1);
2798
+ oe === -1 ? (M = re, L = ne, F = z + 1, I = ie, z = i.length) : z = oe;
2799
+ } else if (i.charCodeAt(ae) === b) {
2800
+ var se = i.indexOf("]", ae + 1);
2801
+ se === -1 ? (M = re, L = ne, F = z + 1, I = ie, z = i.length) : z = se;
2802
+ } else z = ie;
2803
+ }
2804
+ }
2805
+ if (M >= 0) {
2806
+ var ce = L ? "" : i.slice(F, I);
2807
+ i = i.slice(0, M) + ce, E = !0;
2808
+ }
2809
+ }
2810
+ let j = i.match(/<([A-Z][A-Za-z0-9]*)(?:\s[^>]*)?>([^<]*)$/);
2811
+ if (j && j.index !== void 0) {
2812
+ for (var le = !1, ue = 0, de = 0; de < j.index; de++) i.charCodeAt(de) === v && ue++;
2813
+ if (le = ue % 2 == 1, !le) {
2814
+ let e = j[1];
2815
+ Jt(i, "</" + e, 0) === -1 && (i = i.replace(/<[A-Z][A-Za-z0-9]*(?:\s[^>]*)?>([^<]*)$/, "$1"));
2816
+ }
2817
+ }
2818
+ i !== a && (e = e.slice(0, t) + i, n = t + i.length);
2819
+ }
2820
+ let fe = [];
2821
+ var pe = [];
2822
+ let B = t;
2823
+ var me = i.disableAutoLink || i.disableBareUrls || a.inAnchor ? -1 : e.indexOf("@", t);
2824
+ for (me >= n && (me = -1); t < n;) {
2825
+ let r = e.charCodeAt(t), o = null;
2826
+ if (r === v) {
2827
+ if (o = sn(e, t, n), !o) {
2828
+ var he = jt(e, t, n, v);
2829
+ t += he - 1;
2830
+ }
2831
+ } else if (r === k || r === A) {
2832
+ var _e = hn(e, t, n);
2833
+ if (_e) {
2834
+ if (_e.canOpen || _e.canClose) {
2835
+ t > B && fe.push(wn(e.slice(B, t)));
2836
+ var ve = wn(e.slice(t, t + _e.len));
2837
+ pe.push({
2838
+ idx: fe.length,
2839
+ ch: r,
2840
+ len: _e.len,
2841
+ canOpen: _e.canOpen,
2842
+ canClose: _e.canClose,
2843
+ active: !0
2844
+ }), fe.push(ve), t += _e.len, B = t;
2845
+ continue;
2846
+ }
2847
+ t += _e.len - 1;
2848
+ }
2849
+ } else r === y ? o = un(e, t, n, a, i) : r === D ? o = dn(e, t, n, a, i) : r === b ? (t + 1 < n && e.charCodeAt(t + 1) === x && (o = yn(e, t, n, a)), o ||= _n(e, t, n, a, i)) : r === P && t + 1 < n && e.charCodeAt(t + 1) === b ? o = _n(e, t, n, a, i) : r === j ? (o = vn(e, t, n), !o && !i.disableParsingRawHTML && !i.ignoreHTMLBlocks && (o = Tn(e, t, n, a, i))) : (r === ee || r === te || r === R) && !a.inAnchor && !i.disableAutoLink && (t === 0 || e.charCodeAt(t - 1) !== j) && (o = bn(e, t, n, i));
2850
+ if (!o && me >= 0 && me - t <= 64 && !a.inAnchor && !i.disableAutoLink && !i.disableBareUrls && (r >= U && r <= W || r >= G && r <= K || r >= V && r <= H) && (o = xn(e, t, n, i), !o && t >= me && (me = e.indexOf("@", t + 1), me >= n && (me = -1))), r === ye) {
2851
+ t > B && fe.push(wn(e.slice(B, t))), fe.push({ type: J.breakLine }), t++, B = t;
2852
+ continue;
2853
+ }
2854
+ if (o) t > B && fe.push(wn(e.slice(B, t))), fe.push(o.node), t = o.end, B = t;
2855
+ else {
2856
+ if (r === O && t + 1 < n && Et(e.charCodeAt(t + 1)) & X) {
2857
+ t > B && fe.push(wn(e.slice(B, t))), fe.push(wn(e[t + 1])), t += 2, B = t;
2858
+ continue;
2859
+ }
2860
+ if (t++, me < 0 || me - t > 64) for (; t < n;) {
2861
+ var q = e.charCodeAt(t);
2862
+ if (q < be && !ut[q]) t++;
2863
+ else break;
2864
+ }
2865
+ }
2866
+ }
2867
+ if (n > B) {
2868
+ let t = e.slice(B, n);
2869
+ (i.streaming || i.optimizeForStreaming) && (t = t.replace(/\*\*([^*]+)$/, "$1"), t.match(/\*[^*]+$/) && (t = t.replace(/\*([^*]+)$/, "$1")), t = t.replace(/__([^_]+)$/, "$1"), t.match(/_[^_]+$/) && (t = t.replace(/_([^_]+)$/, "$1")), t = t.replace(/~~([^~]+)$/, "$1"), t = t.replace(/\[([^\]]+)$/, "$1"), t = t.replace(/\[([^\]]+)\]\([^)]*$/, "$1")), t && fe.push(wn(t));
2870
+ }
2871
+ return pe.length > 0 && gn(fe, pe, r, i), Dn--, fe;
2872
+ }
2873
+ var kn = 500;
2874
+ function An(e, t, n) {
2875
+ var r = t.g || 0;
2876
+ if (r > kn) return [{
2877
+ type: J.text,
2878
+ text: e
2879
+ }];
2880
+ if (t.g = r + 1, n.streaming || n.optimizeForStreaming) {
2881
+ var i = e.length;
2882
+ i > 0 && e.charCodeAt(i - 1) === _ && i--;
2883
+ for (var a = i; a > 0 && e.charCodeAt(a - 1) !== _;) a--;
2884
+ if (a > 0 && e.charCodeAt(a) === B) {
2885
+ for (var o = !0, s = a; s < i; s++) {
2886
+ var c = e.charCodeAt(s);
2887
+ if (c !== m && c !== h && c !== E && c !== I && c !== B) {
2888
+ o = !1;
2889
+ break;
2890
+ }
2891
+ }
2892
+ if (o) {
2893
+ for (var l = a - 1; l > 0 && e.charCodeAt(l - 1) !== _;) l--;
2894
+ e.charCodeAt(l) === B && (e = e.slice(0, l).trimEnd());
2895
+ }
2896
+ }
2897
+ var u = e.trim(), d = u.lastIndexOf("\n"), f = d === -1 ? u : u.slice(d + 1);
2898
+ if (f.length > 0 && f.charCodeAt(0) === B) {
2899
+ for (var p = !1, g = !1, x = 1; x < f.length; x++) {
2900
+ var w = f.charCodeAt(x);
2901
+ w === B && (p = !0), w === E && (g = !0);
2902
+ }
2903
+ p && g && (e = d === -1 ? "" : e.slice(0, e.lastIndexOf(f)).trimEnd());
2904
+ }
2905
+ for (var T = -1, D = -1, O = -1, M = e.length - 1; M >= 0; M--) if (e.charCodeAt(M) === j) {
2906
+ var N = M + 1 < e.length ? e.charCodeAt(M + 1) : 0;
2907
+ if (N >= U && N <= W || N >= G && N <= K) {
2908
+ for (var P = M + 2; P < e.length;) {
2909
+ var F = e.charCodeAt(P);
2910
+ if (F >= U && F <= W || F >= G && F <= K || F >= V && F <= H) P++;
2911
+ else break;
2912
+ }
2913
+ for (var L = P; L < e.length && e.charCodeAt(L) !== S;) L++;
2914
+ if (L < e.length) {
2915
+ for (var R = !1, ee = L + 1; ee < e.length; ee++) if (e.charCodeAt(ee) === j) {
2916
+ R = !0;
2917
+ break;
2918
+ }
2919
+ R || (T = M, D = P, O = L + 1);
2920
+ }
2921
+ }
2922
+ break;
2923
+ }
2924
+ if (T >= 0) {
2925
+ for (var te = 0, z = 0; z < T; z++) e.charCodeAt(z) === v && te++;
2926
+ if (te % 2 == 0) {
2927
+ var ne = e.slice(T + 1, D);
2928
+ Jt(e, "</" + ne, 0) === -1 && (e = e.slice(0, T) + e.slice(O));
2929
+ }
2930
+ }
2931
+ var re = e.length;
2932
+ if (re > 0) {
2933
+ for (var ie = e.lastIndexOf("\n"), ae = ie === -1 ? 0 : ie + 1, oe = re, se = ae, ce = 0; se < oe && e.charCodeAt(se) === m && ce < 3;) se++, ce++;
2934
+ if (se < oe) {
2935
+ var ue = e.charCodeAt(se), de = !1;
2936
+ if (ue === k || ue === E || ue === pe) {
2937
+ var fe = se + 1;
2938
+ if (fe >= oe || e.charCodeAt(fe) === m || e.charCodeAt(fe) === h) {
2939
+ for (var me = fe; me < oe && (e.charCodeAt(me) === m || e.charCodeAt(me) === h);) me++;
2940
+ me >= oe && (de = !0);
2941
+ }
2942
+ } else if (ue >= V && ue <= H) {
2943
+ for (var he = se; he < oe && e.charCodeAt(he) >= V && e.charCodeAt(he) <= H;) he++;
2944
+ if (he < oe && (e.charCodeAt(he) === le || e.charCodeAt(he) === _e)) {
2945
+ var ge = he + 1;
2946
+ if (ge >= oe || e.charCodeAt(ge) === m || e.charCodeAt(ge) === h) {
2947
+ for (var ye = ge; ye < oe && (e.charCodeAt(ye) === m || e.charCodeAt(ye) === h);) ye++;
2948
+ ye >= oe && (de = !0);
2949
+ }
2950
+ }
2951
+ }
2952
+ de && (e = e.slice(0, ae).trimEnd());
2953
+ }
2954
+ }
2955
+ }
2956
+ if (t.inline) return On(e, 0, e.length, t, n);
2957
+ let be = [], q = 0, Se = e.length;
2958
+ if (q === 0 && e.startsWith("---")) {
2959
+ let t = xe(e);
2960
+ if (t && t.hasValidYaml) {
2961
+ if (n.preserveFrontmatter !== !1) {
2962
+ let n = e.slice(0, t.endPos).trimEnd();
2963
+ be.push({
2964
+ type: J.frontmatter,
2965
+ text: n
2966
+ });
2967
+ }
2968
+ q = t.endPos;
2969
+ }
2970
+ }
2971
+ for (; q < Se;) {
2972
+ for (var Ce = e.indexOf("\n", q), we = Ce < 0 ? Se : Ce; q < Se && Ft(e, q, we);) q = we < Se ? we + 1 : we, q < Se && (Ce = e.indexOf("\n", q), we = Ce < 0 ? Se : Ce);
2973
+ if (q >= Se) break;
2974
+ e.charCodeAt(q), Pt(e, q, we);
2975
+ let r = null;
2976
+ if (e.charCodeAt(q) !== ve && Mt >= 4 && !t.inHTML) r = zt(e, q);
2977
+ else if (e.charCodeAt(q) !== ve) {
2978
+ let i = q + Nt, a = e.charCodeAt(i);
2979
+ a === C ? r = It(e, q, t, n) : a === S ? r = Bt(e, q, t, n) : a === v || a === y ? r = Rt(e, q, t) : a === E || a === k || a === A ? (r = Lt(e, q), !r && (r = Gt(e, q, t, n))) : a === pe || a >= V && a <= H ? r = Gt(e, q, t, n) : a === j ? r = Qt(e, q, t, n) : a === B ? r = tn(e, q, t, n) : a === b && (r = nn(e, q, t));
2980
+ }
2981
+ if (!r) {
2982
+ for (var Te = !1, Y = q; Y < we; Y++) if (e.charCodeAt(Y) === B) {
2983
+ Te = !0;
2984
+ break;
2985
+ }
2986
+ Te && (r = tn(e, q, t, n));
2987
+ }
2988
+ if (r ||= an(e, q, t, n), r) r.node.type !== J.refCollection && be.push(r.node), q = r.end;
2989
+ else {
2990
+ var Ee = e.indexOf("\n", q);
2991
+ q = Ee < 0 ? Se : Ee + 1;
2992
+ }
2993
+ }
2994
+ return t.g = r, be;
2995
+ }
2996
+ function jn(e, t, n, r) {
2997
+ var i = ht(e, t);
2998
+ return i ? {
2999
+ tagName: i.tag,
3000
+ tagLower: i.tag.toLowerCase(),
3001
+ attrs: i.rawAttrs,
3002
+ whitespaceBeforeAttrs: i.whitespaceBeforeAttrs,
3003
+ isSelfClosing: i.selfClosing,
3004
+ hasSpaceBeforeSlash: i.hasSpaceBeforeSlash,
3005
+ isClosing: i.isClosing,
3006
+ hasNewline: i.whitespaceBeforeAttrs.includes("\n") || i.rawAttrs.includes("\n"),
3007
+ endPos: i.end
3008
+ } : null;
3009
+ }
3010
+ function Mn(e, t, n) {
3011
+ Dn = 0, e = Ye(e), !t.refs && (t.refs = {}), gt(e, t.refs, n);
3012
+ let r = An(e, t, n);
3013
+ return t.refs && Object.keys(t.refs).length > 0 ? [{
3014
+ type: J.refCollection,
3015
+ refs: t.refs
3016
+ }, ...r] : r;
3017
+ }
3018
+ var Nn = /^\n+/, Pn;
3019
+ try {
3020
+ Pn = u.createElement("div").$$typeof;
3021
+ } catch {
3022
+ Pn = Symbol.for("react.transitional.element");
3023
+ }
3024
+ function Fn(e, t, n) {
3025
+ return {
3026
+ $$typeof: Pn,
3027
+ type: e,
3028
+ key: n == null ? null : "" + n,
3029
+ ref: null,
3030
+ props: t
3031
+ };
3032
+ }
3033
+ var In = typeof u.createContext < "u" ? u.createContext(void 0) : void 0;
3034
+ function Ln(e, t, n, r, i, a, o, s) {
3035
+ switch (e.type) {
3036
+ case J.blockQuote: {
3037
+ let i = { key: n.key };
3038
+ return e.alert && (i.className = "markdown-alert-" + a(e.alert.toLowerCase(), Me), e.children.unshift({
3039
+ attrs: {},
3040
+ children: [{
3041
+ type: J.text,
3042
+ text: e.alert
3043
+ }],
3044
+ d: !0,
3045
+ type: J.htmlBlock,
3046
+ tag: "header"
3047
+ })), r("blockquote", i, t(e.children, n));
3048
+ }
3049
+ case J.breakLine: return r("br", { key: n.key });
3050
+ case J.breakThematic: return r("hr", { key: n.key });
3051
+ case J.frontmatter: return s.preserveFrontmatter ? r("pre", { key: n.key }, e.text) : null;
3052
+ case J.codeBlock:
3053
+ let h = e.lang ? Y(e.lang) : "";
3054
+ return r("pre", { key: n.key }, r("code", {
3055
+ ...we(e.attrs || {}),
3056
+ className: h ? `language-${h} lang-${h}` : ""
3057
+ }, e.text));
3058
+ case J.codeInline: return r("code", { key: n.key }, e.text);
3059
+ case J.footnoteReference: return r("a", {
3060
+ key: n.key,
3061
+ href: i(e.target, "a", "href") || void 0
3062
+ }, r("sup", { key: n.key }, e.text));
3063
+ case J.gfmTask: return r("input", {
3064
+ checked: e.completed,
3065
+ key: n.key,
3066
+ readOnly: !0,
3067
+ type: "checkbox"
3068
+ });
3069
+ case J.heading: return r(`h${e.level}`, {
3070
+ id: e.id,
3071
+ key: n.key
3072
+ }, t(e.children, n));
3073
+ case J.htmlBlock: {
3074
+ let h = e;
3075
+ if (s.tagfilter && tt(h.tag)) {
3076
+ var c = "";
3077
+ if (h.attrs) for (var l in h.attrs) {
3078
+ var d = h.attrs[l];
3079
+ d === !0 ? c += " " + l : d != null && d !== !1 && (c += " " + l + "=\"" + String(d) + "\"");
3080
+ }
3081
+ return r("span", { key: n.key }, "<" + h.tag + c + ">");
3082
+ }
3083
+ if (h.a && h.d) {
3084
+ let c = function(e) {
3085
+ if ((e.type === J.htmlSelfClosing || e.type === J.htmlBlock) && e.b) return [];
3086
+ if (e.type === J.paragraph) {
3087
+ let t = e.children;
3088
+ return t ? t.flatMap(c) : [];
3089
+ }
3090
+ return e.type === J.text ? e.text?.trim() ? [e] : [] : e.type === J.htmlBlock && e.children ? [{
3091
+ ...e,
3092
+ children: e.children?.flatMap(c)
3093
+ }] : [e];
3094
+ }, l = function(e) {
3095
+ for (var t = 0; t < e.length; t++) e[t].type === J.htmlBlock && (e[t].d = !1), "children" in e[t] && e[t].children && l(e[t].children);
3096
+ }, d = function(e, t) {
3097
+ for (var n = 0; n < e.length; n++) {
3098
+ var r = e[n];
3099
+ if (r.type === J.paragraph && r.children) for (var i = r.children, a = 0; a < i.length; a++) {
3100
+ var o = i[a];
3101
+ if (o.type === J.htmlSelfClosing && o.b && o.tag.toLowerCase() === t) {
3102
+ var s = e.slice(0, n);
3103
+ a > 0 && s.push({
3104
+ type: J.paragraph,
3105
+ children: i.slice(0, a)
3106
+ });
3107
+ var c = [];
3108
+ if (a + 1 < i.length) {
3109
+ var l = i.slice(a + 1);
3110
+ l = l.filter(function(e) {
3111
+ return !(e.type === J.htmlSelfClosing && e.b);
3112
+ }), l.length > 0 && (c = l);
3113
+ }
3114
+ return c = c.concat(e.slice(n + 1)), {
3115
+ found: !0,
3116
+ beforeClose: s,
3117
+ afterClose: c
3118
+ };
3119
+ }
3120
+ }
3121
+ if ((r.type === J.htmlSelfClosing || r.type === J.htmlBlock) && r.b && r.tag.toLowerCase() === t) return {
3122
+ found: !0,
3123
+ beforeClose: e.slice(0, n),
3124
+ afterClose: e.slice(n + 1)
3125
+ };
3126
+ }
3127
+ return {
3128
+ found: !1,
3129
+ beforeClose: e,
3130
+ afterClose: []
3131
+ };
3132
+ }, g = h.tag.toLowerCase(), _ = ft(g), v = h.children && h.children.length > 0, y = /<[a-z][^>]{0,100}>/i.test(h.a);
3133
+ if (_) {
3134
+ let t = h.a.replace(RegExp("\\s*</" + g + ">\\s*$", "i"), "");
3135
+ return s.tagfilter && (t = rt(t)), y ? r(e.tag, {
3136
+ key: n.key,
3137
+ ...we(e.attrs || {}),
3138
+ dangerouslySetInnerHTML: { __html: t }
3139
+ }) : r(e.tag, {
3140
+ key: n.key,
3141
+ ...we(e.attrs || {})
3142
+ }, t);
3143
+ }
3144
+ let b = RegExp(`^<${h.tag}(\\s|>)`, "i").test(h.a);
3145
+ if (v && !b && s.tagfilter && nt(h.a)) return r(e.tag, {
3146
+ key: n.key,
3147
+ ...we(e.attrs || {})
3148
+ }, t(h.children, n));
3149
+ if (pt(h.a)) {
3150
+ let t = s.tagfilter ? rt(h.a) : h.a;
3151
+ return r(e.tag, {
3152
+ key: n.key,
3153
+ ...we(e.attrs || {}),
3154
+ dangerouslySetInnerHTML: { __html: t }
3155
+ });
3156
+ }
3157
+ let x = {
3158
+ slugify: (e) => a(e, Me),
3159
+ sanitizer: i,
3160
+ tagfilter: !0
3161
+ }, S = h.a.replace(/>\s+</g, "><").replace(/\n+/g, " ").trim();
3162
+ if (RegExp(`^<${h.tag}(\\s[^>]*)?>(\\s*</${h.tag}>)?$`, "i").test(S)) return h.children && h.children.length > 0 ? r(e.tag, {
3163
+ key: n.key,
3164
+ ...we(e.attrs || {})
3165
+ }, t(h.children, n)) : r(e.tag, {
3166
+ key: n.key,
3167
+ ...we(e.attrs || {})
3168
+ });
3169
+ let C = Mn(S, {
3170
+ inline: !1,
3171
+ refs: o,
3172
+ inHTML: !1
3173
+ }, x);
3174
+ l(C);
3175
+ let w = h.tag.toLowerCase(), T = "</" + w + ">", E = RegExp(`^<${h.tag}(\\s|>)`, "i").test(S), D = S.toLowerCase().trimEnd().endsWith(T), O = E && D;
3176
+ if (O && v) return r(e.tag, {
3177
+ key: n.key,
3178
+ ...we(e.attrs || {})
3179
+ }, t(h.children, n));
3180
+ if (O) return t(C.flatMap(c), n);
3181
+ var f = d(C, w);
3182
+ if (f.found && f.afterClose.length > 0) {
3183
+ var p = f.beforeClose.flatMap(c), m = f.afterClose.flatMap(c);
3184
+ return Fn(u.Fragment, { children: [r(e.tag, {
3185
+ key: n.key,
3186
+ ...we(e.attrs || {})
3187
+ }, t(p, n)), t(m, n)] }, null);
3188
+ }
3189
+ return r(e.tag, {
3190
+ key: n.key,
3191
+ ...we(e.attrs || {})
3192
+ }, t(C.flatMap(c), n));
3193
+ }
3194
+ return r(e.tag, {
3195
+ key: n.key,
3196
+ ...we(e.attrs || {})
3197
+ }, e.children ? t(e.children, n) : "");
3198
+ }
3199
+ case J.htmlSelfClosing: {
3200
+ let t = e;
3201
+ if (s.tagfilter && tt(t.tag)) {
3202
+ var c = "";
3203
+ if (t.attrs) for (var l in t.attrs) {
3204
+ var d = t.attrs[l];
3205
+ d === !0 ? c += " " + l : d != null && d !== !1 && (c += " " + l + "=\"" + String(d) + "\"");
3206
+ }
3207
+ return r("span", { key: n.key }, "<" + t.tag + c + " />");
3208
+ }
3209
+ return r(e.tag, {
3210
+ key: n.key,
3211
+ ...we(e.attrs || {})
3212
+ });
3213
+ }
3214
+ case J.image: {
3215
+ let t = e.target == null ? null : i(e.target, "img", "src");
3216
+ return r("img", {
3217
+ key: n.key,
3218
+ alt: e.alt && e.alt.length > 0 ? e.alt : void 0,
3219
+ title: e.title || void 0,
3220
+ src: t || void 0
3221
+ });
3222
+ }
3223
+ case J.link: {
3224
+ let i = { key: n.key };
3225
+ return e.target != null && (i.href = Ze(e.target)), e.title && (i.title = e.title), r("a", i, t(e.children, n));
3226
+ }
3227
+ case J.table: {
3228
+ let i = e;
3229
+ return r("table", { key: n.key }, r("thead", null, r("tr", null, i.header.map(function(e, a) {
3230
+ return r("th", {
3231
+ key: a,
3232
+ style: i.align[a] == null ? {} : { textAlign: i.align[a] }
3233
+ }, t(e, n));
3234
+ }))), r("tbody", null, i.cells.map(function(e, a) {
3235
+ return r("tr", { key: a }, e.map(function(e, a) {
3236
+ return r("td", {
3237
+ key: a,
3238
+ style: i.align[a] == null ? {} : { textAlign: i.align[a] }
3239
+ }, t(e, n));
3240
+ }));
3241
+ })));
3242
+ }
3243
+ case J.text: return e.text;
3244
+ case J.textFormatted: return r(e.tag, { key: n.key }, t(e.children, n));
3245
+ case J.orderedList:
3246
+ case J.unorderedList: return r(e.type === J.orderedList ? "ol" : "ul", {
3247
+ key: n.key,
3248
+ start: e.type === J.orderedList ? e.start : void 0
3249
+ }, e.items.map(function(e, i) {
3250
+ return r("li", { key: i }, t(e, n));
3251
+ }));
3252
+ case J.paragraph: return r("p", { key: n.key }, t(e.children, n));
3253
+ case J.ref: return null;
3254
+ default: return null;
3255
+ }
3256
+ }
3257
+ var Rn = (e, t, n, r, i, a) => {
3258
+ var o = (e) => e.map(function(e) {
3259
+ return "text" in e ? e.text : "";
3260
+ }), s = (c, l = {}) => {
3261
+ var u = (l.renderDepth || 0) + 1;
3262
+ if (u > 2500) return o(c);
3263
+ l.renderDepth = u;
3264
+ for (var d = l.key, f = [], p = !1, m = 0; m < c.length; m++) {
3265
+ l.key = m;
3266
+ var h = e ? e(Ln.bind(null, c[m], s, l, t, n, r, i, a), c[m], s, l) : Ln(c[m], s, l, t, n, r, i, a), g = typeof h == "string";
3267
+ if (g && p) f[f.length - 1] += h;
3268
+ else if (h !== null) if (Array.isArray(h)) for (var _ = 0; _ < h.length; _++) f.push(h[_]);
3269
+ else f.push(h);
3270
+ p = g;
3271
+ }
3272
+ return l.key = d, l.renderDepth = u - 1, f;
3273
+ };
3274
+ return s;
3275
+ }, zn = (e, t) => {
3276
+ let n = Xe(t, e, void 0);
3277
+ return n ? typeof n == "function" || typeof n == "object" && "render" in n ? n : Xe(t, `${e}.component`, e) : e;
3278
+ };
3279
+ function Bn(e, t) {
3280
+ let n = { ...t || {} };
3281
+ n.overrides = n.overrides || {};
3282
+ let r = n.slugify || Me, i = n.sanitizer || De, a = n.createElement, o = n.overrides && Object.keys(n.overrides).length > 0, s = (e) => Vn(e, {
3283
+ ...n,
3284
+ wrapper: null
3285
+ });
3286
+ function c(e, t, ...r) {
3287
+ var i = t || {};
3288
+ for (var c in i) {
3289
+ var l = i[c];
3290
+ if (typeof l == "string" && l.length > 0 && l.charCodeAt(0) === j && (it.test(l) || at.test(l) || jn(l, 0))) {
3291
+ var u = s(l.trim());
3292
+ i[c] = c === "innerHTML" && Array.isArray(u) ? u[0] : u;
3293
+ }
3294
+ }
3295
+ var d = e;
3296
+ if (o) {
3297
+ var f = Xe(n.overrides, e + ".props", {});
3298
+ d = zn(e, n.overrides), i = {
3299
+ ...i,
3300
+ ...f,
3301
+ className: Qe(i.className, f.className) || void 0
3302
+ };
3303
+ }
3304
+ if (!a) {
3305
+ var p = i.key;
3306
+ return p != null && delete i.key, r.length === 1 ? i.children = r[0] : r.length > 1 && (i.children = r), Fn(d, i, p);
3307
+ }
3308
+ return a(d, i, ...r);
3309
+ }
3310
+ let l = {
3311
+ ...n,
3312
+ slugify: (e) => r(e, Me),
3313
+ sanitizer: i,
3314
+ tagfilter: n.tagfilter !== !1
3315
+ }, u = e[0] && e[0].type === J.refCollection ? e[0].refs : {}, d = Rn(n.renderRule, c, i, r, u, n), f = d(e, {
3316
+ inline: n.forceInline,
3317
+ refs: u
3318
+ }), p = [];
3319
+ for (let e in u) e.charCodeAt(0) === x && p.push({
3320
+ identifier: e,
3321
+ footnote: u[e].target
3322
+ });
3323
+ if (p.length && f.push(c("footer", { key: "footer" }, p.map(function(e) {
3324
+ let t = e.identifier.charCodeAt(0) === x ? e.identifier.slice(1) : e.identifier, n = Mn(e.footnote, {
3325
+ inline: !0,
3326
+ refs: u
3327
+ }, l);
3328
+ return c("div", {
3329
+ id: r(t, Me),
3330
+ key: e.identifier
3331
+ }, t + ": ", d(n, {
3332
+ inline: !0,
3333
+ refs: u
3334
+ }));
3335
+ }))), n.wrapper === null) return f;
3336
+ let m = n.wrapper || (n.forceInline ? "span" : "div"), h;
3337
+ if (f.length > 1 || n.forceWrapper) h = f;
3338
+ else return f.length === 1 ? f[0] : null;
3339
+ var g = n.wrapperProps ? { ...n.wrapperProps } : {};
3340
+ return g.children = h, Fn(m, g, "outer");
3341
+ }
3342
+ function Vn(e = "", t = {}) {
3343
+ let n = { ...t || {} };
3344
+ n.overrides = n.overrides || {};
3345
+ let r = n.slugify || Me, i = n.sanitizer || De;
3346
+ function a(e) {
3347
+ let t = n.forceInline || !n.forceBlock && !Te.test(e), a = {
3348
+ ...n,
3349
+ slugify: (e) => r(e, Me),
3350
+ sanitizer: i,
3351
+ tagfilter: n.tagfilter !== !1
3352
+ };
3353
+ t || gt(e, o, a);
3354
+ let s = e;
3355
+ if (!t) {
3356
+ let e = s.length;
3357
+ for (; e > 0 && (s[e - 1] === "\n" || s[e - 1] === "\r");) e--;
3358
+ s = s.slice(0, e), s = `${s.replace(Nn, "")}
3359
+
3360
+ `;
3361
+ }
3362
+ if (n.optimizeForStreaming) {
3363
+ let e = s.lastIndexOf("<");
3364
+ e !== -1 && s.slice(e).indexOf(">") === -1 && (s = s.slice(0, e));
3365
+ }
3366
+ return Bn(Mn(t ? e : s, {
3367
+ inline: t,
3368
+ refs: o
3369
+ }, a), {
3370
+ ...a,
3371
+ forceInline: t
3372
+ });
3373
+ }
3374
+ let o = {};
3375
+ return a(e);
3376
+ }
3377
+ var Hn = ({ children: e, options: t, ...n }) => {
3378
+ if (!(typeof u.useContext < "u")) {
3379
+ let r = {
3380
+ ...t,
3381
+ overrides: { ...t?.overrides },
3382
+ wrapperProps: {
3383
+ ...t?.wrapperProps,
3384
+ ...n
3385
+ }
3386
+ };
3387
+ return Vn(e ?? "", r);
3388
+ }
3389
+ let r = u.useContext(In), i = u.useMemo(() => ({
3390
+ ...r,
3391
+ ...t,
3392
+ overrides: {
3393
+ ...r?.overrides,
3394
+ ...t?.overrides
3395
+ },
3396
+ wrapperProps: {
3397
+ ...r?.wrapperProps,
3398
+ ...t?.wrapperProps,
3399
+ ...n
3400
+ }
3401
+ }), [
3402
+ r,
3403
+ t,
3404
+ n
3405
+ ]), a = e ?? "";
3406
+ return u.useMemo(() => Vn(a, i), [a, i]);
3407
+ }, $ = r(), Un = u.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ (0, $.jsx)("div", {
3408
+ className: "relative w-full overflow-auto",
3409
+ children: /* @__PURE__ */ (0, $.jsx)("table", {
3410
+ ref: r,
3411
+ className: n("w-full caption-bottom text-sm", e),
3412
+ ...t
3413
+ })
3414
+ }));
3415
+ Un.displayName = "Table";
3416
+ var Wn = u.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ (0, $.jsx)("thead", {
3417
+ ref: r,
3418
+ className: n("[&_tr]:border-b", e),
3419
+ ...t
3420
+ }));
3421
+ Wn.displayName = "TableHeader";
3422
+ var Gn = u.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ (0, $.jsx)("tbody", {
3423
+ ref: r,
3424
+ className: n("[&_tr:last-child]:border-0", e),
3425
+ ...t
3426
+ }));
3427
+ Gn.displayName = "TableBody";
3428
+ var Kn = u.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ (0, $.jsx)("tr", {
3429
+ ref: r,
3430
+ className: n("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted", e),
3431
+ ...t
3432
+ }));
3433
+ Kn.displayName = "TableRow";
3434
+ var qn = u.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ (0, $.jsx)("th", {
3435
+ ref: r,
3436
+ className: n("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0", e),
3437
+ ...t
3438
+ }));
3439
+ qn.displayName = "TableHead";
3440
+ var Jn = u.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ (0, $.jsx)("td", {
3441
+ ref: r,
3442
+ className: n("p-4 align-middle [&:has([role=checkbox])]:pr-0", e),
3443
+ ...t
3444
+ }));
3445
+ Jn.displayName = "TableCell";
3446
+ //#endregion
3447
+ //#region src/client/components/shared/MarkdownRenderer.tsx
3448
+ function Yn({ children: e, className: t }) {
3449
+ let n = "text";
3450
+ if (t) {
3451
+ let e = t.match(/(?:lang(?:uage)?-)(\w+)/);
3452
+ n = e ? e[1] : t.replace(/^(lang-|language-)\s*/, "").trim();
3453
+ }
3454
+ let [r, s] = (0, u.useState)(!1), c = String(e).trim();
3455
+ return /* @__PURE__ */ (0, $.jsxs)("div", {
3456
+ className: "my-4 relative group/code bg-muted rounded-md p-0",
3457
+ children: [/* @__PURE__ */ (0, $.jsxs)("div", {
3458
+ className: "flex items-center justify-between mb-2 absolute top-0 left-0 w-full",
3459
+ children: [/* @__PURE__ */ (0, $.jsx)("div", {
3460
+ className: "text-[10px] font-mono text-muted-foreground/50 bg-transparent px-2 py-0 rounded",
3461
+ children: n
3462
+ }), /* @__PURE__ */ (0, $.jsx)("button", {
3463
+ className: "opacity-0 group-hover/code:opacity-100 transition-opacity text-muted-foreground hover:text-foreground text-xs flex items-center gap-1 px-2 py-1 rounded hover:bg-muted",
3464
+ onClick: async () => {
3465
+ await o(c), s(!0), setTimeout(() => s(!1), 2e3);
3466
+ },
3467
+ title: "Copy code",
3468
+ children: r ? /* @__PURE__ */ (0, $.jsx)(i, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ (0, $.jsx)(a, { className: "h-3.5 w-3.5" })
3469
+ })]
3470
+ }), /* @__PURE__ */ (0, $.jsx)("pre", {
3471
+ className: "text-sm m-0 p-4 pt-8 rounded-lg font-mono overflow-x-auto",
3472
+ style: { background: "var(--muted)" },
3473
+ children: /* @__PURE__ */ (0, $.jsx)("code", { children: c })
3474
+ })]
3475
+ });
3476
+ }
3477
+ function Xn({ children: e }) {
3478
+ return /* @__PURE__ */ (0, $.jsx)("code", {
3479
+ className: "bg-muted px-1.5 py-0.5 rounded text-sm font-mono",
3480
+ children: e
3481
+ });
3482
+ }
3483
+ function Zn({ children: e, className: t }) {
3484
+ return t ? /* @__PURE__ */ (0, $.jsx)(Yn, {
3485
+ className: t,
3486
+ children: e
3487
+ }) : /* @__PURE__ */ (0, $.jsx)(Xn, { children: e });
3488
+ }
3489
+ function Qn({ children: e }) {
3490
+ if (typeof e == "string") {
3491
+ let t = e.match(/^\[([ xX])\]\s*(.*)/);
3492
+ if (t) {
3493
+ let e = t[1].toLowerCase() === "x", n = t[2];
3494
+ return /* @__PURE__ */ (0, $.jsxs)("li", {
3495
+ className: "text-foreground flex items-center gap-2",
3496
+ children: [/* @__PURE__ */ (0, $.jsx)(l, {
3497
+ checked: e,
3498
+ disabled: !0
3499
+ }), /* @__PURE__ */ (0, $.jsx)("span", { children: n })]
3500
+ });
3501
+ }
3502
+ }
3503
+ if (Array.isArray(e) && e.length > 0) {
3504
+ let t = e[0];
3505
+ if (typeof t == "string") {
3506
+ let n = t.match(/^\[([ xX])\]\s*(.*)/);
3507
+ if (n) {
3508
+ let t = n[1].toLowerCase() === "x", r = n[2];
3509
+ return /* @__PURE__ */ (0, $.jsxs)("li", {
3510
+ className: "text-foreground flex items-center gap-2",
3511
+ children: [/* @__PURE__ */ (0, $.jsx)(l, {
3512
+ checked: t,
3513
+ disabled: !0
3514
+ }), /* @__PURE__ */ (0, $.jsxs)("span", { children: [r, e.slice(1)] })]
3515
+ });
3516
+ }
3517
+ }
3518
+ }
3519
+ return /* @__PURE__ */ (0, $.jsx)("li", {
3520
+ className: "text-foreground",
3521
+ children: e
3522
+ });
3523
+ }
3524
+ function $n({ content: e, className: t }) {
3525
+ let n = /* @__PURE__ */ (0, $.jsx)(Hn, {
3526
+ options: { overrides: {
3527
+ code: Zn,
3528
+ pre: ({ children: e }) => /* @__PURE__ */ (0, $.jsx)($.Fragment, { children: e }),
3529
+ h1: ({ children: e }) => /* @__PURE__ */ (0, $.jsx)("h1", {
3530
+ className: "text-xl font-bold text-foreground mb-2 mt-4",
3531
+ children: e
3532
+ }),
3533
+ h2: ({ children: e }) => /* @__PURE__ */ (0, $.jsx)("h2", {
3534
+ className: "text-lg font-bold text-foreground mb-2 mt-4",
3535
+ children: e
3536
+ }),
3537
+ h3: ({ children: e }) => /* @__PURE__ */ (0, $.jsx)("h3", {
3538
+ className: "text-base font-bold text-foreground mb-2 mt-4",
3539
+ children: e
3540
+ }),
3541
+ h4: ({ children: e }) => /* @__PURE__ */ (0, $.jsx)("h4", {
3542
+ className: "text-sm font-bold text-foreground mb-2 mt-4",
3543
+ children: e
3544
+ }),
3545
+ h5: ({ children: e }) => /* @__PURE__ */ (0, $.jsx)("h5", {
3546
+ className: "text-sm font-bold text-foreground mb-2 mt-4",
3547
+ children: e
3548
+ }),
3549
+ h6: ({ children: e }) => /* @__PURE__ */ (0, $.jsx)("h6", {
3550
+ className: "text-sm font-bold text-foreground mb-2 mt-4",
3551
+ children: e
3552
+ }),
3553
+ p: ({ children: e }) => /* @__PURE__ */ (0, $.jsx)("p", {
3554
+ className: "text-foreground mb-2 leading-relaxed",
3555
+ children: e
3556
+ }),
3557
+ ul: ({ children: e }) => /* @__PURE__ */ (0, $.jsx)("ul", {
3558
+ className: "list-disc list-outside pl-6 mb-3 space-y-1",
3559
+ children: e
3560
+ }),
3561
+ ol: ({ children: e }) => /* @__PURE__ */ (0, $.jsx)("ol", {
3562
+ className: "list-decimal list-outside pl-6 mb-3 space-y-1",
3563
+ children: e
3564
+ }),
3565
+ li: Qn,
3566
+ table: ({ children: e }) => /* @__PURE__ */ (0, $.jsx)("div", {
3567
+ className: "my-4",
3568
+ children: /* @__PURE__ */ (0, $.jsx)(Un, { children: e })
3569
+ }),
3570
+ thead: ({ children: e }) => /* @__PURE__ */ (0, $.jsx)(Wn, { children: e }),
3571
+ tbody: ({ children: e }) => /* @__PURE__ */ (0, $.jsx)(Gn, { children: e }),
3572
+ tr: ({ children: e }) => /* @__PURE__ */ (0, $.jsx)(Kn, { children: e }),
3573
+ th: ({ children: e }) => /* @__PURE__ */ (0, $.jsx)(qn, { children: e }),
3574
+ td: ({ children: e }) => /* @__PURE__ */ (0, $.jsx)(Jn, { children: e }),
3575
+ blockquote: ({ children: e }) => /* @__PURE__ */ (0, $.jsx)("blockquote", {
3576
+ className: "border-l-4 border-muted-foreground pl-4 italic text-muted-foreground mb-3",
3577
+ children: e
3578
+ }),
3579
+ a: ({ children: e, href: t }) => /* @__PURE__ */ (0, $.jsx)("a", {
3580
+ href: t,
3581
+ className: "text-primary hover:underline",
3582
+ target: "_blank",
3583
+ rel: "noopener noreferrer",
3584
+ children: e
3585
+ }),
3586
+ strong: ({ children: e }) => /* @__PURE__ */ (0, $.jsx)("strong", {
3587
+ className: "font-semibold text-foreground",
3588
+ children: e
3589
+ }),
3590
+ em: ({ children: e }) => /* @__PURE__ */ (0, $.jsx)("em", {
3591
+ className: "italic text-foreground",
3592
+ children: e
3593
+ }),
3594
+ img: ({ src: e, alt: t }) => /* @__PURE__ */ (0, $.jsx)("img", {
3595
+ src: e,
3596
+ alt: t || "",
3597
+ className: "max-w-full max-h-[500px] object-contain rounded-lg my-4 border border-border",
3598
+ loading: "lazy"
3599
+ }),
3600
+ hr: () => /* @__PURE__ */ (0, $.jsx)("hr", { className: "my-4 border-t border-border" })
3601
+ } },
3602
+ children: e
3603
+ });
3604
+ return t ? /* @__PURE__ */ (0, $.jsx)("div", {
3605
+ className: t,
3606
+ children: n
3607
+ }) : n;
3608
+ }
3609
+ //#endregion
3610
+ export { d as n, $n as t };