@seriousgaming/sdk-tools 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/dist/agent/guidance.md +1 -0
  2. package/dist/{cli-ZTZ5H55T.js → cli-27M4PX7O.js} +17 -17
  3. package/dist/{cli-2BH7FX27.js → cli-2FXZZLCL.js} +1 -1
  4. package/dist/{cli-HHPMAV4F.js → cli-2KDV2DYC.js} +3 -3
  5. package/dist/{cli-57V4ARER.js → cli-2QM63J3I.js} +1 -1
  6. package/dist/{cli-TFMNNVJ7.js → cli-32NRB2IT.js} +15 -15
  7. package/dist/{cli-JPAXKLVT.js → cli-3HBYH4VF.js} +11 -11
  8. package/dist/{cli-JR5AZLLK.js → cli-3HPAKEJJ.js} +2 -2
  9. package/dist/{cli-3PIJLSRQ.js → cli-3HZGJRQW.js} +11 -11
  10. package/dist/{cli-BOXXMDSX.js → cli-3OCKRPXI.js} +18 -18
  11. package/dist/{cli-4CHKF4DQ.js → cli-3OVXQJEW.js} +2 -2
  12. package/dist/{cli-4UWFQNGF.js → cli-3VV2JLHX.js} +1 -1
  13. package/dist/{cli-EJVAQCMQ.js → cli-42ZUP4X3.js} +114 -5
  14. package/dist/{cli-CV4JGVJR.js → cli-4B5OBHSY.js} +19 -19
  15. package/dist/{cli-2DQJACAH.js → cli-4EMNCU63.js} +17 -17
  16. package/dist/cli-5CG6BMCY.js +36 -0
  17. package/dist/{cli-VYR326C6.js → cli-5FRKWNVP.js} +19 -19
  18. package/dist/{cli-TDYKRXUA.js → cli-5P66N5G6.js} +17 -17
  19. package/dist/{cli-ZRPWZOCW.js → cli-5SYPXJCB.js} +20 -16
  20. package/dist/{cli-TJ3PLRHF.js → cli-66AHBZRZ.js} +15 -15
  21. package/dist/{cli-M7WEAIRF.js → cli-6AGWTGTO.js} +106 -28
  22. package/dist/{cli-WG36UJRK.js → cli-6BAZE75K.js} +18 -18
  23. package/dist/{cli-VPON5HGB.js → cli-6FVHRL3H.js} +19 -19
  24. package/dist/{cli-QVASWX2A.js → cli-6GDPO5VU.js} +2 -2
  25. package/dist/{cli-TPNQLYPC.js → cli-6NBER36P.js} +1 -1
  26. package/dist/{cli-LQ4VSM5R.js → cli-726NJARI.js} +0 -0
  27. package/dist/{cli-GHLILDH7.js → cli-72DRYVTT.js} +13 -13
  28. package/dist/{cli-MMN4BPO4.js → cli-7CW2BBJG.js} +1 -1
  29. package/dist/{cli-FP32D3T6.js → cli-7GJGFILU.js} +15 -15
  30. package/dist/{cli-HYEU3QS6.js → cli-7NCVUM5U.js} +3 -3
  31. package/dist/cli-7S4G4EKK.js +110 -0
  32. package/dist/{cli-J4DKUUTK.js → cli-7V6GUIIS.js} +2 -2
  33. package/dist/{cli-N6H6T2E2.js → cli-AEAFLZGY.js} +12 -0
  34. package/dist/{cli-C47GJATR.js → cli-AGYCXRPR.js} +3 -3
  35. package/dist/{cli-XSVGKI3R.js → cli-BC4KKNLA.js} +1 -1
  36. package/dist/cli-BQ3FHENQ.js +16 -0
  37. package/dist/{cli-CXCL7VRK.js → cli-BXCCODYD.js} +20 -20
  38. package/dist/cli-C2XDL4LD.js +30 -0
  39. package/dist/{cli-MJUYJIEP.js → cli-C45A5VX6.js} +3 -3
  40. package/dist/{cli-64AA7367.js → cli-C7YZNPWX.js} +11 -11
  41. package/dist/{cli-ZKG3OPZ6.js → cli-CAX4CQTC.js} +13 -13
  42. package/dist/{cli-YOTGR3NB.js → cli-CVOLMK3Z.js} +1 -1
  43. package/dist/{cli-PKQNOGBO.js → cli-D3CZRXVJ.js} +63 -17
  44. package/dist/{cli-4YB3ROVR.js → cli-DMKRP33X.js} +1 -1
  45. package/dist/{cli-FZ7QAZZP.js → cli-DPFN2LIZ.js} +15 -15
  46. package/dist/{cli-7TOLC62D.js → cli-DT756M3Z.js} +20 -20
  47. package/dist/{cli-TIDQ4WUE.js → cli-DXHPYN4N.js} +1 -1
  48. package/dist/{cli-OANH3BTQ.js → cli-E665NKUQ.js} +5 -5
  49. package/dist/{cli-DEBCP7UH.js → cli-EK7CGMGS.js} +17 -17
  50. package/dist/{cli-PIO7NWMH.js → cli-ESU3J563.js} +15 -15
  51. package/dist/{cli-6HB6HTC6.js → cli-F47ELAXM.js} +47 -47
  52. package/dist/{cli-JIZTQVL2.js → cli-FH4WBZHA.js} +14 -14
  53. package/dist/{cli-JRMHSMYT.js → cli-FHKRO6OU.js} +19 -19
  54. package/dist/{cli-ESA6YNPF.js → cli-FSEDPZR5.js} +19 -19
  55. package/dist/{cli-G5DQGZ2E.js → cli-FV45UZQP.js} +19 -19
  56. package/dist/{cli-XR2XSWQN.js → cli-G7FX7ZIU.js} +12 -12
  57. package/dist/{cli-X7E3637I.js → cli-GFONBOJT.js} +50 -26
  58. package/dist/{cli-C5QOJJWX.js → cli-GHIMH6JU.js} +1 -1
  59. package/dist/{cli-T4HWGMY4.js → cli-HC7L5DXV.js} +15 -15
  60. package/dist/{cli-WU43JT4T.js → cli-HJPNNORV.js} +2 -2
  61. package/dist/{cli-SOMIB4B4.js → cli-HMEZHQBC.js} +17 -17
  62. package/dist/{cli-TFZ53OA2.js → cli-HQUVSAHY.js} +18 -18
  63. package/dist/{cli-MYJGMA6U.js → cli-IC5FOT2J.js} +1 -1
  64. package/dist/{cli-VL2P354N.js → cli-IVZ7AHUJ.js} +3 -3
  65. package/dist/{cli-B6YHEKIJ.js → cli-J2OTL6JH.js} +5 -5
  66. package/dist/{cli-NEOLMC2P.js → cli-JA6UFTSX.js} +17 -17
  67. package/dist/{cli-Z5HWENER.js → cli-JOXCAGM7.js} +19 -19
  68. package/dist/{cli-NOQBWJQN.js → cli-JQ6I5GGE.js} +3 -3
  69. package/dist/{cli-TDSQSCX4.js → cli-K6M6YB67.js} +1 -1
  70. package/dist/{cli-MYJGGLC5.js → cli-KFVA7DT3.js} +3 -3
  71. package/dist/{cli-DHOWZCXT.js → cli-KH6FKM5A.js} +15 -15
  72. package/dist/{cli-4VZIJYKU.js → cli-KMT235FV.js} +2 -2
  73. package/dist/{cli-6ZSMW4HR.js → cli-KU4PG7ZA.js} +15 -15
  74. package/dist/{cli-ATI6OLJU.js → cli-L4DEEAMK.js} +17 -17
  75. package/dist/{cli-EDCAH2TC.js → cli-ME3JKMJL.js} +19 -19
  76. package/dist/{cli-R7RG2VMW.js → cli-MJ65PIYI.js} +15 -15
  77. package/dist/cli-MM2ROZWO.js +36 -0
  78. package/dist/{cli-RZITKPJX.js → cli-MN7X4UG2.js} +1 -1
  79. package/dist/{cli-LE5ICDAF.js → cli-MPU4FLA7.js} +4 -4
  80. package/dist/{cli-HCRTYQQS.js → cli-MPWTXNF6.js} +2 -2
  81. package/dist/{cli-NPPY557S.js → cli-N5K2KHPR.js} +15 -15
  82. package/dist/{cli-PVA52RC2.js → cli-NGOQWOQE.js} +15 -15
  83. package/dist/{cli-ZTWOE3ZT.js → cli-NU4SCD5D.js} +1 -1
  84. package/dist/{cli-UTM4QU67.js → cli-O3IMNLN2.js} +282 -96
  85. package/dist/{cli-MM3A4SPH.js → cli-OUFXSQOW.js} +7265 -4467
  86. package/dist/{cli-UBQCSUDH.js → cli-PEY6XZDE.js} +16 -16
  87. package/dist/{cli-HM7CD4VU.js → cli-PLW3TWJ7.js} +19 -19
  88. package/dist/{cli-LRQDF3ZO.js → cli-PO2ALWHP.js} +13 -13
  89. package/dist/{cli-IPP5FDCH.js → cli-PPEB3ENS.js} +18 -18
  90. package/dist/{cli-C3OERMIR.js → cli-PZ7G544B.js} +3 -3
  91. package/dist/{cli-GPAN6XK2.js → cli-Q5BKFFDL.js} +4 -4
  92. package/dist/{cli-MULKSLA4.js → cli-QAI6T5FL.js} +15 -15
  93. package/dist/{cli-JGFJWZFU.js → cli-QAVLRCQ5.js} +3 -3
  94. package/dist/{cli-OQG3Y4RU.js → cli-QDIH2G2P.js} +15 -15
  95. package/dist/cli-SN7D7HTX.js +36 -0
  96. package/dist/{cli-SWZY7L7K.js → cli-SOQJHK4Q.js} +6 -6
  97. package/dist/{cli-7RYIEKMB.js → cli-SPKPDXWD.js} +15 -15
  98. package/dist/{cli-WAZD75KE.js → cli-SWUAXVIJ.js} +15 -15
  99. package/dist/cli-TJNLXQJ5.js +36 -0
  100. package/dist/{cli-SX3ULO5P.js → cli-U2EWI6H5.js} +11 -11
  101. package/dist/{cli-FXY3DKPW.js → cli-UADUC4JD.js} +2 -2
  102. package/dist/{cli-FWFRKQNE.js → cli-UR63LFVK.js} +2 -2
  103. package/dist/{cli-YSPZZQCP.js → cli-UTHPCZYL.js} +2 -2
  104. package/dist/{cli-XTANOFQR.js → cli-UYV3BDPA.js} +3 -3
  105. package/dist/{cli-H3J3ICCQ.js → cli-UZCQL6YP.js} +3 -3
  106. package/dist/{cli-LQERHJFE.js → cli-V5K3CCYZ.js} +2 -2
  107. package/dist/cli-V7L3HEL4.js +36 -0
  108. package/dist/{cli-GEQUJF4L.js → cli-VBSF3R3L.js} +16 -16
  109. package/dist/{cli-FXWWYBYU.js → cli-VQ4OJ4KE.js} +18 -18
  110. package/dist/{cli-IUS2YCD3.js → cli-VTLFQHDO.js} +1 -1
  111. package/dist/{cli-SOFCTQAL.js → cli-W7XCTGQ7.js} +15 -15
  112. package/dist/{cli-GTWEGYSU.js → cli-W7Y7X3FX.js} +19 -19
  113. package/dist/cli-WWNTBK37.js +1973 -0
  114. package/dist/cli-XPJGW375.js +36 -0
  115. package/dist/{cli-SRHBXZCN.js → cli-Y33ULHYO.js} +1 -1
  116. package/dist/{cli-ZQ2Y3U7F.js → cli-YLYB4ITF.js} +13 -13
  117. package/dist/{cli-4XCQUM3E.js → cli-ZFY6TGU7.js} +4 -4
  118. package/dist/{cli-JRIIAZ33.js → cli-ZSKP2IRP.js} +53 -38
  119. package/dist/cli.js +52 -52
  120. package/dist/client.js +17518 -16558
  121. package/dist/core/save-scenario.d.ts +1 -0
  122. package/dist/core/session-start-gate.d.ts +25 -0
  123. package/dist/core/session.d.ts +4 -0
  124. package/dist/dev/console/assets/{index-CnXlPeLX.js → index-CVNjiRUh.js} +31 -27
  125. package/dist/dev/console/index.html +1 -1
  126. package/dist/docs/api/deck.md +1 -1
  127. package/dist/docs/api/index.md +1 -1
  128. package/dist/docs/api/sdk-e2e.md +7 -6
  129. package/dist/docs/api/sdk-projection.md +1 -0
  130. package/dist/docs/api/sdk-tools-client.md +3 -1
  131. package/dist/docs/api/sdk-tools-playwright.md +1 -8
  132. package/dist/docs/api/sdk-ui.md +40 -64
  133. package/dist/docs/api/sdk.md +10 -1
  134. package/dist/docs/changelog.md +15 -0
  135. package/dist/docs/cli-error-codes.md +7 -1
  136. package/dist/docs/cli-reference.md +3 -0
  137. package/dist/docs/concepts/index.md +1 -0
  138. package/dist/docs/guides/engine.md +5 -0
  139. package/dist/docs/guides/file-handling.md +4 -1
  140. package/dist/docs/guides/llm-integration.md +3 -2
  141. package/dist/docs/guides/multi-team-games.md +2 -0
  142. package/dist/docs/guides/patterns.md +5 -0
  143. package/dist/docs/guides/session.md +1 -1
  144. package/dist/docs/guides/settings.md +2 -0
  145. package/dist/docs/guides/setup.md +23 -2
  146. package/dist/docs/guides/speech-generation.md +1 -0
  147. package/dist/docs/guides/testing.md +2 -0
  148. package/dist/docs/guides/tick-controller.md +2 -0
  149. package/dist/docs/guides/type-safety.md +2 -1
  150. package/dist/docs/guides/ui-files-and-llms.md +3 -1
  151. package/dist/docs/guides/upgrading.md +4 -0
  152. package/dist/docs/guides/validators.md +27 -4
  153. package/dist/docs/guides/waiting-room.md +2 -0
  154. package/dist/docs/page-index.md +8 -6
  155. package/dist/docs/recipes/call-endpoint-from-ui.md +1 -0
  156. package/dist/docs/recipes/create-scenario-editor.md +2 -1
  157. package/dist/docs/recipes/create-setup.md +2 -1
  158. package/dist/docs/recipes/declare-api-uses.md +1 -0
  159. package/dist/docs/recipes/describe-setup-with-endpoint.md +69 -0
  160. package/dist/docs/recipes/index.md +3 -1
  161. package/dist/docs/recipes/share-logic-between-engine-and-ui.md +2 -2
  162. package/dist/docs/recipes/test-user-interface.md +1 -1
  163. package/dist/docs/recipes/validate-scenarios.md +9 -3
  164. package/dist/docs/recipes/write-setup-notes.md +58 -0
  165. package/dist/docs/troubleshooting.md +2 -1
  166. package/dist/execution/executor.d.ts +12 -0
  167. package/dist/execution/scenario-gates.d.ts +40 -0
  168. package/dist/host.js +1082 -467
  169. package/dist/playwright.js +17529 -16569
  170. package/dist/runtime/manifest-version.d.ts +1 -1
  171. package/dist/runtime.js +4 -2
  172. package/dist/setup/setup-notes.d.ts +42 -0
  173. package/dist/templates/package/package.json.liquid +15 -15
  174. package/dist/templates/starter-game/package.json +13 -13
  175. package/dist/utils/error-codes.d.ts +13 -1
  176. package/dist/validation/package-validation.d.ts +1 -1
  177. package/package.json +22 -23
  178. package/dist/cli-57C72YKJ.js +0 -36
  179. package/dist/cli-5G7TZHD3.js +0 -36
  180. package/dist/cli-7MBLH4M3.js +0 -36
  181. package/dist/cli-C6G65H6S.js +0 -256
  182. package/dist/cli-L5IG7MY2.js +0 -36
  183. package/dist/cli-SPGUVL6Z.js +0 -36
  184. package/dist/cli-UY4VDI7W.js +0 -30
  185. package/dist/cli-WM6SQJ6Q.js +0 -16
  186. package/dist/cli-ZBTFLZUL.js +0 -36
  187. package/dist/cli-ZF7IFB54.js +0 -4026
