@kky42/pievo-server 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/.output/nitro.json +17 -0
  2. package/.output/public/assets/CodeField-dOzyFQNH.js +34 -0
  3. package/.output/public/assets/LoopView-B4H9QibC.js +55 -0
  4. package/.output/public/assets/Modal-D33gNSgx.js +1 -0
  5. package/.output/public/assets/SignIn-SHuRRyOv.js +1 -0
  6. package/.output/public/assets/actionUi-ChGGALzg.js +1 -0
  7. package/.output/public/assets/app-DElSo_jy.css +2 -0
  8. package/.output/public/assets/artifactView-DFuubXLJ.js +66 -0
  9. package/.output/public/assets/index-DfpTWRSz.js +12 -0
  10. package/.output/public/assets/invite._token-DJtd-XE2.js +1 -0
  11. package/.output/public/assets/invite._token-T8oo4Qtw.js +1 -0
  12. package/.output/public/assets/jsx-runtime-BseJUIpC.js +1 -0
  13. package/.output/public/assets/lifecycleUi-DKkChdnU.js +1 -0
  14. package/.output/public/assets/loopApi-BM2nj71x.js +3 -0
  15. package/.output/public/assets/loops._loopId-B19Jw7jC.js +5 -0
  16. package/.output/public/assets/loops._loopId_.runs._runId-_CflHV38.js +3 -0
  17. package/.output/public/assets/notifyFns-DCubjpRy.js +1 -0
  18. package/.output/public/assets/preload-helper-CKUiEq3b.js +3 -0
  19. package/.output/public/assets/routes-B9tgli5f.js +1 -0
  20. package/.output/public/assets/routes-CTtlM_qt.js +1 -0
  21. package/.output/public/assets/t._teamId-Bm21mngW.js +1 -0
  22. package/.output/public/assets/t._teamId-gR7BVKkR.js +1 -0
  23. package/.output/public/assets/ui-Dp88qUWh.js +1 -0
  24. package/.output/public/assets/useRouter-DsjH8G0p.js +1 -0
  25. package/.output/public/favicon.svg +12 -0
  26. package/.output/public/fonts/GeistPixel-Square.woff2 +0 -0
  27. package/.output/server/_chunks/ssr-renderer.mjs +26 -0
  28. package/.output/server/_libs/@aws-crypto/crc32+[...].mjs +419 -0
  29. package/.output/server/_libs/@aws-sdk/checksums+[...].mjs +10732 -0
  30. package/.output/server/_libs/@aws-sdk/client-s3+[...].mjs +9475 -0
  31. package/.output/server/_libs/@aws-sdk/credential-provider-http+[...].mjs +137 -0
  32. package/.output/server/_libs/@aws-sdk/credential-provider-ini+[...].mjs +440 -0
  33. package/.output/server/_libs/@aws-sdk/credential-provider-process+[...].mjs +62 -0
  34. package/.output/server/_libs/@aws-sdk/credential-provider-sso+[...].mjs +818 -0
  35. package/.output/server/_libs/@aws-sdk/credential-provider-web-identity+[...].mjs +59 -0
  36. package/.output/server/_libs/@base-ui/react+[...].mjs +11125 -0
  37. package/.output/server/_libs/@codemirror/autocomplete+[...].mjs +19713 -0
  38. package/.output/server/_libs/@codemirror/lang-css+[...].mjs +2636 -0
  39. package/.output/server/_libs/@codemirror/lang-html+[...].mjs +2247 -0
  40. package/.output/server/_libs/@codemirror/lang-json+[...].mjs +79 -0
  41. package/.output/server/_libs/@reduxjs/toolkit+[...].mjs +1736 -0
  42. package/.output/server/_libs/@smithy/credential-provider-imds+[...].mjs +342 -0
  43. package/.output/server/_libs/@tanstack/react-router+[...].mjs +14300 -0
  44. package/.output/server/_libs/@uiw/codemirror-extensions-basic-setup+[...].mjs +76 -0
  45. package/.output/server/_libs/atomic-sleep.mjs +27 -0
  46. package/.output/server/_libs/aws-crypto__crc32c.mjs +314 -0
  47. package/.output/server/_libs/aws-sdk__nested-clients.mjs +2671 -0
  48. package/.output/server/_libs/babel__runtime.mjs +30 -0
  49. package/.output/server/_libs/clsx.mjs +16 -0
  50. package/.output/server/_libs/codemirror__commands.mjs +1725 -0
  51. package/.output/server/_libs/codemirror__lint.mjs +565 -0
  52. package/.output/server/_libs/codemirror__search.mjs +1138 -0
  53. package/.output/server/_libs/codemirror__theme-one-dark.mjs +161 -0
  54. package/.output/server/_libs/colorette.mjs +129 -0
  55. package/.output/server/_libs/croner.mjs +735 -0
  56. package/.output/server/_libs/d3-array.mjs +231 -0
  57. package/.output/server/_libs/d3-color.mjs +330 -0
  58. package/.output/server/_libs/d3-format.mjs +252 -0
  59. package/.output/server/_libs/d3-interpolate.mjs +163 -0
  60. package/.output/server/_libs/d3-path.mjs +77 -0
  61. package/.output/server/_libs/d3-scale+[...].mjs +1907 -0
  62. package/.output/server/_libs/d3-shape.mjs +689 -0
  63. package/.output/server/_libs/dateformat.mjs +341 -0
  64. package/.output/server/_libs/decimal.js-light.mjs +884 -0
  65. package/.output/server/_libs/diff.mjs +732 -0
  66. package/.output/server/_libs/dom-serializer+[...].mjs +708 -0
  67. package/.output/server/_libs/domhandler.mjs +461 -0
  68. package/.output/server/_libs/dompurify.mjs +2111 -0
  69. package/.output/server/_libs/domutils.mjs +868 -0
  70. package/.output/server/_libs/drizzle-orm+postgres.mjs +7689 -0
  71. package/.output/server/_libs/electric-sql__pglite.mjs +14674 -0
  72. package/.output/server/_libs/end-of-stream+once+wrappy.mjs +145 -0
  73. package/.output/server/_libs/es-toolkit.mjs +1737 -0
  74. package/.output/server/_libs/eventemitter3.mjs +236 -0
  75. package/.output/server/_libs/fast-copy.mjs +285 -0
  76. package/.output/server/_libs/fast-safe-stringify.mjs +172 -0
  77. package/.output/server/_libs/h3+rou3+srvx.mjs +1201 -0
  78. package/.output/server/_libs/html-dom-parser+htmlparser2.mjs +1560 -0
  79. package/.output/server/_libs/html-react-parser+[...].mjs +1360 -0
  80. package/.output/server/_libs/initdb.wasm +0 -0
  81. package/.output/server/_libs/marked.mjs +1548 -0
  82. package/.output/server/_libs/on-exit-leak-free.mjs +80 -0
  83. package/.output/server/_libs/pglite.data +37667 -8
  84. package/.output/server/_libs/pglite.wasm +0 -0
  85. package/.output/server/_libs/pino+[...].mjs +3196 -0
  86. package/.output/server/_libs/pino-abstract-transport+split2.mjs +194 -0
  87. package/.output/server/_libs/pino-pretty+[...].mjs +1623 -0
  88. package/.output/server/_libs/pinojs__redact.mjs +280 -0
  89. package/.output/server/_libs/react-redux+[...].mjs +205 -0
  90. package/.output/server/_libs/recharts+victory-vendor.mjs +15875 -0
  91. package/.output/server/_libs/tanstack__history.mjs +342 -0
  92. package/.output/server/_libs/ufo.mjs +64 -0
  93. package/.output/server/_libs/uiw__codemirror-themes.mjs +32 -0
  94. package/.output/server/_libs/uiw__react-codemirror.mjs +354 -0
  95. package/.output/server/_runtime.mjs +37 -0
  96. package/.output/server/_ssr/CodeField-tm4rr6G3.mjs +143 -0
  97. package/.output/server/_ssr/DashboardView-CC7htv28.mjs +2795 -0
  98. package/.output/server/_ssr/LoopPlaybook-BXH8mhiX.mjs +2105 -0
  99. package/.output/server/_ssr/LoopView-DCugEbHx.mjs +1106 -0
  100. package/.output/server/_ssr/Modal-DpKZHLZK.mjs +49 -0
  101. package/.output/server/_ssr/SignIn-dTndU6Hw.mjs +67 -0
  102. package/.output/server/_ssr/actionUi-CZbEixbf.mjs +119 -0
  103. package/.output/server/_ssr/adapters-BS8XosjF.mjs +130 -0
  104. package/.output/server/_ssr/artifactFiles-Cagtj7J0.mjs +61 -0
  105. package/.output/server/_ssr/artifactKind-BW0isV8L.mjs +37 -0
  106. package/.output/server/_ssr/artifactView-DS4O22wl.mjs +304 -0
  107. package/.output/server/_ssr/artifacts-DngKyW2u.mjs +2 -0
  108. package/.output/server/_ssr/auth-DY1DuYZd.mjs +38429 -0
  109. package/.output/server/_ssr/boot-BbtG0ImW.mjs +9010 -0
  110. package/.output/server/_ssr/boot-CMHTxQpJ.mjs +2 -0
  111. package/.output/server/_ssr/bun-sqlite-dialect-BW9W1_Ps-CU1Spd6z.mjs +162 -0
  112. package/.output/server/_ssr/core-RrmWoKne.mjs +5 -0
  113. package/.output/server/_ssr/createServerRpc-BD8Xn_0_.mjs +12 -0
  114. package/.output/server/_ssr/d1-sqlite-dialect-BLC8LXE6-DfG7tB8s.mjs +112 -0
  115. package/.output/server/_ssr/db-DWAuZq1o.mjs +2 -0
  116. package/.output/server/_ssr/dist-BIxFFVZg.mjs +342 -0
  117. package/.output/server/_ssr/empty-plugin-adapters-DKUlnwwl.mjs +5 -0
  118. package/.output/server/_ssr/factory-Blq0DYfT.mjs +6903 -0
  119. package/.output/server/_ssr/invite._token-BRCo9LGB.mjs +36 -0
  120. package/.output/server/_ssr/invite._token-DJxGLILJ.mjs +28 -0
  121. package/.output/server/_ssr/invite._token-NewFt27g.mjs +92 -0
  122. package/.output/server/_ssr/kysely-adapter-D3XTe64J.mjs +2 -0
  123. package/.output/server/_ssr/kysely-migration-tables-JkVUjPF_-bPAX9LR_.mjs +19 -0
  124. package/.output/server/_ssr/lifecycleUi-C9lg1r3r.mjs +38 -0
  125. package/.output/server/_ssr/logger-Dw82jNjH.mjs +2 -0
  126. package/.output/server/_ssr/loopApi-BtfkZQYK.mjs +532 -0
  127. package/.output/server/_ssr/loopApi-Cxe8WyOB.mjs +105 -0
  128. package/.output/server/_ssr/loops._loopId-7NQJPB9W.mjs +30 -0
  129. package/.output/server/_ssr/loops._loopId-DhnArGdL.mjs +1635 -0
  130. package/.output/server/_ssr/loops._loopId_.runs._runId-Bvuo2nki.mjs +29 -0
  131. package/.output/server/_ssr/loops._loopId_.runs._runId-Dip5Xk-q.mjs +674 -0
  132. package/.output/server/_ssr/machineFns-Dvr5ICUy.mjs +266 -0
  133. package/.output/server/_ssr/node-sqlite-dialect-DhyOpJTX.mjs +162 -0
  134. package/.output/server/_ssr/notifyFns-BcMRY5kP.mjs +118 -0
  135. package/.output/server/_ssr/notifyFns-Q458pZmE.mjs +580 -0
  136. package/.output/server/_ssr/router-J8KZ30xw.mjs +678 -0
  137. package/.output/server/_ssr/routes-Bcs4T1ox.mjs +28 -0
  138. package/.output/server/_ssr/routes-BoGrcf-b.mjs +43 -0
  139. package/.output/server/_ssr/routes-D4am3Zff.mjs +28 -0
  140. package/.output/server/_ssr/runDiff-CpEFqo7G.mjs +113 -0
  141. package/.output/server/_ssr/ssr.mjs +5837 -0
  142. package/.output/server/_ssr/start-4ifArtKx.mjs +4 -0
  143. package/.output/server/_ssr/store-b3JcQ08F.mjs +2 -0
  144. package/.output/server/_ssr/t._teamId-CeUhzgzT.mjs +32 -0
  145. package/.output/server/_ssr/t._teamId-DR-hQK7o.mjs +47 -0
  146. package/.output/server/_ssr/t._teamId-Dy_McbRt.mjs +31 -0
  147. package/.output/server/_ssr/teamCookie-B7hLOIie.mjs +10 -0
  148. package/.output/server/_ssr/teamFns-BIDnsg2A.mjs +473 -0
  149. package/.output/server/_ssr/teamFns-DA4ovI5g.mjs +33 -0
  150. package/.output/server/_ssr/tokens-ytd60FUt.mjs +2 -0
  151. package/.output/server/_ssr/ui-Dej2qjuS.mjs +267 -0
  152. package/.output/server/_tanstack-start-manifest_v-CVS6c7re.mjs +95 -0
  153. package/.output/server/drizzle/0000_round_marauders.sql +193 -0
  154. package/.output/server/drizzle/0001_naive_silver_fox.sql +25 -0
  155. package/.output/server/drizzle/0002_funny_sage.sql +12 -0
  156. package/.output/server/drizzle/0003_optimal_slapstick.sql +102 -0
  157. package/.output/server/drizzle/0004_remove_grok_agent.sql +5 -0
  158. package/.output/server/drizzle/0005_heavy_gauntlet.sql +8 -0
  159. package/.output/server/drizzle/0006_tranquil_sharon_carter.sql +1 -0
  160. package/.output/server/drizzle/0007_faulty_starbolt.sql +30 -0
  161. package/.output/server/drizzle/0008_durable_lifecycle_evidence.sql +15 -0
  162. package/.output/server/drizzle/meta/0000_snapshot.json +1333 -0
  163. package/.output/server/drizzle/meta/0001_snapshot.json +1498 -0
  164. package/.output/server/drizzle/meta/0002_snapshot.json +1576 -0
  165. package/.output/server/drizzle/meta/0003_snapshot.json +1666 -0
  166. package/.output/server/drizzle/meta/0005_snapshot.json +1666 -0
  167. package/.output/server/drizzle/meta/0006_snapshot.json +1672 -0
  168. package/.output/server/drizzle/meta/0007_snapshot.json +1787 -0
  169. package/.output/server/drizzle/meta/_journal.json +69 -0
  170. package/.output/server/index.mjs +464 -0
  171. package/.output/server/node_modules/tslib/modules/index.js +70 -0
  172. package/.output/server/node_modules/tslib/modules/package.json +3 -0
  173. package/.output/server/node_modules/tslib/package.json +47 -0
  174. package/.output/server/node_modules/tslib/tslib.js +484 -0
  175. package/.output/server/package.json +9 -0
  176. package/LICENSE +21 -0
  177. package/drizzle/0000_round_marauders.sql +193 -0
  178. package/drizzle/0001_naive_silver_fox.sql +25 -0
  179. package/drizzle/0002_funny_sage.sql +12 -0
  180. package/drizzle/0003_optimal_slapstick.sql +102 -0
  181. package/drizzle/0004_remove_grok_agent.sql +5 -0
  182. package/drizzle/0005_heavy_gauntlet.sql +8 -0
  183. package/drizzle/0006_tranquil_sharon_carter.sql +1 -0
  184. package/drizzle/0007_faulty_starbolt.sql +30 -0
  185. package/drizzle/0008_durable_lifecycle_evidence.sql +15 -0
  186. package/drizzle/meta/0000_snapshot.json +1333 -0
  187. package/drizzle/meta/0001_snapshot.json +1498 -0
  188. package/drizzle/meta/0002_snapshot.json +1576 -0
  189. package/drizzle/meta/0003_snapshot.json +1666 -0
  190. package/drizzle/meta/0005_snapshot.json +1666 -0
  191. package/drizzle/meta/0006_snapshot.json +1672 -0
  192. package/drizzle/meta/0007_snapshot.json +1787 -0
  193. package/drizzle/meta/_journal.json +69 -0
  194. package/package.json +84 -0
  195. package/scripts/pievo-server.mjs +390 -0
  196. package/scripts/prestart.mjs +66 -0
  197. package/scripts/server-cli-lib.mjs +451 -0
