@wirecat/wordpress-cli 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/LICENSE +204 -0
  3. package/README.md +248 -2
  4. package/contracts/wirecat.json +2535 -0
  5. package/dist/bin/wordpress.d.ts +3 -0
  6. package/dist/bin/wordpress.d.ts.map +1 -0
  7. package/dist/bin/wordpress.js +40 -0
  8. package/dist/bin/wordpress.js.map +1 -0
  9. package/dist/bundle/agent-LKBRYKNB.js +37 -0
  10. package/dist/bundle/all-profiles-OEV7VFQG.js +320 -0
  11. package/dist/bundle/anthropic-JKTZP2DW.js +91 -0
  12. package/dist/bundle/app-server-7LWLDDE2.js +249 -0
  13. package/dist/bundle/bun-2FLR4IV4.js +169 -0
  14. package/dist/bundle/bun-sqlite-GRSRX5P4.js +76 -0
  15. package/dist/bundle/chunk-2BI25SEE.js +259 -0
  16. package/dist/bundle/chunk-2UEGJ5AJ.js +52 -0
  17. package/dist/bundle/chunk-2XUV7HNE.js +58 -0
  18. package/dist/bundle/chunk-2Z7UOXFC.js +16 -0
  19. package/dist/bundle/chunk-3BM6KBWP.js +2788 -0
  20. package/dist/bundle/chunk-3BRAZVHR.js +1010 -0
  21. package/dist/bundle/chunk-3LMW7U7F.js +1233 -0
  22. package/dist/bundle/chunk-3LVTQFGB.js +2000 -0
  23. package/dist/bundle/chunk-3TKFFSFU.js +106 -0
  24. package/dist/bundle/chunk-3UX4VJWD.js +78 -0
  25. package/dist/bundle/chunk-4HEXAGKT.js +334 -0
  26. package/dist/bundle/chunk-4HP6KGBI.js +32 -0
  27. package/dist/bundle/chunk-4ZAQMDLD.js +1308 -0
  28. package/dist/bundle/chunk-4ZTB7LS3.js +87 -0
  29. package/dist/bundle/chunk-5XPHFV7H.js +2333 -0
  30. package/dist/bundle/chunk-5Z3P543G.js +80 -0
  31. package/dist/bundle/chunk-6UYDKCV6.js +794 -0
  32. package/dist/bundle/chunk-7GNB4LBX.js +50 -0
  33. package/dist/bundle/chunk-7HJFBOAT.js +161 -0
  34. package/dist/bundle/chunk-7JVKQ6NM.js +206 -0
  35. package/dist/bundle/chunk-7QH5BZUG.js +142 -0
  36. package/dist/bundle/chunk-A474OVIW.js +1392 -0
  37. package/dist/bundle/chunk-AENEMQL3.js +1068 -0
  38. package/dist/bundle/chunk-AL7I4DT4.js +65718 -0
  39. package/dist/bundle/chunk-ARGRGTPX.js +108 -0
  40. package/dist/bundle/chunk-AV2ZJ4WX.js +7 -0
  41. package/dist/bundle/chunk-BAXNAOOL.js +76 -0
  42. package/dist/bundle/chunk-BH63B66W.js +407 -0
  43. package/dist/bundle/chunk-CCOSG3F2.js +24616 -0
  44. package/dist/bundle/chunk-CFQQTDSA.js +46 -0
  45. package/dist/bundle/chunk-CGCUOT67.js +388 -0
  46. package/dist/bundle/chunk-CHPWBQUK.js +39 -0
  47. package/dist/bundle/chunk-D72URWJE.js +532 -0
  48. package/dist/bundle/chunk-DFDN6AUB.js +21 -0
  49. package/dist/bundle/chunk-DQSOYH6N.js +20 -0
  50. package/dist/bundle/chunk-ECYOTDJM.js +14 -0
  51. package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
  52. package/dist/bundle/chunk-EHW45LLT.js +100 -0
  53. package/dist/bundle/chunk-F3AV5ZSL.js +338 -0
  54. package/dist/bundle/chunk-F4BX7TH2.js +15 -0
  55. package/dist/bundle/chunk-F5ZAN7OC.js +6848 -0
  56. package/dist/bundle/chunk-FMMYBVCH.js +38 -0
  57. package/dist/bundle/chunk-FNB4SWTY.js +66 -0
  58. package/dist/bundle/chunk-FQROWBKV.js +12660 -0
  59. package/dist/bundle/chunk-FV2HJOSC.js +771 -0
  60. package/dist/bundle/chunk-GCAJW4SR.js +53 -0
  61. package/dist/bundle/chunk-GPRJXJC7.js +102 -0
  62. package/dist/bundle/chunk-HCOZUOSN.js +54 -0
  63. package/dist/bundle/chunk-HM6AMYHR.js +72 -0
  64. package/dist/bundle/chunk-HVXOA4FO.js +23 -0
  65. package/dist/bundle/chunk-HWQ7572G.js +95 -0
  66. package/dist/bundle/chunk-IJVTN5L3.js +82 -0
  67. package/dist/bundle/chunk-IZDDBOHU.js +3610 -0
  68. package/dist/bundle/chunk-JAE5B4G7.js +388 -0
  69. package/dist/bundle/chunk-K2Y5K37O.js +218 -0
  70. package/dist/bundle/chunk-KCH224US.js +9581 -0
  71. package/dist/bundle/chunk-KZJQPJK5.js +230 -0
  72. package/dist/bundle/chunk-L7P3LUDQ.js +286 -0
  73. package/dist/bundle/chunk-LECMHK2F.js +18 -0
  74. package/dist/bundle/chunk-LWEMZJLG.js +1332 -0
  75. package/dist/bundle/chunk-LWTETL2O.js +185 -0
  76. package/dist/bundle/chunk-MEYYH47C.js +25 -0
  77. package/dist/bundle/chunk-MJ6LTG4L.js +170 -0
  78. package/dist/bundle/chunk-NMQRSEZM.js +37 -0
  79. package/dist/bundle/chunk-ODVGFCBE.js +557 -0
  80. package/dist/bundle/chunk-OEQNP56V.js +633 -0
  81. package/dist/bundle/chunk-OV6WQY3L.js +39 -0
  82. package/dist/bundle/chunk-PL5P7UKW.js +25216 -0
  83. package/dist/bundle/chunk-PPNTY7LD.js +733 -0
  84. package/dist/bundle/chunk-PRZYRA66.js +358 -0
  85. package/dist/bundle/chunk-PV5UYGRJ.js +41594 -0
  86. package/dist/bundle/chunk-QYTOLPNI.js +52 -0
  87. package/dist/bundle/chunk-R7Y3XU66.js +362 -0
  88. package/dist/bundle/chunk-S4UUN6LD.js +1410 -0
  89. package/dist/bundle/chunk-SD5CXGIG.js +188 -0
  90. package/dist/bundle/chunk-SXY5G62I.js +288 -0
  91. package/dist/bundle/chunk-T37TAXVL.js +29 -0
  92. package/dist/bundle/chunk-T5SOY3AE.js +1197 -0
  93. package/dist/bundle/chunk-TJ7OORSO.js +1876 -0
  94. package/dist/bundle/chunk-TRYYWV7J.js +291 -0
  95. package/dist/bundle/chunk-U6VLNYCO.js +73 -0
  96. package/dist/bundle/chunk-UC7JLE6J.js +58 -0
  97. package/dist/bundle/chunk-UUIOAZPH.js +156 -0
  98. package/dist/bundle/chunk-UXQ24OY6.js +4072 -0
  99. package/dist/bundle/chunk-VBRRMGON.js +1007 -0
  100. package/dist/bundle/chunk-VRIBES2C.js +319 -0
  101. package/dist/bundle/chunk-XFLCVHSQ.js +50 -0
  102. package/dist/bundle/chunk-XT5XYQEZ.js +3414 -0
  103. package/dist/bundle/chunk-XTAS5Z3G.js +2231 -0
  104. package/dist/bundle/chunk-XYQVVW4R.js +24 -0
  105. package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
  106. package/dist/bundle/chunk-YHWFF6DN.js +39 -0
  107. package/dist/bundle/chunk-YUDVRFXN.js +63 -0
  108. package/dist/bundle/chunk-Z3I2MCUT.js +131 -0
  109. package/dist/bundle/chunk-ZDI3WC7V.js +353 -0
  110. package/dist/bundle/chunk-ZVQ7KFMT.js +274 -0
  111. package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
  112. package/dist/bundle/command-contract-P7YE4EKS.js +37 -0
  113. package/dist/bundle/command-server-entry-XIMCBWMV.js +166 -0
  114. package/dist/bundle/decode-6XK55WYV.js +297 -0
  115. package/dist/bundle/definitions-GIQCGYPR.js +7986 -0
  116. package/dist/bundle/dispatch-JQBAZWCL.js +411 -0
  117. package/dist/bundle/dist-2TV3NVE5.js +7577 -0
  118. package/dist/bundle/dist-PAKDDIBT.js +191 -0
  119. package/dist/bundle/echarts-YRRVLEX3.js +42501 -0
  120. package/dist/bundle/embed-L3EEQSGX.js +38 -0
  121. package/dist/bundle/embedder-BIKLBV3J.js +111 -0
  122. package/dist/bundle/failure-I6AAF5R5.js +25 -0
  123. package/dist/bundle/first-run-W6G6TYZ2.js +29 -0
  124. package/dist/bundle/first-screen-ITIAJIBU.js +37 -0
  125. package/dist/bundle/hast-util-from-html-ZHU6HGIE.js +10531 -0
  126. package/dist/bundle/hast-util-to-html-IIFHILP5.js +998 -0
  127. package/dist/bundle/hast-util-to-mdast-D62XX3NR.js +2272 -0
  128. package/dist/bundle/instructions-AG7SRWTR.js +11 -0
  129. package/dist/bundle/mcp-YGOAUNC3.js +167 -0
  130. package/dist/bundle/mdast-util-from-markdown-WVUJDSUO.js +1900 -0
  131. package/dist/bundle/mdast-util-gfm-KN2D32QS.js +1040 -0
  132. package/dist/bundle/mdast-util-to-hast-AYJV7KAE.js +879 -0
  133. package/dist/bundle/mdast-util-to-markdown-UCAJNHJO.js +18 -0
  134. package/dist/bundle/meeting-combined-CQJ3JHHU.js +24 -0
  135. package/dist/bundle/meeting-model-MZ7VVBNK.js +25 -0
  136. package/dist/bundle/meeting-semantic-DADWRRHP.js +22 -0
  137. package/dist/bundle/micromark-extension-gfm-EEJRRJ36.js +1771 -0
  138. package/dist/bundle/node-GJQYN4FT.js +176 -0
  139. package/dist/bundle/node-JJ3WDCNJ.js +2340 -0
  140. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  141. package/dist/bundle/node-sqlite-TPR62DT2.js +74 -0
  142. package/dist/bundle/oauth-WGY7JQVW.js +20 -0
  143. package/dist/bundle/open-DE7QZNAN.js +23 -0
  144. package/dist/bundle/openai-NHEFT3HS.js +238 -0
  145. package/dist/bundle/process-MEKCZMX3.js +91 -0
  146. package/dist/bundle/program-EP2S5BTM.js +38857 -0
  147. package/dist/bundle/prompt-PWY53BYH.js +17 -0
  148. package/dist/bundle/recognize-74TXHKMQ.js +26 -0
  149. package/dist/bundle/remote-F5TJZ5ER.js +31 -0
  150. package/dist/bundle/rerank-HWUO52UF.js +52 -0
  151. package/dist/bundle/schemas-4K6WWS5N.js +2157 -0
  152. package/dist/bundle/serve-I2USUY4X.js +199 -0
  153. package/dist/bundle/server-GDYDNO6K.js +79 -0
  154. package/dist/bundle/server-KYUW2AHB.js +212 -0
  155. package/dist/bundle/sqlite-runtime-N6VFGBJK.js +20 -0
  156. package/dist/bundle/state-L6JSCN77.js +36 -0
  157. package/dist/bundle/store-EPG2YPN3.js +291 -0
  158. package/dist/bundle/store-SQWQJE32.js +181 -0
  159. package/dist/bundle/store-maintenance-command-FTGSICVA.js +66 -0
  160. package/dist/bundle/surface-SNMHY6GP.js +65 -0
  161. package/dist/bundle/wordpress.js +183 -0
  162. package/dist/commands/api.d.ts +22 -0
  163. package/dist/commands/api.d.ts.map +1 -0
  164. package/dist/commands/api.js +37 -0
  165. package/dist/commands/api.js.map +1 -0
  166. package/dist/commands/content.d.ts +4 -0
  167. package/dist/commands/content.d.ts.map +1 -0
  168. package/dist/commands/content.js +94 -0
  169. package/dist/commands/content.js.map +1 -0
  170. package/dist/commands/session.d.ts +8 -0
  171. package/dist/commands/session.d.ts.map +1 -0
  172. package/dist/commands/session.js +28 -0
  173. package/dist/commands/session.js.map +1 -0
  174. package/dist/config.d.ts +13 -0
  175. package/dist/config.d.ts.map +1 -0
  176. package/dist/config.js +69 -0
  177. package/dist/config.js.map +1 -0
  178. package/dist/context.d.ts +37 -0
  179. package/dist/context.d.ts.map +1 -0
  180. package/dist/context.js +31 -0
  181. package/dist/context.js.map +1 -0
  182. package/dist/generated/definitions.d.ts +3 -0
  183. package/dist/generated/definitions.d.ts.map +1 -0
  184. package/dist/generated/definitions.js +7982 -0
  185. package/dist/generated/definitions.js.map +1 -0
  186. package/dist/generated/manifest.d.ts +6 -0
  187. package/dist/generated/manifest.d.ts.map +1 -0
  188. package/dist/generated/manifest.js +8830 -0
  189. package/dist/generated/manifest.js.map +1 -0
  190. package/dist/generated/schemas.d.ts +229 -0
  191. package/dist/generated/schemas.d.ts.map +1 -0
  192. package/dist/generated/schemas.js +2019 -0
  193. package/dist/generated/schemas.js.map +1 -0
  194. package/dist/generated/types.d.ts +3365 -0
  195. package/dist/generated/types.d.ts.map +1 -0
  196. package/dist/generated/types.js +5 -0
  197. package/dist/generated/types.js.map +1 -0
  198. package/dist/generated/wirecat-config.d.ts +11 -0
  199. package/dist/generated/wirecat-config.d.ts.map +1 -0
  200. package/dist/generated/wirecat-config.js +337 -0
  201. package/dist/generated/wirecat-config.js.map +1 -0
  202. package/dist/identity.d.ts +28 -0
  203. package/dist/identity.d.ts.map +1 -0
  204. package/dist/identity.js +29 -0
  205. package/dist/identity.js.map +1 -0
  206. package/dist/index.d.ts +3 -0
  207. package/dist/index.d.ts.map +1 -0
  208. package/dist/index.js +3 -0
  209. package/dist/index.js.map +1 -0
  210. package/dist/program.d.ts +6 -0
  211. package/dist/program.d.ts.map +1 -0
  212. package/dist/program.js +53 -0
  213. package/dist/program.js.map +1 -0
  214. package/dist/version.d.ts +2 -0
  215. package/dist/version.d.ts.map +1 -0
  216. package/dist/version.js +2 -0
  217. package/dist/version.js.map +1 -0
  218. package/dist/wcat.d.ts +3 -0
  219. package/dist/wcat.d.ts.map +1 -0
  220. package/dist/wcat.js +4 -0
  221. package/dist/wcat.js.map +1 -0
  222. package/package.json +87 -4
  223. package/skills/wordpress-cli/SKILL.md +88 -0
  224. package/skills/wordpress-cli/references/api/api-block-directory.md +17 -0
  225. package/skills/wordpress-cli/references/api/api-block-patterns.md +13 -0
  226. package/skills/wordpress-cli/references/api/api-block-types.md +34 -0
  227. package/skills/wordpress-cli/references/api/api-blocks.md +159 -0
  228. package/skills/wordpress-cli/references/api/api-categories.md +69 -0
  229. package/skills/wordpress-cli/references/api/api-comments.md +79 -0
  230. package/skills/wordpress-cli/references/api/api-font-collections.md +16 -0
  231. package/skills/wordpress-cli/references/api/api-font-families.md +122 -0
  232. package/skills/wordpress-cli/references/api/api-global-styles.md +29 -0
  233. package/skills/wordpress-cli/references/api/api-media.md +106 -0
  234. package/skills/wordpress-cli/references/api/api-menu-items.md +115 -0
  235. package/skills/wordpress-cli/references/api/api-menu-locations.md +22 -0
  236. package/skills/wordpress-cli/references/api/api-menus.md +69 -0
  237. package/skills/wordpress-cli/references/api/api-navigation.md +155 -0
  238. package/skills/wordpress-cli/references/api/api-pages.md +161 -0
  239. package/skills/wordpress-cli/references/api/api-pattern-directory.md +23 -0
  240. package/skills/wordpress-cli/references/api/api-plugins.md +25 -0
  241. package/skills/wordpress-cli/references/api/api-posts.md +166 -0
  242. package/skills/wordpress-cli/references/api/api-search.md +21 -0
  243. package/skills/wordpress-cli/references/api/api-settings.md +19 -0
  244. package/skills/wordpress-cli/references/api/api-sidebars.md +34 -0
  245. package/skills/wordpress-cli/references/api/api-statuses.md +22 -0
  246. package/skills/wordpress-cli/references/api/api-tags.md +69 -0
  247. package/skills/wordpress-cli/references/api/api-taxonomies.md +23 -0
  248. package/skills/wordpress-cli/references/api/api-template-parts.md +38 -0
  249. package/skills/wordpress-cli/references/api/api-templates.md +38 -0
  250. package/skills/wordpress-cli/references/api/api-themes.md +12 -0
  251. package/skills/wordpress-cli/references/api/api-types.md +22 -0
  252. package/skills/wordpress-cli/references/api/api-users.md +149 -0
  253. package/skills/wordpress-cli/references/api/api-widget-types.md +46 -0
  254. package/skills/wordpress-cli/references/api/api-widgets.md +57 -0
  255. package/skills/wordpress-cli/references/api/api-wp-pattern-category.md +69 -0
  256. package/skills/wordpress-cli/references/api.md +44 -0