package/dist/host.js CHANGED
@@ -845,8 +845,8 @@ function markdownSpace(code3) {
845
845
  var unicodePunctuation = regexCheck(/\p{P}|\p{S}/u);
846
846
  var unicodeWhitespace = regexCheck(/\s/);
847
847
  function regexCheck(regex) {
848
- return check;
849
- function check(code3) {
848
+ return check2;
849
+ function check2(code3) {
850
850
  return code3 !== null && code3 > -1 && regex.test(String.fromCharCode(code3));
851
851
  }
852
852
  }
@@ -1053,18 +1053,18 @@ function parseEntities(value, options) {
1053
1053
  let index2 = 0;
1054
1054
  let lines = -1;
1055
1055
  let queue = "";
1056
- let point3;
1056
+ let point4;
1057
1057
  let indent2;
1058
1058
  if (settings.position) {
1059
1059
  if ("start" in settings.position || "indent" in settings.position) {
1060
1060
  indent2 = settings.position.indent;
1061
- point3 = settings.position.start;
1061
+ point4 = settings.position.start;
1062
1062
  } else {
1063
- point3 = settings.position;
1063
+ point4 = settings.position;
1064
1064
  }
1065
1065
  }
1066
- let line = (point3 ? point3.line : 0) || 1;
1067
- let column = (point3 ? point3.column : 0) || 1;
1066
+ let line = (point4 ? point4.line : 0) || 1;
1067
+ let column = (point4 ? point4.column : 0) || 1;
1068
1068
  let previous4 = now();
1069
1069
  let character;
1070
1070
  index2--;
@@ -1229,7 +1229,7 @@ function parseEntities(value, options) {
1229
1229
  return {
1230
1230
  line,
1231
1231
  column,
1232
- offset: index2 + ((point3 ? point3.offset : 0) || 0)
1232
+ offset: index2 + ((point4 ? point4.offset : 0) || 0)
1233
1233
  };
1234
1234
  }
1235
1235
  function warning(code3, offset) {
@@ -1284,9 +1284,9 @@ function core(value, options) {
1284
1284
  return value;
1285
1285
  }
1286
1286
  return value.replace(surrogatePairsRegex, surrogate).replace(controlCharactersRegex, basic);
1287
- function surrogate(pair, index2, all2) {
1287
+ function surrogate(pair2, index2, all2) {
1288
1288
  return options.format(
1289
- (pair.charCodeAt(0) - 55296) * 1024 + pair.charCodeAt(1) - 56320 + 65536,
1289
+ (pair2.charCodeAt(0) - 55296) * 1024 + pair2.charCodeAt(1) - 56320 + 65536,
1290
1290
  all2.charCodeAt(index2 + 2),
1291
1291
  options
1292
1292
  );
@@ -1326,193 +1326,14 @@ function stringifyEntitiesLight(value, options) {
1326
1326
  return core(value, Object.assign({ format: formatBasic }, options));
1327
1327
  }
1328
1328
 
1329
- // ../node_modules/.pnpm/unist-util-is@6.0.1/node_modules/unist-util-is/lib/index.js
1330
- var convert = (
1331
- // Note: overloads in JSDoc can’t yet use different `@template`s.
1332
- /**
1333
- * @type {(
1334
- * (<Condition extends string>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &
1335
- * (<Condition extends Props>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &
1336
- * (<Condition extends TestFunction>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &
1337
- * ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &
1338
- * ((test?: Test) => Check)
1339
- * )}
1340
- */
1341
- /**
1342
- * @param {Test} [test]
1343
- * @returns {Check}
1344
- */
1345
- (function(test) {
1346
- if (test === null || test === void 0) {
1347
- return ok2;
1348
- }
1349
- if (typeof test === "function") {
1350
- return castFactory(test);
1351
- }
1352
- if (typeof test === "object") {
1353
- return Array.isArray(test) ? anyFactory(test) : (
1354
- // Cast because `ReadonlyArray` goes into the above but `isArray`
1355
- // narrows to `Array`.
1356
- propertiesFactory(
1357
- /** @type {Props} */
1358
- test
1359
- )
1360
- );
1361
- }
1362
- if (typeof test === "string") {
1363
- return typeFactory(test);
1364
- }
1365
- throw new Error("Expected function, string, or object as test");
1366
- })
1367
- );
1368
- function anyFactory(tests) {
1369
- const checks = [];
1370
- let index2 = -1;
1371
- while (++index2 < tests.length) {
1372
- checks[index2] = convert(tests[index2]);
1373
- }
1374
- return castFactory(any);
1375
- function any(...parameters) {
1376
- let index3 = -1;
1377
- while (++index3 < checks.length) {
1378
- if (checks[index3].apply(this, parameters)) return true;
1379
- }
1380
- return false;
1381
- }
1382
- }
1383
- function propertiesFactory(check) {
1384
- const checkAsRecord = (
1385
- /** @type {Record<string, unknown>} */
1386
- check
1387
- );
1388
- return castFactory(all2);
1389
- function all2(node2) {
1390
- const nodeAsRecord = (
1391
- /** @type {Record<string, unknown>} */
1392
- /** @type {unknown} */
1393
- node2
1394
- );
1395
- let key;
1396
- for (key in check) {
1397
- if (nodeAsRecord[key] !== checkAsRecord[key]) return false;
1398
- }
1399
- return true;
1400
- }
1401
- }
1402
- function typeFactory(check) {
1403
- return castFactory(type);
1404
- function type(node2) {
1405
- return node2 && node2.type === check;
1406
- }
1407
- }
1408
- function castFactory(testFunction) {
1409
- return check;
1410
- function check(value, index2, parent) {
1411
- return Boolean(
1412
- looksLikeANode(value) && testFunction.call(
1413
- this,
1414
- value,
1415
- typeof index2 === "number" ? index2 : void 0,
1416
- parent || void 0
1417
- )
1418
- );
1419
- }
1420
- }
1421
- function ok2() {
1422
- return true;
1423
- }
1424
- function looksLikeANode(value) {
1425
- return value !== null && typeof value === "object" && "type" in value;
1426
- }
1427
-
1428
- // ../node_modules/.pnpm/unist-util-visit-parents@6.0.2/node_modules/unist-util-visit-parents/lib/color.js
1429
- function color(d) {
1430
- return d;
1431
- }
1432
-
1433
- // ../node_modules/.pnpm/unist-util-visit-parents@6.0.2/node_modules/unist-util-visit-parents/lib/index.js
1434
- var empty = [];
1435
- var CONTINUE = true;
1436
- var EXIT = false;
1437
- var SKIP = "skip";
1438
- function visitParents(tree, test, visitor, reverse) {
1439
- let check;
1440
- if (typeof test === "function" && typeof visitor !== "function") {
1441
- reverse = visitor;
1442
- visitor = test;
1443
- } else {
1444
- check = test;
1445
- }
1446
- const is2 = convert(check);
1447
- const step = reverse ? -1 : 1;
1448
- factory(tree, void 0, [])();
1449
- function factory(node2, index2, parents) {
1450
- const value = (
1451
- /** @type {Record<string, unknown>} */
1452
- node2 && typeof node2 === "object" ? node2 : {}
1453
- );
1454
- if (typeof value.type === "string") {
1455
- const name = (
1456
- // `hast`
1457
- typeof value.tagName === "string" ? value.tagName : (
1458
- // `xast`
1459
- typeof value.name === "string" ? value.name : void 0
1460
- )
1461
- );
1462
- Object.defineProperty(visit2, "name", {
1463
- value: "node (" + color(node2.type + (name ? "<" + name + ">" : "")) + ")"
1464
- });
1465
- }
1466
- return visit2;
1467
- function visit2() {
1468
- let result = empty;
1469
- let subresult;
1470
- let offset;
1471
- let grandparents;
1472
- if (!test || is2(node2, index2, parents[parents.length - 1] || void 0)) {
1473
- result = toResult(visitor(node2, parents));
1474
- if (result[0] === EXIT) {
1475
- return result;
1476
- }
1477
- }
1478
- if ("children" in node2 && node2.children) {
1479
- const nodeAsParent = (
1480
- /** @type {UnistParent} */
1481
- node2
1482
- );
1483
- if (nodeAsParent.children && result[0] !== SKIP) {
1484
- offset = (reverse ? nodeAsParent.children.length : -1) + step;
1485
- grandparents = parents.concat(nodeAsParent);
1486
- while (offset > -1 && offset < nodeAsParent.children.length) {
1487
- const child = nodeAsParent.children[offset];
1488
- subresult = factory(child, offset, grandparents)();
1489
- if (subresult[0] === EXIT) {
1490
- return subresult;
1491
- }
1492
- offset = typeof subresult[1] === "number" ? subresult[1] : offset + step;
1493
- }
1494
- }
1495
- }
1496
- return result;
1497
- }
1498
- }
1499
- }
1500
- function toResult(value) {
1501
- if (Array.isArray(value)) {
1502
- return value;
1503
- }
1504
- if (typeof value === "number") {
1505
- return [CONTINUE, value];
1506
- }
1507
- return value === null || value === void 0 ? empty : [value];
1508
- }
1509
-
1510
- // ../node_modules/.pnpm/mdast-util-directive@3.1.1/node_modules/mdast-util-directive/lib/index.js
1329
+ // ../node_modules/.pnpm/mdast-util-directive@3.2.0/node_modules/mdast-util-directive/lib/index.js
1511
1330
  var own = {}.hasOwnProperty;
1331
+ var emptyFromMarkdownOptions = {};
1512
1332
  var emptyOptions = {};
1513
1333
  var shortcut = /^[^\t\n\r "#'.<=>`}]+$/;
1514
1334
  var unquoted = /^[^\t\n\r "'<=>`}]+$/;
1515
- function directiveFromMarkdown() {
1335
+ function directiveFromMarkdown(options) {
1336
+ const settings = options || emptyFromMarkdownOptions;
1516
1337
  return {
1517
1338
  canContainEols: ["textDirective"],
1518
1339
  enter: {
@@ -1526,29 +1347,58 @@ function directiveFromMarkdown() {
1526
1347
  },
1527
1348
  exit: {
1528
1349
  directiveContainer: exit,
1350
+ directiveContainerAttributeClass: exitAttributeShortcut,
1529
1351
  directiveContainerAttributeClassValue: exitAttributeClassValue,
1352
+ directiveContainerAttributeId: exitAttributeShortcut,
1530
1353
  directiveContainerAttributeIdValue: exitAttributeIdValue,
1531
1354
  directiveContainerAttributeName: exitAttributeName,
1532
1355
  directiveContainerAttributeValue: exitAttributeValue,
1356
+ directiveContainerAttributeValueLiteral: exitAttributeValueLiteral,
1533
1357
  directiveContainerAttributes: exitAttributes,
1534
1358
  directiveContainerLabel: exitContainerLabel,
1535
1359
  directiveContainerName: exitName,
1360
+ directiveContainerSequence: exitSequence,
1536
1361
  directiveLeaf: exit,
1362
+ directiveLeafAttributeClass: exitAttributeShortcut,
1537
1363
  directiveLeafAttributeClassValue: exitAttributeClassValue,
1364
+ directiveLeafAttributeId: exitAttributeShortcut,
1538
1365
  directiveLeafAttributeIdValue: exitAttributeIdValue,
1539
1366
  directiveLeafAttributeName: exitAttributeName,
1540
1367
  directiveLeafAttributeValue: exitAttributeValue,
1368
+ directiveLeafAttributeValueLiteral: exitAttributeValueLiteral,
1541
1369
  directiveLeafAttributes: exitAttributes,
1370
+ directiveLeafLabel: exitLabel,
1542
1371
  directiveLeafName: exitName,
1372
+ directiveLeafSequence: exitSequence,
1543
1373
  directiveText: exit,
1374
+ directiveTextAttributeClass: exitAttributeShortcut,
1544
1375
  directiveTextAttributeClassValue: exitAttributeClassValue,
1376
+ directiveTextAttributeId: exitAttributeShortcut,
1545
1377
  directiveTextAttributeIdValue: exitAttributeIdValue,
1546
1378
  directiveTextAttributeName: exitAttributeName,
1547
1379
  directiveTextAttributeValue: exitAttributeValue,
1380
+ directiveTextAttributeValueLiteral: exitAttributeValueLiteral,
1548
1381
  directiveTextAttributes: exitAttributes,
1382
+ directiveTextLabel: exitLabel,
1383
+ directiveTextMarker: exitSequence,
1549
1384
  directiveTextName: exitName
1550
1385
  }
1551
1386
  };
1387
+ function exitSequence(token) {
1388
+ if (!settings.verbose) return;
1389
+ const node2 = this.stack[this.stack.length - 1];
1390
+ ok(node2, "expected `node`");
1391
+ ok(
1392
+ node2.type === "containerDirective" || node2.type === "leafDirective" || node2.type === "textDirective"
1393
+ );
1394
+ const place = { start: point(token.start), end: point(token.end) };
1395
+ if (node2.data && node2.data.position) {
1396
+ ok(node2.type === "containerDirective");
1397
+ node2.data.position.closing = place;
1398
+ } else {
1399
+ node2.data = { position: { opening: place } };
1400
+ }
1401
+ }
1552
1402
  }
1553
1403
  function directiveToMarkdown(options) {
1554
1404
  const settings = options || emptyOptions;
@@ -1586,8 +1436,23 @@ function directiveToMarkdown(options) {
1586
1436
  };
1587
1437
  function handleDirective(node2, _, state, info) {
1588
1438
  const tracker = state.createTracker(info);
1589
- const sequence = fence(node2);
1590
1439
  const exit4 = state.enter(node2.type);
1440
+ let content3;
1441
+ if (node2.type === "containerDirective") {
1442
+ const head = (node2.children || [])[0];
1443
+ const children = inlineDirectiveLabel(head) ? node2.children.slice(1) : node2.children;
1444
+ if (children && children.length > 0) {
1445
+ const current = tracker.current();
1446
+ content3 = state.containerFlow(
1447
+ { ...node2, children },
1448
+ {
1449
+ now: { line: current.now.line + 1, column: 1 + current.lineShift },
1450
+ lineShift: current.lineShift
1451
+ }
1452
+ );
1453
+ }
1454
+ }
1455
+ const sequence = fence(node2, content3 ? longestColonLine(content3) : 0);
1591
1456
  let value = tracker.move(sequence + (node2.name || ""));
1592
1457
  const attributesValue = attributes4(node2, state);
1593
1458
  const after = info.after.charCodeAt(0);
@@ -1620,14 +1485,8 @@ function directiveToMarkdown(options) {
1620
1485
  attributesValue || (after === 123 ? "{}" : "")
1621
1486
  );
1622
1487
  if (node2.type === "containerDirective") {
1623
- const head = (node2.children || [])[0];
1624
- let shallow = node2;
1625
- if (inlineDirectiveLabel(head)) {
1626
- shallow = Object.assign({}, node2, { children: node2.children.slice(1) });
1627
- }
1628
- if (shallow && shallow.children && shallow.children.length > 0) {
1629
- value += tracker.move("\n");
1630
- value += tracker.move(state.containerFlow(shallow, tracker.current()));
1488
+ if (content3) {
1489
+ value += tracker.move("\n" + content3);
1631
1490
  }
1632
1491
  value += tracker.move("\n" + sequence);
1633
1492
  }
@@ -1643,17 +1502,16 @@ function directiveToMarkdown(options) {
1643
1502
  let key;
1644
1503
  for (key in attributes5) {
1645
1504
  if (own.call(attributes5, key) && attributes5[key] !== void 0 && attributes5[key] !== null) {
1646
- const value = String(attributes5[key]);
1505
+ const value = encode(String(attributes5[key]));
1647
1506
  if (key === "id") {
1648
1507
  id = settings.preferShortcut !== false && shortcut.test(value) ? "#" + value : quoted("id", value, node2, state);
1649
1508
  } else if (key === "class") {
1650
1509
  const list3 = value.split(/[\t\n\r ]+/);
1651
1510
  const classesFullList = [];
1652
1511
  const classesList = [];
1653
- let index2 = -1;
1654
- while (++index2 < list3.length) {
1512
+ for (const item of list3) {
1655
1513
  ;
1656
- (settings.preferShortcut !== false && shortcut.test(list3[index2]) ? classesList : classesFullList).push(list3[index2]);
1514
+ (settings.preferShortcut !== false && shortcut.test(item) ? classesList : classesFullList).push(item);
1657
1515
  }
1658
1516
  classesFull = classesFullList.length > 0 ? quoted("class", classesFullList.join(" "), node2, state) : "";
1659
1517
  classes = classesList.length > 0 ? "." + classesList.join(".") : "";
@@ -1699,10 +1557,12 @@ function enter(type, token) {
1699
1557
  }
1700
1558
  function exitName(token) {
1701
1559
  const node2 = this.stack[this.stack.length - 1];
1560
+ ok(node2, "expected `node`");
1702
1561
  ok(
1703
1562
  node2.type === "containerDirective" || node2.type === "leafDirective" || node2.type === "textDirective"
1704
1563
  );
1705
1564
  node2.name = this.sliceSerialize(token);
1565
+ openingEnd(node2, token);
1706
1566
  }
1707
1567
  function enterContainerLabel(token) {
1708
1568
  this.enter(
@@ -1712,11 +1572,42 @@ function enterContainerLabel(token) {
1712
1572
  }
1713
1573
  function exitContainerLabel(token) {
1714
1574
  this.exit(token);
1575
+ const node2 = this.stack[this.stack.length - 1];
1576
+ ok(node2, "expected `node`");
1577
+ ok(node2.type === "containerDirective");
1578
+ openingEnd(node2, token);
1579
+ }
1580
+ function exitLabel(token) {
1581
+ const node2 = this.stack[this.stack.length - 1];
1582
+ ok(node2, "expected `node`");
1583
+ ok(node2.type === "leafDirective" || node2.type === "textDirective");
1584
+ openingEnd(node2, token);
1715
1585
  }
1716
1586
  function enterAttributes() {
1587
+ const node2 = this.stack[this.stack.length - 1];
1588
+ ok(node2, "expected `node`");
1589
+ ok(
1590
+ node2.type === "containerDirective" || node2.type === "leafDirective" || node2.type === "textDirective"
1591
+ );
1592
+ if (node2.data && node2.data.position) {
1593
+ this.data.directiveAttributePositions = {};
1594
+ }
1717
1595
  this.data.directiveAttributes = [];
1718
1596
  this.buffer();
1719
1597
  }
1598
+ function exitAttributeShortcut(token) {
1599
+ const positions = this.data.directiveAttributePositions;
1600
+ if (positions) {
1601
+ const list3 = this.data.directiveAttributes;
1602
+ ok(list3, "expected `directiveAttributes`");
1603
+ const tail = list3[list3.length - 1];
1604
+ ok(tail, "expected attribute");
1605
+ positions[tail[0]] = { start: point(token.start), end: point(token.end) };
1606
+ }
1607
+ }
1608
+ function exitAttributeValueLiteral(token) {
1609
+ attributeEnd(this, token);
1610
+ }
1720
1611
  function exitAttributeIdValue(token) {
1721
1612
  const list3 = this.data.directiveAttributes;
1722
1613
  ok(list3, "expected `directiveAttributes`");
@@ -1736,35 +1627,69 @@ function exitAttributeClassValue(token) {
1736
1627
  function exitAttributeValue(token) {
1737
1628
  const list3 = this.data.directiveAttributes;
1738
1629
  ok(list3, "expected `directiveAttributes`");
1739
- list3[list3.length - 1][1] = parseEntities(this.sliceSerialize(token), {
1740
- attribute: true
1741
- });
1630
+ const tail = list3[list3.length - 1];
1631
+ ok(tail, "expected attribute");
1632
+ tail[1] = parseEntities(this.sliceSerialize(token), { attribute: true });
1633
+ attributeEnd(this, token);
1742
1634
  }
1743
1635
  function exitAttributeName(token) {
1744
1636
  const list3 = this.data.directiveAttributes;
1745
1637
  ok(list3, "expected `directiveAttributes`");
1746
- list3.push([this.sliceSerialize(token), ""]);
1638
+ const name = this.sliceSerialize(token);
1639
+ list3.push([name, ""]);
1640
+ const positions = this.data.directiveAttributePositions;
1641
+ if (positions) {
1642
+ positions[name] = { start: point(token.start), end: point(token.end) };
1643
+ }
1747
1644
  }
1748
- function exitAttributes() {
1645
+ function exitAttributes(token) {
1749
1646
  const list3 = this.data.directiveAttributes;
1750
1647
  ok(list3, "expected `directiveAttributes`");
1751
1648
  const cleaned = {};
1752
- let index2 = -1;
1753
- while (++index2 < list3.length) {
1754
- const attribute = list3[index2];
1649
+ for (const attribute of list3) {
1755
1650
  if (attribute[0] === "class" && cleaned.class) {
1756
1651
  cleaned.class += " " + attribute[1];
1757
1652
  } else {
1758
1653
  cleaned[attribute[0]] = attribute[1];
1759
1654
  }
1760
1655
  }
1656
+ const positions = this.data.directiveAttributePositions;
1657
+ this.data.directiveAttributePositions = void 0;
1761
1658
  this.data.directiveAttributes = void 0;
1762
1659
  this.resume();
1763
1660
  const node2 = this.stack[this.stack.length - 1];
1661
+ ok(node2, "expected `node`");
1764
1662
  ok(
1765
1663
  node2.type === "containerDirective" || node2.type === "leafDirective" || node2.type === "textDirective"
1766
1664
  );
1767
1665
  node2.attributes = cleaned;
1666
+ if (positions) {
1667
+ ok(node2.data && node2.data.position, "expected `position`");
1668
+ node2.data.position.attributes = positions;
1669
+ }
1670
+ openingEnd(node2, token);
1671
+ }
1672
+ function openingEnd(node2, token) {
1673
+ if (node2.data && node2.data.position) {
1674
+ const { opening } = node2.data.position;
1675
+ ok(opening, "expected `opening`");
1676
+ opening.end = point(token.end);
1677
+ }
1678
+ }
1679
+ function attributeEnd(context, token) {
1680
+ const positions = context.data.directiveAttributePositions;
1681
+ if (positions) {
1682
+ const list3 = context.data.directiveAttributes;
1683
+ ok(list3, "expected `directiveAttributes`");
1684
+ const tail = list3[list3.length - 1];
1685
+ ok(tail, "expected attribute");
1686
+ const position2 = positions[tail[0]];
1687
+ ok(position2, "expected position");
1688
+ position2.end = point(token.end);
1689
+ }
1690
+ }
1691
+ function point(d) {
1692
+ return { line: d.line, column: d.column, offset: d.offset };
1768
1693
  }
1769
1694
  function exit(token) {
1770
1695
  this.exit(token);
@@ -1772,27 +1697,30 @@ function exit(token) {
1772
1697
  function peekDirective() {
1773
1698
  return ":";
1774
1699
  }
1700
+ function encode(value) {
1701
+ const result = [];
1702
+ let start = 0;
1703
+ let index2 = value.indexOf("&");
1704
+ while (index2 !== -1) {
1705
+ const code3 = value.charCodeAt(index2 + 1);
1706
+ if (code3 === 35 || asciiAlpha(code3)) {
1707
+ result.push(value.slice(start, index2), "&#x26;");
1708
+ start = index2 + 1;
1709
+ }
1710
+ index2 = value.indexOf("&", index2 + 1);
1711
+ }
1712
+ result.push(value.slice(start));
1713
+ return result.join("");
1714
+ }
1775
1715
  function inlineDirectiveLabel(node2) {
1776
1716
  return Boolean(
1777
1717
  node2 && node2.type === "paragraph" && node2.data && node2.data.directiveLabel
1778
1718
  );
1779
1719
  }
1780
- function fence(node2) {
1720
+ function fence(node2, longest) {
1781
1721
  let size = 0;
1782
1722
  if (node2.type === "containerDirective") {
1783
- visitParents(node2, function(node3, parents) {
1784
- if (node3.type === "containerDirective") {
1785
- let index2 = parents.length;
1786
- let nesting = 0;
1787
- while (index2--) {
1788
- if (parents[index2].type === "containerDirective") {
1789
- nesting++;
1790
- }
1791
- }
1792
- if (nesting > size) size = nesting;
1793
- }
1794
- });
1795
- size += 3;
1723
+ size = Math.max(3, longest + 1);
1796
1724
  } else if (node2.type === "leafDirective") {
1797
1725
  size = 2;
1798
1726
  } else {
@@ -1800,6 +1728,31 @@ function fence(node2) {
1800
1728
  }
1801
1729
  return ":".repeat(size);
1802
1730
  }
1731
+ function longestColonLine(value) {
1732
+ let longest = 0;
1733
+ let index2 = 0;
1734
+ while (index2 < value.length) {
1735
+ let size = 0;
1736
+ let code3 = value.charCodeAt(index2);
1737
+ while (code3 === 9 || code3 === 32) {
1738
+ code3 = value.charCodeAt(++index2);
1739
+ }
1740
+ while (code3 === 58) {
1741
+ size++;
1742
+ code3 = value.charCodeAt(++index2);
1743
+ }
1744
+ while (code3 === 9 || code3 === 32) {
1745
+ code3 = value.charCodeAt(++index2);
1746
+ }
1747
+ while (!(code3 === 10 || code3 === 13 || Number.isNaN(code3))) {
1748
+ size = 0;
1749
+ code3 = value.charCodeAt(++index2);
1750
+ }
1751
+ if (size > longest) longest = size;
1752
+ index2++;
1753
+ }
1754
+ return longest;
1755
+ }
1803
1756
 
1804
1757
  // ../node_modules/.pnpm/micromark-factory-space@2.1.0/node_modules/micromark-factory-space/index.js
1805
1758
  function factorySpace(effects, ok3, type, max) {
@@ -2463,46 +2416,255 @@ function escapeStringRegexp(string3) {
2463
2416
  return string3.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
2464
2417
  }
2465
2418
 
2466
- // ../node_modules/.pnpm/mdast-util-find-and-replace@3.0.3/node_modules/mdast-util-find-and-replace/lib/index.js
2467
- function findAndReplace(tree, list3, options) {
2468
- const settings = options || {};
2469
- const ignored = convert(settings.ignore || []);
2470
- const pairs = toPairs(list3);
2471
- let pairIndex = -1;
2472
- while (++pairIndex < pairs.length) {
2473
- visitParents(tree, "text", visitor);
2474
- }
2475
- function visitor(node2, parents) {
2476
- let index2 = -1;
2477
- let grandparent;
2478
- while (++index2 < parents.length) {
2479
- const parent = parents[index2];
2480
- const siblings = grandparent ? grandparent.children : void 0;
2481
- if (ignored(
2482
- parent,
2483
- siblings ? siblings.indexOf(parent) : void 0,
2484
- grandparent
2485
- )) {
2486
- return;
2487
- }
2488
- grandparent = parent;
2419
+ // ../node_modules/.pnpm/unist-util-is@6.0.1/node_modules/unist-util-is/lib/index.js
2420
+ var convert = (
2421
+ // Note: overloads in JSDoc can’t yet use different `@template`s.
2422
+ /**
2423
+ * @type {(
2424
+ * (<Condition extends string>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &
2425
+ * (<Condition extends Props>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &
2426
+ * (<Condition extends TestFunction>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &
2427
+ * ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &
2428
+ * ((test?: Test) => Check)
2429
+ * )}
2430
+ */
2431
+ /**
2432
+ * @param {Test} [test]
2433
+ * @returns {Check}
2434
+ */
2435
+ (function(test) {
2436
+ if (test === null || test === void 0) {
2437
+ return ok2;
2489
2438
  }
2490
- if (grandparent) {
2491
- return handler(node2, parents);
2439
+ if (typeof test === "function") {
2440
+ return castFactory(test);
2492
2441
  }
2493
- }
2494
- function handler(node2, parents) {
2495
- const parent = parents[parents.length - 1];
2496
- const find = pairs[pairIndex][0];
2497
- const replace2 = pairs[pairIndex][1];
2498
- let start = 0;
2499
- const siblings = parent.children;
2500
- const index2 = siblings.indexOf(node2);
2501
- let change = false;
2502
- let nodes = [];
2503
- find.lastIndex = 0;
2504
- let match = find.exec(node2.value);
2505
- while (match) {
2442
+ if (typeof test === "object") {
2443
+ return Array.isArray(test) ? anyFactory(test) : (
2444
+ // Cast because `ReadonlyArray` goes into the above but `isArray`
2445
+ // narrows to `Array`.
2446
+ propertiesFactory(
2447
+ /** @type {Props} */
2448
+ test
2449
+ )
2450
+ );
2451
+ }
2452
+ if (typeof test === "string") {
2453
+ return typeFactory(test);
2454
+ }
2455
+ throw new Error("Expected function, string, or object as test");
2456
+ })
2457
+ );
2458
+ function anyFactory(tests) {
2459
+ const checks = [];
2460
+ let index2 = -1;
2461
+ while (++index2 < tests.length) {
2462
+ checks[index2] = convert(tests[index2]);
2463
+ }
2464
+ return castFactory(any);
2465
+ function any(...parameters) {
2466
+ let index3 = -1;
2467
+ while (++index3 < checks.length) {
2468
+ if (checks[index3].apply(this, parameters)) return true;
2469
+ }
2470
+ return false;
2471
+ }
2472
+ }
2473
+ function propertiesFactory(check2) {
2474
+ const checkAsRecord = (
2475
+ /** @type {Record<string, unknown>} */
2476
+ check2
2477
+ );
2478
+ return castFactory(all2);
2479
+ function all2(node2) {
2480
+ const nodeAsRecord = (
2481
+ /** @type {Record<string, unknown>} */
2482
+ /** @type {unknown} */
2483
+ node2
2484
+ );
2485
+ let key;
2486
+ for (key in check2) {
2487
+ if (nodeAsRecord[key] !== checkAsRecord[key]) return false;
2488
+ }
2489
+ return true;
2490
+ }
2491
+ }
2492
+ function typeFactory(check2) {
2493
+ return castFactory(type);
2494
+ function type(node2) {
2495
+ return node2 && node2.type === check2;
2496
+ }
2497
+ }
2498
+ function castFactory(testFunction) {
2499
+ return check2;
2500
+ function check2(value, index2, parent) {
2501
+ return Boolean(
2502
+ looksLikeANode(value) && testFunction.call(
2503
+ this,
2504
+ value,
2505
+ typeof index2 === "number" ? index2 : void 0,
2506
+ parent || void 0
2507
+ )
2508
+ );
2509
+ }
2510
+ }
2511
+ function ok2() {
2512
+ return true;
2513
+ }
2514
+ function looksLikeANode(value) {
2515
+ return value !== null && typeof value === "object" && "type" in value;
2516
+ }
2517
+
2518
+ // ../node_modules/.pnpm/unist-util-visit-parents@6.1.0/node_modules/unist-util-visit-parents/lib/color.js
2519
+ function color(d) {
2520
+ return d;
2521
+ }
2522
+
2523
+ // ../node_modules/.pnpm/unist-util-visit-parents@6.1.0/node_modules/unist-util-visit-parents/lib/index.js
2524
+ var empty = [];
2525
+ var CONTINUE = true;
2526
+ var EXIT = false;
2527
+ var SKIP = "skip";
2528
+ function visitParents(tree, testOrEnterOrVisitors, enterOrVisitorsOrReverse, reverse) {
2529
+ if (!tree || typeof tree !== "object") {
2530
+ throw new Error("Unexpected value `" + tree + "` for `tree`, expected node");
2531
+ }
2532
+ let preorder = true;
2533
+ let check2;
2534
+ let visitors;
2535
+ let enter2;
2536
+ let exit4;
2537
+ if (typeof enterOrVisitorsOrReverse === "function" || enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === "object") {
2538
+ check2 = /** @type {Test} */
2539
+ testOrEnterOrVisitors;
2540
+ visitors = enterOrVisitorsOrReverse;
2541
+ if (reverse) preorder = false;
2542
+ } else {
2543
+ visitors = /** @type {Visitors | Visitor} */
2544
+ testOrEnterOrVisitors;
2545
+ if (enterOrVisitorsOrReverse) preorder = false;
2546
+ }
2547
+ if (typeof visitors === "function") {
2548
+ enter2 = visitors;
2549
+ } else if (visitors && typeof visitors === "object") {
2550
+ if (visitors.enter === null || visitors.enter === void 0) {
2551
+ } else if (typeof visitors.enter === "function") {
2552
+ enter2 = visitors.enter;
2553
+ } else {
2554
+ throw new Error(
2555
+ "Unexpected value `" + visitors.enter + "` for `visitors.enter`, expected optional visitor"
2556
+ );
2557
+ }
2558
+ if (typeof visitors.exit === "function") {
2559
+ exit4 = visitors.exit;
2560
+ } else {
2561
+ throw new Error(
2562
+ "Unexpected value `" + visitors.exit + "` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)"
2563
+ );
2564
+ }
2565
+ } else {
2566
+ throw new Error(
2567
+ "Unexpected value `" + visitors + "` for `enter` or `visitors`, expected visitor or object with visitors"
2568
+ );
2569
+ }
2570
+ const is2 = convert(check2);
2571
+ const step = preorder ? 1 : -1;
2572
+ factory(tree, void 0, [])();
2573
+ function factory(node2, index2, parents) {
2574
+ const value = (
2575
+ /** @type {Record<string, unknown>} */
2576
+ node2 && typeof node2 === "object" ? node2 : {}
2577
+ );
2578
+ if (typeof value.type === "string") {
2579
+ const name = (
2580
+ // `hast`
2581
+ typeof value.tagName === "string" ? value.tagName : (
2582
+ // `xast`
2583
+ typeof value.name === "string" ? value.name : void 0
2584
+ )
2585
+ );
2586
+ Object.defineProperty(visit2, "name", {
2587
+ value: "node (" + color(node2.type + (name ? "<" + name + ">" : "")) + ")"
2588
+ });
2589
+ }
2590
+ return visit2;
2591
+ function visit2() {
2592
+ const matches = !check2 || is2(node2, index2, parents[parents.length - 1] || void 0);
2593
+ let result = empty;
2594
+ if (enter2 && matches) {
2595
+ result = toResult(enter2(node2, parents, index2));
2596
+ if (result[0] === EXIT) {
2597
+ return result;
2598
+ }
2599
+ }
2600
+ if ("children" in node2 && node2.children) {
2601
+ const nodeAsParent = (
2602
+ /** @type {UnistParent} */
2603
+ node2
2604
+ );
2605
+ if (nodeAsParent.children && result[0] !== SKIP) {
2606
+ let offset = (preorder ? -1 : nodeAsParent.children.length) + step;
2607
+ const grandparents = [...parents, nodeAsParent];
2608
+ while (offset > -1 && offset < nodeAsParent.children.length) {
2609
+ const child = nodeAsParent.children[offset];
2610
+ const subresult = factory(child, offset, grandparents)();
2611
+ if (subresult[0] === EXIT) {
2612
+ return subresult;
2613
+ }
2614
+ offset = typeof subresult[1] === "number" ? subresult[1] : offset + step;
2615
+ }
2616
+ }
2617
+ }
2618
+ if (exit4 && matches) {
2619
+ const exitResult = toResult(exit4(node2, parents, index2));
2620
+ if (exitResult[0] === SKIP) {
2621
+ throw new Error(
2622
+ "Unexpected value `" + exitResult[0] + "` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing"
2623
+ );
2624
+ }
2625
+ if (exitResult[0] === EXIT || typeof exitResult[1] === "number") {
2626
+ return exitResult;
2627
+ }
2628
+ }
2629
+ return result;
2630
+ }
2631
+ }
2632
+ }
2633
+ function toResult(value) {
2634
+ if (Array.isArray(value)) {
2635
+ return value;
2636
+ }
2637
+ if (typeof value === "number") {
2638
+ return [CONTINUE, value];
2639
+ }
2640
+ return value === null || value === void 0 ? empty : [value];
2641
+ }
2642
+
2643
+ // ../node_modules/.pnpm/mdast-util-find-and-replace@3.0.4/node_modules/mdast-util-find-and-replace/lib/index.js
2644
+ function findAndReplace(tree, list3, options) {
2645
+ const settings = options || {};
2646
+ const ignored = convert(settings.ignore || []);
2647
+ const pairs = toPairs(list3);
2648
+ let pairIndex = -1;
2649
+ while (++pairIndex < pairs.length) {
2650
+ visitParents(tree, visitor);
2651
+ }
2652
+ function visitor(node2, parents, index2) {
2653
+ if (node2.type === "text" && typeof index2 === "number") {
2654
+ return handler(node2, parents, index2);
2655
+ }
2656
+ if (ignored(node2, index2, parents[parents.length - 1])) return SKIP;
2657
+ }
2658
+ function handler(node2, parents, index2) {
2659
+ const parent = parents[parents.length - 1];
2660
+ const find = pairs[pairIndex][0];
2661
+ const replace2 = pairs[pairIndex][1];
2662
+ let start = 0;
2663
+ let change = false;
2664
+ let nodes = [];
2665
+ find.lastIndex = 0;
2666
+ let match = find.exec(node2.value);
2667
+ while (match) {
2506
2668
  const position2 = match.index;
2507
2669
  const matchObject = {
2508
2670
  index: match.index,
@@ -2556,7 +2718,13 @@ function toPairs(tupleOrList) {
2556
2718
  throw new TypeError("Expected find and replace tuple or list of tuples");
2557
2719
  }
2558
2720
  const result = [];
2559
- const list3 = !tupleOrList[0] || Array.isArray(tupleOrList[0]) ? tupleOrList : [tupleOrList];
2721
+ const list3 = !tupleOrList[0] || Array.isArray(tupleOrList[0]) ? (
2722
+ /** @type {FindAndReplaceList} */
2723
+ tupleOrList
2724
+ ) : [
2725
+ /** @type {FindAndReplaceTuple} */
2726
+ tupleOrList
2727
+ ];
2560
2728
  let index2 = -1;
2561
2729
  while (++index2 < list3.length) {
2562
2730
  const tuple = list3[index2];
@@ -3067,7 +3235,7 @@ var phrasing = (
3067
3235
  ])
3068
3236
  );
3069
3237
 
3070
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js
3238
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js
3071
3239
  function blockquote(node2, _, state, info) {
3072
3240
  const exit4 = state.enter("blockquote");
3073
3241
  const tracker = state.createTracker(info);
@@ -3084,7 +3252,7 @@ function map(line, _, blank) {
3084
3252
  return ">" + (blank ? "" : " ") + line;
3085
3253
  }
3086
3254
 
3087
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js
3255
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js
3088
3256
  function patternInScope(stack, pattern) {
3089
3257
  return listInScope(stack, pattern.inConstruct, true) && !listInScope(stack, pattern.notInConstruct, false);
3090
3258
  }
@@ -3104,7 +3272,7 @@ function listInScope(stack, list3, none) {
3104
3272
  return false;
3105
3273
  }
3106
3274
 
3107
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/break.js
3275
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/break.js
3108
3276
  function hardBreak(_, _1, state, info) {
3109
3277
  let index2 = -1;
3110
3278
  while (++index2 < state.unsafe.length) {
@@ -3140,7 +3308,7 @@ function longestStreak(value, substring) {
3140
3308
  return max;
3141
3309
  }
3142
3310
 
3143
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js
3311
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js
3144
3312
  function formatCodeAsIndented(node2, state) {
3145
3313
  return Boolean(
3146
3314
  state.options.fences === false && node2.value && // If there’s no info…
@@ -3150,7 +3318,7 @@ function formatCodeAsIndented(node2, state) {
3150
3318
  );
3151
3319
  }
3152
3320
 
3153
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-fence.js
3321
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/check-fence.js
3154
3322
  function checkFence(state) {
3155
3323
  const marker = state.options.fence || "`";
3156
3324
  if (marker !== "`" && marker !== "~") {
@@ -3161,7 +3329,7 @@ function checkFence(state) {
3161
3329
  return marker;
3162
3330
  }
3163
3331
 
3164
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/code.js
3332
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/code.js
3165
3333
  function code(node2, _, state, info) {
3166
3334
  const marker = checkFence(state);
3167
3335
  const raw = node2.value || "";
@@ -3213,7 +3381,7 @@ function map2(line, _, blank) {
3213
3381
  return (blank ? "" : " ") + line;
3214
3382
  }
3215
3383
 
3216
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-quote.js
3384
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/check-quote.js
3217
3385
  function checkQuote(state) {
3218
3386
  const marker = state.options.quote || '"';
3219
3387
  if (marker !== '"' && marker !== "'") {
@@ -3224,7 +3392,7 @@ function checkQuote(state) {
3224
3392
  return marker;
3225
3393
  }
3226
3394
 
3227
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/definition.js
3395
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/definition.js
3228
3396
  function definition(node2, _, state, info) {
3229
3397
  const quote = checkQuote(state);
3230
3398
  const suffix = quote === '"' ? "Quote" : "Apostrophe";
@@ -3280,7 +3448,7 @@ function definition(node2, _, state, info) {
3280
3448
  return value;
3281
3449
  }
3282
3450
 
3283
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js
3451
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js
3284
3452
  function checkEmphasis(state) {
3285
3453
  const marker = state.options.emphasis || "*";
3286
3454
  if (marker !== "*" && marker !== "_") {
@@ -3291,12 +3459,518 @@ function checkEmphasis(state) {
3291
3459
  return marker;
3292
3460
  }
3293
3461
 
3294
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js
3462
+ // ../node_modules/.pnpm/micromark-util-classify-character@2.0.1/node_modules/micromark-util-classify-character/index.js
3463
+ function classifyCharacter(code3) {
3464
+ if (code3 === null || markdownLineEndingOrSpace(code3) || unicodeWhitespace(code3)) {
3465
+ return 1;
3466
+ }
3467
+ if (unicodePunctuation(code3)) {
3468
+ return 2;
3469
+ }
3470
+ }
3471
+
3472
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/character.js
3473
+ function firstCharacter(value) {
3474
+ const code3 = value.codePointAt(0);
3475
+ return code3 === void 0 ? "" : String.fromCodePoint(code3);
3476
+ }
3477
+ function lastCharacter(value) {
3478
+ const code3 = value.codePointAt(value.length - 2);
3479
+ return code3 !== void 0 && code3 > 65535 ? value.slice(-2) : value.slice(-1);
3480
+ }
3481
+
3482
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js
3483
+ function encodeCharacterReference(code3) {
3484
+ return "&#x" + code3.toString(16).toUpperCase() + ";";
3485
+ }
3486
+
3487
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/encode-info.js
3488
+ function encodeInfo(outside, inside, marker) {
3489
+ const outsideKind = classifyCharacter(outside);
3490
+ const insideKind = classifyCharacter(inside);
3491
+ if (outsideKind === void 0) {
3492
+ return insideKind === void 0 ? (
3493
+ // Letter inside:
3494
+ // we have to encode *both* letters for `_` as it is looser.
3495
+ // it already forms for `*` (and GFMs `~`).
3496
+ marker === "_" ? { inside: true, outside: true } : { inside: false, outside: false }
3497
+ ) : insideKind === 1 ? (
3498
+ // Whitespace inside: encode both (letter, whitespace).
3499
+ { inside: true, outside: true }
3500
+ ) : (
3501
+ // Punctuation inside: encode outer (letter)
3502
+ { inside: false, outside: true }
3503
+ );
3504
+ }
3505
+ if (outsideKind === 1) {
3506
+ return insideKind === void 0 ? (
3507
+ // Letter inside: already forms.
3508
+ { inside: false, outside: false }
3509
+ ) : insideKind === 1 ? (
3510
+ // Whitespace inside: encode both (whitespace).
3511
+ { inside: true, outside: true }
3512
+ ) : (
3513
+ // Punctuation inside: already forms.
3514
+ { inside: false, outside: false }
3515
+ );
3516
+ }
3517
+ return insideKind === void 0 ? (
3518
+ // Letter inside: already forms.
3519
+ { inside: false, outside: false }
3520
+ ) : insideKind === 1 ? (
3521
+ // Whitespace inside: encode inner (whitespace).
3522
+ { inside: true, outside: false }
3523
+ ) : (
3524
+ // Punctuation inside: already forms.
3525
+ { inside: false, outside: false }
3526
+ );
3527
+ }
3528
+
3529
+ // ../node_modules/.pnpm/micromark-util-html-tag-name@2.0.1/node_modules/micromark-util-html-tag-name/index.js
3530
+ var htmlBlockNames = [
3531
+ "address",
3532
+ "article",
3533
+ "aside",
3534
+ "base",
3535
+ "basefont",
3536
+ "blockquote",
3537
+ "body",
3538
+ "caption",
3539
+ "center",
3540
+ "col",
3541
+ "colgroup",
3542
+ "dd",
3543
+ "details",
3544
+ "dialog",
3545
+ "dir",
3546
+ "div",
3547
+ "dl",
3548
+ "dt",
3549
+ "fieldset",
3550
+ "figcaption",
3551
+ "figure",
3552
+ "footer",
3553
+ "form",
3554
+ "frame",
3555
+ "frameset",
3556
+ "h1",
3557
+ "h2",
3558
+ "h3",
3559
+ "h4",
3560
+ "h5",
3561
+ "h6",
3562
+ "head",
3563
+ "header",
3564
+ "hr",
3565
+ "html",
3566
+ "iframe",
3567
+ "legend",
3568
+ "li",
3569
+ "link",
3570
+ "main",
3571
+ "menu",
3572
+ "menuitem",
3573
+ "nav",
3574
+ "noframes",
3575
+ "ol",
3576
+ "optgroup",
3577
+ "option",
3578
+ "p",
3579
+ "param",
3580
+ "search",
3581
+ "section",
3582
+ "summary",
3583
+ "table",
3584
+ "tbody",
3585
+ "td",
3586
+ "tfoot",
3587
+ "th",
3588
+ "thead",
3589
+ "title",
3590
+ "tr",
3591
+ "track",
3592
+ "ul"
3593
+ ];
3594
+ var htmlRawNames = ["pre", "script", "style", "textarea"];
3595
+
3596
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/html-kind.js
3597
+ function htmlKind(value) {
3598
+ if (value.charCodeAt(0) !== 60) return;
3599
+ const next = value.charCodeAt(1);
3600
+ if (next === 33) {
3601
+ const code4 = value.charCodeAt(2);
3602
+ if (code4 === 45) return 2;
3603
+ if (code4 === 91) return 5;
3604
+ if (asciiAlpha(code4)) return 4;
3605
+ return;
3606
+ }
3607
+ if (next === 63) return 3;
3608
+ const closing = next === 47;
3609
+ const start = closing ? 2 : 1;
3610
+ let end = start;
3611
+ let code3 = value.charCodeAt(end);
3612
+ if (!asciiAlpha(code3)) return;
3613
+ while (code3 === 45 || asciiAlphanumeric(code3)) {
3614
+ code3 = value.charCodeAt(++end);
3615
+ }
3616
+ const name = value.slice(start, end).toLowerCase();
3617
+ if (!closing && code3 !== 47 && htmlRawNames.includes(name)) {
3618
+ return 1;
3619
+ }
3620
+ return htmlBlockNames.includes(name) ? 6 : 7;
3621
+ }
3622
+
3623
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js
3624
+ var builtins = /* @__PURE__ */ new Map([
3625
+ ["*", false],
3626
+ ["_", true]
3627
+ ]);
3628
+ function candidates(tokens, involved, runOf) {
3629
+ const related = /* @__PURE__ */ new Set();
3630
+ for (const token of tokens) {
3631
+ const siblings = runOf.get(token);
3632
+ if (siblings && token.attention && involved.some((d) => d.attention === token.attention)) {
3633
+ for (const sibling of siblings.tokens) {
3634
+ related.add(sibling.attention);
3635
+ }
3636
+ }
3637
+ }
3638
+ const ordered = [];
3639
+ for (const token of tokens) {
3640
+ if (token.attention && related.delete(token.attention)) {
3641
+ ordered.push(token.attention);
3642
+ }
3643
+ }
3644
+ ordered.reverse();
3645
+ return ordered;
3646
+ }
3647
+ function check(tokens, before, after) {
3648
+ const runs = [];
3649
+ const wrong = /* @__PURE__ */ new Map();
3650
+ const runOf = /* @__PURE__ */ new Map();
3651
+ let index2 = 0;
3652
+ while (index2 < tokens.length) {
3653
+ if (!tokens[index2].attention) {
3654
+ index2++;
3655
+ continue;
3656
+ }
3657
+ const marker = tokens[index2].value.charAt(0);
3658
+ const strict = builtins.get(marker);
3659
+ let end = index2 + 1;
3660
+ while (end < tokens.length && tokens[end].attention && tokens[end].value.charAt(0) === marker) {
3661
+ end++;
3662
+ }
3663
+ const head = index2 ? tokens[index2 - 1].value : before;
3664
+ const previous4 = classifyCharacter(head.charCodeAt(head.length - 1));
3665
+ const next = classifyCharacter(
3666
+ (end < tokens.length ? tokens[end].value : after).charCodeAt(0)
3667
+ );
3668
+ const open = !next || next === 2 && Boolean(previous4);
3669
+ const close = !previous4 || previous4 === 2 && Boolean(next);
3670
+ const run = {
3671
+ tokens: tokens.slice(index2, end),
3672
+ markers: [],
3673
+ start: 0,
3674
+ end: 0,
3675
+ // Underscores are strict, they cannot open or close inside words.
3676
+ open: strict ? open && (Boolean(previous4) || !close) : open,
3677
+ close: strict ? close && (Boolean(next) || !open) : close,
3678
+ // All builtins can split runs.
3679
+ split: strict !== void 0
3680
+ };
3681
+ for (const token of run.tokens) {
3682
+ wrong.set(token, [...run.tokens]);
3683
+ runOf.set(token, run);
3684
+ let size = token.value.length;
3685
+ while (size--) run.markers.push(token);
3686
+ }
3687
+ run.end = run.markers.length;
3688
+ runs.push(run);
3689
+ index2 = end;
3690
+ }
3691
+ pair(runs, wrong);
3692
+ index2 = -1;
3693
+ while (++index2 < tokens.length) {
3694
+ const involved = wrong.get(tokens[index2]);
3695
+ if (involved) return { attention: candidates(tokens, involved, runOf), index: index2 };
3696
+ }
3697
+ }
3698
+ function encode2(tokens, start) {
3699
+ const token = tokens[start ? 0 : tokens.length - 1];
3700
+ if (!token || token.attention) return;
3701
+ const character = start ? firstCharacter(token.value) : lastCharacter(token.value);
3702
+ const reference = encodeCharacterReference(
3703
+ /** @type {number} */
3704
+ character.codePointAt(0)
3705
+ );
3706
+ if (start) {
3707
+ token.value = reference + token.value.slice(character.length);
3708
+ } else {
3709
+ let value = token.value.slice(0, token.value.length - character.length);
3710
+ let escapes = 0;
3711
+ while (value.charCodeAt(value.length - 1 - escapes) === 92) {
3712
+ escapes++;
3713
+ }
3714
+ if (escapes % 2) value += "\\";
3715
+ token.value = value + reference;
3716
+ }
3717
+ }
3718
+ function improve(items, chosen, mistake, before, after) {
3719
+ for (const attention4 of mistake.attention) {
3720
+ const current = chosen.get(attention4) || attention4.sequences[0];
3721
+ for (const sequence of attention4.sequences) {
3722
+ if (sequence === current) continue;
3723
+ const trial = new Map(chosen);
3724
+ trial.set(attention4, sequence);
3725
+ const tokens = render(items, trial, before, after);
3726
+ const next = check(tokens, before, after);
3727
+ if (!next || next.index > mistake.index) {
3728
+ return { chosen: trial, mistake: next, tokens };
3729
+ }
3730
+ }
3731
+ }
3732
+ }
3733
+ function pair(runs, wrong) {
3734
+ const openersByMarker = /* @__PURE__ */ new Map();
3735
+ for (const closer of runs) {
3736
+ const marker = closer.tokens[0].value.charAt(0);
3737
+ let openers = openersByMarker.get(marker);
3738
+ if (!openers) {
3739
+ openers = [];
3740
+ openersByMarker.set(marker, openers);
3741
+ }
3742
+ let open = closer.close ? openers.length : 0;
3743
+ while (open-- && closer.start < closer.end) {
3744
+ const opener = openers[open];
3745
+ const openerSize = opener.end - opener.start;
3746
+ const closerSize = closer.end - closer.start;
3747
+ if (closer.split ? (
3748
+ // The rule of 3, on the sizes that are left.
3749
+ (opener.close || closer.open) && closerSize % 3 && !((openerSize + closerSize) % 3)
3750
+ ) : (
3751
+ // Others pair whole runs of the same size.
3752
+ openerSize !== opener.markers.length || openerSize !== closerSize
3753
+ )) {
3754
+ continue;
3755
+ }
3756
+ const size = closer.split ? openerSize > 1 && closerSize > 1 ? 2 : 1 : closerSize;
3757
+ const opening = opener.markers.slice(opener.end - size, opener.end);
3758
+ const closing = closer.markers.slice(closer.start, closer.start + size);
3759
+ const openToken = opening[0];
3760
+ const closeToken = closing[0];
3761
+ if (
3762
+ // Whole sequences:
3763
+ // the markers of a sequence are next to each other,
3764
+ // so if the first and last marker are of one sequence of that size,
3765
+ // all markers are exactly that sequence.
3766
+ openToken === opening[size - 1] && openToken.value.length === size && closeToken === closing[size - 1] && closeToken.value.length === size && // Of the same attention, so its opening and closing sequence.
3767
+ openToken.attention === closeToken.attention
3768
+ ) {
3769
+ wrong.delete(openToken);
3770
+ wrong.delete(closeToken);
3771
+ } else {
3772
+ const involved = [.../* @__PURE__ */ new Set([...opening, ...closing])];
3773
+ for (const token of involved) {
3774
+ const list3 = wrong.get(token);
3775
+ if (list3) list3.push(...involved);
3776
+ }
3777
+ }
3778
+ opener.end -= size;
3779
+ closer.start += size;
3780
+ if (opener.start === opener.end) openers.splice(open, 1);
3781
+ open = openers.length;
3782
+ }
3783
+ if (closer.open && closer.start < closer.end) openers.push(closer);
3784
+ }
3785
+ }
3786
+ function attentionSequences(type, markers, sizes) {
3787
+ if (markers.length === 0) {
3788
+ throw new Error(
3789
+ "Cannot serialize `" + type + "` as attention without markers, expected one or more markers"
3790
+ );
3791
+ }
3792
+ if (sizes.length === 0) {
3793
+ throw new Error(
3794
+ "Cannot serialize `" + type + "` as attention without sizes, expected one or more sizes"
3795
+ );
3796
+ }
3797
+ for (const size of sizes) {
3798
+ if (!Number.isSafeInteger(size) || size < 1) {
3799
+ throw new Error(
3800
+ "Cannot serialize `" + type + "` as attention with `" + size + "` as size, expected positive integer"
3801
+ );
3802
+ }
3803
+ }
3804
+ const sequences = [];
3805
+ for (const marker of markers) {
3806
+ if (marker.length !== 1) {
3807
+ throw new Error(
3808
+ "Cannot serialize `" + type + "` as attention with `" + marker + "` as marker, expected a single ascii character"
3809
+ );
3810
+ }
3811
+ if (!asciiPunctuation(marker.charCodeAt(0))) {
3812
+ throw new Error(
3813
+ "Cannot serialize `" + type + "` as attention with `" + marker + "` as marker, expected ascii punctuation"
3814
+ );
3815
+ }
3816
+ for (const size of sizes) {
3817
+ sequences.push(marker.repeat(size));
3818
+ }
3819
+ }
3820
+ return sequences;
3821
+ }
3822
+ function phrasing2(parent, state, info) {
3823
+ const indexStack = state.indexStack;
3824
+ const children = parent.children || [];
3825
+ const results = [];
3826
+ let index2 = -1;
3827
+ let before = info.before;
3828
+ indexStack.push(-1);
3829
+ let tracker = state.createTracker(info);
3830
+ while (++index2 < children.length) {
3831
+ const child = children[index2];
3832
+ let after;
3833
+ indexStack[indexStack.length - 1] = index2;
3834
+ if (index2 + 1 < children.length) {
3835
+ let handle3 = state.handle.handlers[children[index2 + 1].type];
3836
+ if (handle3 && handle3.peek) handle3 = handle3.peek;
3837
+ after = handle3 ? firstCharacter(
3838
+ handle3(children[index2 + 1], parent, state, {
3839
+ before: "",
3840
+ after: "",
3841
+ ...tracker.current()
3842
+ })
3843
+ ) : "";
3844
+ } else {
3845
+ after = info.after;
3846
+ }
3847
+ const previous4 = results[results.length - 1];
3848
+ if (typeof previous4 === "string" && (before === "\r" || before === "\n") && child.type === "html" && htmlKind(child.value) !== 7) {
3849
+ results[results.length - 1] = previous4.replace(/(\r?\n|\r)$/, " ");
3850
+ before = " ";
3851
+ tracker = state.createTracker(info);
3852
+ tracker.move(serialize2(results, info.before, info.after));
3853
+ }
3854
+ const handle2 = state.handle.handlers[child.type];
3855
+ if (handle2 && handle2.attention) {
3856
+ const item = attentionItem(
3857
+ /** @type {PhrasingParents} */
3858
+ child,
3859
+ handle2.attention,
3860
+ state,
3861
+ tracker
3862
+ );
3863
+ results.push(item);
3864
+ before = lastCharacter(item.sequences[0]);
3865
+ } else {
3866
+ const value = state.handle(child, parent, state, {
3867
+ ...tracker.current(),
3868
+ after,
3869
+ before
3870
+ });
3871
+ if (!value) continue;
3872
+ tracker.move(value);
3873
+ results.push(value);
3874
+ before = lastCharacter(value);
3875
+ }
3876
+ }
3877
+ indexStack.pop();
3878
+ return results;
3879
+ }
3880
+ function attentionItem(node2, attention4, state, tracker) {
3881
+ const { construct, markers, sizes } = attention4(node2, state);
3882
+ const sequences = attentionSequences(node2.type, markers, sizes);
3883
+ const sequence = sequences[0];
3884
+ const exit4 = state.enter(construct);
3885
+ tracker.move(sequence);
3886
+ const children = phrasing2(node2, state, {
3887
+ ...tracker.current(),
3888
+ before: sequence,
3889
+ after: sequence
3890
+ });
3891
+ tracker.move(serialize2(children, sequence, sequence));
3892
+ tracker.move(sequence);
3893
+ exit4();
3894
+ return { children, sequences };
3895
+ }
3896
+ function render(items, chosen, before, after) {
3897
+ const tokens = [];
3898
+ let encodeAfter;
3899
+ let previous4 = lastCharacter(before);
3900
+ let index2 = -1;
3901
+ while (++index2 < items.length) {
3902
+ const item = items[index2];
3903
+ if (typeof item === "string") {
3904
+ const token = { value: item, attention: void 0 };
3905
+ if (encodeAfter && encodeAfter === firstCharacter(item)) {
3906
+ encode2([token], true);
3907
+ }
3908
+ encodeAfter = void 0;
3909
+ tokens.push(token);
3910
+ if (token.value) previous4 = lastCharacter(token.value);
3911
+ continue;
3912
+ }
3913
+ const sequence = chosen.get(item) || item.sequences[0];
3914
+ const marker = sequence.charAt(0);
3915
+ const next = items[index2 + 1];
3916
+ const outsideBefore = previous4;
3917
+ const outsideAfter = firstCharacter(
3918
+ next === void 0 ? after : typeof next === "string" ? next : chosen.get(next) || next.sequences[0]
3919
+ );
3920
+ const inside = render(item.children, chosen, sequence, sequence);
3921
+ const head = inside.length > 0 ? inside[0].value : "";
3922
+ const open = encodeInfo(
3923
+ outsideBefore.charCodeAt(outsideBefore.length - 1),
3924
+ head.charCodeAt(0),
3925
+ marker
3926
+ );
3927
+ if (open.inside) encode2(inside, true);
3928
+ const tail = inside.length > 0 ? lastCharacter(inside[inside.length - 1].value) : "";
3929
+ const close = encodeInfo(
3930
+ outsideAfter.charCodeAt(0),
3931
+ tail.charCodeAt(tail.length - 1),
3932
+ marker
3933
+ );
3934
+ if (close.inside) encode2(inside, false);
3935
+ if (open.outside && outsideBefore !== "\n" && outsideBefore !== "\r") {
3936
+ encode2(tokens, false);
3937
+ }
3938
+ if (close.outside) encodeAfter = outsideAfter;
3939
+ tokens.push({ value: sequence, attention: item }, ...inside, {
3940
+ value: sequence,
3941
+ attention: item
3942
+ });
3943
+ previous4 = sequence.charAt(sequence.length - 1);
3944
+ }
3945
+ return tokens;
3946
+ }
3947
+ function serialize2(items, before, after) {
3948
+ let chosen = /* @__PURE__ */ new Map();
3949
+ const initial = render(items, chosen, before, after);
3950
+ let tokens = initial;
3951
+ let mistake = check(tokens, before, after);
3952
+ while (mistake) {
3953
+ const next = improve(items, chosen, mistake, before, after);
3954
+ if (!next) {
3955
+ tokens = initial;
3956
+ break;
3957
+ }
3958
+ chosen = next.chosen;
3959
+ tokens = next.tokens;
3960
+ mistake = next.mistake;
3961
+ }
3962
+ let result = "";
3963
+ for (const token of tokens) result += token.value;
3964
+ return result;
3965
+ }
3966
+
3967
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js
3295
3968
  emphasis.attention = attention;
3296
3969
  emphasis.peek = peek;
3297
3970
  function emphasis(node2, _, state, info) {
3298
3971
  const exit4 = state.enter("phrasing");
3299
- const value = state.containerPhrasing({ type: "root", children: [node2] }, info);
3972
+ const item = attentionItem(node2, attention, state, state.createTracker(info));
3973
+ const value = serialize2([item], info.before, info.after);
3300
3974
  exit4();
3301
3975
  return value;
3302
3976
  }
@@ -3312,30 +3986,38 @@ function peek(_, _1, state) {
3312
3986
  return state.options.emphasis || "*";
3313
3987
  }
3314
3988
 
3315
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js
3316
- function encodeCharacterReference(code3) {
3317
- return "&#x" + code3.toString(16).toUpperCase() + ";";
3318
- }
3319
-
3320
- // ../node_modules/.pnpm/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.js
3321
- function visit(tree, testOrVisitor, visitorOrReverse, maybeReverse) {
3989
+ // ../node_modules/.pnpm/unist-util-visit@5.2.0/node_modules/unist-util-visit/lib/index.js
3990
+ function visit(tree, testOrEnterOrVisitors, enterOrVisitorsOrReverse, maybeReverse) {
3991
+ let check2;
3992
+ let visitors;
3322
3993
  let reverse;
3323
- let test;
3324
- let visitor;
3325
- if (typeof testOrVisitor === "function" && typeof visitorOrReverse !== "function") {
3326
- test = void 0;
3327
- visitor = testOrVisitor;
3328
- reverse = visitorOrReverse;
3329
- } else {
3330
- test = testOrVisitor;
3331
- visitor = visitorOrReverse;
3994
+ if (typeof enterOrVisitorsOrReverse === "function" || enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === "object") {
3995
+ check2 = /** @type {Test} */
3996
+ testOrEnterOrVisitors;
3997
+ visitors = enterOrVisitorsOrReverse;
3332
3998
  reverse = maybeReverse;
3999
+ } else {
4000
+ visitors = /** @type {Visitor | Visitors} */
4001
+ testOrEnterOrVisitors;
4002
+ reverse = enterOrVisitorsOrReverse;
3333
4003
  }
3334
- visitParents(tree, test, overload, reverse);
3335
- function overload(node2, parents) {
3336
- const parent = parents[parents.length - 1];
3337
- const index2 = parent ? parent.children.indexOf(node2) : void 0;
3338
- return visitor(node2, index2, parent);
4004
+ if (typeof visitors === "function") {
4005
+ visitParents(tree, check2, wrap(visitors), reverse);
4006
+ } else {
4007
+ visitParents(tree, check2, wrapVisitors(visitors), reverse);
4008
+ }
4009
+ }
4010
+ function wrapVisitors(visitors) {
4011
+ if (!visitors || typeof visitors !== "object") return visitors;
4012
+ return {
4013
+ enter: typeof visitors.enter === "function" ? wrap(visitors.enter) : visitors.enter,
4014
+ exit: typeof visitors.exit === "function" ? wrap(visitors.exit) : visitors.exit
4015
+ };
4016
+ }
4017
+ function wrap(visitor) {
4018
+ return overload;
4019
+ function overload(node2, parents, index2) {
4020
+ return visitor(node2, index2, parents[parents.length - 1]);
3339
4021
  }
3340
4022
  }
3341
4023
 
@@ -3376,7 +4058,7 @@ function node(value) {
3376
4058
  return Boolean(value && typeof value === "object");
3377
4059
  }
3378
4060
 
3379
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js
4061
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js
3380
4062
  function formatHeadingAsSetext(node2, state) {
3381
4063
  let literalWithBreak = false;
3382
4064
  visit(node2, function(node3) {
@@ -3390,7 +4072,7 @@ function formatHeadingAsSetext(node2, state) {
3390
4072
  );
3391
4073
  }
3392
4074
 
3393
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/heading.js
4075
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/heading.js
3394
4076
  function heading(node2, _, state, info) {
3395
4077
  const rank = Math.max(Math.min(6, node2.depth || 1), 1);
3396
4078
  const tracker = state.createTracker(info);
@@ -3433,7 +4115,7 @@ function heading(node2, _, state, info) {
3433
4115
  return value;
3434
4116
  }
3435
4117
 
3436
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/html.js
4118
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/html.js
3437
4119
  html.peek = htmlPeek;
3438
4120
  function html(node2) {
3439
4121
  return node2.value || "";
@@ -3442,7 +4124,7 @@ function htmlPeek() {
3442
4124
  return "<";
3443
4125
  }
3444
4126
 
3445
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/image.js
4127
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/image.js
3446
4128
  image.peek = imagePeek;
3447
4129
  function image(node2, _, state, info) {
3448
4130
  const quote = checkQuote(state);
@@ -3499,7 +4181,7 @@ function imagePeek() {
3499
4181
  return "!";
3500
4182
  }
3501
4183
 
3502
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js
4184
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js
3503
4185
  imageReference.peek = imageReferencePeek;
3504
4186
  function imageReference(node2, _, state, info) {
3505
4187
  const type = node2.referenceType;
@@ -3540,7 +4222,7 @@ function imageReferencePeek() {
3540
4222
  return "!";
3541
4223
  }
3542
4224
 
3543
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js
4225
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js
3544
4226
  inlineCode.peek = inlineCodePeek;
3545
4227
  function inlineCode(node2, _, state) {
3546
4228
  let value = node2.value || "";
@@ -3571,7 +4253,7 @@ function inlineCodePeek() {
3571
4253
  return "`";
3572
4254
  }
3573
4255
 
3574
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js
4256
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js
3575
4257
  function formatLinkAsAutolink(node2, state) {
3576
4258
  const raw = toString(node2);
3577
4259
  return Boolean(
@@ -3586,7 +4268,7 @@ function formatLinkAsAutolink(node2, state) {
3586
4268
  );
3587
4269
  }
3588
4270
 
3589
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/link.js
4271
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/link.js
3590
4272
  link.peek = linkPeek;
3591
4273
  function link(node2, _, state, info) {
3592
4274
  const quote = checkQuote(state);
@@ -3614,19 +4296,28 @@ function link(node2, _, state, info) {
3614
4296
  const exit4 = state.enter("link");
3615
4297
  let subexit = state.enter("label");
3616
4298
  let value = tracker.move("[");
3617
- value += tracker.move(
3618
- state.containerPhrasing(node2, {
3619
- before: value,
3620
- after: "](",
3621
- ...tracker.current()
3622
- })
3623
- );
3624
- value += tracker.move("](");
4299
+ const text5 = state.containerPhrasing(node2, {
4300
+ before: value,
4301
+ after: "](",
4302
+ ...tracker.current()
4303
+ });
4304
+ value += tracker.move(text5);
3625
4305
  subexit();
4306
+ value += tracker.move("](");
4307
+ const enclose = /[\0- \u007F]/.test(node2.url);
4308
+ const last = info.before.charAt(info.before.length - 1);
4309
+ let title = node2.title || void 0;
4310
+ if (!title && !enclose && (last === "\n" || last === "\r")) {
4311
+ let index2 = 0;
4312
+ while (index2 < text5.length && text5.charCodeAt(index2) !== 93) {
4313
+ index2 += text5.charCodeAt(index2) === 92 ? 2 : 1;
4314
+ }
4315
+ if (text5.charCodeAt(index2 + 1) === 58) title = "";
4316
+ }
3626
4317
  if (
3627
4318
  // If there’s no url but there is a title…
3628
- !node2.url && node2.title || // If there are control characters or whitespace.
3629
- /[\0- \u007F]/.test(node2.url)
4319
+ !node2.url && typeof title === "string" || // If there are control characters or whitespace.
4320
+ enclose
3630
4321
  ) {
3631
4322
  subexit = state.enter("destinationLiteral");
3632
4323
  value += tracker.move("<");
@@ -3639,17 +4330,17 @@ function link(node2, _, state, info) {
3639
4330
  value += tracker.move(
3640
4331
  state.safe(node2.url, {
3641
4332
  before: value,
3642
- after: node2.title ? " " : ")",
4333
+ after: typeof title === "string" ? " " : ")",
3643
4334
  ...tracker.current()
3644
4335
  })
3645
4336
  );
3646
4337
  }
3647
4338
  subexit();
3648
- if (node2.title) {
4339
+ if (typeof title === "string") {
3649
4340
  subexit = state.enter(`title${suffix}`);
3650
4341
  value += tracker.move(" " + quote);
3651
4342
  value += tracker.move(
3652
- state.safe(node2.title, {
4343
+ state.safe(title, {
3653
4344
  before: value,
3654
4345
  after: quote,
3655
4346
  ...tracker.current()
@@ -3666,7 +4357,7 @@ function linkPeek(node2, _, state) {
3666
4357
  return formatLinkAsAutolink(node2, state) ? "<" : "[";
3667
4358
  }
3668
4359
 
3669
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js
4360
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js
3670
4361
  linkReference.peek = linkReferencePeek;
3671
4362
  function linkReference(node2, _, state, info) {
3672
4363
  const type = node2.referenceType;
@@ -3707,7 +4398,7 @@ function linkReferencePeek() {
3707
4398
  return "[";
3708
4399
  }
3709
4400
 
3710
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js
4401
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js
3711
4402
  function checkBullet(state) {
3712
4403
  const marker = state.options.bullet || "*";
3713
4404
  if (marker !== "*" && marker !== "+" && marker !== "-") {
@@ -3718,7 +4409,7 @@ function checkBullet(state) {
3718
4409
  return marker;
3719
4410
  }
3720
4411
 
3721
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js
4412
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js
3722
4413
  function checkBulletOther(state) {
3723
4414
  const bullet = checkBullet(state);
3724
4415
  const bulletOther = state.options.bulletOther;
@@ -3738,7 +4429,7 @@ function checkBulletOther(state) {
3738
4429
  return bulletOther;
3739
4430
  }
3740
4431
 
3741
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js
4432
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js
3742
4433
  function checkBulletOrdered(state) {
3743
4434
  const marker = state.options.bulletOrdered || ".";
3744
4435
  if (marker !== "." && marker !== ")") {
@@ -3749,7 +4440,7 @@ function checkBulletOrdered(state) {
3749
4440
  return marker;
3750
4441
  }
3751
4442
 
3752
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-rule.js
4443
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/check-rule.js
3753
4444
  function checkRule(state) {
3754
4445
  const marker = state.options.rule || "*";
3755
4446
  if (marker !== "*" && marker !== "-" && marker !== "_") {
@@ -3760,7 +4451,7 @@ function checkRule(state) {
3760
4451
  return marker;
3761
4452
  }
3762
4453
 
3763
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/list.js
4454
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/list.js
3764
4455
  function list(node2, parent, state, info) {
3765
4456
  const exit4 = state.enter("list");
3766
4457
  const bulletCurrent = state.bulletCurrent;
@@ -3800,7 +4491,7 @@ function list(node2, parent, state, info) {
3800
4491
  return value;
3801
4492
  }
3802
4493
 
3803
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js
4494
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js
3804
4495
  function checkListItemIndent(state) {
3805
4496
  const style = state.options.listItemIndent || "one";
3806
4497
  if (style !== "tab" && style !== "one" && style !== "mixed") {
@@ -3811,7 +4502,7 @@ function checkListItemIndent(state) {
3811
4502
  return style;
3812
4503
  }
3813
4504
 
3814
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/list-item.js
4505
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/list-item.js
3815
4506
  function listItem(node2, parent, state, info) {
3816
4507
  const listItemIndent = checkListItemIndent(state);
3817
4508
  let bullet = state.bulletCurrent || checkBullet(state);
@@ -3840,7 +4531,7 @@ function listItem(node2, parent, state, info) {
3840
4531
  }
3841
4532
  }
3842
4533
 
3843
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js
4534
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js
3844
4535
  function paragraph(node2, _, state, info) {
3845
4536
  const exit4 = state.enter("paragraph");
3846
4537
  const subexit = state.enter("phrasing");
@@ -3850,7 +4541,7 @@ function paragraph(node2, _, state, info) {
3850
4541
  return value;
3851
4542
  }
3852
4543
 
3853
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/root.js
4544
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/root.js
3854
4545
  function root(node2, _, state, info) {
3855
4546
  const hasPhrasing = node2.children.some(function(d) {
3856
4547
  return phrasing(d);
@@ -3862,7 +4553,7 @@ function root(node2, _, state, info) {
3862
4553
  return value;
3863
4554
  }
3864
4555
 
3865
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-strong.js
4556
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/check-strong.js
3866
4557
  function checkStrong(state) {
3867
4558
  const marker = state.options.strong || "*";
3868
4559
  if (marker !== "*" && marker !== "_") {
@@ -3873,12 +4564,13 @@ function checkStrong(state) {
3873
4564
  return marker;
3874
4565
  }
3875
4566
 
3876
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/strong.js
4567
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/strong.js
3877
4568
  strong.attention = attention2;
3878
4569
  strong.peek = peek2;
3879
4570
  function strong(node2, _, state, info) {
3880
4571
  const exit4 = state.enter("phrasing");
3881
- const value = state.containerPhrasing({ type: "root", children: [node2] }, info);
4572
+ const item = attentionItem(node2, attention2, state, state.createTracker(info));
4573
+ const value = serialize2([item], info.before, info.after);
3882
4574
  exit4();
3883
4575
  return value;
3884
4576
  }
@@ -3894,10 +4586,10 @@ function peek2(_, _1, state) {
3894
4586
  return state.options.strong || "*";
3895
4587
  }
3896
4588
 
3897
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/text.js
4589
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/text.js
3898
4590
  function text(node2, parent, state, info) {
3899
4591
  const siblings = parent ? parent.children : [];
3900
- const index2 = siblings.indexOf(node2);
4592
+ const index2 = state.indexStack[state.indexStack.length - 1];
3901
4593
  return state.safe(node2.value, {
3902
4594
  ...info,
3903
4595
  afterNode: siblings[index2 + 1],
@@ -3905,7 +4597,7 @@ function text(node2, parent, state, info) {
3905
4597
  });
3906
4598
  }
3907
4599
 
3908
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js
4600
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js
3909
4601
  function checkRuleRepetition(state) {
3910
4602
  const repetition = state.options.ruleRepetition || 3;
3911
4603
  if (repetition < 3) {
@@ -3916,13 +4608,13 @@ function checkRuleRepetition(state) {
3916
4608
  return repetition;
3917
4609
  }
3918
4610
 
3919
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js
4611
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js
3920
4612
  function thematicBreak(_, _1, state) {
3921
4613
  const value = (checkRule(state) + (state.options.ruleSpaces ? " " : "")).repeat(checkRuleRepetition(state));
3922
4614
  return state.options.ruleSpaces ? value.slice(0, -1) : value;
3923
4615
  }
3924
4616
 
3925
- // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.0/node_modules/mdast-util-to-markdown/lib/handle/index.js
4617
+ // ../node_modules/.pnpm/mdast-util-to-markdown@2.2.1/node_modules/mdast-util-to-markdown/lib/handle/index.js
3926
4618
  var handle = {
3927
4619
  blockquote,
3928
4620
  break: hardBreak,
@@ -3946,73 +4638,6 @@ var handle = {
3946
4638
  thematicBreak
3947
4639
  };
3948
4640
 
3949
- // ../node_modules/.pnpm/micromark-util-html-tag-name@2.0.1/node_modules/micromark-util-html-tag-name/index.js
3950
- var htmlBlockNames = [
3951
- "address",
3952
- "article",
3953
- "aside",
3954
- "base",
3955
- "basefont",
3956
- "blockquote",
3957
- "body",
3958
- "caption",
3959
- "center",
3960
- "col",
3961
- "colgroup",
3962
- "dd",
3963
- "details",
3964
- "dialog",
3965
- "dir",
3966
- "div",
3967
- "dl",
3968
- "dt",
3969
- "fieldset",
3970
- "figcaption",
3971
- "figure",
3972
- "footer",
3973
- "form",
3974
- "frame",
3975
- "frameset",
3976
- "h1",
3977
- "h2",
3978
- "h3",
3979
- "h4",
3980
- "h5",
3981
- "h6",
3982
- "head",
3983
- "header",
3984
- "hr",
3985
- "html",
3986
- "iframe",
3987
- "legend",
3988
- "li",
3989
- "link",
3990
- "main",
3991
- "menu",
3992
- "menuitem",
3993
- "nav",
3994
- "noframes",
3995
- "ol",
3996
- "optgroup",
3997
- "option",
3998
- "p",
3999
- "param",
4000
- "search",
4001
- "section",
4002
- "summary",
4003
- "table",
4004
- "tbody",
4005
- "td",
4006
- "tfoot",
4007
- "th",
4008
- "thead",
4009
- "title",
4010
- "tr",
4011
- "track",
4012
- "ul"
4013
- ];
4014
- var htmlRawNames = ["pre", "script", "style", "textarea"];
4015
-
4016
4641
  // ../node_modules/.pnpm/micromark-util-decode-numeric-character-reference@2.0.2/node_modules/micromark-util-decode-numeric-character-reference/index.js
4017
4642
  function decodeNumericCharacterReference(value, base) {
4018
4643
  const code3 = Number.parseInt(value, base);
@@ -4049,16 +4674,6 @@ function decode($0, $1, $2) {
4049
4674
  return decodeNamedCharacterReference($2) || $0;
4050
4675
  }
4051
4676
 
4052
- // ../node_modules/.pnpm/micromark-util-classify-character@2.0.1/node_modules/micromark-util-classify-character/index.js
4053
- function classifyCharacter(code3) {
4054
- if (code3 === null || markdownLineEndingOrSpace(code3) || unicodeWhitespace(code3)) {
4055
- return 1;
4056
- }
4057
- if (unicodePunctuation(code3)) {
4058
- return 2;
4059
- }
4060
- }
4061
-
4062
4677
  // ../node_modules/.pnpm/mdast-util-gfm-table@2.0.0/node_modules/mdast-util-gfm-table/lib/index.js
4063
4678
  function gfmTableFromMarkdown() {
4064
4679
  return {
@@ -4277,10 +4892,10 @@ function listItemWithTaskListItem(node2, parent, state, info) {
4277
4892
  ...tracker.current()
4278
4893
  });
4279
4894
  if (checkable) {
4280
- value = value.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/, check);
4895
+ value = value.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/, check2);
4281
4896
  }
4282
4897
  return value;
4283
- function check($0) {
4898
+ function check2($0) {
4284
4899
  return $0 + checkbox;
4285
4900
  }
4286
4901
  }
@@ -4854,10 +5469,10 @@ function tokenizeAttention(effects, ok3) {
4854
5469
  return ok3(code3);
4855
5470
  }
4856
5471
  }
4857
- function movePoint(point3, offset) {
4858
- point3.column += offset;
4859
- point3.offset += offset;
4860
- point3._bufferIndex += offset;
5472
+ function movePoint(point4, offset) {
5473
+ point4.column += offset;
5474
+ point4.offset += offset;
5475
+ point4._bufferIndex += offset;
4861
5476
  }
4862
5477
 
4863
5478
  // ../node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/autolink.js
@@ -8700,10 +9315,10 @@ function initializeDocument(effects) {
8700
9315
  }
8701
9316
  const indexBeforeExits = self.events.length;
8702
9317
  let indexBeforeFlow = indexBeforeExits;
8703
- let point3;
9318
+ let point4;
8704
9319
  while (indexBeforeFlow--) {
8705
9320
  if (self.events[indexBeforeFlow][0] === "exit" && self.events[indexBeforeFlow][1].type === "chunkFlow") {
8706
- point3 = self.events[indexBeforeFlow][1].end;
9321
+ point4 = self.events[indexBeforeFlow][1].end;
8707
9322
  break;
8708
9323
  }
8709
9324
  }
@@ -8711,7 +9326,7 @@ function initializeDocument(effects) {
8711
9326
  let index2 = indexBeforeExits;
8712
9327
  while (index2 < self.events.length) {
8713
9328
  self.events[index2][1].end = {
8714
- ...point3
9329
+ ...point4
8715
9330
  };
8716
9331
  index2++;
8717
9332
  }
@@ -8818,11 +9433,11 @@ function initializeDocument(effects) {
8818
9433
  const indexBeforeExits = self.events.length;
8819
9434
  let indexBeforeFlow = indexBeforeExits;
8820
9435
  let seen;
8821
- let point3;
9436
+ let point4;
8822
9437
  while (indexBeforeFlow--) {
8823
9438
  if (self.events[indexBeforeFlow][0] === "exit" && self.events[indexBeforeFlow][1].type === "chunkFlow") {
8824
9439
  if (seen) {
8825
- point3 = self.events[indexBeforeFlow][1].end;
9440
+ point4 = self.events[indexBeforeFlow][1].end;
8826
9441
  break;
8827
9442
  }
8828
9443
  seen = true;
@@ -8832,7 +9447,7 @@ function initializeDocument(effects) {
8832
9447
  index2 = indexBeforeExits;
8833
9448
  while (index2 < self.events.length) {
8834
9449
  self.events[index2][1].end = {
8835
- ...point3
9450
+ ...point4
8836
9451
  };
8837
9452
  index2++;
8838
9453
  }
@@ -9119,7 +9734,7 @@ var disable = {
9119
9734
 
9120
9735
  // ../node_modules/.pnpm/micromark@4.0.3/node_modules/micromark/lib/create-tokenizer.js
9121
9736
  function createTokenizer(parser, initialize, from) {
9122
- let point3 = {
9737
+ let point4 = {
9123
9738
  _bufferIndex: -1,
9124
9739
  _index: 0,
9125
9740
  line: from && from.line || 1,
@@ -9182,7 +9797,7 @@ function createTokenizer(parser, initialize, from) {
9182
9797
  line,
9183
9798
  column,
9184
9799
  offset
9185
- } = point3;
9800
+ } = point4;
9186
9801
  return {
9187
9802
  _bufferIndex,
9188
9803
  _index,
@@ -9196,15 +9811,15 @@ function createTokenizer(parser, initialize, from) {
9196
9811
  accountForPotentialSkip();
9197
9812
  }
9198
9813
  function main() {
9199
- while (point3._index < chunks.length) {
9200
- const chunk = chunks[point3._index];
9814
+ while (point4._index < chunks.length) {
9815
+ const chunk = chunks[point4._index];
9201
9816
  if (typeof chunk === "string") {
9202
- const chunkIndex = point3._index;
9203
- if (point3._bufferIndex < 0) {
9204
- point3._bufferIndex = 0;
9817
+ const chunkIndex = point4._index;
9818
+ if (point4._bufferIndex < 0) {
9819
+ point4._bufferIndex = 0;
9205
9820
  }
9206
- while (point3._index === chunkIndex && point3._bufferIndex < chunk.length) {
9207
- go(chunk.charCodeAt(point3._bufferIndex));
9821
+ while (point4._index === chunkIndex && point4._bufferIndex < chunk.length) {
9822
+ go(chunk.charCodeAt(point4._bufferIndex));
9208
9823
  }
9209
9824
  } else {
9210
9825
  go(chunk);
@@ -9218,24 +9833,24 @@ function createTokenizer(parser, initialize, from) {
9218
9833
  }
9219
9834
  function consume(code3) {
9220
9835
  if (markdownLineEnding(code3)) {
9221
- point3.line++;
9222
- point3.column = 1;
9223
- point3.offset += code3 === -3 ? 2 : 1;
9836
+ point4.line++;
9837
+ point4.column = 1;
9838
+ point4.offset += code3 === -3 ? 2 : 1;
9224
9839
  accountForPotentialSkip();
9225
9840
  } else if (code3 !== -1) {
9226
- point3.column++;
9227
- point3.offset++;
9841
+ point4.column++;
9842
+ point4.offset++;
9228
9843
  }
9229
- if (point3._bufferIndex < 0) {
9230
- point3._index++;
9844
+ if (point4._bufferIndex < 0) {
9845
+ point4._index++;
9231
9846
  } else {
9232
- point3._bufferIndex++;
9233
- if (point3._bufferIndex === // Points w/ non-negative `_bufferIndex` reference
9847
+ point4._bufferIndex++;
9848
+ if (point4._bufferIndex === // Points w/ non-negative `_bufferIndex` reference
9234
9849
  // strings.
9235
9850
  /** @type {string} */
9236
- chunks[point3._index].length) {
9237
- point3._bufferIndex = -1;
9238
- point3._index++;
9851
+ chunks[point4._index].length) {
9852
+ point4._bufferIndex = -1;
9853
+ point4._index++;
9239
9854
  }
9240
9855
  }
9241
9856
  context.previous = code3;
@@ -9359,7 +9974,7 @@ function createTokenizer(parser, initialize, from) {
9359
9974
  restore
9360
9975
  };
9361
9976
  function restore() {
9362
- point3 = startPoint;
9977
+ point4 = startPoint;
9363
9978
  context.previous = startPrevious;
9364
9979
  context.currentConstruct = startCurrentConstruct;
9365
9980
  context.events.length = startEventsIndex;
@@ -9368,9 +9983,9 @@ function createTokenizer(parser, initialize, from) {
9368
9983
  }
9369
9984
  }
9370
9985
  function accountForPotentialSkip() {
9371
- if (point3.line in columnStart && point3.column < 2) {
9372
- point3.column = columnStart[point3.line];
9373
- point3.offset += columnStart[point3.line] - 1;
9986
+ if (point4.line in columnStart && point4.column < 2) {
9987
+ point4.column = columnStart[point4.line];
9988
+ point4.offset += columnStart[point4.line] - 1;
9374
9989
  }
9375
9990
  }
9376
9991
  }
@@ -9568,15 +10183,15 @@ function stringifyPosition(value) {
9568
10183
  return position(value);
9569
10184
  }
9570
10185
  if ("line" in value || "column" in value) {
9571
- return point(value);
10186
+ return point2(value);
9572
10187
  }
9573
10188
  return "";
9574
10189
  }
9575
- function point(point3) {
9576
- return index(point3 && point3.line) + ":" + index(point3 && point3.column);
10190
+ function point2(point4) {
10191
+ return index(point4 && point4.line) + ":" + index(point4 && point4.column);
9577
10192
  }
9578
10193
  function position(pos) {
9579
- return point(pos && pos.start) + "-" + point(pos && pos.end);
10194
+ return point2(pos && pos.start) + "-" + point2(pos && pos.end);
9580
10195
  }
9581
10196
  function index(value) {
9582
10197
  return value && typeof value === "number" ? value : 1;
@@ -9754,12 +10369,12 @@ function compiler(options) {
9754
10369
  handler.call(context, void 0, tail[0]);
9755
10370
  }
9756
10371
  tree.position = {
9757
- start: point2(events.length > 0 ? events[0][1].start : {
10372
+ start: point3(events.length > 0 ? events[0][1].start : {
9758
10373
  line: 1,
9759
10374
  column: 1,
9760
10375
  offset: 0
9761
10376
  }),
9762
- end: point2(events.length > 0 ? events[events.length - 2][1].end : {
10377
+ end: point3(events.length > 0 ? events[events.length - 2][1].end : {
9763
10378
  line: 1,
9764
10379
  column: 1,
9765
10380
  offset: 0
@@ -9898,7 +10513,7 @@ function compiler(options) {
9898
10513
  this.stack.push(node2);
9899
10514
  this.tokenStack.push([token, errorHandler || void 0]);
9900
10515
  node2.position = {
9901
- start: point2(token.start),
10516
+ start: point3(token.start),
9902
10517
  // @ts-expect-error: `end` will be patched later.
9903
10518
  end: void 0
9904
10519
  };
@@ -9927,7 +10542,7 @@ function compiler(options) {
9927
10542
  handler.call(this, token, open[0]);
9928
10543
  }
9929
10544
  }
9930
- node2.position.end = point2(token.end);
10545
+ node2.position.end = point3(token.end);
9931
10546
  }
9932
10547
  function resume() {
9933
10548
  return toString(this.stack.pop());
@@ -10008,7 +10623,7 @@ function compiler(options) {
10008
10623
  if (!tail || tail.type !== "text") {
10009
10624
  tail = text5();
10010
10625
  tail.position = {
10011
- start: point2(token.start),
10626
+ start: point3(token.start),
10012
10627
  // @ts-expect-error: we’ll add `end` later.
10013
10628
  end: void 0
10014
10629
  };
@@ -10019,13 +10634,13 @@ function compiler(options) {
10019
10634
  function onexitdata(token) {
10020
10635
  const tail = this.stack.pop();
10021
10636
  tail.value += this.sliceSerialize(token);
10022
- tail.position.end = point2(token.end);
10637
+ tail.position.end = point3(token.end);
10023
10638
  }
10024
10639
  function onexitlineending(token) {
10025
10640
  const context = this.stack[this.stack.length - 1];
10026
10641
  if (this.data.atHardBreak) {
10027
10642
  const tail = context.children[context.children.length - 1];
10028
- tail.position.end = point2(token.end);
10643
+ tail.position.end = point3(token.end);
10029
10644
  this.data.atHardBreak = void 0;
10030
10645
  return;
10031
10646
  }
@@ -10140,7 +10755,7 @@ function compiler(options) {
10140
10755
  }
10141
10756
  function onexitcharacterreference(token) {
10142
10757
  const tail = this.stack.pop();
10143
- tail.position.end = point2(token.end);
10758
+ tail.position.end = point3(token.end);
10144
10759
  }
10145
10760
  function onexitautolinkprotocol(token) {
10146
10761
  onexitdata.call(this, token);
@@ -10279,7 +10894,7 @@ function compiler(options) {
10279
10894
  };
10280
10895
  }
10281
10896
  }
10282
- function point2(d) {
10897
+ function point3(d) {
10283
10898
  return {
10284
10899
  line: d.line,
10285
10900
  column: d.column,
@@ -10414,7 +11029,7 @@ function trough() {
10414
11029
  }
10415
11030
  values = output;
10416
11031
  if (fn) {
10417
- wrap(fn, next)(...output);
11032
+ wrap2(fn, next)(...output);
10418
11033
  } else {
10419
11034
  callback(null, ...output);
10420
11035
  }
@@ -10430,7 +11045,7 @@ function trough() {
10430
11045
  return pipeline;
10431
11046
  }
10432
11047
  }
10433
- function wrap(middleware, callback) {
11048
+ function wrap2(middleware, callback) {
10434
11049
  let called;
10435
11050
  return wrapped;
10436
11051
  function wrapped(...parameters) {