@poe-platform/safe-bash 0.1.814 → 0.1.815

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 (59) hide show
  1. package/dist/mp4-ast/index.d.ts +1 -0
  2. package/dist/mp4-ast/mp4-fragment-source.d.ts +35 -0
  3. package/dist/mp4-ast/mp4-sample-source.d.ts +5 -2
  4. package/dist/mp4-ast/types.d.ts +11 -0
  5. package/dist/pdf-ast/cos/object-reader.d.ts +3 -2
  6. package/dist/pdf-ast/edit/forms.d.ts +1 -0
  7. package/dist/pdf-ast/edit/retained-form-data.d.ts +9 -0
  8. package/dist/pdf-ast/index.d.ts +1 -0
  9. package/dist/pdf-ast/index.js +476 -55
  10. package/dist/safe-bash/command-chunks/{biff-KRHJ63K3-VQPJCVIL.js → biff-A7XPBWAK-DCLG5QKF.js} +1775 -1667
  11. package/dist/safe-bash/command-chunks/{chunk-AVGXFWEB.js → chunk-44F5TOHZ.js} +179 -58
  12. package/dist/safe-bash/command-chunks/{chunk-PIVH35EQ.js → chunk-6CDDKNNA.js} +1 -0
  13. package/dist/safe-bash/command-chunks/{chunk-K4XNUJVJ.js → chunk-6EINUY5G.js} +149 -165
  14. package/dist/safe-bash/command-chunks/{chunk-5BIQWWLB.js → chunk-CFMJXJS5.js} +1 -1
  15. package/dist/safe-bash/command-chunks/{chunk-3JM7E42I.js → chunk-GPGLTWNR.js} +106 -32
  16. package/dist/safe-bash/command-chunks/{chunk-2ETEJOYX.js → chunk-HQ2UN2L2.js} +8 -8
  17. package/dist/safe-bash/command-chunks/{chunk-CK2WFJZN.js → chunk-KASXIRKD.js} +12 -14
  18. package/dist/safe-bash/command-chunks/chunk-KHUT7BB5.js +65 -0
  19. package/dist/safe-bash/command-chunks/{chunk-LAPOMHGY.js → chunk-NEYITAAO.js} +114 -97
  20. package/dist/safe-bash/command-chunks/{chunk-FF7UGJWS.js → chunk-QDVDBN2N.js} +1 -1
  21. package/dist/safe-bash/command-chunks/{chunk-SW37YCBW.js → chunk-U3C6IT2C.js} +44 -30
  22. package/dist/safe-bash/command-chunks/{chunk-G3TAX3CV.js → chunk-WAT2562G.js} +610 -539
  23. package/dist/safe-bash/command-chunks/{chunk-VT7UBPAE.js → chunk-YW2VYN4V.js} +23 -11
  24. package/dist/safe-bash/command-chunks/{chunk-GQGMQMIM.js → chunk-ZIGENXGC.js} +243 -1
  25. package/dist/safe-bash/command-chunks/{command-engine-7V6PZR7G.js → command-engine-M7S4QIXV.js} +12 -4
  26. package/dist/safe-bash/command-chunks/{engine-UYJENSWK-VSCGKSQV.js → engine-YUYZJIB4-NZUDFEHL.js} +1 -1
  27. package/dist/safe-bash-command-ffmpeg/index.js +1 -1
  28. package/dist/safe-bash-command-ffprobe/index.js +2 -2
  29. package/dist/safe-bash-command-ffprobe/media.d.ts +8 -2
  30. package/dist/safe-bash-command-ffprobe/media.js +4 -2
  31. package/dist/safe-bash-command-pandoc/command.js +3 -3
  32. package/dist/safe-bash-command-pandoc/index.js +8 -8
  33. package/dist/safe-bash-command-patch/index.js +7 -6
  34. package/dist/safe-bash-command-patch/patch-formats.d.ts +6 -5
  35. package/dist/safe-bash-command-patch/patch-formats.js +3 -2
  36. package/dist/safe-bash-command-patch/patch-gnu-paths.d.ts +7 -7
  37. package/dist/safe-bash-command-patch/patch-gnu-reject.d.ts +1 -1
  38. package/dist/safe-bash-command-patch/patch-gnu-reject.js +3 -2
  39. package/dist/safe-bash-command-patch/patch-publication.js +3 -2
  40. package/dist/safe-bash-command-patch/patch-text.d.ts +13 -0
  41. package/dist/safe-bash-command-patch/patch.js +7 -6
  42. package/dist/safe-bash-command-patch/stored-patch.d.ts +29 -4
  43. package/dist/safe-bash-command-patch/stored-target.d.ts +2 -1
  44. package/dist/safe-bash-command-patch/unified.d.ts +18 -4
  45. package/dist/safe-bash-command-patch/unified.js +2 -1
  46. package/dist/safe-bash-command-pdftk/index.js +30 -20
  47. package/dist/safe-bash-command-pptx/engine.js +1 -1
  48. package/dist/safe-bash-command-ssconvert/index.js +2 -2
  49. package/dist/safe-bash-presentation-engine/index.js +1 -1
  50. package/dist/safe-bash-presentation-engine/notes.d.ts +1 -0
  51. package/dist/safe-bash-presentation-engine/notes.js +7 -1
  52. package/dist/safe-bash-presentation-engine/retained-notes.d.ts +27 -0
  53. package/dist/safe-bash-xml-engine/document.js +2 -2
  54. package/dist/safe-bash-xml-engine/index.js +2 -2
  55. package/dist/safe-bash-xml-engine/stored-document.js +1 -1
  56. package/dist/spreadsheet-format-xls/biff-properties-merge.js +40 -21
  57. package/dist/spreadsheet-format-xls/biff-property-values.d.ts +31 -0
  58. package/dist/spreadsheet-format-xls/biff-property-values.js +158 -0
  59. package/package.json +3 -2
@@ -42,7 +42,7 @@ import {
42
42
  p
43
43
  } from "./chunk-QIFS4QHZ.js";
44
44
 
45
- // packages/safe-bash-command-pandoc/dist/chunks/chunk-YCEQL5FO.js
45
+ // packages/safe-bash-command-pandoc/dist/chunks/chunk-GJ52QHT3.js
46
46
  import { builtInDirectContextExecutors as ow, syncCommandEvaluators as lw } from "../../safe-bash-contracts/runtime-control.js";
47
47
  import * as Zx from "../../safe-bash-markdown-engine/gfm-syntax.js";
48
48
  import * as t1 from "../../safe-bash-markdown-engine/commonmark-blocks.js";
@@ -53,7 +53,7 @@ import { IntegerTable as Wh } from "../../safe-bash-io-engine/storage.js";
53
53
  import { PagedStorage as Up } from "../../safe-bash-io-engine/storage.js";
54
54
  import { PagedStorage as fm } from "../../safe-bash-io-engine/storage.js";
55
55
  import { IntegerTable as Aa } from "../../safe-bash-io-engine/storage.js";
56
- import { PagedStorage as Jn } from "../../safe-bash-io-engine/storage.js";
56
+ import { PagedStorage as Vn } from "../../safe-bash-io-engine/storage.js";
57
57
  import { IntegerTable as hm } from "../../safe-bash-io-engine/storage.js";
58
58
  import { PagedStorage as jd } from "../../safe-bash-io-engine/storage.js";
59
59
  import { IntegerTable as Fd } from "../../safe-bash-io-engine/storage.js";
@@ -61,18 +61,18 @@ import { IntegerTable as Md } from "../../safe-bash-io-engine/storage.js";
61
61
  import { PagedStorage as Xd } from "../../safe-bash-io-engine/storage.js";
62
62
  import { PagedStorage as qd } from "../../safe-bash-io-engine/storage.js";
63
63
  import { IntegerTable as gm } from "../../safe-bash-io-engine/storage.js";
64
- import { IntegerTable as lr } from "../../safe-bash-io-engine/storage.js";
64
+ import { IntegerTable as cr } from "../../safe-bash-io-engine/storage.js";
65
65
  import { IntegerTable as sl } from "../../safe-bash-io-engine/storage.js";
66
66
  import { IntegerTable as xm, PagedStorage as km } from "../../safe-bash-io-engine/storage.js";
67
67
  import { IntegerTable as bm, PagedStorage as ym } from "../../safe-bash-io-engine/storage.js";
68
68
  import { PagedStorage as vm } from "../../safe-bash-io-engine/storage.js";
69
69
  import { hasYieldCheckpoint as Cm, runYieldCheckpoint as Bm, yieldTurn as Om } from "../../safe-bash-contracts/yield.js";
70
70
  import { readBytes as qm } from "../../safe-bash-contracts/index.js";
71
- import { IntegerTable as gr, PagedStorage as ul } from "../../safe-bash-io-engine/storage.js";
71
+ import { IntegerTable as br, PagedStorage as ul } from "../../safe-bash-io-engine/storage.js";
72
72
  import { IntegerTable as Hm } from "../../safe-bash-io-engine/storage.js";
73
73
  import { IntegerTable as Ym, PagedStorage as Gm } from "../../safe-bash-io-engine/storage.js";
74
74
  import { IntegerTable as Re, PagedStorage as zm } from "../../safe-bash-io-engine/storage.js";
75
- import { IntegerTable as xr, PagedStorage as Km } from "../../safe-bash-io-engine/storage.js";
75
+ import { IntegerTable as kr, PagedStorage as Km } from "../../safe-bash-io-engine/storage.js";
76
76
  import { IntegerTable as Xm } from "../../safe-bash-io-engine/storage.js";
77
77
  import { IntegerTable as ml, PagedStorage as Zm } from "../../safe-bash-io-engine/storage.js";
78
78
  import { IntegerTable as Tu, PagedStorage as tw } from "../../safe-bash-io-engine/storage.js";
@@ -85,7 +85,7 @@ import { PagedStorage as Lu } from "../../safe-bash-io-engine/storage.js";
85
85
  import { createBytePipe as rw } from "../../safe-bash-contracts/index.js";
86
86
  import { dirname as Mu, readFileStream as ju } from "@poe-platform/safe-fs/core";
87
87
  import { createOutputOperation as cw, getCommandArguments as fw, readBytes as Il, FsError as Wu } from "../../safe-bash-contracts/index.js";
88
- import { writeFileOutput as Sr } from "../../safe-bash-contracts/filesystem-output-budget.js";
88
+ import { writeFileOutput as Er } from "../../safe-bash-contracts/filesystem-output-budget.js";
89
89
  import { compareObservedEntries as dw, compareCopyIdentity as uw } from "../../safe-bash-contracts/filesystem-identity.js";
90
90
  import { pathOf as Hi } from "../../safe-bash-contracts/path.js";
91
91
  var wf = m((Ft) => {
@@ -103,24 +103,24 @@ var wf = m((Ft) => {
103
103
  Ft.NAME_CHAR_RE = new RegExp("^[" + Ft.NAME_CHAR + "]$", "u");
104
104
  Ft.NAME_RE = new RegExp("^[" + Ft.NAME_START_CHAR + "][" + Ft.NAME_CHAR + "]*$", "u");
105
105
  Ft.NMTOKEN_RE = new RegExp("^[" + Ft.NAME_CHAR + "]+$", "u");
106
- var Eo = 9, Ao = 10, Io = 13, Po = 32;
107
- Ft.S_LIST = [Po, Ao, Io, Eo];
106
+ var Ao = 9, Io = 10, Po = 13, Ro = 32;
107
+ Ft.S_LIST = [Ro, Io, Po, Ao];
108
108
  function qh(s15) {
109
- return s15 >= Po && s15 <= 55295 || s15 === Ao || s15 === Io || s15 === Eo || s15 >= 57344 && s15 <= 65533 || s15 >= 65536 && s15 <= 1114111;
109
+ return s15 >= Ro && s15 <= 55295 || s15 === Io || s15 === Po || s15 === Ao || s15 >= 57344 && s15 <= 65533 || s15 >= 65536 && s15 <= 1114111;
110
110
  }
111
111
  Ft.isChar = qh;
112
- function Jh(s15) {
113
- return s15 === Po || s15 === Ao || s15 === Io || s15 === Eo;
112
+ function Vh(s15) {
113
+ return s15 === Ro || s15 === Io || s15 === Po || s15 === Ao;
114
114
  }
115
- Ft.isS = Jh;
115
+ Ft.isS = Vh;
116
116
  function mf(s15) {
117
117
  return s15 >= 65 && s15 <= 90 || s15 >= 97 && s15 <= 122 || s15 === 58 || s15 === 95 || s15 === 8204 || s15 === 8205 || s15 >= 192 && s15 <= 214 || s15 >= 216 && s15 <= 246 || s15 >= 248 && s15 <= 767 || s15 >= 880 && s15 <= 893 || s15 >= 895 && s15 <= 8191 || s15 >= 8304 && s15 <= 8591 || s15 >= 11264 && s15 <= 12271 || s15 >= 12289 && s15 <= 55295 || s15 >= 63744 && s15 <= 64975 || s15 >= 65008 && s15 <= 65533 || s15 >= 65536 && s15 <= 983039;
118
118
  }
119
119
  Ft.isNameStartChar = mf;
120
- function Vh(s15) {
120
+ function Jh(s15) {
121
121
  return mf(s15) || s15 >= 48 && s15 <= 57 || s15 === 45 || s15 === 46 || s15 === 183 || s15 >= 768 && s15 <= 879 || s15 >= 8255 && s15 <= 8256;
122
122
  }
123
- Ft.isNameChar = Vh;
123
+ Ft.isNameChar = Jh;
124
124
  });
125
125
  var vf = m((Et2) => {
126
126
  "use strict";
@@ -182,15 +182,15 @@ var Sf = m((ue) => {
182
182
  }
183
183
  ue.isNCNameChar = Kh;
184
184
  });
185
- var qo = m((Fn) => {
185
+ var Vo = m((Fn) => {
186
186
  "use strict";
187
187
  Object.defineProperty(Fn, "__esModule", { value: true });
188
188
  Fn.SaxesParser = Fn.EVENTS = void 0;
189
- var $n = wf(), Qh = vf(), Wo = Sf(), he = $n.isS, Zh = $n.isChar, xa = $n.isNameStartChar, Ef = $n.isNameChar, Uf = $n.S_LIST, tp = $n.NAME_RE, ep = Qh.isChar, ip = Wo.isNCNameStartChar, np = Wo.isNCNameChar, ap = Wo.NC_NAME_RE, Js = "http://www.w3.org/XML/1998/namespace", Ln = "http://www.w3.org/2000/xmlns/", sp = { __proto__: null, xml: Js, xmlns: Ln }, rp = { __proto__: null, amp: "&", gt: ">", lt: "<", quot: '"', apos: "'" }, $t = -1, si = -2, Af = 0, op = 1, Ro = 2, lp = 3, Bn = 4, cp = 5, fp = 6, dp = 7, Co = 8, up = 9, hp = 10, pp = 11, mp = 12, le = 13, Us = 14, Bo = 15, wp = 16, Oo = 17, gp = 18, bp = 19, No = 20, yp = 21, xp = 22, kp = 23, If = 24, Lo = 25, Ms = 26, Pf = 27, vp = 28, Tp = 29, Rf = 30, Sp = 31, Ep = 32, en = 33, Ap = 34, Fo = 35, ka = 36, $o = 37, Ip = 38, Cf = 39, Bf = 40, Pp = 41, Of = 42, Rp = 43, Cp = 44, Do = 9, je = 10, _o = 13, Nf = 32, Lf = 33, Mf = 34, va = 38, jf = 39, js = 45, Ws = 47, Bp = 59, Ui = 60, On = 61, Yt = 62, Qt = 63, Wf = 91, Nn = 93, Ff = 133, $f = 8232, qs = (s15) => s15 === Mf || s15 === jf, qf = [Mf, jf], Op = [...qf, Wf, Yt], Np = [...qf, Ui, Nn], Lp = [On, Qt, ...Uf], Fp = [...Uf, Yt, va, Ui];
190
- function Mo(s15, t2, e2) {
189
+ var $n = wf(), Qh = vf(), qo = Sf(), he = $n.isS, Zh = $n.isChar, xa = $n.isNameStartChar, Ef = $n.isNameChar, Uf = $n.S_LIST, tp = $n.NAME_RE, ep = Qh.isChar, ip = qo.isNCNameStartChar, np = qo.isNCNameChar, ap = qo.NC_NAME_RE, Vs = "http://www.w3.org/XML/1998/namespace", Ln = "http://www.w3.org/2000/xmlns/", sp = { __proto__: null, xml: Vs, xmlns: Ln }, rp = { __proto__: null, amp: "&", gt: ">", lt: "<", quot: '"', apos: "'" }, $t = -1, si = -2, Af = 0, op = 1, Co = 2, lp = 3, Bn = 4, cp = 5, fp = 6, dp = 7, Bo = 8, up = 9, hp = 10, pp = 11, mp = 12, le = 13, Us = 14, Oo = 15, wp = 16, No = 17, gp = 18, bp = 19, Lo = 20, yp = 21, xp = 22, kp = 23, If = 24, Fo = 25, Ms = 26, Pf = 27, vp = 28, Tp = 29, Rf = 30, Sp = 31, Ep = 32, en = 33, Ap = 34, $o = 35, ka = 36, Do = 37, Ip = 38, Cf = 39, Bf = 40, Pp = 41, Of = 42, Rp = 43, Cp = 44, _o = 9, je = 10, Uo = 13, Nf = 32, Lf = 33, Mf = 34, va = 38, jf = 39, js = 45, Ws = 47, Bp = 59, Ui = 60, On = 61, Yt = 62, Qt = 63, Wf = 91, Nn = 93, Ff = 133, $f = 8232, qs = (s15) => s15 === Mf || s15 === jf, qf = [Mf, jf], Op = [...qf, Wf, Yt], Np = [...qf, Ui, Nn], Lp = [On, Qt, ...Uf], Fp = [...Uf, Yt, va, Ui];
190
+ function jo(s15, t2, e2) {
191
191
  switch (t2) {
192
192
  case "xml":
193
- e2 !== Js && s15.fail(`xml prefix must be bound to ${Js}.`);
193
+ e2 !== Vs && s15.fail(`xml prefix must be bound to ${Vs}.`);
194
194
  break;
195
195
  case "xmlns":
196
196
  e2 !== Ln && s15.fail(`xmlns prefix must be bound to ${Ln}.`);
@@ -201,7 +201,7 @@ var qo = m((Fn) => {
201
201
  case Ln:
202
202
  s15.fail(t2 === "" ? `the default namespace may not be set to ${e2}.` : `may not assign a prefix (even "xmlns") to the URI ${Ln}.`);
203
203
  break;
204
- case Js:
204
+ case Vs:
205
205
  switch (t2) {
206
206
  case "xml":
207
207
  break;
@@ -216,11 +216,11 @@ var qo = m((Fn) => {
216
216
  }
217
217
  }
218
218
  function $p(s15, t2) {
219
- for (let e2 of Object.keys(t2)) Mo(s15, e2, t2[e2]);
219
+ for (let e2 of Object.keys(t2)) jo(s15, e2, t2[e2]);
220
220
  }
221
- var Dp = (s15) => ap.test(s15), _p = (s15) => tp.test(s15), nn = 0, Df = 1, Uo = 2;
221
+ var Dp = (s15) => ap.test(s15), _p = (s15) => tp.test(s15), nn = 0, Df = 1, Mo = 2;
222
222
  Fn.EVENTS = ["xmldecl", "text", "processinginstruction", "doctype", "comment", "opentagstart", "attribute", "opentag", "closetag", "cdata", "error", "end", "ready"];
223
- var _f = { xmldecl: "xmldeclHandler", text: "textHandler", processinginstruction: "piHandler", doctype: "doctypeHandler", comment: "commentHandler", opentagstart: "openTagStartHandler", attribute: "attributeHandler", opentag: "openTagHandler", closetag: "closeTagHandler", cdata: "cdataHandler", error: "errorHandler", end: "endHandler", ready: "readyHandler" }, jo = class {
223
+ var _f = { xmldecl: "xmldeclHandler", text: "textHandler", processinginstruction: "piHandler", doctype: "doctypeHandler", comment: "commentHandler", opentagstart: "openTagStartHandler", attribute: "attributeHandler", opentag: "openTagHandler", closetag: "closeTagHandler", cdata: "cdataHandler", error: "errorHandler", end: "endHandler", ready: "readyHandler" }, Wo = class {
224
224
  constructor(t2) {
225
225
  this.opt = t2 ?? {}, this.fragmentOpt = !!this.opt.fragment;
226
226
  let e2 = this.xmlnsOpt = !!this.opt.xmlns;
@@ -273,7 +273,7 @@ var qo = m((Fn) => {
273
273
  let e2 = false;
274
274
  t2 === null ? (e2 = true, t2 = "") : typeof t2 == "object" && (t2 = t2.toString()), this.carriedFromPrevious !== void 0 && (t2 = `${this.carriedFromPrevious}${t2}`, this.carriedFromPrevious = void 0);
275
275
  let i2 = t2.length, n = t2.charCodeAt(i2 - 1);
276
- !e2 && (n === _o || n >= 55296 && n <= 56319) && (this.carriedFromPrevious = t2[i2 - 1], i2--, t2 = t2.slice(0, i2));
276
+ !e2 && (n === Uo || n >= 55296 && n <= 56319) && (this.carriedFromPrevious = t2[i2 - 1], i2--, t2 = t2.slice(0, i2));
277
277
  let { stateTable: a } = this;
278
278
  for (this.chunk = t2, this.i = 0; this.i < i2; ) a[this.state].call(this);
279
279
  return this.chunkPosition += i2, e2 ? this.end() : this;
@@ -286,11 +286,11 @@ var qo = m((Fn) => {
286
286
  if (this.prevI = e2, this.i = e2 + 1, e2 >= t2.length) return $t;
287
287
  let i2 = t2.charCodeAt(e2);
288
288
  if (this.column++, i2 < 55296) {
289
- if (i2 >= Nf || i2 === Do) return i2;
289
+ if (i2 >= Nf || i2 === _o) return i2;
290
290
  switch (i2) {
291
291
  case je:
292
292
  return this.line++, this.column = 0, this.positionAtNewLine = this.position, je;
293
- case _o:
293
+ case Uo:
294
294
  return t2.charCodeAt(e2 + 1) === je && (this.i = e2 + 2), this.line++, this.column = 0, this.positionAtNewLine = this.position, si;
295
295
  default:
296
296
  return this.fail("disallowed character."), i2;
@@ -305,11 +305,11 @@ var qo = m((Fn) => {
305
305
  if (this.prevI = e2, this.i = e2 + 1, e2 >= t2.length) return $t;
306
306
  let i2 = t2.charCodeAt(e2);
307
307
  if (this.column++, i2 < 55296) {
308
- if (i2 > 31 && i2 < 127 || i2 > 159 && i2 !== $f || i2 === Do) return i2;
308
+ if (i2 > 31 && i2 < 127 || i2 > 159 && i2 !== $f || i2 === _o) return i2;
309
309
  switch (i2) {
310
310
  case je:
311
311
  return this.line++, this.column = 0, this.positionAtNewLine = this.position, je;
312
- case _o: {
312
+ case Uo: {
313
313
  let a = t2.charCodeAt(e2 + 1);
314
314
  (a === je || a === Ff) && (this.i = e2 + 2);
315
315
  }
@@ -380,7 +380,7 @@ var qo = m((Fn) => {
380
380
  let t2 = this.i, e2 = this.skipSpaces();
381
381
  switch (this.prevI !== t2 && (this.xmlDeclPossible = false), e2) {
382
382
  case Ui:
383
- if (this.state = Bo, this.text.length !== 0) throw new Error("no-empty text at start");
383
+ if (this.state = Oo, this.text.length !== 0) throw new Error("no-empty text at start");
384
384
  break;
385
385
  case $t:
386
386
  break;
@@ -404,11 +404,11 @@ var qo = m((Fn) => {
404
404
  }
405
405
  sDoctypeQuote() {
406
406
  let t2 = this.q;
407
- this.captureToChar(t2) && (this.text += String.fromCodePoint(t2), this.q = null, this.state = Ro);
407
+ this.captureToChar(t2) && (this.text += String.fromCodePoint(t2), this.q = null, this.state = Co);
408
408
  }
409
409
  sDTD() {
410
410
  let t2 = this.captureTo(Np);
411
- t2 !== $t && (this.text += String.fromCodePoint(t2), t2 === Nn ? this.state = Ro : t2 === Ui ? this.state = fp : qs(t2) && (this.state = cp, this.q = t2));
411
+ t2 !== $t && (this.text += String.fromCodePoint(t2), t2 === Nn ? this.state = Co : t2 === Ui ? this.state = fp : qs(t2) && (this.state = cp, this.q = t2));
412
412
  }
413
413
  sDTDQuoted() {
414
414
  let t2 = this.q;
@@ -429,18 +429,18 @@ var qo = m((Fn) => {
429
429
  }
430
430
  sDTDOpenWakaBang() {
431
431
  let t2 = String.fromCodePoint(this.getCodeNorm()), e2 = this.openWakaBang += t2;
432
- this.text += t2, e2 !== "-" && (this.state = e2 === "--" ? Co : Bn, this.openWakaBang = "");
432
+ this.text += t2, e2 !== "-" && (this.state = e2 === "--" ? Bo : Bn, this.openWakaBang = "");
433
433
  }
434
434
  sDTDComment() {
435
435
  this.captureToChar(js) && (this.text += "-", this.state = up);
436
436
  }
437
437
  sDTDCommentEnding() {
438
438
  let t2 = this.getCodeNorm();
439
- this.text += String.fromCodePoint(t2), this.state = t2 === js ? hp : Co;
439
+ this.text += String.fromCodePoint(t2), this.state = t2 === js ? hp : Bo;
440
440
  }
441
441
  sDTDCommentEnded() {
442
442
  let t2 = this.getCodeNorm();
443
- this.text += String.fromCodePoint(t2), t2 === Yt ? this.state = Bn : (this.fail("malformed comment."), this.state = Co);
443
+ this.text += String.fromCodePoint(t2), t2 === Yt ? this.state = Bn : (this.fail("malformed comment."), this.state = Bo);
444
444
  }
445
445
  sDTDPI() {
446
446
  this.captureToChar(Qt) && (this.text += "?", this.state = mp);
@@ -492,13 +492,13 @@ var qo = m((Fn) => {
492
492
  sOpenWakaBang() {
493
493
  switch (this.openWakaBang += String.fromCodePoint(this.getCodeNorm()), this.openWakaBang) {
494
494
  case "[CDATA[":
495
- !this.sawRoot && !this.reportedTextBeforeRoot && (this.fail("text data outside of root node."), this.reportedTextBeforeRoot = true), this.closedRoot && !this.reportedTextAfterRoot && (this.fail("text data outside of root node."), this.reportedTextAfterRoot = true), this.state = No, this.openWakaBang = "";
495
+ !this.sawRoot && !this.reportedTextBeforeRoot && (this.fail("text data outside of root node."), this.reportedTextBeforeRoot = true), this.closedRoot && !this.reportedTextAfterRoot && (this.fail("text data outside of root node."), this.reportedTextAfterRoot = true), this.state = Lo, this.openWakaBang = "";
496
496
  break;
497
497
  case "--":
498
- this.state = Oo, this.openWakaBang = "";
498
+ this.state = No, this.openWakaBang = "";
499
499
  break;
500
500
  case "DOCTYPE":
501
- this.state = Ro, (this.doctype || this.sawRoot) && this.fail("inappropriately located doctype declaration."), this.openWakaBang = "";
501
+ this.state = Co, (this.doctype || this.sawRoot) && this.fail("inappropriately located doctype declaration."), this.openWakaBang = "";
502
502
  break;
503
503
  default:
504
504
  this.openWakaBang.length >= 7 && this.fail("incorrect syntax.");
@@ -510,18 +510,18 @@ var qo = m((Fn) => {
510
510
  sCommentEnding() {
511
511
  var t2;
512
512
  let e2 = this.getCodeNorm();
513
- e2 === js ? (this.state = bp, (t2 = this.commentHandler) === null || t2 === void 0 || t2.call(this, this.text), this.text = "") : (this.text += `-${String.fromCodePoint(e2)}`, this.state = Oo);
513
+ e2 === js ? (this.state = bp, (t2 = this.commentHandler) === null || t2 === void 0 || t2.call(this, this.text), this.text = "") : (this.text += `-${String.fromCodePoint(e2)}`, this.state = No);
514
514
  }
515
515
  sCommentEnded() {
516
516
  let t2 = this.getCodeNorm();
517
- t2 !== Yt ? (this.fail("malformed comment."), this.text += `--${String.fromCodePoint(t2)}`, this.state = Oo) : this.state = le;
517
+ t2 !== Yt ? (this.fail("malformed comment."), this.text += `--${String.fromCodePoint(t2)}`, this.state = No) : this.state = le;
518
518
  }
519
519
  sCData() {
520
520
  this.captureToChar(Nn) && (this.state = yp);
521
521
  }
522
522
  sCDataEnding() {
523
523
  let t2 = this.getCodeNorm();
524
- t2 === Nn ? this.state = xp : (this.text += `]${String.fromCodePoint(t2)}`, this.state = No);
524
+ t2 === Nn ? this.state = xp : (this.text += `]${String.fromCodePoint(t2)}`, this.state = Lo);
525
525
  }
526
526
  sCDataEnding2() {
527
527
  var t2;
@@ -535,12 +535,12 @@ var qo = m((Fn) => {
535
535
  this.text += "]";
536
536
  break;
537
537
  default:
538
- this.text += `]]${String.fromCodePoint(e2)}`, this.state = No;
538
+ this.text += `]]${String.fromCodePoint(e2)}`, this.state = Lo;
539
539
  }
540
540
  }
541
541
  sPIFirstChar() {
542
542
  let t2 = this.getCodeNorm();
543
- this.nameStartCheck(t2) ? (this.piTarget += String.fromCodePoint(t2), this.state = If) : t2 === Qt || he(t2) ? (this.fail("processing instruction without a target."), this.state = t2 === Qt ? Ms : Lo) : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(t2), this.state = If);
543
+ this.nameStartCheck(t2) ? (this.piTarget += String.fromCodePoint(t2), this.state = If) : t2 === Qt || he(t2) ? (this.fail("processing instruction without a target."), this.state = t2 === Qt ? Ms : Fo) : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(t2), this.state = If);
544
544
  }
545
545
  sPIRest() {
546
546
  let { chunk: t2, i: e2 } = this;
@@ -553,7 +553,7 @@ var qo = m((Fn) => {
553
553
  if (!this.nameCheck(i2)) {
554
554
  this.piTarget += t2.slice(e2, this.prevI);
555
555
  let n = i2 === Qt;
556
- n || he(i2) ? this.piTarget === "xml" ? (this.xmlDeclPossible || this.fail("an XML declaration must be at the start of the document."), this.state = n ? en : Pf) : this.state = n ? Ms : Lo : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(i2));
556
+ n || he(i2) ? this.piTarget === "xml" ? (this.xmlDeclPossible || this.fail("an XML declaration must be at the start of the document."), this.state = n ? en : Pf) : this.state = n ? Ms : Fo : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(i2));
557
557
  break;
558
558
  }
559
559
  }
@@ -570,7 +570,7 @@ var qo = m((Fn) => {
570
570
  if (e2 === Yt) {
571
571
  let { piTarget: i2 } = this;
572
572
  i2.toLowerCase() === "xml" && this.fail("the XML declaration must appear at the start of the document."), (t2 = this.piHandler) === null || t2 === void 0 || t2.call(this, { target: i2, body: this.text }), this.piTarget = this.text = "", this.state = le;
573
- } else e2 === Qt ? this.text += "?" : (this.text += `?${String.fromCodePoint(e2)}`, this.state = Lo);
573
+ } else e2 === Qt ? this.text += "?" : (this.text += `?${String.fromCodePoint(e2)}`, this.state = Fo);
574
574
  this.xmlDeclPossible = false;
575
575
  }
576
576
  sXMLDeclNameStart() {
@@ -664,7 +664,7 @@ var qo = m((Fn) => {
664
664
  this.openTag();
665
665
  break;
666
666
  case Ws:
667
- this.state = Fo;
667
+ this.state = $o;
668
668
  break;
669
669
  default:
670
670
  he(e2) || this.fail("disallowed character in tag name."), this.state = ka;
@@ -675,7 +675,7 @@ var qo = m((Fn) => {
675
675
  }
676
676
  sAttrib() {
677
677
  let t2 = this.skipSpaces();
678
- t2 !== $t && (xa(t2) ? (this.unget(), this.state = $o) : t2 === Yt ? this.openTag() : t2 === Ws ? this.state = Fo : this.fail("disallowed character in attribute name."));
678
+ t2 !== $t && (xa(t2) ? (this.unget(), this.state = Do) : t2 === Yt ? this.openTag() : t2 === Ws ? this.state = $o : this.fail("disallowed character in attribute name."));
679
679
  }
680
680
  sAttribName() {
681
681
  let t2 = this.captureNameChars();
@@ -690,7 +690,7 @@ var qo = m((Fn) => {
690
690
  this.state = Cf;
691
691
  break;
692
692
  default:
693
- this.fail("attribute without value."), this.text = "", this.name = "", t2 === Yt ? this.openTag() : xa(t2) ? (this.unget(), this.state = $o) : (this.fail("disallowed character in attribute name."), this.state = ka);
693
+ this.fail("attribute without value."), this.text = "", this.name = "", t2 === Yt ? this.openTag() : xa(t2) ? (this.unget(), this.state = Do) : (this.fail("disallowed character in attribute name."), this.state = ka);
694
694
  }
695
695
  }
696
696
  sAttribValue() {
@@ -708,7 +708,7 @@ var qo = m((Fn) => {
708
708
  return;
709
709
  case je:
710
710
  case si:
711
- case Do:
711
+ case _o:
712
712
  this.text += `${e2.slice(i2, this.prevI)} `, i2 = this.i;
713
713
  break;
714
714
  case Ui:
@@ -722,7 +722,7 @@ var qo = m((Fn) => {
722
722
  }
723
723
  sAttribValueClosed() {
724
724
  let t2 = this.getCodeNorm();
725
- he(t2) ? this.state = ka : t2 === Yt ? this.openTag() : t2 === Ws ? this.state = Fo : xa(t2) ? (this.fail("no whitespace between attributes."), this.unget(), this.state = $o) : this.fail("disallowed character in attribute name.");
725
+ he(t2) ? this.state = ka : t2 === Yt ? this.openTag() : t2 === Ws ? this.state = $o : xa(t2) ? (this.fail("no whitespace between attributes."), this.unget(), this.state = Do) : this.fail("disallowed character in attribute name.");
726
726
  }
727
727
  sAttribValueUnquoted() {
728
728
  let t2 = this.captureTo(Fp);
@@ -758,7 +758,7 @@ var qo = m((Fn) => {
758
758
  let { i: t2, forbiddenState: e2 } = this, { chunk: i2, textHandler: n } = this;
759
759
  t: for (; ; ) switch (this.getCode()) {
760
760
  case Ui: {
761
- if (this.state = Bo, n !== void 0) {
761
+ if (this.state = Oo, n !== void 0) {
762
762
  let { text: a } = this, r = i2.slice(t2, this.prevI);
763
763
  a.length !== 0 ? (n(a + r), this.text = "") : r.length !== 0 && n(r);
764
764
  }
@@ -774,16 +774,16 @@ var qo = m((Fn) => {
774
774
  e2 = Df;
775
775
  break;
776
776
  case Df:
777
- e2 = Uo;
777
+ e2 = Mo;
778
778
  break;
779
- case Uo:
779
+ case Mo:
780
780
  break;
781
781
  default:
782
782
  throw new Error("impossible state");
783
783
  }
784
784
  break;
785
785
  case Yt:
786
- e2 === Uo && this.fail('the string "]]>" is disallowed in char data.'), e2 = nn;
786
+ e2 === Mo && this.fail('the string "]]>" is disallowed in char data.'), e2 = nn;
787
787
  break;
788
788
  case si:
789
789
  n !== void 0 && (this.text += `${i2.slice(t2, this.prevI)}
@@ -803,7 +803,7 @@ var qo = m((Fn) => {
803
803
  let a = this.getCode();
804
804
  switch (a) {
805
805
  case Ui: {
806
- if (this.state = Bo, i2 !== void 0) {
806
+ if (this.state = Oo, i2 !== void 0) {
807
807
  let { text: r } = this, o2 = e2.slice(t2, this.prevI);
808
808
  r.length !== 0 ? (i2(r + o2), this.text = "") : o2.length !== 0 && i2(o2);
809
809
  }
@@ -830,10 +830,10 @@ var qo = m((Fn) => {
830
830
  let { prefix: n, local: a } = this.qname(t2), r = { name: t2, prefix: n, local: a, value: e2 };
831
831
  if (this.attribList.push(r), (i2 = this.attributeHandler) === null || i2 === void 0 || i2.call(this, r), n === "xmlns") {
832
832
  let o2 = e2.trim();
833
- this.currentXMLVersion === "1.0" && o2 === "" && this.fail("invalid attempt to undefine prefix in XML 1.0"), this.topNS[a] = o2, Mo(this, a, o2);
833
+ this.currentXMLVersion === "1.0" && o2 === "" && this.fail("invalid attempt to undefine prefix in XML 1.0"), this.topNS[a] = o2, jo(this, a, o2);
834
834
  } else if (t2 === "xmlns") {
835
835
  let o2 = e2.trim();
836
- this.topNS[""] = o2, Mo(this, "", o2);
836
+ this.topNS[""] = o2, jo(this, "", o2);
837
837
  }
838
838
  }
839
839
  pushAttribPlain(t2, e2) {
@@ -924,7 +924,7 @@ var qo = m((Fn) => {
924
924
  return t2[1] === "x" && /^#x[0-9a-f]+$/i.test(t2) ? e2 = parseInt(t2.slice(2), 16) : /^#[0-9]+$/.test(t2) && (e2 = parseInt(t2.slice(1), 10)), this.isChar(e2) ? String.fromCodePoint(e2) : (this.fail("malformed character entity."), `&${t2};`);
925
925
  }
926
926
  };
927
- Fn.SaxesParser = jo;
927
+ Fn.SaxesParser = Wo;
928
928
  });
929
929
  var Fl = `abc
930
930
  actionscript
@@ -1090,7 +1090,7 @@ yaml
1090
1090
  zig
1091
1091
  zsh
1092
1092
  `;
1093
- var Cr = `<!DOCTYPE html>
1093
+ var Br = `<!DOCTYPE html>
1094
1094
  <html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ lang="$lang$" xml:lang="$lang$"$endif$$if(dir)$ dir="$dir$"$endif$>
1095
1095
  <head>
1096
1096
  <meta charset="utf-8" />
@@ -2787,7 +2787,7 @@ var Ma = /* @__PURE__ */ new Map([["pygments", `{
2787
2787
  function Hu(s15) {
2788
2788
  return s15.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "section";
2789
2789
  }
2790
- function Br(s15) {
2790
+ function Or2(s15) {
2791
2791
  let t2 = [], e2 = s15.split(/( +)/);
2792
2792
  for (let i2 of e2) i2 && (i2[0] === " " ? t2.push({ t: "Space" }) : t2.push({ t: "Str", c: i2 }));
2793
2793
  return t2;
@@ -2795,9 +2795,9 @@ function Br(s15) {
2795
2795
  function oi(s15) {
2796
2796
  let t2 = [], e2 = /\[\[File:([^|\]]+)(?:\|([^\]]*))?\]\]|\[\[([^|\]]+)(?:\|([^\]]*))?\]\]|\[((?:https?:\/\/|mailto:)[^\s\]]+)(?:\s+([^\]]+))?\]|'''([\s\S]+?)'''|''([\s\S]+?)''|<code>([\s\S]*?)<\/code>|<s>([\s\S]*?)<\/s>/g, i2 = 0, n;
2797
2797
  for (; (n = e2.exec(s15)) !== null; ) {
2798
- if (n.index > i2 && t2.push(...Br(s15.slice(i2, n.index))), n[1] !== void 0) {
2798
+ if (n.index > i2 && t2.push(...Or2(s15.slice(i2, n.index))), n[1] !== void 0) {
2799
2799
  let a = n[1].trim(), r = (n[2] ?? "").split("|").pop()?.trim() ?? "";
2800
- t2.push({ t: "Image", c: [["", [], []], Br(r), [a, ""]] });
2800
+ t2.push({ t: "Image", c: [["", [], []], Or2(r), [a, ""]] });
2801
2801
  } else if (n[3] !== void 0) {
2802
2802
  let a = n[3].trim(), r = (n[4] ?? a).trim();
2803
2803
  t2.push({ t: "Link", c: [["", [], []], oi(r), [a, ""]] });
@@ -2807,7 +2807,7 @@ function oi(s15) {
2807
2807
  } else n[7] !== void 0 ? t2.push({ t: "Strong", c: oi(n[7]) }) : n[8] !== void 0 ? t2.push({ t: "Emph", c: oi(n[8]) }) : n[9] !== void 0 ? t2.push({ t: "Code", c: [["", [], []], n[9]] }) : n[10] !== void 0 && t2.push({ t: "Strikeout", c: oi(n[10]) });
2808
2808
  i2 = e2.lastIndex;
2809
2809
  }
2810
- return i2 < s15.length && t2.push(...Br(s15.slice(i2))), t2;
2810
+ return i2 < s15.length && t2.push(...Or2(s15.slice(i2))), t2;
2811
2811
  }
2812
2812
  var Yu = async (s15, t2) => {
2813
2813
  let i2 = (s15.text ?? await t2.decodeUtf8([s15.bytes])).replace(/\r\n?/g, `
@@ -2999,14 +2999,14 @@ var Dl = Object.freeze({ name: "mediawiki", operands: "join", reader: { format:
2999
2999
  var ja = /* @__PURE__ */ Symbol.for("yaml.alias");
3000
3000
  var Wa = /* @__PURE__ */ Symbol.for("yaml.document");
3001
3001
  var Be = /* @__PURE__ */ Symbol.for("yaml.map");
3002
- var Or2 = /* @__PURE__ */ Symbol.for("yaml.pair");
3002
+ var Nr = /* @__PURE__ */ Symbol.for("yaml.pair");
3003
3003
  var be = /* @__PURE__ */ Symbol.for("yaml.scalar");
3004
3004
  var li = /* @__PURE__ */ Symbol.for("yaml.seq");
3005
3005
  var oe = /* @__PURE__ */ Symbol.for("yaml.node.type");
3006
3006
  var Oe = (s15) => !!s15 && typeof s15 == "object" && s15[oe] === ja;
3007
3007
  var Ye = (s15) => !!s15 && typeof s15 == "object" && s15[oe] === Wa;
3008
3008
  var Ne = (s15) => !!s15 && typeof s15 == "object" && s15[oe] === Be;
3009
- var kt = (s15) => !!s15 && typeof s15 == "object" && s15[oe] === Or2;
3009
+ var kt = (s15) => !!s15 && typeof s15 == "object" && s15[oe] === Nr;
3010
3010
  var wt = (s15) => !!s15 && typeof s15 == "object" && s15[oe] === be;
3011
3011
  var Le = (s15) => !!s15 && typeof s15 == "object" && s15[oe] === li;
3012
3012
  function St(s15) {
@@ -3064,13 +3064,13 @@ function hn(s15, t2, e2, i2) {
3064
3064
  }
3065
3065
  return n;
3066
3066
  }
3067
- async function Ja(s15, t2) {
3067
+ async function Va(s15, t2) {
3068
3068
  let e2 = Ul(t2);
3069
3069
  Ye(s15) ? await pn(null, s15.contents, e2, Object.freeze([s15])) === Ge && (s15.contents = null) : await pn(null, s15, e2, Object.freeze([]));
3070
3070
  }
3071
- Ja.BREAK = ce;
3072
- Ja.SKIP = _l;
3073
- Ja.REMOVE = Ge;
3071
+ Va.BREAK = ce;
3072
+ Va.SKIP = _l;
3073
+ Va.REMOVE = Ge;
3074
3074
  async function pn(s15, t2, e2, i2) {
3075
3075
  let n = await Ml(s15, t2, e2, i2);
3076
3076
  if (vt(n) || kt(n)) return jl(s15, i2, n), pn(s15, n, e2, i2);
@@ -3198,20 +3198,20 @@ var Xe = class s {
3198
3198
  };
3199
3199
  Xe.defaultYaml = { explicit: false, version: "1.2" };
3200
3200
  Xe.defaultTags = { "!!": "tag:yaml.org,2002:" };
3201
- function Va(s15) {
3201
+ function Ja(s15) {
3202
3202
  if (/[\x00-\x19\s,[\]{}]/.test(s15)) {
3203
3203
  let e2 = `Anchor must not contain whitespace or control characters: ${JSON.stringify(s15)}`;
3204
3204
  throw new Error(e2);
3205
3205
  }
3206
3206
  return true;
3207
3207
  }
3208
- function Nr(s15) {
3208
+ function Lr(s15) {
3209
3209
  let t2 = /* @__PURE__ */ new Set();
3210
3210
  return ze(s15, { Value(e2, i2) {
3211
3211
  i2.anchor && t2.add(i2.anchor);
3212
3212
  } }), t2;
3213
3213
  }
3214
- function Lr(s15, t2) {
3214
+ function Fr(s15, t2) {
3215
3215
  for (let e2 = 1; ; ++e2) {
3216
3216
  let i2 = `${s15}${e2}`;
3217
3217
  if (!t2.has(i2)) return i2;
@@ -3220,8 +3220,8 @@ function Lr(s15, t2) {
3220
3220
  function Wl(s15, t2) {
3221
3221
  let e2 = [], i2 = /* @__PURE__ */ new Map(), n = null;
3222
3222
  return { onAnchor: (a) => {
3223
- e2.push(a), n ?? (n = Nr(s15));
3224
- let r = Lr(t2, n);
3223
+ e2.push(a), n ?? (n = Lr(s15));
3224
+ let r = Fr(t2, n);
3225
3225
  return n.add(r), r;
3226
3226
  }, setAnchors: () => {
3227
3227
  for (let a of e2) {
@@ -3321,7 +3321,7 @@ var ci = class extends Pi {
3321
3321
  toString(t2, e2, i2) {
3322
3322
  let n = `*${this.source}`;
3323
3323
  if (t2) {
3324
- if (Va(this.source), t2.options.verifyAliasOrder && !t2.anchors.has(this.source)) {
3324
+ if (Ja(this.source), t2.options.verifyAliasOrder && !t2.anchors.has(this.source)) {
3325
3325
  let a = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
3326
3326
  throw new Error(a);
3327
3327
  }
@@ -3472,7 +3472,7 @@ var Ke = (s15, t2, e2) => s15.endsWith(`
3472
3472
  `) ? ve(e2, t2) : e2.includes(`
3473
3473
  `) ? `
3474
3474
  ` + ve(e2, t2) : (s15.endsWith(" ") ? "" : " ") + e2;
3475
- var Fr = "flow";
3475
+ var $r = "flow";
3476
3476
  var Ga = "block";
3477
3477
  var zn = "quoted";
3478
3478
  function Xn(s15, t2, e2 = "flow", { indentAtStart: i2, lineWidth: n = 80, minContentWidth: a = 20, onFold: r, onOverflow: o2 } = {}) {
@@ -3483,7 +3483,7 @@ function Xn(s15, t2, e2 = "flow", { indentAtStart: i2, lineWidth: n = 80, minCon
3483
3483
  let f = [], c = {}, d = n - t2.length;
3484
3484
  typeof i2 == "number" && (i2 > n - Math.max(2, a) ? f.push(0) : d = n - i2);
3485
3485
  let u, h, p2 = false, m2 = -1, w = -1, y2 = -1;
3486
- e2 === Ga && (m2 = Jl(s15, m2, t2.length), m2 !== -1 && (d = m2 + l));
3486
+ e2 === Ga && (m2 = Vl(s15, m2, t2.length), m2 !== -1 && (d = m2 + l));
3487
3487
  for (let b; b = s15[m2 += 1]; ) {
3488
3488
  if (e2 === zn && b === "\\") {
3489
3489
  switch (w = m2, s15[m2 + 1]) {
@@ -3502,7 +3502,7 @@ function Xn(s15, t2, e2 = "flow", { indentAtStart: i2, lineWidth: n = 80, minCon
3502
3502
  y2 = m2;
3503
3503
  }
3504
3504
  if (b === `
3505
- `) e2 === Ga && (m2 = Jl(s15, m2, t2.length)), d = m2 + t2.length + l, u = void 0;
3505
+ `) e2 === Ga && (m2 = Vl(s15, m2, t2.length)), d = m2 + t2.length + l, u = void 0;
3506
3506
  else {
3507
3507
  if (b === " " && h && h !== " " && h !== `
3508
3508
  ` && h !== " ") {
@@ -3531,7 +3531,7 @@ ${t2}${s15.slice(x + 1, v)}`);
3531
3531
  }
3532
3532
  return g;
3533
3533
  }
3534
- function Jl(s15, t2, e2) {
3534
+ function Vl(s15, t2, e2) {
3535
3535
  let i2 = t2, n = t2 + 1, a = s15[n];
3536
3536
  for (; a === " " || a === " "; ) if (t2 < n + e2) a = s15[++t2];
3537
3537
  else {
@@ -3611,30 +3611,30 @@ function Kn(s15, t2) {
3611
3611
  }
3612
3612
  return r = o2 ? r + e2.slice(o2) : e2, i2 ? r : Xn(r, a, zn, Xa(t2, false));
3613
3613
  }
3614
- function $r(s15, t2) {
3614
+ function Dr(s15, t2) {
3615
3615
  if (t2.options.singleQuote === false || t2.implicitKey && s15.includes(`
3616
3616
  `) || /[ \t]\n|\n[ \t]/.test(s15)) return Kn(s15, t2);
3617
3617
  let e2 = t2.indent || (Ka(s15) ? " " : ""), i2 = "'" + s15.replace(/'/g, "''").replace(/\n+/g, `$&
3618
3618
  ${e2}`) + "'";
3619
- return t2.implicitKey ? i2 : Xn(i2, e2, Fr, Xa(t2, false));
3619
+ return t2.implicitKey ? i2 : Xn(i2, e2, $r, Xa(t2, false));
3620
3620
  }
3621
3621
  function gn(s15, t2) {
3622
3622
  let { singleQuote: e2 } = t2.options, i2;
3623
3623
  if (e2 === false) i2 = Kn;
3624
3624
  else {
3625
3625
  let n = s15.includes('"'), a = s15.includes("'");
3626
- n && !a ? i2 = $r : a && !n ? i2 = Kn : i2 = e2 ? $r : Kn;
3626
+ n && !a ? i2 = Dr : a && !n ? i2 = Kn : i2 = e2 ? Dr : Kn;
3627
3627
  }
3628
3628
  return i2(s15, t2);
3629
3629
  }
3630
- var Dr;
3630
+ var _r2;
3631
3631
  try {
3632
- Dr = new RegExp(`(^|(?<!
3632
+ _r2 = new RegExp(`(^|(?<!
3633
3633
  ))
3634
3634
  +(?!
3635
3635
  |$)`, "g");
3636
3636
  } catch {
3637
- Dr = /\n+(?!\n|$)/g;
3637
+ _r2 = /\n+(?!\n|$)/g;
3638
3638
  }
3639
3639
  function za({ comment: s15, type: t2, value: e2 }, i2, n, a) {
3640
3640
  let { blockQuote: r, commentString: o2, lineWidth: l } = i2.options;
@@ -3652,7 +3652,7 @@ function za({ comment: s15, type: t2, value: e2 }, i2, n, a) {
3652
3652
  let h = e2.substring(u), p2 = h.indexOf(`
3653
3653
  `);
3654
3654
  p2 === -1 ? d = "-" : e2 === h || p2 !== h.length - 1 ? (d = "+", a && a()) : d = "", h && (e2 = e2.slice(0, -h.length), h[h.length - 1] === `
3655
- ` && (h = h.slice(0, -1)), h = h.replace(Dr, `$&${f}`));
3655
+ ` && (h = h.slice(0, -1)), h = h.replace(_r2, `$&${f}`));
3656
3656
  let m2 = false, w, y2 = -1;
3657
3657
  for (w = 0; w < e2.length; ++w) {
3658
3658
  let v = e2[w];
@@ -3695,7 +3695,7 @@ ${l}`);
3695
3695
  let u = (m2) => m2.default && m2.tag !== "tag:yaml.org,2002:str" && m2.test?.test(d), { compat: h, tags: p2 } = t2.doc.schema;
3696
3696
  if (p2.some(u) || h?.some(u)) return gn(a, t2);
3697
3697
  }
3698
- return o2 ? d : Xn(d, l, Fr, Xa(t2, false));
3698
+ return o2 ? d : Xn(d, l, $r, Xa(t2, false));
3699
3699
  }
3700
3700
  function Gi(s15, t2, e2, i2) {
3701
3701
  let { implicitKey: n, inFlow: a } = t2, r = typeof s15.value == "string" ? s15 : Object.assign({}, s15, { value: String(s15.value) }), { type: o2 } = s15;
@@ -3708,7 +3708,7 @@ function Gi(s15, t2, e2, i2) {
3708
3708
  case rt.QUOTE_DOUBLE:
3709
3709
  return Kn(r.value, t2);
3710
3710
  case rt.QUOTE_SINGLE:
3711
- return $r(r.value, t2);
3711
+ return Dr(r.value, t2);
3712
3712
  case rt.PLAIN:
3713
3713
  return th(r, t2, e2, i2);
3714
3714
  default:
@@ -3759,7 +3759,7 @@ function eh(s15, t2) {
3759
3759
  function ih(s15, t2, { anchors: e2, doc: i2 }) {
3760
3760
  if (!i2.directives) return "";
3761
3761
  let n = [], a = (wt(s15) || St(s15)) && s15.anchor;
3762
- a && Va(a) && (e2.add(a), n.push(`&${a}`));
3762
+ a && Ja(a) && (e2.add(a), n.push(`&${a}`));
3763
3763
  let r = s15.tag ?? (t2.default ? null : t2.tag);
3764
3764
  return r && n.push(i2.directives.tagString(r)), n.join(" ");
3765
3765
  }
@@ -3778,7 +3778,7 @@ function di(s15, t2, e2, i2) {
3778
3778
  return r ? wt(a) || o2[0] === "{" || o2[0] === "[" ? `${r} ${o2}` : `${r}
3779
3779
  ${t2.indent}${o2}` : o2;
3780
3780
  }
3781
- function Vl({ key: s15, value: t2 }, e2, i2, n) {
3781
+ function Jl({ key: s15, value: t2 }, e2, i2, n) {
3782
3782
  let { allNullValues: a, doc: r, indent: o2, indentStep: l, options: { commentString: f, indentSeq: c, simpleKeys: d } } = e2, u = vt(s15) && s15.comment || null;
3783
3783
  if (d) {
3784
3784
  if (u) throw new Error("With simple keys, key nodes cannot have comments");
@@ -3830,19 +3830,19 @@ ${e2.indent}`);
3830
3830
  `) && (k = "");
3831
3831
  return w += k + v, e2.inFlow ? x && i2 && i2() : b && !x ? w += Ke(w, e2.indent, f(b)) : m2 && n && n(), w;
3832
3832
  }
3833
- function _r2(s15, t2) {
3833
+ function Ur(s15, t2) {
3834
3834
  (s15 === "debug" || s15 === "warn") && console.warn(t2);
3835
3835
  }
3836
3836
  var Za = "<<";
3837
- var Fe = { identify: (s15) => s15 === Za || typeof s15 == "symbol" && s15.description === Za, default: "key", tag: "tag:yaml.org,2002:merge", test: /^<<$/, resolve: () => Object.assign(new rt(Symbol(Za)), { addToJSMap: Mr }), stringify: () => Za };
3837
+ var Fe = { identify: (s15) => s15 === Za || typeof s15 == "symbol" && s15.description === Za, default: "key", tag: "tag:yaml.org,2002:merge", test: /^<<$/, resolve: () => Object.assign(new rt(Symbol(Za)), { addToJSMap: jr }), stringify: () => Za };
3838
3838
  var Hl = (s15, t2) => (Fe.identify(t2) || wt(t2) && (!t2.type || t2.type === rt.PLAIN) && Fe.identify(t2.value)) && s15?.doc.schema.tags.some((e2) => e2.tag === Fe.tag && e2.default);
3839
- function Mr(s15, t2, e2) {
3839
+ function jr(s15, t2, e2) {
3840
3840
  let i2 = Yl(s15, e2);
3841
- if (Le(i2)) for (let n of i2.items) Ur(s15, t2, n);
3842
- else if (Array.isArray(i2)) for (let n of i2) Ur(s15, t2, n);
3843
- else Ur(s15, t2, i2);
3841
+ if (Le(i2)) for (let n of i2.items) Mr(s15, t2, n);
3842
+ else if (Array.isArray(i2)) for (let n of i2) Mr(s15, t2, n);
3843
+ else Mr(s15, t2, i2);
3844
3844
  }
3845
- function Ur(s15, t2, e2) {
3845
+ function Mr(s15, t2, e2) {
3846
3846
  let i2 = Yl(s15, e2);
3847
3847
  if (!Ne(i2)) throw new Error("Merge sources must be maps or map aliases");
3848
3848
  let n = i2.toJSON(null, s15, Map);
@@ -3854,7 +3854,7 @@ function Yl(s15, t2) {
3854
3854
  }
3855
3855
  function ts(s15, t2, { key: e2, value: i2 }) {
3856
3856
  if (vt(e2) && e2.addToJSMap) e2.addToJSMap(s15, t2, i2);
3857
- else if (Hl(s15, e2)) Mr(s15, t2, i2);
3857
+ else if (Hl(s15, e2)) jr(s15, t2, i2);
3858
3858
  else {
3859
3859
  let n = Ht(e2, "", s15);
3860
3860
  if (t2 instanceof Map) t2.set(n, Ht(i2, n, s15));
@@ -3877,7 +3877,7 @@ function nh(s15, t2, e2) {
3877
3877
  let n = s15.toString(i2);
3878
3878
  if (!e2.mapKeyWarned) {
3879
3879
  let a = JSON.stringify(n);
3880
- a.length > 40 && (a = a.substring(0, 36) + '..."'), _r2(e2.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`), e2.mapKeyWarned = true;
3880
+ a.length > 40 && (a = a.substring(0, 36) + '..."'), Ur(e2.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`), e2.mapKeyWarned = true;
3881
3881
  }
3882
3882
  return n;
3883
3883
  }
@@ -3889,7 +3889,7 @@ function bn(s15, t2, e2) {
3889
3889
  }
3890
3890
  var Ut = class s2 {
3891
3891
  constructor(t2, e2 = null) {
3892
- Object.defineProperty(this, oe, { value: Or2 }), this.key = t2, this.value = e2;
3892
+ Object.defineProperty(this, oe, { value: Nr }), this.key = t2, this.value = e2;
3893
3893
  }
3894
3894
  clone(t2) {
3895
3895
  let { key: e2, value: i2 } = this;
@@ -3900,7 +3900,7 @@ var Ut = class s2 {
3900
3900
  return ts(e2, i2, this);
3901
3901
  }
3902
3902
  toString(t2, e2, i2) {
3903
- return t2?.doc ? Vl(this, t2, e2, i2) : JSON.stringify(this);
3903
+ return t2?.doc ? Jl(this, t2, e2, i2) : JSON.stringify(this);
3904
3904
  }
3905
3905
  };
3906
3906
  function is(s15, t2, e2) {
@@ -4130,14 +4130,14 @@ var rs = { identify: (s15) => typeof s15 == "number", default: true, tag: "tag:y
4130
4130
  return e2 !== -1 && s15[s15.length - 1] === "0" && (t2.minFractionDigits = s15.length - e2 - 1), t2;
4131
4131
  }, stringify: ie };
4132
4132
  var os = (s15) => typeof s15 == "bigint" || Number.isInteger(s15);
4133
- var jr = (s15, t2, e2, { intAsBigInt: i2 }) => i2 ? BigInt(s15) : parseInt(s15.substring(t2), e2);
4133
+ var Wr = (s15, t2, e2, { intAsBigInt: i2 }) => i2 ? BigInt(s15) : parseInt(s15.substring(t2), e2);
4134
4134
  function Gl(s15, t2, e2) {
4135
4135
  let { value: i2 } = s15;
4136
4136
  return os(i2) && i2 >= 0 ? e2 + i2.toString(t2) : ie(s15);
4137
4137
  }
4138
- var ls = { identify: (s15) => os(s15) && s15 >= 0, default: true, tag: "tag:yaml.org,2002:int", format: "OCT", test: /^0o[0-7]+$/, resolve: (s15, t2, e2) => jr(s15, 2, 8, e2), stringify: (s15) => Gl(s15, 8, "0o") };
4139
- var cs = { identify: os, default: true, tag: "tag:yaml.org,2002:int", test: /^[-+]?[0-9]+$/, resolve: (s15, t2, e2) => jr(s15, 0, 10, e2), stringify: ie };
4140
- var fs = { identify: (s15) => os(s15) && s15 >= 0, default: true, tag: "tag:yaml.org,2002:int", format: "HEX", test: /^0x[0-9a-fA-F]+$/, resolve: (s15, t2, e2) => jr(s15, 2, 16, e2), stringify: (s15) => Gl(s15, 16, "0x") };
4138
+ var ls = { identify: (s15) => os(s15) && s15 >= 0, default: true, tag: "tag:yaml.org,2002:int", format: "OCT", test: /^0o[0-7]+$/, resolve: (s15, t2, e2) => Wr(s15, 2, 8, e2), stringify: (s15) => Gl(s15, 8, "0o") };
4139
+ var cs = { identify: os, default: true, tag: "tag:yaml.org,2002:int", test: /^[-+]?[0-9]+$/, resolve: (s15, t2, e2) => Wr(s15, 0, 10, e2), stringify: ie };
4140
+ var fs = { identify: (s15) => os(s15) && s15 >= 0, default: true, tag: "tag:yaml.org,2002:int", format: "HEX", test: /^0x[0-9a-fA-F]+$/, resolve: (s15, t2, e2) => Wr(s15, 2, 16, e2), stringify: (s15) => Gl(s15, 16, "0x") };
4141
4141
  var zl = [$e, De, Ci, zi, Qn, ls, cs, fs, as, ss, rs];
4142
4142
  function Xl(s15) {
4143
4143
  return typeof s15 == "bigint" || Number.isInteger(s15);
@@ -4170,7 +4170,7 @@ var Zn = { identify: (s15) => s15 instanceof Uint8Array, default: false, tag: "t
4170
4170
  }
4171
4171
  return Gi({ comment: s15, type: t2, value: o2 }, i2, n, a);
4172
4172
  } };
4173
- function Wr(s15, t2) {
4173
+ function qr(s15, t2) {
4174
4174
  if (Le(s15)) for (let e2 = 0; e2 < s15.items.length; ++e2) {
4175
4175
  let i2 = s15.items[e2];
4176
4176
  if (!kt(i2)) {
@@ -4191,7 +4191,7 @@ ${a.comment}` : i2.comment;
4191
4191
  else t2("Expected a sequence for this tag");
4192
4192
  return s15;
4193
4193
  }
4194
- function qr(s15, t2, e2) {
4194
+ function Vr(s15, t2, e2) {
4195
4195
  let { replacer: i2 } = e2, n = new ee(s15);
4196
4196
  n.tag = "tag:yaml.org,2002:pairs";
4197
4197
  let a = 0;
@@ -4209,7 +4209,7 @@ function qr(s15, t2, e2) {
4209
4209
  }
4210
4210
  return n;
4211
4211
  }
4212
- var ta = { collection: "seq", default: false, tag: "tag:yaml.org,2002:pairs", resolve: Wr, createNode: qr };
4212
+ var ta = { collection: "seq", default: false, tag: "tag:yaml.org,2002:pairs", resolve: qr, createNode: Vr };
4213
4213
  var yn = class s3 extends ee {
4214
4214
  constructor() {
4215
4215
  super(), this.add = Mt.prototype.add.bind(this), this.delete = Mt.prototype.delete.bind(this), this.get = Mt.prototype.get.bind(this), this.has = Mt.prototype.has.bind(this), this.set = Mt.prototype.set.bind(this), this.tag = s3.tag;
@@ -4226,21 +4226,21 @@ var yn = class s3 extends ee {
4226
4226
  return i2;
4227
4227
  }
4228
4228
  static from(t2, e2, i2) {
4229
- let n = qr(t2, e2, i2), a = new this();
4229
+ let n = Vr(t2, e2, i2), a = new this();
4230
4230
  return a.items = n.items, a;
4231
4231
  }
4232
4232
  };
4233
4233
  yn.tag = "tag:yaml.org,2002:omap";
4234
4234
  var ea = { collection: "seq", identify: (s15) => s15 instanceof Map, nodeClass: yn, default: false, tag: "tag:yaml.org,2002:omap", resolve(s15, t2) {
4235
- let e2 = Wr(s15, t2), i2 = [];
4235
+ let e2 = qr(s15, t2), i2 = [];
4236
4236
  for (let { key: n } of e2.items) wt(n) && (i2.includes(n.value) ? t2(`Ordered maps must not include duplicate keys: ${n.value}`) : i2.push(n.value));
4237
4237
  return Object.assign(new yn(), e2);
4238
4238
  }, createNode: (s15, t2, e2) => yn.from(s15, t2, e2) };
4239
4239
  function Ql({ value: s15, source: t2 }, e2) {
4240
- return t2 && (s15 ? Jr : Vr).test.test(t2) ? t2 : s15 ? e2.options.trueStr : e2.options.falseStr;
4240
+ return t2 && (s15 ? Jr : Hr).test.test(t2) ? t2 : s15 ? e2.options.trueStr : e2.options.falseStr;
4241
4241
  }
4242
4242
  var Jr = { identify: (s15) => s15 === true, default: true, tag: "tag:yaml.org,2002:bool", test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/, resolve: () => new rt(true), stringify: Ql };
4243
- var Vr = { identify: (s15) => s15 === false, default: true, tag: "tag:yaml.org,2002:bool", test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/, resolve: () => new rt(false), stringify: Ql };
4243
+ var Hr = { identify: (s15) => s15 === false, default: true, tag: "tag:yaml.org,2002:bool", test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/, resolve: () => new rt(false), stringify: Ql };
4244
4244
  var Zl = { identify: (s15) => typeof s15 == "number", default: true, tag: "tag:yaml.org,2002:float", test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/, resolve: (s15) => s15.slice(-3).toLowerCase() === "nan" ? NaN : s15[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, stringify: ie };
4245
4245
  var tc = { identify: (s15) => typeof s15 == "number", default: true, tag: "tag:yaml.org,2002:float", format: "EXP", test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/, resolve: (s15) => parseFloat(s15.replace(/_/g, "")), stringify(s15) {
4246
4246
  let t2 = Number(s15.value);
@@ -4275,7 +4275,7 @@ function us(s15, t2, e2, { intAsBigInt: i2 }) {
4275
4275
  let a = parseInt(s15, e2);
4276
4276
  return n === "-" ? -1 * a : a;
4277
4277
  }
4278
- function Hr(s15, t2, e2) {
4278
+ function Yr(s15, t2, e2) {
4279
4279
  let { value: i2 } = s15;
4280
4280
  if (ia(i2)) {
4281
4281
  let n = i2.toString(t2);
@@ -4283,10 +4283,10 @@ function Hr(s15, t2, e2) {
4283
4283
  }
4284
4284
  return ie(s15);
4285
4285
  }
4286
- var ic = { identify: ia, default: true, tag: "tag:yaml.org,2002:int", format: "BIN", test: /^[-+]?0b[0-1_]+$/, resolve: (s15, t2, e2) => us(s15, 2, 2, e2), stringify: (s15) => Hr(s15, 2, "0b") };
4287
- var nc = { identify: ia, default: true, tag: "tag:yaml.org,2002:int", format: "OCT", test: /^[-+]?0[0-7_]+$/, resolve: (s15, t2, e2) => us(s15, 1, 8, e2), stringify: (s15) => Hr(s15, 8, "0") };
4286
+ var ic = { identify: ia, default: true, tag: "tag:yaml.org,2002:int", format: "BIN", test: /^[-+]?0b[0-1_]+$/, resolve: (s15, t2, e2) => us(s15, 2, 2, e2), stringify: (s15) => Yr(s15, 2, "0b") };
4287
+ var nc = { identify: ia, default: true, tag: "tag:yaml.org,2002:int", format: "OCT", test: /^[-+]?0[0-7_]+$/, resolve: (s15, t2, e2) => us(s15, 1, 8, e2), stringify: (s15) => Yr(s15, 8, "0") };
4288
4288
  var ac = { identify: ia, default: true, tag: "tag:yaml.org,2002:int", test: /^[-+]?[0-9][0-9_]*$/, resolve: (s15, t2, e2) => us(s15, 0, 10, e2), stringify: ie };
4289
- var sc = { identify: ia, default: true, tag: "tag:yaml.org,2002:int", format: "HEX", test: /^[-+]?0x[0-9a-fA-F_]+$/, resolve: (s15, t2, e2) => us(s15, 2, 16, e2), stringify: (s15) => Hr(s15, 16, "0x") };
4289
+ var sc = { identify: ia, default: true, tag: "tag:yaml.org,2002:int", format: "HEX", test: /^[-+]?0x[0-9a-fA-F_]+$/, resolve: (s15, t2, e2) => us(s15, 2, 16, e2), stringify: (s15) => Yr(s15, 16, "0x") };
4290
4290
  var xn = class s4 extends Mt {
4291
4291
  constructor(t2) {
4292
4292
  super(t2), this.tag = s4.tag;
@@ -4326,7 +4326,7 @@ var na = { collection: "map", identify: (s15) => s15 instanceof Set, nodeClass:
4326
4326
  } else t2("Expected a mapping for this tag");
4327
4327
  return s15;
4328
4328
  } };
4329
- function Yr(s15, t2) {
4329
+ function Gr(s15, t2) {
4330
4330
  let e2 = s15[0], i2 = e2 === "-" || e2 === "+" ? s15.substring(1) : s15, n = (r) => t2 ? BigInt(r) : Number(r), a = i2.replace(/_/g, "").split(":").reduce((r, o2) => r * n(60) + n(o2), n(0));
4331
4331
  return e2 === "-" ? n(-1) * a : a;
4332
4332
  }
@@ -4339,20 +4339,20 @@ function rc(s15) {
4339
4339
  let n = e2(60), a = [t2 % n];
4340
4340
  return t2 < 60 ? a.unshift(0) : (t2 = (t2 - a[0]) / n, a.unshift(t2 % n), t2 >= 60 && (t2 = (t2 - a[0]) / n, a.unshift(t2))), i2 + a.map((r) => String(r).padStart(2, "0")).join(":").replace(/000000\d*$/, "");
4341
4341
  }
4342
- var hs = { identify: (s15) => typeof s15 == "bigint" || Number.isInteger(s15), default: true, tag: "tag:yaml.org,2002:int", format: "TIME", test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/, resolve: (s15, t2, { intAsBigInt: e2 }) => Yr(s15, e2), stringify: rc };
4343
- var ps = { identify: (s15) => typeof s15 == "number", default: true, tag: "tag:yaml.org,2002:float", format: "TIME", test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/, resolve: (s15) => Yr(s15, false), stringify: rc };
4342
+ var hs = { identify: (s15) => typeof s15 == "bigint" || Number.isInteger(s15), default: true, tag: "tag:yaml.org,2002:int", format: "TIME", test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/, resolve: (s15, t2, { intAsBigInt: e2 }) => Gr(s15, e2), stringify: rc };
4343
+ var ps = { identify: (s15) => typeof s15 == "number", default: true, tag: "tag:yaml.org,2002:float", format: "TIME", test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/, resolve: (s15) => Gr(s15, false), stringify: rc };
4344
4344
  var kn = { identify: (s15) => s15 instanceof Date, default: true, tag: "tag:yaml.org,2002:timestamp", test: RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"), resolve(s15) {
4345
4345
  let t2 = s15.match(kn.test);
4346
4346
  if (!t2) throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");
4347
4347
  let [, e2, i2, n, a, r, o2] = t2.map(Number), l = t2[7] ? Number((t2[7] + "00").substr(1, 3)) : 0, f = Date.UTC(e2, i2 - 1, n, a || 0, r || 0, o2 || 0, l), c = t2[8];
4348
4348
  if (c && c !== "Z") {
4349
- let d = Yr(c, false);
4349
+ let d = Gr(c, false);
4350
4350
  Math.abs(d) < 30 && (d *= 60), f -= 6e4 * d;
4351
4351
  }
4352
4352
  return new Date(f);
4353
4353
  }, stringify: ({ value: s15 }) => s15?.toISOString().replace(/(T00:00:00)?\.000Z$/, "") ?? "" };
4354
- var Gr = [$e, De, Ci, zi, Jr, Vr, ic, nc, ac, sc, Zl, tc, ec, Zn, Fe, ea, ta, na, hs, ps, kn];
4355
- var oc = /* @__PURE__ */ new Map([["core", zl], ["failsafe", [$e, De, Ci]], ["json", Kl], ["yaml11", Gr], ["yaml-1.1", Gr]]);
4354
+ var zr = [$e, De, Ci, zi, Jr, Hr, ic, nc, ac, sc, Zl, tc, ec, Zn, Fe, ea, ta, na, hs, ps, kn];
4355
+ var oc = /* @__PURE__ */ new Map([["core", zl], ["failsafe", [$e, De, Ci]], ["json", Kl], ["yaml11", zr], ["yaml-1.1", zr]]);
4356
4356
  var lc = { binary: Zn, bool: Qn, float: rs, floatExp: ss, floatNaN: as, floatTime: ps, int: cs, intHex: fs, intOct: ls, intTime: hs, map: $e, merge: Fe, null: zi, omap: ea, pairs: ta, seq: De, set: na, timestamp: kn };
4357
4357
  var cc = { "tag:yaml.org,2002:binary": Zn, "tag:yaml.org,2002:merge": Fe, "tag:yaml.org,2002:omap": ea, "tag:yaml.org,2002:pairs": ta, "tag:yaml.org,2002:set": na, "tag:yaml.org,2002:timestamp": kn };
4358
4358
  function ms(s15, t2, e2) {
@@ -4445,8 +4445,8 @@ var Bi = class s6 {
4445
4445
  }
4446
4446
  createAlias(t2, e2) {
4447
4447
  if (!t2.anchor) {
4448
- let i2 = Nr(this);
4449
- t2.anchor = !e2 || i2.has(e2) ? Lr(e2 || "a", i2) : e2;
4448
+ let i2 = Lr(this);
4449
+ t2.anchor = !e2 || i2.has(e2) ? Fr(e2 || "a", i2) : e2;
4450
4450
  }
4451
4451
  return new ci(t2.anchor);
4452
4452
  }
@@ -4547,7 +4547,7 @@ var ra = class extends sa {
4547
4547
  super("YAMLWarning", t2, e2, i2);
4548
4548
  }
4549
4549
  };
4550
- var zr = (s15, t2) => (e2) => {
4550
+ var Xr = (s15, t2) => (e2) => {
4551
4551
  if (e2.pos[0] === -1) return;
4552
4552
  e2.linePos = e2.pos.map((o2) => t2.linePos(o2));
4553
4553
  let { line: i2, col: n } = e2.linePos[0];
@@ -4724,8 +4724,8 @@ function Ze(s15, t2, e2, i2) {
4724
4724
  }
4725
4725
  return { comment: n, offset: t2 };
4726
4726
  }
4727
- var Xr = "Block collections are not allowed within flow collections";
4728
- var Kr = (s15) => s15 && (s15.type === "block-map" || s15.type === "block-seq");
4727
+ var Kr = "Block collections are not allowed within flow collections";
4728
+ var Qr = (s15) => s15 && (s15.type === "block-map" || s15.type === "block-seq");
4729
4729
  function pc({ composeNode: s15, composeEmptyNode: t2 }, e2, i2, n, a) {
4730
4730
  let r = i2.start.source === "{", o2 = r ? "flow map" : "flow sequence", l = a?.nodeClass ?? (r ? Mt : ee), f = new l(e2.schema);
4731
4731
  f.flow = true;
@@ -4763,11 +4763,11 @@ function pc({ composeNode: s15, composeEmptyNode: t2 }, e2, i2, n, a) {
4763
4763
  }
4764
4764
  if (!r && !x && !k.found) {
4765
4765
  let T = v ? s15(e2, v, k, n) : t2(e2, k.end, x, null, k, n);
4766
- f.items.push(T), d = T.range[2], Kr(v) && n(T.range, "BLOCK_IN_FLOW", Xr);
4766
+ f.items.push(T), d = T.range[2], Qr(v) && n(T.range, "BLOCK_IN_FLOW", Kr);
4767
4767
  } else {
4768
4768
  e2.atKey = true;
4769
4769
  let T = k.end, E = b ? s15(e2, b, k, n) : t2(e2, T, g, null, k, n);
4770
- Kr(b) && n(E.range, "BLOCK_IN_FLOW", Xr), e2.atKey = false;
4770
+ Qr(b) && n(E.range, "BLOCK_IN_FLOW", Kr), e2.atKey = false;
4771
4771
  let A = Qe(x ?? [], { flow: o2, indicator: "map-value-ind", next: v, offset: E.range[2], onError: n, parentIndent: i2.indent, startOnNewline: false });
4772
4772
  if (A.found) {
4773
4773
  if (!r && !k.found && e2.options.strict) {
@@ -4782,7 +4782,7 @@ function pc({ composeNode: s15, composeEmptyNode: t2 }, e2, i2, n, a) {
4782
4782
  }
4783
4783
  } else v && ("source" in v && v.source?.[0] === ":" ? n(v, "MISSING_CHAR", `Missing space after : in ${o2}`) : n(A.start, "MISSING_CHAR", `Missing , or : between ${o2} items`));
4784
4784
  let I = v ? s15(e2, v, A, n) : A.found ? t2(e2, A.end, x, null, A, n) : null;
4785
- I ? Kr(v) && n(I.range, "BLOCK_IN_FLOW", Xr) : A.comment && (E.comment ? E.comment += `
4785
+ I ? Qr(v) && n(I.range, "BLOCK_IN_FLOW", Kr) : A.comment && (E.comment ? E.comment += `
4786
4786
  ` + A.comment : E.comment = A.comment);
4787
4787
  let F = new Ut(E, I);
4788
4788
  if (e2.options.keepSourceTokens && (F.srcToken = y2), r) {
@@ -4810,7 +4810,7 @@ function pc({ composeNode: s15, composeEmptyNode: t2 }, e2, i2, n, a) {
4810
4810
  } else f.range = [i2.offset, m2, m2];
4811
4811
  return f;
4812
4812
  }
4813
- function Qr(s15, t2, e2, i2, n, a) {
4813
+ function Zr(s15, t2, e2, i2, n, a) {
4814
4814
  let r = e2.type === "block-map" ? uc(s15, t2, e2, i2, a) : e2.type === "block-seq" ? hc(s15, t2, e2, i2, a) : pc(s15, t2, e2, i2, a), o2 = r.constructor;
4815
4815
  return n === "!" || n === o2.tagName ? (r.tag = o2.tagName, r) : (n && (r.tag = n), r);
4816
4816
  }
@@ -4821,17 +4821,17 @@ function mc(s15, t2, e2, i2, n) {
4821
4821
  p2 && (!h || h.offset < p2.offset) && n(p2, "MISSING_CHAR", "Missing newline after block sequence props");
4822
4822
  }
4823
4823
  let o2 = e2.type === "block-map" ? "map" : e2.type === "block-seq" ? "seq" : e2.start.source === "{" ? "map" : "seq";
4824
- if (!a || !r || r === "!" || r === Mt.tagName && o2 === "map" || r === ee.tagName && o2 === "seq") return Qr(s15, t2, e2, n, r);
4824
+ if (!a || !r || r === "!" || r === Mt.tagName && o2 === "map" || r === ee.tagName && o2 === "seq") return Zr(s15, t2, e2, n, r);
4825
4825
  let l = t2.schema.tags.find((u) => u.tag === r && u.collection === o2);
4826
4826
  if (!l) {
4827
4827
  let u = t2.schema.knownTags[r];
4828
4828
  if (u?.collection === o2) t2.schema.tags.push(Object.assign({}, u, { default: false })), l = u;
4829
- else return u ? n(a, "BAD_COLLECTION_TYPE", `${u.tag} used for ${o2} collection, but expects ${u.collection ?? "scalar"}`, true) : n(a, "TAG_RESOLVE_FAILED", `Unresolved tag: ${r}`, true), Qr(s15, t2, e2, n, r);
4829
+ else return u ? n(a, "BAD_COLLECTION_TYPE", `${u.tag} used for ${o2} collection, but expects ${u.collection ?? "scalar"}`, true) : n(a, "TAG_RESOLVE_FAILED", `Unresolved tag: ${r}`, true), Zr(s15, t2, e2, n, r);
4830
4830
  }
4831
- let f = Qr(s15, t2, e2, n, r, l), c = l.resolve?.(f, (u) => n(a, "TAG_RESOLVE_FAILED", u), t2.options) ?? f, d = vt(c) ? c : new rt(c);
4831
+ let f = Zr(s15, t2, e2, n, r, l), c = l.resolve?.(f, (u) => n(a, "TAG_RESOLVE_FAILED", u), t2.options) ?? f, d = vt(c) ? c : new rt(c);
4832
4832
  return d.range = f.range, d.tag = r, l?.format && (d.format = l.format), d;
4833
4833
  }
4834
- function Zr(s15, t2, e2) {
4834
+ function to(s15, t2, e2) {
4835
4835
  let i2 = t2.offset, n = ch(t2, s15.options.strict, e2);
4836
4836
  if (!n) return { value: "", type: null, comment: "", range: [i2, i2, i2] };
4837
4837
  let a = n.mode === ">" ? rt.BLOCK_FOLDED : rt.BLOCK_LITERAL, r = t2.source ? fh(t2.source) : [], o2 = r.length;
@@ -4937,7 +4937,7 @@ function fh(s15) {
4937
4937
  for (let r = 1; r < t2.length; r += 2) a.push([t2[r], t2[r + 1]]);
4938
4938
  return a;
4939
4939
  }
4940
- function to(s15, t2, e2) {
4940
+ function eo(s15, t2, e2) {
4941
4941
  let { offset: i2, type: n, source: a, end: r } = s15, o2, l, f = (u, h, p2) => e2(i2 + u, h, p2);
4942
4942
  switch (n) {
4943
4943
  case "scalar":
@@ -5054,8 +5054,8 @@ function wh(s15, t2, e2, i2) {
5054
5054
  return i2(t2 - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${o2}`), o2;
5055
5055
  }
5056
5056
  }
5057
- function eo(s15, t2, e2, i2) {
5058
- let { value: n, type: a, comment: r, range: o2 } = t2.type === "block-scalar" ? Zr(s15, t2, i2) : to(t2, s15.options.strict, i2), l = e2 ? s15.directives.tagName(e2.source, (d) => i2(e2, "TAG_RESOLVE_FAILED", d)) : null, f;
5057
+ function io(s15, t2, e2, i2) {
5058
+ let { value: n, type: a, comment: r, range: o2 } = t2.type === "block-scalar" ? to(s15, t2, i2) : eo(t2, s15.options.strict, i2), l = e2 ? s15.directives.tagName(e2.source, (d) => i2(e2, "TAG_RESOLVE_FAILED", d)) : null, f;
5059
5059
  s15.options.stringKeys && s15.atKey ? f = s15.schema[be] : l ? f = gh(s15.schema, n, l, e2, i2) : t2.type === "scalar" ? f = bh(s15, n, t2, i2) : f = s15.schema[be];
5060
5060
  let c;
5061
5061
  try {
@@ -5105,8 +5105,8 @@ function gc(s15, t2, e2) {
5105
5105
  }
5106
5106
  return s15;
5107
5107
  }
5108
- var yh = { composeNode: io, composeEmptyNode: gs };
5109
- function io(s15, t2, e2, i2) {
5108
+ var yh = { composeNode: no, composeEmptyNode: gs };
5109
+ function no(s15, t2, e2, i2) {
5110
5110
  let n = s15.atKey, { spaceBefore: a, comment: r, anchor: o2, tag: l } = e2, f, c = true;
5111
5111
  switch (t2.type) {
5112
5112
  case "alias":
@@ -5116,7 +5116,7 @@ function io(s15, t2, e2, i2) {
5116
5116
  case "single-quoted-scalar":
5117
5117
  case "double-quoted-scalar":
5118
5118
  case "block-scalar":
5119
- f = eo(s15, t2, l, i2), o2 && (f.anchor = o2.source.substring(1));
5119
+ f = io(s15, t2, l, i2), o2 && (f.anchor = o2.source.substring(1));
5120
5120
  break;
5121
5121
  case "block-map":
5122
5122
  case "block-seq":
@@ -5136,7 +5136,7 @@ function io(s15, t2, e2, i2) {
5136
5136
  return f ?? (f = gs(s15, t2.offset, void 0, null, e2, i2)), o2 && f.anchor === "" && i2(o2, "BAD_ALIAS", "Anchor cannot be an empty string"), n && s15.options.stringKeys && (!wt(f) || typeof f.value != "string" || f.tag && f.tag !== "tag:yaml.org,2002:str") && i2(l ?? t2, "NON_STRING_KEY", "With stringKeys, all keys must be strings"), a && (f.spaceBefore = true), r && (t2.type === "scalar" && t2.source === "" ? f.comment = r : f.commentBefore = r), s15.options.keepSourceTokens && c && (f.srcToken = t2), f;
5137
5137
  }
5138
5138
  function gs(s15, t2, e2, i2, { spaceBefore: n, comment: a, anchor: r, tag: o2, end: l }, f) {
5139
- let c = { type: "scalar", offset: gc(t2, e2, i2), indent: -1, source: "" }, d = eo(s15, c, o2, f);
5139
+ let c = { type: "scalar", offset: gc(t2, e2, i2), indent: -1, source: "" }, d = io(s15, c, o2, f);
5140
5140
  return r && (d.anchor = r.source.substring(1), d.anchor === "" && f(r, "BAD_ALIAS", "Anchor cannot be an empty string")), n && (d.spaceBefore = true), a && (d.comment = a, d.range[2] = l), d;
5141
5141
  }
5142
5142
  function xh({ options: s15 }, { offset: t2, source: e2, end: i2 }, n) {
@@ -5147,7 +5147,7 @@ function xh({ options: s15 }, { offset: t2, source: e2, end: i2 }, n) {
5147
5147
  }
5148
5148
  function bc(s15, t2, { offset: e2, start: i2, value: n, end: a }, r) {
5149
5149
  let o2 = Object.assign({ _directives: t2 }, s15), l = new Bi(void 0, o2), f = { atKey: false, atRoot: true, directives: l.directives, options: l.options, schema: l.schema }, c = Qe(i2, { indicator: "doc-start", next: n ?? a?.[0], offset: e2, onError: r, parentIndent: 0, startOnNewline: true });
5150
- c.found && (l.directives.docStart = true, n && (n.type === "block-map" || n.type === "block-seq") && !c.hasNewline && r(c.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker")), l.contents = n ? io(f, n, c, r) : gs(f, c.end, i2, null, c, r);
5150
+ c.found && (l.directives.docStart = true, n && (n.type === "block-map" || n.type === "block-seq") && !c.hasNewline && r(c.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker")), l.contents = n ? no(f, n, c, r) : gs(f, c.end, i2, null, c, r);
5151
5151
  let d = l.contents.range[2], u = Ze(a, d, false, r);
5152
5152
  return u.comment && (l.comment = u.comment), l.range = [e2, d, u.offset], l;
5153
5153
  }
@@ -5269,13 +5269,13 @@ ${e2.comment}` : e2.comment;
5269
5269
  }
5270
5270
  }
5271
5271
  };
5272
- var no = /* @__PURE__ */ Symbol("break visit");
5272
+ var ao = /* @__PURE__ */ Symbol("break visit");
5273
5273
  var kh = /* @__PURE__ */ Symbol("skip children");
5274
5274
  var xc = /* @__PURE__ */ Symbol("remove item");
5275
5275
  function Xi(s15, t2) {
5276
5276
  "type" in s15 && s15.type === "document" && (s15 = { start: s15.start, value: s15.value }), kc(Object.freeze([]), s15, t2);
5277
5277
  }
5278
- Xi.BREAK = no;
5278
+ Xi.BREAK = ao;
5279
5279
  Xi.SKIP = kh;
5280
5280
  Xi.REMOVE = xc;
5281
5281
  Xi.itemAtPath = (s15, t2) => {
@@ -5302,7 +5302,7 @@ function kc(s15, t2, e2) {
5302
5302
  let o2 = kc(Object.freeze(s15.concat([[n, r]])), a.items[r], e2);
5303
5303
  if (typeof o2 == "number") r = o2 - 1;
5304
5304
  else {
5305
- if (o2 === no) return no;
5305
+ if (o2 === ao) return ao;
5306
5306
  o2 === xc && (a.items.splice(r, 1), r -= 1);
5307
5307
  }
5308
5308
  }
@@ -5311,17 +5311,17 @@ function kc(s15, t2, e2) {
5311
5311
  }
5312
5312
  return typeof i2 == "function" ? i2(t2, s15) : i2;
5313
5313
  }
5314
- var ao = "\uFEFF";
5315
- var so = "";
5316
- var ro = "";
5314
+ var so = "\uFEFF";
5315
+ var ro = "";
5316
+ var oo = "";
5317
5317
  var bs = "";
5318
5318
  function vc(s15) {
5319
5319
  switch (s15) {
5320
- case ao:
5321
- return "byte-order-mark";
5322
5320
  case so:
5323
- return "doc-mode";
5321
+ return "byte-order-mark";
5324
5322
  case ro:
5323
+ return "doc-mode";
5324
+ case oo:
5325
5325
  return "flow-error-end";
5326
5326
  case bs:
5327
5327
  return "scalar";
@@ -5394,7 +5394,7 @@ var Th = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
5394
5394
  var ys = new Set(",[]{}");
5395
5395
  var Sh = new Set(` ,[]{}
5396
5396
  \r `);
5397
- var oo = (s15) => !s15 || Sh.has(s15);
5397
+ var lo = (s15) => !s15 || Sh.has(s15);
5398
5398
  var fa = class {
5399
5399
  constructor() {
5400
5400
  this.atEnd = false, this.blockScalarIndent = -1, this.blockScalarKeep = false, this.buffer = "", this.flowKey = false, this.flowLevel = 0, this.indentNext = 0, this.indentValue = 0, this.lineEndPos = null, this.next = null, this.pos = 0;
@@ -5474,7 +5474,7 @@ var fa = class {
5474
5474
  *parseStream() {
5475
5475
  let t2 = this.getLine();
5476
5476
  if (t2 === null) return this.setNext("stream");
5477
- if (t2[0] === ao && (yield* this.pushCount(1), t2 = t2.substring(1)), t2[0] === "%") {
5477
+ if (t2[0] === so && (yield* this.pushCount(1), t2 = t2.substring(1)), t2[0] === "%") {
5478
5478
  let e2 = t2.length, i2 = t2.indexOf("#");
5479
5479
  for (; i2 !== -1; ) {
5480
5480
  let a = t2[i2 - 1];
@@ -5495,7 +5495,7 @@ var fa = class {
5495
5495
  let e2 = yield* this.pushSpaces(true);
5496
5496
  return yield* this.pushCount(t2.length - e2), yield* this.pushNewline(), "stream";
5497
5497
  }
5498
- return yield so, yield* this.parseLineStart();
5498
+ return yield ro, yield* this.parseLineStart();
5499
5499
  }
5500
5500
  *parseLineStart() {
5501
5501
  let t2 = this.charAt(0);
@@ -5533,7 +5533,7 @@ var fa = class {
5533
5533
  case "]":
5534
5534
  return yield* this.pushCount(1), "doc";
5535
5535
  case "*":
5536
- return yield* this.pushUntil(oo), "doc";
5536
+ return yield* this.pushUntil(lo), "doc";
5537
5537
  case '"':
5538
5538
  case "'":
5539
5539
  return yield* this.parseQuotedScalar();
@@ -5551,7 +5551,7 @@ var fa = class {
5551
5551
  while (t2 + e2 > 0);
5552
5552
  let n = this.getLine();
5553
5553
  if (n === null) return this.setNext("flow");
5554
- if ((i2 !== -1 && i2 < this.indentNext && n[0] !== "#" || i2 === 0 && (n.startsWith("---") || n.startsWith("...")) && Ue(n[3])) && !(i2 === this.indentNext - 1 && this.flowLevel === 1 && (n[0] === "]" || n[0] === "}"))) return this.flowLevel = 0, yield ro, yield* this.parseLineStart();
5554
+ if ((i2 !== -1 && i2 < this.indentNext && n[0] !== "#" || i2 === 0 && (n.startsWith("---") || n.startsWith("...")) && Ue(n[3])) && !(i2 === this.indentNext - 1 && this.flowLevel === 1 && (n[0] === "]" || n[0] === "}"))) return this.flowLevel = 0, yield oo, yield* this.parseLineStart();
5555
5555
  let a = 0;
5556
5556
  for (; n[a] === ","; ) a += yield* this.pushCount(1), a += yield* this.pushSpaces(true), this.flowKey = false;
5557
5557
  switch (a += yield* this.pushIndicators(), n[a]) {
@@ -5566,7 +5566,7 @@ var fa = class {
5566
5566
  case "]":
5567
5567
  return yield* this.pushCount(1), this.flowKey = true, this.flowLevel -= 1, this.flowLevel ? "flow" : "doc";
5568
5568
  case "*":
5569
- return yield* this.pushUntil(oo), "flow";
5569
+ return yield* this.pushUntil(lo), "flow";
5570
5570
  case '"':
5571
5571
  case "'":
5572
5572
  return this.flowKey = true, yield* this.parseQuotedScalar();
@@ -5703,7 +5703,7 @@ var fa = class {
5703
5703
  t2 += yield* this.pushTag(), t2 += yield* this.pushSpaces(true);
5704
5704
  continue t;
5705
5705
  case "&":
5706
- t2 += yield* this.pushUntil(oo), t2 += yield* this.pushSpaces(true);
5706
+ t2 += yield* this.pushUntil(lo), t2 += yield* this.pushSpaces(true);
5707
5707
  continue t;
5708
5708
  case "-":
5709
5709
  case "?":
@@ -6276,7 +6276,7 @@ function ha(s15, t2 = {}) {
6276
6276
  r.errors.push(new _e(o2.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
6277
6277
  break;
6278
6278
  }
6279
- return i2 && e2 && (r.errors.forEach(zr(s15, e2)), r.warnings.forEach(zr(s15, e2))), r;
6279
+ return i2 && e2 && (r.errors.forEach(Xr(s15, e2)), r.warnings.forEach(Xr(s15, e2))), r;
6280
6280
  }
6281
6281
  var Sn = {};
6282
6282
  o(Sn, Zx);
@@ -6286,21 +6286,21 @@ var Li = {};
6286
6286
  o(Li, e1);
6287
6287
  var An = {};
6288
6288
  o(An, i1);
6289
- function lo(s15) {
6289
+ function co(s15) {
6290
6290
  if (typeof s15 == "string") return { t: "MetaString", c: s15 };
6291
6291
  if (typeof s15 == "number") return { t: "MetaString", c: String(s15) };
6292
6292
  if (typeof s15 == "boolean") return { t: "MetaBool", c: s15 };
6293
- if (Array.isArray(s15)) return { t: "MetaList", c: s15.map(lo).filter((e2) => e2 !== void 0) };
6293
+ if (Array.isArray(s15)) return { t: "MetaList", c: s15.map(co).filter((e2) => e2 !== void 0) };
6294
6294
  if (s15 && typeof s15 == "object") {
6295
6295
  let t2 = {};
6296
6296
  for (let [e2, i2] of Object.entries(s15)) {
6297
- let n = lo(i2);
6297
+ let n = co(i2);
6298
6298
  n !== void 0 && (t2[e2] = n);
6299
6299
  }
6300
6300
  return { t: "MetaMap", c: t2 };
6301
6301
  }
6302
6302
  }
6303
- var co = async (s15, t2, e2) => {
6303
+ var fo = async (s15, t2, e2) => {
6304
6304
  let i2 = e2?.extensions ?? {}, n = s15.text ?? await t2.decodeUtf8([s15.bytes]), a = {}, r = n, o2 = /^---[ \t]*\r?\n((?:[A-Za-z_][A-Za-z0-9_-]*[ \t]*:[^\r\n]*\r?\n|[ \t]+[^\r\n]*\r?\n)+)(?:---|\.\.\.)[ \t]*\r?\n(?=\s*\S)/.exec(n);
6305
6305
  if (o2) try {
6306
6306
  let u = ha(o2[1]);
@@ -6308,7 +6308,7 @@ var co = async (s15, t2, e2) => {
6308
6308
  let h = u.toJS({ maxAliasCount: 32 });
6309
6309
  if (h && typeof h == "object" && !Array.isArray(h)) {
6310
6310
  for (let [p2, m2] of Object.entries(h)) {
6311
- let w = lo(m2);
6311
+ let w = co(m2);
6312
6312
  w !== void 0 && (a[p2] = w);
6313
6313
  }
6314
6314
  r = n.slice(o2[0].length);
@@ -6373,7 +6373,7 @@ var co = async (s15, t2, e2) => {
6373
6373
  let c = await f(l.blocks, 1);
6374
6374
  return { blocks: i2.citations || a.bibliography !== void 0 || a.references !== void 0 ? Ce(c) : c, metadata: a, resources: [] };
6375
6375
  };
6376
- var Ic = { format: "commonmark", read: co };
6376
+ var Ic = { format: "commonmark", read: fo };
6377
6377
  function ti(s15) {
6378
6378
  if (s15.t !== "Span") return;
6379
6379
  let [t2, e2] = s15.c;
@@ -6453,7 +6453,7 @@ var pa = class s7 {
6453
6453
  n.kind === "text" && this.escaped(n.text, e2);
6454
6454
  }
6455
6455
  };
6456
- function fo(s15, t2) {
6456
+ function uo(s15, t2) {
6457
6457
  switch (s15.t) {
6458
6458
  case "Str":
6459
6459
  t2.add(s15.c);
@@ -6487,7 +6487,7 @@ function fo(s15, t2) {
6487
6487
  }
6488
6488
  }
6489
6489
  function ui(s15, t2) {
6490
- for (let e2 of s15) fo(e2, t2);
6490
+ for (let e2 of s15) uo(e2, t2);
6491
6491
  }
6492
6492
  function fe(s15, t2) {
6493
6493
  for (let [e2, i2] of s15.entries()) switch (e2 && t2.add(" "), i2.t) {
@@ -6556,7 +6556,7 @@ function ii(s15, t2, e2, i2) {
6556
6556
  case "Strong":
6557
6557
  case "Strikeout": {
6558
6558
  if (!i2) {
6559
- t2.loss(r, `Flattened cell inline ${a.t}`), t2.textProjection((l) => fo(a, l), false);
6559
+ t2.loss(r, `Flattened cell inline ${a.t}`), t2.textProjection((l) => uo(a, l), false);
6560
6560
  break;
6561
6561
  }
6562
6562
  let o2 = { Emph: "em", Strong: "strong", Strikeout: "del" }[a.t];
@@ -6574,14 +6574,14 @@ function ii(s15, t2, e2, i2) {
6574
6574
  i2 ? (t2.add("<span"), t2.attrs(a.c[0]), t2.add(">"), ii(a.c[1], t2, `${r}.c[1]`, true), t2.add("</span>")) : (t2.loss(r, "Flattened cell span formatting"), ii(a.c[1], t2, `${r}.c[1]`, false));
6575
6575
  break;
6576
6576
  default:
6577
- t2.loss(r, `Flattened cell inline ${a.t}`), t2.textProjection((o2) => fo(a, o2), i2);
6577
+ t2.loss(r, `Flattened cell inline ${a.t}`), t2.textProjection((o2) => uo(a, o2), i2);
6578
6578
  }
6579
6579
  }
6580
6580
  }
6581
6581
  function Ph(s15) {
6582
6582
  return s15.length === 0 || s15.length === 1 && (s15[0]?.t === "Plain" || s15[0]?.t === "Para");
6583
6583
  }
6584
- function uo(s15, t2, e2, i2, n = 0) {
6584
+ function ho(s15, t2, e2, i2, n = 0) {
6585
6585
  for (let [a, r] of s15.entries()) {
6586
6586
  let o2 = `${e2}[${a + n}]`;
6587
6587
  switch (r.t) {
@@ -6603,7 +6603,7 @@ function uo(s15, t2, e2, i2, n = 0) {
6603
6603
  break;
6604
6604
  }
6605
6605
  let l = r.t === "Div" ? "div" : "blockquote";
6606
- t2.add(`<${l}`), r.t === "Div" && t2.attrs(r.c[0]), t2.add(">"), uo(r.t === "Div" ? r.c[1] : r.c, t2, r.t === "Div" ? `${o2}.c[1]` : `${o2}.c`, true), t2.add(`</${l}>`);
6606
+ t2.add(`<${l}`), r.t === "Div" && t2.attrs(r.c[0]), t2.add(">"), ho(r.t === "Div" ? r.c[1] : r.c, t2, r.t === "Div" ? `${o2}.c[1]` : `${o2}.c`, true), t2.add(`</${l}>`);
6607
6607
  break;
6608
6608
  }
6609
6609
  case "BulletList":
@@ -6614,7 +6614,7 @@ function uo(s15, t2, e2, i2, n = 0) {
6614
6614
  }
6615
6615
  let l = r.t === "BulletList" ? "ul" : "ol";
6616
6616
  r.t === "OrderedList" && (r.c[0][1] !== "DefaultStyle" && r.c[0][1] !== "Decimal" || r.c[0][2] !== "DefaultDelim" && r.c[0][2] !== "Period") && t2.loss(o2, "Flattened list numbering style"), t2.add(`<${l}${r.t === "OrderedList" ? ` start="${r.c[0][0]}"` : ""}>`);
6617
- for (let [f, c] of (r.t === "BulletList" ? r.c : r.c[1]).entries()) t2.add("<li>"), uo(c, t2, `${o2}.c${r.t === "OrderedList" ? "[1]" : ""}[${f}]`, true), t2.add("</li>");
6617
+ for (let [f, c] of (r.t === "BulletList" ? r.c : r.c[1]).entries()) t2.add("<li>"), ho(c, t2, `${o2}.c${r.t === "OrderedList" ? "[1]" : ""}[${f}]`, true), t2.add("</li>");
6618
6618
  t2.add(`</${l}>`);
6619
6619
  break;
6620
6620
  }
@@ -6698,10 +6698,10 @@ async function Rc(s15, t2, e2, i2) {
6698
6698
  for (let [a, r] of s15.blocks.entries()) if (await t2.cooperate(), r.t === "Table") {
6699
6699
  if (e2?.extensions.pipe_tables === false) throw new t("E_CAPABILITY", t2.operation ?? "write", "GFM pipe_tables is disabled", "gfm", `$.blocks[${a}]`);
6700
6700
  await Rh(r, n, `$.blocks[${a}]`);
6701
- } else uo([r], n, "$.blocks", false, a);
6701
+ } else ho([r], n, "$.blocks", false, a);
6702
6702
  return n.finish();
6703
6703
  }
6704
- var ho = class {
6704
+ var po = class {
6705
6705
  constructor(t2, e2) {
6706
6706
  this.context = t2;
6707
6707
  this.selection = e2;
@@ -6940,7 +6940,7 @@ var ho = class {
6940
6940
  };
6941
6941
  async function Ts(s15, t2, e2) {
6942
6942
  if (!e2) throw new t("E_INTERNAL", t2.operation ?? "write", "Markdown requires format selection");
6943
- let i2 = new ho(t2, e2), n = async (o2) => {
6943
+ let i2 = new po(t2, e2), n = async (o2) => {
6944
6944
  if (await t2.cooperate(), !(!o2 || typeof o2 != "object")) {
6945
6945
  if ("t" in o2 && (o2.t === "Link" || o2.t === "Image")) {
6946
6946
  let l = o2.c[2];
@@ -6962,12 +6962,12 @@ async function Ts(s15, t2, e2) {
6962
6962
  `]) : a };
6963
6963
  }
6964
6964
  var Cc = { name: "commonmark", aliases: { read: ["markdown_strict"], write: ["markdown_strict"] }, operands: "join", reader: Ic, writer: { format: "commonmark", write: Ts }, read: true, write: true, media: "text", inputEncoding: "utf8", suffixes: ["commonmark", "mkd", "mdown", "mdwn"], extensions: {}, options: { read: [], write: ["wrap", "columns", "standalone", "metadata", "toc", "ascii", "eol", "rawContent"] } };
6965
- var Bc = { name: "gfm", aliases: { read: ["markdown", "md", "markdown_github", "markdown_mmd", "markdown_phpextra", "commonmark_x"], write: ["markdown", "md", "markdown_github", "markdown_mmd", "markdown_phpextra", "commonmark_x"] }, operands: "join", reader: { format: "gfm", read: co }, writer: { format: "gfm", write: Ts }, read: true, write: true, media: "text", inputEncoding: "utf8", suffixes: ["gfm", "markdown", "md"], extensions: { pipe_tables: true, raw_html: true, strikeout: true, task_lists: true, autolink_bare_uris: true }, options: { read: [], write: ["wrap", "columns", "standalone", "metadata", "toc", "ascii", "eol", "rawContent"] } };
6965
+ var Bc = { name: "gfm", aliases: { read: ["markdown", "md", "markdown_github", "markdown_mmd", "markdown_phpextra", "commonmark_x"], write: ["markdown", "md", "markdown_github", "markdown_mmd", "markdown_phpextra", "commonmark_x"] }, operands: "join", reader: { format: "gfm", read: fo }, writer: { format: "gfm", write: Ts }, read: true, write: true, media: "text", inputEncoding: "utf8", suffixes: ["gfm", "markdown", "md"], extensions: { pipe_tables: true, raw_html: true, strikeout: true, task_lists: true, autolink_bare_uris: true }, options: { read: [], write: ["wrap", "columns", "standalone", "metadata", "toc", "ascii", "eol", "rawContent"] } };
6966
6966
  var Oc = { reader: tu, name: "html", aliases: { read: ["html5"] }, read: true, write: false, media: "text", inputEncoding: "utf8", suffixes: ["html", "htm"], extensions: {}, options: { read: [], write: [] } };
6967
- var po = { AlignLeft: "left", AlignRight: "right", AlignCenter: "center", AlignDefault: "" };
6967
+ var mo = { AlignLeft: "left", AlignRight: "right", AlignCenter: "center", AlignDefault: "" };
6968
6968
  var Nc = { DefaultStyle: "", Example: "1", Decimal: "1", LowerRoman: "i", UpperRoman: "I", LowerAlpha: "a", UpperAlpha: "A" };
6969
6969
  var Ch = { Emph: "em", Underline: "u", Strong: "strong", Strikeout: "del", Superscript: "sup", Subscript: "sub", SmallCaps: "span" };
6970
- var mo = class {
6970
+ var wo = class {
6971
6971
  constructor(t2) {
6972
6972
  this.context = t2;
6973
6973
  }
@@ -7153,7 +7153,7 @@ var mo = class {
7153
7153
  `), r++, this.add("<tr"), this.attrs(t2[r][0]), this.add(">");
7154
7154
  let l = o2.cell, f = n || o2.column < a, c = f ? "th" : "td";
7155
7155
  this.add(`<${c}`), this.attrs(l[0]), f && this.attribute("scope", n ? "col" : "row"), l[2] !== 1 && this.attribute("rowspan", String(l[2])), l[3] !== 1 && this.attribute("colspan", String(l[3]));
7156
- let d = po[l[1] === "AlignDefault" ? e2[o2.column][0] : l[1]];
7156
+ let d = mo[l[1] === "AlignDefault" ? e2[o2.column][0] : l[1]];
7157
7157
  d && this.attribute("style", `text-align:${d}`), this.add(">"), await this.blocks(l[4], `${o2.path}[4]`), this.add(`</${c}>`);
7158
7158
  }
7159
7159
  for (; r < t2.length - 1; ) r >= 0 && this.add(`</tr>
@@ -7168,7 +7168,7 @@ var mo = class {
7168
7168
  `)), this.add("<colgroup>");
7169
7169
  for (let [n, a] of i2[2]) {
7170
7170
  this.add("<col");
7171
- let r = [a.t === "ColWidth" ? `width:${a.c * 100}%` : "", po[n] ? `text-align:${po[n]}` : ""].filter(Boolean).join(";");
7171
+ let r = [a.t === "ColWidth" ? `width:${a.c * 100}%` : "", mo[n] ? `text-align:${mo[n]}` : ""].filter(Boolean).join(";");
7172
7172
  r && this.attribute("style", r), this.add(">");
7173
7173
  }
7174
7174
  this.add(`</colgroup>
@@ -7352,7 +7352,7 @@ var mo = class {
7352
7352
  }
7353
7353
  };
7354
7354
  async function ma(s15, t2) {
7355
- return new mo(t2).write(s15);
7355
+ return new wo(t2).write(s15);
7356
7356
  }
7357
7357
  var Lc = { name: "html5", writer: { format: "html5", math: "source", write: ma }, read: false, write: true, media: "text", inputEncoding: "utf8", suffixes: ["html", "htm"], extensions: {}, options: { read: [], write: ["wrap", "numberSections", "toc", "ascii", "standalone", "metadata", "rawContent"] }, aliases: { write: ["html"] } };
7358
7358
  async function Fc(s15, t2, e2, i2 = () => {
@@ -7606,7 +7606,7 @@ var Is = async (s15, t2, e2) => {
7606
7606
  };
7607
7607
  var _c = { name: "csv", operands: "documents", reader: { format: "csv", read: Is }, read: true, write: false, media: "text", inputEncoding: "utf8", suffixes: ["csv"], extensions: {}, options: { read: [], write: [] } };
7608
7608
  var Uc = { name: "tsv", operands: "documents", reader: { format: "tsv", read: Is }, read: true, write: false, media: "text", inputEncoding: "utf8", suffixes: ["tsv"], extensions: {}, options: { read: [], write: [] } };
7609
- var wo = class {
7609
+ var go = class {
7610
7610
  constructor(t2) {
7611
7611
  this.context = t2;
7612
7612
  }
@@ -7797,12 +7797,12 @@ var wo = class {
7797
7797
  }
7798
7798
  };
7799
7799
  async function Mc(s15, t2) {
7800
- let e2 = new wo(t2), i2 = await e2.blocks(s15.blocks, "$.blocks");
7800
+ let e2 = new go(t2), i2 = await e2.blocks(s15.blocks, "$.blocks");
7801
7801
  return { kind: "text", text: e2.join([i2, `
7802
7802
  `]) };
7803
7803
  }
7804
7804
  var jc = { name: "plain", writer: { format: "plain", write: Mc }, read: false, write: true, media: "text", inputEncoding: "utf8", suffixes: ["txt"], extensions: {}, options: { read: [], write: ["columns", "wrap", "rawContent"] } };
7805
- var go = /* @__PURE__ */ new Set(["catcode", "write", "directlua", "luaexec", "def", "gdef", "edef", "xdef", "csname", "endcsname", "usepackage", "RequirePackage", "openout", "openin", "closeout", "closein", "read", "special", "immediate", "shipout", "global", "let", "futurelet", "expandafter", "noexpand", "scantokens", "everypar", "everyjob", "loop", "repeat", "if", "ifnum", "ifx", "unless", "includeonly"]);
7805
+ var bo = /* @__PURE__ */ new Set(["catcode", "write", "directlua", "luaexec", "def", "gdef", "edef", "xdef", "csname", "endcsname", "usepackage", "RequirePackage", "openout", "openin", "closeout", "closein", "read", "special", "immediate", "shipout", "global", "let", "futurelet", "expandafter", "noexpand", "scantokens", "everypar", "everyjob", "loop", "repeat", "if", "ifnum", "ifx", "unless", "includeonly"]);
7806
7806
  var Ps = (s15) => s15 >= "a" && s15 <= "z" || s15 >= "A" && s15 <= "Z";
7807
7807
  var Rs = (s15) => ` \r
7808
7808
  `.includes(s15) && s15 !== "";
@@ -7818,7 +7818,7 @@ async function ga(s15, t2) {
7818
7818
  if (Ps(s15[e2] ?? "")) for (; Ps(s15[e2] ?? ""); ) await t2.cooperate(), e2++;
7819
7819
  else e2 < s15.length ? e2++ : ct(t2, "Command at EOF");
7820
7820
  let f = s15.slice(l, e2);
7821
- return go.has(f) && ct(t2, `Forbidden TeX primitive: ${f}`, "E_CAPABILITY"), f;
7821
+ return bo.has(f) && ct(t2, `Forbidden TeX primitive: ${f}`, "E_CAPABILITY"), f;
7822
7822
  }
7823
7823
  async function n() {
7824
7824
  for (; e2 < s15.length; ) if (Rs(s15[e2])) await t2.cooperate(), e2++;
@@ -7961,7 +7961,7 @@ var Me = class {
7961
7961
  function Se(s15) {
7962
7962
  return s15.map((t2) => t2.raw).join("");
7963
7963
  }
7964
- var Oh = /* @__PURE__ */ new Set([...go, "begin", "end", "input", "include", "newcommand", "renewcommand", "providecommand", "documentclass", "title", "author", "date", "maketitle", "section", "subsection", "subsubsection", "chapter", "part", "paragraph", "subparagraph", "emph", "textit", "textbf", "texttt", "textsc", "underline", "item", "caption", "label", "ref", "eqref", "pageref", "href", "url", "includegraphics", "multicolumn", "hline", "par", "verb", "footnote", "LaTeX", "TeX", "ae", "AE", "oe", "OE", "aa", "AA", "o", "O", "ss", "l", "L", "textendash", "textemdash", "ldots", "dots", "textbackslash", "textasciitilde", "textasciicircum", "copyright", "pounds", "euro", "textless", "textgreater", "c", "v", "u", "H", "r", "newline"]);
7964
+ var Oh = /* @__PURE__ */ new Set([...bo, "begin", "end", "input", "include", "newcommand", "renewcommand", "providecommand", "documentclass", "title", "author", "date", "maketitle", "section", "subsection", "subsubsection", "chapter", "part", "paragraph", "subparagraph", "emph", "textit", "textbf", "texttt", "textsc", "underline", "item", "caption", "label", "ref", "eqref", "pageref", "href", "url", "includegraphics", "multicolumn", "hline", "par", "verb", "footnote", "LaTeX", "TeX", "ae", "AE", "oe", "OE", "aa", "AA", "o", "O", "ss", "l", "L", "textendash", "textemdash", "ldots", "dots", "textbackslash", "textasciitilde", "textasciicircum", "copyright", "pounds", "euro", "textless", "textgreater", "c", "v", "u", "H", "r", "newline"]);
7965
7965
  function Nh(s15) {
7966
7966
  return s15.length > 0 && s15.length <= 64 && [...s15].every((t2) => t2 >= "a" && t2 <= "z" || t2 >= "A" && t2 <= "Z");
7967
7967
  }
@@ -8082,8 +8082,8 @@ async function Wc(s15, t2, e2) {
8082
8082
  }
8083
8083
  var de = () => ["", [], []];
8084
8084
  var qc = { ae: "\xE6", AE: "\xC6", oe: "\u0153", OE: "\u0152", aa: "\xE5", AA: "\xC5", o: "\xF8", O: "\xD8", ss: "\xDF", l: "\u0142", L: "\u0141", LaTeX: "LaTeX", TeX: "TeX", textendash: "\u2013", textemdash: "\u2014", ldots: "\u2026", dots: "\u2026", textbackslash: "\\", textasciitilde: "~", textasciicircum: "^", copyright: "\xA9", pounds: "\xA3", euro: "\u20AC", textless: "<", textgreater: ">" };
8085
- var Jc = { "'": "\u0301", '"': "\u0308", "`": "\u0300", "^": "\u0302", "~": "\u0303", "=": "\u0304", ".": "\u0307", c: "\u0327", v: "\u030C", u: "\u0306", H: "\u030B", r: "\u030A" };
8086
- var Vc = { emph: "Emph", textit: "Emph", textbf: "Strong", textsc: "SmallCaps", underline: "Underline" };
8085
+ var Vc = { "'": "\u0301", '"': "\u0308", "`": "\u0300", "^": "\u0302", "~": "\u0303", "=": "\u0304", ".": "\u0307", c: "\u0327", v: "\u030C", u: "\u0306", H: "\u030B", r: "\u030A" };
8086
+ var Jc = { emph: "Emph", textit: "Emph", textbf: "Strong", textsc: "SmallCaps", underline: "Underline" };
8087
8087
  var Hc = { part: 1, chapter: 1, section: 1, subsection: 2, subsubsection: 3, paragraph: 4, subparagraph: 5 };
8088
8088
  function jt(s15, t2) {
8089
8089
  let e2 = s15.at(-1);
@@ -8097,7 +8097,7 @@ function Yc(s15) {
8097
8097
  function Gc(s15) {
8098
8098
  return s15.map((t2) => t2.t === "Str" ? t2.c : t2.t === "Space" || t2.t === "SoftBreak" ? " " : t2.t === "Code" || t2.t === "Math" ? t2.c[1] : t2.t === "Emph" || t2.t === "Strong" || t2.t === "SmallCaps" || t2.t === "Underline" ? Gc(t2.c) : "").join("");
8099
8099
  }
8100
- var bo = class {
8100
+ var yo = class {
8101
8101
  constructor(t2) {
8102
8102
  this.context = t2;
8103
8103
  }
@@ -8129,13 +8129,13 @@ var bo = class {
8129
8129
  else if (a.kind === "environment") jt(i2, this.raw(a.raw));
8130
8130
  else {
8131
8131
  let r = a.text;
8132
- if (Vc[r]) jt(i2, { t: Vc[r], c: this.inlines(n.group().children, e2 + 1) });
8132
+ if (Jc[r]) jt(i2, { t: Jc[r], c: this.inlines(n.group().children, e2 + 1) });
8133
8133
  else if (r === "texttt") jt(i2, { t: "Code", c: [de(), Se(n.group().children)] });
8134
8134
  else if (qc[r]) jt(i2, { t: "Str", c: qc[r] });
8135
8135
  else if ("{}$%&#_".includes(r) && r.length === 1) jt(i2, { t: "Str", c: r });
8136
8136
  else if (r === " " || r === "," || r === ";" || r === ":") jt(i2, { t: "Space" });
8137
8137
  else if (r === "\\" || r === "newline") jt(i2, { t: "LineBreak" });
8138
- else if (Jc[r]) {
8138
+ else if (Vc[r]) {
8139
8139
  n.skip();
8140
8140
  let o2 = t2[n.index], l, f = "";
8141
8141
  if (o2?.kind === "group") l = Gc(this.inlines(n.group().children, e2 + 1));
@@ -8143,7 +8143,7 @@ var bo = class {
8143
8143
  let c = [...o2.text][0];
8144
8144
  l = c, n.index++, f = o2.text.slice(c.length);
8145
8145
  } else return ct(this.context, "Accent requires text or a group");
8146
- [...l].length !== 1 && ct(this.context, "Accent requires one Unicode scalar"), jt(i2, { t: "Str", c: (l + Jc[r]).normalize("NFC") + f });
8146
+ [...l].length !== 1 && ct(this.context, "Accent requires one Unicode scalar"), jt(i2, { t: "Str", c: (l + Vc[r]).normalize("NFC") + f });
8147
8147
  } else if (r === "href" || r === "url" || r === "includegraphics") {
8148
8148
  let o2 = de(), l = r === "includegraphics" ? n.optional() : void 0;
8149
8149
  l && o2[2].push(["latex-options", l.raw.slice(1, -1)]);
@@ -8280,7 +8280,7 @@ var bo = class {
8280
8280
  }
8281
8281
  };
8282
8282
  var zc = { format: "latex", async read(s15, t2) {
8283
- let e2 = await ga(s15.text ?? await t2.decodeUtf8([s15.bytes]), t2), i2 = await Wc(e2, t2, s15.base), n = new bo(t2), a = n.blocks(i2), r = new Map(n.references.map((f) => [f.content, f])), o2 = /* @__PURE__ */ new Set(), l = (f, c, d) => {
8283
+ let e2 = await ga(s15.text ?? await t2.decodeUtf8([s15.bytes]), t2), i2 = await Wc(e2, t2, s15.base), n = new yo(t2), a = n.blocks(i2), r = new Map(n.references.map((f) => [f.content, f])), o2 = /* @__PURE__ */ new Set(), l = (f, c, d) => {
8284
8284
  if (t2.bound("depth", d), c.includes(f.name) && ct(t2, `Cyclic reference title: ${f.name}`, "E_CAPABILITY"), f.content.length) return;
8285
8285
  let u = n.labels.get(f.name);
8286
8286
  u || ct(t2, `Unresolved reference: ${f.name}`, "E_CAPABILITY");
@@ -8302,7 +8302,7 @@ var zc = { format: "latex", async read(s15, t2) {
8302
8302
  var ba = { Emph: "emph", Strong: "textbf", Underline: "uline", Strikeout: "sout", Superscript: "textsuperscript", Subscript: "textsubscript", SmallCaps: "textsc" };
8303
8303
  var Fi = { en: "english", "en-US": "english", "en-GB": "british", de: "ngerman", "de-DE": "ngerman", fr: "french", es: "spanish", it: "italian", pt: "portuguese", nl: "dutch" };
8304
8304
  var Cs = new Set("alpha beta gamma delta epsilon varepsilon zeta eta theta vartheta iota kappa lambda mu nu xi pi varpi rho varrho sigma varsigma tau upsilon phi varphi chi psi omega Gamma Delta Theta Lambda Xi Pi Sigma Upsilon Phi Psi Omega frac dfrac tfrac sqrt sum prod int iint iiint oint lim limsup liminf sin cos tan log ln exp min max sup inf det gcd left right middle big Big bigg Bigg cdot times div pm mp le leq ge geq ne neq approx equiv sim simeq in notin subset supset subseteq supseteq cup cap emptyset infinity infty partial nabla forall exists neg land lor to mapsto rightarrow leftarrow Rightarrow Leftarrow leftrightarrow Leftrightarrow overline underline hat widehat bar vec dot ddot text mathrm mathbf mathit mathsf mathtt mathcal mathbb mathnormal operatorname overset underset underbrace overbrace binom dbinom tbinom quad qquad hspace phantom vphantom hphantom langle rangle lbrace rbrace lvert rvert vert Vert lVert rVert ldots cdots vdots ddots degree prime ast star ell Re Im mod bmod pmod limits nolimits substack displaystyle textstyle scriptstyle scriptscriptstyle".split(" "));
8305
- var yo = class {
8305
+ var xo = class {
8306
8306
  constructor(t2) {
8307
8307
  this.context = t2;
8308
8308
  }
@@ -8673,7 +8673,7 @@ var yo = class {
8673
8673
  }
8674
8674
  };
8675
8675
  async function Xc(s15, t2) {
8676
- return new yo(t2).write(s15);
8676
+ return new xo(t2).write(s15);
8677
8677
  }
8678
8678
  var Kc = { reader: zc, writer: { format: "latex", math: "source", write: Xc }, name: "latex", read: true, write: true, media: "text", inputEncoding: "utf8", suffixes: ["tex", "latex"], extensions: {}, options: { read: [], write: ["wrap", "columns", "standalone", "metadata", "toc", "ascii", "eol", "rawContent"] } };
8679
8679
  var Qi = {};
@@ -8803,7 +8803,7 @@ function tf(s15, t2) {
8803
8803
 
8804
8804
  ` + t2, s15.length) : s15 + gi(t2, s15.length).slice(t2 ? s15.length : 0);
8805
8805
  }
8806
- var xo = class {
8806
+ var ko = class {
8807
8807
  constructor(t2) {
8808
8808
  this.context = t2;
8809
8809
  }
@@ -9113,13 +9113,13 @@ var xo = class {
9113
9113
  }
9114
9114
  };
9115
9115
  async function ef(s15, t2) {
9116
- return new xo(t2).write(s15);
9116
+ return new ko(t2).write(s15);
9117
9117
  }
9118
9118
  var Fh = { emphasis: "Emph", strong: "Strong", superscript: "Superscript", sup: "Superscript", subscript: "Subscript", sub: "Subscript" };
9119
9119
  var bi = (s15) => s15 === " " || s15 === `
9120
9120
  ` || s15 === " ";
9121
9121
  var nf = (s15, t2) => t2 === 0 || bi(s15[t2 - 1]) || `([{<'"/:,-`.includes(s15[t2 - 1]);
9122
- var ko = (s15, t2) => t2 === s15.length || bi(s15[t2]) || `.,;:!?)]}>'"/\\`.includes(s15[t2]);
9122
+ var vo = (s15, t2) => t2 === s15.length || bi(s15[t2]) || `.,;:!?)]}>'"/\\`.includes(s15[t2]);
9123
9123
  async function tn(s15, t2, e2, i2) {
9124
9124
  for (let n = e2; n + t2.length <= s15.length; n++) if (await i2.cooperate(), s15.startsWith(t2, n)) return n;
9125
9125
  return -1;
@@ -9127,7 +9127,7 @@ async function tn(s15, t2, e2, i2) {
9127
9127
  async function $h(s15, t2, e2, i2) {
9128
9128
  let n = e2;
9129
9129
  for (; (n = await tn(s15, t2, n, i2)) >= 0; ) {
9130
- if (s15[n - 1] !== "\\" && !bi(s15[n - 1]) && ko(s15, n + t2.length)) return n;
9130
+ if (s15[n - 1] !== "\\" && !bi(s15[n - 1]) && vo(s15, n + t2.length)) return n;
9131
9131
  n += t2.length;
9132
9132
  }
9133
9133
  return -1;
@@ -9177,7 +9177,7 @@ async function Ls2(s15, t2, e2, i2 = [], n = 0) {
9177
9177
  }
9178
9178
  if (u === "|") {
9179
9179
  let b = await tn(s15, "|", l + 1, a), x = s15[b + 1] === "_", v = x && s15[b + 2] === "_", k = b + 1 + (x ? v ? 2 : 1 : 0);
9180
- if (b > l + 1 && ko(s15, k)) {
9180
+ if (b > l + 1 && vo(s15, k)) {
9181
9181
  let T = s15.slice(l + 1, b), E = await e2.substitution(T, f(l), i2, n + 1);
9182
9182
  if (x) o2(r, e2.link(v ? void 0 : mi(T), E, f(l)));
9183
9183
  else for (let A of E) o2(r, A);
@@ -9187,7 +9187,7 @@ async function Ls2(s15, t2, e2, i2 = [], n = 0) {
9187
9187
  }
9188
9188
  if (u === "[") {
9189
9189
  let b = await tn(s15, "]_", l + 1, a);
9190
- if (b > l + 1 && ko(s15, b + 2)) {
9190
+ if (b > l + 1 && vo(s15, b + 2)) {
9191
9191
  o2(r, await e2.note(s15.slice(l + 1, b), f(l), i2, n + 1)), l = b + 2;
9192
9192
  continue;
9193
9193
  }
@@ -9241,7 +9241,7 @@ async function Ls2(s15, t2, e2, i2 = [], n = 0) {
9241
9241
  return r;
9242
9242
  }
9243
9243
  var Dh = ["attention", "caution", "danger", "error", "hint", "important", "note", "tip", "warning", "admonition"];
9244
- var vo = class {
9244
+ var To = class {
9245
9245
  constructor(t2) {
9246
9246
  this.context = t2;
9247
9247
  }
@@ -9596,7 +9596,7 @@ var af = { format: "rst", async read(s15, t2) {
9596
9596
  let e2 = s15.text ?? await t2.decodeUtf8([s15.bytes]);
9597
9597
  t2.charge("retainedBytes", e2.length * 2), t2.charge("references", e2.split(`
9598
9598
  `).length);
9599
- let i2 = new vo(t2), n = await i2.blocks(Bs(e2, s15.base, void 0, t2));
9599
+ let i2 = new To(t2), n = await i2.blocks(Bs(e2, s15.base, void 0, t2));
9600
9600
  await i2.resolve(n);
9601
9601
  for (let a of i2.targets.values()) i2.target(a);
9602
9602
  for (let a of i2.links) {
@@ -9718,7 +9718,7 @@ var $s = /* @__PURE__ */ new Set(["info", "generator", "fonttbl", "colortbl", "s
9718
9718
  var Ds = /* @__PURE__ */ new Set(["object", "objdata", "objclass", "objname", "objalias", "datafield", "filetbl"]);
9719
9719
  var _s = /* @__PURE__ */ new Set(["header", "headerl", "headerr", "headerf", "footer", "footerl", "footerr", "footerf", "annotation", "shp", "shptxt", "nonshppict", "upr", "ud", "xmlopen", "xmlattrname", "xmlattrvalue"]);
9720
9720
  var xi = ["", [], []];
9721
- var To = class s8 {
9721
+ var So = class s8 {
9722
9722
  constructor(t2, e2 = []) {
9723
9723
  this.context = t2;
9724
9724
  this.resources = e2;
@@ -10099,7 +10099,7 @@ var To = class s8 {
10099
10099
  }
10100
10100
  };
10101
10101
  var cf = { format: "rtf", async read(s15, t2) {
10102
- return new To(t2).read(await lf(s15.bytes, t2));
10102
+ return new So(t2).read(await lf(s15.bytes, t2));
10103
10103
  } };
10104
10104
  function Bt(s15, t2) {
10105
10105
  throw new t("E_RESOURCE", s15.operation ?? "write", t2, "rtf");
@@ -10192,7 +10192,7 @@ async function df(s15, t2) {
10192
10192
  }
10193
10193
  var Mh = { Emph: "i", Strong: "b", Underline: "ul", Strikeout: "strike", Superscript: "super", Subscript: "sub", SmallCaps: "scaps" };
10194
10194
  var jh = { AlignDefault: "ql", AlignLeft: "ql", AlignRight: "qr", AlignCenter: "qc" };
10195
- var So = class {
10195
+ var Eo = class {
10196
10196
  constructor(t2) {
10197
10197
  this.context = t2;
10198
10198
  }
@@ -10437,7 +10437,7 @@ var So = class {
10437
10437
  }
10438
10438
  };
10439
10439
  async function uf(s15, t2) {
10440
- return new So(t2).write(s15);
10440
+ return new Eo(t2).write(s15);
10441
10441
  }
10442
10442
  var hf = { reader: cf, writer: { format: "rtf", imageResources: "embed", write: uf }, name: "rtf", read: true, write: true, media: "text", inputEncoding: "bytes", suffixes: ["rtf"], extensions: {}, options: { read: [], write: ["standalone"] } };
10443
10443
  var at = () => ({ first: 0, last: 0, units: 0 });
@@ -10727,7 +10727,7 @@ var Lt = class {
10727
10727
  return this.last = a, a;
10728
10728
  }
10729
10729
  };
10730
- var Jf = p(qo(), 1);
10730
+ var Vf = p(Vo(), 1);
10731
10731
  var Pt = { container: "urn:oasis:names:tc:opendocument:xmlns:container", opf: "http://www.idpf.org/2007/opf", dc: "http://purl.org/dc/elements/1.1/", xhtml: "http://www.w3.org/1999/xhtml", epub: "http://www.idpf.org/2007/ops", ncx: "http://www.daisy.org/z3986/2005/ncx/" };
10732
10732
  function mt(s15, t2, e2 = "") {
10733
10733
  return s15.attrs.find((i2) => i2.name === t2 && i2.uri === e2)?.value ?? "";
@@ -10741,8 +10741,8 @@ function Mi(s15) {
10741
10741
  function ae(s15, t2, e2, i2 = "E_PARSE") {
10742
10742
  throw new t(i2, s15.operation ?? "read", e2, "epub", t2);
10743
10743
  }
10744
- async function Vf(s15, t2, e2, i2) {
10745
- let n = new Jf.SaxesParser({ xmlns: true }), a = [], r, o2 = 0, l = 0, f, c = [], d = async () => {
10744
+ async function Jf(s15, t2, e2, i2) {
10745
+ let n = new Vf.SaxesParser({ xmlns: true }), a = [], r, o2 = 0, l = 0, f, c = [], d = async () => {
10746
10746
  for (let h of c) await i2(h);
10747
10747
  c.length = 0;
10748
10748
  };
@@ -10820,7 +10820,7 @@ async function Vf(s15, t2, e2, i2) {
10820
10820
  }
10821
10821
  return n.close(), await d(), r || ae(e2, t2, "Missing EPUB XML root"), r;
10822
10822
  }
10823
- function Vs(s15, t2, e2) {
10823
+ function Js(s15, t2, e2) {
10824
10824
  (s15.name !== "html" || s15.uri !== Pt.xhtml) && ae(t2, e2, "Expected XHTML html root"), pe(s15, "body").length !== 1 && ae(t2, e2, "Expected exactly one XHTML body");
10825
10825
  let i2 = D.createDocument();
10826
10826
  function n(a, r) {
@@ -10875,7 +10875,7 @@ async function Hf(s15, t2) {
10875
10875
  let $ = R2.value;
10876
10876
  if (!($ instanceof Uint8Array)) throw new t("E_IO", t2.operation ?? "read", "Producer must yield bytes");
10877
10877
  t2.checkpoint(), "chunks" in s15 && (t2.charge("inputBytes", $.length), t2.charge("compressedBytes", $.length));
10878
- for (let V = 0; V < $.length; V += 4096) await l.append($.subarray(V, V + 4096)), await t2.cooperate();
10878
+ for (let J = 0; J < $.length; J += 4096) await l.append($.subarray(J, J + 4096)), await t2.cooperate();
10879
10879
  T += $.length;
10880
10880
  }
10881
10881
  } catch (R2) {
@@ -10991,7 +10991,7 @@ async function Yf(s15, t2) {
10991
10991
  if (d.has(L)) return d.get(L);
10992
10992
  let Q = await l(L);
10993
10993
  if (!Q) return e2(L, "Missing required EPUB part");
10994
- let nt = await Vf(Q instanceof Uint8Array ? Q : f(Q), L, t2, K);
10994
+ let nt = await Jf(Q instanceof Uint8Array ? Q : f(Q), L, t2, K);
10995
10995
  return d.set(L, nt), nt;
10996
10996
  }, h = await u("META-INF/container.xml");
10997
10997
  (h.name !== "container" || h.uri !== Pt.container) && e2("META-INF/container.xml", "Invalid EPUB container namespace");
@@ -11046,11 +11046,11 @@ async function Yf(s15, t2) {
11046
11046
  for (let L of pe(E[0], "itemref")) {
11047
11047
  let K = await v.get(mt(L, "idref"));
11048
11048
  (!K || !await r(K.part)) && e2(m2, "Missing EPUB spine item"), mt(L, "properties").includes("rendition:layout-pre-paginated") && e2(K.part, "Fixed-layout EPUB spine is unsupported"), K.media !== "application/xhtml+xml" && e2(K.part, "Unsupported EPUB spine media type"), C.has(K.part) && e2(K.part, "Duplicate EPUB spine chapter");
11049
- let Q = await u(K.part), nt = await Ls(Vs(Q, t2, K.part), t2), ft = mt(L, "linear") || "yes";
11049
+ let Q = await u(K.part), nt = await Ls(Js(Q, t2, K.part), t2), ft = mt(L, "linear") || "yes";
11050
11050
  ["yes", "no"].includes(ft) || e2(K.part, "Invalid EPUB spine linear value"), F.push({ item: K, xml: Q, blocks: nt.blocks, language: nt.language ?? (A ? Mi(A) : ""), linear: ft }), C.add(K.part);
11051
11051
  }
11052
11052
  F.length || e2(m2, "Empty EPUB spine");
11053
- let P = a && new Tt(a, async () => t2.cooperate()), R2 = a ? new Lt(a, P) : /* @__PURE__ */ new Set(), $ = a ? new Lt(a, P) : /* @__PURE__ */ new Set(), V = a ? new Lt(a, P) : /* @__PURE__ */ new Set(), Y = async (L, K) => {
11053
+ let P = a && new Tt(a, async () => t2.cooperate()), R2 = a ? new Lt(a, P) : /* @__PURE__ */ new Set(), $ = a ? new Lt(a, P) : /* @__PURE__ */ new Set(), J = a ? new Lt(a, P) : /* @__PURE__ */ new Set(), Y = async (L, K) => {
11054
11054
  if (t2.checkpoint(), L.uri !== Pt.xhtml) return;
11055
11055
  let Q = mt(L, "id");
11056
11056
  if (Q) {
@@ -11059,20 +11059,20 @@ async function Yf(s15, t2) {
11059
11059
  }
11060
11060
  if (ki(mt(L, "type", Pt.epub)).includes("noteref")) {
11061
11061
  let nt = ji(mt(L, "href"), K, t2);
11062
- await V.add(vi(nt.part, nt.fragment));
11062
+ await J.add(vi(nt.part, nt.fragment));
11063
11063
  }
11064
11064
  (L.name === "style" || mt(L, "style") || L.name === "link" && ki(mt(L, "rel")).includes("stylesheet")) && i2(K, "Unsupported EPUB CSS styling/layout loss"), ["audio", "video", "object", "embed", "svg", "math"].includes(L.name) && i2(K, `Unsupported EPUB media loss: ${L.name}`), (L.name === "script" || mt(L, "onload") || mt(L, "onclick")) && i2(K, "EPUB script content ignored"), mt(L, "base", "http://www.w3.org/XML/1998/namespace") && e2(K, "Unsupported XHTML xml:base resource identity");
11065
11065
  for (let nt of L.children) typeof nt != "string" && await Y(nt, K);
11066
11066
  };
11067
11067
  for (let L of F) await Y(L.xml, L.item.part);
11068
11068
  let U = /* @__PURE__ */ new Map(), H = new Set(C);
11069
- for await (let L of V) {
11069
+ for await (let L of J) {
11070
11070
  let K = decodeURIComponent(L.split("#")[0]);
11071
11071
  if (H.has(K)) continue;
11072
11072
  let Q = await v.getPart(K);
11073
11073
  (!Q || Q.media !== "application/xhtml+xml") && e2(K, "Unadmitted EPUB note document"), t2.charge("includes", 1), H.add(K);
11074
11074
  let nt = await u(K);
11075
- await Y(nt, K), U.set(K, (await Ls(Vs(nt, t2, K), t2)).blocks);
11075
+ await Y(nt, K), U.set(K, (await Ls(Js(nt, t2, K), t2)).blocks);
11076
11076
  }
11077
11077
  let q = /* @__PURE__ */ new Map(), M = async (L) => {
11078
11078
  if (q.has(L)) return true;
@@ -11120,7 +11120,7 @@ async function Yf(s15, t2) {
11120
11120
  };
11121
11121
  for (let L of F) await _(L.blocks);
11122
11122
  for (let L of U.values()) await _(L);
11123
- for await (let L of V) W.has(L) || e2(L, "Missing EPUB note target");
11123
+ for await (let L of J) W.has(L) || e2(L, "Missing EPUB note target");
11124
11124
  let S = a ? new ZipDirectoryIndex(a) : /* @__PURE__ */ new Set(), B = async (L, K) => {
11125
11125
  if (t2.checkpoint(), t2.bound("depth", K), !(!L || typeof L != "object")) {
11126
11126
  if ("t" in L && L.t === "Link") {
@@ -11150,7 +11150,7 @@ async function Yf(s15, t2) {
11150
11150
  if (t2.checkpoint(), !(!L || typeof L != "object") && !("t" in L && L.t === "Note")) {
11151
11151
  if ("t" in L && L.t === "Div") {
11152
11152
  let K = L;
11153
- if (await V.has(K.c[0][0])) {
11153
+ if (await J.has(K.c[0][0])) {
11154
11154
  K.c[1] = [];
11155
11155
  return;
11156
11156
  }
@@ -11159,9 +11159,9 @@ async function Yf(s15, t2) {
11159
11159
  }
11160
11160
  };
11161
11161
  for (let L of F) await j(L.blocks);
11162
- let J = [], Z = async (L, K) => {
11162
+ let V = [], Z = async (L, K) => {
11163
11163
  let Q = await u(L.part);
11164
- K && (Q.name !== "ncx" || Q.uri !== Pt.ncx) && e2(L.part, "Invalid NCX namespace"), K || Vs(Q, t2, L.part);
11164
+ K && (Q.name !== "ncx" || Q.uri !== Pt.ncx) && e2(L.part, "Invalid NCX namespace"), K || Js(Q, t2, L.part);
11165
11165
  let nt = /* @__PURE__ */ new Set(), ft = async (et, ot, bt, st) => {
11166
11166
  t2.checkpoint();
11167
11167
  let lt = ot || !K && et.uri === Pt.xhtml && et.name === "nav" && ki(mt(et, "type", Pt.epub)).includes("toc"), yt = bt || !K && et.uri === Pt.xhtml && et.name === "nav" && ki(mt(et, "type", Pt.epub)).includes("landmarks");
@@ -11179,7 +11179,7 @@ async function Yf(s15, t2) {
11179
11179
  }
11180
11180
  for (let Nt of et.children) typeof Nt != "string" && await ft(Nt, lt, yt, gt);
11181
11181
  };
11182
- await ft(Q, false, false, J);
11182
+ await ft(Q, false, false, V);
11183
11183
  }, tt = mt(E[0], "toc"), it;
11184
11184
  for await (let L of v.values()) L.properties.includes("nav") && (it && e2(m2, "Ambiguous EPUB navigation"), it = L);
11185
11185
  if (mt(g, "version") === "3.0" && it) it.media !== "application/xhtml+xml" && e2(m2, "Unsupported EPUB navigation media type"), await Z(it, false);
@@ -11187,7 +11187,7 @@ async function Yf(s15, t2) {
11187
11187
  let L = await v.get(tt);
11188
11188
  (!L || L.media !== "application/x-dtbncx+xml") && e2(m2, "Missing EPUB NCX item"), await Z(L, true);
11189
11189
  } else it && await Z(it, false);
11190
- return J.length && (b["epub-toc"] = { t: "MetaList", c: J }), { blocks: F.map((L) => ({ t: "Div", c: [[vi(L.item.part), ["epub-chapter"], [["data-epub-source", L.item.part], ["data-epub-item-id", L.item.id], ["data-epub-linear", L.linear], ...L.language ? [["lang", L.language]] : []]], L.blocks] })), metadata: b, resources: [...q.values()], ...A ? { language: Mi(A) } : {}, ...["ltr", "rtl"].includes(I) ? { direction: I } : {} };
11190
+ return V.length && (b["epub-toc"] = { t: "MetaList", c: V }), { blocks: F.map((L) => ({ t: "Div", c: [[vi(L.item.part), ["epub-chapter"], [["data-epub-source", L.item.part], ["data-epub-item-id", L.item.id], ["data-epub-linear", L.linear], ...L.language ? [["lang", L.language]] : []]], L.blocks] })), metadata: b, resources: [...q.values()], ...A ? { language: Mi(A) } : {}, ...["ltr", "rtl"].includes(I) ? { direction: I } : {} };
11191
11191
  } catch (d) {
11192
11192
  throw c = { reason: d }, d;
11193
11193
  } finally {
@@ -11196,10 +11196,10 @@ async function Yf(s15, t2) {
11196
11196
  });
11197
11197
  }
11198
11198
  }
11199
- var Jp = (s15) => s15 / 2 ** 32 | 0;
11200
- var Vp = (s15) => s15 >>> 0;
11199
+ var Vp = (s15) => s15 / 2 ** 32 | 0;
11200
+ var Jp = (s15) => s15 >>> 0;
11201
11201
  function Kf(s15, t2, e2, i2) {
11202
- let n = Jp(e2), a = Vp(e2);
11202
+ let n = Vp(e2), a = Jp(e2);
11203
11203
  s15.setUint32(t2, i2 ? a : n, i2), s15.setUint32(t2 + 4, i2 ? n : a, i2);
11204
11204
  }
11205
11205
  function Qf(s15) {
@@ -11211,7 +11211,7 @@ function Hp(s15, t2 = "") {
11211
11211
  if (!Number.isSafeInteger(s15) || s15 < 0) throw new RangeError(Jo(t2) + "expected integer >= 0, got " + s15);
11212
11212
  return s15;
11213
11213
  }
11214
- function Vo(s15, t2, e2 = "") {
11214
+ function Ho(s15, t2, e2 = "") {
11215
11215
  if (Qf(s15) && (t2 === void 0 || s15.length === t2)) return s15;
11216
11216
  t2 !== void 0 && Hp(t2, "length");
11217
11217
  let i2 = Qf(s15), n = t2 !== void 0 ? ` of length ${t2}` : "", a = i2 ? `length=${s15.length}` : `type=${typeof s15}`, r = Jo(e2) + "expected Uint8Array" + n + ", got " + a;
@@ -11226,16 +11226,16 @@ var Zf = (s15, t2) => {
11226
11226
  if (e2 !== Object.prototype && e2 !== null) throw new TypeError(`"${t2}" expected plain object`);
11227
11227
  if (Object.hasOwn(s15, "__proto__")) throw new TypeError(`"${t2}.__proto__" is not allowed`);
11228
11228
  };
11229
- function Ho(s15, t2 = true) {
11229
+ function Yo(s15, t2 = true) {
11230
11230
  if (s15.destroyed) throw new Error("hash was destroyed");
11231
11231
  if (t2 && s15.finished) throw new Error("digest() was already called");
11232
11232
  }
11233
11233
  function td(s15, t2) {
11234
- Vo(s15, void 0, "output");
11234
+ Ho(s15, void 0, "output");
11235
11235
  let e2 = t2.outputLen;
11236
11236
  if (!(s15.length >= e2)) throw new RangeError('"output" expected length >= ' + e2);
11237
11237
  }
11238
- function Yo(...s15) {
11238
+ function Go(...s15) {
11239
11239
  for (let t2 = 0; t2 < s15.length; t2++) s15[t2].fill(0);
11240
11240
  }
11241
11241
  function Hs(s15) {
@@ -11276,7 +11276,7 @@ var Ys = class {
11276
11276
  this.blockLen = t2, this.outputLen = e2, this.padOffset = i2, this.isLE = n, this.buffer = new Uint8Array(t2), this.view = Hs(this.buffer);
11277
11277
  }
11278
11278
  update(t2) {
11279
- Ho(this), Vo(t2);
11279
+ Yo(this), Ho(t2);
11280
11280
  let { view: e2, buffer: i2, blockLen: n } = this, a = t2.length, r = false;
11281
11281
  for (let o2 = 0; o2 < a; ) {
11282
11282
  let l = Math.min(n - this.pos, a - o2);
@@ -11291,7 +11291,7 @@ var Ys = class {
11291
11291
  return this.length += t2.length, r && this.roundClean(), this;
11292
11292
  }
11293
11293
  digestInto(t2) {
11294
- Ho(this), td(t2, this), this.finished = true;
11294
+ Yo(this), td(t2, this), this.finished = true;
11295
11295
  let { buffer: e2, view: i2, blockLen: n, isLE: a } = this, { pos: r } = this;
11296
11296
  e2[r++] = 128, e2.fill(0, r), this.padOffset > n - r && (this.process(i2, 0), e2.fill(0)), Kf(i2, n - 8, this.length * 8, a), this.process(i2, 0), this.roundClean();
11297
11297
  let o2 = t2 === e2 ? i2 : Hs(t2), l = this.outputLen, f = l / 4, c = this.get();
@@ -11315,7 +11315,7 @@ var Ys = class {
11315
11315
  var sd = Uint32Array.from([1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225]);
11316
11316
  var zp = Uint32Array.from([1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298]);
11317
11317
  var Wi = new Uint32Array(64);
11318
- var Go = class extends Ys {
11318
+ var zo = class extends Ys {
11319
11319
  A = 0;
11320
11320
  B = 0;
11321
11321
  C = 0;
@@ -11351,18 +11351,18 @@ var Go = class extends Ys {
11351
11351
  i2 = i2 + this.A | 0, n = n + this.B | 0, a = a + this.C | 0, r = r + this.D | 0, o2 = o2 + this.E | 0, l = l + this.F | 0, f = f + this.G | 0, c = c + this.H | 0, this.set(i2, n, a, r, o2, l, f, c);
11352
11352
  }
11353
11353
  roundClean() {
11354
- Yo(Wi);
11354
+ Go(Wi);
11355
11355
  }
11356
11356
  destroy() {
11357
- this.destroyed = true, this.set(0, 0, 0, 0, 0, 0, 0, 0), Yo(this.buffer);
11357
+ this.destroyed = true, this.set(0, 0, 0, 0, 0, 0, 0, 0), Go(this.buffer);
11358
11358
  }
11359
11359
  };
11360
- var zo = class extends Go {
11360
+ var Xo = class extends zo {
11361
11361
  constructor() {
11362
11362
  super(32, sd);
11363
11363
  }
11364
11364
  };
11365
- var rd = ed(() => new zo(), id(1));
11365
+ var rd = ed(() => new Xo(), id(1));
11366
11366
  var Qp = "body{margin:1em;line-height:1.5}img{max-width:100%;height:auto}pre{white-space:pre-wrap;overflow-wrap:anywhere}p,a,td{overflow-wrap:anywhere}table{max-width:100%;border-collapse:collapse}th,td{border:1px solid;padding:.3em}h1,h2,h3,h4,h5,h6{break-after:avoid}blockquote{margin-inline:1em}.smallcaps{font-variant:small-caps}.cover{text-align:center}.level-2{margin-inline-start:1em}.level-3,.level-4,.level-5,.level-6{margin-inline-start:2em}";
11367
11367
  var Gs = (s15) => s15.split("/").map(encodeURIComponent).join("/");
11368
11368
  var od = { format: "epub", imageResources: "embed", math: "source", async write(s15, t2) {
@@ -11372,8 +11372,8 @@ var od = { format: "epub", imageResources: "embed", math: "source", async write(
11372
11372
  t2.checkpoint(S.length);
11373
11373
  let B = "";
11374
11374
  for (let j of S) {
11375
- let J = j.codePointAt(0);
11376
- (J < 32 && ![9, 10, 13].includes(J) || J === 65534 || J === 65535) && e2("Invalid XML character"), B += { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "\r": "&#13;" }[j] ?? j;
11375
+ let V = j.codePointAt(0);
11376
+ (V < 32 && ![9, 10, 13].includes(V) || V === 65534 || V === 65535) && e2("Invalid XML character"), B += { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "\r": "&#13;" }[j] ?? j;
11377
11377
  }
11378
11378
  return t2.charge("retainedBytes", B.length * 2), B;
11379
11379
  }, n = (S) => (t2.checkpoint(), D.isTextNode(S) ? S.value : "childNodes" in S ? S.childNodes.map(n).join("") : ""), a = async (S) => {
@@ -11409,8 +11409,8 @@ var od = { format: "epub", imageResources: "embed", math: "source", async write(
11409
11409
  await t2.cooperate();
11410
11410
  let B = S.id;
11411
11411
  (!B || B.startsWith("/") || B.includes(":") || B.includes("\\") || B.split("/").some((tt) => !tt || tt === "." || tt === "..")) && e2("Unsafe declared resource key", "E_RESOURCE"), i2(B), g.has(B) && e2("Duplicate declared resource key", "E_RESOURCE");
11412
- let j = B.slice(B.lastIndexOf(".") + 1).toLowerCase(), J = S.bytes, Z = j === "png" && [137, 80, 78, 71, 13, 10, 26, 10].every((tt, it) => J[it] === tt) ? "image/png" : ["jpg", "jpeg"].includes(j) && J[0] === 255 && J[1] === 216 && J[2] === 255 ? "image/jpeg" : j === "gif" && ["GIF87a", "GIF89a"].includes(new TextDecoder().decode(J.subarray(0, 6))) ? "image/gif" : "";
11413
- Z || e2("Unsupported or mismatched declared resource media type", "E_RESOURCE"), g.set(B, { path: `resources/${B}`, bytes: J, type: Z, used: y2 === B });
11412
+ let j = B.slice(B.lastIndexOf(".") + 1).toLowerCase(), V = S.bytes, Z = j === "png" && [137, 80, 78, 71, 13, 10, 26, 10].every((tt, it) => V[it] === tt) ? "image/png" : ["jpg", "jpeg"].includes(j) && V[0] === 255 && V[1] === 216 && V[2] === 255 ? "image/jpeg" : j === "gif" && ["GIF87a", "GIF89a"].includes(new TextDecoder().decode(V.subarray(0, 6))) ? "image/gif" : "";
11413
+ Z || e2("Unsupported or mismatched declared resource media type", "E_RESOURCE"), g.set(B, { path: `resources/${B}`, bytes: V, type: Z, used: y2 === B });
11414
11414
  }
11415
11415
  y2 !== void 0 && !g.has(y2) && e2("Missing declared cover resource", "E_RESOURCE");
11416
11416
  let b = /* @__PURE__ */ new Set(), x = async (S) => {
@@ -11424,15 +11424,15 @@ var od = { format: "epub", imageResources: "embed", math: "source", async write(
11424
11424
  if (await t2.cooperate(), !S || typeof S != "object") return S;
11425
11425
  if (t2.charge("references", 1), t2.charge("retainedBytes", 64), Array.isArray(S)) {
11426
11426
  let j = [];
11427
- for (let J of S) j.push(await v(J));
11427
+ for (let V of S) j.push(await v(V));
11428
11428
  return j;
11429
11429
  }
11430
11430
  if ("t" in S && (S.t === "Image" || S.t === "Link")) {
11431
- let j = S, J = j.c[2][0], Z = g.get(J);
11431
+ let j = S, V = j.c[2][0], Z = g.get(V);
11432
11432
  if (!Z && j.t === "Image" && t2.resources) {
11433
- let tt = await t2.resources.resolve(J, void 0, t2.signal);
11433
+ let tt = await t2.resources.resolve(V, void 0, t2.signal);
11434
11434
  if (tt) {
11435
- let it = J;
11435
+ let it = V;
11436
11436
  (!it || it.startsWith("/") || it.includes(":") || it.includes("\\") || it.split("/").some((Q) => !Q || Q === "." || Q === "..")) && e2("Unsafe declared resource key", "E_RESOURCE"), i2(it);
11437
11437
  let L = it.slice(it.lastIndexOf(".") + 1).toLowerCase(), K = L === "png" && [137, 80, 78, 71, 13, 10, 26, 10].every((Q, nt) => tt[nt] === Q) ? "image/png" : ["jpg", "jpeg"].includes(L) && tt[0] === 255 && tt[1] === 216 && tt[2] === 255 ? "image/jpeg" : L === "gif" && ["GIF87a", "GIF89a"].includes(new TextDecoder().decode(tt.subarray(0, 6))) ? "image/gif" : L === "webp" && new TextDecoder().decode(tt.subarray(0, 4)) === "RIFF" && new TextDecoder().decode(tt.subarray(8, 12)) === "WEBP" ? "image/webp" : L === "svg" ? "image/svg+xml" : "";
11438
11438
  K || e2("Unsupported or mismatched declared resource media type", "E_RESOURCE"), Z = { path: `resources/${it}`, bytes: tt, type: K, used: true }, g.set(it, Z);
@@ -11442,7 +11442,7 @@ var od = { format: "epub", imageResources: "embed", math: "source", async write(
11442
11442
  if (j.t === "Image") return e2("Image must name an explicit declared resource", "E_RESOURCE");
11443
11443
  }
11444
11444
  let B = {};
11445
- for (let [j, J] of Object.entries(S)) B[j] = await v(J);
11445
+ for (let [j, V] of Object.entries(S)) B[j] = await v(V);
11446
11446
  return B;
11447
11447
  }, k = await v(s15.blocks), T = await ma({ ...s15, blocks: k, metadata: {} }, o2);
11448
11448
  if (T.kind !== "text") return e2("Expected text serialization");
@@ -11451,27 +11451,27 @@ var od = { format: "epub", imageResources: "embed", math: "source", async write(
11451
11451
  for (let S of E.childNodes) await t2.cooperate(), !(D.isTextNode(S) && !S.value.trim()) && (I.nodes.length && D.isElementNode(S) && ["h1", "h2", "h3", "h4", "h5", "h6"].slice(0, t2.epub?.chapterLevel ?? 1).includes(S.tagName) && (A.push(I), I = { name: `chapter-${A.length + 1}.xhtml`, nodes: [] }), I.nodes.push(S));
11452
11452
  A.push(I);
11453
11453
  let F = /* @__PURE__ */ new Map(), C = new Set([...g.values()].map((S) => Gs(S.path))), P = [], R2 = async (S, B, j = 1) => {
11454
- if (await t2.cooperate(), t2.bound("xmlDepth", j), t2.charge("xmlNodes", 1), D.isElementNode(S) && B(S), "childNodes" in S) for (let J of S.childNodes) await R2(J, B, j + 1);
11454
+ if (await t2.cooperate(), t2.bound("xmlDepth", j), t2.charge("xmlNodes", 1), D.isElementNode(S) && B(S), "childNodes" in S) for (let V of S.childNodes) await R2(V, B, j + 1);
11455
11455
  };
11456
11456
  for (let S of A) {
11457
11457
  let B = P.length;
11458
- for (let j of S.nodes) await R2(j, (J) => {
11459
- let Z = J.attrs.find((tt) => tt.name === "id")?.value;
11460
- Z && ((F.has(Z) || [...Z].some((tt) => tt.charCodeAt(0) <= 32)) && e2("Duplicate or invalid publication ID"), F.set(Z, S.name)), ["h1", "h2", "h3", "h4", "h5", "h6"].includes(J.tagName) && P.push({ href: `${S.name}#${encodeURIComponent(Z)}`, label: n(J) || u, level: J.tagName.slice(1) });
11458
+ for (let j of S.nodes) await R2(j, (V) => {
11459
+ let Z = V.attrs.find((tt) => tt.name === "id")?.value;
11460
+ Z && ((F.has(Z) || [...Z].some((tt) => tt.charCodeAt(0) <= 32)) && e2("Duplicate or invalid publication ID"), F.set(Z, S.name)), ["h1", "h2", "h3", "h4", "h5", "h6"].includes(V.tagName) && P.push({ href: `${S.name}#${encodeURIComponent(Z)}`, label: n(V) || u, level: V.tagName.slice(1) });
11461
11461
  });
11462
11462
  P.length === B && P.push({ href: S.name, label: A.length === 1 ? u : `Chapter ${A.indexOf(S) + 1}`, level: "1" });
11463
11463
  }
11464
11464
  for (let S of A) for (let B of S.nodes) await R2(B, (j) => {
11465
- for (let J of j.attrs) if (!(J.name !== "href" && J.name !== "src") && !C.has(J.value)) if (J.name === "src" && e2("Image must name an explicit declared resource", "E_RESOURCE"), J.value.startsWith("#")) {
11465
+ for (let V of j.attrs) if (!(V.name !== "href" && V.name !== "src") && !C.has(V.value)) if (V.name === "src" && e2("Image must name an explicit declared resource", "E_RESOURCE"), V.value.startsWith("#")) {
11466
11466
  let Z;
11467
11467
  try {
11468
- Z = F.has(J.value.slice(1)) ? J.value.slice(1) : decodeURIComponent(J.value.slice(1));
11468
+ Z = F.has(V.value.slice(1)) ? V.value.slice(1) : decodeURIComponent(V.value.slice(1));
11469
11469
  } catch {
11470
11470
  return e2("Invalid fragment URI");
11471
11471
  }
11472
11472
  let tt = F.get(Z);
11473
- tt || e2("Unknown internal publication target"), J.value = `${tt === S.name ? "" : tt}#${encodeURIComponent(Z)}`;
11474
- } else ["https:", "http:", "mailto:", "tel:"].some((Z) => J.value.toLowerCase().startsWith(Z)) || e2("Unknown local publication target");
11473
+ tt || e2("Unknown internal publication target"), V.value = `${tt === S.name ? "" : tt}#${encodeURIComponent(Z)}`;
11474
+ } else ["https:", "http:", "mailto:", "tel:"].some((Z) => V.value.toLowerCase().startsWith(Z)) || e2("Unknown local publication target");
11475
11475
  });
11476
11476
  for (let S of g.values()) S.used || e2("Orphan declared resource", "E_RESOURCE");
11477
11477
  let $ = (S) => {
@@ -11479,17 +11479,17 @@ var od = { format: "epub", imageResources: "embed", math: "source", async write(
11479
11479
  if (!D.isElementNode(S)) return "";
11480
11480
  let B = S.attrs.map((j) => ` ${j.name}="${i2(j.value)}"`).join("");
11481
11481
  return ["br", "hr", "img", "col"].includes(S.tagName) ? `<${S.tagName}${B}/>` : `<${S.tagName}${B}>${S.childNodes.map($).join("")}</${S.tagName}>`;
11482
- }, V = (S, B) => `<?xml version="1.0" encoding="UTF-8"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" lang="${i2(h)}" xml:lang="${i2(h)}"><head><title>${i2(B)}</title><link rel="stylesheet" type="text/css" href="style.css"/></head><body>${S}</body></html>`, Y = /* @__PURE__ */ new Map(), U = 0, H = (S, B) => {
11482
+ }, J = (S, B) => `<?xml version="1.0" encoding="UTF-8"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" lang="${i2(h)}" xml:lang="${i2(h)}"><head><title>${i2(B)}</title><link rel="stylesheet" type="text/css" href="style.css"/></head><body>${S}</body></html>`, Y = /* @__PURE__ */ new Map(), U = 0, H = (S, B) => {
11483
11483
  t2.charge("parts", 1);
11484
11484
  let j = typeof B == "string" ? B.length * 3 : B.length;
11485
11485
  t2.bound("outputBytes", U + j), t2.charge("retainedBytes", j);
11486
- let J = typeof B == "string" ? new TextEncoder().encode(B) : B;
11487
- U += J.length, t2.bound("expandedBytes", U), Y.set(S, J);
11486
+ let V = typeof B == "string" ? new TextEncoder().encode(B) : B;
11487
+ U += V.length, t2.bound("expandedBytes", U), Y.set(S, V);
11488
11488
  };
11489
11489
  H("mimetype", "application/epub+zip"), H("META-INF/container.xml", '<?xml version="1.0" encoding="UTF-8"?><container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container"><rootfiles><rootfile full-path="EPUB/package.opf" media-type="application/oebps-package+xml"/></rootfiles></container>'), H("EPUB/style.css", Qp);
11490
- for (let S of A) H(`EPUB/${S.name}`, V(S.nodes.map($).join(""), u));
11490
+ for (let S of A) H(`EPUB/${S.name}`, J(S.nodes.map($).join(""), u));
11491
11491
  for (let S of g.values()) H(`EPUB/${S.path}`, S.bytes);
11492
- y2 !== void 0 && H("EPUB/cover.xhtml", V(`<section class="cover" epub:type="cover"><h1>${i2(u)}</h1><img src="${Gs(g.get(y2).path)}" alt="${i2(u)}"/></section>`, u)), H("EPUB/nav.xhtml", V(`<nav epub:type="toc" id="toc"><h1>Contents</h1><ol>${P.map((S) => `<li class="level-${S.level}"><a href="${i2(S.href)}">${i2(S.label)}</a></li>`).join("")}</ol></nav>${y2 === void 0 ? "" : '<nav epub:type="landmarks"><h2>Landmarks</h2><ol><li><a epub:type="cover" href="cover.xhtml">Cover</a></li></ol></nav>'}`, "Contents"));
11492
+ y2 !== void 0 && H("EPUB/cover.xhtml", J(`<section class="cover" epub:type="cover"><h1>${i2(u)}</h1><img src="${Gs(g.get(y2).path)}" alt="${i2(u)}"/></section>`, u)), H("EPUB/nav.xhtml", J(`<nav epub:type="toc" id="toc"><h1>Contents</h1><ol>${P.map((S) => `<li class="level-${S.level}"><a href="${i2(S.href)}">${i2(S.label)}</a></li>`).join("")}</ol></nav>${y2 === void 0 ? "" : '<nav epub:type="landmarks"><h2>Landmarks</h2><ol><li><a epub:type="cover" href="cover.xhtml">Cover</a></li></ol></nav>'}`, "Contents"));
11493
11493
  let q = rd.create(), M;
11494
11494
  try {
11495
11495
  for (let [S, B] of Y) {
@@ -11891,16 +11891,16 @@ var xd = { format: "docx", imageResources: "embed", async write(s15, t2) {
11891
11891
  t2.checkpoint();
11892
11892
  let W = G[z];
11893
11893
  if (N.raw !== void 0) {
11894
- let J = new u(new TextEncoder().encode(`<w:p xmlns:w="${a}" xmlns:r="${r}">${N.raw}</w:p>`), {}, void 0, p2.budget);
11895
- q.set(W, J.sourceXml(J.root, /* @__PURE__ */ new Map(), true));
11894
+ let V = new u(new TextEncoder().encode(`<w:p xmlns:w="${a}" xmlns:r="${r}">${N.raw}</w:p>`), {}, void 0, p2.budget);
11895
+ q.set(W, V.sourceXml(V.root, /* @__PURE__ */ new Map(), true));
11896
11896
  continue;
11897
11897
  }
11898
- let X = W.children.find((J) => J.localName === "rPr"), _ = N.code ? '<w:rStyle w:val="VerbatimChar"/>' : "", S = (N.strike ? "<w:strike/>" : "") + (N.baseline ? `<w:vertAlign w:val="${N.baseline}"/>` : ""), B = /* @__PURE__ */ new Map();
11898
+ let X = W.children.find((V) => V.localName === "rPr"), _ = N.code ? '<w:rStyle w:val="VerbatimChar"/>' : "", S = (N.strike ? "<w:strike/>" : "") + (N.baseline ? `<w:vertAlign w:val="${N.baseline}"/>` : ""), B = /* @__PURE__ */ new Map();
11899
11899
  X && (_ || S) && B.set(X, `<w:rPr>${_}${y2.sourceXml(X, /* @__PURE__ */ new Map(), true)}${S}</w:rPr>`);
11900
11900
  let j = N.image ? `<w:r>${await E(N.image)}</w:r>` : `<w:r>${!X && (_ || S) ? `<w:rPr>${_}${S}</w:rPr>` : ""}${y2.sourceXml(W, B, true)}</w:r>`;
11901
11901
  if (N.link !== void 0) {
11902
- let J = N.link.startsWith("#"), Z = `rId${x++}`;
11903
- J || v.push(`<Relationship Id="${Z}" Type="${r}/hyperlink" Target="${hr(N.link)}" TargetMode="External"/>`), j = `<w:hyperlink ${J ? `w:anchor="${hr(N.link.slice(1))}"` : `xmlns:r="${r}" r:id="${Z}"`}>${j}</w:hyperlink>`;
11902
+ let V = N.link.startsWith("#"), Z = `rId${x++}`;
11903
+ V || v.push(`<Relationship Id="${Z}" Type="${r}/hyperlink" Target="${hr(N.link)}" TargetMode="External"/>`), j = `<w:hyperlink ${V ? `w:anchor="${hr(N.link.slice(1))}"` : `xmlns:r="${r}" r:id="${Z}"`}>${j}</w:hyperlink>`;
11904
11904
  }
11905
11905
  (_ || S || N.image || N.link !== void 0) && q.set(W, j);
11906
11906
  }
@@ -11922,13 +11922,13 @@ var xd = { format: "docx", imageResources: "embed", async write(s15, t2) {
11922
11922
  await d({ members: P, comment: w.comment }, { async write(U) {
11923
11923
  $ += U.length, t2.bound("outputBytes", $), t2.charge("retainedBytes", U.length), R2.push(new Uint8Array(U));
11924
11924
  } }, { order: "name", compression: "store" }, m2);
11925
- let V = new Uint8Array($), Y = 0;
11926
- for (let U of R2) V.set(U, Y), Y += U.length;
11927
- return { kind: "binary", bytes: V };
11925
+ let J = new Uint8Array($), Y = 0;
11926
+ for (let U of R2) J.set(U, Y), Y += U.length;
11927
+ return { kind: "binary", bytes: J };
11928
11928
  });
11929
11929
  } };
11930
11930
  var kd = { reader: yd, writer: xd, name: "docx", read: true, write: true, media: "binary", inputEncoding: "bytes", suffixes: ["docx"], extensions: {}, options: { read: [], write: ["standalone"] } };
11931
- var vd = p(qo(), 1);
11931
+ var vd = p(Vo(), 1);
11932
11932
  var ht = Object.fromEntries(["office", "text", "style", "table", "draw", "manifest"].map((s15) => [s15, `urn:oasis:names:tc:opendocument:xmlns:${s15 === "draw" ? "drawing" : s15}:1.0`]));
11933
11933
  var an = "application/vnd.oasis.opendocument.text";
11934
11934
  var _n = "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0";
@@ -12080,8 +12080,8 @@ var Td = { format: "odt", async read(s15, t2) {
12080
12080
  let C = [];
12081
12081
  for (let R2 of Ae(I, "table-cell", ht.table)) {
12082
12082
  (u(Dt(R2, "number-columns-spanned", ht.table), t2.limits.tableColumns) !== 1 || u(Dt(R2, "number-rows-spanned", ht.table), t2.limits.tableRows) !== 1) && At(t2, "ODT table spans are unsupported", "E_UNSUPPORTED_FEATURE");
12083
- let $ = u(Dt(R2, "number-columns-repeated", ht.table), t2.limits.tableColumns), V = await p2(R2.children);
12084
- for (let Y = 0; Y < $; Y++) t2.charge("tableCells", 1), C.push([Si, "AlignDefault", 1, 1, V]);
12083
+ let $ = u(Dt(R2, "number-columns-repeated", ht.table), t2.limits.tableColumns), J = await p2(R2.children);
12084
+ for (let Y = 0; Y < $; Y++) t2.charge("tableCells", 1), C.push([Si, "AlignDefault", 1, 1, J]);
12085
12085
  t2.bound("tableColumns", C.length);
12086
12086
  }
12087
12087
  E = Math.max(E, C.length);
@@ -12278,18 +12278,18 @@ var Id = { format: "xlsx", async read(s15, t2) {
12278
12278
  }
12279
12279
  } };
12280
12280
  var Pd = { reader: Id, name: "xlsx", read: true, write: false, media: "binary", inputEncoding: "bytes", suffixes: ["xlsx"], extensions: {}, options: { read: [], write: [] } };
12281
- var Qo = [Cc, Bc, Oc, Lc, Dc, _c, Uc, jc, Kc, sf, hf, ld, ud, kd, Ed, Ad, Pd];
12282
- var Zo = (s15, t2) => s15 < t2 ? -1 : s15 > t2 ? 1 : 0;
12281
+ var Zo = [Cc, Bc, Oc, Lc, Dc, _c, Uc, jc, Kc, sf, hf, ld, ud, kd, Ed, Ad, Pd];
12282
+ var tl = (s15, t2) => s15 < t2 ? -1 : s15 > t2 ? 1 : 0;
12283
12283
  var cm = /* @__PURE__ */ new Set(["citations", "yaml_metadata_block", "tex_math_dollars", "fenced_code_blocks", "backtick_code_blocks", "footnotes", "smart", "implicit_figures", "definition_lists", "header_attributes", "auto_identifiers", "link_attributes", "bracketed_spans", "native_divs", "native_spans"]);
12284
12284
  function Qs(s15) {
12285
12285
  if (!s15) return false;
12286
12286
  for (let t2 of s15) if (!(t2 >= "a" && t2 <= "z") && !(t2 >= "0" && t2 <= "9") && t2 !== "_") return false;
12287
12287
  return true;
12288
12288
  }
12289
- function Ie(s15 = Qo, t2 = {}, e2 = "convert") {
12289
+ function Ie(s15 = Zo, t2 = {}, e2 = "convert") {
12290
12290
  let i2 = (c, d) => {
12291
12291
  throw new t(c, e2, d);
12292
- }, n = /* @__PURE__ */ new Set(), a = { read: /* @__PURE__ */ new Map(), write: /* @__PURE__ */ new Map() }, r = s15.map((c) => Object.freeze({ ...c, ...c.aliases === void 0 ? {} : { aliases: Object.freeze({ ...c.aliases.read === void 0 ? {} : { read: Object.freeze([...c.aliases.read]) }, ...c.aliases.write === void 0 ? {} : { write: Object.freeze([...c.aliases.write]) } }) }, suffixes: Object.freeze([...c.suffixes]), extensions: Object.freeze({ ...c.extensions }), options: Object.freeze({ read: Object.freeze([...c.options.read]), write: Object.freeze([...c.options.write]) }) })).sort((c, d) => Zo(c.name, d.name));
12292
+ }, n = /* @__PURE__ */ new Set(), a = { read: /* @__PURE__ */ new Map(), write: /* @__PURE__ */ new Map() }, r = s15.map((c) => Object.freeze({ ...c, ...c.aliases === void 0 ? {} : { aliases: Object.freeze({ ...c.aliases.read === void 0 ? {} : { read: Object.freeze([...c.aliases.read]) }, ...c.aliases.write === void 0 ? {} : { write: Object.freeze([...c.aliases.write]) } }) }, suffixes: Object.freeze([...c.suffixes]), extensions: Object.freeze({ ...c.extensions }), options: Object.freeze({ read: Object.freeze([...c.options.read]), write: Object.freeze([...c.options.write]) }) })).sort((c, d) => tl(c.name, d.name));
12293
12293
  for (let c of r) {
12294
12294
  (!Qs(c.name) || n.has(c.name)) && i2("E_FORMAT", `Invalid or duplicate format: ${c.name}`), n.add(c.name), (c.reader && (!c.read || c.reader.format !== c.name) || c.writer && (!c.write || c.writer.format !== c.name)) && i2("E_CAPABILITY", `Invalid binding: ${c.name}`);
12295
12295
  for (let d of Object.keys(c.extensions)) Qs(d) || i2("E_EXTENSION", `Invalid extension: ${d}`);
@@ -12305,7 +12305,7 @@ function Ie(s15 = Qo, t2 = {}, e2 = "convert") {
12305
12305
  for (; u < c.length && c[u] !== "+" && c[u] !== "-"; ) u++;
12306
12306
  let h = c.slice(0, u), p2 = d ?? (a.read.has(h) ? "read" : "write"), m2 = a[p2].get(h) ?? (h === "mediawiki" ? Dl : void 0);
12307
12307
  if (!m2) return i2("E_FORMAT", `Unsupported ${p2} format: ${h}`);
12308
- let w = Object.fromEntries(Object.entries(m2.extensions).sort(([y2], [g]) => Zo(y2, g)));
12308
+ let w = Object.fromEntries(Object.entries(m2.extensions).sort(([y2], [g]) => tl(y2, g)));
12309
12309
  for (; u < c.length; ) {
12310
12310
  let y2 = c[u++] === "+", g = u;
12311
12311
  for (; u < c.length && c[u] !== "+" && c[u] !== "-"; ) u++;
@@ -12318,7 +12318,7 @@ function Ie(s15 = Qo, t2 = {}, e2 = "convert") {
12318
12318
  let u = f(c, d), h = o2(u.descriptor), p2 = l(u.descriptor);
12319
12319
  return (d === "read" ? h : p2) || i2("E_CAPABILITY", `No ${d} capability for ${u.descriptor.name}`), { ...u, reader: h, writer: p2 };
12320
12320
  }, list(c) {
12321
- return [...a[c]].filter(([, d]) => c === "read" ? o2(d) : l(d)).map(([d]) => d).sort(Zo);
12321
+ return [...a[c]].filter(([, d]) => c === "read" ? o2(d) : l(d)).map(([d]) => d).sort(tl);
12322
12322
  }, listExtensions(c, d) {
12323
12323
  return Object.entries(f(c, d).extensions).map(([u, h]) => `${h ? "+" : "-"}${u}`);
12324
12324
  }, infer(c, d) {
@@ -12353,12 +12353,12 @@ function Rd(s15, t2, e2) {
12353
12353
  let c = o2 ? i2.slice(2) : a < 0 ? void 0 : i2.slice(a + 1), d = l === "bash" ? "bash" : c ?? s15[1];
12354
12354
  if (!d || s15.length !== (l === "bash" || c !== void 0 ? 1 : 2)) return f("Use an inspection flag with exactly one value");
12355
12355
  if (l === "template") {
12356
- if (d === "html" || d === "html5") return Cr;
12356
+ if (d === "html" || d === "html5") return Br;
12357
12357
  throw new t("E_CAPABILITY", "convert", `No bundled default template for ${d}`);
12358
12358
  }
12359
12359
  if (l === "data") {
12360
12360
  if (d === "abbreviations") return $l;
12361
- if (d === "templates/default.html5") return Cr;
12361
+ if (d === "templates/default.html5") return Br;
12362
12362
  throw new t("E_RESOURCE", "convert", `No bundled data file: ${d}`);
12363
12363
  }
12364
12364
  if (l === "style") {
@@ -12389,7 +12389,7 @@ Use -- before`)[0].split(`
12389
12389
  complete -o filenames -o bashdefault -F _pandoc_typescript pandoc
12390
12390
  `;
12391
12391
  }
12392
- function tl(s15, t2 = {}) {
12392
+ function el(s15, t2 = {}) {
12393
12393
  if (s15[0] === "--help" || s15[0] === "-h") {
12394
12394
  if (!s15.every((i2) => i2 === "--help" || i2 === "-h")) throw new t("E_OPTION", "convert", "Use help flags alone");
12395
12395
  return `Usage: pandoc -f FORMAT -t FORMAT [OPTIONS] [FILE|- ...]
@@ -12418,7 +12418,7 @@ Capabilities (available directions):
12418
12418
  return `pandoc TypeScript converter 0.0.1 (original bounded implementation)
12419
12419
  `;
12420
12420
  }
12421
- let e2 = Rd(s15, t2, () => tl(["--help"], t2));
12421
+ let e2 = Rd(s15, t2, () => el(["--help"], t2));
12422
12422
  if (e2 !== void 0) return e2;
12423
12423
  if (s15[0]?.startsWith("--list-")) return Zs(s15, t2);
12424
12424
  }
@@ -12627,7 +12627,7 @@ var tr = class {
12627
12627
  let M = new fm({ fs: P.fs, cwd: P.directory, env: {}, signal: a.signal ?? new AbortController().signal }, q / 16384);
12628
12628
  a.onClose(() => M.close()), this.storage = M;
12629
12629
  }
12630
- let $ = R2 ? this.storage.allocate(0) : 0, V = [], Y = 0, U = a.signal ? { signal: a.signal } : {};
12630
+ let $ = R2 ? this.storage.allocate(0) : 0, J = [], Y = 0, U = a.signal ? { signal: a.signal } : {};
12631
12631
  await a.call(async () => {
12632
12632
  let q = n.readStream ? n.readStream(F, U) : (async function* () {
12633
12633
  n.readFile || a.fail("E_CAPABILITY", "VFS requires explicit resource reads");
@@ -12640,7 +12640,7 @@ var tr = class {
12640
12640
  yield M;
12641
12641
  })();
12642
12642
  await a.consume(q, async (M) => {
12643
- R2 ? await this.storage.append(M) : (a.charge("references", 1), V.push(M)), Y += M.length;
12643
+ R2 ? await this.storage.append(M) : (a.charge("references", 1), J.push(M)), Y += M.length;
12644
12644
  }, ["resourceBytes"]);
12645
12645
  });
12646
12646
  let H;
@@ -12648,7 +12648,7 @@ var tr = class {
12648
12648
  else {
12649
12649
  a.charge("retainedBytes", Y);
12650
12650
  let q = new Uint8Array(Y), M = 0;
12651
- for (let G of V) q.set(G, M), M += G.length, await a.cooperate();
12651
+ for (let G of J) q.set(G, M), M += G.length, await a.cooperate();
12652
12652
  H = { bytes: q };
12653
12653
  }
12654
12654
  E = this.allocate(v.name.slice(v.name.lastIndexOf("/") + 1), H), this.bag.set(F, E);
@@ -12754,16 +12754,16 @@ function ir(s15, t2, e2, i2 = []) {
12754
12754
  P || p2("Missing variable value");
12755
12755
  let R2 = Math.min(...[P.indexOf("="), P.indexOf(":")].filter((Y) => Y >= 0)), $ = Number.isFinite(R2) ? P.slice(0, R2) : P;
12756
12756
  (!$ || ["__proto__", "constructor", "prototype"].includes($) || [...$].some((Y) => !(Y >= "a" && Y <= "z") && !(Y >= "A" && Y <= "Z") && !(Y >= "0" && Y <= "9") && !"_-".includes(Y))) && p2("Invalid variable key");
12757
- let V = Number.isFinite(R2) ? P.slice(R2 + 1) : true;
12757
+ let J = Number.isFinite(R2) ? P.slice(R2 + 1) : true;
12758
12758
  if (k === "--variable-json") try {
12759
- V = JSON.parse(String(V));
12759
+ J = JSON.parse(String(J));
12760
12760
  } catch {
12761
12761
  p2("Invalid JSON variable value");
12762
12762
  }
12763
12763
  if (Object.hasOwn(f, $)) {
12764
12764
  let Y = f[$];
12765
- f[$] = [...Array.isArray(Y) ? Y : [Y], V];
12766
- } else f[$] = V;
12765
+ f[$] = [...Array.isArray(Y) ? Y : [Y], J];
12766
+ } else f[$] = J;
12767
12767
  n.variables = f;
12768
12768
  continue;
12769
12769
  }
@@ -12833,16 +12833,16 @@ function ir(s15, t2, e2, i2 = []) {
12833
12833
  (R2 < 1 || P === "") && p2("Metadata requires a key");
12834
12834
  let $ = Number.isFinite(R2) ? P.slice(0, R2) : P;
12835
12835
  (["__proto__", "constructor", "prototype"].includes($) || [...$].some((Y) => !(Y >= "a" && Y <= "z") && !(Y >= "A" && Y <= "Z") && !(Y >= "0" && Y <= "9") && Y !== "-" && Y !== "_")) && p2("Invalid metadata key");
12836
- let V = Number.isFinite(R2) ? P.slice(R2 + 1) : "true";
12837
- if (V.startsWith("{") || V.startsWith("[") || V.startsWith('"') || ["true", "false", "null"].includes(V)) {
12836
+ let J = Number.isFinite(R2) ? P.slice(R2 + 1) : "true";
12837
+ if (J.startsWith("{") || J.startsWith("[") || J.startsWith('"') || ["true", "false", "null"].includes(J)) {
12838
12838
  let Y;
12839
12839
  try {
12840
- Y = JSON.parse(V);
12840
+ Y = JSON.parse(J);
12841
12841
  } catch {
12842
12842
  p2("Invalid JSON metadata value");
12843
12843
  }
12844
12844
  r.push({ [$]: Y });
12845
- } else r.push({ [$]: V });
12845
+ } else r.push({ [$]: J });
12846
12846
  continue;
12847
12847
  }
12848
12848
  let F = h.get(k);
@@ -13059,7 +13059,7 @@ var nr = class {
13059
13059
  return { start: e2, end: i2 };
13060
13060
  }
13061
13061
  };
13062
- var el = ["Code", "CodeBlock", "HorizontalRule", "Str", "Space", "LineBreak", "Strong", "Emph", "Underline", "Strikeout", "SmallCaps", "Superscript", "Subscript", "Span", "Para", "Header", "Div", "BulletList", "OrderedList", "Table", "ColWidthDefault", "AlignDefault", "Plain", "Image", "Link", "Note", "Decimal", "UpperRoman", "LowerRoman", "UpperAlpha", "LowerAlpha", "Period", "OneParen", "TwoParens", "BlockQuote", "Figure"];
13062
+ var ar = ["Code", "CodeBlock", "HorizontalRule", "Str", "Space", "LineBreak", "Strong", "Emph", "Underline", "Strikeout", "SmallCaps", "Superscript", "Subscript", "Span", "Para", "Header", "Div", "BulletList", "OrderedList", "Table", "ColWidthDefault", "AlignDefault", "Plain", "Image", "Link", "Note", "Decimal", "UpperRoman", "LowerRoman", "UpperAlpha", "LowerAlpha", "Period", "OneParen", "TwoParens", "BlockQuote", "Figure", "MetaMap", "MetaList", "MetaString", "MetaBlocks", "MetaInlines"];
13063
13063
  var Wn = class {
13064
13064
  constructor(t2, e2) {
13065
13065
  this.storage = t2;
@@ -13084,11 +13084,14 @@ var Wn = class {
13084
13084
  async array() {
13085
13085
  return { position: await this.record([0, 0, 0, 0, 0]) };
13086
13086
  }
13087
+ async object() {
13088
+ return { position: await this.record([4, 0, 0, 0, 0]) };
13089
+ }
13087
13090
  async string(t2) {
13088
13091
  return { position: await this.record([1, t2.first, t2.last, t2.units, 0]) };
13089
13092
  }
13090
13093
  async tag(t2, e2) {
13091
- return { position: await this.record([3, el.indexOf(t2), e2?.position ?? 0, 0, 0]) };
13094
+ return { position: await this.record([3, ar.indexOf(t2), e2?.position ?? 0, 0, 0]) };
13092
13095
  }
13093
13096
  async value(t2) {
13094
13097
  if (typeof t2 == "string") return this.string(await this.text.from([t2]));
@@ -13103,7 +13106,7 @@ var Wn = class {
13103
13106
  }
13104
13107
  async list(t2) {
13105
13108
  let e2 = await this.fields(t2.position, 5);
13106
- if (e2[0] !== 0) throw new Error("RTF AST array required");
13109
+ if (e2[0] !== 0 && e2[0] !== 4) throw new Error("Retained AST collection required");
13107
13110
  return e2;
13108
13111
  }
13109
13112
  async count(t2) {
@@ -13134,7 +13137,7 @@ var Wn = class {
13134
13137
  }
13135
13138
  async name(t2) {
13136
13139
  let e2 = await this.fields(t2.position, 2);
13137
- return e2[0] === 3 ? el[e2[1]] : void 0;
13140
+ return e2[0] === 3 ? ar[e2[1]] : void 0;
13138
13141
  }
13139
13142
  async content(t2) {
13140
13143
  let e2 = await this.fields(t2.position, 3);
@@ -13149,12 +13152,73 @@ var Wn = class {
13149
13152
  let i2 = await this.range(t2);
13150
13153
  await this.text.append(i2, e2), await this.put(t2.position + 8, [i2.first, i2.last, i2.units]);
13151
13154
  }
13155
+ async kind(t2) {
13156
+ return ["array", "string", "literal", "tag", "object"][(await this.fields(t2.position, 1))[0]];
13157
+ }
13158
+ async at(t2, e2) {
13159
+ if (!Number.isSafeInteger(e2) || e2 < 0) throw new RangeError("Invalid retained array index");
13160
+ let i2 = 0;
13161
+ for await (let n of this.children(t2)) if (i2++ === e2) return n;
13162
+ }
13163
+ async set(t2, e2, i2) {
13164
+ if (!Number.isSafeInteger(e2) || e2 < 0) throw new RangeError("Invalid retained array index");
13165
+ let n = (await this.list(t2))[1];
13166
+ for (; n && e2--; ) await this.cooperate(), n = (await this.fields(n + 8, 1))[0];
13167
+ if (await this.cooperate(), !n) throw new RangeError("Retained array index out of range");
13168
+ await this.put(n + 16, [i2.position]);
13169
+ }
13170
+ async replaceTag(t2, e2, i2) {
13171
+ if (await this.kind(t2) !== "tag") throw new Error("Retained tag required");
13172
+ await this.put(t2.position, [3, ar.indexOf(e2), i2?.position ?? 0, 0, 0]);
13173
+ }
13174
+ async walk(t2, e2) {
13175
+ let i2 = await this.record([0, t2.position, 0, 0]), n = async (a, r, o2) => {
13176
+ i2 = await this.record([i2, a, r, o2]);
13177
+ };
13178
+ for (; i2; ) {
13179
+ let [a, r, o2, l] = await this.fields(i2, 4);
13180
+ i2 = a, await this.cooperate();
13181
+ let c = await e2({ position: r }, o2, !!l);
13182
+ if (l || (await n(r, o2, 1), c === false)) continue;
13183
+ if (c) {
13184
+ await n(c.descend.position, o2 + 1, 0);
13185
+ continue;
13186
+ }
13187
+ let d = await this.fields(r, 5);
13188
+ if (d[0] === 3 && d[2]) await n(d[2], o2 + 1, 0);
13189
+ else if (d[0] === 0 || d[0] === 4) {
13190
+ let u = d[2];
13191
+ for (; u; ) {
13192
+ await this.cooperate();
13193
+ let [h, , p2] = await this.fields(u, 3);
13194
+ await n(p2, o2 + 1, 0), u = h;
13195
+ }
13196
+ }
13197
+ }
13198
+ }
13199
+ async clone(t2) {
13200
+ let e2 = 0, i2 = async (a) => {
13201
+ await this.cooperate();
13202
+ let r = await this.fields(a.position, 5), o2 = r[0];
13203
+ if (o2 === 1) return this.string(await this.text.from(this.text.chunks(await this.range(a))));
13204
+ let l = { position: await this.record(o2 === 0 || o2 === 4 ? [o2, 0, 0, 0, 0] : o2 === 3 ? [o2, r[1], 0, 0, 0] : r) };
13205
+ return (o2 === 0 || o2 === 3 || o2 === 4) && (e2 = await this.record([e2, a.position, l.position])), l;
13206
+ }, n = await i2(t2);
13207
+ for (; e2; ) {
13208
+ let [a, r, o2] = await this.fields(e2, 3);
13209
+ e2 = a;
13210
+ let l = await this.fields(r, 5);
13211
+ if (l[0] === 3 && l[2]) await this.put(o2 + 16, [(await i2({ position: l[2] })).position]);
13212
+ else if (l[0] !== 3) for await (let f of this.children({ position: r })) await this.push({ position: o2 }, await i2(f));
13213
+ }
13214
+ return n;
13215
+ }
13152
13216
  async write(t2, e2) {
13153
13217
  let i2 = 0, n = async (a) => {
13154
13218
  await this.cooperate();
13155
13219
  let r = await this.fields(a.position, 5), o2 = r[0];
13156
- if (o2 === 0) await e2.begin("array"), i2 = await this.record([i2, r[1], 0]);
13157
- else if (o2 === 3) await e2.begin("object"), await e2.key("t"), await e2.value(el[r[1]]), r[2] && await e2.key("c"), i2 = await this.record([i2, r[2], 1]);
13220
+ if (o2 === 0 || o2 === 4) await e2.begin(o2 === 0 ? "array" : "object"), i2 = await this.record([i2, r[1], o2 === 4 ? 2 : 0]);
13221
+ else if (o2 === 3) await e2.begin("object"), await e2.key("t"), await e2.value(ar[r[1]]), r[2] && await e2.key("c"), i2 = await this.record([i2, r[2], 1]);
13158
13222
  else if (o2 === 1) {
13159
13223
  await e2.begin("string");
13160
13224
  for await (let l of this.text.chunks({ first: r[1], last: r[2], units: r[3] })) await e2.text(l);
@@ -13165,8 +13229,15 @@ var Wn = class {
13165
13229
  await this.cooperate();
13166
13230
  let [a, r, o2] = await this.fields(i2, 3);
13167
13231
  if (!r) await e2.end(), i2 = a;
13168
- else if (o2) await this.put(i2 + 8, [0]), await n({ position: r });
13169
- else {
13232
+ else if (o2 === 1) await this.put(i2 + 8, [0]), await n({ position: r });
13233
+ else if (o2 === 2) {
13234
+ let l = await this.fields(r, 3), f = { position: l[2] };
13235
+ if (await this.count(f) !== 2) throw new Error("Retained object entry requires a key/value pair");
13236
+ let c = await this.edge(f), d = await this.edge(f, true);
13237
+ await e2.begin("key");
13238
+ for await (let u of this.text.chunks(await this.range(c))) await e2.text(u);
13239
+ await e2.end(), await this.put(i2 + 8, [l[1]]), await n(d);
13240
+ } else {
13170
13241
  let l = await this.fields(r, 3);
13171
13242
  await this.put(i2 + 8, [l[1]]), await n({ position: l[2] });
13172
13243
  }
@@ -13182,7 +13253,7 @@ async function* qi(s15, t2, e2, i2, n = false) {
13182
13253
  }, i2), t2.charge("retainedBytes", r), n && t2.charge("retainedBytes", r);
13183
13254
  for (let o2 = 0; o2 < r; o2 += 16384) yield await e2.read(a + o2, Math.min(16384, r - o2));
13184
13255
  }
13185
- async function ar(s15, t2, e2 = false, i2 = true) {
13256
+ async function sr(s15, t2, e2 = false, i2 = true) {
13186
13257
  let n = "";
13187
13258
  for (; t2 !== s15.rootPosition; ) {
13188
13259
  let a = (await s15.describe(t2)).parent, r = await s15.describe(a), o2 = 0;
@@ -13224,7 +13295,7 @@ async function* il(s15, t2, e2, i2) {
13224
13295
  }
13225
13296
  async function Ld(s15, t2, e2, i2) {
13226
13297
  let n = new hm(e2, 64), a = async (h, p2, m2 = "") => {
13227
- throw new t("E_AST", "read", p2, "json", await ar(s15, h, false, false) + m2);
13298
+ throw new t("E_AST", "read", p2, "json", await sr(s15, h, false, false) + m2);
13228
13299
  }, r = async (h, p2, m2) => {
13229
13300
  let w = await s15.describe(h);
13230
13301
  (w.kind !== p2 || m2 !== void 0 && w.children !== m2) && await a(h, m2 === void 0 ? `Expected ${p2}` : "Invalid tuple arity");
@@ -13285,15 +13356,15 @@ async function Ld(s15, t2, e2, i2) {
13285
13356
  return n;
13286
13357
  }
13287
13358
  var nl = /* @__PURE__ */ new Set(["AlignDefault", "AlignLeft", "AlignRight", "AlignCenter", "SingleQuote", "DoubleQuote", "InlineMath", "DisplayMath", "AuthorInText", "SuppressAuthor", "NormalCitation", "DefaultStyle", "Example", "Decimal", "LowerRoman", "UpperRoman", "LowerAlpha", "UpperAlpha", "DefaultDelim", "Period", "OneParen", "TwoParens"]);
13288
- async function Ji(s15, t2, e2, i2, n = false) {
13359
+ async function Vi(s15, t2, e2, i2, n = false) {
13289
13360
  if (!Number.isFinite(e2.limits.tableCells) && !Number.isFinite(e2.limits.attributes) && !Number.isFinite(e2.limits.depth) && !Number.isFinite(e2.limits.nodes) && !Number.isFinite(e2.limits.text) && !Number.isFinite(e2.limits.references) && !Number.isFinite(e2.limits.retainedBytes)) return { nodes: 0, text: 0 };
13290
13361
  let a = 0, r = 0, o2 = 0, l = 0, f = 0, c = async (w, y2, g = "E_AST") => {
13291
- let b = await ar(s15, w);
13362
+ let b = await sr(s15, w);
13292
13363
  throw new t(g, "convert", `${b}: ${y2}`, void 0, b);
13293
13364
  }, d = async (w, y2 = 1, g = true, b = "") => {
13294
13365
  let x = l + y2;
13295
13366
  if (!Number.isSafeInteger(x) || x > e2.limits.nodes) {
13296
- let v = await ar(s15, w) + b;
13367
+ let v = await sr(s15, w) + b;
13297
13368
  throw new t("E_LIMIT", "convert", `${v}: AST budget exceeded`, void 0, v);
13298
13369
  }
13299
13370
  g && (l = x, n || e2.charge("nodes", y2));
@@ -13324,12 +13395,12 @@ async function Ji(s15, t2, e2, i2, n = false) {
13324
13395
  await e2.cooperate();
13325
13396
  let k = await s15.describe(g), T = await p2(g);
13326
13397
  if (v + 1 > e2.limits.depth && await c(x ? k.parent : g, "AST budget exceeded", "E_LIMIT"), x && (await d(k.parent), await u(k.parent, ((await s15.describe(x)).end - x - 32) / 2)), i2 && x && (await h(x, k.parent), ["__proto__", "constructor", "prototype"].includes(await s15.smallText(x, 11) ?? "") && await c(g, "Invalid shape")), await d(g), T || k.kind === "string") {
13327
- let V = T || g;
13328
- await u(g, ((await s15.describe(V)).end - V - 32) / 2);
13398
+ let J = T || g;
13399
+ await u(g, ((await s15.describe(J)).end - J - 32) / 2);
13329
13400
  }
13330
13401
  if (i2 && (T || k.kind === "string") && await h(T || g, g), k.kind === "array" && !T && await d(g, k.children, false), k.kind === "array" && k.children === 3 && Number.isFinite(e2.limits.attributes)) {
13331
- let V = await s15.describe(g + 32), Y = await s15.describe(V.end), U = await s15.describe(Y.end);
13332
- if ((V.kind === "string" || await i2?.get(BigInt(g + 32))) && Y.kind === "array" && U.kind === "array") {
13402
+ let J = await s15.describe(g + 32), Y = await s15.describe(J.end), U = await s15.describe(Y.end);
13403
+ if ((J.kind === "string" || await i2?.get(BigInt(g + 32))) && Y.kind === "array" && U.kind === "array") {
13333
13404
  let H = 1 + Y.children + U.children;
13334
13405
  o2 += H, (!Number.isSafeInteger(o2) || o2 > e2.limits.attributes) && await c(g, "AST budget exceeded", "E_LIMIT"), n || e2.charge("attributes", H);
13335
13406
  }
@@ -13337,10 +13408,10 @@ async function Ji(s15, t2, e2, i2, n = false) {
13337
13408
  if (k.kind !== "array" || k.children !== 5) continue;
13338
13409
  let E = await s15.describe(g + 32), A = await s15.describe(E.end), I = A.kind === "object" ? await s15.property(E.end, "t") : void 0, F = i2 ? A.kind === "string" || !!await i2.get(BigInt(E.end)) : I !== void 0 && ["AlignDefault", "AlignLeft", "AlignRight", "AlignCenter"].includes(await s15.smallText(I, 16) ?? "");
13339
13410
  if (E.kind !== "array" || !F) continue;
13340
- let C = A.end, P = (await s15.describe(C)).end, R2 = async (V) => {
13341
- if ((await s15.describe(V)).kind !== "literal") return c(g, "Invalid spans");
13411
+ let C = A.end, P = (await s15.describe(C)).end, R2 = async (J) => {
13412
+ if ((await s15.describe(J)).kind !== "literal") return c(g, "Invalid spans");
13342
13413
  try {
13343
- let Y = await readJsonNumber(s15.scalarChunks(V), (U) => e2.cooperate(U));
13414
+ let Y = await readJsonNumber(s15.scalarChunks(J), (U) => e2.cooperate(U));
13344
13415
  return !Number.isSafeInteger(Y) || Y < 1 ? c(g, "Invalid spans") : Y;
13345
13416
  } catch (Y) {
13346
13417
  if (Y instanceof JsonNumberError) return c(g, "Invalid spans");
@@ -13352,7 +13423,7 @@ async function Ji(s15, t2, e2, i2, n = false) {
13352
13423
  }
13353
13424
  return await d(s15.rootPosition), await u(s15.rootPosition, 9), await d(s15.rootPosition, 1, true, ".resources"), { nodes: l, text: f };
13354
13425
  }
13355
- async function* sr(s15, t2, e2, i2 = [], n, a = false, r = !a) {
13426
+ async function* rr(s15, t2, e2, i2 = [], n, a = false, r = !a) {
13356
13427
  let o2 = new Tt(e2, (f) => t2.cooperate(f)), l = at();
13357
13428
  await t2.decodeUtf8To(s15, async (f) => {
13358
13429
  await o2.append(l, await o2.from([f]));
@@ -13371,7 +13442,7 @@ var al = Rt(ye, te(pm));
13371
13442
  var Dd = Rt(ye, te(al));
13372
13443
  var mm = { record: { citationId: "string", citationPrefix: Wt, citationSuffix: Wt, citationMode: qn("AuthorInText", "SuppressAuthor", "NormalCitation"), citationNoteNum: "integer", citationHash: "integer" } };
13373
13444
  var _d = { document: { record: { "pandoc-api-version": Rt(...[1, 23, 1, 2].map((s15) => ({ constant: s15 }))), meta: { map: "meta" }, blocks: Pe } }, inline: { tag: { Str: "string", Space: null, SoftBreak: null, LineBreak: null, Emph: Wt, Underline: Wt, Strong: Wt, Strikeout: Wt, Superscript: Wt, Subscript: Wt, SmallCaps: Wt, Quoted: Rt(qn("SingleQuote", "DoubleQuote"), Wt), Cite: Rt(te(mm), Wt), Code: Rt(ye, "string"), Math: Rt(qn("InlineMath", "DisplayMath"), "string"), RawInline: Rt("string", "string"), Link: Rt(ye, Wt, Rt("string", "string")), Image: Rt(ye, Wt, Rt("string", "string")), Note: Pe, Span: Rt(ye, Wt) } }, block: { tag: { Plain: Wt, Para: Wt, LineBlock: te(Wt), CodeBlock: Rt(ye, "string"), RawBlock: Rt("string", "string"), BlockQuote: Pe, OrderedList: Rt(Rt("integer", qn("DefaultStyle", "Example", "Decimal", "LowerRoman", "UpperRoman", "LowerAlpha", "UpperAlpha"), qn("DefaultDelim", "Period", "OneParen", "TwoParens")), te(Pe)), BulletList: te(Pe), DefinitionList: te(Rt(Wt, te(Pe))), Header: Rt("positive", ye, Wt), HorizontalRule: null, Div: Rt(ye, Pe), Figure: Rt(ye, $d, Pe), Table: Rt(ye, $d, te(Rt(Ud, { tag: { ColWidthDefault: null, ColWidth: "width" } })), Dd, te(Rt(ye, "integer", te(al), te(al))), Dd) } }, meta: { tag: { MetaMap: { map: "meta" }, MetaList: te("meta"), MetaBool: "boolean", MetaString: "string", MetaInlines: Wt, MetaBlocks: Pe } } };
13374
- async function rr(s15, t2, e2, i2, n = false, a) {
13445
+ async function or(s15, t2, e2, i2, n = false, a) {
13375
13446
  let r = [], o2 = /* @__PURE__ */ new Map(), l = 0, f = 0, c = 0, d = async (y2, g, b = 0, x = 0) => {
13376
13447
  let v = o2.get(g);
13377
13448
  v === void 0 && (v = r.length, r.push(g), o2.set(g, v));
@@ -13438,8 +13509,8 @@ async function rr(s15, t2, e2, i2, n = false, a) {
13438
13509
  let U = BigInt(C + Y);
13439
13510
  Number(await T.get(U) ?? 0n) > A && await u(P, "Overlapping spans"), await T.set(U, BigInt(A + R2)), await e2.cooperate();
13440
13511
  }
13441
- let V = BigInt(A + R2);
13442
- await E.set(V, (await E.get(V) ?? 0n) + BigInt($)), I += $, C += $;
13512
+ let J = BigInt(A + R2);
13513
+ await E.set(J, (await E.get(J) ?? 0n) + BigInt($)), I += $, C += $;
13443
13514
  }
13444
13515
  I !== g && await u(F, "Incomplete row occupancy"), A++;
13445
13516
  }
@@ -13502,12 +13573,12 @@ async function rr(s15, t2, e2, i2, n = false, a) {
13502
13573
  if (F === "Table") if (n) {
13503
13574
  let R2 = new Uint8Array(16);
13504
13575
  new DataView(R2.buffer).setFloat64(8, C, true);
13505
- let V = await t2.append(R2);
13576
+ let J = await t2.append(R2);
13506
13577
  if (c) {
13507
13578
  let Y = new Uint8Array(8);
13508
- new DataView(Y.buffer).setFloat64(0, V, true), await t2.write(c, Y);
13509
- } else f = V;
13510
- c = V;
13579
+ new DataView(Y.buffer).setFloat64(0, J, true), await t2.write(c, Y);
13580
+ } else f = J;
13581
+ c = J;
13511
13582
  } else await d(C, "geometry");
13512
13583
  await d(C, P);
13513
13584
  }
@@ -13530,7 +13601,7 @@ async function rr(s15, t2, e2, i2, n = false, a) {
13530
13601
  await w(b.getFloat64(8, true)), y2 = b.getFloat64(0, true);
13531
13602
  }
13532
13603
  }
13533
- async function Vi(s15, t2, e2) {
13604
+ async function Ji(s15, t2, e2) {
13534
13605
  let i2 = new Md(t2, 64), n = new Md(t2, 64), a = async (f) => {
13535
13606
  let c = await t2.read(f, 8);
13536
13607
  return new DataView(c.buffer, c.byteOffset, 8).getFloat64(0, true);
@@ -13593,7 +13664,7 @@ async function Vi(s15, t2, e2) {
13593
13664
  return c === "null" || c === "true" || c === "false" ? c : JSON.stringify(await readJsonNumber(s15.scalarChunks(f), e2));
13594
13665
  } };
13595
13666
  }
13596
- async function Je(s15, t2, e2, i2 = true, n = true, a, r = i2, o2 = false) {
13667
+ async function Ve(s15, t2, e2, i2 = true, n = true, a, r = i2, o2 = false) {
13597
13668
  let l = e2.cacheBytes ?? 1048576;
13598
13669
  (!Number.isSafeInteger(l) || l < 16384 || l % 16384) && t2.fail("E_OPTION", "Working storage cacheBytes must be a positive multiple of 16384"), (typeof e2.directory != "string" || !e2.directory.startsWith("/")) && t2.fail("E_OPTION", "Working storage requires an absolute caller filesystem directory");
13599
13670
  let f = { fs: e2.fs, cwd: e2.directory, env: {}, signal: t2.signal ?? new AbortController().signal }, c = new jd(f, l / 16384), d = new jd(f, l / 16384), u = t2.onClose(async () => {
@@ -13666,7 +13737,7 @@ async function Je(s15, t2, e2, i2 = true, n = true, a, r = i2, o2 = false) {
13666
13737
  }
13667
13738
  yield U.value;
13668
13739
  }
13669
- }, C = r && (Number.isFinite(t2.limits.text) || Number.isFinite(t2.limits.references) || A) ? sr(I ? qi(F(), t2, d, ["inputBytes"], A) : F(), t2, d, i2 && !I ? ["inputBytes"] : [], a, A, !A || !i2 && !o2) : b;
13740
+ }, C = r && (Number.isFinite(t2.limits.text) || Number.isFinite(t2.limits.references) || A) ? rr(I ? qi(F(), t2, d, ["inputBytes"], A) : F(), t2, d, i2 && !I ? ["inputBytes"] : [], a, A, !A || !i2 && !o2) : b;
13670
13741
  await parseBackedJson(C, h, d, (U) => t2.cooperate(U), (U, H) => {
13671
13742
  throw new t("E_AST", "read", H, "json", `$@${U}`);
13672
13743
  }, async (U, H) => {
@@ -13680,17 +13751,17 @@ async function Je(s15, t2, e2, i2 = true, n = true, a, r = i2, o2 = false) {
13680
13751
  } : void 0, r ? (U, H) => {
13681
13752
  H || (t2.bound("nodes", ++T), A && t2.charge("retainedBytes", 16));
13682
13753
  } : void 0, r && Number.isFinite(t2.limits.references) ? () => t2.charge("references", 1) : void 0, r && A ? (U) => t2.charge("retainedBytes", U) : void 0);
13683
- let P = await Vi(h, d, (U) => t2.cooperate(U));
13754
+ let P = await Ji(h, d, (U) => t2.cooperate(U));
13684
13755
  if (n) try {
13685
13756
  let U = Number.isFinite(t2.limits.tableCells) || Number.isFinite(t2.limits.attributes) || Number.isFinite(t2.limits.depth) || Number.isFinite(t2.limits.nodes) || Number.isFinite(t2.limits.text) || Number.isFinite(t2.limits.references) || A ? await Ld(h, P, d, t2) : void 0;
13686
- E = await Ji(h, P, t2, U);
13757
+ E = await Vi(h, P, t2, U);
13687
13758
  } catch (U) {
13688
13759
  throw U instanceof t && U.code === "E_LIMIT" && s15.source ? new t(U.code, U.operation, U.message, U.format, `${s15.source}:${U.location ?? "1:1"}`) : U;
13689
13760
  }
13690
- await rr(h, d, t2, void 0, n && (Number.isFinite(t2.limits.tableCells) || Number.isFinite(t2.limits.attributes) || Number.isFinite(t2.limits.depth) || Number.isFinite(t2.limits.nodes) || Number.isFinite(t2.limits.text) || Number.isFinite(t2.limits.references) || A));
13691
- let R2 = await h.property(h.rootPosition, "meta"), $ = await h.property(h.rootPosition, "blocks"), V = new TextEncoder();
13761
+ await or(h, d, t2, void 0, n && (Number.isFinite(t2.limits.tableCells) || Number.isFinite(t2.limits.attributes) || Number.isFinite(t2.limits.depth) || Number.isFinite(t2.limits.nodes) || Number.isFinite(t2.limits.text) || Number.isFinite(t2.limits.references) || A));
13762
+ let R2 = await h.property(h.rootPosition, "meta"), $ = await h.property(h.rootPosition, "blocks"), J = new TextEncoder();
13692
13763
  v = { normalizedUsage: E, tree: h, order: P, chunks: async function* (U) {
13693
- yield V.encode('{"pandoc-api-version":[1,23,1,2],"meta":'), yield* h.chunks(R2, P), yield V.encode(',"blocks":'), yield* h.chunks($, P), yield V.encode(U === "crlf" ? `}\r
13764
+ yield J.encode('{"pandoc-api-version":[1,23,1,2],"meta":'), yield* h.chunks(R2, P), yield J.encode(',"blocks":'), yield* h.chunks($, P), yield J.encode(U === "crlf" ? `}\r
13694
13765
  ` : `}
13695
13766
  `);
13696
13767
  }, close: k };
@@ -13716,7 +13787,7 @@ async function Je(s15, t2, e2, i2 = true, n = true, a, r = i2, o2 = false) {
13716
13787
  async function Wd(s15, t2, e2, i2 = false, n) {
13717
13788
  let a = e2.cacheBytes ?? 1048576;
13718
13789
  (!Number.isSafeInteger(a) || a < 16384 || a % 16384) && t2.fail("E_OPTION", "Working storage cacheBytes must be a positive multiple of 16384"), (typeof e2.directory != "string" || !e2.directory.startsWith("/")) && t2.fail("E_OPTION", "Working storage requires an absolute caller filesystem directory");
13719
- let r = { fs: e2.fs, cwd: e2.directory, env: {}, signal: t2.signal ?? new AbortController().signal }, o2 = new Jn(r, a / 16384), l = new Jn(r, a / 16384), f = new Jn(r, a / 16384), c = new Jn(r, a / 16384), d = new Jn(r, a / 16384), u = [o2, l, f, c, d], h, p2 = () => h ??= (async () => {
13790
+ let r = { fs: e2.fs, cwd: e2.directory, env: {}, signal: t2.signal ?? new AbortController().signal }, o2 = new Vn(r, a / 16384), l = new Vn(r, a / 16384), f = new Vn(r, a / 16384), c = new Vn(r, a / 16384), d = new Vn(r, a / 16384), u = [o2, l, f, c, d], h, p2 = () => h ??= (async () => {
13720
13791
  let w;
13721
13792
  for (let y2 of u) try {
13722
13793
  await y2.close();
@@ -13766,7 +13837,7 @@ async function Wd(s15, t2, e2, i2 = false, n) {
13766
13837
  let _ = async (et) => {
13767
13838
  let [ot, bt] = await g(z + et * 16, 2);
13768
13839
  return { start: ot, end: bt };
13769
- }, S = new Wn(f, (et) => t2.cooperate(et)), B = await S.array(), j = async (et) => S.string(await S.text.from(w.chunks(et))), J = async () => S.value(["", [], []]), Z = async (et, ot) => {
13840
+ }, S = new Wn(f, (et) => t2.cooperate(et)), B = await S.array(), j = async (et) => S.string(await S.text.from(w.chunks(et))), V = async () => S.value(["", [], []]), Z = async (et, ot) => {
13770
13841
  let bt = et.start;
13771
13842
  for (; bt < et.end; ) {
13772
13843
  let st = await w.unit(bt) === " ", lt = bt + 1;
@@ -13826,7 +13897,7 @@ async function Wd(s15, t2, e2, i2 = false, n) {
13826
13897
  }
13827
13898
  await Z({ start: yt, end: lt }, bt);
13828
13899
  let Nt = await S.array(), xt;
13829
- ut.kind === "Link" || ut.kind === "Image" ? xt = await S.tag(ut.kind, await S.value([await J(), Nt, [await j(ut.target), ""]])) : ut.kind === "Code" ? xt = await S.tag("Code", await S.value([await J(), await j(ut.content)])) : xt = await S.tag(ut.kind, Nt), await S.push(bt, xt), lt = yt = ut.end, ut.kind === "Image" ? await Z(ut.content, Nt) : ut.kind !== "Code" && (gt = await y2([gt, lt, st, yt, bt.position]), bt = Nt, lt = yt = ut.content.start, st = ut.content.end);
13900
+ ut.kind === "Link" || ut.kind === "Image" ? xt = await S.tag(ut.kind, await S.value([await V(), Nt, [await j(ut.target), ""]])) : ut.kind === "Code" ? xt = await S.tag("Code", await S.value([await V(), await j(ut.content)])) : xt = await S.tag(ut.kind, Nt), await S.push(bt, xt), lt = yt = ut.end, ut.kind === "Image" ? await Z(ut.content, Nt) : ut.kind !== "Code" && (gt = await y2([gt, lt, st, yt, bt.position]), bt = Nt, lt = yt = ut.content.start, st = ut.content.end);
13830
13901
  }
13831
13902
  }, L = async (et) => {
13832
13903
  let ot = 0, bt = 0;
@@ -13890,7 +13961,7 @@ async function Wd(s15, t2, e2, i2 = false, n) {
13890
13961
  if (await w.starts(ot, "{|")) {
13891
13962
  let gt = await S.array(), dt = await S.array(), ut = await S.array(), Nt = false, xt = 1, we = async () => {
13892
13963
  let Xt = await S.count(ut);
13893
- Xt && (xt = Math.max(xt, Xt), await S.push(Nt && !await S.count(dt) ? gt : dt, await S.value([await J(), ut])), ut = await S.array(), Nt = false);
13964
+ Xt && (xt = Math.max(xt, Xt), await S.push(Nt && !await S.count(dt) ? gt : dt, await S.value([await V(), ut])), ut = await S.array(), Nt = false);
13894
13965
  };
13895
13966
  for (Q++; Q < N; ) {
13896
13967
  let Xt = await w.trim(await _(Q++));
@@ -13906,16 +13977,16 @@ async function Wd(s15, t2, e2, i2 = false, n) {
13906
13977
  let Yi = await w.unit(Xt.start);
13907
13978
  if (Yi !== "!" && Yi !== "|") continue;
13908
13979
  Yi === "!" && (Nt = true);
13909
- let Er = Xt.start + 1;
13980
+ let Ar = Xt.start + 1;
13910
13981
  for (; ; ) {
13911
- let $a = await w.find({ start: Er, end: Xt.end }, Yi + Yi), Vu = $a < 0 ? Xt.end : $a, Da = { start: Er, end: Vu }, Pl = await w.find(Da, "|");
13912
- if (Pl >= 0 && await w.find(Da, "[[") < 0 && (Da.start = Pl + 1), await S.push(ut, await S.value([await J(), await S.tag("AlignDefault"), 1, 1, [await S.tag("Plain", await it(await w.trim(Da)))]])), $a < 0) break;
13913
- Er = $a + 2;
13982
+ let $a = await w.find({ start: Ar, end: Xt.end }, Yi + Yi), Ju = $a < 0 ? Xt.end : $a, Da = { start: Ar, end: Ju }, Pl = await w.find(Da, "|");
13983
+ if (Pl >= 0 && await w.find(Da, "[[") < 0 && (Da.start = Pl + 1), await S.push(ut, await S.value([await V(), await S.tag("AlignDefault"), 1, 1, [await S.tag("Plain", await it(await w.trim(Da)))]])), $a < 0) break;
13984
+ Ar = $a + 2;
13914
13985
  }
13915
13986
  }
13916
13987
  let re = await S.array();
13917
13988
  for (let Xt = 0; Xt < xt; Xt++) await S.push(re, await S.value([await S.tag("AlignDefault"), await S.tag("ColWidthDefault")]));
13918
- await S.push(B, await S.tag("Table", await S.value([await J(), [null, []], re, [await J(), gt], [[await J(), 0, [], dt]], [await J(), []]])));
13989
+ await S.push(B, await S.tag("Table", await S.value([await V(), [null, []], re, [await V(), gt], [[await V(), 0, [], dt]], [await V(), []]])));
13919
13990
  continue;
13920
13991
  }
13921
13992
  let st = await w.unit(ot.start);
@@ -13940,7 +14011,7 @@ async function Wd(s15, t2, e2, i2 = false, n) {
13940
14011
  await S.push(B, await S.tag("Para", await it(yt)));
13941
14012
  }
13942
14013
  let nt = new BackedJson(c, (et) => t2.cooperate(et));
13943
- return await nt.begin("object"), await nt.key("pandoc-api-version"), await nt.value([1, 23, 1, 2]), await nt.key("meta"), await nt.value({}), await nt.key("blocks"), await S.write(B, nt), await nt.end(), await Je({ chunks: nt.chunks() }, t2, e2, false);
14014
+ return await nt.begin("object"), await nt.key("pandoc-api-version"), await nt.value([1, 23, 1, 2]), await nt.key("meta"), await nt.value({}), await nt.key("blocks"), await S.write(B, nt), await nt.end(), await Ve({ chunks: nt.chunks() }, t2, e2, false);
13944
14015
  };
13945
14016
  if (!i2 || s15.length === 1) {
13946
14017
  n?.(0);
@@ -13969,10 +14040,10 @@ async function Wd(s15, t2, e2, i2 = false, n) {
13969
14040
  M = N;
13970
14041
  }
13971
14042
  n?.(-1), await C(T.encode("]}"));
13972
- let P = await Je({ chunks: (async function* () {
14043
+ let P = await Ve({ chunks: (async function* () {
13973
14044
  for (let M = 0; M < A; M += 16384) yield await d.read(E + M, Math.min(16384, A - M));
13974
- })() }, t2, e2, false, false), R2 = new Jn(r, a / 16384), $ = t2.onClose(() => R2.close()), V = new jn(R2, (M) => t2.cooperate(M));
13975
- V.clear();
14045
+ })() }, t2, e2, false, false), R2 = new Vn(r, a / 16384), $ = t2.onClose(() => R2.close()), J = new jn(R2, (M) => t2.cooperate(M));
14046
+ J.clear();
13976
14047
  let Y = await P.tree.property(P.tree.rootPosition, "blocks"), U = b, H = 1, q = (await g(b + 24, 1))[0];
13977
14048
  for await (let M of P.tree.children(Y)) {
13978
14049
  for (; !q; ) U = (await g(U + 16, 1))[0], H++, q = (await g(U + 24, 1))[0];
@@ -13985,13 +14056,13 @@ async function Wd(s15, t2, e2, i2 = false, n) {
13985
14056
  if (W !== void 0 && await P.tree.smallText(W, 5) === "Image") {
13986
14057
  let X = await P.tree.property(z, "c") + 32;
13987
14058
  for (let _ = 0; _ < 2; _++) X = (await P.tree.describe(X)).end;
13988
- await V.seed(X + 32, H);
14059
+ await J.seed(X + 32, H);
13989
14060
  }
13990
14061
  }
13991
14062
  z = N.kind === "array" || N.kind === "object" ? z + 32 : N.end, await t2.cooperate();
13992
14063
  }
13993
14064
  }
13994
- return await p2(), { ...P, referencesAggregated: true, origins: V, originFor: (M) => s15[M - 1], async closeResources() {
14065
+ return await p2(), { ...P, referencesAggregated: true, origins: J, originFor: (M) => s15[M - 1], async closeResources() {
13995
14066
  try {
13996
14067
  await R2.close();
13997
14068
  } finally {
@@ -14006,10 +14077,10 @@ async function Wd(s15, t2, e2, i2 = false, n) {
14006
14077
  throw w;
14007
14078
  }
14008
14079
  }
14009
- var Jd = ["group", "word", "symbol", "hex", "text", "binary"];
14010
- var Vd = (s15) => s15 >= 65 && s15 <= 90 || s15 >= 97 && s15 <= 122;
14080
+ var Vd = ["group", "word", "symbol", "hex", "text", "binary"];
14081
+ var Jd = (s15) => s15 >= 65 && s15 <= 90 || s15 >= 97 && s15 <= 122;
14011
14082
  var Hd = (s15) => s15 >= 48 && s15 <= 57;
14012
- var or = class s9 {
14083
+ var lr = class s9 {
14013
14084
  constructor(t2, e2) {
14014
14085
  this.context = t2;
14015
14086
  let i2 = { fs: e2.fs, cwd: e2.directory, env: {}, signal: t2.signal ?? new AbortController().signal }, n = (e2.cacheBytes ?? 1048576) / 16384;
@@ -14073,7 +14144,7 @@ var or = class s9 {
14073
14144
  }
14074
14145
  async token(t2) {
14075
14146
  await this.context.cooperate();
14076
- let e2 = await this.fields(t2), i2 = Jd[e2[0]], n = e2[1];
14147
+ let e2 = await this.fields(t2), i2 = Vd[e2[0]], n = e2[1];
14077
14148
  if (i2 === "binary") return { kind: i2, offset: n, length: e2[3] };
14078
14149
  if (i2 === "group" || i2 === "text") return { kind: i2, offset: n };
14079
14150
  if (i2 === "hex") return { kind: i2, offset: n, byte: e2[4] };
@@ -14101,7 +14172,7 @@ var or = class s9 {
14101
14172
  let i2 = e2, n = 0, a = 0, r = 0, o2 = -1, l = new Uint8Array(0), f = async (p2) => p2 >= this.length ? -1 : ((p2 < o2 || p2 >= o2 + l.length) && (o2 = Math.floor(p2 / 16384) * 16384, l = await this.source.read(this.start + o2, Math.min(16384, this.length - o2))), l[p2 - o2]), c = async (p2, m2, w = 0, y2 = 0, g = NaN) => {
14102
14173
  t2.charge("references", 1), t2.charge("retainedBytes", 64);
14103
14174
  let b = this.tape.allocate(72), x = await this.fields(i2);
14104
- return await this.put(b, [Jd.indexOf(p2), m2, w, y2, g, i2, 0, 0, 0]), x[7] ? await this.put(x[7] + 64, [b]) : await this.put(i2 + 48, [b]), await this.put(i2 + 56, [b]), i2 === e2 && a++, b;
14175
+ return await this.put(b, [Vd.indexOf(p2), m2, w, y2, g, i2, 0, 0, 0]), x[7] ? await this.put(x[7] + 64, [b]) : await this.put(i2 + 48, [b]), await this.put(i2 + 56, [b]), i2 === e2 && a++, b;
14105
14176
  };
14106
14177
  for (; r < this.length; ) {
14107
14178
  await t2.cooperate();
@@ -14127,12 +14198,12 @@ var or = class s9 {
14127
14198
  (v < 0 || k < 0) && D3(t2, "Malformed RTF hex escape", "E_PARSE", p2), await c("hex", p2, 0, 0, v * 16 + k);
14128
14199
  continue;
14129
14200
  }
14130
- if (!Vd(y2)) {
14201
+ if (!Jd(y2)) {
14131
14202
  await c("symbol", p2, w, 1);
14132
14203
  continue;
14133
14204
  }
14134
14205
  let g = String.fromCharCode(y2);
14135
- for (; Vd(await f(r)); ) t2.checkpoint(), g.length >= 32 && D3(t2, "RTF control word exceeds 32 letters", "E_PARSE", p2), g += String.fromCharCode(await f(r++));
14206
+ for (; Jd(await f(r)); ) t2.checkpoint(), g.length >= 32 && D3(t2, "RTF control word exceeds 32 letters", "E_PARSE", p2), g += String.fromCharCode(await f(r++));
14136
14207
  let b, x = await f(r) === 45;
14137
14208
  if (x && r++, Hd(await f(r))) {
14138
14209
  let v = 0;
@@ -14150,12 +14221,12 @@ var or = class s9 {
14150
14221
  };
14151
14222
  var wm = /* @__PURE__ */ new Set(["f", "fnil", "froman", "fswiss", "fmodern", "fscript", "fdecor", "ftech", "fbidi", "fcharset", "cpg", "fprq", "fttruetype"]);
14152
14223
  var Yd = /* @__PURE__ */ new Set(["snext", "sautoupd", "additive", "sqformat", "spriority", "sunhideused", "slink"]);
14153
- var cr = class s10 {
14224
+ var fr = class s10 {
14154
14225
  constructor(t2, e2, i2) {
14155
14226
  this.syntax = t2;
14156
14227
  this.storage = e2;
14157
14228
  this.context = i2;
14158
- this.text = new Tt(e2, (n) => i2.cooperate(n)), this.fonts = new lr(e2, 64), this.colors = new lr(e2, 64), this.styles = new lr(e2, 64);
14229
+ this.text = new Tt(e2, (n) => i2.cooperate(n)), this.fonts = new cr(e2, 64), this.colors = new cr(e2, 64), this.styles = new cr(e2, 64);
14159
14230
  }
14160
14231
  syntax;
14161
14232
  storage;
@@ -14289,7 +14360,7 @@ var cr = class s10 {
14289
14360
  }
14290
14361
  }
14291
14362
  async *controls(t2) {
14292
- let e2 = new lr(this.storage, 64), i2 = 0, n = 0;
14363
+ let e2 = new cr(this.storage, 64), i2 = 0, n = 0;
14293
14364
  for (; ; ) {
14294
14365
  await this.context.cooperate(), this.context.bound("depth", ++n), await e2.get(BigInt(t2)) !== void 0 && D3(this.context, "Cyclic RTF stylesheet");
14295
14366
  let a = Number(await this.styles.get(BigInt(t2)) ?? 0n);
@@ -14313,8 +14384,8 @@ var cr = class s10 {
14313
14384
  }
14314
14385
  };
14315
14386
  var Ia = ["Decimal", "UpperRoman", "LowerRoman", "UpperAlpha", "LowerAlpha", "bullet"];
14316
- var fr = ["Period", "OneParen", "TwoParens"];
14317
- var dr = class s11 {
14387
+ var dr = ["Period", "OneParen", "TwoParens"];
14388
+ var ur = class s11 {
14318
14389
  constructor(t2, e2, i2) {
14319
14390
  this.syntax = t2;
14320
14391
  this.storage = e2;
@@ -14348,7 +14419,7 @@ var dr = class s11 {
14348
14419
  return t2.forEach((n, a) => i2.setFloat64(a * 8, n, true)), this.storage.append(e2);
14349
14420
  }
14350
14421
  encoded(t2) {
14351
- return [t2.start ?? NaN, t2.style === void 0 ? NaN : Ia.indexOf(t2.style), t2.delimiter === void 0 ? NaN : fr.indexOf(t2.delimiter)];
14422
+ return [t2.start ?? NaN, t2.style === void 0 ? NaN : Ia.indexOf(t2.style), t2.delimiter === void 0 ? NaN : dr.indexOf(t2.delimiter)];
14352
14423
  }
14353
14424
  async destination(t2) {
14354
14425
  let e2 = await this.syntax.first(t2);
@@ -14376,10 +14447,10 @@ var dr = class s11 {
14376
14447
  let f = await this.fields(i2 + 16 + e2 * 24, 3);
14377
14448
  for (let c = 0; c < 3; c++) Number.isNaN(f[c]) || (l[c] = f[c]);
14378
14449
  }
14379
- return { start: l[0], style: Ia[l[1]], delimiter: fr[l[2]] };
14450
+ return { start: l[0], style: Ia[l[1]], delimiter: dr[l[2]] };
14380
14451
  }
14381
14452
  async legacy(t2) {
14382
- let e2 = BigInt((t2.start * Ia.length + Ia.indexOf(t2.style)) * fr.length + fr.indexOf(t2.delimiter)), i2 = await this.legacyIds.get(e2);
14453
+ let e2 = BigInt((t2.start * Ia.length + Ia.indexOf(t2.style)) * dr.length + dr.indexOf(t2.delimiter)), i2 = await this.legacyIds.get(e2);
14383
14454
  if (i2 !== void 0) return -Number(i2);
14384
14455
  let n = -++this.legacyCount;
14385
14456
  return await this.legacyIds.set(e2, BigInt(-n)), await this.lists.set(this.key(n), BigInt(await this.record([1, ...this.encoded(t2)]))), await this.overrides.set(this.key(n), BigInt(await this.record([n, 0]))), n;
@@ -14678,7 +14749,7 @@ var rl = class {
14678
14749
  this.syntax = t2;
14679
14750
  this.storage = e2;
14680
14751
  this.context = i2;
14681
- this.ast = new Wn(e2, (n) => i2.cooperate(n)), this.definitions = new cr(t2, e2, i2), this.lists = new dr(t2, e2, i2), this.pictures = new gm(e2, 64);
14752
+ this.ast = new Wn(e2, (n) => i2.cooperate(n)), this.definitions = new fr(t2, e2, i2), this.lists = new ur(t2, e2, i2), this.pictures = new gm(e2, 64);
14682
14753
  }
14683
14754
  syntax;
14684
14755
  storage;
@@ -14943,7 +15014,7 @@ async function zd(s15, t2, e2) {
14943
15014
  return await i2.read(), i2;
14944
15015
  }
14945
15016
  async function Kd(s15, t2, e2, i2) {
14946
- let n = await or.acquire(s15, t2, e2, i2), a = { fs: e2.fs, cwd: e2.directory, env: {}, signal: t2.signal ?? new AbortController().signal }, r = (e2.cacheBytes ?? 1048576) / 16384, o2 = new Xd(a, r), l = new Xd(a, r), f, c, d = () => c ??= (async () => {
15017
+ let n = await lr.acquire(s15, t2, e2, i2), a = { fs: e2.fs, cwd: e2.directory, env: {}, signal: t2.signal ?? new AbortController().signal }, r = (e2.cacheBytes ?? 1048576) / 16384, o2 = new Xd(a, r), l = new Xd(a, r), f, c, d = () => c ??= (async () => {
14947
15018
  let h;
14948
15019
  for (let p2 of [f, n, l, o2]) try {
14949
15020
  await p2?.close();
@@ -14954,7 +15025,7 @@ async function Kd(s15, t2, e2, i2) {
14954
15025
  })(), u = t2.onClose(d);
14955
15026
  try {
14956
15027
  let h = await zd(n, o2, t2), p2 = new BackedJson(l, (m2) => t2.cooperate(m2));
14957
- return await p2.begin("object"), await p2.key("pandoc-api-version"), await p2.value([1, 23, 1, 2]), await p2.key("meta"), await p2.value({}), await p2.key("blocks"), await h.ast.write(h.blocks, p2), await p2.end(), f = await Je({ chunks: p2.chunks() }, t2, e2, false), await h.reserveResources(f.normalizedUsage), await n.close(), await l.close(), { document: f, resources: { count: h.resourceCount, maxIdLength: `rtf-picture-${h.resourceCount}.png`.length, get: h.resource.bind(h), reserve: h.reserveResources.bind(h) }, close: d };
15028
+ return await p2.begin("object"), await p2.key("pandoc-api-version"), await p2.value([1, 23, 1, 2]), await p2.key("meta"), await p2.value({}), await p2.key("blocks"), await h.ast.write(h.blocks, p2), await p2.end(), f = await Ve({ chunks: p2.chunks() }, t2, e2, false), await h.reserveResources(f.normalizedUsage), await n.close(), await l.close(), { document: f, resources: { count: h.resourceCount, maxIdLength: `rtf-picture-${h.resourceCount}.png`.length, get: h.resource.bind(h), reserve: h.reserveResources.bind(h) }, close: d };
14958
15029
  } catch (h) {
14959
15030
  try {
14960
15031
  await d();
@@ -15006,10 +15077,10 @@ var on = class s13 {
15006
15077
  let d = 0, u = 0, h = 0, p2 = 0, m2 = async (A, I, F = "Invalid shape", C = "E_AST") => {
15007
15078
  let P = I === void 0 ? "" : typeof I == "number" ? `[${I}]` : `.${I}`;
15008
15079
  for (let R2 = A; R2; ) {
15009
- let [$, V] = await l(R2, 2);
15080
+ let [$, J] = await l(R2, 2);
15010
15081
  if (!$) break;
15011
15082
  let Y = await l($, 8);
15012
- P = (Y[6] ? `[${V}]` : `.${await f(Y[2], V)}`) + P, R2 = $;
15083
+ P = (Y[6] ? `[${J}]` : `.${await f(Y[2], J)}`) + P, R2 = $;
15013
15084
  }
15014
15085
  throw P = "$.metadata" + P, new t(C, "convert", `${P}: ${F}`, void 0, P);
15015
15086
  }, w = async (A, I) => {
@@ -15031,25 +15102,25 @@ var on = class s13 {
15031
15102
  return !C || !("value" in C) || !Array.isArray(A) && !C.enumerable ? m2(F, I, Array.isArray(A) ? "Accessor or sparse array" : "Invalid shape") : C.value;
15032
15103
  }, x = async (A, I, F, C) => {
15033
15104
  c || n.bound("depth", C);
15034
- let P = Array.isArray(A), R2 = e2.allocate(64), $ = 0, V = P ? A.length : 0;
15105
+ let P = Array.isArray(A), R2 = e2.allocate(64), $ = 0, J = P ? A.length : 0;
15035
15106
  if (!P) {
15036
15107
  let U = c ? Object.getOwnPropertyNames(A) : Object.keys(A);
15037
- V = U.length, $ = e2.allocate(V * 24);
15038
- for (let H = 0; H < V; H++) {
15108
+ J = U.length, $ = e2.allocate(J * 24);
15109
+ for (let H = 0; H < J; H++) {
15039
15110
  let q = await r.from([U[H]]);
15040
15111
  await o2($ + H * 24, [q.first, q.last, q.units]);
15041
15112
  }
15042
15113
  }
15043
- if (await o2(R2, [I, F, $, V, 0, C, P ? 1 : 0, 0]), c && C > n.limits.depth && await m2(R2, void 0, "AST budget exceeded", "E_LIMIT"), c && !I && await w(R2), c && P && h + V > n.limits.nodes && await m2(R2, void 0, "AST budget exceeded", "E_LIMIT"), c && P && Object.getOwnPropertySymbols(A).length && await m2(R2), c && P && (Number.isFinite(n.limits.references) || Number.isFinite(n.limits.tableCells) || Number.isFinite(n.limits.attributes) || Number.isFinite(n.limits.depth) || Number.isFinite(n.limits.nodes) || Number.isFinite(n.limits.text))) {
15044
- for (let U = 0; U < V; U++) await b(A, U, R2), await n.cooperate();
15045
- if (V === 3 && Number.isFinite(n.limits.attributes)) {
15114
+ if (await o2(R2, [I, F, $, J, 0, C, P ? 1 : 0, 0]), c && C > n.limits.depth && await m2(R2, void 0, "AST budget exceeded", "E_LIMIT"), c && !I && await w(R2), c && P && h + J > n.limits.nodes && await m2(R2, void 0, "AST budget exceeded", "E_LIMIT"), c && P && Object.getOwnPropertySymbols(A).length && await m2(R2), c && P && (Number.isFinite(n.limits.references) || Number.isFinite(n.limits.tableCells) || Number.isFinite(n.limits.attributes) || Number.isFinite(n.limits.depth) || Number.isFinite(n.limits.nodes) || Number.isFinite(n.limits.text))) {
15115
+ for (let U = 0; U < J; U++) await b(A, U, R2), await n.cooperate();
15116
+ if (J === 3 && Number.isFinite(n.limits.attributes)) {
15046
15117
  let U = await b(A, 0, R2), H = await b(A, 1, R2), q = await b(A, 2, R2);
15047
15118
  if (typeof U == "string" && Array.isArray(H) && Array.isArray(q)) {
15048
15119
  let M = 1 + H.length + q.length;
15049
15120
  u += M, (!Number.isSafeInteger(u) || u > n.limits.attributes) && await m2(R2, void 0, "AST budget exceeded", "E_LIMIT"), n.charge("attributes", M);
15050
15121
  }
15051
15122
  }
15052
- if (V === 5 && Array.isArray(await b(A, 0, R2)) && typeof await b(A, 1, R2) == "string") {
15123
+ if (J === 5 && Array.isArray(await b(A, 0, R2)) && typeof await b(A, 1, R2) == "string") {
15053
15124
  let U = await b(A, 2, R2), H = await b(A, 3, R2);
15054
15125
  (typeof U != "number" || typeof H != "number" || !Number.isSafeInteger(U) || !Number.isSafeInteger(H) || U < 1 || H < 1) && await m2(R2, void 0, "Invalid spans");
15055
15126
  let q = U * H;
@@ -15065,7 +15136,7 @@ var on = class s13 {
15065
15136
  for (let R2 = A; R2; ) await n.cooperate(), await o2(R2 + 56, [P]), P = R2, R2 = (await l(R2, 1))[0];
15066
15137
  for (; P !== A; ) {
15067
15138
  await n.cooperate();
15068
- let R2 = await l(P, 8), $ = R2[7], V = (await l($, 2))[1], Y = R2[6] ? V : await f(R2[2], V);
15139
+ let R2 = await l(P, 8), $ = R2[7], J = (await l($, 2))[1], Y = R2[6] ? J : await f(R2[2], J);
15069
15140
  C = await b(C, Y, P), C === I && (c && await m2(A, F, "Non-JSON or cyclic input"), n.fail("E_OPTION", "Invalid JSON metadata value")), P = $;
15070
15141
  }
15071
15142
  return C;
@@ -15087,10 +15158,10 @@ var on = class s13 {
15087
15158
  continue;
15088
15159
  }
15089
15160
  await o2(T + 32, [P + 1]);
15090
- let V = $ ? P : await f(F, P);
15091
- c && R2 + 1 > n.limits.depth && await m2(T, typeof V == "string" ? void 0 : V, "AST budget exceeded", "E_LIMIT"), c && typeof V == "string" && (await w(T), await y2(V, T), await g(V, T));
15092
- let Y = await b(E, V, T);
15093
- if ($ || (c || n.charge("references", 1), (V === "__proto__" || V === "constructor" || V === "prototype") && (c && await m2(T, V), n.fail("E_OPTION", "Unsafe metadata key")), await a.key(V)), c && (await w(T, V), typeof Y == "string" && (await y2(Y, T, V), await g(Y, T, V))), i2 === true && T === k) {
15161
+ let J = $ ? P : await f(F, P);
15162
+ c && R2 + 1 > n.limits.depth && await m2(T, typeof J == "string" ? void 0 : J, "AST budget exceeded", "E_LIMIT"), c && typeof J == "string" && (await w(T), await y2(J, T), await g(J, T));
15163
+ let Y = await b(E, J, T);
15164
+ if ($ || (c || n.charge("references", 1), (J === "__proto__" || J === "constructor" || J === "prototype") && (c && await m2(T, J), n.fail("E_OPTION", "Unsafe metadata key")), await a.key(J)), c && (await w(T, J), typeof Y == "string" && (await y2(Y, T, J), await g(Y, T, J))), i2 === true && T === k) {
15094
15165
  (Y === null || typeof Y != "object" || Array.isArray(Y)) && n.fail("E_OPTION", "JSON metadata must be an object"), await v(T, Y), T = await x(Y, T, P, 0), E = Y;
15095
15166
  continue;
15096
15167
  }
@@ -15098,7 +15169,7 @@ var on = class s13 {
15098
15169
  $ && !c && n.fail("E_OPTION", "Null metadata list elements are unsupported"), await a.value(null);
15099
15170
  continue;
15100
15171
  }
15101
- c || (n.bound("depth", R2 + 1), n.charge("nodes", 1)), await n.cooperate(), typeof Y == "string" || typeof Y == "boolean" || typeof Y == "number" && Number.isFinite(Y) ? await a.value(Y) : Y && typeof Y == "object" ? (await v(T, Y, V), T = await x(Y, T, P, R2 + (c || Array.isArray(Y) ? 1 : 2)), E = Y) : (c && await m2(T, V, typeof Y == "number" ? "Invalid shape" : "Non-JSON or cyclic input"), n.fail("E_OPTION", "Invalid JSON metadata value"));
15172
+ c || (n.bound("depth", R2 + 1), n.charge("nodes", 1)), await n.cooperate(), typeof Y == "string" || typeof Y == "boolean" || typeof Y == "number" && Number.isFinite(Y) ? await a.value(Y) : Y && typeof Y == "object" ? (await v(T, Y, J), T = await x(Y, T, P, R2 + (c || Array.isArray(Y) ? 1 : 2)), E = Y) : (c && await m2(T, J, typeof Y == "number" ? "Invalid shape" : "Non-JSON or cyclic input"), n.fail("E_OPTION", "Invalid JSON metadata value"));
15102
15173
  }
15103
15174
  if (c) for (let [A, I] of ["$", "$.resources"].entries()) {
15104
15175
  if (++h > n.limits.nodes) throw new t("E_LIMIT", "convert", `${I}: AST budget exceeded`, void 0, I);
@@ -15133,7 +15204,7 @@ async function Qd(s15, t2, e2, i2) {
15133
15204
  let n = await on.acquire(s15, t2, e2, i2, "ast"), a = new km({ fs: e2.fs, cwd: e2.directory, env: {}, signal: t2.signal ?? new AbortController().signal }, (e2.cacheBytes ?? 1048576) / 16384), r = t2.onClose(() => l()), o2, l = () => o2 ??= a.close().finally(r), f = n.tree, c = new BackedJson(a, (u) => t2.cooperate(u)), d;
15134
15205
  try {
15135
15206
  let u = new xm(i2, 64);
15136
- await rr(f, i2, t2, async (m2) => {
15207
+ await or(f, i2, t2, async (m2) => {
15137
15208
  await u.set(BigInt(m2), 1n);
15138
15209
  }, false, n.invalidPrototypes);
15139
15210
  let h = f.rootPosition, p2 = false;
@@ -15171,7 +15242,7 @@ async function Qd(s15, t2, e2, i2) {
15171
15242
  }
15172
15243
  return { tree: c, close: l };
15173
15244
  }
15174
- var ur = class {
15245
+ var hr2 = class {
15175
15246
  constructor(t2, e2) {
15176
15247
  this.storage = t2;
15177
15248
  this.context = e2;
@@ -15305,15 +15376,15 @@ var ur = class {
15305
15376
  await n.cooperate();
15306
15377
  let $ = await this.find(k, r);
15307
15378
  if ($ < 0) break;
15308
- let V = await this.find($ + 1, r);
15309
- if (V < 0) break;
15310
- (await this.prefix($ + 1, V, "if(") || await this.prefix($ + 1, V, "for(")) && v++;
15311
- let Y = await this.equal($ + 1, V, "endif"), U = await this.equal($ + 1, V, "endfor");
15379
+ let J = await this.find($ + 1, r);
15380
+ if (J < 0) break;
15381
+ (await this.prefix($ + 1, J, "if(") || await this.prefix($ + 1, J, "for(")) && v++;
15382
+ let Y = await this.equal($ + 1, J, "endif"), U = await this.equal($ + 1, J, "endfor");
15312
15383
  if ((Y || U) && --v === 0) {
15313
- (p2 ? !U : !Y) && n.fail("E_PARSE", "Mismatched template block"), E = $, A = V + 1;
15384
+ (p2 ? !U : !Y) && n.fail("E_PARSE", "Mismatched template block"), E = $, A = J + 1;
15314
15385
  break;
15315
15386
  }
15316
- v === 1 && await this.equal($ + 1, V, "else") && (T = $), k = V + 1;
15387
+ v === 1 && await this.equal($ + 1, J, "else") && (T = $), k = J + 1;
15317
15388
  }
15318
15389
  E < 0 && n.fail("E_PARSE", "Unclosed template block"), p2 && T >= 0 && n.fail("E_UNSUPPORTED_FEATURE", "Template loop separators are unsupported");
15319
15390
  let I = g ? await i2.truthy(g) : !!(w?.units || y2), F = g, C = 0;
@@ -15324,8 +15395,8 @@ var ur = class {
15324
15395
  let P = p2 ? F || w ? a : -1 : I ? a : T < 0 ? -1 : T + 6, R2 = !p2 && I && T >= 0 ? T : E;
15325
15396
  if (P >= 0) {
15326
15397
  n.bound("depth", o2 + 1);
15327
- let $ = new Uint8Array(88), V = new DataView($.buffer);
15328
- [l, A, r, o2, P, R2, b, x, p2 ? F : 0, C, f].forEach((Y, U) => V.setFloat64(U * 8, Y, true)), l = await this.storage.append($), f = 0, o2++, a = P, r = R2;
15398
+ let $ = new Uint8Array(88), J = new DataView($.buffer);
15399
+ [l, A, r, o2, P, R2, b, x, p2 ? F : 0, C, f].forEach((Y, U) => J.setFloat64(U * 8, Y, true)), l = await this.storage.append($), f = 0, o2++, a = P, r = R2;
15329
15400
  } else a = A;
15330
15401
  } else {
15331
15402
  let v = false;
@@ -15378,7 +15449,7 @@ var Ra = class s14 {
15378
15449
  let a = new vm({ fs: e2.fs, cwd: e2.directory, env: {}, signal: t2.signal ?? new AbortController().signal }, n), r = new s14(a, t2);
15379
15450
  r.standalone = !i2.template && (i2.standalone === true || i2.embedResources === true || !!(i2.includeInHeader?.length || i2.includeBeforeBody?.length || i2.includeAfterBody?.length));
15380
15451
  try {
15381
- i2.variables !== void 0 && (r.variables = await on.acquire(i2.variables, t2, e2, a)), i2.template && (r.template = new ur(a, t2), await r.template.acquire(i2.template));
15452
+ i2.variables !== void 0 && (r.variables = await on.acquire(i2.variables, t2, e2, a)), i2.template && (r.template = new hr2(a, t2), await r.template.acquire(i2.template));
15382
15453
  for (let [o2, l] of [[i2.includeInHeader, r.header], [i2.includeBeforeBody, r.before], [i2.includeAfterBody, r.after]]) for (let f of o2 ?? []) {
15383
15454
  t2.charge("includes", 1);
15384
15455
  let c = Number.isFinite(t2.limits.retainedBytes), d = Number.isFinite(t2.limits.references) || c, u = l.units, h = "bytes" in f ? [f.bytes] : f.chunks;
@@ -15474,7 +15545,7 @@ var Ra = class s14 {
15474
15545
  function Ct(s15, t2 = "Invalid shape") {
15475
15546
  throw new e("E_AST", s15, t2);
15476
15547
  }
15477
- var Jt = (s15, t2) => {
15548
+ var Vt = (s15, t2) => {
15478
15549
  typeof s15 != "string" && Ct(t2);
15479
15550
  };
15480
15551
  var Ca = (s15, t2) => {
@@ -15495,9 +15566,9 @@ var Ot = (...s15) => (t2, e2) => {
15495
15566
  function Ba(s15, t2) {
15496
15567
  return (s15 === null || typeof s15 != "object" || Array.isArray(s15) || Object.getPrototypeOf(s15) !== Object.prototype && Object.getPrototypeOf(s15) !== null) && Ct(t2), s15;
15497
15568
  }
15498
- var xe = Ot(Jt, zt(Jt), zt(Ot(Jt, Jt)));
15569
+ var xe = Ot(Vt, zt(Vt), zt(Ot(Vt, Vt)));
15499
15570
  var tu2 = ln("AlignLeft", "AlignRight", "AlignCenter", "AlignDefault");
15500
- function hr2(s15) {
15571
+ function pr(s15) {
15501
15572
  return (t2, e2) => {
15502
15573
  let i2 = Ba(t2, e2);
15503
15574
  (typeof i2.t != "string" || !Object.hasOwn(s15, i2.t)) && Ct(`${e2}.t`, "Unknown tag");
@@ -15506,35 +15577,35 @@ function hr2(s15) {
15506
15577
  };
15507
15578
  }
15508
15579
  var qt = (s15, t2) => zt(Am)(s15, t2);
15509
- var Ve = (s15, t2) => zt(Pm)(s15, t2);
15580
+ var Je = (s15, t2) => zt(Pm)(s15, t2);
15510
15581
  var eu = Ot((s15, t2) => {
15511
15582
  s15 !== null && qt(s15, t2);
15512
- }, Ve);
15513
- var Tm = Ot(xe, tu2, ol, ol, Ve);
15583
+ }, Je);
15584
+ var Tm = Ot(xe, tu2, ol, ol, Je);
15514
15585
  var ll = Ot(xe, zt(Tm));
15515
15586
  var Zd = Ot(xe, zt(ll));
15516
15587
  var Sm = (s15, t2) => {
15517
15588
  (typeof s15 != "number" || !Number.isFinite(s15) || s15 <= 0 || s15 > 1) && Ct(t2);
15518
15589
  };
15519
15590
  var Em = (s15, t2) => {
15520
- let e2 = Ba(s15, t2), i2 = { citationId: Jt, citationPrefix: qt, citationSuffix: qt, citationMode: ln("AuthorInText", "SuppressAuthor", "NormalCitation"), citationNoteNum: Ca, citationHash: Ca };
15591
+ let e2 = Ba(s15, t2), i2 = { citationId: Vt, citationPrefix: qt, citationSuffix: qt, citationMode: ln("AuthorInText", "SuppressAuthor", "NormalCitation"), citationNoteNum: Ca, citationHash: Ca };
15521
15592
  Object.keys(e2).length !== 6 && Ct(t2);
15522
15593
  for (let [n, a] of Object.entries(i2)) a(e2[n], `${t2}.${n}`);
15523
15594
  };
15524
- var Am = hr2({ Str: Jt, Space: null, SoftBreak: null, LineBreak: null, Emph: qt, Underline: qt, Strong: qt, Strikeout: qt, Superscript: qt, Subscript: qt, SmallCaps: qt, Quoted: Ot(ln("SingleQuote", "DoubleQuote"), qt), Cite: Ot(zt(Em), qt), Code: Ot(xe, Jt), Math: Ot(ln("InlineMath", "DisplayMath"), Jt), RawInline: Ot(Jt, Jt), Link: Ot(xe, qt, Ot(Jt, Jt)), Image: Ot(xe, qt, Ot(Jt, Jt)), Note: Ve, Span: Ot(xe, qt) });
15525
- var Im = Ot(xe, eu, zt(Ot(tu2, hr2({ ColWidthDefault: null, ColWidth: Sm }))), Zd, zt(Ot(xe, Ca, zt(ll), zt(ll))), Zd);
15526
- var Pm = hr2({ Plain: qt, Para: qt, LineBlock: zt(qt), CodeBlock: Ot(xe, Jt), RawBlock: Ot(Jt, Jt), BlockQuote: Ve, OrderedList: Ot(Ot(Ca, ln("DefaultStyle", "Example", "Decimal", "LowerRoman", "UpperRoman", "LowerAlpha", "UpperAlpha"), ln("DefaultDelim", "Period", "OneParen", "TwoParens")), zt(Ve)), BulletList: zt(Ve), DefinitionList: zt(Ot(qt, zt(Ve))), Header: Ot(ol, xe, qt), HorizontalRule: null, Div: Ot(xe, Ve), Figure: Ot(xe, eu, Ve), Table: Im });
15595
+ var Am = pr({ Str: Vt, Space: null, SoftBreak: null, LineBreak: null, Emph: qt, Underline: qt, Strong: qt, Strikeout: qt, Superscript: qt, Subscript: qt, SmallCaps: qt, Quoted: Ot(ln("SingleQuote", "DoubleQuote"), qt), Cite: Ot(zt(Em), qt), Code: Ot(xe, Vt), Math: Ot(ln("InlineMath", "DisplayMath"), Vt), RawInline: Ot(Vt, Vt), Link: Ot(xe, qt, Ot(Vt, Vt)), Image: Ot(xe, qt, Ot(Vt, Vt)), Note: Je, Span: Ot(xe, qt) });
15596
+ var Im = Ot(xe, eu, zt(Ot(tu2, pr({ ColWidthDefault: null, ColWidth: Sm }))), Zd, zt(Ot(xe, Ca, zt(ll), zt(ll))), Zd);
15597
+ var Pm = pr({ Plain: qt, Para: qt, LineBlock: zt(qt), CodeBlock: Ot(xe, Vt), RawBlock: Ot(Vt, Vt), BlockQuote: Je, OrderedList: Ot(Ot(Ca, ln("DefaultStyle", "Example", "Decimal", "LowerRoman", "UpperRoman", "LowerAlpha", "UpperAlpha"), ln("DefaultDelim", "Period", "OneParen", "TwoParens")), zt(Je)), BulletList: zt(Je), DefinitionList: zt(Ot(qt, zt(Je))), Header: Ot(ol, xe, qt), HorizontalRule: null, Div: Ot(xe, Je), Figure: Ot(xe, eu, Je), Table: Im });
15527
15598
  var iu = (s15, t2) => {
15528
15599
  for (let [e2, i2] of Object.entries(Ba(s15, t2))) nu(i2, `${t2}.${e2}`);
15529
15600
  };
15530
- var nu = hr2({ MetaMap: iu, MetaList: (s15, t2) => zt(nu)(s15, t2), MetaBool: (s15, t2) => {
15601
+ var nu = pr({ MetaMap: iu, MetaList: (s15, t2) => zt(nu)(s15, t2), MetaBool: (s15, t2) => {
15531
15602
  typeof s15 != "boolean" && Ct(t2);
15532
- }, MetaString: Jt, MetaInlines: qt, MetaBlocks: Ve });
15603
+ }, MetaString: Vt, MetaInlines: qt, MetaBlocks: Je });
15533
15604
  function Rm(s15) {
15534
15605
  let t2 = Ba(s15, "$");
15535
- Object.keys(t2).some((e2) => !["blocks", "metadata", "resources", "language", "direction"].includes(e2)) && Ct("$"), Ve(t2.blocks, "$.blocks"), iu(t2.metadata, "$.metadata"), Object.hasOwn(t2, "language") && Jt(t2.language, "$.language"), Object.hasOwn(t2, "direction") && ln("ltr", "rtl", "auto")(t2.direction, "$.direction"), zt((e2, i2) => {
15606
+ Object.keys(t2).some((e2) => !["blocks", "metadata", "resources", "language", "direction"].includes(e2)) && Ct("$"), Je(t2.blocks, "$.blocks"), iu(t2.metadata, "$.metadata"), Object.hasOwn(t2, "language") && Vt(t2.language, "$.language"), Object.hasOwn(t2, "direction") && ln("ltr", "rtl", "auto")(t2.direction, "$.direction"), zt((e2, i2) => {
15536
15607
  let n = Ba(e2, i2);
15537
- (Object.keys(n).length !== 2 || !(n.bytes instanceof Uint8Array)) && Ct(i2), Jt(n.id, `${i2}.id`);
15608
+ (Object.keys(n).length !== 2 || !(n.bytes instanceof Uint8Array)) && Ct(i2), Vt(n.id, `${i2}.id`);
15538
15609
  })(t2.resources, "$.resources");
15539
15610
  }
15540
15611
  function* au(s15, t2, e2, i2) {
@@ -15955,7 +16026,7 @@ var cn = class {
15955
16026
  function OE(s15, t2 = {}) {
15956
16027
  return new cn(s15, t2);
15957
16028
  }
15958
- function pr(s15, t2 = false) {
16029
+ function mr(s15, t2 = false) {
15959
16030
  let e2 = s15.length, i2 = 0, n = "", a = 0, r = 16, o2 = 0, l = 0, f = 0, c = 0, d = 0;
15960
16031
  function u(b, x) {
15961
16032
  let v = 0, k = 0;
@@ -15975,12 +16046,12 @@ function pr(s15, t2 = false) {
15975
16046
  function p2() {
15976
16047
  let b = i2;
15977
16048
  if (s15.charCodeAt(i2) === 48) i2++;
15978
- else for (i2++; i2 < s15.length && Vn(s15.charCodeAt(i2)); ) i2++;
15979
- if (i2 < s15.length && s15.charCodeAt(i2) === 46) if (i2++, i2 < s15.length && Vn(s15.charCodeAt(i2))) for (i2++; i2 < s15.length && Vn(s15.charCodeAt(i2)); ) i2++;
16049
+ else for (i2++; i2 < s15.length && Jn(s15.charCodeAt(i2)); ) i2++;
16050
+ if (i2 < s15.length && s15.charCodeAt(i2) === 46) if (i2++, i2 < s15.length && Jn(s15.charCodeAt(i2))) for (i2++; i2 < s15.length && Jn(s15.charCodeAt(i2)); ) i2++;
15980
16051
  else return d = 3, s15.substring(b, i2);
15981
16052
  let x = i2;
15982
- if (i2 < s15.length && (s15.charCodeAt(i2) === 69 || s15.charCodeAt(i2) === 101)) if (i2++, (i2 < s15.length && s15.charCodeAt(i2) === 43 || s15.charCodeAt(i2) === 45) && i2++, i2 < s15.length && Vn(s15.charCodeAt(i2))) {
15983
- for (i2++; i2 < s15.length && Vn(s15.charCodeAt(i2)); ) i2++;
16053
+ if (i2 < s15.length && (s15.charCodeAt(i2) === 69 || s15.charCodeAt(i2) === 101)) if (i2++, (i2 < s15.length && s15.charCodeAt(i2) === 43 || s15.charCodeAt(i2) === 45) && i2++, i2 < s15.length && Jn(s15.charCodeAt(i2))) {
16054
+ for (i2++; i2 < s15.length && Jn(s15.charCodeAt(i2)); ) i2++;
15984
16055
  x = i2;
15985
16056
  } else d = 3;
15986
16057
  return s15.substring(b, x);
@@ -16093,7 +16164,7 @@ function pr(s15, t2 = false) {
16093
16164
  }
16094
16165
  return n += String.fromCharCode(b), i2++, r = 16;
16095
16166
  case 45:
16096
- if (n += String.fromCharCode(b), i2++, i2 === e2 || !Vn(s15.charCodeAt(i2))) return r = 16;
16167
+ if (n += String.fromCharCode(b), i2++, i2 === e2 || !Jn(s15.charCodeAt(i2))) return r = 16;
16097
16168
  case 48:
16098
16169
  case 49:
16099
16170
  case 50:
@@ -16151,7 +16222,7 @@ function cl(s15) {
16151
16222
  function Na(s15) {
16152
16223
  return s15 === 10 || s15 === 13;
16153
16224
  }
16154
- function Vn(s15) {
16225
+ function Jn(s15) {
16155
16226
  return s15 >= 48 && s15 <= 57;
16156
16227
  }
16157
16228
  var ru;
@@ -16170,7 +16241,7 @@ var fl;
16170
16241
  s15.DEFAULT = { allowTrailingComma: false };
16171
16242
  })(fl || (fl = {}));
16172
16243
  function ou(s15, t2, e2 = fl.DEFAULT) {
16173
- let i2 = pr(s15, false), n = [], a = 0;
16244
+ let i2 = mr(s15, false), n = [], a = 0;
16174
16245
  function r(R2) {
16175
16246
  return R2 ? () => a === 0 && R2(i2.getTokenOffset(), i2.getTokenLength(), i2.getTokenStartLine(), i2.getTokenStartCharacter()) : () => true;
16176
16247
  }
@@ -16230,14 +16301,14 @@ function ou(s15, t2, e2 = fl.DEFAULT) {
16230
16301
  }
16231
16302
  }
16232
16303
  }
16233
- function T(R2, $ = [], V = []) {
16234
- if (b(R2), $.length + V.length > 0) {
16304
+ function T(R2, $ = [], J = []) {
16305
+ if (b(R2), $.length + J.length > 0) {
16235
16306
  let Y = i2.getToken();
16236
16307
  for (; Y !== 17; ) {
16237
16308
  if ($.indexOf(Y) !== -1) {
16238
16309
  k();
16239
16310
  break;
16240
- } else if (V.indexOf(Y) !== -1) break;
16311
+ } else if (J.indexOf(Y) !== -1) break;
16241
16312
  Y = k();
16242
16313
  }
16243
16314
  }
@@ -16333,12 +16404,12 @@ async function uu(s15, t2, e2) {
16333
16404
  throw new t("E_PARSE", t2.operation ?? "convert", "Invalid JSON metadata", "json", `${e2 ? e2 + ":" : ""}${f + 1}:${c + 1}`);
16334
16405
  } }, { disallowComments: true, allowTrailingComma: false, allowEmptyContent: false }), JSON.parse(s15);
16335
16406
  }
16336
- async function mr(s15, t2, e2) {
16407
+ async function wr(s15, t2, e2) {
16337
16408
  let i2 = Object.assign(/* @__PURE__ */ Object.create(null), s15);
16338
16409
  for (let [n, a] of Object.entries(t2)) {
16339
16410
  await e2.cooperate();
16340
16411
  let r = i2[n];
16341
- i2[n] = r?.t === "MetaMap" && a.t === "MetaMap" ? { t: "MetaMap", c: await mr(r.c, a.c, e2) } : a;
16412
+ i2[n] = r?.t === "MetaMap" && a.t === "MetaMap" ? { t: "MetaMap", c: await wr(r.c, a.c, e2) } : a;
16342
16413
  }
16343
16414
  return i2;
16344
16415
  }
@@ -16369,7 +16440,7 @@ async function Ei(s15, t2, e2, i2 = 0) {
16369
16440
  }
16370
16441
  return n;
16371
16442
  }
16372
- var wr = class {
16443
+ var gr = class {
16373
16444
  native = false;
16374
16445
  escape = "";
16375
16446
  surrogate = "";
@@ -16518,7 +16589,7 @@ async function hu(s15, t2) {
16518
16589
  }
16519
16590
  if (e2 === "authority" || e2 === "authorityEnd" || e2 === "slashes") {
16520
16591
  if (i2 === "file" && c) return false;
16521
- let d = f < 0 ? o2 : f, u = new wr(), h = d, p2 = false, m2 = "", w = 0, y2 = false, g = false, b = false, x = 0, v = false, k = false;
16592
+ let d = f < 0 ? o2 : f, u = new gr(), h = d, p2 = false, m2 = "", w = 0, y2 = false, g = false, b = false, x = 0, v = false, k = false;
16522
16593
  for await (let E of s15()) {
16523
16594
  let A = w + E.length, I = Math.max(w, l);
16524
16595
  if (A > l && w < d) for (let F of E.slice(Math.max(0, l - w), Math.min(E.length, d - w))) {
@@ -16723,7 +16794,7 @@ async function se(s15, t2) {
16723
16794
  }
16724
16795
  i2 && await t2.emit(e2.subarray(0, i2));
16725
16796
  }
16726
- async function br(s15, t2, e2, i2) {
16797
+ async function yr2(s15, t2, e2, i2) {
16727
16798
  let n = { fs: i2.fs, cwd: i2.directory, env: {}, signal: e2.signal ?? new AbortController().signal }, a = (i2.cacheBytes ?? 1048576) / 16384, r = "tree" in t2 ? void 0 : new ul(n, a), o2 = new ul(n, a), l = new ul(n, a), f = async () => {
16728
16799
  let g;
16729
16800
  for (let b of [r, o2, l]) try {
@@ -16767,7 +16838,7 @@ async function br(s15, t2, e2, i2) {
16767
16838
  }
16768
16839
  W && (yield `
16769
16840
  `);
16770
- }, G = Number.isFinite(e2.limits.text) || Number.isFinite(e2.limits.retainedBytes) ? sr((async function* () {
16841
+ }, G = Number.isFinite(e2.limits.text) || Number.isFinite(e2.limits.retainedBytes) ? rr((async function* () {
16771
16842
  for (let N = 0; N < q; N += 16384) yield await r.read(H + N, Math.min(16384, q - N));
16772
16843
  })(), e2, o2, [], void 0, Number.isFinite(e2.limits.retainedBytes)) : M(), z;
16773
16844
  try {
@@ -16795,7 +16866,7 @@ async function br(s15, t2, e2, i2) {
16795
16866
  }
16796
16867
  let g = "tree" in t2 ? t2.root : h.rootPosition;
16797
16868
  (await h.describe(g)).kind !== "object" && y2("JSON metadata must be an object");
16798
- let b = new Tt(o2, d), x = new Lt(o2, b), v = new gr(o2, 64), k = new gr(o2, 64), T = new gr(o2, 64), E = new gr(o2, 64), A = async (U, H, q) => x.add(await b.from((async function* () {
16869
+ let b = new Tt(o2, d), x = new Lt(o2, b), v = new br(o2, 64), k = new br(o2, 64), T = new br(o2, 64), E = new br(o2, 64), A = async (U, H, q) => x.add(await b.from((async function* () {
16799
16870
  yield `${q}:`, yield* U.scalarChunks(H);
16800
16871
  })())), I = (await h.describe(g)).end;
16801
16872
  for (let U = g; U < I; ) {
@@ -16892,9 +16963,9 @@ async function br(s15, t2, e2, i2) {
16892
16963
  }
16893
16964
  }
16894
16965
  }
16895
- let V = new TextEncoder(), Y = await u.property(u.rootPosition, "blocks");
16896
- m2 = await Je({ chunks: (async function* () {
16897
- yield V.encode('{"pandoc-api-version":[1,23,1,2],"meta":'), yield* p2.chunks(), yield V.encode(',"blocks":'), yield* u.chunks(Y, s15.order), yield V.encode("}");
16966
+ let J = new TextEncoder(), Y = await u.property(u.rootPosition, "blocks");
16967
+ m2 = await Ve({ chunks: (async function* () {
16968
+ yield J.encode('{"pandoc-api-version":[1,23,1,2],"meta":'), yield* p2.chunks(), yield J.encode(',"blocks":'), yield* u.chunks(Y, s15.order), yield J.encode("}");
16898
16969
  })() }, e2, i2, false, false);
16899
16970
  } catch (g) {
16900
16971
  w = { reason: g };
@@ -16915,7 +16986,7 @@ async function br(s15, t2, e2, i2) {
16915
16986
  }
16916
16987
  return m2;
16917
16988
  }
16918
- var yr2 = class {
16989
+ var xr = class {
16919
16990
  constructor(t2, e2) {
16920
16991
  this.storage = t2;
16921
16992
  this.context = e2;
@@ -16969,19 +17040,19 @@ async function mu(s15, t2, e2, i2, n) {
16969
17040
  return R2;
16970
17041
  }, E = async (C) => (await s15.describe(C)).children, A = async (C) => await s15.smallText(await s15.property(C, "t"), 32), I = (C) => readJsonNumber(s15.scalarChunks(C), (P) => t2.cooperate(P)), F = async (C, P = false) => {
16971
17042
  let R2 = typeof C == "number" ? await l.from(s15.scalarChunks(C)) : C, $ = 0;
16972
- for await (let V of l.unicodeChunks(R2)) {
16973
- for (let U of V) {
17043
+ for await (let J of l.unicodeChunks(R2)) {
17044
+ for (let U of J) {
16974
17045
  let H = U.codePointAt(0);
16975
17046
  (H < 32 && ![9, 10, 13].includes(H) || H === 65534 || H === 65535) && y2("Invalid XML character");
16976
17047
  }
16977
- let Y = hr(V);
17048
+ let Y = hr(J);
16978
17049
  $ += Y.length, P && (Y = Y.split(" ").join("<text:s/>").split(" ").join("<text:tab/>").split(`
16979
17050
  `).join("<text:line-break/>")), await g(Y);
16980
17051
  }
16981
17052
  t2.charge("retainedBytes", $ * 2);
16982
17053
  };
16983
17054
  try {
16984
- let C = new yr2(r, t2), P = async function* (q) {
17055
+ let C = new xr(r, t2), P = async function* (q) {
16985
17056
  for (let M of q) if (typeof M == "string") yield new TextEncoder().encode(M);
16986
17057
  else for await (let G of l.unicodeChunks(M)) yield new TextEncoder().encode(G);
16987
17058
  }, R2 = async (q, M) => {
@@ -17033,8 +17104,8 @@ async function mu(s15, t2, e2, i2, n) {
17033
17104
  }
17034
17105
  let _ = await s15.smallText(await s15.property(N, "t"), 32), S = await s15.property(N, "c");
17035
17106
  if (z.op === "table") {
17036
- let B = await T(await T(S, 3), 1), j = await T(await T(S, 5), 1), J = !!await E(B);
17037
- await x(v(`<table:table table:name="Table${++m2}"><table:table-column table:number-columns-repeated="${await E(await T(S, 2))}"/>`), ...J ? [v("<table:table-header-rows>"), k(B, "row", "Table_20_Heading"), v("</table:table-header-rows>")] : [], k(await T(S, 4), "body", "Table_20_Contents"), k(j, "row", "Table_20_Contents"), v("</table:table>"));
17107
+ let B = await T(await T(S, 3), 1), j = await T(await T(S, 5), 1), V = !!await E(B);
17108
+ await x(v(`<table:table table:name="Table${++m2}"><table:table-column table:number-columns-repeated="${await E(await T(S, 2))}"/>`), ...V ? [v("<table:table-header-rows>"), k(B, "row", "Table_20_Heading"), v("</table:table-header-rows>")] : [], k(await T(S, 4), "body", "Table_20_Contents"), k(j, "row", "Table_20_Contents"), v("</table:table>"));
17038
17109
  continue;
17039
17110
  }
17040
17111
  if (z.op === "inline") {
@@ -17051,7 +17122,7 @@ async function mu(s15, t2, e2, i2, n) {
17051
17122
  else if (_ === "Image") {
17052
17123
  let B = await T(S, 2), j = await n.image(B + 32);
17053
17124
  t2.charge("images", 1);
17054
- let J = BigInt(j.identity), Z = Number(await c.get(J) ?? 0n), tt;
17125
+ let V = BigInt(j.identity), Z = Number(await c.get(V) ?? 0n), tt;
17055
17126
  if (Z) {
17056
17127
  let st = await r.read(Z, 8), lt = new DataView(st.buffer, st.byteOffset, 8).getFloat64(0, true);
17057
17128
  tt = JSON.parse(new TextDecoder().decode(await r.read(Z + 8, lt)));
@@ -17063,7 +17134,7 @@ async function mu(s15, t2, e2, i2, n) {
17063
17134
  if (xt <= 0) throw new gt("Native image height must round to positive EMUs.");
17064
17135
  tt = { name: `Pictures/image-${++d}.${ut}`, width: Nt, height: xt };
17065
17136
  let we = new TextEncoder().encode(JSON.stringify(tt)), re = new Uint8Array(8 + we.length);
17066
- new DataView(re.buffer).setFloat64(0, we.length, true), re.set(we, 8), await c.set(J, BigInt(await r.append(re))), await C.addSource(tt.name, j.chunks), await l.append(f, await l.from([`<manifest:file-entry manifest:full-path="${tt.name}" manifest:media-type="${dt.mime}"/>`]));
17137
+ new DataView(re.buffer).setFloat64(0, we.length, true), re.set(we, 8), await c.set(V, BigInt(await r.append(re))), await C.addSource(tt.name, j.chunks), await l.append(f, await l.from([`<manifest:file-entry manifest:full-path="${tt.name}" manifest:media-type="${dt.mime}"/>`]));
17067
17138
  }
17068
17139
  let it, L, K = await T(S + 32, 2), Q = (await s15.describe(K)).end;
17069
17140
  for (let st = K + 32; st < Q; st = (await s15.describe(st)).end) {
@@ -17096,9 +17167,9 @@ async function mu(s15, t2, e2, i2, n) {
17096
17167
  }
17097
17168
  await x(v('">'), k(await T(S, 1), "block", W, X), v("</text:section>"));
17098
17169
  } else if (_ === "BulletList" || _ === "OrderedList") {
17099
- let B = "List" + ++m2, j = _ === "OrderedList", J = S + 32, Z = j ? { DefaultStyle: "1", Decimal: "1", LowerAlpha: "a", UpperAlpha: "A", LowerRoman: "i", UpperRoman: "I" }[await A(await T(J, 1))] : void 0;
17170
+ let B = "List" + ++m2, j = _ === "OrderedList", V = S + 32, Z = j ? { DefaultStyle: "1", Decimal: "1", LowerAlpha: "a", UpperAlpha: "A", LowerRoman: "i", UpperRoman: "I" }[await A(await T(V, 1))] : void 0;
17100
17171
  j && !Z && y2("Unsupported ODT list style", "E_UNSUPPORTED_FEATURE");
17101
- let tt = j ? await A(await T(J, 2)) : "", it = `<text:list-style style:name="${B}">${j ? `<text:list-level-style-number text:level="${X}" style:num-format="${Z}" text:start-value="${await I(J + 32)}" style:num-prefix="${tt === "TwoParens" ? "(" : ""}" style:num-suffix="${tt === "OneParen" || tt === "TwoParens" ? ")" : "."}"/>` : `<text:list-level-style-bullet text:level="${X}" text:bullet-char="\u2022"/>`}</text:list-style>`;
17172
+ let tt = j ? await A(await T(V, 2)) : "", it = `<text:list-style style:name="${B}">${j ? `<text:list-level-style-number text:level="${X}" style:num-format="${Z}" text:start-value="${await I(V + 32)}" style:num-prefix="${tt === "TwoParens" ? "(" : ""}" style:num-suffix="${tt === "OneParen" || tt === "TwoParens" ? ")" : "."}"/>` : `<text:list-level-style-bullet text:level="${X}" text:bullet-char="\u2022"/>`}</text:list-style>`;
17102
17173
  await l.append(h, await l.from([it])), await x(v(`<text:list text:style-name="${B}">`), k(j ? await T(S, 1) : S, "item", W, X + 1), v("</text:list>"));
17103
17174
  } else if (_ === "Table") {
17104
17175
  let B = await T(S, 1), j = await T(B, 1);
@@ -17106,10 +17177,10 @@ async function mu(s15, t2, e2, i2, n) {
17106
17177
  } else y2("Unsupported ODT block: " + _, "E_UNSUPPORTED_FEATURE");
17107
17178
  }
17108
17179
  await R2("content.xml", [`<?xml version="1.0" encoding="UTF-8"?><office:document-content ${Sa} office:version="1.3"><office:automatic-styles>`, h, "</office:automatic-styles><office:body><office:text>", u, "</office:text></office:body></office:document-content>"]), await R2("styles.xml", [Ks]);
17109
- let $ = await s15.property(s15.rootPosition, "meta"), V = await s15.property($, "title"), Y = at();
17110
- if (V !== void 0 && await s15.smallText(await s15.property(V, "t"), 32) === "MetaString") {
17180
+ let $ = await s15.property(s15.rootPosition, "meta"), J = await s15.property($, "title"), Y = at();
17181
+ if (J !== void 0 && await s15.smallText(await s15.property(J, "t"), 32) === "MetaString") {
17111
17182
  let q = { ...u };
17112
- u.first = 0, u.last = 0, u.units = 0, await g("<dc:title>"), await F(await s15.property(V, "c")), await g("</dc:title>"), Object.assign(Y, u), Object.assign(u, q);
17183
+ u.first = 0, u.last = 0, u.units = 0, await g("<dc:title>"), await F(await s15.property(J, "c")), await g("</dc:title>"), Object.assign(Y, u), Object.assign(u, q);
17113
17184
  }
17114
17185
  await R2("meta.xml", [`<?xml version="1.0"?><office:document-meta xmlns:office="${ht.office}" xmlns:dc="http://purl.org/dc/elements/1.1/" office:version="1.3"><office:meta>`, Y, "</office:meta></office:document-meta>"]), await R2("META-INF/manifest.xml", [`<?xml version="1.0"?><manifest:manifest xmlns:manifest="${ht.manifest}" manifest:version="1.3"><manifest:file-entry manifest:full-path="/" manifest:media-type="${an}"/>`, f, ...["content.xml", "styles.xml", "meta.xml"].map((q) => `<manifest:file-entry manifest:full-path="${q}" manifest:media-type="text/xml"/>`), "</manifest:manifest>"]);
17115
17186
  let U = await C.prepare(), H = t2.snapshotDiagnostics();
@@ -17307,21 +17378,21 @@ async function bu(s15, t2, e2, i2, n, a = {}, r) {
17307
17378
  B = z(Z.slice(0, 32)) !== 0;
17308
17379
  break;
17309
17380
  }
17310
- let j = e2.resources || B ? void 0 : (await A(_)).base, J = BigInt(await p2.intern(async function* () {
17381
+ let j = e2.resources || B ? void 0 : (await A(_)).base, V = BigInt(await p2.intern(async function* () {
17311
17382
  yield j === void 0 ? "-:" : String(j.length) + ":" + j, yield* s15.scalarChunks(_);
17312
17383
  }));
17313
- return await T.set(BigInt(_), J), J;
17384
+ return await T.set(BigInt(_), V), V;
17314
17385
  }, F = e2.context.resourceFiles, C = e2.signal ? { signal: e2.signal } : {}, P, R2 = 0, $ = async function* (_) {
17315
17386
  if (P === void 0) {
17316
17387
  yield* _;
17317
17388
  return;
17318
17389
  }
17319
17390
  for (let S = 0; S < R2; S++) {
17320
- let B = P + S * 24, j = await o2.read(B, 24), J = new DataView(j.buffer, j.byteOffset, j.length), Z = "";
17321
- for await (let tt of f.chunks({ first: J.getFloat64(0, true), last: J.getFloat64(8, true), units: J.getFloat64(16, true) })) Z += tt;
17391
+ let B = P + S * 24, j = await o2.read(B, 24), V = new DataView(j.buffer, j.byteOffset, j.length), Z = "";
17392
+ for await (let tt of f.chunks({ first: V.getFloat64(0, true), last: V.getFloat64(8, true), units: V.getFloat64(16, true) })) Z += tt;
17322
17393
  yield Z;
17323
17394
  }
17324
- }, V = async (_) => {
17395
+ }, J = async (_) => {
17325
17396
  let S = "";
17326
17397
  for await (let B of s15.scalarChunks(_)) S += B;
17327
17398
  return S;
@@ -17338,18 +17409,18 @@ async function bu(s15, t2, e2, i2, n, a = {}, r) {
17338
17409
  }, q = async (_, S) => {
17339
17410
  let B = "";
17340
17411
  for (; _ !== s15.rootPosition; ) {
17341
- let j = await s15.describe(_), J = j.parent;
17342
- if ((await s15.describe(J)).kind === "array") {
17343
- let tt = 0, it = J + 32;
17412
+ let j = await s15.describe(_), V = j.parent;
17413
+ if ((await s15.describe(V)).kind === "array") {
17414
+ let tt = 0, it = V + 32;
17344
17415
  for (; it !== _; ) it = (await s15.describe(it)).end, tt++, await e2.cooperate();
17345
17416
  B = "[" + tt + "]" + B;
17346
17417
  } else {
17347
- let tt = J + 32;
17418
+ let tt = V + 32;
17348
17419
  for (; (await s15.describe(tt)).end !== _; ) tt = (await s15.describe((await s15.describe(tt)).end)).end, await e2.cooperate();
17349
- let it = await V(tt);
17350
- J === s15.rootPosition && it === "meta" && (it = "metadata"), B = "." + it + B;
17420
+ let it = await J(tt);
17421
+ V === s15.rootPosition && it === "meta" && (it = "metadata"), B = "." + it + B;
17351
17422
  }
17352
- _ = J;
17423
+ _ = V;
17353
17424
  }
17354
17425
  return (S.source ? S.source + ":" : "") + "$" + B;
17355
17426
  }, M = async function* () {
@@ -17359,8 +17430,8 @@ async function bu(s15, t2, e2, i2, n, a = {}, r) {
17359
17430
  await e2.cooperate();
17360
17431
  let j = await s15.describe(B);
17361
17432
  if (j.kind === "object") {
17362
- let J = await s15.property(B, "t");
17363
- if (J !== void 0 && await s15.smallText(J, 5) === "Image") {
17433
+ let V = await s15.property(B, "t");
17434
+ if (V !== void 0 && await s15.smallText(V, 5) === "Image") {
17364
17435
  let Z = await s15.property(B, "c"), tt = await Y(Z, 2);
17365
17436
  yield { node: B, target: tt + 32, metadata: _ === "meta" };
17366
17437
  }
@@ -17374,18 +17445,18 @@ async function bu(s15, t2, e2, i2, n, a = {}, r) {
17374
17445
  continue;
17375
17446
  }
17376
17447
  for (; B !== S; ) {
17377
- let J = await s15.describe(B), Z = await s15.describe(J.parent);
17448
+ let V = await s15.describe(B), Z = await s15.describe(V.parent);
17378
17449
  if (Z.kind === "object") {
17379
- let tt = await t2.next(B, J.parent);
17450
+ let tt = await t2.next(B, V.parent);
17380
17451
  if (tt) {
17381
17452
  B = (await s15.describe(tt)).end;
17382
17453
  break;
17383
17454
  }
17384
- } else if (J.end < Z.end) {
17385
- B = J.end;
17455
+ } else if (V.end < Z.end) {
17456
+ B = V.end;
17386
17457
  break;
17387
17458
  }
17388
- B = J.parent;
17459
+ B = V.parent;
17389
17460
  }
17390
17461
  B === S && (B = 0);
17391
17462
  }
@@ -17398,10 +17469,10 @@ async function bu(s15, t2, e2, i2, n, a = {}, r) {
17398
17469
  j = tt.slice(0, 32);
17399
17470
  break;
17400
17471
  }
17401
- let J = z(j);
17402
- J || await La(s15, _, e2);
17472
+ let V = z(j);
17473
+ V || await La(s15, _, e2);
17403
17474
  let Z = await c.intern(async function* () {
17404
- yield String(S.position) + ":", J || (yield* hl(s15, _));
17475
+ yield String(S.position) + ":", V || (yield* hl(s15, _));
17405
17476
  });
17406
17477
  return await E.set(BigInt(_), BigInt(Z)), Z;
17407
17478
  }, z = (_) => {
@@ -17412,10 +17483,10 @@ async function bu(s15, t2, e2, i2, n, a = {}, r) {
17412
17483
  let _ = Number.isFinite(e2.limits.retainedBytes) ? await h("resource") : "";
17413
17484
  return Number.isFinite(e2.limits.retainedBytes) && e2.charge("retainedBytes", _.length * 2 + 64), e2.charge("references", 1), Number.isFinite(e2.limits.retainedBytes) && e2.charge("retainedBytes", _.length * 2 + 64), _.length;
17414
17485
  }, W = async (_, S) => {
17415
- let B = o2.allocate(0), j = 0, J = S, Z = "", tt = false, it = new Uint8Array(4096), L = 0;
17486
+ let B = o2.allocate(0), j = 0, V = S, Z = "", tt = false, it = new Uint8Array(4096), L = 0;
17416
17487
  for await (let K of s15.scalarChunks(_)) for (let Q of K) {
17417
- if (J) {
17418
- J--;
17488
+ if (V) {
17489
+ V--;
17419
17490
  continue;
17420
17491
  }
17421
17492
  if (!`
@@ -17441,10 +17512,10 @@ async function bu(s15, t2, e2, i2, n, a = {}, r) {
17441
17512
  }
17442
17513
  return L && (await o2.append(it.subarray(0, L)), j += L), e2.charge("resources", 1), e2.charge("resourceBytes", j, false), Number.isFinite(e2.limits.retainedBytes) && e2.charge("retainedBytes", j), { position: B, length: j };
17443
17514
  }, X = async (_, S = true, B = false, j = true) => {
17444
- let J = o2.allocate(0), Z = 0;
17515
+ let V = o2.allocate(0), Z = 0;
17445
17516
  return await e2.consume(_(), async (tt) => {
17446
17517
  B && e2.charge("references", 1), await o2.append(tt), Z += tt.length;
17447
- }, S ? ["resourceBytes"] : [], j), { position: J, length: Z };
17518
+ }, S ? ["resourceBytes"] : [], j), { position: V, length: Z };
17448
17519
  };
17449
17520
  try {
17450
17521
  if (n.resourcePath !== void 0) {
@@ -17452,8 +17523,8 @@ async function bu(s15, t2, e2, i2, n, a = {}, r) {
17452
17523
  let _ = Zt(e2.context.resourceCwd ?? "/");
17453
17524
  R2 = n.resourcePath.length, P = o2.allocate(R2 * 24);
17454
17525
  for (let S = 0; S < R2; S++) {
17455
- let B = await f.from([Zt(n.resourcePath[S], _)]), j = new Uint8Array(24), J = new DataView(j.buffer);
17456
- J.setFloat64(0, B.first, true), J.setFloat64(8, B.last, true), J.setFloat64(16, B.units, true), await o2.write(P + S * 24, j);
17526
+ let B = await f.from([Zt(n.resourcePath[S], _)]), j = new Uint8Array(24), V = new DataView(j.buffer);
17527
+ V.setFloat64(0, B.first, true), V.setFloat64(8, B.last, true), V.setFloat64(16, B.units, true), await o2.write(P + S * 24, j);
17457
17528
  }
17458
17529
  }
17459
17530
  if (r) for await (let _ of M()) {
@@ -17461,8 +17532,8 @@ async function bu(s15, t2, e2, i2, n, a = {}, r) {
17461
17532
  if (S === void 0) continue;
17462
17533
  let B = await r.get(S);
17463
17534
  if (B) {
17464
- let j = await I(_.target), J = BigInt(B.identity), Z = await k.get(J);
17465
- Z || (Z = BigInt(await U(await X(() => B.chunks(), false, false, false))), await k.set(J, Z)), await x.set(j, Z), await v.set(j, J);
17535
+ let j = await I(_.target), V = BigInt(B.identity), Z = await k.get(V);
17536
+ Z || (Z = BigInt(await U(await X(() => B.chunks(), false, false, false))), await k.set(V, Z)), await x.set(j, Z), await v.set(j, V);
17466
17537
  }
17467
17538
  }
17468
17539
  if (F && !e2.resources) {
@@ -17470,8 +17541,8 @@ async function bu(s15, t2, e2, i2, n, a = {}, r) {
17470
17541
  let S = await I(_.target);
17471
17542
  if (await x.get(S)) continue;
17472
17543
  let B = "";
17473
- for await (let J of s15.scalarChunks(_.target)) {
17474
- B = J.slice(0, 32);
17544
+ for await (let V of s15.scalarChunks(_.target)) {
17545
+ B = V.slice(0, 32);
17475
17546
  break;
17476
17547
  }
17477
17548
  let j = z(B);
@@ -17492,13 +17563,13 @@ async function bu(s15, t2, e2, i2, n, a = {}, r) {
17492
17563
  for await (let _ of M()) {
17493
17564
  let S = await I(_.target);
17494
17565
  if (await x.get(S) || await w.get(S)) continue;
17495
- let B = await La(s15, _.target, e2), j = await A(_.target), J = [Zt(j.base ?? e2.context.resourceCwd ?? "/")];
17566
+ let B = await La(s15, _.target, e2), j = await A(_.target), V = [Zt(j.base ?? e2.context.resourceCwd ?? "/")];
17496
17567
  if (j.base && e2.context.resourceCwd) {
17497
17568
  let tt = Zt(e2.context.resourceCwd);
17498
- J.includes(tt) || J.push(tt);
17569
+ V.includes(tt) || V.push(tt);
17499
17570
  }
17500
17571
  let Z = 0;
17501
- for await (let tt of $(J)) {
17572
+ for await (let tt of $(V)) {
17502
17573
  let it = (tt === "/" ? "" : tt) + "/" + B.name, L = BigInt(await m2.add(await f.from([it])));
17503
17574
  if (Z = Number(await y2.get(L) ?? 0n), Z) break;
17504
17575
  let K = await Mn(F, it, e2);
@@ -17526,7 +17597,7 @@ async function bu(s15, t2, e2, i2, n, a = {}, r) {
17526
17597
  await b.get(tt) || (e2.charge("references", 1), Number.isFinite(e2.limits.retainedBytes) && e2.charge("retainedBytes", (Number(await u.get(BigInt(Z))) + B.suffixUnits) * 2 + 64), await b.set(tt, 1n));
17527
17598
  }
17528
17599
  } else {
17529
- let tt = await q(_.node, j), it = await V(_.target);
17600
+ let tt = await q(_.node, j), it = await J(_.target);
17530
17601
  if (!n.lossy) throw new t("E_RESOURCE", "convert", "Missing image resource: " + it, void 0, tt);
17531
17602
  e2.report({ code: "W_RESOURCE_MISSING", operation: "convert", message: "Missing image resource: " + it, location: tt });
17532
17603
  }
@@ -17545,8 +17616,8 @@ async function bu(s15, t2, e2, i2, n, a = {}, r) {
17545
17616
  if (r?.count) {
17546
17617
  let S = new Re(o2, 64), B = 0;
17547
17618
  for await (let j of M()) {
17548
- let J = await v.get(await I(j.target));
17549
- J !== void 0 && !j.metadata && !await S.get(J) && (await S.set(J, 1n), B++);
17619
+ let V = await v.get(await I(j.target));
17620
+ V !== void 0 && !j.metadata && !await S.get(V) && (await S.set(V, 1n), B++);
17550
17621
  }
17551
17622
  if (B !== r.count) throw new t("E_RESOURCE", "convert", "Unreferenced RTF resource; embedded fonts/objects unsupported", "rtf");
17552
17623
  }
@@ -17564,8 +17635,8 @@ async function bu(s15, t2, e2, i2, n, a = {}, r) {
17564
17635
  if (!B) return;
17565
17636
  let j = await H(B);
17566
17637
  if (Number.isFinite(e2.limits.retainedBytes)) {
17567
- let J = await u.get(BigInt(B)), Z = Number(J ?? 0n);
17568
- if (J === void 0) for await (let tt of s15.scalarChunks(_)) Z += tt.length;
17638
+ let V = await u.get(BigInt(B)), Z = Number(V ?? 0n);
17639
+ if (V === void 0) for await (let tt of s15.scalarChunks(_)) Z += tt.length;
17569
17640
  else if (!await x.get(S)) {
17570
17641
  let tt = "";
17571
17642
  for await (let it of s15.scalarChunks(_)) {
@@ -17580,11 +17651,11 @@ async function bu(s15, t2, e2, i2, n, a = {}, r) {
17580
17651
  e2.charge("retainedBytes", Z * 2);
17581
17652
  }
17582
17653
  return (async function* () {
17583
- for (let J = 0; J < j.length; J += 16384) await e2.cooperate(), yield await o2.read(j.position + J, Math.min(16384, j.length - J));
17654
+ for (let V = 0; V < j.length; V += 16384) await e2.cooperate(), yield await o2.read(j.position + V, Math.min(16384, j.length - V));
17584
17655
  })();
17585
17656
  }, async image(_) {
17586
- let S, B = await I(_), j = n.to === "odt" ? Number(await w.get(B) ?? 0n) : 0, J = Number(await x.get(B) ?? 0n);
17587
- if (J) S = await H(J);
17657
+ let S, B = await I(_), j = n.to === "odt" ? Number(await w.get(B) ?? 0n) : 0, V = Number(await x.get(B) ?? 0n);
17658
+ if (V) S = await H(V);
17588
17659
  else if (e2.resources && j) S = await H(j);
17589
17660
  else if (e2.resources) {
17590
17661
  if (e2.context.resources?.resolveSource || e2.context.resources?.resolveStream) {
@@ -17593,14 +17664,14 @@ async function bu(s15, t2, e2, i2, n, a = {}, r) {
17593
17664
  });
17594
17665
  n.to !== "odt" && (e2.charge("resources", 1), e2.charge("resourceBytes", K)), S = { position: L, length: K };
17595
17666
  } else {
17596
- let it = await e2.resources.resolve(await V(_), void 0, e2.signal);
17667
+ let it = await e2.resources.resolve(await J(_), void 0, e2.signal);
17597
17668
  if (!(it instanceof Uint8Array)) throw new t("E_RESOURCE", "convert", "Invalid resource bytes", n.to);
17598
17669
  n.to !== "odt" && e2.charge("resources", 1), S = await X(() => [it], n.to !== "odt", false, false);
17599
17670
  }
17600
17671
  n.to === "odt" && await w.set(B, BigInt(await U(S)));
17601
17672
  } else {
17602
17673
  let it = Number(await w.get(B) ?? 0n);
17603
- if (!it) throw new t("E_RESOURCE", "convert", (n.to === "odt" ? "Missing image resource: " : "Missing explicit picture resource: ") + await V(_), n.to);
17674
+ if (!it) throw new t("E_RESOURCE", "convert", (n.to === "odt" ? "Missing image resource: " : "Missing explicit picture resource: ") + await J(_), n.to);
17604
17675
  S = await H(it);
17605
17676
  }
17606
17677
  let Z = { size: S.length, read: (it, L) => o2.read(S.position + it, L) }, tt = Number(B);
@@ -17711,7 +17782,7 @@ var pl = class {
17711
17782
  this.order = a;
17712
17783
  this.image = r;
17713
17784
  this.validateResources = o2;
17714
- this.text = new Tt(e2, (l) => i2.cooperate(l)), this.fonts = new Fa(e2, this.text), this.colors = new Fa(e2, this.text), this.fontRanks = new xr(e2, 64), this.colorRanks = new xr(e2, 64), this.lists = new xr(e2, 64), this.listNodes = new xr(e2, 64);
17785
+ this.text = new Tt(e2, (l) => i2.cooperate(l)), this.fonts = new Fa(e2, this.text), this.colors = new Fa(e2, this.text), this.fontRanks = new kr(e2, 64), this.colorRanks = new kr(e2, 64), this.lists = new kr(e2, 64), this.listNodes = new kr(e2, 64);
17715
17786
  }
17716
17787
  tree;
17717
17788
  storage;
@@ -20665,16 +20736,16 @@ async function Cu(s15, t2, e2, i2, n) {
20665
20736
  }
20666
20737
  let F = Number(await h.get(BigInt(A)) ?? BigInt(A)), C = await s15.describe(F);
20667
20738
  if (C.kind === "object" && F >= w && F < y2) {
20668
- let R2 = await s15.property(F, "t"), $ = R2 === void 0 ? void 0 : await s15.smallText(R2, 16), V = await s15.property(F, "c");
20739
+ let R2 = await s15.property(F, "t"), $ = R2 === void 0 ? void 0 : await s15.smallText(R2, 16), J = await s15.property(F, "c");
20669
20740
  if ($ === "Header") {
20670
- let Y = V + 32, U = await readJsonNumber(s15.scalarChunks(Y), (H) => t2.cooperate(H)) + (i2.shiftHeadingLevelBy ?? 0);
20741
+ let Y = J + 32, U = await readJsonNumber(s15.scalarChunks(Y), (H) => t2.cooperate(H)) + (i2.shiftHeadingLevelBy ?? 0);
20671
20742
  if (U < 1) {
20672
20743
  let H = (await s15.describe(Y)).end, q = (await s15.describe(H)).end;
20673
- await u.set(BigInt(R2), 1n), await h.set(BigInt(V), BigInt(q));
20744
+ await u.set(BigInt(R2), 1n), await h.set(BigInt(J), BigInt(q));
20674
20745
  } else await u.set(BigInt(Y), BigInt(10 + Math.min(6, U)));
20675
20746
  }
20676
- if (i2.stripComments && ($ === "RawInline" || $ === "RawBlock") && await s15.smallText(V + 32, 4) === "html") {
20677
- let Y = (await s15.describe(V + 32)).end, U = 0;
20747
+ if (i2.stripComments && ($ === "RawInline" || $ === "RawBlock") && await s15.smallText(J + 32, 4) === "html") {
20748
+ let Y = (await s15.describe(J + 32)).end, U = 0;
20678
20749
  for await (let H of Ru(s15.scalarChunks(Y))) U += H.length;
20679
20750
  if (t2.charge("retainedBytes", U * 2), !U) continue;
20680
20751
  await u.set(BigInt(Y), 2n);
@@ -20690,7 +20761,7 @@ async function Cu(s15, t2, e2, i2, n) {
20690
20761
  await d.end();
20691
20762
  }
20692
20763
  }
20693
- let g = await Vi(d, l, (k) => t2.cooperate(k)), b = await d.property(d.rootPosition, "meta"), x = await d.property(d.rootPosition, "blocks"), v = new TextEncoder();
20764
+ let g = await Ji(d, l, (k) => t2.cooperate(k)), b = await d.property(d.rootPosition, "meta"), x = await d.property(d.rootPosition, "blocks"), v = new TextEncoder();
20694
20765
  return { tree: d, order: g, close: c, async *chunks(k) {
20695
20766
  yield v.encode('{"pandoc-api-version":[1,23,1,2],"meta":'), yield* d.chunks(b, g), yield v.encode(',"blocks":'), yield* d.chunks(x, g), yield v.encode(k === "crlf" ? `}\r
20696
20767
  ` : `}
@@ -21053,7 +21124,7 @@ async function sw(s15, t2) {
21053
21124
  i2 = n.kind === "object" || n.kind === "array" ? i2 + 32 : n.end;
21054
21125
  }
21055
21126
  }
21056
- async function kr(s15, t2, e2, i2, n = "json", a, r) {
21127
+ async function vr(s15, t2, e2, i2, n = "json", a, r) {
21057
21128
  let o2, l, f, c, d, u, h = async (p2, m2, w = true) => {
21058
21129
  if (!Number.isFinite(t2.limits.retainedBytes) && !Number.isFinite(t2.limits.outputBytes) && !(Number.isFinite(t2.limits.references) && m2 === "crlf")) return;
21059
21130
  if (Number.isFinite(t2.limits.references) || Number.isFinite(t2.limits.retainedBytes)) {
@@ -21082,27 +21153,27 @@ async function kr(s15, t2, e2, i2, n = "json", a, r) {
21082
21153
  for (let x = 0, v = (await d.tree.describe(b)).children / 2; x < v; x++) t2.charge("references", 1);
21083
21154
  }
21084
21155
  if (Number.isFinite(t2.limits.retainedBytes)) {
21085
- let g = await Ji(d.tree, d.order, t2, void 0, true);
21156
+ let g = await Vi(d.tree, d.order, t2, void 0, true);
21086
21157
  await m2?.reserve(g, true);
21087
21158
  }
21088
21159
  let y2 = false;
21089
21160
  for (let g of i2.metadataFiles ?? []) {
21090
- let b = await br(d, { source: g }, t2, e2);
21161
+ let b = await yr2(d, { source: g }, t2, e2);
21091
21162
  await f?.transfer(d.tree, b.tree), await d.close(), d = b, y2 = true;
21092
21163
  }
21093
21164
  if (r?.metadata) {
21094
21165
  let g = r.metadata.tree;
21095
21166
  for await (let b of g.children(g.rootPosition)) {
21096
- let x = await br(d, { tree: g, root: b }, t2, e2);
21167
+ let x = await yr2(d, { tree: g, root: b }, t2, e2);
21097
21168
  await f?.transfer(d.tree, x.tree), await d.close(), d = x, y2 = true;
21098
21169
  }
21099
21170
  }
21100
21171
  if (r?.typedMetadata) {
21101
- let g = r.typedMetadata.tree, b = await br(d, { tree: g, root: g.rootPosition, typed: true }, t2, e2);
21172
+ let g = r.typedMetadata.tree, b = await yr2(d, { tree: g, root: g.rootPosition, typed: true }, t2, e2);
21102
21173
  await f?.transfer(d.tree, b.tree, g), await d.close(), d = b, y2 = true;
21103
21174
  }
21104
21175
  if (y2) {
21105
- let g = await Ji(d.tree, d.order, t2);
21176
+ let g = await Vi(d.tree, d.order, t2);
21106
21177
  await m2?.reserve(g);
21107
21178
  }
21108
21179
  for (let g of i2.filters ?? []) {
@@ -21116,7 +21187,7 @@ async function kr(s15, t2, e2, i2, n = "json", a, r) {
21116
21187
  g.kind === "json" && P.length && (E || (t2.charge("inputBytes", P.length), t2.charge("retainedBytes", P.length), await I(P.length)), E -= P.length), await x.append(P), T += P.length;
21117
21188
  } };
21118
21189
  await t2.call(() => t2.context.filters.applyJsonStream({ stdin: d.chunks(), signal: b, stdout: F }, { ...g }, Object.assign(t2, { to: i2.to })));
21119
- let C = await Je({ chunks: (async function* () {
21190
+ let C = await Ve({ chunks: (async function* () {
21120
21191
  for (let P = 0; P < T; ) {
21121
21192
  let R2 = T - P;
21122
21193
  if (g.kind === "json") {
@@ -21223,7 +21294,7 @@ async function Sl(s15, t2, e2) {
21223
21294
  await s15.end(), await s15.end(), n || (await s15.end(), await s15.end(), await s15.begin("array"), await s15.begin("array"), await s15.value(i2), await s15.value(0), await s15.value([]), await s15.begin("array")), n++, a = 0;
21224
21295
  } }), await s15.end(), await s15.end(), await s15.end(), await s15.value([i2, []]), await s15.end(), await s15.end();
21225
21296
  }
21226
- var vr = class {
21297
+ var Tr = class {
21227
21298
  constructor(t2) {
21228
21299
  this.accept = t2;
21229
21300
  }
@@ -21253,11 +21324,11 @@ async function Fu(s15, t2, e2, i2, n, a, r, o2) {
21253
21324
  let p2 = d.allocate(0);
21254
21325
  if (!s15.length && !l) {
21255
21326
  let g = new BackedJson(d, (b) => i2.cooperate(b));
21256
- await g.value({ blocks: [], meta: {} }), await Ji(g, await Vi(g, d, (b) => i2.cooperate(b)), i2, void 0, true);
21327
+ await g.value({ blocks: [], meta: {} }), await Vi(g, await Ji(g, d, (b) => i2.cooperate(b)), i2, void 0, true);
21257
21328
  }
21258
21329
  for (let g of s15) {
21259
21330
  f && i2.charge("references", 1);
21260
- let b = d.allocate(24), x = 0, v = Number.isFinite(i2.limits.text) || f ? void 0 : new vr(async () => {
21331
+ let b = d.allocate(24), x = 0, v = Number.isFinite(i2.limits.text) || f ? void 0 : new Tr(async () => {
21261
21332
  });
21262
21333
  await i2.consume("bytes" in g ? [g.bytes] : g.chunks, async (E) => {
21263
21334
  if (f) {
@@ -21279,7 +21350,7 @@ async function Fu(s15, t2, e2, i2, n, a, r, o2) {
21279
21350
  new DataView(T.buffer).setFloat64(0, x, true), await d.write(b, T);
21280
21351
  }
21281
21352
  let m2 = async (g, b, x) => {
21282
- let v = new vr((k) => x.accept(k));
21353
+ let v = new Tr((k) => x.accept(k));
21283
21354
  for (let k = 0; k < b; k += 16384) await v.push(await d.read(g + k, Math.min(16384, b - k))), await i2.cooperate();
21284
21355
  await v.push(), await x.finish();
21285
21356
  }, w = p2, y2 = false;
@@ -21317,7 +21388,7 @@ async function Fu(s15, t2, e2, i2, n, a, r, o2) {
21317
21388
  let T = new Lu({ fs: n.fs, cwd: n.directory, env: {}, signal: i2.signal ?? new AbortController().signal }, c / 16384), E = i2.onClose(() => T.close());
21318
21389
  try {
21319
21390
  let A = new BackedJson(T, (I) => i2.cooperate(I));
21320
- await A.begin("object"), await A.key("meta"), await A.value({}), await A.key("blocks"), await A.begin("array"), k.rows && await Sl(A, k.width, (I) => m2(w + 24, v, new ni(t2, i2, I, false))), await A.end(), await A.end(), await Ji(A, await Vi(A, T, (I) => i2.cooperate(I)), i2);
21391
+ await A.begin("object"), await A.key("meta"), await A.value({}), await A.key("blocks"), await A.begin("array"), k.rows && await Sl(A, k.width, (I) => m2(w + 24, v, new ni(t2, i2, I, false))), await A.end(), await A.end(), await Vi(A, await Ji(A, T, (I) => i2.cooperate(I)), i2);
21321
21392
  } finally {
21322
21393
  try {
21323
21394
  await T.close();
@@ -21355,7 +21426,7 @@ async function Fu(s15, t2, e2, i2, n, a, r, o2) {
21355
21426
  let x = await d.read(w, 24), v = new DataView(x.buffer, x.byteOffset, x.length), k = v.getFloat64(0, true), T = v.getFloat64(8, true), E = v.getFloat64(16, true);
21356
21427
  T && await Sl(g, E, (A) => m2(w + 24, k, new ni(t2, i2, A, false))), w += 24 + k;
21357
21428
  }
21358
- await g.end(), await g.end(), await kr(async () => ({ referencesAggregated: true, normalizedUsage: { nodes: 0, text: 0 }, tree: g, order: await Vi(g, d, (b) => i2.cooperate(b)), async *chunks(b) {
21429
+ await g.end(), await g.end(), await vr(async () => ({ referencesAggregated: true, normalizedUsage: { nodes: 0, text: 0 }, tree: g, order: await Ji(g, d, (b) => i2.cooperate(b)), async *chunks(b) {
21359
21430
  yield* g.chunks(), yield new TextEncoder().encode(b === "crlf" ? `\r
21360
21431
  ` : `
21361
21432
  `);
@@ -21388,10 +21459,10 @@ async function Fu(s15, t2, e2, i2, n, a, r, o2) {
21388
21459
  await T(`</colgroup>
21389
21460
  <thead>
21390
21461
  `);
21391
- let $ = 0, V = 0, Y = false, U = async () => {
21392
- Y || (V || await T("<tr>"), await T($ ? "<td>" : '<th scope="col">'), Y = true);
21462
+ let $ = 0, J = 0, Y = false, U = async () => {
21463
+ Y || (J || await T("<tr>"), await T($ ? "<td>" : '<th scope="col">'), Y = true);
21393
21464
  }, H = async () => {
21394
- await U(), await T($ ? "</td>" : "</th>"), V++, Y = false;
21465
+ await U(), await T($ ? "</td>" : "</th>"), J++, Y = false;
21395
21466
  }, q = new ni(t2, i2, { async text(M) {
21396
21467
  await U();
21397
21468
  let G = "";
@@ -21399,11 +21470,11 @@ async function Fu(s15, t2, e2, i2, n, a, r, o2) {
21399
21470
  ` ? "<br>" : z === "&" ? "&amp;" : z === "<" ? "&lt;" : z === ">" ? "&gt;" : a.ascii && z.codePointAt(0) > 127 ? `&#${z.codePointAt(0)};` : z, G.length >= 4096 && (await T(G), G = "");
21400
21471
  G && await T(G);
21401
21472
  }, field: H, async record() {
21402
- for (; V < R2; ) await H(), await i2.cooperate();
21473
+ for (; J < R2; ) await H(), await i2.cooperate();
21403
21474
  await T(`</tr>
21404
21475
  `), $ || await T(`</thead>
21405
21476
  <tbody>
21406
- `), $++, V = 0;
21477
+ `), $++, J = 0;
21407
21478
  } });
21408
21479
  await m2(w + 24, C, q), await T(`</tbody>
21409
21480
  </table>
@@ -21427,7 +21498,7 @@ async function Fu(s15, t2, e2, i2, n, a, r, o2) {
21427
21498
  if (h) throw h.reason;
21428
21499
  await i2.completeOutput();
21429
21500
  }
21430
- var Tr = class {
21501
+ var Sr = class {
21431
21502
  constructor(t2, e2) {
21432
21503
  this.context = t2;
21433
21504
  this.options = e2;
@@ -21482,12 +21553,12 @@ ${n}`).replace("</body>", `${a}</body>`).replace("</head>", `${r}</head>`) : i2
21482
21553
  await e2.cooperate();
21483
21554
  let R2 = this.template.indexOf("$", A), $ = this.template.indexOf("$", R2 + 1);
21484
21555
  if (R2 < 0 || $ < 0 || $ >= d) break;
21485
- let V = this.template.slice(R2 + 1, $);
21486
- if ((V.startsWith("if(") || V.startsWith("for(")) && E++, (V === "endif" || V === "endfor") && --E === 0) {
21487
- V !== (v ? "endfor" : "endif") && e2.fail("E_PARSE", "Mismatched template block"), F = R2, C = $ + 1;
21556
+ let J = this.template.slice(R2 + 1, $);
21557
+ if ((J.startsWith("if(") || J.startsWith("for(")) && E++, (J === "endif" || J === "endfor") && --E === 0) {
21558
+ J !== (v ? "endfor" : "endif") && e2.fail("E_PARSE", "Mismatched template block"), F = R2, C = $ + 1;
21488
21559
  break;
21489
21560
  }
21490
- V === "else" && E === 1 && (I = R2), A = $ + 1;
21561
+ J === "else" && E === 1 && (I = R2), A = $ + 1;
21491
21562
  }
21492
21563
  F < 0 && e2.fail("E_PARSE", "Unclosed template block");
21493
21564
  let P = u[T];
@@ -21575,7 +21646,7 @@ var fn = class extends cn {
21575
21646
  t2.variables !== void 0 && (!t2.variables || typeof t2.variables != "object" || Array.isArray(t2.variables)) && this.fail("E_OPTION", "variables must be a map"), this.variables = t2.variables;
21576
21647
  for (let a of [...t2.template ? [t2.template] : [], ...t2.includeInHeader ?? [], ...t2.includeBeforeBody ?? [], ...t2.includeAfterBody ?? []]) (!a || typeof a != "object" || !("bytes" in a) && !("chunks" in a)) && this.fail("E_OPTION", "Invalid local template/include input");
21577
21648
  let n = t2.template || t2.includeInHeader?.length || t2.includeBeforeBody?.length || t2.includeAfterBody?.length;
21578
- n && !["html", "html5"].includes(this.registry.resolve(t2.to, "write").descriptor.name) && this.fail("E_OPTION", "Local templates and includes currently require HTML output"), n && (this.localTemplate = new Tr(this, t2));
21649
+ n && !["html", "html5"].includes(this.registry.resolve(t2.to, "write").descriptor.name) && this.fail("E_OPTION", "Local templates and includes currently require HTML output"), n && (this.localTemplate = new Sr(this, t2));
21579
21650
  for (let a of ["numberSections", "toc", "ascii", "stripComments"]) t2[a] !== void 0 && typeof t2[a] != "boolean" && this.fail("E_OPTION", `${a} must be boolean`), this[a] = t2[a] === true;
21580
21651
  t2.columns !== void 0 && (!Number.isSafeInteger(t2.columns) || t2.columns < 1) && this.fail("E_OPTION", "columns must be a positive integer"), t2.shiftHeadingLevelBy !== void 0 && (!Number.isInteger(t2.shiftHeadingLevelBy) || Math.abs(t2.shiftHeadingLevelBy) > 6) && this.fail("E_OPTION", "heading shift must be between -6 and 6"), t2.eol !== void 0 && !["lf", "crlf", "native"].includes(t2.eol) && this.fail("E_OPTION", "Invalid eol policy"), this.wrap = t2.wrap, this.columns = t2.columns, this.shiftHeadingLevelBy = t2.shiftHeadingLevelBy ?? 0, this.eol = t2.eol, this.media.configure(t2, e2), this.registry.validateOptions(t2.to, "write", Object.keys(t2).filter((a) => !["from", "to", "filters", "yes", "lossy", "stripComments", "shiftHeadingLevelBy", "eol", "failIfWarnings", "metadata", "metadataJson", "metadataFiles", "resourcePath", "extractMedia", "template", "variables", "includeInHeader", "includeBeforeBody", "includeAfterBody", "fileScope", "sandbox", "embedResources"].includes(a) && !(a === "standalone" && t2.standalone === false))), t2.yes !== void 0 && typeof t2.yes != "boolean" && this.fail("E_OPTION", "yes must be boolean"), this.yes = t2.yes === true, t2.failIfWarnings !== void 0 && typeof t2.failIfWarnings != "boolean" && this.fail("E_OPTION", "failIfWarnings must be boolean"), this.failIfWarnings = t2.failIfWarnings === true, t2.metadataJson !== void 0 && !Array.isArray(t2.metadataJson) && this.fail("E_OPTION", "metadataJson must be an array"), t2.metadataFiles !== void 0 && !Array.isArray(t2.metadataFiles) && this.fail("E_OPTION", "metadataFiles must be an array");
21581
21652
  for (let a of t2.metadataFiles ?? []) {
@@ -21710,7 +21781,7 @@ var fn = class extends cn {
21710
21781
  a = await Ei(a, l, this);
21711
21782
  }
21712
21783
  for (let r of this.metadataJson ?? []) a = await Ei(a, r, this);
21713
- this.metadata && (a = await mr(a, this.metadata, this)), a !== t2.metadata && (t2 = await this.document({ ...t2, metadata: a }));
21784
+ this.metadata && (a = await wr(a, this.metadata, this)), a !== t2.metadata && (t2 = await this.document({ ...t2, metadata: a }));
21714
21785
  for (let r of i2 ?? []) t2 = await this.document(await this.call(() => this.context.filters.apply(t2, { ...r }, Object.assign(this, { to: n }))));
21715
21786
  if (e2.math !== "source") {
21716
21787
  let r = async (o2, l) => {
@@ -21878,7 +21949,7 @@ async function El(s15, t2, e2) {
21878
21949
  x && await x;
21879
21950
  }
21880
21951
  }
21881
- for (let [b, x] of Object.entries(g.metadata)) Object.hasOwn(f, b) && i2.report({ code: "W_METADATA_CONFLICT", operation: "convert", message: `Later metadata replaces ${b}`, location: `input[${m2}].metadata.${b}` }), Object.hasOwn(f, b) || i2.charge("references", 1), f = await mr(f, { [b]: x }, i2);
21952
+ for (let [b, x] of Object.entries(g.metadata)) Object.hasOwn(f, b) && i2.report({ code: "W_METADATA_CONFLICT", operation: "convert", message: `Later metadata replaces ${b}`, location: `input[${m2}].metadata.${b}` }), Object.hasOwn(f, b) || i2.charge("references", 1), f = await wr(f, { [b]: x }, i2);
21882
21953
  }
21883
21954
  let p2 = await i2.writable(await i2.document({ blocks: l, metadata: f, resources: c, ...d }, true), a.writer, r, t2.to);
21884
21955
  return await i2.finish(await i2.call(() => a.writer.write(p2, i2, a)));
@@ -21895,9 +21966,9 @@ async function Du(s15, t2, e2) {
21895
21966
  d.options(t2, false);
21896
21967
  let u = await d.admitFilters(t2.filters), h = await d.call(() => Ra.acquire(d, e2.workingFiles, t2)), p2 = false, m2 = false, w = 0;
21897
21968
  try {
21898
- await d.call(() => kr(async () => {
21969
+ await d.call(() => vr(async () => {
21899
21970
  if (n.descriptor.name !== "mediawiki" && Number.isFinite(d.limits.references) && d.charge("references", 1), p2 = true, n.descriptor.name === "json") {
21900
- let g = await Je(s15[0], d, e2.workingFiles, true, true, () => {
21971
+ let g = await Ve(s15[0], d, e2.workingFiles, true, true, () => {
21901
21972
  m2 = true;
21902
21973
  });
21903
21974
  return p2 = false, g;
@@ -22129,7 +22200,7 @@ function pw(s15) {
22129
22200
  let i2 = e2[0].split("/").pop();
22130
22201
  return i2 === "env" ? e2.find((a, r) => r > 0 && !a.startsWith("-") && !a.includes("="))?.split("/").pop() : i2 || void 0;
22131
22202
  }
22132
- function Ju(s15 = {}, t2) {
22203
+ function Vu(s15 = {}, t2) {
22133
22204
  i(s15);
22134
22205
  let e2 = s15.jsonFilterCommand, i2 = { ...s15.limits }, n = s15.filters, a = yr(s15.citeproc), r = { name: "pandoc", description: "Convert documents with the original bounded TypeScript SDK", async execute(o2) {
22135
22206
  o2.signal.throwIfAborted();
@@ -22151,7 +22222,7 @@ function Ju(s15 = {}, t2) {
22151
22222
  } catch {
22152
22223
  throw new t("E_OPTION", "convert", "Arguments must be valid UTF-8 without NUL");
22153
22224
  }
22154
- let w = tl(p2.args);
22225
+ let w = el(p2.args);
22155
22226
  if (w !== void 0) return c = l.child(o2.stdout), await c.output.write(new TextEncoder().encode(w)), { exitCode: 0 };
22156
22227
  let y2 = Math.min(i2.inputBytes ?? Oa.inputBytes, o2.inputBudget?.maxBytes ?? 1 / 0), g = 0, b = l.signal, x = { cwd: o2.cwd, stdin: o2.stdinIsDefault ? [] : o2.stdin, readFile: async (N, W, X) => (c ?? l).acquire(async () => {
22157
22228
  let _ = Math.min(y2, X ?? y2), S = await o2.fs.readFile(Hi(o2, N), Number.isFinite(_) ? { signal: b, maxBytes: _ } : { signal: b });
@@ -22162,14 +22233,14 @@ function Ju(s15 = {}, t2) {
22162
22233
  _.throwIfAborted();
22163
22234
  let S = Math.min(y2, X ?? y2), B = 0, j = ju(o2.fs, Hi(o2, N), { signal: _, chunkSize: 65536 });
22164
22235
  try {
22165
- for await (let J of Il(j, _)) {
22166
- if (B += J.byteLength, B > S) throw new t("E_LIMIT", "convert", "Input byte limit exceeded");
22167
- g += J.byteLength, o2.inputBudget?.check(g), yield J;
22236
+ for await (let V of Il(j, _)) {
22237
+ if (B += V.byteLength, B > S) throw new t("E_LIMIT", "convert", "Input byte limit exceeded");
22238
+ g += V.byteLength, o2.inputBudget?.check(g), yield V;
22168
22239
  }
22169
22240
  return;
22170
- } catch (J) {
22171
- let Z = typeof J == "object" && J !== null && "code" in J ? J.code : void 0;
22172
- if (B > 0 || Z !== "ENOTSUP" && Z !== "EOPNOTSUPP") throw J;
22241
+ } catch (V) {
22242
+ let Z = typeof V == "object" && V !== null && "code" in V ? V.code : void 0;
22243
+ if (B > 0 || Z !== "ENOTSUP" && Z !== "EOPNOTSUPP") throw V;
22173
22244
  }
22174
22245
  yield await x.readFile(N, _, X);
22175
22246
  }, writeFile: async () => {
@@ -22183,9 +22254,9 @@ function Ju(s15 = {}, t2) {
22183
22254
  let W = N.toLowerCase(), _ = (W.endsWith(".py") ? ["python3", "python"] : W.endsWith(".js") || W.endsWith(".cjs") || W.endsWith(".mjs") ? ["node"] : W.endsWith(".sh") ? ["sh", "bash"] : []).find((S) => t2(S));
22184
22255
  if (_) return _;
22185
22256
  if (["python3", "python", "node", "sh", "bash"].some((S) => t2(S))) try {
22186
- let S = Math.min(i2.resourceBytes ?? Oa.resourceBytes, y2), B = new Uint8Array(256), j = 0, J = 0;
22257
+ let S = Math.min(i2.resourceBytes ?? Oa.resourceBytes, y2), B = new Uint8Array(256), j = 0, V = 0;
22187
22258
  for await (let tt of Il(ju(o2.fs, Hi(o2, N), { signal: b, chunkSize: 16384 }), b)) {
22188
- if (J += tt.length, J > S) throw new t("E_LIMIT", "convert", "Filter script byte limit exceeded");
22259
+ if (V += tt.length, V > S) throw new t("E_LIMIT", "convert", "Filter script byte limit exceeded");
22189
22260
  g += tt.length, o2.inputBudget?.check(g);
22190
22261
  let it = Math.min(tt.length, B.length - j);
22191
22262
  B.set(tt.subarray(0, it), j), j += it;
@@ -22210,7 +22281,7 @@ function Ju(s15 = {}, t2) {
22210
22281
  let _ = await T(W.path);
22211
22282
  if (!_) throw new t("E_CAPABILITY", "convert", "Filter capability does not support json processing");
22212
22283
  return f(_).apply(N, W, X);
22213
- } }, I = await Uu(p2.args, x, l.signal, { limits: { ...i2, inputBytes: y2 } }), F = [...I.operands ?? [], ...I.options.metadataFiles ?? [], ...I.options.pdfFonts ?? [], ...I.options.template ? [I.options.template] : [], ...I.options.includeInHeader ?? [], ...I.options.includeBeforeBody ?? [], ...I.options.includeAfterBody ?? []], C = [...I.defaultsPaths.map((N) => Hi(o2, N)), ...F.filter((N) => N.source && !("chunks" in N && N.chunks === x.stdin)).map((N) => Hi(o2, N.source))], P = I.operands === void 0 || I.operands.some((N) => "chunks" in N && N.chunks === x.stdin), R2 = I.destination === void 0 ? void 0 : Hi(o2, I.destination), $ = null, V, Y = false;
22284
+ } }, I = await Uu(p2.args, x, l.signal, { limits: { ...i2, inputBytes: y2 } }), F = [...I.operands ?? [], ...I.options.metadataFiles ?? [], ...I.options.pdfFonts ?? [], ...I.options.template ? [I.options.template] : [], ...I.options.includeInHeader ?? [], ...I.options.includeBeforeBody ?? [], ...I.options.includeAfterBody ?? []], C = [...I.defaultsPaths.map((N) => Hi(o2, N)), ...F.filter((N) => N.source && !("chunks" in N && N.chunks === x.stdin)).map((N) => Hi(o2, N.source))], P = I.operands === void 0 || I.operands.some((N) => "chunks" in N && N.chunks === x.stdin), R2 = I.destination === void 0 ? void 0 : Hi(o2, I.destination), $ = null, J, Y = false;
22214
22285
  if (R2 !== void 0) {
22215
22286
  let N = await l.acquire(async () => await o2.fs.capabilitiesFor?.(R2, { signal: l.signal }) ?? o2.fs.capabilities, () => {
22216
22287
  });
@@ -22222,7 +22293,7 @@ function Ju(s15 = {}, t2) {
22222
22293
  if (!(W instanceof Wu) || W.code !== "ENOENT") throw W;
22223
22294
  }
22224
22295
  if ($ && $.type !== "file") throw new t("E_IO", "convert", "Output must be a regular file; symlinks are refused");
22225
- await qu(o2, l, R2, $, C, P), V = await l.acquire(() => o2.fs.stat(Mu(R2), { signal: l.signal }), () => {
22296
+ await qu(o2, l, R2, $, C, P), J = await l.acquire(() => o2.fs.stat(Mu(R2), { signal: l.signal }), () => {
22226
22297
  });
22227
22298
  } else if (c = l.child(o2.stdout), o2.stdoutFile) {
22228
22299
  let N = o2.stdoutFile.path, W = await c.acquire(() => o2.fs.stat(N, { signal: c.signal }), () => {
@@ -22239,7 +22310,7 @@ function Ju(s15 = {}, t2) {
22239
22310
  })() } : N), q = c ?? l, M = { ...o2.fs.publishFileConditional && o2.fs.capabilities.atomicFilePublication ? { writeStream: async (N, W) => q.acquire(async () => {
22240
22311
  let X = await o2.fs.stat(Mu(N), { signal: U }), _ = Al(o2.fs, N, { expected: null, parent: X, signal: U, maxBytes: I.limits?.resourceBytes ?? 1 / 0 });
22241
22312
  try {
22242
- for await (let S of W) await Sr(o2, S, (B) => _.write(B, U));
22313
+ for await (let S of W) await Er(o2, S, (B) => _.write(B, U));
22243
22314
  await _.close(U);
22244
22315
  } finally {
22245
22316
  await _.abort(new t("E_CANCELLED", "convert", "Resource publication closed"));
@@ -22251,14 +22322,14 @@ function Ju(s15 = {}, t2) {
22251
22322
  return g += _.byteLength, o2.inputBudget?.check(g), _;
22252
22323
  }, () => {
22253
22324
  }), mkdir: (N, W) => q.acquire(() => o2.fs.mkdir(N, { signal: U, ...W?.recursive === void 0 ? {} : { recursive: W.recursive } }), () => {
22254
- }), writeFile: (N, W, X) => q.acquire(() => Sr(o2, W, (_) => o2.fs.writeFile(N, _, { signal: U, ...X?.flag === void 0 ? {} : { flag: X.flag } })), () => {
22325
+ }), writeFile: (N, W, X) => q.acquire(() => Er(o2, W, (_) => o2.fs.writeFile(N, _, { signal: U, ...X?.flag === void 0 ? {} : { flag: X.flag } })), () => {
22255
22326
  }) }, G = { workingFiles: { fs: o2.fs, directory: Hi(o2, o2.env.TMPDIR || o2.cwd) }, limits: I.limits, signal: U, resourceFiles: M, resourceCwd: o2.cwd, ...A === void 0 ? {} : { filters: A } };
22256
22327
  if (R2 !== void 0 && Y) {
22257
- d = Al(o2.fs, R2, { expected: $, parent: V, signal: U, maxBytes: I.limits?.outputBytes ?? 1 / 0 });
22328
+ d = Al(o2.fs, R2, { expected: $, parent: J, signal: U, maxBytes: I.limits?.outputBytes ?? 1 / 0 });
22258
22329
  let N = d;
22259
22330
  o2.registerCleanup?.(() => N.abort(new t("E_CANCELLED", "convert", "Invocation closed")));
22260
22331
  }
22261
- let z = R2 === void 0 || d !== void 0 ? await Du(H, I.options, { ...G, output: d ? { write: (N) => Sr(o2, N, (W) => d.write(W, U)), close: () => d.close(U), abort: (N) => d.abort(N) } : { async write(N) {
22332
+ let z = R2 === void 0 || d !== void 0 ? await Du(H, I.options, { ...G, output: d ? { write: (N) => Er(o2, N, (W) => d.write(W, U)), close: () => d.close(U), abort: (N) => d.abort(N) } : { async write(N) {
22262
22333
  try {
22263
22334
  await c.output.write(N);
22264
22335
  } catch (W) {
@@ -22269,8 +22340,8 @@ function Ju(s15 = {}, t2) {
22269
22340
  `));
22270
22341
  if (U.throwIfAborted(), z.kind !== "output") {
22271
22342
  let N = z.kind === "binary" ? z.bytes : new TextEncoder().encode(z.text);
22272
- await l.acquire(() => Sr(o2, N, async (W) => {
22273
- await o2.fs.writeFileConditional(R2, W, { expected: $, parent: V, signal: U });
22343
+ await l.acquire(() => Er(o2, N, async (W) => {
22344
+ await o2.fs.writeFileConditional(R2, W, { expected: $, parent: J, signal: U });
22274
22345
  }), () => {
22275
22346
  });
22276
22347
  }
@@ -22292,10 +22363,10 @@ function Ju(s15 = {}, t2) {
22292
22363
  return lw.evalSyncPandoc = _u, s15.limits === void 0 && s15.filters === void 0 && s15.jsonFilterCommand === void 0 && s15.citeproc === void 0 && ow.add(r.execute), r;
22293
22364
  }
22294
22365
  function wR(s15 = {}) {
22295
- return [Ju(s15)];
22366
+ return [Vu(s15)];
22296
22367
  }
22297
22368
  function gR(s15 = {}) {
22298
- let t2, e2 = [Ju(s15, (n) => t2?.(n) ?? false)], i2 = s15.replace ?? false;
22369
+ let t2, e2 = [Vu(s15, (n) => t2?.(n) ?? false)], i2 = s15.replace ?? false;
22299
22370
  return { name: "pandoc-commands", setup(n) {
22300
22371
  if (t2 = (a) => n.commands.has(a), !i2) {
22301
22372
  for (let a of e2) if (n.commands.has(a.name)) throw new Error(`Command already registered: ${a.name}`);
@@ -22307,10 +22378,10 @@ function gR(s15 = {}) {
22307
22378
  export {
22308
22379
  Qi,
22309
22380
  dd,
22310
- Qo,
22381
+ Zo,
22311
22382
  Ie,
22312
22383
  pT,
22313
- tl,
22384
+ el,
22314
22385
  Zs,
22315
22386
  ir,
22316
22387
  IE,
@@ -22327,7 +22398,7 @@ export {
22327
22398
  _u,
22328
22399
  Al,
22329
22400
  Uu,
22330
- Ju,
22401
+ Vu,
22331
22402
  wR,
22332
22403
  gR
22333
22404
  };