@@ -0,0 +1,1548 @@
1
+ //#region ../../node_modules/.pnpm/marked@18.0.5/node_modules/marked/lib/marked.esm.js
2
+ /**
3
+ * marked v18.0.5 - a markdown parser
4
+ * Copyright (c) 2018-2026, MarkedJS. (MIT License)
5
+ * Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)
6
+ * https://github.com/markedjs/marked
7
+ */
8
+ /**
9
+ * DO NOT EDIT THIS FILE
10
+ * The code in this file is generated from files in ./src/
11
+ */
12
+ function M() {
13
+ return {
14
+ async: !1,
15
+ breaks: !1,
16
+ extensions: null,
17
+ gfm: !0,
18
+ hooks: null,
19
+ pedantic: !1,
20
+ renderer: null,
21
+ silent: !1,
22
+ tokenizer: null,
23
+ walkTokens: null
24
+ };
25
+ }
26
+ var T = M();
27
+ function N(l) {
28
+ T = l;
29
+ }
30
+ var _ = { exec: () => null };
31
+ function E(l) {
32
+ let e = [];
33
+ return (t) => {
34
+ let n = Math.max(0, Math.min(3, t - 1)), s = e[n];
35
+ return s || (s = l(n), e[n] = s), s;
36
+ };
37
+ }
38
+ function d(l, e = "") {
39
+ let t = typeof l == "string" ? l : l.source, n = {
40
+ replace: (s, r) => {
41
+ let i = typeof r == "string" ? r : r.source;
42
+ return i = i.replace(m.caret, "$1"), t = t.replace(s, i), n;
43
+ },
44
+ getRegex: () => new RegExp(t, e)
45
+ };
46
+ return n;
47
+ }
48
+ var Te = ((l = "") => {
49
+ try {
50
+ return !!new RegExp("(?<=1)(?<!1)" + l);
51
+ } catch {
52
+ return !1;
53
+ }
54
+ })(), m = {
55
+ codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
56
+ outputLinkReplace: /\\([\[\]])/g,
57
+ indentCodeCompensation: /^(\s+)(?:```)/,
58
+ beginningSpace: /^\s+/,
59
+ endingHash: /#$/,
60
+ startingSpaceChar: /^ /,
61
+ endingSpaceChar: / $/,
62
+ nonSpaceChar: /[^ ]/,
63
+ newLineCharGlobal: /\n/g,
64
+ tabCharGlobal: /\t/g,
65
+ multipleSpaceGlobal: /\s+/g,
66
+ blankLine: /^[ \t]*$/,
67
+ doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
68
+ blockquoteStart: /^ {0,3}>/,
69
+ blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
70
+ blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
71
+ listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
72
+ listIsTask: /^\[[ xX]\] +\S/,
73
+ listReplaceTask: /^\[[ xX]\] +/,
74
+ listTaskCheckbox: /\[[ xX]\]/,
75
+ anyLine: /\n.*\n/,
76
+ hrefBrackets: /^<(.*)>$/,
77
+ tableDelimiter: /[:|]/,
78
+ tableAlignChars: /^\||\| *$/g,
79
+ tableRowBlankLine: /\n[ \t]*$/,
80
+ tableAlignRight: /^ *-+: *$/,
81
+ tableAlignCenter: /^ *:-+: *$/,
82
+ tableAlignLeft: /^ *:-+ *$/,
83
+ startATag: /^<a /i,
84
+ endATag: /^<\/a>/i,
85
+ startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
86
+ endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
87
+ startAngleBracket: /^</,
88
+ endAngleBracket: />$/,
89
+ pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
90
+ unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
91
+ escapeTest: /[&<>"']/,
92
+ escapeReplace: /[&<>"']/g,
93
+ escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
94
+ escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
95
+ caret: /(^|[^\[])\^/g,
96
+ percentDecode: /%25/g,
97
+ findPipe: /\|/g,
98
+ splitPipe: / \|/,
99
+ slashPipe: /\\\|/g,
100
+ carriageReturn: /\r\n|\r/g,
101
+ spaceLine: /^ +$/gm,
102
+ notSpaceStart: /^\S*/,
103
+ endingNewline: /\n$/,
104
+ listItemRegex: (l) => new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),
105
+ nextBulletRegex: E((l) => new RegExp(`^ {0,${l}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
106
+ hrRegex: E((l) => new RegExp(`^ {0,${l}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),
107
+ fencesBeginRegex: E((l) => new RegExp(`^ {0,${l}}(?:\`\`\`|~~~)`)),
108
+ headingBeginRegex: E((l) => new RegExp(`^ {0,${l}}#`)),
109
+ htmlBeginRegex: E((l) => new RegExp(`^ {0,${l}}<(?:[a-z].*>|!--)`, "i")),
110
+ blockquoteBeginRegex: E((l) => new RegExp(`^ {0,${l}}>`))
111
+ }, Oe = /^(?:[ \t]*(?:\n|$))+/, we = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, ye = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, B = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Pe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, j = / {0,3}(?:[*+-]|\d{1,9}[.)])/, oe = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ae = d(oe).replace(/bull/g, j).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Se = d(oe).replace(/bull/g, j).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), F = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, $e = /^[^\n]+/, U = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Le = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", U).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), _e = d(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, j).getRegex(), H = "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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", K = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, ze = d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", K).replace("tag", H).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), le = d(F).replace("hr", B).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex(), W = {
112
+ blockquote: d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", le).getRegex(),
113
+ code: we,
114
+ def: Le,
115
+ fences: ye,
116
+ heading: Pe,
117
+ hr: B,
118
+ html: ze,
119
+ lheading: ae,
120
+ list: _e,
121
+ newline: Oe,
122
+ paragraph: le,
123
+ table: _,
124
+ text: $e
125
+ }, se = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", B).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex(), Ee = {
126
+ ...W,
127
+ lheading: Se,
128
+ table: se,
129
+ paragraph: d(F).replace("hr", B).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", se).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex()
130
+ }, Ie = {
131
+ ...W,
132
+ html: d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", K).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
133
+ def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
134
+ heading: /^(#{1,6})(.*)(?:\n+|$)/,
135
+ fences: _,
136
+ lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
137
+ paragraph: d(F).replace("hr", B).replace("heading", ` *#{1,6} *[^
138
+ ]`).replace("lheading", ae).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
139
+ }, Ae = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ce = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ue = /^( {2,}|\\)\n(?!\s*$)/, Be = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, I = /[\p{P}\p{S}]/u, Z = /[\s\p{P}\p{S}]/u, X = /[^\s\p{P}\p{S}]/u, De = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Z).getRegex(), pe = /(?!~)[\p{P}\p{S}]/u, qe = /(?!~)[\s\p{P}\p{S}]/u, ve = /(?:[^\s\p{P}\p{S}]|~)/u, He = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Te ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ce = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Ze = d(ce, "u").replace(/punct/g, I).getRegex(), Ge = d(ce, "u").replace(/punct/g, pe).getRegex(), he = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ne = d(he, "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, Z).replace(/punct/g, I).getRegex(), Qe = d(he, "gu").replace(/notPunctSpace/g, ve).replace(/punctSpace/g, qe).replace(/punct/g, pe).getRegex(), je = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, Z).replace(/punct/g, I).getRegex(), Fe = d(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, I).getRegex(), Ke = d("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, Z).replace(/punct/g, I).getRegex(), We = d(/\\(punct)/, "gu").replace(/punct/g, I).getRegex(), Xe = d(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[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])?)+(?![-_])/).getRegex(), Je = d(K).replace("(?:-->|$)", "-->").getRegex(), Ve = d("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Je).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), v = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Ye = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", v).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ke = d(/^!?\[(label)\]\[(ref)\]/).replace("label", v).replace("ref", U).getRegex(), de = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", U).getRegex(), et = d("reflink|nolink(?!\\()", "g").replace("reflink", ke).replace("nolink", de).getRegex(), ie = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, J = {
140
+ _backpedal: _,
141
+ anyPunctuation: We,
142
+ autolink: Xe,
143
+ blockSkip: He,
144
+ br: ue,
145
+ code: Ce,
146
+ del: _,
147
+ delLDelim: _,
148
+ delRDelim: _,
149
+ emStrongLDelim: Ze,
150
+ emStrongRDelimAst: Ne,
151
+ emStrongRDelimUnd: je,
152
+ escape: Ae,
153
+ link: Ye,
154
+ nolink: de,
155
+ punctuation: De,
156
+ reflink: ke,
157
+ reflinkSearch: et,
158
+ tag: Ve,
159
+ text: Be,
160
+ url: _
161
+ }, tt = {
162
+ ...J,
163
+ link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", v).getRegex(),
164
+ reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", v).getRegex()
165
+ }, Q = {
166
+ ...J,
167
+ emStrongRDelimAst: Qe,
168
+ emStrongLDelim: Ge,
169
+ delLDelim: Fe,
170
+ delRDelim: Ke,
171
+ url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ie).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
172
+ _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
173
+ del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
174
+ text: d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ie).getRegex()
175
+ }, nt = {
176
+ ...Q,
177
+ br: d(ue).replace("{2,}", "*").getRegex(),
178
+ text: d(Q.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
179
+ }, D = {
180
+ normal: W,
181
+ gfm: Ee,
182
+ pedantic: Ie
183
+ }, A = {
184
+ normal: J,
185
+ gfm: Q,
186
+ breaks: nt,
187
+ pedantic: tt
188
+ };
189
+ var rt = {
190
+ "&": "&amp;",
191
+ "<": "&lt;",
192
+ ">": "&gt;",
193
+ "\"": "&quot;",
194
+ "'": "&#39;"
195
+ }, ge = (l) => rt[l];
196
+ function O(l, e) {
197
+ if (e) {
198
+ if (m.escapeTest.test(l)) return l.replace(m.escapeReplace, ge);
199
+ } else if (m.escapeTestNoEncode.test(l)) return l.replace(m.escapeReplaceNoEncode, ge);
200
+ return l;
201
+ }
202
+ function V(l) {
203
+ try {
204
+ l = encodeURI(l).replace(m.percentDecode, "%");
205
+ } catch {
206
+ return null;
207
+ }
208
+ return l;
209
+ }
210
+ function Y(l, e) {
211
+ let n = l.replace(m.findPipe, (r, i, o) => {
212
+ let u = !1, a = i;
213
+ for (; --a >= 0 && o[a] === "\\";) u = !u;
214
+ return u ? "|" : " |";
215
+ }).split(m.splitPipe), s = 0;
216
+ if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e);
217
+ else for (; n.length < e;) n.push("");
218
+ for (; s < n.length; s++) n[s] = n[s].trim().replace(m.slashPipe, "|");
219
+ return n;
220
+ }
221
+ function $(l, e, t) {
222
+ let n = l.length;
223
+ if (n === 0) return "";
224
+ let s = 0;
225
+ for (; s < n;) {
226
+ let r = l.charAt(n - s - 1);
227
+ if (r === e && !t) s++;
228
+ else if (r !== e && t) s++;
229
+ else break;
230
+ }
231
+ return l.slice(0, n - s);
232
+ }
233
+ function ee(l) {
234
+ let e = l.split(`
235
+ `), t = e.length - 1;
236
+ for (; t >= 0 && m.blankLine.test(e[t]);) t--;
237
+ return e.length - t <= 2 ? l : e.slice(0, t + 1).join(`
238
+ `);
239
+ }
240
+ function fe(l, e) {
241
+ if (l.indexOf(e[1]) === -1) return -1;
242
+ let t = 0;
243
+ for (let n = 0; n < l.length; n++) if (l[n] === "\\") n++;
244
+ else if (l[n] === e[0]) t++;
245
+ else if (l[n] === e[1] && (t--, t < 0)) return n;
246
+ return t > 0 ? -2 : -1;
247
+ }
248
+ function me(l, e = 0) {
249
+ let t = e, n = "";
250
+ for (let s of l) if (s === " ") {
251
+ let r = 4 - t % 4;
252
+ n += " ".repeat(r), t += r;
253
+ } else n += s, t++;
254
+ return n;
255
+ }
256
+ function xe(l, e, t, n, s) {
257
+ let r = e.href, i = e.title || null, o = l[1].replace(s.other.outputLinkReplace, "$1");
258
+ n.state.inLink = !0;
259
+ let u = {
260
+ type: l[0].charAt(0) === "!" ? "image" : "link",
261
+ raw: t,
262
+ href: r,
263
+ title: i,
264
+ text: o,
265
+ tokens: n.inlineTokens(o)
266
+ };
267
+ return n.state.inLink = !1, u;
268
+ }
269
+ function st(l, e, t) {
270
+ let n = l.match(t.other.indentCodeCompensation);
271
+ if (n === null) return e;
272
+ let s = n[1];
273
+ return e.split(`
274
+ `).map((r) => {
275
+ let i = r.match(t.other.beginningSpace);
276
+ if (i === null) return r;
277
+ let [o] = i;
278
+ return o.length >= s.length ? r.slice(s.length) : r;
279
+ }).join(`
280
+ `);
281
+ }
282
+ var w = class {
283
+ options;
284
+ rules;
285
+ lexer;
286
+ constructor(e) {
287
+ this.options = e || T;
288
+ }
289
+ space(e) {
290
+ let t = this.rules.block.newline.exec(e);
291
+ if (t && t[0].length > 0) return {
292
+ type: "space",
293
+ raw: t[0]
294
+ };
295
+ }
296
+ code(e) {
297
+ let t = this.rules.block.code.exec(e);
298
+ if (t) {
299
+ let n = this.options.pedantic ? t[0] : ee(t[0]);
300
+ return {
301
+ type: "code",
302
+ raw: n,
303
+ codeBlockStyle: "indented",
304
+ text: n.replace(this.rules.other.codeRemoveIndent, "")
305
+ };
306
+ }
307
+ }
308
+ fences(e) {
309
+ let t = this.rules.block.fences.exec(e);
310
+ if (t) {
311
+ let n = t[0], s = st(n, t[3] || "", this.rules);
312
+ return {
313
+ type: "code",
314
+ raw: n,
315
+ lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
316
+ text: s
317
+ };
318
+ }
319
+ }
320
+ heading(e) {
321
+ let t = this.rules.block.heading.exec(e);
322
+ if (t) {
323
+ let n = t[2].trim();
324
+ if (this.rules.other.endingHash.test(n)) {
325
+ let s = $(n, "#");
326
+ (this.options.pedantic || !s || this.rules.other.endingSpaceChar.test(s)) && (n = s.trim());
327
+ }
328
+ return {
329
+ type: "heading",
330
+ raw: $(t[0], `
331
+ `),
332
+ depth: t[1].length,
333
+ text: n,
334
+ tokens: this.lexer.inline(n)
335
+ };
336
+ }
337
+ }
338
+ hr(e) {
339
+ let t = this.rules.block.hr.exec(e);
340
+ if (t) return {
341
+ type: "hr",
342
+ raw: $(t[0], `
343
+ `)
344
+ };
345
+ }
346
+ blockquote(e) {
347
+ let t = this.rules.block.blockquote.exec(e);
348
+ if (t) {
349
+ let n = $(t[0], `
350
+ `).split(`
351
+ `), s = "", r = "", i = [];
352
+ for (; n.length > 0;) {
353
+ let o = !1, u = [], a;
354
+ for (a = 0; a < n.length; a++) if (this.rules.other.blockquoteStart.test(n[a])) u.push(n[a]), o = !0;
355
+ else if (!o) u.push(n[a]);
356
+ else break;
357
+ n = n.slice(a);
358
+ let c = u.join(`
359
+ `), p = c.replace(this.rules.other.blockquoteSetextReplace, `
360
+ $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
361
+ s = s ? `${s}
362
+ ${c}` : c, r = r ? `${r}
363
+ ${p}` : p;
364
+ let k = this.lexer.state.top;
365
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(p, i, !0), this.lexer.state.top = k, n.length === 0) break;
366
+ let h = i.at(-1);
367
+ if (h?.type === "code") break;
368
+ if (h?.type === "blockquote") {
369
+ let R = h, f = R.raw + `
370
+ ` + n.join(`
371
+ `), S = this.blockquote(f);
372
+ i[i.length - 1] = S, s = s.substring(0, s.length - R.raw.length) + S.raw, r = r.substring(0, r.length - R.text.length) + S.text;
373
+ break;
374
+ } else if (h?.type === "list") {
375
+ let R = h, f = R.raw + `
376
+ ` + n.join(`
377
+ `), S = this.list(f);
378
+ i[i.length - 1] = S, s = s.substring(0, s.length - h.raw.length) + S.raw, r = r.substring(0, r.length - R.raw.length) + S.raw, n = f.substring(i.at(-1).raw.length).split(`
379
+ `);
380
+ continue;
381
+ }
382
+ }
383
+ return {
384
+ type: "blockquote",
385
+ raw: s,
386
+ tokens: i,
387
+ text: r
388
+ };
389
+ }
390
+ }
391
+ list(e) {
392
+ let t = this.rules.block.list.exec(e);
393
+ if (t) {
394
+ let n = t[1].trim(), s = n.length > 1, r = {
395
+ type: "list",
396
+ raw: "",
397
+ ordered: s,
398
+ start: s ? +n.slice(0, -1) : "",
399
+ loose: !1,
400
+ items: []
401
+ };
402
+ n = s ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = s ? n : "[*+-]");
403
+ let i = this.rules.other.listItemRegex(n), o = !1;
404
+ for (; e;) {
405
+ let a = !1, c = "", p = "";
406
+ if (!(t = i.exec(e)) || this.rules.block.hr.test(e)) break;
407
+ c = t[0], e = e.substring(c.length);
408
+ let k = me(t[2].split(`
409
+ `, 1)[0], t[1].length), h = e.split(`
410
+ `, 1)[0], R = !k.trim(), f = 0;
411
+ if (this.options.pedantic ? (f = 2, p = k.trimStart()) : R ? f = t[1].length + 1 : (f = k.search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, p = k.slice(f), f += t[1].length), R && this.rules.other.blankLine.test(h) && (c += h + `
412
+ `, e = e.substring(h.length + 1), a = !0), !a) {
413
+ let S = this.rules.other.nextBulletRegex(f), te = this.rules.other.hrRegex(f), ne = this.rules.other.fencesBeginRegex(f), re = this.rules.other.headingBeginRegex(f), be = this.rules.other.htmlBeginRegex(f), Re = this.rules.other.blockquoteBeginRegex(f);
414
+ for (; e;) {
415
+ let G = e.split(`
416
+ `, 1)[0], C;
417
+ if (h = G, this.options.pedantic ? (h = h.replace(this.rules.other.listReplaceNesting, " "), C = h) : C = h.replace(this.rules.other.tabCharGlobal, " "), ne.test(h) || re.test(h) || be.test(h) || Re.test(h) || S.test(h) || te.test(h)) break;
418
+ if (C.search(this.rules.other.nonSpaceChar) >= f || !h.trim()) p += `
419
+ ` + C.slice(f);
420
+ else {
421
+ if (R || k.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ne.test(k) || re.test(k) || te.test(k)) break;
422
+ p += `
423
+ ` + h;
424
+ }
425
+ R = !h.trim(), c += G + `
426
+ `, e = e.substring(G.length + 1), k = C.slice(f);
427
+ }
428
+ }
429
+ r.loose || (o ? r.loose = !0 : this.rules.other.doubleBlankLine.test(c) && (o = !0)), r.items.push({
430
+ type: "list_item",
431
+ raw: c,
432
+ task: !!this.options.gfm && this.rules.other.listIsTask.test(p),
433
+ loose: !1,
434
+ text: p,
435
+ tokens: []
436
+ }), r.raw += c;
437
+ }
438
+ let u = r.items.at(-1);
439
+ if (u) u.raw = u.raw.trimEnd(), u.text = u.text.trimEnd();
440
+ else return;
441
+ r.raw = r.raw.trimEnd();
442
+ for (let a of r.items) {
443
+ this.lexer.state.top = !1, a.tokens = this.lexer.blockTokens(a.text, []);
444
+ let c = a.tokens[0];
445
+ if (a.task && (c?.type === "text" || c?.type === "paragraph")) {
446
+ a.text = a.text.replace(this.rules.other.listReplaceTask, ""), c.raw = c.raw.replace(this.rules.other.listReplaceTask, ""), c.text = c.text.replace(this.rules.other.listReplaceTask, "");
447
+ for (let k = this.lexer.inlineQueue.length - 1; k >= 0; k--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[k].src)) {
448
+ this.lexer.inlineQueue[k].src = this.lexer.inlineQueue[k].src.replace(this.rules.other.listReplaceTask, "");
449
+ break;
450
+ }
451
+ let p = this.rules.other.listTaskCheckbox.exec(a.raw);
452
+ if (p) {
453
+ let k = {
454
+ type: "checkbox",
455
+ raw: p[0] + " ",
456
+ checked: p[0] !== "[ ]"
457
+ };
458
+ a.checked = k.checked, r.loose ? a.tokens[0] && ["paragraph", "text"].includes(a.tokens[0].type) && "tokens" in a.tokens[0] && a.tokens[0].tokens ? (a.tokens[0].raw = k.raw + a.tokens[0].raw, a.tokens[0].text = k.raw + a.tokens[0].text, a.tokens[0].tokens.unshift(k)) : a.tokens.unshift({
459
+ type: "paragraph",
460
+ raw: k.raw,
461
+ text: k.raw,
462
+ tokens: [k]
463
+ }) : a.tokens.unshift(k);
464
+ }
465
+ } else a.task && (a.task = !1);
466
+ if (!r.loose) {
467
+ let p = a.tokens.filter((h) => h.type === "space");
468
+ r.loose = p.length > 0 && p.some((h) => this.rules.other.anyLine.test(h.raw));
469
+ }
470
+ }
471
+ if (r.loose) for (let a of r.items) {
472
+ a.loose = !0;
473
+ for (let c of a.tokens) c.type === "text" && (c.type = "paragraph");
474
+ }
475
+ return r;
476
+ }
477
+ }
478
+ html(e) {
479
+ let t = this.rules.block.html.exec(e);
480
+ if (t) {
481
+ let n = ee(t[0]);
482
+ return {
483
+ type: "html",
484
+ block: !0,
485
+ raw: n,
486
+ pre: t[1] === "pre" || t[1] === "script" || t[1] === "style",
487
+ text: n
488
+ };
489
+ }
490
+ }
491
+ def(e) {
492
+ let t = this.rules.block.def.exec(e);
493
+ if (t) {
494
+ let n = t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), s = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
495
+ return {
496
+ type: "def",
497
+ tag: n,
498
+ raw: $(t[0], `
499
+ `),
500
+ href: s,
501
+ title: r
502
+ };
503
+ }
504
+ }
505
+ table(e) {
506
+ let t = this.rules.block.table.exec(e);
507
+ if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
508
+ let n = Y(t[1]), s = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), r = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
509
+ `) : [], i = {
510
+ type: "table",
511
+ raw: $(t[0], `
512
+ `),
513
+ header: [],
514
+ align: [],
515
+ rows: []
516
+ };
517
+ if (n.length === s.length) {
518
+ for (let o of s) this.rules.other.tableAlignRight.test(o) ? i.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? i.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? i.align.push("left") : i.align.push(null);
519
+ for (let o = 0; o < n.length; o++) i.header.push({
520
+ text: n[o],
521
+ tokens: this.lexer.inline(n[o]),
522
+ header: !0,
523
+ align: i.align[o]
524
+ });
525
+ for (let o of r) i.rows.push(Y(o, i.header.length).map((u, a) => ({
526
+ text: u,
527
+ tokens: this.lexer.inline(u),
528
+ header: !1,
529
+ align: i.align[a]
530
+ })));
531
+ return i;
532
+ }
533
+ }
534
+ lheading(e) {
535
+ let t = this.rules.block.lheading.exec(e);
536
+ if (t) {
537
+ let n = t[1].trim();
538
+ return {
539
+ type: "heading",
540
+ raw: $(t[0], `
541
+ `),
542
+ depth: t[2].charAt(0) === "=" ? 1 : 2,
543
+ text: n,
544
+ tokens: this.lexer.inline(n)
545
+ };
546
+ }
547
+ }
548
+ paragraph(e) {
549
+ let t = this.rules.block.paragraph.exec(e);
550
+ if (t) {
551
+ let n = t[1].charAt(t[1].length - 1) === `
552
+ ` ? t[1].slice(0, -1) : t[1];
553
+ return {
554
+ type: "paragraph",
555
+ raw: t[0],
556
+ text: n,
557
+ tokens: this.lexer.inline(n)
558
+ };
559
+ }
560
+ }
561
+ text(e) {
562
+ let t = this.rules.block.text.exec(e);
563
+ if (t) return {
564
+ type: "text",
565
+ raw: t[0],
566
+ text: t[0],
567
+ tokens: this.lexer.inline(t[0])
568
+ };
569
+ }
570
+ escape(e) {
571
+ let t = this.rules.inline.escape.exec(e);
572
+ if (t) return {
573
+ type: "escape",
574
+ raw: t[0],
575
+ text: t[1]
576
+ };
577
+ }
578
+ tag(e) {
579
+ let t = this.rules.inline.tag.exec(e);
580
+ if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = !1), {
581
+ type: "html",
582
+ raw: t[0],
583
+ inLink: this.lexer.state.inLink,
584
+ inRawBlock: this.lexer.state.inRawBlock,
585
+ block: !1,
586
+ text: t[0]
587
+ };
588
+ }
589
+ link(e) {
590
+ let t = this.rules.inline.link.exec(e);
591
+ if (t) {
592
+ let n = t[2].trim();
593
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
594
+ if (!this.rules.other.endAngleBracket.test(n)) return;
595
+ let i = $(n.slice(0, -1), "\\");
596
+ if ((n.length - i.length) % 2 === 0) return;
597
+ } else {
598
+ let i = fe(t[2], "()");
599
+ if (i === -2) return;
600
+ if (i > -1) {
601
+ let u = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + i;
602
+ t[2] = t[2].substring(0, i), t[0] = t[0].substring(0, u).trim(), t[3] = "";
603
+ }
604
+ }
605
+ let s = t[2], r = "";
606
+ if (this.options.pedantic) {
607
+ let i = this.rules.other.pedanticHrefTitle.exec(s);
608
+ i && (s = i[1], r = i[3]);
609
+ } else r = t[3] ? t[3].slice(1, -1) : "";
610
+ return s = s.trim(), this.rules.other.startAngleBracket.test(s) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? s = s.slice(1) : s = s.slice(1, -1)), xe(t, {
611
+ href: s && s.replace(this.rules.inline.anyPunctuation, "$1"),
612
+ title: r && r.replace(this.rules.inline.anyPunctuation, "$1")
613
+ }, t[0], this.lexer, this.rules);
614
+ }
615
+ }
616
+ reflink(e, t) {
617
+ let n;
618
+ if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
619
+ let r = t[(n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " ").toLowerCase()];
620
+ if (!r) {
621
+ let i = n[0].charAt(0);
622
+ return {
623
+ type: "text",
624
+ raw: i,
625
+ text: i
626
+ };
627
+ }
628
+ return xe(n, r, n[0], this.lexer, this.rules);
629
+ }
630
+ }
631
+ emStrong(e, t, n = "") {
632
+ let s = this.rules.inline.emStrongLDelim.exec(e);
633
+ if (!s || !s[1] && !s[2] && !s[3] && !s[4] || s[4] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
634
+ if (!(s[1] || s[3] || "") || !n || this.rules.inline.punctuation.exec(n)) {
635
+ let i = [...s[0]].length - 1, o, u, a = i, c = 0, p = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
636
+ for (p.lastIndex = 0, t = t.slice(-1 * e.length + i); (s = p.exec(t)) !== null;) {
637
+ if (o = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !o) continue;
638
+ if (u = [...o].length, s[3] || s[4]) {
639
+ a += u;
640
+ continue;
641
+ } else if ((s[5] || s[6]) && i % 3 && !((i + u) % 3)) {
642
+ c += u;
643
+ continue;
644
+ }
645
+ if (a -= u, a > 0) continue;
646
+ u = Math.min(u, u + a + c);
647
+ let k = [...s[0]][0].length, h = e.slice(0, i + s.index + k + u);
648
+ if (Math.min(i, u) % 2) {
649
+ let f = h.slice(1, -1);
650
+ return {
651
+ type: "em",
652
+ raw: h,
653
+ text: f,
654
+ tokens: this.lexer.inlineTokens(f)
655
+ };
656
+ }
657
+ let R = h.slice(2, -2);
658
+ return {
659
+ type: "strong",
660
+ raw: h,
661
+ text: R,
662
+ tokens: this.lexer.inlineTokens(R)
663
+ };
664
+ }
665
+ }
666
+ }
667
+ codespan(e) {
668
+ let t = this.rules.inline.code.exec(e);
669
+ if (t) {
670
+ let n = t[2].replace(this.rules.other.newLineCharGlobal, " "), s = this.rules.other.nonSpaceChar.test(n), r = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
671
+ return s && r && (n = n.substring(1, n.length - 1)), {
672
+ type: "codespan",
673
+ raw: t[0],
674
+ text: n
675
+ };
676
+ }
677
+ }
678
+ br(e) {
679
+ let t = this.rules.inline.br.exec(e);
680
+ if (t) return {
681
+ type: "br",
682
+ raw: t[0]
683
+ };
684
+ }
685
+ del(e, t, n = "") {
686
+ let s = this.rules.inline.delLDelim.exec(e);
687
+ if (!s) return;
688
+ if (!(s[1] || "") || !n || this.rules.inline.punctuation.exec(n)) {
689
+ let i = [...s[0]].length - 1, o, u, a = i, c = this.rules.inline.delRDelim;
690
+ for (c.lastIndex = 0, t = t.slice(-1 * e.length + i); (s = c.exec(t)) !== null;) {
691
+ if (o = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !o || (u = [...o].length, u !== i)) continue;
692
+ if (s[3] || s[4]) {
693
+ a += u;
694
+ continue;
695
+ }
696
+ if (a -= u, a > 0) continue;
697
+ u = Math.min(u, u + a);
698
+ let p = [...s[0]][0].length, k = e.slice(0, i + s.index + p + u), h = k.slice(i, -i);
699
+ return {
700
+ type: "del",
701
+ raw: k,
702
+ text: h,
703
+ tokens: this.lexer.inlineTokens(h)
704
+ };
705
+ }
706
+ }
707
+ }
708
+ autolink(e) {
709
+ let t = this.rules.inline.autolink.exec(e);
710
+ if (t) {
711
+ let n, s;
712
+ return t[2] === "@" ? (n = t[1], s = "mailto:" + n) : (n = t[1], s = n), {
713
+ type: "link",
714
+ raw: t[0],
715
+ text: n,
716
+ href: s,
717
+ tokens: [{
718
+ type: "text",
719
+ raw: n,
720
+ text: n
721
+ }]
722
+ };
723
+ }
724
+ }
725
+ url(e) {
726
+ let t;
727
+ if (t = this.rules.inline.url.exec(e)) {
728
+ let n, s;
729
+ if (t[2] === "@") n = t[0], s = "mailto:" + n;
730
+ else {
731
+ let r;
732
+ do
733
+ r = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
734
+ while (r !== t[0]);
735
+ n = t[0], t[1] === "www." ? s = "http://" + t[0] : s = t[0];
736
+ }
737
+ return {
738
+ type: "link",
739
+ raw: t[0],
740
+ text: n,
741
+ href: s,
742
+ tokens: [{
743
+ type: "text",
744
+ raw: n,
745
+ text: n
746
+ }]
747
+ };
748
+ }
749
+ }
750
+ inlineText(e) {
751
+ let t = this.rules.inline.text.exec(e);
752
+ if (t) {
753
+ let n = this.lexer.state.inRawBlock;
754
+ return {
755
+ type: "text",
756
+ raw: t[0],
757
+ text: t[0],
758
+ escaped: n
759
+ };
760
+ }
761
+ }
762
+ };
763
+ var x = class l {
764
+ tokens;
765
+ options;
766
+ state;
767
+ inlineQueue;
768
+ tokenizer;
769
+ constructor(e) {
770
+ this.tokens = [], this.tokens.links = Object.create(null), this.options = e || T, this.options.tokenizer = this.options.tokenizer || new w(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
771
+ inLink: !1,
772
+ inRawBlock: !1,
773
+ top: !0
774
+ };
775
+ let t = {
776
+ other: m,
777
+ block: D.normal,
778
+ inline: A.normal
779
+ };
780
+ this.options.pedantic ? (t.block = D.pedantic, t.inline = A.pedantic) : this.options.gfm && (t.block = D.gfm, this.options.breaks ? t.inline = A.breaks : t.inline = A.gfm), this.tokenizer.rules = t;
781
+ }
782
+ static get rules() {
783
+ return {
784
+ block: D,
785
+ inline: A
786
+ };
787
+ }
788
+ static lex(e, t) {
789
+ return new l(t).lex(e);
790
+ }
791
+ static lexInline(e, t) {
792
+ return new l(t).inlineTokens(e);
793
+ }
794
+ lex(e) {
795
+ e = e.replace(m.carriageReturn, `
796
+ `), this.blockTokens(e, this.tokens);
797
+ for (let t = 0; t < this.inlineQueue.length; t++) {
798
+ let n = this.inlineQueue[t];
799
+ this.inlineTokens(n.src, n.tokens);
800
+ }
801
+ return this.inlineQueue = [], this.tokens;
802
+ }
803
+ blockTokens(e, t = [], n = !1) {
804
+ this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(m.tabCharGlobal, " ").replace(m.spaceLine, ""));
805
+ let s = Infinity;
806
+ for (; e;) {
807
+ if (e.length < s) s = e.length;
808
+ else {
809
+ this.infiniteLoopError(e.charCodeAt(0));
810
+ break;
811
+ }
812
+ let r;
813
+ if (this.options.extensions?.block?.some((o) => (r = o.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
814
+ if (r = this.tokenizer.space(e)) {
815
+ e = e.substring(r.raw.length);
816
+ let o = t.at(-1);
817
+ r.raw.length === 1 && o !== void 0 ? o.raw += `
818
+ ` : t.push(r);
819
+ continue;
820
+ }
821
+ if (r = this.tokenizer.code(e)) {
822
+ e = e.substring(r.raw.length);
823
+ let o = t.at(-1);
824
+ o?.type === "paragraph" || o?.type === "text" ? (o.raw += (o.raw.endsWith(`
825
+ `) ? "" : `
826
+ `) + r.raw, o.text += `
827
+ ` + r.text, this.inlineQueue.at(-1).src = o.text) : t.push(r);
828
+ continue;
829
+ }
830
+ if (r = this.tokenizer.fences(e)) {
831
+ e = e.substring(r.raw.length), t.push(r);
832
+ continue;
833
+ }
834
+ if (r = this.tokenizer.heading(e)) {
835
+ e = e.substring(r.raw.length), t.push(r);
836
+ continue;
837
+ }
838
+ if (r = this.tokenizer.hr(e)) {
839
+ e = e.substring(r.raw.length), t.push(r);
840
+ continue;
841
+ }
842
+ if (r = this.tokenizer.blockquote(e)) {
843
+ e = e.substring(r.raw.length), t.push(r);
844
+ continue;
845
+ }
846
+ if (r = this.tokenizer.list(e)) {
847
+ e = e.substring(r.raw.length), t.push(r);
848
+ continue;
849
+ }
850
+ if (r = this.tokenizer.html(e)) {
851
+ e = e.substring(r.raw.length), t.push(r);
852
+ continue;
853
+ }
854
+ if (r = this.tokenizer.def(e)) {
855
+ e = e.substring(r.raw.length);
856
+ let o = t.at(-1);
857
+ o?.type === "paragraph" || o?.type === "text" ? (o.raw += (o.raw.endsWith(`
858
+ `) ? "" : `
859
+ `) + r.raw, o.text += `
860
+ ` + r.raw, this.inlineQueue.at(-1).src = o.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = {
861
+ href: r.href,
862
+ title: r.title
863
+ }, t.push(r));
864
+ continue;
865
+ }
866
+ if (r = this.tokenizer.table(e)) {
867
+ e = e.substring(r.raw.length), t.push(r);
868
+ continue;
869
+ }
870
+ if (r = this.tokenizer.lheading(e)) {
871
+ e = e.substring(r.raw.length), t.push(r);
872
+ continue;
873
+ }
874
+ let i = e;
875
+ if (this.options.extensions?.startBlock) {
876
+ let o = Infinity, u = e.slice(1), a;
877
+ this.options.extensions.startBlock.forEach((c) => {
878
+ a = c.call({ lexer: this }, u), typeof a == "number" && a >= 0 && (o = Math.min(o, a));
879
+ }), o < Infinity && o >= 0 && (i = e.substring(0, o + 1));
880
+ }
881
+ if (this.state.top && (r = this.tokenizer.paragraph(i))) {
882
+ let o = t.at(-1);
883
+ n && o?.type === "paragraph" ? (o.raw += (o.raw.endsWith(`
884
+ `) ? "" : `
885
+ `) + r.raw, o.text += `
886
+ ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = o.text) : t.push(r), n = i.length !== e.length, e = e.substring(r.raw.length);
887
+ continue;
888
+ }
889
+ if (r = this.tokenizer.text(e)) {
890
+ e = e.substring(r.raw.length);
891
+ let o = t.at(-1);
892
+ o?.type === "text" ? (o.raw += (o.raw.endsWith(`
893
+ `) ? "" : `
894
+ `) + r.raw, o.text += `
895
+ ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = o.text) : t.push(r);
896
+ continue;
897
+ }
898
+ if (e) {
899
+ this.infiniteLoopError(e.charCodeAt(0));
900
+ break;
901
+ }
902
+ }
903
+ return this.state.top = !0, t;
904
+ }
905
+ inline(e, t = []) {
906
+ return this.inlineQueue.push({
907
+ src: e,
908
+ tokens: t
909
+ }), t;
910
+ }
911
+ inlineTokens(e, t = []) {
912
+ this.tokenizer.lexer = this;
913
+ let n = e, s = null;
914
+ if (this.tokens.links) {
915
+ let a = Object.keys(this.tokens.links);
916
+ if (a.length > 0) for (; (s = this.tokenizer.rules.inline.reflinkSearch.exec(n)) !== null;) a.includes(s[0].slice(s[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, s.index) + "[" + "a".repeat(s[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
917
+ }
918
+ for (; (s = this.tokenizer.rules.inline.anyPunctuation.exec(n)) !== null;) n = n.slice(0, s.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
919
+ let r;
920
+ for (; (s = this.tokenizer.rules.inline.blockSkip.exec(n)) !== null;) r = s[2] ? s[2].length : 0, n = n.slice(0, s.index + r) + "[" + "a".repeat(s[0].length - r - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
921
+ n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
922
+ let i = !1, o = "", u = Infinity;
923
+ for (; e;) {
924
+ if (e.length < u) u = e.length;
925
+ else {
926
+ this.infiniteLoopError(e.charCodeAt(0));
927
+ break;
928
+ }
929
+ i || (o = ""), i = !1;
930
+ let a;
931
+ if (this.options.extensions?.inline?.some((p) => (a = p.call({ lexer: this }, e, t)) ? (e = e.substring(a.raw.length), t.push(a), !0) : !1)) continue;
932
+ if (a = this.tokenizer.escape(e)) {
933
+ e = e.substring(a.raw.length), t.push(a);
934
+ continue;
935
+ }
936
+ if (a = this.tokenizer.tag(e)) {
937
+ e = e.substring(a.raw.length), t.push(a);
938
+ continue;
939
+ }
940
+ if (a = this.tokenizer.link(e)) {
941
+ e = e.substring(a.raw.length), t.push(a);
942
+ continue;
943
+ }
944
+ if (a = this.tokenizer.reflink(e, this.tokens.links)) {
945
+ e = e.substring(a.raw.length);
946
+ let p = t.at(-1);
947
+ a.type === "text" && p?.type === "text" ? (p.raw += a.raw, p.text += a.text) : t.push(a);
948
+ continue;
949
+ }
950
+ if (a = this.tokenizer.emStrong(e, n, o)) {
951
+ e = e.substring(a.raw.length), t.push(a);
952
+ continue;
953
+ }
954
+ if (a = this.tokenizer.codespan(e)) {
955
+ e = e.substring(a.raw.length), t.push(a);
956
+ continue;
957
+ }
958
+ if (a = this.tokenizer.br(e)) {
959
+ e = e.substring(a.raw.length), t.push(a);
960
+ continue;
961
+ }
962
+ if (a = this.tokenizer.del(e, n, o)) {
963
+ e = e.substring(a.raw.length), t.push(a);
964
+ continue;
965
+ }
966
+ if (a = this.tokenizer.autolink(e)) {
967
+ e = e.substring(a.raw.length), t.push(a);
968
+ continue;
969
+ }
970
+ if (!this.state.inLink && (a = this.tokenizer.url(e))) {
971
+ e = e.substring(a.raw.length), t.push(a);
972
+ continue;
973
+ }
974
+ let c = e;
975
+ if (this.options.extensions?.startInline) {
976
+ let p = Infinity, k = e.slice(1), h;
977
+ this.options.extensions.startInline.forEach((R) => {
978
+ h = R.call({ lexer: this }, k), typeof h == "number" && h >= 0 && (p = Math.min(p, h));
979
+ }), p < Infinity && p >= 0 && (c = e.substring(0, p + 1));
980
+ }
981
+ if (a = this.tokenizer.inlineText(c)) {
982
+ e = e.substring(a.raw.length), a.raw.slice(-1) !== "_" && (o = a.raw.slice(-1)), i = !0;
983
+ let p = t.at(-1);
984
+ p?.type === "text" ? (p.raw += a.raw, p.text += a.text) : t.push(a);
985
+ continue;
986
+ }
987
+ if (e) {
988
+ this.infiniteLoopError(e.charCodeAt(0));
989
+ break;
990
+ }
991
+ }
992
+ return t;
993
+ }
994
+ infiniteLoopError(e) {
995
+ let t = "Infinite loop on byte: " + e;
996
+ if (this.options.silent) console.error(t);
997
+ else throw new Error(t);
998
+ }
999
+ };
1000
+ var y = class {
1001
+ options;
1002
+ parser;
1003
+ constructor(e) {
1004
+ this.options = e || T;
1005
+ }
1006
+ space(e) {
1007
+ return "";
1008
+ }
1009
+ code({ text: e, lang: t, escaped: n }) {
1010
+ let s = (t || "").match(m.notSpaceStart)?.[0], r = e.replace(m.endingNewline, "") + `
1011
+ `;
1012
+ return s ? "<pre><code class=\"language-" + O(s) + "\">" + (n ? r : O(r, !0)) + `</code></pre>
1013
+ ` : "<pre><code>" + (n ? r : O(r, !0)) + `</code></pre>
1014
+ `;
1015
+ }
1016
+ blockquote({ tokens: e }) {
1017
+ return `<blockquote>
1018
+ ${this.parser.parse(e)}</blockquote>
1019
+ `;
1020
+ }
1021
+ html({ text: e }) {
1022
+ return e;
1023
+ }
1024
+ def(e) {
1025
+ return "";
1026
+ }
1027
+ heading({ tokens: e, depth: t }) {
1028
+ return `<h${t}>${this.parser.parseInline(e)}</h${t}>
1029
+ `;
1030
+ }
1031
+ hr(e) {
1032
+ return `<hr>
1033
+ `;
1034
+ }
1035
+ list(e) {
1036
+ let t = e.ordered, n = e.start, s = "";
1037
+ for (let o = 0; o < e.items.length; o++) {
1038
+ let u = e.items[o];
1039
+ s += this.listitem(u);
1040
+ }
1041
+ let r = t ? "ol" : "ul", i = t && n !== 1 ? " start=\"" + n + "\"" : "";
1042
+ return "<" + r + i + `>
1043
+ ` + s + "</" + r + `>
1044
+ `;
1045
+ }
1046
+ listitem(e) {
1047
+ return `<li>${this.parser.parse(e.tokens)}</li>
1048
+ `;
1049
+ }
1050
+ checkbox({ checked: e }) {
1051
+ return "<input " + (e ? "checked=\"\" " : "") + "disabled=\"\" type=\"checkbox\"> ";
1052
+ }
1053
+ paragraph({ tokens: e }) {
1054
+ return `<p>${this.parser.parseInline(e)}</p>
1055
+ `;
1056
+ }
1057
+ table(e) {
1058
+ let t = "", n = "";
1059
+ for (let r = 0; r < e.header.length; r++) n += this.tablecell(e.header[r]);
1060
+ t += this.tablerow({ text: n });
1061
+ let s = "";
1062
+ for (let r = 0; r < e.rows.length; r++) {
1063
+ let i = e.rows[r];
1064
+ n = "";
1065
+ for (let o = 0; o < i.length; o++) n += this.tablecell(i[o]);
1066
+ s += this.tablerow({ text: n });
1067
+ }
1068
+ return s && (s = `<tbody>${s}</tbody>`), `<table>
1069
+ <thead>
1070
+ ` + t + `</thead>
1071
+ ` + s + `</table>
1072
+ `;
1073
+ }
1074
+ tablerow({ text: e }) {
1075
+ return `<tr>
1076
+ ${e}</tr>
1077
+ `;
1078
+ }
1079
+ tablecell(e) {
1080
+ let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
1081
+ return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
1082
+ `;
1083
+ }
1084
+ strong({ tokens: e }) {
1085
+ return `<strong>${this.parser.parseInline(e)}</strong>`;
1086
+ }
1087
+ em({ tokens: e }) {
1088
+ return `<em>${this.parser.parseInline(e)}</em>`;
1089
+ }
1090
+ codespan({ text: e }) {
1091
+ return `<code>${O(e, !0)}</code>`;
1092
+ }
1093
+ br(e) {
1094
+ return "<br>";
1095
+ }
1096
+ del({ tokens: e }) {
1097
+ return `<del>${this.parser.parseInline(e)}</del>`;
1098
+ }
1099
+ link({ href: e, title: t, tokens: n }) {
1100
+ let s = this.parser.parseInline(n), r = V(e);
1101
+ if (r === null) return s;
1102
+ e = r;
1103
+ let i = "<a href=\"" + e + "\"";
1104
+ return t && (i += " title=\"" + O(t) + "\""), i += ">" + s + "</a>", i;
1105
+ }
1106
+ image({ href: e, title: t, text: n, tokens: s }) {
1107
+ s && (n = this.parser.parseInline(s, this.parser.textRenderer));
1108
+ let r = V(e);
1109
+ if (r === null) return O(n);
1110
+ e = r;
1111
+ let i = `<img src="${e}" alt="${O(n)}"`;
1112
+ return t && (i += ` title="${O(t)}"`), i += ">", i;
1113
+ }
1114
+ text(e) {
1115
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : O(e.text);
1116
+ }
1117
+ };
1118
+ var L = class {
1119
+ strong({ text: e }) {
1120
+ return e;
1121
+ }
1122
+ em({ text: e }) {
1123
+ return e;
1124
+ }
1125
+ codespan({ text: e }) {
1126
+ return e;
1127
+ }
1128
+ del({ text: e }) {
1129
+ return e;
1130
+ }
1131
+ html({ text: e }) {
1132
+ return e;
1133
+ }
1134
+ text({ text: e }) {
1135
+ return e;
1136
+ }
1137
+ link({ text: e }) {
1138
+ return "" + e;
1139
+ }
1140
+ image({ text: e }) {
1141
+ return "" + e;
1142
+ }
1143
+ br() {
1144
+ return "";
1145
+ }
1146
+ checkbox({ raw: e }) {
1147
+ return e;
1148
+ }
1149
+ };
1150
+ var b = class l {
1151
+ options;
1152
+ renderer;
1153
+ textRenderer;
1154
+ constructor(e) {
1155
+ this.options = e || T, this.options.renderer = this.options.renderer || new y(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L();
1156
+ }
1157
+ static parse(e, t) {
1158
+ return new l(t).parse(e);
1159
+ }
1160
+ static parseInline(e, t) {
1161
+ return new l(t).parseInline(e);
1162
+ }
1163
+ parse(e) {
1164
+ this.renderer.parser = this;
1165
+ let t = "";
1166
+ for (let n = 0; n < e.length; n++) {
1167
+ let s = e[n];
1168
+ if (this.options.extensions?.renderers?.[s.type]) {
1169
+ let i = s, o = this.options.extensions.renderers[i.type].call({ parser: this }, i);
1170
+ if (o !== !1 || ![
1171
+ "space",
1172
+ "hr",
1173
+ "heading",
1174
+ "code",
1175
+ "table",
1176
+ "blockquote",
1177
+ "list",
1178
+ "html",
1179
+ "def",
1180
+ "paragraph",
1181
+ "text"
1182
+ ].includes(i.type)) {
1183
+ t += o || "";
1184
+ continue;
1185
+ }
1186
+ }
1187
+ let r = s;
1188
+ switch (r.type) {
1189
+ case "space":
1190
+ t += this.renderer.space(r);
1191
+ break;
1192
+ case "hr":
1193
+ t += this.renderer.hr(r);
1194
+ break;
1195
+ case "heading":
1196
+ t += this.renderer.heading(r);
1197
+ break;
1198
+ case "code":
1199
+ t += this.renderer.code(r);
1200
+ break;
1201
+ case "table":
1202
+ t += this.renderer.table(r);
1203
+ break;
1204
+ case "blockquote":
1205
+ t += this.renderer.blockquote(r);
1206
+ break;
1207
+ case "list":
1208
+ t += this.renderer.list(r);
1209
+ break;
1210
+ case "checkbox":
1211
+ t += this.renderer.checkbox(r);
1212
+ break;
1213
+ case "html":
1214
+ t += this.renderer.html(r);
1215
+ break;
1216
+ case "def":
1217
+ t += this.renderer.def(r);
1218
+ break;
1219
+ case "paragraph":
1220
+ t += this.renderer.paragraph(r);
1221
+ break;
1222
+ case "text":
1223
+ t += this.renderer.text(r);
1224
+ break;
1225
+ default: {
1226
+ let i = "Token with \"" + r.type + "\" type was not found.";
1227
+ if (this.options.silent) return console.error(i), "";
1228
+ throw new Error(i);
1229
+ }
1230
+ }
1231
+ }
1232
+ return t;
1233
+ }
1234
+ parseInline(e, t = this.renderer) {
1235
+ this.renderer.parser = this;
1236
+ let n = "";
1237
+ for (let s = 0; s < e.length; s++) {
1238
+ let r = e[s];
1239
+ if (this.options.extensions?.renderers?.[r.type]) {
1240
+ let o = this.options.extensions.renderers[r.type].call({ parser: this }, r);
1241
+ if (o !== !1 || ![
1242
+ "escape",
1243
+ "html",
1244
+ "link",
1245
+ "image",
1246
+ "strong",
1247
+ "em",
1248
+ "codespan",
1249
+ "br",
1250
+ "del",
1251
+ "text"
1252
+ ].includes(r.type)) {
1253
+ n += o || "";
1254
+ continue;
1255
+ }
1256
+ }
1257
+ let i = r;
1258
+ switch (i.type) {
1259
+ case "escape":
1260
+ n += t.text(i);
1261
+ break;
1262
+ case "html":
1263
+ n += t.html(i);
1264
+ break;
1265
+ case "link":
1266
+ n += t.link(i);
1267
+ break;
1268
+ case "image":
1269
+ n += t.image(i);
1270
+ break;
1271
+ case "checkbox":
1272
+ n += t.checkbox(i);
1273
+ break;
1274
+ case "strong":
1275
+ n += t.strong(i);
1276
+ break;
1277
+ case "em":
1278
+ n += t.em(i);
1279
+ break;
1280
+ case "codespan":
1281
+ n += t.codespan(i);
1282
+ break;
1283
+ case "br":
1284
+ n += t.br(i);
1285
+ break;
1286
+ case "del":
1287
+ n += t.del(i);
1288
+ break;
1289
+ case "text":
1290
+ n += t.text(i);
1291
+ break;
1292
+ default: {
1293
+ let o = "Token with \"" + i.type + "\" type was not found.";
1294
+ if (this.options.silent) return console.error(o), "";
1295
+ throw new Error(o);
1296
+ }
1297
+ }
1298
+ }
1299
+ return n;
1300
+ }
1301
+ };
1302
+ var P = class {
1303
+ options;
1304
+ block;
1305
+ constructor(e) {
1306
+ this.options = e || T;
1307
+ }
1308
+ static passThroughHooks = new Set([
1309
+ "preprocess",
1310
+ "postprocess",
1311
+ "processAllTokens",
1312
+ "emStrongMask"
1313
+ ]);
1314
+ static passThroughHooksRespectAsync = new Set([
1315
+ "preprocess",
1316
+ "postprocess",
1317
+ "processAllTokens"
1318
+ ]);
1319
+ preprocess(e) {
1320
+ return e;
1321
+ }
1322
+ postprocess(e) {
1323
+ return e;
1324
+ }
1325
+ processAllTokens(e) {
1326
+ return e;
1327
+ }
1328
+ emStrongMask(e) {
1329
+ return e;
1330
+ }
1331
+ provideLexer(e = this.block) {
1332
+ return e ? x.lex : x.lexInline;
1333
+ }
1334
+ provideParser(e = this.block) {
1335
+ return e ? b.parse : b.parseInline;
1336
+ }
1337
+ };
1338
+ var q = class {
1339
+ defaults = M();
1340
+ options = this.setOptions;
1341
+ parse = this.parseMarkdown(!0);
1342
+ parseInline = this.parseMarkdown(!1);
1343
+ Parser = b;
1344
+ Renderer = y;
1345
+ TextRenderer = L;
1346
+ Lexer = x;
1347
+ Tokenizer = w;
1348
+ Hooks = P;
1349
+ constructor(...e) {
1350
+ this.use(...e);
1351
+ }
1352
+ walkTokens(e, t) {
1353
+ let n = [];
1354
+ for (let s of e) switch (n = n.concat(t.call(this, s)), s.type) {
1355
+ case "table": {
1356
+ let r = s;
1357
+ for (let i of r.header) n = n.concat(this.walkTokens(i.tokens, t));
1358
+ for (let i of r.rows) for (let o of i) n = n.concat(this.walkTokens(o.tokens, t));
1359
+ break;
1360
+ }
1361
+ case "list": {
1362
+ let r = s;
1363
+ n = n.concat(this.walkTokens(r.items, t));
1364
+ break;
1365
+ }
1366
+ default: {
1367
+ let r = s;
1368
+ this.defaults.extensions?.childTokens?.[r.type] ? this.defaults.extensions.childTokens[r.type].forEach((i) => {
1369
+ let o = r[i].flat(Infinity);
1370
+ n = n.concat(this.walkTokens(o, t));
1371
+ }) : r.tokens && (n = n.concat(this.walkTokens(r.tokens, t)));
1372
+ }
1373
+ }
1374
+ return n;
1375
+ }
1376
+ use(...e) {
1377
+ let t = this.defaults.extensions || {
1378
+ renderers: {},
1379
+ childTokens: {}
1380
+ };
1381
+ return e.forEach((n) => {
1382
+ let s = { ...n };
1383
+ if (s.async = this.defaults.async || s.async || !1, n.extensions && (n.extensions.forEach((r) => {
1384
+ if (!r.name) throw new Error("extension name required");
1385
+ if ("renderer" in r) {
1386
+ let i = t.renderers[r.name];
1387
+ i ? t.renderers[r.name] = function(...o) {
1388
+ let u = r.renderer.apply(this, o);
1389
+ return u === !1 && (u = i.apply(this, o)), u;
1390
+ } : t.renderers[r.name] = r.renderer;
1391
+ }
1392
+ if ("tokenizer" in r) {
1393
+ if (!r.level || r.level !== "block" && r.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
1394
+ let i = t[r.level];
1395
+ i ? i.unshift(r.tokenizer) : t[r.level] = [r.tokenizer], r.start && (r.level === "block" ? t.startBlock ? t.startBlock.push(r.start) : t.startBlock = [r.start] : r.level === "inline" && (t.startInline ? t.startInline.push(r.start) : t.startInline = [r.start]));
1396
+ }
1397
+ "childTokens" in r && r.childTokens && (t.childTokens[r.name] = r.childTokens);
1398
+ }), s.extensions = t), n.renderer) {
1399
+ let r = this.defaults.renderer || new y(this.defaults);
1400
+ for (let i in n.renderer) {
1401
+ if (!(i in r)) throw new Error(`renderer '${i}' does not exist`);
1402
+ if (["options", "parser"].includes(i)) continue;
1403
+ let o = i, u = n.renderer[o], a = r[o];
1404
+ r[o] = (...c) => {
1405
+ let p = u.apply(r, c);
1406
+ return p === !1 && (p = a.apply(r, c)), p || "";
1407
+ };
1408
+ }
1409
+ s.renderer = r;
1410
+ }
1411
+ if (n.tokenizer) {
1412
+ let r = this.defaults.tokenizer || new w(this.defaults);
1413
+ for (let i in n.tokenizer) {
1414
+ if (!(i in r)) throw new Error(`tokenizer '${i}' does not exist`);
1415
+ if ([
1416
+ "options",
1417
+ "rules",
1418
+ "lexer"
1419
+ ].includes(i)) continue;
1420
+ let o = i, u = n.tokenizer[o], a = r[o];
1421
+ r[o] = (...c) => {
1422
+ let p = u.apply(r, c);
1423
+ return p === !1 && (p = a.apply(r, c)), p;
1424
+ };
1425
+ }
1426
+ s.tokenizer = r;
1427
+ }
1428
+ if (n.hooks) {
1429
+ let r = this.defaults.hooks || new P();
1430
+ for (let i in n.hooks) {
1431
+ if (!(i in r)) throw new Error(`hook '${i}' does not exist`);
1432
+ if (["options", "block"].includes(i)) continue;
1433
+ let o = i, u = n.hooks[o], a = r[o];
1434
+ P.passThroughHooks.has(i) ? r[o] = (c) => {
1435
+ if (this.defaults.async && P.passThroughHooksRespectAsync.has(i)) return (async () => {
1436
+ let k = await u.call(r, c);
1437
+ return a.call(r, k);
1438
+ })();
1439
+ let p = u.call(r, c);
1440
+ return a.call(r, p);
1441
+ } : r[o] = (...c) => {
1442
+ if (this.defaults.async) return (async () => {
1443
+ let k = await u.apply(r, c);
1444
+ return k === !1 && (k = await a.apply(r, c)), k;
1445
+ })();
1446
+ let p = u.apply(r, c);
1447
+ return p === !1 && (p = a.apply(r, c)), p;
1448
+ };
1449
+ }
1450
+ s.hooks = r;
1451
+ }
1452
+ if (n.walkTokens) {
1453
+ let r = this.defaults.walkTokens, i = n.walkTokens;
1454
+ s.walkTokens = function(o) {
1455
+ let u = [];
1456
+ return u.push(i.call(this, o)), r && (u = u.concat(r.call(this, o))), u;
1457
+ };
1458
+ }
1459
+ this.defaults = {
1460
+ ...this.defaults,
1461
+ ...s
1462
+ };
1463
+ }), this;
1464
+ }
1465
+ setOptions(e) {
1466
+ return this.defaults = {
1467
+ ...this.defaults,
1468
+ ...e
1469
+ }, this;
1470
+ }
1471
+ lexer(e, t) {
1472
+ return x.lex(e, t ?? this.defaults);
1473
+ }
1474
+ parser(e, t) {
1475
+ return b.parse(e, t ?? this.defaults);
1476
+ }
1477
+ parseMarkdown(e) {
1478
+ return (n, s) => {
1479
+ let r = { ...s }, i = {
1480
+ ...this.defaults,
1481
+ ...r
1482
+ }, o = this.onError(!!i.silent, !!i.async);
1483
+ if (this.defaults.async === !0 && r.async === !1) return o(/* @__PURE__ */ new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
1484
+ if (typeof n > "u" || n === null) return o(/* @__PURE__ */ new Error("marked(): input parameter is undefined or null"));
1485
+ if (typeof n != "string") return o(/* @__PURE__ */ new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
1486
+ if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
1487
+ let u = i.hooks ? await i.hooks.preprocess(n) : n, c = await (i.hooks ? await i.hooks.provideLexer(e) : e ? x.lex : x.lexInline)(u, i), p = i.hooks ? await i.hooks.processAllTokens(c) : c;
1488
+ i.walkTokens && await Promise.all(this.walkTokens(p, i.walkTokens));
1489
+ let h = await (i.hooks ? await i.hooks.provideParser(e) : e ? b.parse : b.parseInline)(p, i);
1490
+ return i.hooks ? await i.hooks.postprocess(h) : h;
1491
+ })().catch(o);
1492
+ try {
1493
+ i.hooks && (n = i.hooks.preprocess(n));
1494
+ let a = (i.hooks ? i.hooks.provideLexer(e) : e ? x.lex : x.lexInline)(n, i);
1495
+ i.hooks && (a = i.hooks.processAllTokens(a)), i.walkTokens && this.walkTokens(a, i.walkTokens);
1496
+ let p = (i.hooks ? i.hooks.provideParser(e) : e ? b.parse : b.parseInline)(a, i);
1497
+ return i.hooks && (p = i.hooks.postprocess(p)), p;
1498
+ } catch (u) {
1499
+ return o(u);
1500
+ }
1501
+ };
1502
+ }
1503
+ onError(e, t) {
1504
+ return (n) => {
1505
+ if (n.message += `
1506
+ Please report this to https://github.com/markedjs/marked.`, e) {
1507
+ let s = "<p>An error occurred:</p><pre>" + O(n.message + "", !0) + "</pre>";
1508
+ return t ? Promise.resolve(s) : s;
1509
+ }
1510
+ if (t) return Promise.reject(n);
1511
+ throw n;
1512
+ };
1513
+ }
1514
+ };
1515
+ var z = new q();
1516
+ function g(l, e) {
1517
+ return z.parse(l, e);
1518
+ }
1519
+ g.options = g.setOptions = function(l) {
1520
+ return z.setOptions(l), g.defaults = z.defaults, N(g.defaults), g;
1521
+ };
1522
+ g.getDefaults = M;
1523
+ g.defaults = T;
1524
+ g.use = function(...l) {
1525
+ return z.use(...l), g.defaults = z.defaults, N(g.defaults), g;
1526
+ };
1527
+ g.walkTokens = function(l, e) {
1528
+ return z.walkTokens(l, e);
1529
+ };
1530
+ g.parseInline = z.parseInline;
1531
+ g.Parser = b;
1532
+ g.parser = b.parse;
1533
+ g.Renderer = y;
1534
+ g.TextRenderer = L;
1535
+ g.Lexer = x;
1536
+ g.lexer = x.lex;
1537
+ g.Tokenizer = w;
1538
+ g.Hooks = P;
1539
+ g.parse = g;
1540
+ g.options;
1541
+ g.setOptions;
1542
+ g.use;
1543
+ g.walkTokens;
1544
+ g.parseInline;
1545
+ b.parse;
1546
+ x.lex;
1547
+ //#endregion
1548
+ export { g as t };