@@ -0,0 +1,2272 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ esm_default,
5
+ position
6
+ } from "./chunk-L7P3LUDQ.js";
7
+ import {
8
+ whitespace
9
+ } from "./chunk-DQSOYH6N.js";
10
+ import {
11
+ phrasing
12
+ } from "./chunk-NMQRSEZM.js";
13
+ import {
14
+ toString
15
+ } from "./chunk-XFLCVHSQ.js";
16
+ import {
17
+ EXIT,
18
+ SKIP,
19
+ convert,
20
+ visit
21
+ } from "./chunk-TRYYWV7J.js";
22
+ import {
23
+ __name
24
+ } from "./chunk-ZVVMGPBJ.js";
25
+
26
+ // node_modules/.pnpm/hast-util-is-element@3.0.0/node_modules/hast-util-is-element/lib/index.js
27
+ var isElement = (
28
+ // Note: overloads in JSDoc can’t yet use different `@template`s.
29
+ /**
30
+ * @type {(
31
+ * (<Condition extends TestFunction>(element: unknown, test: Condition, index?: number | null | undefined, parent?: Parents | null | undefined, context?: unknown) => element is Element & Predicate<Condition, Element>) &
32
+ * (<Condition extends string>(element: unknown, test: Condition, index?: number | null | undefined, parent?: Parents | null | undefined, context?: unknown) => element is Element & {tagName: Condition}) &
33
+ * ((element?: null | undefined) => false) &
34
+ * ((element: unknown, test?: null | undefined, index?: number | null | undefined, parent?: Parents | null | undefined, context?: unknown) => element is Element) &
35
+ * ((element: unknown, test?: Test, index?: number | null | undefined, parent?: Parents | null | undefined, context?: unknown) => boolean)
36
+ * )}
37
+ */
38
+ /**
39
+ * @param {unknown} [element]
40
+ * @param {Test | undefined} [test]
41
+ * @param {number | null | undefined} [index]
42
+ * @param {Parents | null | undefined} [parent]
43
+ * @param {unknown} [context]
44
+ * @returns {boolean}
45
+ */
46
+ // eslint-disable-next-line max-params
47
+ /* @__PURE__ */ __name((function(element2, test, index, parent, context) {
48
+ const check = convertElement(test);
49
+ if (index !== null && index !== void 0 && (typeof index !== "number" || index < 0 || index === Number.POSITIVE_INFINITY)) {
50
+ throw new Error("Expected positive finite `index`");
51
+ }
52
+ if (parent !== null && parent !== void 0 && (!parent.type || !parent.children)) {
53
+ throw new Error("Expected valid `parent`");
54
+ }
55
+ if ((index === null || index === void 0) !== (parent === null || parent === void 0)) {
56
+ throw new Error("Expected both `index` and `parent`");
57
+ }
58
+ return looksLikeAnElement(element2) ? check.call(context, element2, index, parent) : false;
59
+ }), "isElement")
60
+ );
61
+ var convertElement = (
62
+ // Note: overloads in JSDoc can’t yet use different `@template`s.
63
+ /**
64
+ * @type {(
65
+ * (<Condition extends TestFunction>(test: Condition) => (element: unknown, index?: number | null | undefined, parent?: Parents | null | undefined, context?: unknown) => element is Element & Predicate<Condition, Element>) &
66
+ * (<Condition extends string>(test: Condition) => (element: unknown, index?: number | null | undefined, parent?: Parents | null | undefined, context?: unknown) => element is Element & {tagName: Condition}) &
67
+ * ((test?: null | undefined) => (element?: unknown, index?: number | null | undefined, parent?: Parents | null | undefined, context?: unknown) => element is Element) &
68
+ * ((test?: Test) => Check)
69
+ * )}
70
+ */
71
+ /**
72
+ * @param {Test | null | undefined} [test]
73
+ * @returns {Check}
74
+ */
75
+ /* @__PURE__ */ __name((function(test) {
76
+ if (test === null || test === void 0) {
77
+ return element;
78
+ }
79
+ if (typeof test === "string") {
80
+ return tagNameFactory(test);
81
+ }
82
+ if (typeof test === "object") {
83
+ return anyFactory(test);
84
+ }
85
+ if (typeof test === "function") {
86
+ return castFactory(test);
87
+ }
88
+ throw new Error("Expected function, string, or array as `test`");
89
+ }), "convertElement")
90
+ );
91
+ function anyFactory(tests) {
92
+ const checks = [];
93
+ let index = -1;
94
+ while (++index < tests.length) {
95
+ checks[index] = convertElement(tests[index]);
96
+ }
97
+ return castFactory(any);
98
+ function any(...parameters) {
99
+ let index2 = -1;
100
+ while (++index2 < checks.length) {
101
+ if (checks[index2].apply(this, parameters)) return true;
102
+ }
103
+ return false;
104
+ }
105
+ __name(any, "any");
106
+ }
107
+ __name(anyFactory, "anyFactory");
108
+ function tagNameFactory(check) {
109
+ return castFactory(tagName);
110
+ function tagName(element2) {
111
+ return element2.tagName === check;
112
+ }
113
+ __name(tagName, "tagName");
114
+ }
115
+ __name(tagNameFactory, "tagNameFactory");
116
+ function castFactory(testFunction) {
117
+ return check;
118
+ function check(value, index, parent) {
119
+ return Boolean(
120
+ looksLikeAnElement(value) && testFunction.call(
121
+ this,
122
+ value,
123
+ typeof index === "number" ? index : void 0,
124
+ parent || void 0
125
+ )
126
+ );
127
+ }
128
+ __name(check, "check");
129
+ }
130
+ __name(castFactory, "castFactory");
131
+ function element(element2) {
132
+ return Boolean(
133
+ element2 && typeof element2 === "object" && "type" in element2 && element2.type === "element" && "tagName" in element2 && typeof element2.tagName === "string"
134
+ );
135
+ }
136
+ __name(element, "element");
137
+ function looksLikeAnElement(value) {
138
+ return value !== null && typeof value === "object" && "type" in value && "tagName" in value;
139
+ }
140
+ __name(looksLikeAnElement, "looksLikeAnElement");
141
+
142
+ // node_modules/.pnpm/hast-util-embedded@3.0.0/node_modules/hast-util-embedded/lib/index.js
143
+ var embedded = convertElement(
144
+ /**
145
+ * @param element
146
+ * @returns {element is {tagName: 'audio' | 'canvas' | 'embed' | 'iframe' | 'img' | 'math' | 'object' | 'picture' | 'svg' | 'video'}}
147
+ */
148
+ function(element2) {
149
+ return element2.tagName === "audio" || element2.tagName === "canvas" || element2.tagName === "embed" || element2.tagName === "iframe" || element2.tagName === "img" || element2.tagName === "math" || element2.tagName === "object" || element2.tagName === "picture" || element2.tagName === "svg" || element2.tagName === "video";
150
+ }
151
+ );
152
+
153
+ // node_modules/.pnpm/hast-util-minify-whitespace@1.0.1/node_modules/hast-util-minify-whitespace/lib/block.js
154
+ var blocks = [
155
+ "address",
156
+ // Flow content.
157
+ "article",
158
+ // Sections and headings.
159
+ "aside",
160
+ // Sections and headings.
161
+ "blockquote",
162
+ // Flow content.
163
+ "body",
164
+ // Page.
165
+ "br",
166
+ // Contribute whitespace intrinsically.
167
+ "caption",
168
+ // Similar to block.
169
+ "center",
170
+ // Flow content, legacy.
171
+ "col",
172
+ // Similar to block.
173
+ "colgroup",
174
+ // Similar to block.
175
+ "dd",
176
+ // Lists.
177
+ "dialog",
178
+ // Flow content.
179
+ "dir",
180
+ // Lists, legacy.
181
+ "div",
182
+ // Flow content.
183
+ "dl",
184
+ // Lists.
185
+ "dt",
186
+ // Lists.
187
+ "figcaption",
188
+ // Flow content.
189
+ "figure",
190
+ // Flow content.
191
+ "footer",
192
+ // Flow content.
193
+ "form",
194
+ // Flow content.
195
+ "h1",
196
+ // Sections and headings.
197
+ "h2",
198
+ // Sections and headings.
199
+ "h3",
200
+ // Sections and headings.
201
+ "h4",
202
+ // Sections and headings.
203
+ "h5",
204
+ // Sections and headings.
205
+ "h6",
206
+ // Sections and headings.
207
+ "head",
208
+ // Page.
209
+ "header",
210
+ // Flow content.
211
+ "hgroup",
212
+ // Sections and headings.
213
+ "hr",
214
+ // Flow content.
215
+ "html",
216
+ // Page.
217
+ "legend",
218
+ // Flow content.
219
+ "li",
220
+ // Block-like.
221
+ "li",
222
+ // Similar to block.
223
+ "listing",
224
+ // Flow content, legacy
225
+ "main",
226
+ // Flow content.
227
+ "menu",
228
+ // Lists.
229
+ "nav",
230
+ // Sections and headings.
231
+ "ol",
232
+ // Lists.
233
+ "optgroup",
234
+ // Similar to block.
235
+ "option",
236
+ // Similar to block.
237
+ "p",
238
+ // Flow content.
239
+ "plaintext",
240
+ // Flow content, legacy
241
+ "pre",
242
+ // Flow content.
243
+ "section",
244
+ // Sections and headings.
245
+ "summary",
246
+ // Similar to block.
247
+ "table",
248
+ // Similar to block.
249
+ "tbody",
250
+ // Similar to block.
251
+ "td",
252
+ // Block-like.
253
+ "td",
254
+ // Similar to block.
255
+ "tfoot",
256
+ // Similar to block.
257
+ "th",
258
+ // Block-like.
259
+ "th",
260
+ // Similar to block.
261
+ "thead",
262
+ // Similar to block.
263
+ "tr",
264
+ // Similar to block.
265
+ "ul",
266
+ // Lists.
267
+ "wbr",
268
+ // Contribute whitespace intrinsically.
269
+ "xmp"
270
+ // Flow content, legacy
271
+ ];
272
+
273
+ // node_modules/.pnpm/hast-util-minify-whitespace@1.0.1/node_modules/hast-util-minify-whitespace/lib/content.js
274
+ var content = [
275
+ // Form.
276
+ "button",
277
+ "input",
278
+ "select",
279
+ "textarea"
280
+ ];
281
+
282
+ // node_modules/.pnpm/hast-util-minify-whitespace@1.0.1/node_modules/hast-util-minify-whitespace/lib/skippable.js
283
+ var skippable = [
284
+ "area",
285
+ "base",
286
+ "basefont",
287
+ "dialog",
288
+ "datalist",
289
+ "head",
290
+ "link",
291
+ "meta",
292
+ "noembed",
293
+ "noframes",
294
+ "param",
295
+ "rp",
296
+ "script",
297
+ "source",
298
+ "style",
299
+ "template",
300
+ "track",
301
+ "title"
302
+ ];
303
+
304
+ // node_modules/.pnpm/hast-util-minify-whitespace@1.0.1/node_modules/hast-util-minify-whitespace/lib/index.js
305
+ var emptyOptions = {};
306
+ var ignorableNode = convert(["comment", "doctype"]);
307
+ function minifyWhitespace(tree, options2) {
308
+ const settings = options2 || emptyOptions;
309
+ minify(tree, {
310
+ collapse: collapseFactory(
311
+ settings.newlines ? replaceNewlines : replaceWhitespace
312
+ ),
313
+ whitespace: "normal"
314
+ });
315
+ }
316
+ __name(minifyWhitespace, "minifyWhitespace");
317
+ function minify(node, state) {
318
+ if ("children" in node) {
319
+ const settings = { ...state };
320
+ if (node.type === "root" || blocklike(node)) {
321
+ settings.before = true;
322
+ settings.after = true;
323
+ }
324
+ settings.whitespace = inferWhiteSpace(node, state);
325
+ return all(node, settings);
326
+ }
327
+ if (node.type === "text") {
328
+ if (state.whitespace === "normal") {
329
+ return minifyText(node, state);
330
+ }
331
+ if (state.whitespace === "nowrap") {
332
+ node.value = state.collapse(node.value);
333
+ }
334
+ }
335
+ return { ignore: ignorableNode(node), stripAtStart: false, remove: false };
336
+ }
337
+ __name(minify, "minify");
338
+ function minifyText(node, state) {
339
+ const value = state.collapse(node.value);
340
+ const result = { ignore: false, stripAtStart: false, remove: false };
341
+ let start = 0;
342
+ let end = value.length;
343
+ if (state.before && removable(value.charAt(0))) {
344
+ start++;
345
+ }
346
+ if (start !== end && removable(value.charAt(end - 1))) {
347
+ if (state.after) {
348
+ end--;
349
+ } else {
350
+ result.stripAtStart = true;
351
+ }
352
+ }
353
+ if (start === end) {
354
+ result.remove = true;
355
+ } else {
356
+ node.value = value.slice(start, end);
357
+ }
358
+ return result;
359
+ }
360
+ __name(minifyText, "minifyText");
361
+ function all(parent, state) {
362
+ let before = state.before;
363
+ const after2 = state.after;
364
+ const children = parent.children;
365
+ let length = children.length;
366
+ let index = -1;
367
+ while (++index < length) {
368
+ const result = minify(children[index], {
369
+ ...state,
370
+ after: collapsableAfter(children, index, after2),
371
+ before
372
+ });
373
+ if (result.remove) {
374
+ children.splice(index, 1);
375
+ index--;
376
+ length--;
377
+ } else if (!result.ignore) {
378
+ before = result.stripAtStart;
379
+ }
380
+ if (content2(children[index])) {
381
+ before = false;
382
+ }
383
+ }
384
+ return { ignore: false, stripAtStart: Boolean(before || after2), remove: false };
385
+ }
386
+ __name(all, "all");
387
+ function collapsableAfter(nodes, index, after2) {
388
+ while (++index < nodes.length) {
389
+ const node = nodes[index];
390
+ let result = inferBoundary(node);
391
+ if (result === void 0 && "children" in node && !skippable2(node)) {
392
+ result = collapsableAfter(node.children, -1);
393
+ }
394
+ if (typeof result === "boolean") {
395
+ return result;
396
+ }
397
+ }
398
+ return after2;
399
+ }
400
+ __name(collapsableAfter, "collapsableAfter");
401
+ function inferBoundary(node) {
402
+ if (node.type === "element") {
403
+ if (content2(node)) {
404
+ return false;
405
+ }
406
+ if (blocklike(node)) {
407
+ return true;
408
+ }
409
+ } else if (node.type === "text") {
410
+ if (!whitespace(node)) {
411
+ return false;
412
+ }
413
+ } else if (!ignorableNode(node)) {
414
+ return false;
415
+ }
416
+ }
417
+ __name(inferBoundary, "inferBoundary");
418
+ function content2(node) {
419
+ return embedded(node) || isElement(node, content);
420
+ }
421
+ __name(content2, "content");
422
+ function blocklike(node) {
423
+ return isElement(node, blocks);
424
+ }
425
+ __name(blocklike, "blocklike");
426
+ function skippable2(node) {
427
+ return Boolean(node.type === "element" && node.properties.hidden) || ignorableNode(node) || isElement(node, skippable);
428
+ }
429
+ __name(skippable2, "skippable");
430
+ function removable(character) {
431
+ return character === " " || character === "\n";
432
+ }
433
+ __name(removable, "removable");
434
+ function replaceNewlines(value) {
435
+ const match = /\r?\n|\r/.exec(value);
436
+ return match ? match[0] : " ";
437
+ }
438
+ __name(replaceNewlines, "replaceNewlines");
439
+ function replaceWhitespace() {
440
+ return " ";
441
+ }
442
+ __name(replaceWhitespace, "replaceWhitespace");
443
+ function collapseFactory(replace) {
444
+ return collapse2;
445
+ function collapse2(value) {
446
+ return String(value).replace(/[\t\n\v\f\r ]+/g, replace);
447
+ }
448
+ __name(collapse2, "collapse");
449
+ }
450
+ __name(collapseFactory, "collapseFactory");
451
+ function inferWhiteSpace(node, state) {
452
+ if ("tagName" in node && node.properties) {
453
+ switch (node.tagName) {
454
+ // Whitespace in script/style, while not displayed by CSS as significant,
455
+ // could have some meaning in JS/CSS, so we can’t touch them.
456
+ case "listing":
457
+ case "plaintext":
458
+ case "script":
459
+ case "style":
460
+ case "xmp": {
461
+ return "pre";
462
+ }
463
+ case "nobr": {
464
+ return "nowrap";
465
+ }
466
+ case "pre": {
467
+ return node.properties.wrap ? "pre-wrap" : "pre";
468
+ }
469
+ case "td":
470
+ case "th": {
471
+ return node.properties.noWrap ? "nowrap" : state.whitespace;
472
+ }
473
+ case "textarea": {
474
+ return "pre-wrap";
475
+ }
476
+ default:
477
+ }
478
+ }
479
+ return state.whitespace;
480
+ }
481
+ __name(inferWhiteSpace, "inferWhiteSpace");
482
+
483
+ // node_modules/.pnpm/rehype-minify-whitespace@6.0.2/node_modules/rehype-minify-whitespace/lib/index.js
484
+ function rehypeMinifyWhitespace(options2) {
485
+ return function(tree) {
486
+ minifyWhitespace(tree, options2);
487
+ };
488
+ }
489
+ __name(rehypeMinifyWhitespace, "rehypeMinifyWhitespace");
490
+
491
+ // node_modules/.pnpm/collapse-white-space@2.1.0/node_modules/collapse-white-space/index.js
492
+ var js = /\s+/g;
493
+ var html = /[\t\n\v\f\r ]+/g;
494
+ function collapseWhiteSpace(value, options2) {
495
+ if (!options2) {
496
+ options2 = {};
497
+ } else if (typeof options2 === "string") {
498
+ options2 = { style: options2 };
499
+ }
500
+ const replace = options2.preserveLineEndings ? replaceLineEnding : replaceSpace;
501
+ return String(value).replace(
502
+ options2.style === "html" ? html : js,
503
+ options2.trim ? trimFactory(replace) : replace
504
+ );
505
+ }
506
+ __name(collapseWhiteSpace, "collapseWhiteSpace");
507
+ function replaceLineEnding(value) {
508
+ const match = /\r?\n|\r/.exec(value);
509
+ return match ? match[0] : " ";
510
+ }
511
+ __name(replaceLineEnding, "replaceLineEnding");
512
+ function replaceSpace() {
513
+ return " ";
514
+ }
515
+ __name(replaceSpace, "replaceSpace");
516
+ function trimFactory(replace) {
517
+ return dropOrReplace;
518
+ function dropOrReplace(value, index, all4) {
519
+ return index === 0 || index + value.length === all4.length ? "" : replace(value);
520
+ }
521
+ __name(dropOrReplace, "dropOrReplace");
522
+ }
523
+ __name(trimFactory, "trimFactory");
524
+
525
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/util/collapse.js
526
+ var options = { style: "html", trim: true };
527
+ function collapse(value) {
528
+ return collapseWhiteSpace(String(value || ""), options);
529
+ }
530
+ __name(collapse, "collapse");
531
+
532
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/a.js
533
+ function a(state, node) {
534
+ const properties = node.properties || {};
535
+ const children = (
536
+ /** @type {Array<PhrasingContent>} */
537
+ state.all(node)
538
+ );
539
+ const result = {
540
+ type: "link",
541
+ url: state.resolve(String(properties.href || "") || null),
542
+ title: collapse(properties.title) || null,
543
+ children
544
+ };
545
+ state.patch(node, result);
546
+ return result;
547
+ }
548
+ __name(a, "a");
549
+
550
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/base.js
551
+ function base(state, node) {
552
+ if (!state.baseFound) {
553
+ state.frozenBaseUrl = String(node.properties && node.properties.href || "") || void 0;
554
+ state.baseFound = true;
555
+ }
556
+ }
557
+ __name(base, "base");
558
+
559
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/blockquote.js
560
+ function blockquote(state, node) {
561
+ const result = { type: "blockquote", children: state.toFlow(state.all(node)) };
562
+ state.patch(node, result);
563
+ return result;
564
+ }
565
+ __name(blockquote, "blockquote");
566
+
567
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/br.js
568
+ function br(state, node) {
569
+ const result = { type: "break" };
570
+ state.patch(node, result);
571
+ return result;
572
+ }
573
+ __name(br, "br");
574
+
575
+ // node_modules/.pnpm/hast-util-to-text@4.0.3/node_modules/hast-util-to-text/lib/index.js
576
+ var searchLineFeeds = /\n/g;
577
+ var searchTabOrSpaces = /[\t ]+/g;
578
+ var whitespaceOnly = /^[\t\n\f\r ]+$/;
579
+ var tablePartNames = /* @__PURE__ */ new Set([
580
+ "caption",
581
+ "col",
582
+ "colgroup",
583
+ "tbody",
584
+ "td",
585
+ "tfoot",
586
+ "th",
587
+ "thead",
588
+ "tr"
589
+ ]);
590
+ var notRenderedNames = /* @__PURE__ */ new Set([
591
+ // List from: <https://html.spec.whatwg.org/multipage/rendering.html#hidden-elements>
592
+ "datalist",
593
+ "head",
594
+ "noembed",
595
+ "noframes",
596
+ "noscript",
597
+ // Act as if we support scripting.
598
+ "rp",
599
+ "script",
600
+ "style",
601
+ "template",
602
+ "title"
603
+ ]);
604
+ var blockOrCaptionNames = /* @__PURE__ */ new Set([
605
+ "address",
606
+ // Flow content
607
+ "article",
608
+ // Sections and headings
609
+ "aside",
610
+ // Sections and headings
611
+ "blockquote",
612
+ // Flow content
613
+ "body",
614
+ // Page
615
+ "caption",
616
+ // `table-caption`
617
+ "center",
618
+ // Flow content (legacy)
619
+ "dd",
620
+ // Lists
621
+ "dialog",
622
+ // Flow content
623
+ "dir",
624
+ // Lists (legacy)
625
+ "dl",
626
+ // Lists
627
+ "dt",
628
+ // Lists
629
+ "div",
630
+ // Flow content
631
+ "figure",
632
+ // Flow content
633
+ "figcaption",
634
+ // Flow content
635
+ "footer",
636
+ // Flow content
637
+ "form",
638
+ // Flow content
639
+ "h1",
640
+ // Sections and headings
641
+ "h2",
642
+ // Sections and headings
643
+ "h3",
644
+ // Sections and headings
645
+ "h4",
646
+ // Sections and headings
647
+ "h5",
648
+ // Sections and headings
649
+ "h6",
650
+ // Sections and headings
651
+ "header",
652
+ // Flow content
653
+ "hgroup",
654
+ // Sections and headings
655
+ "hr",
656
+ // Flow content
657
+ "html",
658
+ // Page
659
+ "legend",
660
+ // Flow content
661
+ "li",
662
+ // Lists (as `display: list-item`)
663
+ "listing",
664
+ // Flow content (legacy)
665
+ "main",
666
+ // Flow content
667
+ "menu",
668
+ // Lists
669
+ "nav",
670
+ // Sections and headings
671
+ "ol",
672
+ // Lists
673
+ "p",
674
+ // Flow content
675
+ "plaintext",
676
+ // Flow content (legacy)
677
+ "pre",
678
+ // Flow content
679
+ "section",
680
+ // Sections and headings
681
+ "ul",
682
+ // Lists
683
+ "xmp"
684
+ // Flow content (legacy)
685
+ ]);
686
+ function toText(tree, options2) {
687
+ const options_ = options2 || {};
688
+ const children = "children" in tree ? tree.children : [];
689
+ let block = false;
690
+ let inTable = false;
691
+ if (tree.type === "element") {
692
+ block = blockOrCaptionNames.has(tree.tagName);
693
+ inTable = tree.tagName === "table" || rowGroup(tree);
694
+ }
695
+ const whitespace2 = inferWhitespace(tree, {
696
+ breakAfter: false,
697
+ breakBefore: false,
698
+ whitespace: options_.whitespace || "normal"
699
+ });
700
+ const results = [];
701
+ if (tree.type === "text" || tree.type === "comment") {
702
+ append(
703
+ results,
704
+ collectText(tree, {
705
+ breakAfter: true,
706
+ breakBefore: true,
707
+ whitespace: whitespace2
708
+ })
709
+ );
710
+ }
711
+ let index = -1;
712
+ while (++index < children.length) {
713
+ const next = children[index + 1];
714
+ const breakAfter = next ? next.type === "element" && next.tagName === "br" : block;
715
+ const breakBefore = index ? void 0 : block;
716
+ append(
717
+ results,
718
+ renderedTextCollection(
719
+ children[index],
720
+ index,
721
+ /** @type {Parents} */
722
+ tree,
723
+ {
724
+ breakAfter,
725
+ breakBefore,
726
+ rowAfter: inTable ? inferRowAfter(tree, index, void 0) : void 0,
727
+ whitespace: whitespace2
728
+ }
729
+ )
730
+ );
731
+ }
732
+ const result = [];
733
+ let count;
734
+ index = -1;
735
+ while (++index < results.length) {
736
+ const value = results[index];
737
+ if (typeof value === "number") {
738
+ if (count !== void 0 && value > count) count = value;
739
+ } else if (value) {
740
+ if (count !== void 0 && count > -1) {
741
+ result.push("\n".repeat(count) || " ");
742
+ }
743
+ count = -1;
744
+ result.push(value);
745
+ }
746
+ }
747
+ return result.join("");
748
+ }
749
+ __name(toText, "toText");
750
+ function renderedTextCollection(node, index, parent, info) {
751
+ if (node.type === "element") {
752
+ return collectElement(node, index, parent, info);
753
+ }
754
+ if (node.type === "text") {
755
+ if (whitespaceOnly.test(node.value) && parent.type === "element" && (parent.tagName === "table" || parent.tagName === "tr" || rowGroup(parent))) {
756
+ const before = parent.children[index - 1];
757
+ const after2 = parent.children[index + 1];
758
+ if ((!before || before.type === "element" && tablePartNames.has(before.tagName)) && (!after2 || after2.type === "element" && tablePartNames.has(after2.tagName))) {
759
+ return [];
760
+ }
761
+ }
762
+ return info.whitespace === "normal" ? collectText(node, info) : collectPreText(node);
763
+ }
764
+ return [];
765
+ }
766
+ __name(renderedTextCollection, "renderedTextCollection");
767
+ function collectElement(node, position2, parent, info) {
768
+ const whitespace2 = inferWhitespace(node, info);
769
+ const children = node.children || [];
770
+ const inTable = node.tagName === "table" || rowGroup(node);
771
+ let index = -1;
772
+ const items = [];
773
+ if (notRenderedNames.has(node.tagName) || // Hidden attribute.
774
+ node.properties?.hidden || // From: <https://html.spec.whatwg.org/multipage/rendering.html#flow-content-3>
775
+ node.tagName === "dialog" && !node.properties?.open) {
776
+ return items;
777
+ }
778
+ let prefix2;
779
+ let suffix;
780
+ if (node.tagName === "br") {
781
+ suffix = "\n";
782
+ } else if (row(node) && (info.rowAfter || after(parent, position2, row))) {
783
+ suffix = "\n";
784
+ } else if (node.tagName === "p") {
785
+ prefix2 = 2;
786
+ suffix = 2;
787
+ } else if (blockOrCaptionNames.has(node.tagName)) {
788
+ prefix2 = 1;
789
+ suffix = 1;
790
+ }
791
+ while (++index < children.length) {
792
+ const next = children[index + 1];
793
+ const breakAfter = next ? next.type === "element" && next.tagName === "br" : suffix;
794
+ const breakBefore = index ? void 0 : prefix2;
795
+ append(
796
+ items,
797
+ renderedTextCollection(children[index], index, node, {
798
+ breakAfter,
799
+ breakBefore,
800
+ rowAfter: inTable ? inferRowAfter(node, index, info.rowAfter) : void 0,
801
+ whitespace: whitespace2
802
+ })
803
+ );
804
+ }
805
+ if (cell(node) && after(parent, position2, cell)) {
806
+ items.push(" ");
807
+ }
808
+ if (prefix2) items.unshift(prefix2);
809
+ if (suffix) items.push(suffix);
810
+ return items;
811
+ }
812
+ __name(collectElement, "collectElement");
813
+ function collectText(node, info) {
814
+ const value = String(node.value);
815
+ const lines = [];
816
+ const result = [];
817
+ let start = 0;
818
+ while (start <= value.length) {
819
+ searchLineFeeds.lastIndex = start;
820
+ const match = searchLineFeeds.exec(value);
821
+ const end = match && "index" in match ? match.index : value.length;
822
+ lines.push(
823
+ // Any sequence of collapsible spaces and tabs immediately preceding or
824
+ // following a segment break is removed.
825
+ trimAndCollapseSpacesAndTabs(
826
+ // […] ignoring bidi formatting characters (characters with the
827
+ // Bidi_Control property [UAX9]: ALM, LTR, RTL, LRE-RLO, LRI-PDI) as if
828
+ // they were not there.
829
+ value.slice(start, end).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g, ""),
830
+ start === 0 ? info.breakBefore : true,
831
+ end === value.length ? info.breakAfter : true
832
+ )
833
+ );
834
+ start = end + 1;
835
+ }
836
+ let index = -1;
837
+ let join;
838
+ while (++index < lines.length) {
839
+ if (lines[index].charCodeAt(lines[index].length - 1) === 8203 || index < lines.length - 1 && lines[index + 1].charCodeAt(0) === 8203) {
840
+ result.push(lines[index]);
841
+ join = void 0;
842
+ } else if (lines[index]) {
843
+ if (typeof join === "number") result.push(join);
844
+ result.push(lines[index]);
845
+ join = 0;
846
+ } else if (index === 0 || index === lines.length - 1) {
847
+ result.push(0);
848
+ }
849
+ }
850
+ return result;
851
+ }
852
+ __name(collectText, "collectText");
853
+ function collectPreText(node) {
854
+ return [String(node.value)];
855
+ }
856
+ __name(collectPreText, "collectPreText");
857
+ function trimAndCollapseSpacesAndTabs(value, breakBefore, breakAfter) {
858
+ const result = [];
859
+ let start = 0;
860
+ let end;
861
+ while (start < value.length) {
862
+ searchTabOrSpaces.lastIndex = start;
863
+ const match = searchTabOrSpaces.exec(value);
864
+ end = match ? match.index : value.length;
865
+ if (!start && !end && match && !breakBefore) {
866
+ result.push("");
867
+ }
868
+ if (start !== end) {
869
+ result.push(value.slice(start, end));
870
+ }
871
+ start = match ? end + match[0].length : end;
872
+ }
873
+ if (start !== end && !breakAfter) {
874
+ result.push("");
875
+ }
876
+ return result.join(" ");
877
+ }
878
+ __name(trimAndCollapseSpacesAndTabs, "trimAndCollapseSpacesAndTabs");
879
+ function inferWhitespace(node, info) {
880
+ if (node.type === "element") {
881
+ switch (node.tagName) {
882
+ case "listing":
883
+ case "plaintext":
884
+ case "xmp": {
885
+ return "pre";
886
+ }
887
+ case "nobr": {
888
+ return "nowrap";
889
+ }
890
+ case "pre": {
891
+ return node.properties?.wrap ? "pre-wrap" : "pre";
892
+ }
893
+ case "td":
894
+ case "th": {
895
+ return node.properties?.noWrap ? "nowrap" : info.whitespace;
896
+ }
897
+ case "textarea": {
898
+ return "pre-wrap";
899
+ }
900
+ default:
901
+ }
902
+ }
903
+ return info.whitespace;
904
+ }
905
+ __name(inferWhitespace, "inferWhitespace");
906
+ function inferRowAfter(parent, index, rowAfter) {
907
+ return parent.type === "element" && parent.tagName === "table" ? after(parent, index, rowOrRowGroupWithRow) : rowAfter;
908
+ }
909
+ __name(inferRowAfter, "inferRowAfter");
910
+ function after(parent, index, test) {
911
+ while (++index < parent.children.length) {
912
+ const child = parent.children[index];
913
+ if (child.type === "element" && test(child)) return true;
914
+ }
915
+ return false;
916
+ }
917
+ __name(after, "after");
918
+ function append(list3, items) {
919
+ let index = -1;
920
+ while (++index < items.length) {
921
+ list3.push(items[index]);
922
+ }
923
+ }
924
+ __name(append, "append");
925
+ function cell(node) {
926
+ return node.tagName === "td" || node.tagName === "th";
927
+ }
928
+ __name(cell, "cell");
929
+ function rowGroup(node) {
930
+ return node.tagName === "tbody" || node.tagName === "tfoot" || node.tagName === "thead";
931
+ }
932
+ __name(rowGroup, "rowGroup");
933
+ function rowOrRowGroupWithRow(node) {
934
+ if (row(node)) return true;
935
+ if (rowGroup(node)) {
936
+ let index = -1;
937
+ while (++index < node.children.length) {
938
+ const child = node.children[index];
939
+ if (child.type === "element" && row(child)) return true;
940
+ }
941
+ }
942
+ return false;
943
+ }
944
+ __name(rowOrRowGroupWithRow, "rowOrRowGroupWithRow");
945
+ function row(node) {
946
+ return node.tagName === "tr";
947
+ }
948
+ __name(row, "row");
949
+
950
+ // node_modules/.pnpm/trim-trailing-lines@2.1.0/node_modules/trim-trailing-lines/index.js
951
+ function trimTrailingLines(value) {
952
+ const input2 = String(value);
953
+ let end = input2.length;
954
+ while (end > 0) {
955
+ const code2 = input2.codePointAt(end - 1);
956
+ if (code2 !== void 0 && (code2 === 10 || code2 === 13)) {
957
+ end--;
958
+ } else {
959
+ break;
960
+ }
961
+ }
962
+ return input2.slice(0, end);
963
+ }
964
+ __name(trimTrailingLines, "trimTrailingLines");
965
+
966
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/code.js
967
+ var prefix = "language-";
968
+ function code(state, node) {
969
+ const { children } = node;
970
+ let index = -1;
971
+ let classList;
972
+ let lang;
973
+ if (node.tagName === "pre") {
974
+ while (++index < children.length) {
975
+ const child = children[index];
976
+ if (child.type === "element" && child.tagName === "code" && child.properties && child.properties.className && Array.isArray(child.properties.className)) {
977
+ classList = child.properties.className;
978
+ break;
979
+ }
980
+ }
981
+ }
982
+ if (classList) {
983
+ index = -1;
984
+ while (++index < classList.length) {
985
+ if (String(classList[index]).startsWith(prefix)) {
986
+ lang = String(classList[index]).slice(prefix.length);
987
+ break;
988
+ }
989
+ }
990
+ }
991
+ const result = {
992
+ type: "code",
993
+ lang: lang || null,
994
+ meta: null,
995
+ value: trimTrailingLines(toText(node))
996
+ };
997
+ state.patch(node, result);
998
+ return result;
999
+ }
1000
+ __name(code, "code");
1001
+
1002
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/comment.js
1003
+ function comment(state, node) {
1004
+ const result = {
1005
+ type: "html",
1006
+ value: "<!--" + node.value + "-->"
1007
+ };
1008
+ state.patch(node, result);
1009
+ return result;
1010
+ }
1011
+ __name(comment, "comment");
1012
+
1013
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/del.js
1014
+ function del(state, node) {
1015
+ const children = (
1016
+ /** @type {Array<PhrasingContent>} */
1017
+ state.all(node)
1018
+ );
1019
+ const result = { type: "delete", children };
1020
+ state.patch(node, result);
1021
+ return result;
1022
+ }
1023
+ __name(del, "del");
1024
+
1025
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/util/list-items-spread.js
1026
+ function listItemsSpread(children) {
1027
+ let index = -1;
1028
+ if (children.length > 1) {
1029
+ while (++index < children.length) {
1030
+ if (children[index].spread) {
1031
+ return true;
1032
+ }
1033
+ }
1034
+ }
1035
+ return false;
1036
+ }
1037
+ __name(listItemsSpread, "listItemsSpread");
1038
+
1039
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/dl.js
1040
+ function dl(state, node) {
1041
+ const clean = [];
1042
+ const groups = [];
1043
+ let index = -1;
1044
+ while (++index < node.children.length) {
1045
+ const child = node.children[index];
1046
+ if (child.type === "element" && child.tagName === "div") {
1047
+ clean.push(...child.children);
1048
+ } else {
1049
+ clean.push(child);
1050
+ }
1051
+ }
1052
+ let group = { definitions: [], titles: [] };
1053
+ index = -1;
1054
+ while (++index < clean.length) {
1055
+ const child = clean[index];
1056
+ if (child.type === "element" && child.tagName === "dt") {
1057
+ const previous = clean[index - 1];
1058
+ if (previous && previous.type === "element" && previous.tagName === "dd") {
1059
+ groups.push(group);
1060
+ group = { definitions: [], titles: [] };
1061
+ }
1062
+ group.titles.push(child);
1063
+ } else {
1064
+ group.definitions.push(child);
1065
+ }
1066
+ }
1067
+ groups.push(group);
1068
+ index = -1;
1069
+ const content3 = [];
1070
+ while (++index < groups.length) {
1071
+ const result = [
1072
+ ...handle(state, groups[index].titles),
1073
+ ...handle(state, groups[index].definitions)
1074
+ ];
1075
+ if (result.length > 0) {
1076
+ content3.push({
1077
+ type: "listItem",
1078
+ spread: result.length > 1,
1079
+ checked: null,
1080
+ children: result
1081
+ });
1082
+ }
1083
+ }
1084
+ if (content3.length > 0) {
1085
+ const result = {
1086
+ type: "list",
1087
+ ordered: false,
1088
+ start: null,
1089
+ spread: listItemsSpread(content3),
1090
+ children: content3
1091
+ };
1092
+ state.patch(node, result);
1093
+ return result;
1094
+ }
1095
+ }
1096
+ __name(dl, "dl");
1097
+ function handle(state, children) {
1098
+ const nodes = state.all({ type: "root", children });
1099
+ const listItems = state.toSpecificContent(nodes, create);
1100
+ if (listItems.length === 0) {
1101
+ return [];
1102
+ }
1103
+ if (listItems.length === 1) {
1104
+ return listItems[0].children;
1105
+ }
1106
+ return [
1107
+ {
1108
+ type: "list",
1109
+ ordered: false,
1110
+ start: null,
1111
+ spread: listItemsSpread(listItems),
1112
+ children: listItems
1113
+ }
1114
+ ];
1115
+ }
1116
+ __name(handle, "handle");
1117
+ function create() {
1118
+ return { type: "listItem", spread: false, checked: null, children: [] };
1119
+ }
1120
+ __name(create, "create");
1121
+
1122
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/em.js
1123
+ function em(state, node) {
1124
+ const children = (
1125
+ /** @type {Array<PhrasingContent>} */
1126
+ state.all(node)
1127
+ );
1128
+ const result = { type: "emphasis", children };
1129
+ state.patch(node, result);
1130
+ return result;
1131
+ }
1132
+ __name(em, "em");
1133
+
1134
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/util/drop-surrounding-breaks.js
1135
+ function dropSurroundingBreaks(nodes) {
1136
+ let start = 0;
1137
+ let end = nodes.length;
1138
+ while (start < end && nodes[start].type === "break") start++;
1139
+ while (end > start && nodes[end - 1].type === "break") end--;
1140
+ return start === 0 && end === nodes.length ? nodes : nodes.slice(start, end);
1141
+ }
1142
+ __name(dropSurroundingBreaks, "dropSurroundingBreaks");
1143
+
1144
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/heading.js
1145
+ function heading(state, node) {
1146
+ const depth = (
1147
+ /** @type {Heading['depth']} */
1148
+ /* c8 ignore next */
1149
+ Number(node.tagName.charAt(1)) || 1
1150
+ );
1151
+ const children = dropSurroundingBreaks(
1152
+ /** @type {Array<PhrasingContent>} */
1153
+ state.all(node)
1154
+ );
1155
+ const result = { type: "heading", depth, children };
1156
+ state.patch(node, result);
1157
+ return result;
1158
+ }
1159
+ __name(heading, "heading");
1160
+
1161
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/hr.js
1162
+ function hr(state, node) {
1163
+ const result = { type: "thematicBreak" };
1164
+ state.patch(node, result);
1165
+ return result;
1166
+ }
1167
+ __name(hr, "hr");
1168
+
1169
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/iframe.js
1170
+ function iframe(state, node) {
1171
+ const properties = node.properties || {};
1172
+ const source = String(properties.src || "");
1173
+ const title = collapse(properties.title);
1174
+ if (source && title) {
1175
+ const result = {
1176
+ type: "link",
1177
+ title: null,
1178
+ url: state.resolve(source),
1179
+ children: [{ type: "text", value: title }]
1180
+ };
1181
+ state.patch(node, result);
1182
+ return result;
1183
+ }
1184
+ }
1185
+ __name(iframe, "iframe");
1186
+
1187
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/img.js
1188
+ function img(state, node) {
1189
+ const properties = node.properties || {};
1190
+ const result = {
1191
+ type: "image",
1192
+ url: state.resolve(String(properties.src || "") || null),
1193
+ title: collapse(properties.title) || null,
1194
+ alt: collapse(properties.alt)
1195
+ };
1196
+ state.patch(node, result);
1197
+ return result;
1198
+ }
1199
+ __name(img, "img");
1200
+
1201
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/inline-code.js
1202
+ function inlineCode(state, node) {
1203
+ const result = { type: "inlineCode", value: toText(node) };
1204
+ state.patch(node, result);
1205
+ return result;
1206
+ }
1207
+ __name(inlineCode, "inlineCode");
1208
+
1209
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/util/find-selected-options.js
1210
+ function findSelectedOptions(node, multiple, size) {
1211
+ const options2 = findOptions(node);
1212
+ let list3 = [];
1213
+ const values = [];
1214
+ let index = -1;
1215
+ while (++index < options2.length) {
1216
+ const option = options2[index];
1217
+ if (option.properties && option.properties.selected) {
1218
+ list3.push(option);
1219
+ }
1220
+ }
1221
+ if (!multiple) {
1222
+ list3 = list3.slice(-1);
1223
+ if (list3.length === 0 && !(Number.parseInt(String(size), 10) > 1)) {
1224
+ list3 = options2.slice(0, 1);
1225
+ }
1226
+ }
1227
+ index = -1;
1228
+ while (++index < list3.length) {
1229
+ const option = list3[index];
1230
+ const properties = option.properties || {};
1231
+ const content3 = collapse(toText(option));
1232
+ const label = content3 || collapse(properties.label);
1233
+ const value = collapse(properties.value) || content3;
1234
+ values.push([value, label === value ? void 0 : label]);
1235
+ }
1236
+ return values;
1237
+ }
1238
+ __name(findSelectedOptions, "findSelectedOptions");
1239
+ function findOptions(node) {
1240
+ const results = [];
1241
+ let index = -1;
1242
+ while (++index < node.children.length) {
1243
+ const child = node.children[index];
1244
+ if ("children" in child && Array.isArray(child.children)) {
1245
+ results.push(...findOptions(child));
1246
+ }
1247
+ if (child.type === "element" && child.tagName === "option" && (!child.properties || !child.properties.disabled)) {
1248
+ results.push(child);
1249
+ }
1250
+ }
1251
+ return results;
1252
+ }
1253
+ __name(findOptions, "findOptions");
1254
+
1255
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/input.js
1256
+ var defaultChecked = "[x]";
1257
+ var defaultUnchecked = "[ ]";
1258
+ function input(state, node) {
1259
+ const properties = node.properties || {};
1260
+ if (properties.disabled || properties.type === "hidden" || properties.type === "file") {
1261
+ return;
1262
+ }
1263
+ if (properties.type === "checkbox" || properties.type === "radio") {
1264
+ const result2 = {
1265
+ type: "text",
1266
+ value: properties.checked ? state.options.checked || defaultChecked : state.options.unchecked || defaultUnchecked
1267
+ };
1268
+ state.patch(node, result2);
1269
+ return result2;
1270
+ }
1271
+ const value = collapse(properties.value || properties.placeholder);
1272
+ if (properties.type === "image") {
1273
+ const alt = collapse(properties.alt) || value;
1274
+ if (alt) {
1275
+ const result2 = {
1276
+ type: "image",
1277
+ url: state.resolve(String(properties.src || "") || null),
1278
+ title: collapse(properties.title) || null,
1279
+ alt
1280
+ };
1281
+ state.patch(node, result2);
1282
+ return result2;
1283
+ }
1284
+ return;
1285
+ }
1286
+ let values = [];
1287
+ if (value) {
1288
+ values = [[value, void 0]];
1289
+ } else if (
1290
+ // `list` is not supported on these types:
1291
+ properties.type !== "button" && properties.type !== "file" && properties.type !== "password" && properties.type !== "reset" && properties.type !== "submit" && properties.list
1292
+ ) {
1293
+ const list3 = String(properties.list);
1294
+ const datalist = state.elementById.get(list3);
1295
+ if (datalist && datalist.tagName === "datalist") {
1296
+ values = findSelectedOptions(datalist, properties.multiple);
1297
+ }
1298
+ }
1299
+ if (values.length === 0) {
1300
+ return;
1301
+ }
1302
+ if (properties.type === "password") {
1303
+ values[0] = ["\u2022".repeat(values[0][0].length), void 0];
1304
+ } else if (properties.type === "email" || properties.type === "url") {
1305
+ const results = [];
1306
+ let index2 = -1;
1307
+ while (++index2 < values.length) {
1308
+ const value2 = state.resolve(values[index2][0]);
1309
+ const result2 = {
1310
+ type: "link",
1311
+ title: null,
1312
+ url: properties.type === "email" ? "mailto:" + value2 : value2,
1313
+ children: [{ type: "text", value: values[index2][1] || value2 }]
1314
+ };
1315
+ results.push(result2);
1316
+ if (index2 !== values.length - 1) {
1317
+ results.push({ type: "text", value: ", " });
1318
+ }
1319
+ }
1320
+ return results;
1321
+ }
1322
+ const texts = [];
1323
+ let index = -1;
1324
+ while (++index < values.length) {
1325
+ texts.push(
1326
+ values[index][1] ? values[index][1] + " (" + values[index][0] + ")" : values[index][0]
1327
+ );
1328
+ }
1329
+ const result = { type: "text", value: texts.join(", ") };
1330
+ state.patch(node, result);
1331
+ return result;
1332
+ }
1333
+ __name(input, "input");
1334
+
1335
+ // node_modules/.pnpm/hast-util-has-property@3.0.0/node_modules/hast-util-has-property/lib/index.js
1336
+ var own = {}.hasOwnProperty;
1337
+ function hasProperty(node, name) {
1338
+ const value = node.type === "element" && own.call(node.properties, name) && node.properties[name];
1339
+ return value !== null && value !== void 0 && value !== false;
1340
+ }
1341
+ __name(hasProperty, "hasProperty");
1342
+
1343
+ // node_modules/.pnpm/hast-util-is-body-ok-link@3.0.1/node_modules/hast-util-is-body-ok-link/lib/index.js
1344
+ var list = /* @__PURE__ */ new Set(["pingback", "prefetch", "stylesheet"]);
1345
+ function isBodyOkLink(node) {
1346
+ if (node.type !== "element" || node.tagName !== "link") {
1347
+ return false;
1348
+ }
1349
+ if (node.properties.itemProp) {
1350
+ return true;
1351
+ }
1352
+ const value = node.properties.rel;
1353
+ let index = -1;
1354
+ if (!Array.isArray(value) || value.length === 0) {
1355
+ return false;
1356
+ }
1357
+ while (++index < value.length) {
1358
+ if (!list.has(String(value[index]))) {
1359
+ return false;
1360
+ }
1361
+ }
1362
+ return true;
1363
+ }
1364
+ __name(isBodyOkLink, "isBodyOkLink");
1365
+
1366
+ // node_modules/.pnpm/hast-util-phrasing@3.0.1/node_modules/hast-util-phrasing/lib/index.js
1367
+ var basic = convertElement([
1368
+ "a",
1369
+ "abbr",
1370
+ // `area` is in fact only phrasing if it is inside a `map` element.
1371
+ // However, since `area`s are required to be inside a `map` element, and it’s
1372
+ // a rather involved check, it’s ignored here for now.
1373
+ "area",
1374
+ "b",
1375
+ "bdi",
1376
+ "bdo",
1377
+ "br",
1378
+ "button",
1379
+ "cite",
1380
+ "code",
1381
+ "data",
1382
+ "datalist",
1383
+ "del",
1384
+ "dfn",
1385
+ "em",
1386
+ "i",
1387
+ "input",
1388
+ "ins",
1389
+ "kbd",
1390
+ "keygen",
1391
+ "label",
1392
+ "map",
1393
+ "mark",
1394
+ "meter",
1395
+ "noscript",
1396
+ "output",
1397
+ "progress",
1398
+ "q",
1399
+ "ruby",
1400
+ "s",
1401
+ "samp",
1402
+ "script",
1403
+ "select",
1404
+ "small",
1405
+ "span",
1406
+ "strong",
1407
+ "sub",
1408
+ "sup",
1409
+ "template",
1410
+ "textarea",
1411
+ "time",
1412
+ "u",
1413
+ "var",
1414
+ "wbr"
1415
+ ]);
1416
+ var meta = convertElement("meta");
1417
+ function phrasing2(value) {
1418
+ return Boolean(
1419
+ value.type === "text" || basic(value) || embedded(value) || isBodyOkLink(value) || meta(value) && hasProperty(value, "itemProp")
1420
+ );
1421
+ }
1422
+ __name(phrasing2, "phrasing");
1423
+
1424
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/li.js
1425
+ function li(state, node) {
1426
+ const { rest, checkbox } = extractLeadingCheckbox(node);
1427
+ const checked = checkbox ? Boolean(checkbox.properties.checked) : null;
1428
+ const spread = spreadout(rest);
1429
+ const children = state.toFlow(state.all(rest));
1430
+ const result = { type: "listItem", spread, checked, children };
1431
+ state.patch(node, result);
1432
+ return result;
1433
+ }
1434
+ __name(li, "li");
1435
+ function spreadout(node) {
1436
+ let index = -1;
1437
+ let seenFlow = false;
1438
+ while (++index < node.children.length) {
1439
+ const child = node.children[index];
1440
+ if (child.type === "element") {
1441
+ if (phrasing2(child)) continue;
1442
+ if (child.tagName === "p" || seenFlow || spreadout(child)) {
1443
+ return true;
1444
+ }
1445
+ seenFlow = true;
1446
+ }
1447
+ }
1448
+ return false;
1449
+ }
1450
+ __name(spreadout, "spreadout");
1451
+ function extractLeadingCheckbox(node) {
1452
+ const head = node.children[0];
1453
+ if (head && head.type === "element" && head.tagName === "input" && head.properties && (head.properties.type === "checkbox" || head.properties.type === "radio")) {
1454
+ const rest = { ...node, children: node.children.slice(1) };
1455
+ return { checkbox: head, rest };
1456
+ }
1457
+ if (head && head.type === "element" && head.tagName === "p") {
1458
+ const { checkbox, rest: restHead } = extractLeadingCheckbox(head);
1459
+ if (checkbox) {
1460
+ const rest = { ...node, children: [restHead, ...node.children.slice(1)] };
1461
+ return { checkbox, rest };
1462
+ }
1463
+ }
1464
+ return { checkbox: void 0, rest: node };
1465
+ }
1466
+ __name(extractLeadingCheckbox, "extractLeadingCheckbox");
1467
+
1468
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/list.js
1469
+ function list2(state, node) {
1470
+ const properties = node.properties || {};
1471
+ const ordered = node.tagName === "ol";
1472
+ const children = state.toSpecificContent(state.all(node), create2);
1473
+ let start = null;
1474
+ if (ordered) {
1475
+ start = Number.parseInt(String(properties.start), 10);
1476
+ if (Number.isNaN(start)) start = 1;
1477
+ }
1478
+ const result = {
1479
+ type: "list",
1480
+ ordered,
1481
+ start,
1482
+ spread: listItemsSpread(children),
1483
+ children
1484
+ };
1485
+ state.patch(node, result);
1486
+ return result;
1487
+ }
1488
+ __name(list2, "list");
1489
+ function create2() {
1490
+ return { type: "listItem", spread: false, checked: null, children: [] };
1491
+ }
1492
+ __name(create2, "create");
1493
+
1494
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/util/wrap.js
1495
+ function wrapNeeded(nodes) {
1496
+ let index = -1;
1497
+ while (++index < nodes.length) {
1498
+ const node = nodes[index];
1499
+ if (!phrasing3(node) || "children" in node && wrapNeeded(node.children)) {
1500
+ return true;
1501
+ }
1502
+ }
1503
+ return false;
1504
+ }
1505
+ __name(wrapNeeded, "wrapNeeded");
1506
+ function wrap(nodes) {
1507
+ return runs(nodes, onphrasing, function(d) {
1508
+ return d;
1509
+ });
1510
+ function onphrasing(nodes2) {
1511
+ return nodes2.every(function(d) {
1512
+ return d.type === "text" ? whitespace(d.value) : false;
1513
+ }) ? [] : [{ type: "paragraph", children: dropSurroundingBreaks(nodes2) }];
1514
+ }
1515
+ __name(onphrasing, "onphrasing");
1516
+ }
1517
+ __name(wrap, "wrap");
1518
+ function split(node) {
1519
+ return runs(node.children, onphrasing, onnonphrasing);
1520
+ function onphrasing(nodes) {
1521
+ const newParent = cloneWithoutChildren(node);
1522
+ newParent.children = nodes;
1523
+ return [newParent];
1524
+ }
1525
+ __name(onphrasing, "onphrasing");
1526
+ function onnonphrasing(child) {
1527
+ if ("children" in child && "children" in node) {
1528
+ const newParent = cloneWithoutChildren(node);
1529
+ const newChild = cloneWithoutChildren(child);
1530
+ newParent.children = child.children;
1531
+ newChild.children.push(newParent);
1532
+ return newChild;
1533
+ }
1534
+ return { ...child };
1535
+ }
1536
+ __name(onnonphrasing, "onnonphrasing");
1537
+ }
1538
+ __name(split, "split");
1539
+ function runs(nodes, onphrasing, onnonphrasing) {
1540
+ const flattened = flatten(nodes);
1541
+ const result = [];
1542
+ let queue = [];
1543
+ let index = -1;
1544
+ while (++index < flattened.length) {
1545
+ const node = flattened[index];
1546
+ if (phrasing3(node)) {
1547
+ queue.push(node);
1548
+ } else {
1549
+ if (queue.length > 0) {
1550
+ result.push(...onphrasing(queue));
1551
+ queue = [];
1552
+ }
1553
+ result.push(onnonphrasing(node));
1554
+ }
1555
+ }
1556
+ if (queue.length > 0) {
1557
+ result.push(...onphrasing(queue));
1558
+ queue = [];
1559
+ }
1560
+ return result;
1561
+ }
1562
+ __name(runs, "runs");
1563
+ function flatten(nodes) {
1564
+ const flattened = [];
1565
+ let index = -1;
1566
+ while (++index < nodes.length) {
1567
+ const node = nodes[index];
1568
+ if ((node.type === "delete" || node.type === "link") && wrapNeeded(node.children)) {
1569
+ flattened.push(...split(node));
1570
+ } else {
1571
+ flattened.push(node);
1572
+ }
1573
+ }
1574
+ return flattened;
1575
+ }
1576
+ __name(flatten, "flatten");
1577
+ function phrasing3(node) {
1578
+ const tagName = node.data && node.data.hName;
1579
+ return tagName ? phrasing2({ type: "element", tagName, properties: {}, children: [] }) : phrasing(node);
1580
+ }
1581
+ __name(phrasing3, "phrasing");
1582
+ function cloneWithoutChildren(node) {
1583
+ return esm_default({ ...node, children: [] });
1584
+ }
1585
+ __name(cloneWithoutChildren, "cloneWithoutChildren");
1586
+
1587
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/media.js
1588
+ function media(state, node) {
1589
+ const properties = node.properties || {};
1590
+ const poster = node.tagName === "video" ? String(properties.poster || "") : "";
1591
+ let source = String(properties.src || "");
1592
+ let index = -1;
1593
+ let linkInFallbackContent = false;
1594
+ let nodes = state.all(node);
1595
+ const fragment = { type: "root", children: nodes };
1596
+ visit(fragment, function(node2) {
1597
+ if (node2.type === "link") {
1598
+ linkInFallbackContent = true;
1599
+ return EXIT;
1600
+ }
1601
+ });
1602
+ if (linkInFallbackContent || wrapNeeded(nodes)) {
1603
+ return nodes;
1604
+ }
1605
+ while (!source && ++index < node.children.length) {
1606
+ const child = node.children[index];
1607
+ if (child.type === "element" && child.tagName === "source" && child.properties) {
1608
+ source = String(child.properties.src || "");
1609
+ }
1610
+ }
1611
+ if (poster) {
1612
+ const image = {
1613
+ type: "image",
1614
+ title: null,
1615
+ url: state.resolve(poster),
1616
+ alt: toString(nodes)
1617
+ };
1618
+ state.patch(node, image);
1619
+ nodes = [image];
1620
+ }
1621
+ const children = (
1622
+ /** @type {Array<PhrasingContent>} */
1623
+ nodes
1624
+ );
1625
+ const result = {
1626
+ type: "link",
1627
+ title: collapse(properties.title) || null,
1628
+ url: state.resolve(source),
1629
+ children
1630
+ };
1631
+ state.patch(node, result);
1632
+ return result;
1633
+ }
1634
+ __name(media, "media");
1635
+
1636
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/p.js
1637
+ function p(state, node) {
1638
+ const children = dropSurroundingBreaks(
1639
+ // Allow potentially “invalid” nodes, they might be unknown.
1640
+ // We also support straddling later.
1641
+ /** @type {Array<PhrasingContent>} */
1642
+ state.all(node)
1643
+ );
1644
+ if (children.length > 0) {
1645
+ const result = { type: "paragraph", children };
1646
+ state.patch(node, result);
1647
+ return result;
1648
+ }
1649
+ }
1650
+ __name(p, "p");
1651
+
1652
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/q.js
1653
+ var defaultQuotes = ['"'];
1654
+ function q(state, node) {
1655
+ const quotes = state.options.quotes || defaultQuotes;
1656
+ state.qNesting++;
1657
+ const contents = state.all(node);
1658
+ state.qNesting--;
1659
+ const quote = quotes[state.qNesting % quotes.length];
1660
+ const head = contents[0];
1661
+ const tail = contents[contents.length - 1];
1662
+ const open = quote.charAt(0);
1663
+ const close = quote.length > 1 ? quote.charAt(1) : quote;
1664
+ if (head && head.type === "text") {
1665
+ head.value = open + head.value;
1666
+ } else {
1667
+ contents.unshift({ type: "text", value: open });
1668
+ }
1669
+ if (tail && tail.type === "text") {
1670
+ tail.value += close;
1671
+ } else {
1672
+ contents.push({ type: "text", value: close });
1673
+ }
1674
+ return contents;
1675
+ }
1676
+ __name(q, "q");
1677
+
1678
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/root.js
1679
+ function root(state, node) {
1680
+ let children = state.all(node);
1681
+ if (state.options.document || wrapNeeded(children)) {
1682
+ children = wrap(children);
1683
+ }
1684
+ const result = { type: "root", children };
1685
+ state.patch(node, result);
1686
+ return result;
1687
+ }
1688
+ __name(root, "root");
1689
+
1690
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/select.js
1691
+ function select(state, node) {
1692
+ const properties = node.properties || {};
1693
+ const values = findSelectedOptions(node, properties.multiple, properties.size);
1694
+ let index = -1;
1695
+ const results = [];
1696
+ while (++index < values.length) {
1697
+ const value = values[index];
1698
+ results.push(value[1] ? value[1] + " (" + value[0] + ")" : value[0]);
1699
+ }
1700
+ if (results.length > 0) {
1701
+ const result = { type: "text", value: results.join(", ") };
1702
+ state.patch(node, result);
1703
+ return result;
1704
+ }
1705
+ }
1706
+ __name(select, "select");
1707
+
1708
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/strong.js
1709
+ function strong(state, node) {
1710
+ const children = (
1711
+ /** @type {Array<PhrasingContent>} */
1712
+ state.all(node)
1713
+ );
1714
+ const result = { type: "strong", children };
1715
+ state.patch(node, result);
1716
+ return result;
1717
+ }
1718
+ __name(strong, "strong");
1719
+
1720
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/table-cell.js
1721
+ function tableCell(state, node) {
1722
+ const children = (
1723
+ /** @type {Array<PhrasingContent>} */
1724
+ state.all(node)
1725
+ );
1726
+ const result = { type: "tableCell", children };
1727
+ state.patch(node, result);
1728
+ if (node.properties) {
1729
+ const { rowSpan, colSpan } = node.properties;
1730
+ if (rowSpan || colSpan) {
1731
+ const data = (
1732
+ /** @type {Record<string, unknown>} */
1733
+ result.data || (result.data = {})
1734
+ );
1735
+ if (rowSpan) data.hastUtilToMdastTemporaryRowSpan = rowSpan;
1736
+ if (colSpan) data.hastUtilToMdastTemporaryColSpan = colSpan;
1737
+ }
1738
+ }
1739
+ return result;
1740
+ }
1741
+ __name(tableCell, "tableCell");
1742
+
1743
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/table-row.js
1744
+ function tableRow(state, node) {
1745
+ const children = state.toSpecificContent(state.all(node), create3);
1746
+ const result = { type: "tableRow", children };
1747
+ state.patch(node, result);
1748
+ return result;
1749
+ }
1750
+ __name(tableRow, "tableRow");
1751
+ function create3() {
1752
+ return { type: "tableCell", children: [] };
1753
+ }
1754
+ __name(create3, "create");
1755
+
1756
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/table.js
1757
+ function table(state, node) {
1758
+ if (state.inTable) {
1759
+ const result2 = { type: "text", value: toText(node) };
1760
+ state.patch(node, result2);
1761
+ return result2;
1762
+ }
1763
+ state.inTable = true;
1764
+ const { align, headless } = inspect(node);
1765
+ const rows = state.toSpecificContent(state.all(node), createRow);
1766
+ if (headless) {
1767
+ rows.unshift(createRow());
1768
+ }
1769
+ let rowIndex = -1;
1770
+ while (++rowIndex < rows.length) {
1771
+ const row2 = rows[rowIndex];
1772
+ const cells = state.toSpecificContent(row2.children, createCell);
1773
+ row2.children = cells;
1774
+ }
1775
+ let columns = 1;
1776
+ rowIndex = -1;
1777
+ while (++rowIndex < rows.length) {
1778
+ const cells = rows[rowIndex].children;
1779
+ let cellIndex = -1;
1780
+ while (++cellIndex < cells.length) {
1781
+ const cell2 = cells[cellIndex];
1782
+ if (cell2.data) {
1783
+ const fields = (
1784
+ /** @type {Record<string, unknown>} */
1785
+ cell2.data
1786
+ );
1787
+ const colSpan = Number.parseInt(String(fields.hastUtilToMdastTemporaryColSpan), 10) || 1;
1788
+ const rowSpan = Number.parseInt(String(fields.hastUtilToMdastTemporaryRowSpan), 10) || 1;
1789
+ if (colSpan > 1 || rowSpan > 1) {
1790
+ const rowEnd = Math.min(rowIndex + rowSpan, rows.length);
1791
+ let otherRowIndex = rowIndex - 1;
1792
+ while (++otherRowIndex < rowEnd) {
1793
+ let colIndex = cellIndex - 1;
1794
+ while (++colIndex < cellIndex + colSpan) {
1795
+ const newCells = [];
1796
+ if (otherRowIndex !== rowIndex || colIndex !== cellIndex) {
1797
+ newCells.push({ type: "tableCell", children: [] });
1798
+ }
1799
+ rows[otherRowIndex].children.splice(colIndex, 0, ...newCells);
1800
+ }
1801
+ }
1802
+ }
1803
+ if ("hastUtilToMdastTemporaryColSpan" in cell2.data)
1804
+ delete cell2.data.hastUtilToMdastTemporaryColSpan;
1805
+ if ("hastUtilToMdastTemporaryRowSpan" in cell2.data)
1806
+ delete cell2.data.hastUtilToMdastTemporaryRowSpan;
1807
+ if (Object.keys(cell2.data).length === 0) delete cell2.data;
1808
+ }
1809
+ }
1810
+ if (cells.length > columns) columns = cells.length;
1811
+ }
1812
+ rowIndex = -1;
1813
+ while (++rowIndex < rows.length) {
1814
+ const cells = rows[rowIndex].children;
1815
+ let cellIndex = cells.length - 1;
1816
+ while (++cellIndex < columns) {
1817
+ cells.push({ type: "tableCell", children: [] });
1818
+ }
1819
+ }
1820
+ let alignIndex = align.length - 1;
1821
+ while (++alignIndex < columns) {
1822
+ align.push(null);
1823
+ }
1824
+ state.inTable = false;
1825
+ const result = { type: "table", align, children: rows };
1826
+ state.patch(node, result);
1827
+ return result;
1828
+ }
1829
+ __name(table, "table");
1830
+ function inspect(node) {
1831
+ const info = { align: [null], headless: true };
1832
+ let rowIndex = 0;
1833
+ let cellIndex = 0;
1834
+ visit(node, function(child) {
1835
+ if (child.type === "element") {
1836
+ if (child.tagName === "table" && node !== child) {
1837
+ return SKIP;
1838
+ }
1839
+ if ((child.tagName === "th" || child.tagName === "td") && child.properties) {
1840
+ if (!info.align[cellIndex]) {
1841
+ const value = String(child.properties.align || "") || null;
1842
+ if (value === "center" || value === "left" || value === "right" || value === null) {
1843
+ info.align[cellIndex] = value;
1844
+ }
1845
+ }
1846
+ if (info.headless && rowIndex < 2 && child.tagName === "th") {
1847
+ info.headless = false;
1848
+ }
1849
+ cellIndex++;
1850
+ } else if (child.tagName === "thead") {
1851
+ info.headless = false;
1852
+ } else if (child.tagName === "tr") {
1853
+ rowIndex++;
1854
+ cellIndex = 0;
1855
+ }
1856
+ }
1857
+ });
1858
+ return info;
1859
+ }
1860
+ __name(inspect, "inspect");
1861
+ function createCell() {
1862
+ return { type: "tableCell", children: [] };
1863
+ }
1864
+ __name(createCell, "createCell");
1865
+ function createRow() {
1866
+ return { type: "tableRow", children: [] };
1867
+ }
1868
+ __name(createRow, "createRow");
1869
+
1870
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/text.js
1871
+ function text(state, node) {
1872
+ const result = { type: "text", value: node.value };
1873
+ state.patch(node, result);
1874
+ return result;
1875
+ }
1876
+ __name(text, "text");
1877
+
1878
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/textarea.js
1879
+ function textarea(state, node) {
1880
+ const value = toText(node);
1881
+ const results = [];
1882
+ let blank = false;
1883
+ let start = 0;
1884
+ let cr = value.indexOf("\r");
1885
+ let lf = value.indexOf("\n");
1886
+ while (start <= value.length) {
1887
+ if (cr !== -1 && cr < start) cr = value.indexOf("\r", start);
1888
+ if (lf !== -1 && lf < start) lf = value.indexOf("\n", start);
1889
+ const end = Math.min(
1890
+ cr === -1 ? value.length : cr,
1891
+ lf === -1 ? value.length : lf
1892
+ );
1893
+ const line = collapse(value.slice(start, end));
1894
+ if (line) {
1895
+ if (results.length > 0) {
1896
+ results.push({ type: "break" });
1897
+ if (blank) results.push({ type: "break" });
1898
+ }
1899
+ results.push({ type: "text", value: line });
1900
+ blank = false;
1901
+ } else {
1902
+ blank = true;
1903
+ }
1904
+ start = end + (end === cr && lf === cr + 1 ? 2 : 1);
1905
+ }
1906
+ return results;
1907
+ }
1908
+ __name(textarea, "textarea");
1909
+
1910
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/wbr.js
1911
+ function wbr(state, node) {
1912
+ const result = { type: "text", value: "\u200B" };
1913
+ state.patch(node, result);
1914
+ return result;
1915
+ }
1916
+ __name(wbr, "wbr");
1917
+
1918
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/handlers/index.js
1919
+ var nodeHandlers = {
1920
+ comment,
1921
+ doctype: ignore,
1922
+ root,
1923
+ text
1924
+ };
1925
+ var handlers = {
1926
+ // Ignore:
1927
+ applet: ignore,
1928
+ area: ignore,
1929
+ basefont: ignore,
1930
+ bgsound: ignore,
1931
+ caption: ignore,
1932
+ col: ignore,
1933
+ colgroup: ignore,
1934
+ command: ignore,
1935
+ content: ignore,
1936
+ datalist: ignore,
1937
+ dialog: ignore,
1938
+ element: ignore,
1939
+ embed: ignore,
1940
+ frame: ignore,
1941
+ frameset: ignore,
1942
+ isindex: ignore,
1943
+ keygen: ignore,
1944
+ link: ignore,
1945
+ math: ignore,
1946
+ menu: ignore,
1947
+ menuitem: ignore,
1948
+ meta: ignore,
1949
+ nextid: ignore,
1950
+ noembed: ignore,
1951
+ noframes: ignore,
1952
+ optgroup: ignore,
1953
+ option: ignore,
1954
+ param: ignore,
1955
+ script: ignore,
1956
+ shadow: ignore,
1957
+ source: ignore,
1958
+ spacer: ignore,
1959
+ style: ignore,
1960
+ svg: ignore,
1961
+ template: ignore,
1962
+ title: ignore,
1963
+ track: ignore,
1964
+ // Use children:
1965
+ abbr: all2,
1966
+ acronym: all2,
1967
+ bdi: all2,
1968
+ bdo: all2,
1969
+ big: all2,
1970
+ blink: all2,
1971
+ button: all2,
1972
+ canvas: all2,
1973
+ cite: all2,
1974
+ data: all2,
1975
+ details: all2,
1976
+ dfn: all2,
1977
+ font: all2,
1978
+ ins: all2,
1979
+ label: all2,
1980
+ map: all2,
1981
+ marquee: all2,
1982
+ meter: all2,
1983
+ nobr: all2,
1984
+ noscript: all2,
1985
+ object: all2,
1986
+ output: all2,
1987
+ progress: all2,
1988
+ rb: all2,
1989
+ rbc: all2,
1990
+ rp: all2,
1991
+ rt: all2,
1992
+ rtc: all2,
1993
+ ruby: all2,
1994
+ slot: all2,
1995
+ small: all2,
1996
+ span: all2,
1997
+ sup: all2,
1998
+ sub: all2,
1999
+ tbody: all2,
2000
+ tfoot: all2,
2001
+ thead: all2,
2002
+ time: all2,
2003
+ // Use children as flow.
2004
+ address: flow,
2005
+ article: flow,
2006
+ aside: flow,
2007
+ body: flow,
2008
+ center: flow,
2009
+ div: flow,
2010
+ fieldset: flow,
2011
+ figcaption: flow,
2012
+ figure: flow,
2013
+ form: flow,
2014
+ footer: flow,
2015
+ header: flow,
2016
+ hgroup: flow,
2017
+ html: flow,
2018
+ legend: flow,
2019
+ main: flow,
2020
+ multicol: flow,
2021
+ nav: flow,
2022
+ picture: flow,
2023
+ section: flow,
2024
+ // Handle.
2025
+ a,
2026
+ audio: media,
2027
+ b: strong,
2028
+ base,
2029
+ blockquote,
2030
+ br,
2031
+ code: inlineCode,
2032
+ dir: list2,
2033
+ dl,
2034
+ dt: li,
2035
+ dd: li,
2036
+ del,
2037
+ em,
2038
+ h1: heading,
2039
+ h2: heading,
2040
+ h3: heading,
2041
+ h4: heading,
2042
+ h5: heading,
2043
+ h6: heading,
2044
+ hr,
2045
+ i: em,
2046
+ iframe,
2047
+ img,
2048
+ image: img,
2049
+ input,
2050
+ kbd: inlineCode,
2051
+ li,
2052
+ listing: code,
2053
+ mark: em,
2054
+ ol: list2,
2055
+ p,
2056
+ plaintext: code,
2057
+ pre: code,
2058
+ q,
2059
+ s: del,
2060
+ samp: inlineCode,
2061
+ select,
2062
+ strike: del,
2063
+ strong,
2064
+ summary: p,
2065
+ table,
2066
+ td: tableCell,
2067
+ textarea,
2068
+ th: tableCell,
2069
+ tr: tableRow,
2070
+ tt: inlineCode,
2071
+ u: em,
2072
+ ul: list2,
2073
+ var: inlineCode,
2074
+ video: media,
2075
+ wbr,
2076
+ xmp: code
2077
+ };
2078
+ function all2(state, node) {
2079
+ return state.all(node);
2080
+ }
2081
+ __name(all2, "all");
2082
+ function flow(state, node) {
2083
+ return state.toFlow(state.all(node));
2084
+ }
2085
+ __name(flow, "flow");
2086
+ function ignore() {
2087
+ }
2088
+ __name(ignore, "ignore");
2089
+
2090
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/state.js
2091
+ var own2 = {}.hasOwnProperty;
2092
+ function createState(options2) {
2093
+ return {
2094
+ all: all3,
2095
+ baseFound: false,
2096
+ elementById: /* @__PURE__ */ new Map(),
2097
+ frozenBaseUrl: void 0,
2098
+ handlers: { ...handlers, ...options2.handlers },
2099
+ inTable: false,
2100
+ nodeHandlers: { ...nodeHandlers, ...options2.nodeHandlers },
2101
+ one,
2102
+ options: options2,
2103
+ patch,
2104
+ qNesting: 0,
2105
+ resolve,
2106
+ toFlow,
2107
+ toSpecificContent
2108
+ };
2109
+ }
2110
+ __name(createState, "createState");
2111
+ function all3(parent) {
2112
+ const children = parent.children || [];
2113
+ const results = [];
2114
+ let index = -1;
2115
+ while (++index < children.length) {
2116
+ const child = children[index];
2117
+ const result = (
2118
+ /** @type {Array<MdastRootContent> | MdastRootContent | undefined} */
2119
+ this.one(child, parent)
2120
+ );
2121
+ if (Array.isArray(result)) {
2122
+ results.push(...result);
2123
+ } else if (result) {
2124
+ results.push(result);
2125
+ }
2126
+ }
2127
+ return results;
2128
+ }
2129
+ __name(all3, "all");
2130
+ function one(node, parent) {
2131
+ if (node.type === "element") {
2132
+ if (node.properties && node.properties.dataMdast === "ignore") {
2133
+ return;
2134
+ }
2135
+ if (own2.call(this.handlers, node.tagName)) {
2136
+ return this.handlers[node.tagName](this, node, parent) || void 0;
2137
+ }
2138
+ } else if (own2.call(this.nodeHandlers, node.type)) {
2139
+ return this.nodeHandlers[node.type](this, node, parent) || void 0;
2140
+ }
2141
+ if ("value" in node && typeof node.value === "string") {
2142
+ const result = { type: "text", value: node.value };
2143
+ this.patch(node, result);
2144
+ return result;
2145
+ }
2146
+ if ("children" in node) {
2147
+ return this.all(node);
2148
+ }
2149
+ }
2150
+ __name(one, "one");
2151
+ function patch(origin, node) {
2152
+ if (origin.position) node.position = position(origin);
2153
+ }
2154
+ __name(patch, "patch");
2155
+ function resolve(url) {
2156
+ if (url === null || url === void 0) {
2157
+ return "";
2158
+ }
2159
+ const base2 = this.frozenBaseUrl;
2160
+ if (base2) {
2161
+ return new URL(url, base2).href;
2162
+ }
2163
+ return url;
2164
+ }
2165
+ __name(resolve, "resolve");
2166
+ function toFlow(nodes) {
2167
+ return wrap(nodes);
2168
+ }
2169
+ __name(toFlow, "toFlow");
2170
+ function toSpecificContent(nodes, build) {
2171
+ const reference = build();
2172
+ const results = [];
2173
+ let queue = [];
2174
+ let index = -1;
2175
+ while (++index < nodes.length) {
2176
+ const node = nodes[index];
2177
+ if (expectedParent(node)) {
2178
+ if (queue.length > 0) {
2179
+ node.children.unshift(...queue);
2180
+ queue = [];
2181
+ }
2182
+ results.push(node);
2183
+ } else {
2184
+ const child = (
2185
+ /** @type {ChildType} */
2186
+ node
2187
+ );
2188
+ queue.push(child);
2189
+ }
2190
+ }
2191
+ if (queue.length > 0) {
2192
+ let node = results[results.length - 1];
2193
+ if (!node) {
2194
+ node = build();
2195
+ results.push(node);
2196
+ }
2197
+ node.children.push(...queue);
2198
+ queue = [];
2199
+ }
2200
+ return results;
2201
+ function expectedParent(node) {
2202
+ return node.type === reference.type;
2203
+ }
2204
+ __name(expectedParent, "expectedParent");
2205
+ }
2206
+ __name(toSpecificContent, "toSpecificContent");
2207
+
2208
+ // node_modules/.pnpm/hast-util-to-mdast@10.1.3/node_modules/hast-util-to-mdast/lib/index.js
2209
+ var emptyOptions2 = {};
2210
+ function toMdast(tree, options2) {
2211
+ const cleanTree = esm_default(tree);
2212
+ const settings = options2 || emptyOptions2;
2213
+ const transformWhitespace = rehypeMinifyWhitespace({
2214
+ newlines: settings.newlines === true
2215
+ });
2216
+ const state = createState(settings);
2217
+ let mdast;
2218
+ transformWhitespace(cleanTree);
2219
+ visit(cleanTree, function(node) {
2220
+ if (node && node.type === "element" && node.properties) {
2221
+ const id = String(node.properties.id || "") || void 0;
2222
+ if (id && !state.elementById.has(id)) {
2223
+ state.elementById.set(id, node);
2224
+ }
2225
+ }
2226
+ });
2227
+ const result = state.one(cleanTree, void 0);
2228
+ if (!result) {
2229
+ mdast = { type: "root", children: [] };
2230
+ } else if (Array.isArray(result)) {
2231
+ const children = (
2232
+ /** @type {Array<MdastRootContent>} */
2233
+ result
2234
+ );
2235
+ mdast = { type: "root", children };
2236
+ } else {
2237
+ mdast = result;
2238
+ }
2239
+ visit(mdast, function(node, index, parent) {
2240
+ if (node.type === "text" && index !== void 0 && parent) {
2241
+ const previous = parent.children[index - 1];
2242
+ if (previous && previous.type === node.type) {
2243
+ previous.value += node.value;
2244
+ parent.children.splice(index, 1);
2245
+ if (previous.position && node.position) {
2246
+ previous.position.end = node.position.end;
2247
+ }
2248
+ return index - 1;
2249
+ }
2250
+ node.value = node.value.replace(/[\t ]*(\r?\n|\r)[\t ]*/, "$1");
2251
+ if (parent && (parent.type === "heading" || parent.type === "paragraph" || parent.type === "root")) {
2252
+ if (!index) {
2253
+ node.value = node.value.replace(/^[\t ]+/, "");
2254
+ }
2255
+ if (index === parent.children.length - 1) {
2256
+ node.value = node.value.replace(/[\t ]+$/, "");
2257
+ }
2258
+ }
2259
+ if (!node.value) {
2260
+ parent.children.splice(index, 1);
2261
+ return index;
2262
+ }
2263
+ }
2264
+ });
2265
+ return mdast;
2266
+ }
2267
+ __name(toMdast, "toMdast");
2268
+ export {
2269
+ handlers as defaultHandlers,
2270
+ nodeHandlers as defaultNodeHandlers,
2271
+ toMdast
2272
+ };