soonjs 0.0.30 → 0.0.31

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 (35) hide show
  1. package/dist/deps/acorn-MFuat2YCgG-e4p88nn1g.js +2895 -0
  2. package/dist/deps/angular-Nz7Izt9RB4-h18jjmowy.js +1448 -0
  3. package/dist/deps/babel-JaNXSJC73c-9yodyvvph.js +6844 -0
  4. package/dist/deps/estree-lrVsLbm9_D-frgb7tfnu.js +4265 -0
  5. package/dist/deps/flow-MAZ63dnw8p-m2rrmabt3.js +26221 -0
  6. package/dist/deps/glimmer-SKEURx3bl3-9q9t7pwdx.js +2756 -0
  7. package/dist/deps/graphql--N7MQg-wpp-ikfx3vyg2.js +1212 -0
  8. package/dist/deps/html-WW7XljTSl6-u2zm0618g.js +2623 -0
  9. package/dist/deps/markdown-i-DCK3AslU-27ooihdjf.js +3058 -0
  10. package/dist/deps/meriyah-0-URq6zZ8n-mvot02tnl.js +2320 -0
  11. package/dist/deps/postcss-urUw1vxeu1-ltys6ubta.js +4664 -0
  12. package/dist/deps/soon-id-t25L9qRGGZ-mseuvoose.js +30 -0
  13. package/dist/deps/typescript-5-LBeuVeDB-kqvbhavbi.js +12794 -0
  14. package/dist/deps/yaml-zChCAOpgM7-osfcioi5d.js +4088 -0
  15. package/dist/index.cjs +1 -1
  16. package/dist/index.js +1 -1
  17. package/dist/vite-plugin-soon-client.cjs +2 -2
  18. package/dist/vite-plugin-soon-client.js +14 -14
  19. package/dist/vite-plugin-soon-server.cjs +1 -1
  20. package/dist/vite-plugin-soon-server.js +1 -1
  21. package/package.json +1 -1
  22. /package/dist/deps/{acorn-GEHm0ZzYiF.js → acorn-MFuat2YCgG-3o370z873.js} +0 -0
  23. /package/dist/deps/{angular-AsYEFZGiaL.js → angular-Nz7Izt9RB4-tpn6vrzzy.js} +0 -0
  24. /package/dist/deps/{babel-JF5SXjDJMg.js → babel-JaNXSJC73c-ynxn8i808.js} +0 -0
  25. /package/dist/deps/{estree-mpHydeVRIX.js → estree-lrVsLbm9_D-emih400u1.js} +0 -0
  26. /package/dist/deps/{flow-Nrt1FQ_Vve.js → flow-MAZ63dnw8p-wi0v0aena.js} +0 -0
  27. /package/dist/deps/{glimmer-wulBvI3ec4.js → glimmer-SKEURx3bl3-l70hzjhe4.js} +0 -0
  28. /package/dist/deps/{graphql-RtYSaK2zvJ.js → graphql--N7MQg-wpp-v49tdgcr9.js} +0 -0
  29. /package/dist/deps/{html-Rhm0swv15v.js → html-WW7XljTSl6-nxudy7vqp.js} +0 -0
  30. /package/dist/deps/{markdown-lYixUp5UIZ.js → markdown-i-DCK3AslU-wd4hbzpj4.js} +0 -0
  31. /package/dist/deps/{meriyah-sFHGgRXFc5.js → meriyah-0-URq6zZ8n-8hx0wdln8.js} +0 -0
  32. /package/dist/deps/{postcss-R-fq3Fq8sV.js → postcss-urUw1vxeu1-xxgu2fu5o.js} +0 -0
  33. /package/dist/deps/{soon-id-mHYJjIZNTr.js → soon-id-t25L9qRGGZ-l8lkjbbxl.js} +0 -0
  34. /package/dist/deps/{typescript-VhxF0z88nS.js → typescript-5-LBeuVeDB-7w9kseqyq.js} +0 -0
  35. /package/dist/deps/{yaml-bWZoUlV7rd.js → yaml-zChCAOpgM7-h7aopdk65.js} +0 -0
@@ -0,0 +1,4088 @@
1
+ var Gn = Object.defineProperty;
2
+ var Zn = (t, e, n) => e in t ? Gn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var it = (t, e, n) => Zn(t, typeof e != "symbol" ? e + "" : e, n);
4
+ var Xn = Object.create, Et = Object.defineProperty, zn = Object.getOwnPropertyDescriptor, er = Object.getOwnPropertyNames, tr = Object.getPrototypeOf, nr = Object.prototype.hasOwnProperty, Le = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports), Wt = (t, e) => {
5
+ for (var n in e) Et(t, n, { get: e[n], enumerable: !0 });
6
+ }, rr = (t, e, n, l) => {
7
+ if (e && typeof e == "object" || typeof e == "function") for (let g of er(e)) !nr.call(t, g) && g !== n && Et(t, g, { get: () => e[g], enumerable: !(l = zn(e, g)) || l.enumerable });
8
+ return t;
9
+ }, jt = (t, e, n) => (n = t != null ? Xn(tr(t)) : {}, rr(Et(n, "default", { value: t, enumerable: !0 }), t)), Ie = Le((t) => {
10
+ var e = { ANCHOR: "&", COMMENT: "#", TAG: "!", DIRECTIVES_END: "-", DOCUMENT_END: "." }, n = { ALIAS: "ALIAS", BLANK_LINE: "BLANK_LINE", BLOCK_FOLDED: "BLOCK_FOLDED", BLOCK_LITERAL: "BLOCK_LITERAL", COMMENT: "COMMENT", DIRECTIVE: "DIRECTIVE", DOCUMENT: "DOCUMENT", FLOW_MAP: "FLOW_MAP", FLOW_SEQ: "FLOW_SEQ", MAP: "MAP", MAP_KEY: "MAP_KEY", MAP_VALUE: "MAP_VALUE", PLAIN: "PLAIN", QUOTE_DOUBLE: "QUOTE_DOUBLE", QUOTE_SINGLE: "QUOTE_SINGLE", SEQ: "SEQ", SEQ_ITEM: "SEQ_ITEM" }, l = "tag:yaml.org,2002:", g = { MAP: "tag:yaml.org,2002:map", SEQ: "tag:yaml.org,2002:seq", STR: "tag:yaml.org,2002:str" };
11
+ function E(c) {
12
+ let i = [0], r = c.indexOf(`
13
+ `);
14
+ for (; r !== -1; ) r += 1, i.push(r), r = c.indexOf(`
15
+ `, r);
16
+ return i;
17
+ }
18
+ function b(c) {
19
+ let i, r;
20
+ return typeof c == "string" ? (i = E(c), r = c) : (Array.isArray(c) && (c = c[0]), c && c.context && (c.lineStarts || (c.lineStarts = E(c.context.src)), i = c.lineStarts, r = c.context.src)), { lineStarts: i, src: r };
21
+ }
22
+ function L(c, i) {
23
+ if (typeof c != "number" || c < 0) return null;
24
+ let { lineStarts: r, src: s } = b(i);
25
+ if (!r || !s || c > s.length) return null;
26
+ for (let p = 0; p < r.length; ++p) {
27
+ let u = r[p];
28
+ if (c < u) return { line: p, col: c - r[p - 1] + 1 };
29
+ if (c === u) return { line: p + 1, col: 1 };
30
+ }
31
+ let o = r.length;
32
+ return { line: o, col: c - r[o - 1] + 1 };
33
+ }
34
+ function M(c, i) {
35
+ let { lineStarts: r, src: s } = b(i);
36
+ if (!r || !(c >= 1) || c > r.length) return null;
37
+ let o = r[c - 1], p = r[c];
38
+ for (; p && p > o && s[p - 1] === `
39
+ `; ) --p;
40
+ return s.slice(o, p);
41
+ }
42
+ function I({ start: c, end: i }, r, s = 80) {
43
+ let o = M(c.line, r);
44
+ if (!o) return null;
45
+ let { col: p } = c;
46
+ if (o.length > s) if (p <= s - 10) o = o.substr(0, s - 1) + "…";
47
+ else {
48
+ let C = Math.round(s / 2);
49
+ o.length > p + C && (o = o.substr(0, p + C - 1) + "…"), p -= o.length - s, o = "…" + o.substr(1 - s);
50
+ }
51
+ let u = 1, h = "";
52
+ i && (i.line === c.line && p + (i.col - c.col) <= s + 1 ? u = i.col - c.col : (u = Math.min(o.length + 1, s) - p, h = "…"));
53
+ let v = p > 1 ? " ".repeat(p - 1) : "", O = "^".repeat(u);
54
+ return `${o}
55
+ ${v}${O}${h}`;
56
+ }
57
+ var P = class qt {
58
+ static copy(i) {
59
+ return new qt(i.start, i.end);
60
+ }
61
+ constructor(i, r) {
62
+ this.start = i, this.end = r || i;
63
+ }
64
+ isEmpty() {
65
+ return typeof this.start != "number" || !this.end || this.end <= this.start;
66
+ }
67
+ setOrigRange(i, r) {
68
+ let { start: s, end: o } = this;
69
+ if (i.length === 0 || o <= i[0]) return this.origStart = s, this.origEnd = o, r;
70
+ let p = r;
71
+ for (; p < i.length && !(i[p] > s); ) ++p;
72
+ this.origStart = s + p;
73
+ let u = p;
74
+ for (; p < i.length && !(i[p] >= o); ) ++p;
75
+ return this.origEnd = o + p, u;
76
+ }
77
+ }, Q = class Ne {
78
+ static addStringTerminator(i, r, s) {
79
+ if (s[s.length - 1] === `
80
+ `) return s;
81
+ let o = Ne.endOfWhiteSpace(i, r);
82
+ return o >= i.length || i[o] === `
83
+ ` ? s + `
84
+ ` : s;
85
+ }
86
+ static atDocumentBoundary(i, r, s) {
87
+ let o = i[r];
88
+ if (!o) return !0;
89
+ let p = i[r - 1];
90
+ if (p && p !== `
91
+ `) return !1;
92
+ if (s) {
93
+ if (o !== s) return !1;
94
+ } else if (o !== e.DIRECTIVES_END && o !== e.DOCUMENT_END) return !1;
95
+ let u = i[r + 1], h = i[r + 2];
96
+ if (u !== o || h !== o) return !1;
97
+ let v = i[r + 3];
98
+ return !v || v === `
99
+ ` || v === " " || v === " ";
100
+ }
101
+ static endOfIdentifier(i, r) {
102
+ let s = i[r], o = s === "<", p = o ? [`
103
+ `, " ", " ", ">"] : [`
104
+ `, " ", " ", "[", "]", "{", "}", ","];
105
+ for (; s && p.indexOf(s) === -1; ) s = i[r += 1];
106
+ return o && s === ">" && (r += 1), r;
107
+ }
108
+ static endOfIndent(i, r) {
109
+ let s = i[r];
110
+ for (; s === " "; ) s = i[r += 1];
111
+ return r;
112
+ }
113
+ static endOfLine(i, r) {
114
+ let s = i[r];
115
+ for (; s && s !== `
116
+ `; ) s = i[r += 1];
117
+ return r;
118
+ }
119
+ static endOfWhiteSpace(i, r) {
120
+ let s = i[r];
121
+ for (; s === " " || s === " "; ) s = i[r += 1];
122
+ return r;
123
+ }
124
+ static startOfLine(i, r) {
125
+ let s = i[r - 1];
126
+ if (s === `
127
+ `) return r;
128
+ for (; s && s !== `
129
+ `; ) s = i[r -= 1];
130
+ return r + 1;
131
+ }
132
+ static endOfBlockIndent(i, r, s) {
133
+ let o = Ne.endOfIndent(i, s);
134
+ if (o > s + r) return o;
135
+ {
136
+ let p = Ne.endOfWhiteSpace(i, o), u = i[p];
137
+ if (!u || u === `
138
+ `) return p;
139
+ }
140
+ return null;
141
+ }
142
+ static atBlank(i, r, s) {
143
+ let o = i[r];
144
+ return o === `
145
+ ` || o === " " || o === " " || s && !o;
146
+ }
147
+ static nextNodeIsIndented(i, r, s) {
148
+ return !i || r < 0 ? !1 : r > 0 ? !0 : s && i === "-";
149
+ }
150
+ static normalizeOffset(i, r) {
151
+ let s = i[r];
152
+ return s ? s !== `
153
+ ` && i[r - 1] === `
154
+ ` ? r - 1 : Ne.endOfWhiteSpace(i, r) : r;
155
+ }
156
+ static foldNewline(i, r, s) {
157
+ let o = 0, p = !1, u = "", h = i[r + 1];
158
+ for (; h === " " || h === " " || h === `
159
+ `; ) {
160
+ switch (h) {
161
+ case `
162
+ `:
163
+ o = 0, r += 1, u += `
164
+ `;
165
+ break;
166
+ case " ":
167
+ o <= s && (p = !0), r = Ne.endOfWhiteSpace(i, r + 2) - 1;
168
+ break;
169
+ case " ":
170
+ o += 1, r += 1;
171
+ break;
172
+ }
173
+ h = i[r + 1];
174
+ }
175
+ return u || (u = " "), h && o <= s && (p = !0), { fold: u, offset: r, error: p };
176
+ }
177
+ constructor(i, r, s) {
178
+ Object.defineProperty(this, "context", { value: s || null, writable: !0 }), this.error = null, this.range = null, this.valueRange = null, this.props = r || [], this.type = i, this.value = null;
179
+ }
180
+ getPropValue(i, r, s) {
181
+ if (!this.context) return null;
182
+ let { src: o } = this.context, p = this.props[i];
183
+ return p && o[p.start] === r ? o.slice(p.start + (s ? 1 : 0), p.end) : null;
184
+ }
185
+ get anchor() {
186
+ for (let i = 0; i < this.props.length; ++i) {
187
+ let r = this.getPropValue(i, e.ANCHOR, !0);
188
+ if (r != null) return r;
189
+ }
190
+ return null;
191
+ }
192
+ get comment() {
193
+ let i = [];
194
+ for (let r = 0; r < this.props.length; ++r) {
195
+ let s = this.getPropValue(r, e.COMMENT, !0);
196
+ s != null && i.push(s);
197
+ }
198
+ return i.length > 0 ? i.join(`
199
+ `) : null;
200
+ }
201
+ commentHasRequiredWhitespace(i) {
202
+ let { src: r } = this.context;
203
+ if (this.header && i === this.header.end || !this.valueRange) return !1;
204
+ let { end: s } = this.valueRange;
205
+ return i !== s || Ne.atBlank(r, s - 1);
206
+ }
207
+ get hasComment() {
208
+ if (this.context) {
209
+ let { src: i } = this.context;
210
+ for (let r = 0; r < this.props.length; ++r) if (i[this.props[r].start] === e.COMMENT) return !0;
211
+ }
212
+ return !1;
213
+ }
214
+ get hasProps() {
215
+ if (this.context) {
216
+ let { src: i } = this.context;
217
+ for (let r = 0; r < this.props.length; ++r) if (i[this.props[r].start] !== e.COMMENT) return !0;
218
+ }
219
+ return !1;
220
+ }
221
+ get includesTrailingLines() {
222
+ return !1;
223
+ }
224
+ get jsonLike() {
225
+ return [n.FLOW_MAP, n.FLOW_SEQ, n.QUOTE_DOUBLE, n.QUOTE_SINGLE].indexOf(this.type) !== -1;
226
+ }
227
+ get rangeAsLinePos() {
228
+ if (!this.range || !this.context) return;
229
+ let i = L(this.range.start, this.context.root);
230
+ if (!i) return;
231
+ let r = L(this.range.end, this.context.root);
232
+ return { start: i, end: r };
233
+ }
234
+ get rawValue() {
235
+ if (!this.valueRange || !this.context) return null;
236
+ let { start: i, end: r } = this.valueRange;
237
+ return this.context.src.slice(i, r);
238
+ }
239
+ get tag() {
240
+ for (let i = 0; i < this.props.length; ++i) {
241
+ let r = this.getPropValue(i, e.TAG, !1);
242
+ if (r != null) {
243
+ if (r[1] === "<") return { verbatim: r.slice(2, -1) };
244
+ {
245
+ let [s, o, p] = r.match(/^(.*!)([^!]*)$/);
246
+ return { handle: o, suffix: p };
247
+ }
248
+ }
249
+ }
250
+ return null;
251
+ }
252
+ get valueRangeContainsNewline() {
253
+ if (!this.valueRange || !this.context) return !1;
254
+ let { start: i, end: r } = this.valueRange, { src: s } = this.context;
255
+ for (let o = i; o < r; ++o) if (s[o] === `
256
+ `) return !0;
257
+ return !1;
258
+ }
259
+ parseComment(i) {
260
+ let { src: r } = this.context;
261
+ if (r[i] === e.COMMENT) {
262
+ let s = Ne.endOfLine(r, i + 1), o = new P(i, s);
263
+ return this.props.push(o), s;
264
+ }
265
+ return i;
266
+ }
267
+ setOrigRanges(i, r) {
268
+ return this.range && (r = this.range.setOrigRange(i, r)), this.valueRange && this.valueRange.setOrigRange(i, r), this.props.forEach((s) => s.setOrigRange(i, r)), r;
269
+ }
270
+ toString() {
271
+ let { context: { src: i }, range: r, value: s } = this;
272
+ if (s != null) return s;
273
+ let o = i.slice(r.start, r.end);
274
+ return Ne.addStringTerminator(i, r.end, o);
275
+ }
276
+ }, ne = class extends Error {
277
+ constructor(c, i, r) {
278
+ if (!r || !(i instanceof Q)) throw new Error(`Invalid arguments for new ${c}`);
279
+ super(), this.name = c, this.message = r, this.source = i;
280
+ }
281
+ makePretty() {
282
+ if (!this.source) return;
283
+ this.nodeType = this.source.type;
284
+ let c = this.source.context && this.source.context.root;
285
+ if (typeof this.offset == "number") {
286
+ this.range = new P(this.offset, this.offset + 1);
287
+ let i = c && L(this.offset, c);
288
+ if (i) {
289
+ let r = { line: i.line, col: i.col + 1 };
290
+ this.linePos = { start: i, end: r };
291
+ }
292
+ delete this.offset;
293
+ } else this.range = this.source.range, this.linePos = this.source.rangeAsLinePos;
294
+ if (this.linePos) {
295
+ let { line: i, col: r } = this.linePos.start;
296
+ this.message += ` at line ${i}, column ${r}`;
297
+ let s = c && I(this.linePos, c);
298
+ s && (this.message += `:
299
+
300
+ ${s}
301
+ `);
302
+ }
303
+ delete this.source;
304
+ }
305
+ }, j = class extends ne {
306
+ constructor(c, i) {
307
+ super("YAMLReferenceError", c, i);
308
+ }
309
+ }, G = class extends ne {
310
+ constructor(c, i) {
311
+ super("YAMLSemanticError", c, i);
312
+ }
313
+ }, U = class extends ne {
314
+ constructor(c, i) {
315
+ super("YAMLSyntaxError", c, i);
316
+ }
317
+ }, Z = class extends ne {
318
+ constructor(c, i) {
319
+ super("YAMLWarning", c, i);
320
+ }
321
+ };
322
+ function ae(c, i, r) {
323
+ return i in c ? Object.defineProperty(c, i, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : c[i] = r, c;
324
+ }
325
+ var T = class ct extends Q {
326
+ static endOfLine(i, r, s) {
327
+ let o = i[r], p = r;
328
+ for (; o && o !== `
329
+ ` && !(s && (o === "[" || o === "]" || o === "{" || o === "}" || o === ",")); ) {
330
+ let u = i[p + 1];
331
+ if (o === ":" && (!u || u === `
332
+ ` || u === " " || u === " " || s && u === ",") || (o === " " || o === " ") && u === "#") break;
333
+ p += 1, o = u;
334
+ }
335
+ return p;
336
+ }
337
+ get strValue() {
338
+ if (!this.valueRange || !this.context) return null;
339
+ let { start: i, end: r } = this.valueRange, { src: s } = this.context, o = s[r - 1];
340
+ for (; i < r && (o === `
341
+ ` || o === " " || o === " "); ) o = s[--r - 1];
342
+ let p = "";
343
+ for (let h = i; h < r; ++h) {
344
+ let v = s[h];
345
+ if (v === `
346
+ `) {
347
+ let { fold: O, offset: C } = Q.foldNewline(s, h, -1);
348
+ p += O, h = C;
349
+ } else if (v === " " || v === " ") {
350
+ let O = h, C = s[h + 1];
351
+ for (; h < r && (C === " " || C === " "); ) h += 1, C = s[h + 1];
352
+ C !== `
353
+ ` && (p += h > O ? s.slice(O, h + 1) : v);
354
+ } else p += v;
355
+ }
356
+ let u = s[i];
357
+ switch (u) {
358
+ case " ": {
359
+ let h = "Plain value cannot start with a tab character";
360
+ return { errors: [new G(this, h)], str: p };
361
+ }
362
+ case "@":
363
+ case "`": {
364
+ let h = `Plain value cannot start with reserved character ${u}`;
365
+ return { errors: [new G(this, h)], str: p };
366
+ }
367
+ default:
368
+ return p;
369
+ }
370
+ }
371
+ parseBlockValue(i) {
372
+ let { indent: r, inFlow: s, src: o } = this.context, p = i, u = i;
373
+ for (let h = o[p]; h === `
374
+ ` && !Q.atDocumentBoundary(o, p + 1); h = o[p]) {
375
+ let v = Q.endOfBlockIndent(o, r, p + 1);
376
+ if (v === null || o[v] === "#") break;
377
+ o[v] === `
378
+ ` ? p = v : (u = ct.endOfLine(o, v, s), p = u);
379
+ }
380
+ return this.valueRange.isEmpty() && (this.valueRange.start = i), this.valueRange.end = u, u;
381
+ }
382
+ parse(i, r) {
383
+ this.context = i;
384
+ let { inFlow: s, src: o } = i, p = r, u = o[p];
385
+ return u && u !== "#" && u !== `
386
+ ` && (p = ct.endOfLine(o, r, s)), this.valueRange = new P(r, p), p = Q.endOfWhiteSpace(o, p), p = this.parseComment(p), (!this.hasComment || this.valueRange.isEmpty()) && (p = this.parseBlockValue(p)), p;
387
+ }
388
+ };
389
+ t.Char = e, t.Node = Q, t.PlainValue = T, t.Range = P, t.Type = n, t.YAMLError = ne, t.YAMLReferenceError = j, t.YAMLSemanticError = G, t.YAMLSyntaxError = U, t.YAMLWarning = Z, t._defineProperty = ae, t.defaultTagPrefix = l, t.defaultTags = g;
390
+ }), ir = Le((t) => {
391
+ var e = Ie(), n = class extends e.Node {
392
+ constructor() {
393
+ super(e.Type.BLANK_LINE);
394
+ }
395
+ get includesTrailingLines() {
396
+ return !0;
397
+ }
398
+ parse(T, c) {
399
+ return this.context = T, this.range = new e.Range(c, c + 1), c + 1;
400
+ }
401
+ }, l = class extends e.Node {
402
+ constructor(T, c) {
403
+ super(T, c), this.node = null;
404
+ }
405
+ get includesTrailingLines() {
406
+ return !!this.node && this.node.includesTrailingLines;
407
+ }
408
+ parse(T, c) {
409
+ this.context = T;
410
+ let { parseNode: i, src: r } = T, { atLineStart: s, lineStart: o } = T;
411
+ !s && this.type === e.Type.SEQ_ITEM && (this.error = new e.YAMLSemanticError(this, "Sequence items must not have preceding content on the same line"));
412
+ let p = s ? c - o : T.indent, u = e.Node.endOfWhiteSpace(r, c + 1), h = r[u], v = h === "#", O = [], C = null;
413
+ for (; h === `
414
+ ` || h === "#"; ) {
415
+ if (h === "#") {
416
+ let F = e.Node.endOfLine(r, u + 1);
417
+ O.push(new e.Range(u, F)), u = F;
418
+ } else {
419
+ s = !0, o = u + 1;
420
+ let F = e.Node.endOfWhiteSpace(r, o);
421
+ r[F] === `
422
+ ` && O.length === 0 && (C = new n(), o = C.parse({ src: r }, o)), u = e.Node.endOfIndent(r, o);
423
+ }
424
+ h = r[u];
425
+ }
426
+ if (e.Node.nextNodeIsIndented(h, u - (o + p), this.type !== e.Type.SEQ_ITEM) ? this.node = i({ atLineStart: s, inCollection: !1, indent: p, lineStart: o, parent: this }, u) : h && o > c + 1 && (u = o - 1), this.node) {
427
+ if (C) {
428
+ let F = T.parent.items || T.parent.contents;
429
+ F && F.push(C);
430
+ }
431
+ O.length && Array.prototype.push.apply(this.props, O), u = this.node.range.end;
432
+ } else if (v) {
433
+ let F = O[0];
434
+ this.props.push(F), u = F.end;
435
+ } else u = e.Node.endOfLine(r, c + 1);
436
+ let _ = this.node ? this.node.valueRange.end : u;
437
+ return this.valueRange = new e.Range(c, _), u;
438
+ }
439
+ setOrigRanges(T, c) {
440
+ return c = super.setOrigRanges(T, c), this.node ? this.node.setOrigRanges(T, c) : c;
441
+ }
442
+ toString() {
443
+ let { context: { src: T }, node: c, range: i, value: r } = this;
444
+ if (r != null) return r;
445
+ let s = c ? T.slice(i.start, c.range.start) + String(c) : T.slice(i.start, i.end);
446
+ return e.Node.addStringTerminator(T, i.end, s);
447
+ }
448
+ }, g = class extends e.Node {
449
+ constructor() {
450
+ super(e.Type.COMMENT);
451
+ }
452
+ parse(T, c) {
453
+ this.context = T;
454
+ let i = this.parseComment(c);
455
+ return this.range = new e.Range(c, i), i;
456
+ }
457
+ };
458
+ function E(T) {
459
+ let c = T;
460
+ for (; c instanceof l; ) c = c.node;
461
+ if (!(c instanceof b)) return null;
462
+ let i = c.items.length, r = -1;
463
+ for (let p = i - 1; p >= 0; --p) {
464
+ let u = c.items[p];
465
+ if (u.type === e.Type.COMMENT) {
466
+ let { indent: h, lineStart: v } = u.context;
467
+ if (h > 0 && u.range.start >= v + h) break;
468
+ r = p;
469
+ } else if (u.type === e.Type.BLANK_LINE) r = p;
470
+ else break;
471
+ }
472
+ if (r === -1) return null;
473
+ let s = c.items.splice(r, i - r), o = s[0].range.start;
474
+ for (; c.range.end = o, c.valueRange && c.valueRange.end > o && (c.valueRange.end = o), c !== T; ) c = c.context.parent;
475
+ return s;
476
+ }
477
+ var b = class ut extends e.Node {
478
+ static nextContentHasIndent(c, i, r) {
479
+ let s = e.Node.endOfLine(c, i) + 1;
480
+ i = e.Node.endOfWhiteSpace(c, s);
481
+ let o = c[i];
482
+ return o ? i >= s + r ? !0 : o !== "#" && o !== `
483
+ ` ? !1 : ut.nextContentHasIndent(c, i, r) : !1;
484
+ }
485
+ constructor(c) {
486
+ super(c.type === e.Type.SEQ_ITEM ? e.Type.SEQ : e.Type.MAP);
487
+ for (let r = c.props.length - 1; r >= 0; --r) if (c.props[r].start < c.context.lineStart) {
488
+ this.props = c.props.slice(0, r + 1), c.props = c.props.slice(r + 1);
489
+ let s = c.props[0] || c.valueRange;
490
+ c.range.start = s.start;
491
+ break;
492
+ }
493
+ this.items = [c];
494
+ let i = E(c);
495
+ i && Array.prototype.push.apply(this.items, i);
496
+ }
497
+ get includesTrailingLines() {
498
+ return this.items.length > 0;
499
+ }
500
+ parse(c, i) {
501
+ this.context = c;
502
+ let { parseNode: r, src: s } = c, o = e.Node.startOfLine(s, i), p = this.items[0];
503
+ p.context.parent = this, this.valueRange = e.Range.copy(p.valueRange);
504
+ let u = p.range.start - p.context.lineStart, h = i;
505
+ h = e.Node.normalizeOffset(s, h);
506
+ let v = s[h], O = e.Node.endOfWhiteSpace(s, o) === h, C = !1;
507
+ for (; v; ) {
508
+ for (; v === `
509
+ ` || v === "#"; ) {
510
+ if (O && v === `
511
+ ` && !C) {
512
+ let B = new n();
513
+ if (h = B.parse({ src: s }, h), this.valueRange.end = h, h >= s.length) {
514
+ v = null;
515
+ break;
516
+ }
517
+ this.items.push(B), h -= 1;
518
+ } else if (v === "#") {
519
+ if (h < o + u && !ut.nextContentHasIndent(s, h, u)) return h;
520
+ let B = new g();
521
+ if (h = B.parse({ indent: u, lineStart: o, src: s }, h), this.items.push(B), this.valueRange.end = h, h >= s.length) {
522
+ v = null;
523
+ break;
524
+ }
525
+ }
526
+ if (o = h + 1, h = e.Node.endOfIndent(s, o), e.Node.atBlank(s, h)) {
527
+ let B = e.Node.endOfWhiteSpace(s, h), q = s[B];
528
+ (!q || q === `
529
+ ` || q === "#") && (h = B);
530
+ }
531
+ v = s[h], O = !0;
532
+ }
533
+ if (!v) break;
534
+ if (h !== o + u && (O || v !== ":")) {
535
+ if (h < o + u) {
536
+ o > i && (h = o);
537
+ break;
538
+ } else if (!this.error) {
539
+ let B = "All collection items must start at the same column";
540
+ this.error = new e.YAMLSyntaxError(this, B);
541
+ }
542
+ }
543
+ if (p.type === e.Type.SEQ_ITEM) {
544
+ if (v !== "-") {
545
+ o > i && (h = o);
546
+ break;
547
+ }
548
+ } else if (v === "-" && !this.error) {
549
+ let B = s[h + 1];
550
+ if (!B || B === `
551
+ ` || B === " " || B === " ") {
552
+ let q = "A collection cannot be both a mapping and a sequence";
553
+ this.error = new e.YAMLSyntaxError(this, q);
554
+ }
555
+ }
556
+ let _ = r({ atLineStart: O, inCollection: !0, indent: u, lineStart: o, parent: this }, h);
557
+ if (!_) return h;
558
+ if (this.items.push(_), this.valueRange.end = _.valueRange.end, h = e.Node.normalizeOffset(s, _.range.end), v = s[h], O = !1, C = _.includesTrailingLines, v) {
559
+ let B = h - 1, q = s[B];
560
+ for (; q === " " || q === " "; ) q = s[--B];
561
+ q === `
562
+ ` && (o = B + 1, O = !0);
563
+ }
564
+ let F = E(_);
565
+ F && Array.prototype.push.apply(this.items, F);
566
+ }
567
+ return h;
568
+ }
569
+ setOrigRanges(c, i) {
570
+ return i = super.setOrigRanges(c, i), this.items.forEach((r) => {
571
+ i = r.setOrigRanges(c, i);
572
+ }), i;
573
+ }
574
+ toString() {
575
+ let { context: { src: c }, items: i, range: r, value: s } = this;
576
+ if (s != null) return s;
577
+ let o = c.slice(r.start, i[0].range.start) + String(i[0]);
578
+ for (let p = 1; p < i.length; ++p) {
579
+ let u = i[p], { atLineStart: h, indent: v } = u.context;
580
+ if (h) for (let O = 0; O < v; ++O) o += " ";
581
+ o += String(u);
582
+ }
583
+ return e.Node.addStringTerminator(c, r.end, o);
584
+ }
585
+ }, L = class extends e.Node {
586
+ constructor() {
587
+ super(e.Type.DIRECTIVE), this.name = null;
588
+ }
589
+ get parameters() {
590
+ let T = this.rawValue;
591
+ return T ? T.trim().split(/[ \t]+/) : [];
592
+ }
593
+ parseName(T) {
594
+ let { src: c } = this.context, i = T, r = c[i];
595
+ for (; r && r !== `
596
+ ` && r !== " " && r !== " "; ) r = c[i += 1];
597
+ return this.name = c.slice(T, i), i;
598
+ }
599
+ parseParameters(T) {
600
+ let { src: c } = this.context, i = T, r = c[i];
601
+ for (; r && r !== `
602
+ ` && r !== "#"; ) r = c[i += 1];
603
+ return this.valueRange = new e.Range(T, i), i;
604
+ }
605
+ parse(T, c) {
606
+ this.context = T;
607
+ let i = this.parseName(c + 1);
608
+ return i = this.parseParameters(i), i = this.parseComment(i), this.range = new e.Range(c, i), i;
609
+ }
610
+ }, M = class ft extends e.Node {
611
+ static startCommentOrEndBlankLine(c, i) {
612
+ let r = e.Node.endOfWhiteSpace(c, i), s = c[r];
613
+ return s === "#" || s === `
614
+ ` ? r : i;
615
+ }
616
+ constructor() {
617
+ super(e.Type.DOCUMENT), this.directives = null, this.contents = null, this.directivesEndMarker = null, this.documentEndMarker = null;
618
+ }
619
+ parseDirectives(c) {
620
+ let { src: i } = this.context;
621
+ this.directives = [];
622
+ let r = !0, s = !1, o = c;
623
+ for (; !e.Node.atDocumentBoundary(i, o, e.Char.DIRECTIVES_END); ) switch (o = ft.startCommentOrEndBlankLine(i, o), i[o]) {
624
+ case `
625
+ `:
626
+ if (r) {
627
+ let p = new n();
628
+ o = p.parse({ src: i }, o), o < i.length && this.directives.push(p);
629
+ } else o += 1, r = !0;
630
+ break;
631
+ case "#":
632
+ {
633
+ let p = new g();
634
+ o = p.parse({ src: i }, o), this.directives.push(p), r = !1;
635
+ }
636
+ break;
637
+ case "%":
638
+ {
639
+ let p = new L();
640
+ o = p.parse({ parent: this, src: i }, o), this.directives.push(p), s = !0, r = !1;
641
+ }
642
+ break;
643
+ default:
644
+ return s ? this.error = new e.YAMLSemanticError(this, "Missing directives-end indicator line") : this.directives.length > 0 && (this.contents = this.directives, this.directives = []), o;
645
+ }
646
+ return i[o] ? (this.directivesEndMarker = new e.Range(o, o + 3), o + 3) : (s ? this.error = new e.YAMLSemanticError(this, "Missing directives-end indicator line") : this.directives.length > 0 && (this.contents = this.directives, this.directives = []), o);
647
+ }
648
+ parseContents(c) {
649
+ let { parseNode: i, src: r } = this.context;
650
+ this.contents || (this.contents = []);
651
+ let s = c;
652
+ for (; r[s - 1] === "-"; ) s -= 1;
653
+ let o = e.Node.endOfWhiteSpace(r, c), p = s === c;
654
+ for (this.valueRange = new e.Range(o); !e.Node.atDocumentBoundary(r, o, e.Char.DOCUMENT_END); ) {
655
+ switch (r[o]) {
656
+ case `
657
+ `:
658
+ if (p) {
659
+ let u = new n();
660
+ o = u.parse({ src: r }, o), o < r.length && this.contents.push(u);
661
+ } else o += 1, p = !0;
662
+ s = o;
663
+ break;
664
+ case "#":
665
+ {
666
+ let u = new g();
667
+ o = u.parse({ src: r }, o), this.contents.push(u), p = !1;
668
+ }
669
+ break;
670
+ default: {
671
+ let u = e.Node.endOfIndent(r, o), h = i({ atLineStart: p, indent: -1, inFlow: !1, inCollection: !1, lineStart: s, parent: this }, u);
672
+ if (!h) return this.valueRange.end = u;
673
+ this.contents.push(h), o = h.range.end, p = !1;
674
+ let v = E(h);
675
+ v && Array.prototype.push.apply(this.contents, v);
676
+ }
677
+ }
678
+ o = ft.startCommentOrEndBlankLine(r, o);
679
+ }
680
+ if (this.valueRange.end = o, r[o] && (this.documentEndMarker = new e.Range(o, o + 3), o += 3, r[o])) {
681
+ if (o = e.Node.endOfWhiteSpace(r, o), r[o] === "#") {
682
+ let u = new g();
683
+ o = u.parse({ src: r }, o), this.contents.push(u);
684
+ }
685
+ switch (r[o]) {
686
+ case `
687
+ `:
688
+ o += 1;
689
+ break;
690
+ case void 0:
691
+ break;
692
+ default:
693
+ this.error = new e.YAMLSyntaxError(this, "Document end marker line cannot have a non-comment suffix");
694
+ }
695
+ }
696
+ return o;
697
+ }
698
+ parse(c, i) {
699
+ c.root = this, this.context = c;
700
+ let { src: r } = c, s = r.charCodeAt(i) === 65279 ? i + 1 : i;
701
+ return s = this.parseDirectives(s), s = this.parseContents(s), s;
702
+ }
703
+ setOrigRanges(c, i) {
704
+ return i = super.setOrigRanges(c, i), this.directives.forEach((r) => {
705
+ i = r.setOrigRanges(c, i);
706
+ }), this.directivesEndMarker && (i = this.directivesEndMarker.setOrigRange(c, i)), this.contents.forEach((r) => {
707
+ i = r.setOrigRanges(c, i);
708
+ }), this.documentEndMarker && (i = this.documentEndMarker.setOrigRange(c, i)), i;
709
+ }
710
+ toString() {
711
+ let { contents: c, directives: i, value: r } = this;
712
+ if (r != null) return r;
713
+ let s = i.join("");
714
+ return c.length > 0 && ((i.length > 0 || c[0].type === e.Type.COMMENT) && (s += `---
715
+ `), s += c.join("")), s[s.length - 1] !== `
716
+ ` && (s += `
717
+ `), s;
718
+ }
719
+ }, I = class extends e.Node {
720
+ parse(T, c) {
721
+ this.context = T;
722
+ let { src: i } = T, r = e.Node.endOfIdentifier(i, c + 1);
723
+ return this.valueRange = new e.Range(c + 1, r), r = e.Node.endOfWhiteSpace(i, r), r = this.parseComment(r), r;
724
+ }
725
+ }, P = { CLIP: "CLIP", KEEP: "KEEP", STRIP: "STRIP" }, Q = class extends e.Node {
726
+ constructor(T, c) {
727
+ super(T, c), this.blockIndent = null, this.chomping = P.CLIP, this.header = null;
728
+ }
729
+ get includesTrailingLines() {
730
+ return this.chomping === P.KEEP;
731
+ }
732
+ get strValue() {
733
+ if (!this.valueRange || !this.context) return null;
734
+ let { start: T, end: c } = this.valueRange, { indent: i, src: r } = this.context;
735
+ if (this.valueRange.isEmpty()) return "";
736
+ let s = null, o = r[c - 1];
737
+ for (; o === `
738
+ ` || o === " " || o === " "; ) {
739
+ if (c -= 1, c <= T) {
740
+ if (this.chomping === P.KEEP) break;
741
+ return "";
742
+ }
743
+ o === `
744
+ ` && (s = c), o = r[c - 1];
745
+ }
746
+ let p = c + 1;
747
+ s && (this.chomping === P.KEEP ? (p = s, c = this.valueRange.end) : c = s);
748
+ let u = i + this.blockIndent, h = this.type === e.Type.BLOCK_FOLDED, v = !0, O = "", C = "", _ = !1;
749
+ for (let F = T; F < c; ++F) {
750
+ for (let q = 0; q < u && r[F] === " "; ++q) F += 1;
751
+ let B = r[F];
752
+ if (B === `
753
+ `) C === `
754
+ ` ? O += `
755
+ ` : C = `
756
+ `;
757
+ else {
758
+ let q = e.Node.endOfLine(r, F), oe = r.slice(F, q);
759
+ F = q, h && (B === " " || B === " ") && F < p ? (C === " " ? C = `
760
+ ` : !_ && !v && C === `
761
+ ` && (C = `
762
+
763
+ `), O += C + oe, C = q < c && r[q] || "", _ = !0) : (O += C + oe, C = h && F < p ? " " : `
764
+ `, _ = !1), v && oe !== "" && (v = !1);
765
+ }
766
+ }
767
+ return this.chomping === P.STRIP ? O : O + `
768
+ `;
769
+ }
770
+ parseBlockHeader(T) {
771
+ let { src: c } = this.context, i = T + 1, r = "";
772
+ for (; ; ) {
773
+ let s = c[i];
774
+ switch (s) {
775
+ case "-":
776
+ this.chomping = P.STRIP;
777
+ break;
778
+ case "+":
779
+ this.chomping = P.KEEP;
780
+ break;
781
+ case "0":
782
+ case "1":
783
+ case "2":
784
+ case "3":
785
+ case "4":
786
+ case "5":
787
+ case "6":
788
+ case "7":
789
+ case "8":
790
+ case "9":
791
+ r += s;
792
+ break;
793
+ default:
794
+ return this.blockIndent = Number(r) || null, this.header = new e.Range(T, i), i;
795
+ }
796
+ i += 1;
797
+ }
798
+ }
799
+ parseBlockValue(T) {
800
+ let { indent: c, src: i } = this.context, r = !!this.blockIndent, s = T, o = T, p = 1;
801
+ for (let u = i[s]; u === `
802
+ ` && (s += 1, !e.Node.atDocumentBoundary(i, s)); u = i[s]) {
803
+ let h = e.Node.endOfBlockIndent(i, c, s);
804
+ if (h === null) break;
805
+ let v = i[h], O = h - (s + c);
806
+ if (this.blockIndent) {
807
+ if (v && v !== `
808
+ ` && O < this.blockIndent) {
809
+ if (i[h] === "#") break;
810
+ if (!this.error) {
811
+ let C = `Block scalars must not be less indented than their ${r ? "explicit indentation indicator" : "first line"}`;
812
+ this.error = new e.YAMLSemanticError(this, C);
813
+ }
814
+ }
815
+ } else if (i[h] !== `
816
+ `) {
817
+ if (O < p) {
818
+ let C = "Block scalars with more-indented leading empty lines must use an explicit indentation indicator";
819
+ this.error = new e.YAMLSemanticError(this, C);
820
+ }
821
+ this.blockIndent = O;
822
+ } else O > p && (p = O);
823
+ i[h] === `
824
+ ` ? s = h : s = o = e.Node.endOfLine(i, h);
825
+ }
826
+ return this.chomping !== P.KEEP && (s = i[o] ? o + 1 : o), this.valueRange = new e.Range(T + 1, s), s;
827
+ }
828
+ parse(T, c) {
829
+ this.context = T;
830
+ let { src: i } = T, r = this.parseBlockHeader(c);
831
+ return r = e.Node.endOfWhiteSpace(i, r), r = this.parseComment(r), r = this.parseBlockValue(r), r;
832
+ }
833
+ setOrigRanges(T, c) {
834
+ return c = super.setOrigRanges(T, c), this.header ? this.header.setOrigRange(T, c) : c;
835
+ }
836
+ }, ne = class extends e.Node {
837
+ constructor(T, c) {
838
+ super(T, c), this.items = null;
839
+ }
840
+ prevNodeIsJsonLike(T = this.items.length) {
841
+ let c = this.items[T - 1];
842
+ return !!c && (c.jsonLike || c.type === e.Type.COMMENT && this.prevNodeIsJsonLike(T - 1));
843
+ }
844
+ parse(T, c) {
845
+ this.context = T;
846
+ let { parseNode: i, src: r } = T, { indent: s, lineStart: o } = T, p = r[c];
847
+ this.items = [{ char: p, offset: c }];
848
+ let u = e.Node.endOfWhiteSpace(r, c + 1);
849
+ for (p = r[u]; p && p !== "]" && p !== "}"; ) {
850
+ switch (p) {
851
+ case `
852
+ `:
853
+ {
854
+ o = u + 1;
855
+ let h = e.Node.endOfWhiteSpace(r, o);
856
+ if (r[h] === `
857
+ `) {
858
+ let v = new n();
859
+ o = v.parse({ src: r }, o), this.items.push(v);
860
+ }
861
+ if (u = e.Node.endOfIndent(r, o), u <= o + s && (p = r[u], u < o + s || p !== "]" && p !== "}")) {
862
+ let v = "Insufficient indentation in flow collection";
863
+ this.error = new e.YAMLSemanticError(this, v);
864
+ }
865
+ }
866
+ break;
867
+ case ",":
868
+ this.items.push({ char: p, offset: u }), u += 1;
869
+ break;
870
+ case "#":
871
+ {
872
+ let h = new g();
873
+ u = h.parse({ src: r }, u), this.items.push(h);
874
+ }
875
+ break;
876
+ case "?":
877
+ case ":": {
878
+ let h = r[u + 1];
879
+ if (h === `
880
+ ` || h === " " || h === " " || h === "," || p === ":" && this.prevNodeIsJsonLike()) {
881
+ this.items.push({ char: p, offset: u }), u += 1;
882
+ break;
883
+ }
884
+ }
885
+ default: {
886
+ let h = i({ atLineStart: !1, inCollection: !1, inFlow: !0, indent: -1, lineStart: o, parent: this }, u);
887
+ if (!h) return this.valueRange = new e.Range(c, u), u;
888
+ this.items.push(h), u = e.Node.normalizeOffset(r, h.range.end);
889
+ }
890
+ }
891
+ u = e.Node.endOfWhiteSpace(r, u), p = r[u];
892
+ }
893
+ return this.valueRange = new e.Range(c, u + 1), p && (this.items.push({ char: p, offset: u }), u = e.Node.endOfWhiteSpace(r, u + 1), u = this.parseComment(u)), u;
894
+ }
895
+ setOrigRanges(T, c) {
896
+ return c = super.setOrigRanges(T, c), this.items.forEach((i) => {
897
+ if (i instanceof e.Node) c = i.setOrigRanges(T, c);
898
+ else if (T.length === 0) i.origOffset = i.offset;
899
+ else {
900
+ let r = c;
901
+ for (; r < T.length && !(T[r] > i.offset); ) ++r;
902
+ i.origOffset = i.offset + r, c = r;
903
+ }
904
+ }), c;
905
+ }
906
+ toString() {
907
+ let { context: { src: T }, items: c, range: i, value: r } = this;
908
+ if (r != null) return r;
909
+ let s = c.filter((u) => u instanceof e.Node), o = "", p = i.start;
910
+ return s.forEach((u) => {
911
+ let h = T.slice(p, u.range.start);
912
+ p = u.range.end, o += h + String(u), o[o.length - 1] === `
913
+ ` && T[p - 1] !== `
914
+ ` && T[p] === `
915
+ ` && (p += 1);
916
+ }), o += T.slice(p, i.end), e.Node.addStringTerminator(T, i.end, o);
917
+ }
918
+ }, j = class Kt extends e.Node {
919
+ static endOfQuote(c, i) {
920
+ let r = c[i];
921
+ for (; r && r !== '"'; ) i += r === "\\" ? 2 : 1, r = c[i];
922
+ return i + 1;
923
+ }
924
+ get strValue() {
925
+ if (!this.valueRange || !this.context) return null;
926
+ let c = [], { start: i, end: r } = this.valueRange, { indent: s, src: o } = this.context;
927
+ o[r - 1] !== '"' && c.push(new e.YAMLSyntaxError(this, 'Missing closing "quote'));
928
+ let p = "";
929
+ for (let u = i + 1; u < r - 1; ++u) {
930
+ let h = o[u];
931
+ if (h === `
932
+ `) {
933
+ e.Node.atDocumentBoundary(o, u + 1) && c.push(new e.YAMLSemanticError(this, "Document boundary indicators are not allowed within string values"));
934
+ let { fold: v, offset: O, error: C } = e.Node.foldNewline(o, u, s);
935
+ p += v, u = O, C && c.push(new e.YAMLSemanticError(this, "Multi-line double-quoted string needs to be sufficiently indented"));
936
+ } else if (h === "\\") switch (u += 1, o[u]) {
937
+ case "0":
938
+ p += "\0";
939
+ break;
940
+ case "a":
941
+ p += "\x07";
942
+ break;
943
+ case "b":
944
+ p += "\b";
945
+ break;
946
+ case "e":
947
+ p += "\x1B";
948
+ break;
949
+ case "f":
950
+ p += "\f";
951
+ break;
952
+ case "n":
953
+ p += `
954
+ `;
955
+ break;
956
+ case "r":
957
+ p += "\r";
958
+ break;
959
+ case "t":
960
+ p += " ";
961
+ break;
962
+ case "v":
963
+ p += "\v";
964
+ break;
965
+ case "N":
966
+ p += "…";
967
+ break;
968
+ case "_":
969
+ p += " ";
970
+ break;
971
+ case "L":
972
+ p += "\u2028";
973
+ break;
974
+ case "P":
975
+ p += "\u2029";
976
+ break;
977
+ case " ":
978
+ p += " ";
979
+ break;
980
+ case '"':
981
+ p += '"';
982
+ break;
983
+ case "/":
984
+ p += "/";
985
+ break;
986
+ case "\\":
987
+ p += "\\";
988
+ break;
989
+ case " ":
990
+ p += " ";
991
+ break;
992
+ case "x":
993
+ p += this.parseCharCode(u + 1, 2, c), u += 2;
994
+ break;
995
+ case "u":
996
+ p += this.parseCharCode(u + 1, 4, c), u += 4;
997
+ break;
998
+ case "U":
999
+ p += this.parseCharCode(u + 1, 8, c), u += 8;
1000
+ break;
1001
+ case `
1002
+ `:
1003
+ for (; o[u + 1] === " " || o[u + 1] === " "; ) u += 1;
1004
+ break;
1005
+ default:
1006
+ c.push(new e.YAMLSyntaxError(this, `Invalid escape sequence ${o.substr(u - 1, 2)}`)), p += "\\" + o[u];
1007
+ }
1008
+ else if (h === " " || h === " ") {
1009
+ let v = u, O = o[u + 1];
1010
+ for (; O === " " || O === " "; ) u += 1, O = o[u + 1];
1011
+ O !== `
1012
+ ` && (p += u > v ? o.slice(v, u + 1) : h);
1013
+ } else p += h;
1014
+ }
1015
+ return c.length > 0 ? { errors: c, str: p } : p;
1016
+ }
1017
+ parseCharCode(c, i, r) {
1018
+ let { src: s } = this.context, o = s.substr(c, i), p = o.length === i && /^[0-9a-fA-F]+$/.test(o) ? parseInt(o, 16) : NaN;
1019
+ return isNaN(p) ? (r.push(new e.YAMLSyntaxError(this, `Invalid escape sequence ${s.substr(c - 2, i + 2)}`)), s.substr(c - 2, i + 2)) : String.fromCodePoint(p);
1020
+ }
1021
+ parse(c, i) {
1022
+ this.context = c;
1023
+ let { src: r } = c, s = Kt.endOfQuote(r, i + 1);
1024
+ return this.valueRange = new e.Range(i, s), s = e.Node.endOfWhiteSpace(r, s), s = this.parseComment(s), s;
1025
+ }
1026
+ }, G = class Ut extends e.Node {
1027
+ static endOfQuote(c, i) {
1028
+ let r = c[i];
1029
+ for (; r; ) if (r === "'") {
1030
+ if (c[i + 1] !== "'") break;
1031
+ r = c[i += 2];
1032
+ } else r = c[i += 1];
1033
+ return i + 1;
1034
+ }
1035
+ get strValue() {
1036
+ if (!this.valueRange || !this.context) return null;
1037
+ let c = [], { start: i, end: r } = this.valueRange, { indent: s, src: o } = this.context;
1038
+ o[r - 1] !== "'" && c.push(new e.YAMLSyntaxError(this, "Missing closing 'quote"));
1039
+ let p = "";
1040
+ for (let u = i + 1; u < r - 1; ++u) {
1041
+ let h = o[u];
1042
+ if (h === `
1043
+ `) {
1044
+ e.Node.atDocumentBoundary(o, u + 1) && c.push(new e.YAMLSemanticError(this, "Document boundary indicators are not allowed within string values"));
1045
+ let { fold: v, offset: O, error: C } = e.Node.foldNewline(o, u, s);
1046
+ p += v, u = O, C && c.push(new e.YAMLSemanticError(this, "Multi-line single-quoted string needs to be sufficiently indented"));
1047
+ } else if (h === "'") p += h, u += 1, o[u] !== "'" && c.push(new e.YAMLSyntaxError(this, "Unescaped single quote? This should not happen."));
1048
+ else if (h === " " || h === " ") {
1049
+ let v = u, O = o[u + 1];
1050
+ for (; O === " " || O === " "; ) u += 1, O = o[u + 1];
1051
+ O !== `
1052
+ ` && (p += u > v ? o.slice(v, u + 1) : h);
1053
+ } else p += h;
1054
+ }
1055
+ return c.length > 0 ? { errors: c, str: p } : p;
1056
+ }
1057
+ parse(c, i) {
1058
+ this.context = c;
1059
+ let { src: r } = c, s = Ut.endOfQuote(r, i + 1);
1060
+ return this.valueRange = new e.Range(i, s), s = e.Node.endOfWhiteSpace(r, s), s = this.parseComment(s), s;
1061
+ }
1062
+ };
1063
+ function U(T, c) {
1064
+ switch (T) {
1065
+ case e.Type.ALIAS:
1066
+ return new I(T, c);
1067
+ case e.Type.BLOCK_FOLDED:
1068
+ case e.Type.BLOCK_LITERAL:
1069
+ return new Q(T, c);
1070
+ case e.Type.FLOW_MAP:
1071
+ case e.Type.FLOW_SEQ:
1072
+ return new ne(T, c);
1073
+ case e.Type.MAP_KEY:
1074
+ case e.Type.MAP_VALUE:
1075
+ case e.Type.SEQ_ITEM:
1076
+ return new l(T, c);
1077
+ case e.Type.COMMENT:
1078
+ case e.Type.PLAIN:
1079
+ return new e.PlainValue(T, c);
1080
+ case e.Type.QUOTE_DOUBLE:
1081
+ return new j(T, c);
1082
+ case e.Type.QUOTE_SINGLE:
1083
+ return new G(T, c);
1084
+ default:
1085
+ return null;
1086
+ }
1087
+ }
1088
+ var Z = class He {
1089
+ static parseType(c, i, r) {
1090
+ switch (c[i]) {
1091
+ case "*":
1092
+ return e.Type.ALIAS;
1093
+ case ">":
1094
+ return e.Type.BLOCK_FOLDED;
1095
+ case "|":
1096
+ return e.Type.BLOCK_LITERAL;
1097
+ case "{":
1098
+ return e.Type.FLOW_MAP;
1099
+ case "[":
1100
+ return e.Type.FLOW_SEQ;
1101
+ case "?":
1102
+ return !r && e.Node.atBlank(c, i + 1, !0) ? e.Type.MAP_KEY : e.Type.PLAIN;
1103
+ case ":":
1104
+ return !r && e.Node.atBlank(c, i + 1, !0) ? e.Type.MAP_VALUE : e.Type.PLAIN;
1105
+ case "-":
1106
+ return !r && e.Node.atBlank(c, i + 1, !0) ? e.Type.SEQ_ITEM : e.Type.PLAIN;
1107
+ case '"':
1108
+ return e.Type.QUOTE_DOUBLE;
1109
+ case "'":
1110
+ return e.Type.QUOTE_SINGLE;
1111
+ default:
1112
+ return e.Type.PLAIN;
1113
+ }
1114
+ }
1115
+ constructor(c = {}, { atLineStart: i, inCollection: r, inFlow: s, indent: o, lineStart: p, parent: u } = {}) {
1116
+ e._defineProperty(this, "parseNode", (h, v) => {
1117
+ if (e.Node.atDocumentBoundary(this.src, v)) return null;
1118
+ let O = new He(this, h), { props: C, type: _, valueStart: F } = O.parseProps(v), B = U(_, C), q = B.parse(O, F);
1119
+ if (B.range = new e.Range(v, q), q <= v && (B.error = new Error("Node#parse consumed no characters"), B.error.parseEnd = q, B.error.source = B, B.range.end = v + 1), O.nodeStartsCollection(B)) {
1120
+ !B.error && !O.atLineStart && O.parent.type === e.Type.DOCUMENT && (B.error = new e.YAMLSyntaxError(B, "Block collection must not have preceding content here (e.g. directives-end indicator)"));
1121
+ let oe = new b(B);
1122
+ return q = oe.parse(new He(O), q), oe.range = new e.Range(v, q), oe;
1123
+ }
1124
+ return B;
1125
+ }), this.atLineStart = i ?? (c.atLineStart || !1), this.inCollection = r ?? (c.inCollection || !1), this.inFlow = s ?? (c.inFlow || !1), this.indent = o ?? c.indent, this.lineStart = p ?? c.lineStart, this.parent = u ?? (c.parent || {}), this.root = c.root, this.src = c.src;
1126
+ }
1127
+ nodeStartsCollection(c) {
1128
+ let { inCollection: i, inFlow: r, src: s } = this;
1129
+ if (i || r) return !1;
1130
+ if (c instanceof l) return !0;
1131
+ let o = c.range.end;
1132
+ return s[o] === `
1133
+ ` || s[o - 1] === `
1134
+ ` ? !1 : (o = e.Node.endOfWhiteSpace(s, o), s[o] === ":");
1135
+ }
1136
+ parseProps(c) {
1137
+ let { inFlow: i, parent: r, src: s } = this, o = [], p = !1;
1138
+ c = this.atLineStart ? e.Node.endOfIndent(s, c) : e.Node.endOfWhiteSpace(s, c);
1139
+ let u = s[c];
1140
+ for (; u === e.Char.ANCHOR || u === e.Char.COMMENT || u === e.Char.TAG || u === `
1141
+ `; ) {
1142
+ if (u === `
1143
+ `) {
1144
+ let v = c, O;
1145
+ do
1146
+ O = v + 1, v = e.Node.endOfIndent(s, O);
1147
+ while (s[v] === `
1148
+ `);
1149
+ let C = v - (O + this.indent), _ = r.type === e.Type.SEQ_ITEM && r.context.atLineStart;
1150
+ if (s[v] !== "#" && !e.Node.nextNodeIsIndented(s[v], C, !_)) break;
1151
+ this.atLineStart = !0, this.lineStart = O, p = !1, c = v;
1152
+ } else if (u === e.Char.COMMENT) {
1153
+ let v = e.Node.endOfLine(s, c + 1);
1154
+ o.push(new e.Range(c, v)), c = v;
1155
+ } else {
1156
+ let v = e.Node.endOfIdentifier(s, c + 1);
1157
+ u === e.Char.TAG && s[v] === "," && /^[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+,\d\d\d\d(-\d\d){0,2}\/\S/.test(s.slice(c + 1, v + 13)) && (v = e.Node.endOfIdentifier(s, v + 5)), o.push(new e.Range(c, v)), p = !0, c = e.Node.endOfWhiteSpace(s, v);
1158
+ }
1159
+ u = s[c];
1160
+ }
1161
+ p && u === ":" && e.Node.atBlank(s, c + 1, !0) && (c -= 1);
1162
+ let h = He.parseType(s, c, i);
1163
+ return { props: o, type: h, valueStart: c };
1164
+ }
1165
+ };
1166
+ function ae(T) {
1167
+ let c = [];
1168
+ T.indexOf("\r") !== -1 && (T = T.replace(/\r\n?/g, (s, o) => (s.length > 1 && c.push(o), `
1169
+ `)));
1170
+ let i = [], r = 0;
1171
+ do {
1172
+ let s = new M(), o = new Z({ src: T });
1173
+ r = s.parse(o, r), i.push(s);
1174
+ } while (r < T.length);
1175
+ return i.setOrigRanges = () => {
1176
+ if (c.length === 0) return !1;
1177
+ for (let o = 1; o < c.length; ++o) c[o] -= o;
1178
+ let s = 0;
1179
+ for (let o = 0; o < i.length; ++o) s = i[o].setOrigRanges(c, s);
1180
+ return c.splice(0, c.length), !0;
1181
+ }, i.toString = () => i.join(`...
1182
+ `), i;
1183
+ }
1184
+ t.parse = ae;
1185
+ }), Ke = Le((t) => {
1186
+ var e = Ie();
1187
+ function n(f, a, d) {
1188
+ return d ? `#${d.replace(/[\s\S]^/gm, `$&${a}#`)}
1189
+ ${a}${f}` : f;
1190
+ }
1191
+ function l(f, a, d) {
1192
+ return d ? d.indexOf(`
1193
+ `) === -1 ? `${f} #${d}` : `${f}
1194
+ ` + d.replace(/^/gm, `${a || ""}#`) : f;
1195
+ }
1196
+ var g = class {
1197
+ };
1198
+ function E(f, a, d) {
1199
+ if (Array.isArray(f)) return f.map((m, y) => E(m, String(y), d));
1200
+ if (f && typeof f.toJSON == "function") {
1201
+ let m = d && d.anchors && d.anchors.get(f);
1202
+ m && (d.onCreate = (S) => {
1203
+ m.res = S, delete d.onCreate;
1204
+ });
1205
+ let y = f.toJSON(a, d);
1206
+ return m && d.onCreate && d.onCreate(y), y;
1207
+ }
1208
+ return (!d || !d.keep) && typeof f == "bigint" ? Number(f) : f;
1209
+ }
1210
+ var b = class extends g {
1211
+ constructor(f) {
1212
+ super(), this.value = f;
1213
+ }
1214
+ toJSON(f, a) {
1215
+ return a && a.keep ? this.value : E(this.value, f, a);
1216
+ }
1217
+ toString() {
1218
+ return String(this.value);
1219
+ }
1220
+ };
1221
+ function L(f, a, d) {
1222
+ let m = d;
1223
+ for (let y = a.length - 1; y >= 0; --y) {
1224
+ let S = a[y];
1225
+ if (Number.isInteger(S) && S >= 0) {
1226
+ let N = [];
1227
+ N[S] = m, m = N;
1228
+ } else {
1229
+ let N = {};
1230
+ Object.defineProperty(N, S, { value: m, writable: !0, enumerable: !0, configurable: !0 }), m = N;
1231
+ }
1232
+ }
1233
+ return f.createNode(m, !1);
1234
+ }
1235
+ var M = (f) => f == null || typeof f == "object" && f[Symbol.iterator]().next().done, I = class Ce extends g {
1236
+ constructor(a) {
1237
+ super(), e._defineProperty(this, "items", []), this.schema = a;
1238
+ }
1239
+ addIn(a, d) {
1240
+ if (M(a)) this.add(d);
1241
+ else {
1242
+ let [m, ...y] = a, S = this.get(m, !0);
1243
+ if (S instanceof Ce) S.addIn(y, d);
1244
+ else if (S === void 0 && this.schema) this.set(m, L(this.schema, y, d));
1245
+ else throw new Error(`Expected YAML collection at ${m}. Remaining path: ${y}`);
1246
+ }
1247
+ }
1248
+ deleteIn([a, ...d]) {
1249
+ if (d.length === 0) return this.delete(a);
1250
+ let m = this.get(a, !0);
1251
+ if (m instanceof Ce) return m.deleteIn(d);
1252
+ throw new Error(`Expected YAML collection at ${a}. Remaining path: ${d}`);
1253
+ }
1254
+ getIn([a, ...d], m) {
1255
+ let y = this.get(a, !0);
1256
+ return d.length === 0 ? !m && y instanceof b ? y.value : y : y instanceof Ce ? y.getIn(d, m) : void 0;
1257
+ }
1258
+ hasAllNullValues() {
1259
+ return this.items.every((a) => {
1260
+ if (!a || a.type !== "PAIR") return !1;
1261
+ let d = a.value;
1262
+ return d == null || d instanceof b && d.value == null && !d.commentBefore && !d.comment && !d.tag;
1263
+ });
1264
+ }
1265
+ hasIn([a, ...d]) {
1266
+ if (d.length === 0) return this.has(a);
1267
+ let m = this.get(a, !0);
1268
+ return m instanceof Ce ? m.hasIn(d) : !1;
1269
+ }
1270
+ setIn([a, ...d], m) {
1271
+ if (d.length === 0) this.set(a, m);
1272
+ else {
1273
+ let y = this.get(a, !0);
1274
+ if (y instanceof Ce) y.setIn(d, m);
1275
+ else if (y === void 0 && this.schema) this.set(a, L(this.schema, d, m));
1276
+ else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${d}`);
1277
+ }
1278
+ }
1279
+ toJSON() {
1280
+ return null;
1281
+ }
1282
+ toString(a, { blockItem: d, flowChars: m, isMap: y, itemIndent: S }, N, A) {
1283
+ let { indent: x, indentStep: k, stringify: R } = a, W = this.type === e.Type.FLOW_MAP || this.type === e.Type.FLOW_SEQ || a.inFlow;
1284
+ W && (S += k);
1285
+ let re = y && this.hasAllNullValues();
1286
+ a = Object.assign({}, a, { allNullValues: re, indent: S, inFlow: W, type: null });
1287
+ let V = !1, ie = !1, J = this.items.reduce((ce, X, se) => {
1288
+ let ee;
1289
+ X && (!V && X.spaceBefore && ce.push({ type: "comment", str: "" }), X.commentBefore && X.commentBefore.match(/^.*$/gm).forEach((Hn) => {
1290
+ ce.push({ type: "comment", str: `#${Hn}` });
1291
+ }), X.comment && (ee = X.comment), W && (!V && X.spaceBefore || X.commentBefore || X.comment || X.key && (X.key.commentBefore || X.key.comment) || X.value && (X.value.commentBefore || X.value.comment)) && (ie = !0)), V = !1;
1292
+ let ue = R(X, a, () => ee = null, () => V = !0);
1293
+ return W && !ie && ue.includes(`
1294
+ `) && (ie = !0), W && se < this.items.length - 1 && (ue += ","), ue = l(ue, S, ee), V && (ee || W) && (V = !1), ce.push({ type: "item", str: ue }), ce;
1295
+ }, []), te;
1296
+ if (J.length === 0) te = m.start + m.end;
1297
+ else if (W) {
1298
+ let { start: ce, end: X } = m, se = J.map((ee) => ee.str);
1299
+ if (ie || se.reduce((ee, ue) => ee + ue.length + 2, 2) > Ce.maxFlowStringSingleLineLength) {
1300
+ te = ce;
1301
+ for (let ee of se) te += ee ? `
1302
+ ${k}${x}${ee}` : `
1303
+ `;
1304
+ te += `
1305
+ ${x}${X}`;
1306
+ } else te = `${ce} ${se.join(" ")} ${X}`;
1307
+ } else {
1308
+ let ce = J.map(d);
1309
+ te = ce.shift();
1310
+ for (let X of ce) te += X ? `
1311
+ ${x}${X}` : `
1312
+ `;
1313
+ }
1314
+ return this.comment ? (te += `
1315
+ ` + this.comment.replace(/^/gm, `${x}#`), N && N()) : V && A && A(), te;
1316
+ }
1317
+ };
1318
+ e._defineProperty(I, "maxFlowStringSingleLineLength", 60);
1319
+ function P(f) {
1320
+ let a = f instanceof b ? f.value : f;
1321
+ return a && typeof a == "string" && (a = Number(a)), Number.isInteger(a) && a >= 0 ? a : null;
1322
+ }
1323
+ var Q = class extends I {
1324
+ add(f) {
1325
+ this.items.push(f);
1326
+ }
1327
+ delete(f) {
1328
+ let a = P(f);
1329
+ return typeof a != "number" ? !1 : this.items.splice(a, 1).length > 0;
1330
+ }
1331
+ get(f, a) {
1332
+ let d = P(f);
1333
+ if (typeof d != "number") return;
1334
+ let m = this.items[d];
1335
+ return !a && m instanceof b ? m.value : m;
1336
+ }
1337
+ has(f) {
1338
+ let a = P(f);
1339
+ return typeof a == "number" && a < this.items.length;
1340
+ }
1341
+ set(f, a) {
1342
+ let d = P(f);
1343
+ if (typeof d != "number") throw new Error(`Expected a valid index, not ${f}.`);
1344
+ this.items[d] = a;
1345
+ }
1346
+ toJSON(f, a) {
1347
+ let d = [];
1348
+ a && a.onCreate && a.onCreate(d);
1349
+ let m = 0;
1350
+ for (let y of this.items) d.push(E(y, String(m++), a));
1351
+ return d;
1352
+ }
1353
+ toString(f, a, d) {
1354
+ return f ? super.toString(f, { blockItem: (m) => m.type === "comment" ? m.str : `- ${m.str}`, flowChars: { start: "[", end: "]" }, isMap: !1, itemIndent: (f.indent || "") + " " }, a, d) : JSON.stringify(this);
1355
+ }
1356
+ }, ne = (f, a, d) => a === null ? "" : typeof a != "object" ? String(a) : f instanceof g && d && d.doc ? f.toString({ anchors: /* @__PURE__ */ Object.create(null), doc: d.doc, indent: "", indentStep: d.indentStep, inFlow: !0, inStringifyKey: !0, stringify: d.stringify }) : JSON.stringify(a), j = class Vt extends g {
1357
+ constructor(a, d = null) {
1358
+ super(), this.key = a, this.value = d, this.type = Vt.Type.PAIR;
1359
+ }
1360
+ get commentBefore() {
1361
+ return this.key instanceof g ? this.key.commentBefore : void 0;
1362
+ }
1363
+ set commentBefore(a) {
1364
+ if (this.key == null && (this.key = new b(null)), this.key instanceof g) this.key.commentBefore = a;
1365
+ else {
1366
+ let d = "Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.";
1367
+ throw new Error(d);
1368
+ }
1369
+ }
1370
+ addToJSMap(a, d) {
1371
+ let m = E(this.key, "", a);
1372
+ if (d instanceof Map) {
1373
+ let y = E(this.value, m, a);
1374
+ d.set(m, y);
1375
+ } else if (d instanceof Set) d.add(m);
1376
+ else {
1377
+ let y = ne(this.key, m, a), S = E(this.value, y, a);
1378
+ y in d ? Object.defineProperty(d, y, { value: S, writable: !0, enumerable: !0, configurable: !0 }) : d[y] = S;
1379
+ }
1380
+ return d;
1381
+ }
1382
+ toJSON(a, d) {
1383
+ let m = d && d.mapAsMap ? /* @__PURE__ */ new Map() : {};
1384
+ return this.addToJSMap(d, m);
1385
+ }
1386
+ toString(a, d, m) {
1387
+ if (!a || !a.doc) return JSON.stringify(this);
1388
+ let { indent: y, indentSeq: S, simpleKeys: N } = a.doc.options, { key: A, value: x } = this, k = A instanceof g && A.comment;
1389
+ if (N) {
1390
+ if (k) throw new Error("With simple keys, key nodes cannot have comments");
1391
+ if (A instanceof I) {
1392
+ let ue = "With simple keys, collection cannot be used as a key value";
1393
+ throw new Error(ue);
1394
+ }
1395
+ }
1396
+ let R = !N && (!A || k || (A instanceof g ? A instanceof I || A.type === e.Type.BLOCK_FOLDED || A.type === e.Type.BLOCK_LITERAL : typeof A == "object")), { doc: W, indent: re, indentStep: V, stringify: ie } = a;
1397
+ a = Object.assign({}, a, { implicitKey: !R, indent: re + V });
1398
+ let J = !1, te = ie(A, a, () => k = null, () => J = !0);
1399
+ if (te = l(te, a.indent, k), !R && te.length > 1024) {
1400
+ if (N) throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
1401
+ R = !0;
1402
+ }
1403
+ if (a.allNullValues && !N) return this.comment ? (te = l(te, a.indent, this.comment), d && d()) : J && !k && m && m(), a.inFlow && !R ? te : `? ${te}`;
1404
+ te = R ? `? ${te}
1405
+ ${re}:` : `${te}:`, this.comment && (te = l(te, a.indent, this.comment), d && d());
1406
+ let ce = "", X = null;
1407
+ if (x instanceof g) {
1408
+ if (x.spaceBefore && (ce = `
1409
+ `), x.commentBefore) {
1410
+ let ue = x.commentBefore.replace(/^/gm, `${a.indent}#`);
1411
+ ce += `
1412
+ ${ue}`;
1413
+ }
1414
+ X = x.comment;
1415
+ } else x && typeof x == "object" && (x = W.schema.createNode(x, !0));
1416
+ a.implicitKey = !1, !R && !this.comment && x instanceof b && (a.indentAtStart = te.length + 1), J = !1, !S && y >= 2 && !a.inFlow && !R && x instanceof Q && x.type !== e.Type.FLOW_SEQ && !x.tag && !W.anchors.getName(x) && (a.indent = a.indent.substr(2));
1417
+ let se = ie(x, a, () => X = null, () => J = !0), ee = " ";
1418
+ return ce || this.comment ? ee = `${ce}
1419
+ ${a.indent}` : !R && x instanceof I ? (!(se[0] === "[" || se[0] === "{") || se.includes(`
1420
+ `)) && (ee = `
1421
+ ${a.indent}`) : se[0] === `
1422
+ ` && (ee = ""), J && !X && m && m(), l(te + ee + se, a.indent, X);
1423
+ }
1424
+ };
1425
+ e._defineProperty(j, "Type", { PAIR: "PAIR", MERGE_PAIR: "MERGE_PAIR" });
1426
+ var G = (f, a) => {
1427
+ if (f instanceof U) {
1428
+ let d = a.get(f.source);
1429
+ return d.count * d.aliasCount;
1430
+ } else if (f instanceof I) {
1431
+ let d = 0;
1432
+ for (let m of f.items) {
1433
+ let y = G(m, a);
1434
+ y > d && (d = y);
1435
+ }
1436
+ return d;
1437
+ } else if (f instanceof j) {
1438
+ let d = G(f.key, a), m = G(f.value, a);
1439
+ return Math.max(d, m);
1440
+ }
1441
+ return 1;
1442
+ }, U = class Qt extends g {
1443
+ static stringify({ range: a, source: d }, { anchors: m, doc: y, implicitKey: S, inStringifyKey: N }) {
1444
+ let A = Object.keys(m).find((k) => m[k] === d);
1445
+ if (!A && N && (A = y.anchors.getName(d) || y.anchors.newName()), A) return `*${A}${S ? " " : ""}`;
1446
+ let x = y.anchors.getName(d) ? "Alias node must be after source node" : "Source node not found for alias node";
1447
+ throw new Error(`${x} [${a}]`);
1448
+ }
1449
+ constructor(a) {
1450
+ super(), this.source = a, this.type = e.Type.ALIAS;
1451
+ }
1452
+ set tag(a) {
1453
+ throw new Error("Alias nodes cannot have tags");
1454
+ }
1455
+ toJSON(a, d) {
1456
+ if (!d) return E(this.source, a, d);
1457
+ let { anchors: m, maxAliasCount: y } = d, S = m.get(this.source);
1458
+ if (!S || S.res === void 0) {
1459
+ let N = "This should not happen: Alias anchor was not resolved?";
1460
+ throw this.cstNode ? new e.YAMLReferenceError(this.cstNode, N) : new ReferenceError(N);
1461
+ }
1462
+ if (y >= 0 && (S.count += 1, S.aliasCount === 0 && (S.aliasCount = G(this.source, m)), S.count * S.aliasCount > y)) {
1463
+ let N = "Excessive alias count indicates a resource exhaustion attack";
1464
+ throw this.cstNode ? new e.YAMLReferenceError(this.cstNode, N) : new ReferenceError(N);
1465
+ }
1466
+ return S.res;
1467
+ }
1468
+ toString(a) {
1469
+ return Qt.stringify(this, a);
1470
+ }
1471
+ };
1472
+ e._defineProperty(U, "default", !0);
1473
+ function Z(f, a) {
1474
+ let d = a instanceof b ? a.value : a;
1475
+ for (let m of f) if (m instanceof j && (m.key === a || m.key === d || m.key && m.key.value === d)) return m;
1476
+ }
1477
+ var ae = class extends I {
1478
+ add(f, a) {
1479
+ f ? f instanceof j || (f = new j(f.key || f, f.value)) : f = new j(f);
1480
+ let d = Z(this.items, f.key), m = this.schema && this.schema.sortMapEntries;
1481
+ if (d) if (a) d.value = f.value;
1482
+ else throw new Error(`Key ${f.key} already set`);
1483
+ else if (m) {
1484
+ let y = this.items.findIndex((S) => m(f, S) < 0);
1485
+ y === -1 ? this.items.push(f) : this.items.splice(y, 0, f);
1486
+ } else this.items.push(f);
1487
+ }
1488
+ delete(f) {
1489
+ let a = Z(this.items, f);
1490
+ return a ? this.items.splice(this.items.indexOf(a), 1).length > 0 : !1;
1491
+ }
1492
+ get(f, a) {
1493
+ let d = Z(this.items, f), m = d && d.value;
1494
+ return !a && m instanceof b ? m.value : m;
1495
+ }
1496
+ has(f) {
1497
+ return !!Z(this.items, f);
1498
+ }
1499
+ set(f, a) {
1500
+ this.add(new j(f, a), !0);
1501
+ }
1502
+ toJSON(f, a, d) {
1503
+ let m = d ? new d() : a && a.mapAsMap ? /* @__PURE__ */ new Map() : {};
1504
+ a && a.onCreate && a.onCreate(m);
1505
+ for (let y of this.items) y.addToJSMap(a, m);
1506
+ return m;
1507
+ }
1508
+ toString(f, a, d) {
1509
+ if (!f) return JSON.stringify(this);
1510
+ for (let m of this.items) if (!(m instanceof j)) throw new Error(`Map items must all be pairs; found ${JSON.stringify(m)} instead`);
1511
+ return super.toString(f, { blockItem: (m) => m.str, flowChars: { start: "{", end: "}" }, isMap: !0, itemIndent: f.indent || "" }, a, d);
1512
+ }
1513
+ }, T = "<<", c = class extends j {
1514
+ constructor(f) {
1515
+ if (f instanceof j) {
1516
+ let a = f.value;
1517
+ a instanceof Q || (a = new Q(), a.items.push(f.value), a.range = f.value.range), super(f.key, a), this.range = f.range;
1518
+ } else super(new b(T), new Q());
1519
+ this.type = j.Type.MERGE_PAIR;
1520
+ }
1521
+ addToJSMap(f, a) {
1522
+ for (let { source: d } of this.value.items) {
1523
+ if (!(d instanceof ae)) throw new Error("Merge sources must be maps");
1524
+ let m = d.toJSON(null, f, Map);
1525
+ for (let [y, S] of m) a instanceof Map ? a.has(y) || a.set(y, S) : a instanceof Set ? a.add(y) : Object.prototype.hasOwnProperty.call(a, y) || Object.defineProperty(a, y, { value: S, writable: !0, enumerable: !0, configurable: !0 });
1526
+ }
1527
+ return a;
1528
+ }
1529
+ toString(f, a) {
1530
+ let d = this.value;
1531
+ if (d.items.length > 1) return super.toString(f, a);
1532
+ this.value = d.items[0];
1533
+ let m = super.toString(f, a);
1534
+ return this.value = d, m;
1535
+ }
1536
+ }, i = { defaultType: e.Type.BLOCK_LITERAL, lineWidth: 76 }, r = { trueStr: "true", falseStr: "false" }, s = { asBigInt: !1 }, o = { nullStr: "null" }, p = { defaultType: e.Type.PLAIN, doubleQuoted: { jsonEncoding: !1, minMultiLineLength: 40 }, fold: { lineWidth: 80, minContentWidth: 20 } };
1537
+ function u(f, a, d) {
1538
+ for (let { format: m, test: y, resolve: S } of a) if (y) {
1539
+ let N = f.match(y);
1540
+ if (N) {
1541
+ let A = S.apply(null, N);
1542
+ return A instanceof b || (A = new b(A)), m && (A.format = m), A;
1543
+ }
1544
+ }
1545
+ return d && (f = d(f)), new b(f);
1546
+ }
1547
+ var h = "flow", v = "block", O = "quoted", C = (f, a) => {
1548
+ let d = f[a + 1];
1549
+ for (; d === " " || d === " "; ) {
1550
+ do
1551
+ d = f[a += 1];
1552
+ while (d && d !== `
1553
+ `);
1554
+ d = f[a + 1];
1555
+ }
1556
+ return a;
1557
+ };
1558
+ function _(f, a, d, { indentAtStart: m, lineWidth: y = 80, minContentWidth: S = 20, onFold: N, onOverflow: A }) {
1559
+ if (!y || y < 0) return f;
1560
+ let x = Math.max(1 + S, 1 + y - a.length);
1561
+ if (f.length <= x) return f;
1562
+ let k = [], R = {}, W = y - a.length;
1563
+ typeof m == "number" && (m > y - Math.max(2, S) ? k.push(0) : W = y - m);
1564
+ let re, V, ie = !1, J = -1, te = -1, ce = -1;
1565
+ d === v && (J = C(f, J), J !== -1 && (W = J + x));
1566
+ for (let se; se = f[J += 1]; ) {
1567
+ if (d === O && se === "\\") {
1568
+ switch (te = J, f[J + 1]) {
1569
+ case "x":
1570
+ J += 3;
1571
+ break;
1572
+ case "u":
1573
+ J += 5;
1574
+ break;
1575
+ case "U":
1576
+ J += 9;
1577
+ break;
1578
+ default:
1579
+ J += 1;
1580
+ }
1581
+ ce = J;
1582
+ }
1583
+ if (se === `
1584
+ `) d === v && (J = C(f, J)), W = J + x, re = void 0;
1585
+ else {
1586
+ if (se === " " && V && V !== " " && V !== `
1587
+ ` && V !== " ") {
1588
+ let ee = f[J + 1];
1589
+ ee && ee !== " " && ee !== `
1590
+ ` && ee !== " " && (re = J);
1591
+ }
1592
+ if (J >= W) if (re) k.push(re), W = re + x, re = void 0;
1593
+ else if (d === O) {
1594
+ for (; V === " " || V === " "; ) V = se, se = f[J += 1], ie = !0;
1595
+ let ee = J > ce + 1 ? J - 2 : te - 1;
1596
+ if (R[ee]) return f;
1597
+ k.push(ee), R[ee] = !0, W = ee + x, re = void 0;
1598
+ } else ie = !0;
1599
+ }
1600
+ V = se;
1601
+ }
1602
+ if (ie && A && A(), k.length === 0) return f;
1603
+ N && N();
1604
+ let X = f.slice(0, k[0]);
1605
+ for (let se = 0; se < k.length; ++se) {
1606
+ let ee = k[se], ue = k[se + 1] || f.length;
1607
+ ee === 0 ? X = `
1608
+ ${a}${f.slice(0, ue)}` : (d === O && R[ee] && (X += `${f[ee]}\\`), X += `
1609
+ ${a}${f.slice(ee + 1, ue)}`);
1610
+ }
1611
+ return X;
1612
+ }
1613
+ var F = ({ indentAtStart: f }) => f ? Object.assign({ indentAtStart: f }, p.fold) : p.fold, B = (f) => /^(%|---|\.\.\.)/m.test(f);
1614
+ function q(f, a, d) {
1615
+ if (!a || a < 0) return !1;
1616
+ let m = a - d, y = f.length;
1617
+ if (y <= m) return !1;
1618
+ for (let S = 0, N = 0; S < y; ++S) if (f[S] === `
1619
+ `) {
1620
+ if (S - N > m) return !0;
1621
+ if (N = S + 1, y - N <= m) return !1;
1622
+ }
1623
+ return !0;
1624
+ }
1625
+ function oe(f, a) {
1626
+ let { implicitKey: d } = a, { jsonEncoding: m, minMultiLineLength: y } = p.doubleQuoted, S = JSON.stringify(f);
1627
+ if (m) return S;
1628
+ let N = a.indent || (B(f) ? " " : ""), A = "", x = 0;
1629
+ for (let k = 0, R = S[k]; R; R = S[++k]) if (R === " " && S[k + 1] === "\\" && S[k + 2] === "n" && (A += S.slice(x, k) + "\\ ", k += 1, x = k, R = "\\"), R === "\\") switch (S[k + 1]) {
1630
+ case "u":
1631
+ {
1632
+ A += S.slice(x, k);
1633
+ let W = S.substr(k + 2, 4);
1634
+ switch (W) {
1635
+ case "0000":
1636
+ A += "\\0";
1637
+ break;
1638
+ case "0007":
1639
+ A += "\\a";
1640
+ break;
1641
+ case "000b":
1642
+ A += "\\v";
1643
+ break;
1644
+ case "001b":
1645
+ A += "\\e";
1646
+ break;
1647
+ case "0085":
1648
+ A += "\\N";
1649
+ break;
1650
+ case "00a0":
1651
+ A += "\\_";
1652
+ break;
1653
+ case "2028":
1654
+ A += "\\L";
1655
+ break;
1656
+ case "2029":
1657
+ A += "\\P";
1658
+ break;
1659
+ default:
1660
+ W.substr(0, 2) === "00" ? A += "\\x" + W.substr(2) : A += S.substr(k, 6);
1661
+ }
1662
+ k += 5, x = k + 1;
1663
+ }
1664
+ break;
1665
+ case "n":
1666
+ if (d || S[k + 2] === '"' || S.length < y) k += 1;
1667
+ else {
1668
+ for (A += S.slice(x, k) + `
1669
+
1670
+ `; S[k + 2] === "\\" && S[k + 3] === "n" && S[k + 4] !== '"'; ) A += `
1671
+ `, k += 2;
1672
+ A += N, S[k + 2] === " " && (A += "\\"), k += 1, x = k + 1;
1673
+ }
1674
+ break;
1675
+ default:
1676
+ k += 1;
1677
+ }
1678
+ return A = x ? A + S.slice(x) : S, d ? A : _(A, N, O, F(a));
1679
+ }
1680
+ function de(f, a) {
1681
+ if (a.implicitKey) {
1682
+ if (/\n/.test(f)) return oe(f, a);
1683
+ } else if (/[ \t]\n|\n[ \t]/.test(f)) return oe(f, a);
1684
+ let d = a.indent || (B(f) ? " " : ""), m = "'" + f.replace(/'/g, "''").replace(/\n+/g, `$&
1685
+ ${d}`) + "'";
1686
+ return a.implicitKey ? m : _(m, d, h, F(a));
1687
+ }
1688
+ function ve({ comment: f, type: a, value: d }, m, y, S) {
1689
+ if (/\n[\t ]+$/.test(d) || /^\s*$/.test(d)) return oe(d, m);
1690
+ let N = m.indent || (m.forceBlockIndent || B(d) ? " " : ""), A = N ? "2" : "1", x = a === e.Type.BLOCK_FOLDED ? !1 : a === e.Type.BLOCK_LITERAL ? !0 : !q(d, p.fold.lineWidth, N.length), k = x ? "|" : ">";
1691
+ if (!d) return k + `
1692
+ `;
1693
+ let R = "", W = "";
1694
+ if (d = d.replace(/[\n\t ]*$/, (V) => {
1695
+ let ie = V.indexOf(`
1696
+ `);
1697
+ return ie === -1 ? k += "-" : (d === V || ie !== V.length - 1) && (k += "+", S && S()), W = V.replace(/\n$/, ""), "";
1698
+ }).replace(/^[\n ]*/, (V) => {
1699
+ V.indexOf(" ") !== -1 && (k += A);
1700
+ let ie = V.match(/ +$/);
1701
+ return ie ? (R = V.slice(0, -ie[0].length), ie[0]) : (R = V, "");
1702
+ }), W && (W = W.replace(/\n+(?!\n|$)/g, `$&${N}`)), R && (R = R.replace(/\n+/g, `$&${N}`)), f && (k += " #" + f.replace(/ ?[\r\n]+/g, " "), y && y()), !d) return `${k}${A}
1703
+ ${N}${W}`;
1704
+ if (x) return d = d.replace(/\n+/g, `$&${N}`), `${k}
1705
+ ${N}${R}${d}${W}`;
1706
+ d = d.replace(/\n+/g, `
1707
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${N}`);
1708
+ let re = _(`${R}${d}${W}`, N, v, p.fold);
1709
+ return `${k}
1710
+ ${N}${re}`;
1711
+ }
1712
+ function w(f, a, d, m) {
1713
+ let { comment: y, type: S, value: N } = f, { actualString: A, implicitKey: x, indent: k, inFlow: R } = a;
1714
+ if (x && /[\n[\]{},]/.test(N) || R && /[[\]{},]/.test(N)) return oe(N, a);
1715
+ if (!N || /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(N)) return x || R || N.indexOf(`
1716
+ `) === -1 ? N.indexOf('"') !== -1 && N.indexOf("'") === -1 ? de(N, a) : oe(N, a) : ve(f, a, d, m);
1717
+ if (!x && !R && S !== e.Type.PLAIN && N.indexOf(`
1718
+ `) !== -1) return ve(f, a, d, m);
1719
+ if (k === "" && B(N)) return a.forceBlockIndent = !0, ve(f, a, d, m);
1720
+ let W = N.replace(/\n+/g, `$&
1721
+ ${k}`);
1722
+ if (A) {
1723
+ let { tags: V } = a.doc.schema;
1724
+ if (typeof u(W, V, V.scalarFallback).value != "string") return oe(N, a);
1725
+ }
1726
+ let re = x ? W : _(W, k, h, F(a));
1727
+ return y && !R && (re.indexOf(`
1728
+ `) !== -1 || y.indexOf(`
1729
+ `) !== -1) ? (d && d(), n(re, k, y)) : re;
1730
+ }
1731
+ function $(f, a, d, m) {
1732
+ let { defaultType: y } = p, { implicitKey: S, inFlow: N } = a, { type: A, value: x } = f;
1733
+ typeof x != "string" && (x = String(x), f = Object.assign({}, f, { value: x }));
1734
+ let k = (W) => {
1735
+ switch (W) {
1736
+ case e.Type.BLOCK_FOLDED:
1737
+ case e.Type.BLOCK_LITERAL:
1738
+ return ve(f, a, d, m);
1739
+ case e.Type.QUOTE_DOUBLE:
1740
+ return oe(x, a);
1741
+ case e.Type.QUOTE_SINGLE:
1742
+ return de(x, a);
1743
+ case e.Type.PLAIN:
1744
+ return w(f, a, d, m);
1745
+ default:
1746
+ return null;
1747
+ }
1748
+ };
1749
+ (A !== e.Type.QUOTE_DOUBLE && /[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(x) || (S || N) && (A === e.Type.BLOCK_FOLDED || A === e.Type.BLOCK_LITERAL)) && (A = e.Type.QUOTE_DOUBLE);
1750
+ let R = k(A);
1751
+ if (R === null && (R = k(y), R === null)) throw new Error(`Unsupported default string type ${y}`);
1752
+ return R;
1753
+ }
1754
+ function D({ format: f, minFractionDigits: a, tag: d, value: m }) {
1755
+ if (typeof m == "bigint") return String(m);
1756
+ if (!isFinite(m)) return isNaN(m) ? ".nan" : m < 0 ? "-.inf" : ".inf";
1757
+ let y = JSON.stringify(m);
1758
+ if (!f && a && (!d || d === "tag:yaml.org,2002:float") && /^\d/.test(y)) {
1759
+ let S = y.indexOf(".");
1760
+ S < 0 && (S = y.length, y += ".");
1761
+ let N = a - (y.length - S - 1);
1762
+ for (; N-- > 0; ) y += "0";
1763
+ }
1764
+ return y;
1765
+ }
1766
+ function Y(f, a) {
1767
+ let d, m;
1768
+ switch (a.type) {
1769
+ case e.Type.FLOW_MAP:
1770
+ d = "}", m = "flow map";
1771
+ break;
1772
+ case e.Type.FLOW_SEQ:
1773
+ d = "]", m = "flow sequence";
1774
+ break;
1775
+ default:
1776
+ f.push(new e.YAMLSemanticError(a, "Not a flow collection!?"));
1777
+ return;
1778
+ }
1779
+ let y;
1780
+ for (let S = a.items.length - 1; S >= 0; --S) {
1781
+ let N = a.items[S];
1782
+ if (!N || N.type !== e.Type.COMMENT) {
1783
+ y = N;
1784
+ break;
1785
+ }
1786
+ }
1787
+ if (y && y.char !== d) {
1788
+ let S = `Expected ${m} to end with ${d}`, N;
1789
+ typeof y.offset == "number" ? (N = new e.YAMLSemanticError(a, S), N.offset = y.offset + 1) : (N = new e.YAMLSemanticError(y, S), y.range && y.range.end && (N.offset = y.range.end - y.range.start)), f.push(N);
1790
+ }
1791
+ }
1792
+ function K(f, a) {
1793
+ let d = a.context.src[a.range.start - 1];
1794
+ if (d !== `
1795
+ ` && d !== " " && d !== " ") {
1796
+ let m = "Comments must be separated from other tokens by white space characters";
1797
+ f.push(new e.YAMLSemanticError(a, m));
1798
+ }
1799
+ }
1800
+ function H(f, a) {
1801
+ let d = String(a), m = d.substr(0, 8) + "..." + d.substr(-8);
1802
+ return new e.YAMLSemanticError(f, `The "${m}" key is too long`);
1803
+ }
1804
+ function he(f, a) {
1805
+ for (let { afterKey: d, before: m, comment: y } of a) {
1806
+ let S = f.items[m];
1807
+ S ? (d && S.value && (S = S.value), y === void 0 ? (d || !S.commentBefore) && (S.spaceBefore = !0) : S.commentBefore ? S.commentBefore += `
1808
+ ` + y : S.commentBefore = y) : y !== void 0 && (f.comment ? f.comment += `
1809
+ ` + y : f.comment = y);
1810
+ }
1811
+ }
1812
+ function we(f, a) {
1813
+ let d = a.strValue;
1814
+ return d ? typeof d == "string" ? d : (d.errors.forEach((m) => {
1815
+ m.source || (m.source = a), f.errors.push(m);
1816
+ }), d.str) : "";
1817
+ }
1818
+ function Oe(f, a) {
1819
+ let { handle: d, suffix: m } = a.tag, y = f.tagPrefixes.find((S) => S.handle === d);
1820
+ if (!y) {
1821
+ let S = f.getDefaults().tagPrefixes;
1822
+ if (S && (y = S.find((N) => N.handle === d)), !y) throw new e.YAMLSemanticError(a, `The ${d} tag handle is non-default and was not declared.`);
1823
+ }
1824
+ if (!m) throw new e.YAMLSemanticError(a, `The ${d} tag has no suffix.`);
1825
+ if (d === "!" && (f.version || f.options.version) === "1.0") {
1826
+ if (m[0] === "^") return f.warnings.push(new e.YAMLWarning(a, "YAML 1.0 ^ tag expansion is not supported")), m;
1827
+ if (/[:/]/.test(m)) {
1828
+ let S = m.match(/^([a-z0-9-]+)\/(.*)/i);
1829
+ return S ? `tag:${S[1]}.yaml.org,2002:${S[2]}` : `tag:${m}`;
1830
+ }
1831
+ }
1832
+ return y.prefix + decodeURIComponent(m);
1833
+ }
1834
+ function Se(f, a) {
1835
+ let { tag: d, type: m } = a, y = !1;
1836
+ if (d) {
1837
+ let { handle: S, suffix: N, verbatim: A } = d;
1838
+ if (A) {
1839
+ if (A !== "!" && A !== "!!") return A;
1840
+ let x = `Verbatim tags aren't resolved, so ${A} is invalid.`;
1841
+ f.errors.push(new e.YAMLSemanticError(a, x));
1842
+ } else if (S === "!" && !N) y = !0;
1843
+ else try {
1844
+ return Oe(f, a);
1845
+ } catch (x) {
1846
+ f.errors.push(x);
1847
+ }
1848
+ }
1849
+ switch (m) {
1850
+ case e.Type.BLOCK_FOLDED:
1851
+ case e.Type.BLOCK_LITERAL:
1852
+ case e.Type.QUOTE_DOUBLE:
1853
+ case e.Type.QUOTE_SINGLE:
1854
+ return e.defaultTags.STR;
1855
+ case e.Type.FLOW_MAP:
1856
+ case e.Type.MAP:
1857
+ return e.defaultTags.MAP;
1858
+ case e.Type.FLOW_SEQ:
1859
+ case e.Type.SEQ:
1860
+ return e.defaultTags.SEQ;
1861
+ case e.Type.PLAIN:
1862
+ return y ? e.defaultTags.STR : null;
1863
+ default:
1864
+ return null;
1865
+ }
1866
+ }
1867
+ function De(f, a, d) {
1868
+ let { tags: m } = f.schema, y = [];
1869
+ for (let N of m) if (N.tag === d) if (N.test) y.push(N);
1870
+ else {
1871
+ let A = N.resolve(f, a);
1872
+ return A instanceof I ? A : new b(A);
1873
+ }
1874
+ let S = we(f, a);
1875
+ return typeof S == "string" && y.length > 0 ? u(S, y, m.scalarFallback) : null;
1876
+ }
1877
+ function Qe({ type: f }) {
1878
+ switch (f) {
1879
+ case e.Type.FLOW_MAP:
1880
+ case e.Type.MAP:
1881
+ return e.defaultTags.MAP;
1882
+ case e.Type.FLOW_SEQ:
1883
+ case e.Type.SEQ:
1884
+ return e.defaultTags.SEQ;
1885
+ default:
1886
+ return e.defaultTags.STR;
1887
+ }
1888
+ }
1889
+ function Yn(f, a, d) {
1890
+ try {
1891
+ let m = De(f, a, d);
1892
+ if (m) return d && a.tag && (m.tag = d), m;
1893
+ } catch (m) {
1894
+ return m.source || (m.source = a), f.errors.push(m), null;
1895
+ }
1896
+ try {
1897
+ let m = Qe(a);
1898
+ if (!m) throw new Error(`The tag ${d} is unavailable`);
1899
+ let y = `The tag ${d} is unavailable, falling back to ${m}`;
1900
+ f.warnings.push(new e.YAMLWarning(a, y));
1901
+ let S = De(f, a, m);
1902
+ return S.tag = d, S;
1903
+ } catch (m) {
1904
+ let y = new e.YAMLReferenceError(a, m.message);
1905
+ return y.stack = m.stack, f.errors.push(y), null;
1906
+ }
1907
+ }
1908
+ var Bn = (f) => {
1909
+ if (!f) return !1;
1910
+ let { type: a } = f;
1911
+ return a === e.Type.MAP_KEY || a === e.Type.MAP_VALUE || a === e.Type.SEQ_ITEM;
1912
+ };
1913
+ function Dn(f, a) {
1914
+ let d = { before: [], after: [] }, m = !1, y = !1, S = Bn(a.context.parent) ? a.context.parent.props.concat(a.props) : a.props;
1915
+ for (let { start: N, end: A } of S) switch (a.context.src[N]) {
1916
+ case e.Char.COMMENT: {
1917
+ if (!a.commentHasRequiredWhitespace(N)) {
1918
+ let R = "Comments must be separated from other tokens by white space characters";
1919
+ f.push(new e.YAMLSemanticError(a, R));
1920
+ }
1921
+ let { header: x, valueRange: k } = a;
1922
+ (k && (N > k.start || x && N > x.start) ? d.after : d.before).push(a.context.src.slice(N + 1, A));
1923
+ break;
1924
+ }
1925
+ case e.Char.ANCHOR:
1926
+ if (m) {
1927
+ let x = "A node can have at most one anchor";
1928
+ f.push(new e.YAMLSemanticError(a, x));
1929
+ }
1930
+ m = !0;
1931
+ break;
1932
+ case e.Char.TAG:
1933
+ if (y) {
1934
+ let x = "A node can have at most one tag";
1935
+ f.push(new e.YAMLSemanticError(a, x));
1936
+ }
1937
+ y = !0;
1938
+ break;
1939
+ }
1940
+ return { comments: d, hasAnchor: m, hasTag: y };
1941
+ }
1942
+ function Fn(f, a) {
1943
+ let { anchors: d, errors: m, schema: y } = f;
1944
+ if (a.type === e.Type.ALIAS) {
1945
+ let N = a.rawValue, A = d.getNode(N);
1946
+ if (!A) {
1947
+ let k = `Aliased anchor not found: ${N}`;
1948
+ return m.push(new e.YAMLReferenceError(a, k)), null;
1949
+ }
1950
+ let x = new U(A);
1951
+ return d._cstAliases.push(x), x;
1952
+ }
1953
+ let S = Se(f, a);
1954
+ if (S) return Yn(f, a, S);
1955
+ if (a.type !== e.Type.PLAIN) {
1956
+ let N = `Failed to resolve ${a.type} node here`;
1957
+ return m.push(new e.YAMLSyntaxError(a, N)), null;
1958
+ }
1959
+ try {
1960
+ let N = we(f, a);
1961
+ return u(N, y.tags, y.tags.scalarFallback);
1962
+ } catch (N) {
1963
+ return N.source || (N.source = a), m.push(N), null;
1964
+ }
1965
+ }
1966
+ function Me(f, a) {
1967
+ if (!a) return null;
1968
+ a.error && f.errors.push(a.error);
1969
+ let { comments: d, hasAnchor: m, hasTag: y } = Dn(f.errors, a);
1970
+ if (m) {
1971
+ let { anchors: N } = f, A = a.anchor, x = N.getNode(A);
1972
+ x && (N.map[N.newName(A)] = x), N.map[A] = a;
1973
+ }
1974
+ if (a.type === e.Type.ALIAS && (m || y)) {
1975
+ let N = "An alias node must not specify any properties";
1976
+ f.errors.push(new e.YAMLSemanticError(a, N));
1977
+ }
1978
+ let S = Fn(f, a);
1979
+ if (S) {
1980
+ S.range = [a.range.start, a.range.end], f.options.keepCstNodes && (S.cstNode = a), f.options.keepNodeTypes && (S.type = a.type);
1981
+ let N = d.before.join(`
1982
+ `);
1983
+ N && (S.commentBefore = S.commentBefore ? `${S.commentBefore}
1984
+ ${N}` : N);
1985
+ let A = d.after.join(`
1986
+ `);
1987
+ A && (S.comment = S.comment ? `${S.comment}
1988
+ ${A}` : A);
1989
+ }
1990
+ return a.resolved = S;
1991
+ }
1992
+ function Wn(f, a) {
1993
+ if (a.type !== e.Type.MAP && a.type !== e.Type.FLOW_MAP) {
1994
+ let N = `A ${a.type} node cannot be resolved as a mapping`;
1995
+ return f.errors.push(new e.YAMLSyntaxError(a, N)), null;
1996
+ }
1997
+ let { comments: d, items: m } = a.type === e.Type.FLOW_MAP ? Un(f, a) : Kn(f, a), y = new ae();
1998
+ y.items = m, he(y, d);
1999
+ let S = !1;
2000
+ for (let N = 0; N < m.length; ++N) {
2001
+ let { key: A } = m[N];
2002
+ if (A instanceof I && (S = !0), f.schema.merge && A && A.value === T) {
2003
+ m[N] = new c(m[N]);
2004
+ let x = m[N].value.items, k = null;
2005
+ x.some((R) => {
2006
+ if (R instanceof U) {
2007
+ let { type: W } = R.source;
2008
+ return W === e.Type.MAP || W === e.Type.FLOW_MAP ? !1 : k = "Merge nodes aliases can only point to maps";
2009
+ }
2010
+ return k = "Merge nodes can only have Alias nodes as values";
2011
+ }), k && f.errors.push(new e.YAMLSemanticError(a, k));
2012
+ } else for (let x = N + 1; x < m.length; ++x) {
2013
+ let { key: k } = m[x];
2014
+ if (A === k || A && k && Object.prototype.hasOwnProperty.call(A, "value") && A.value === k.value) {
2015
+ let R = `Map keys must be unique; "${A}" is repeated`;
2016
+ f.errors.push(new e.YAMLSemanticError(a, R));
2017
+ break;
2018
+ }
2019
+ }
2020
+ }
2021
+ if (S && !f.options.mapAsMap) {
2022
+ let N = "Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";
2023
+ f.warnings.push(new e.YAMLWarning(a, N));
2024
+ }
2025
+ return a.resolved = y, y;
2026
+ }
2027
+ var jn = ({ context: { lineStart: f, node: a, src: d }, props: m }) => {
2028
+ if (m.length === 0) return !1;
2029
+ let { start: y } = m[0];
2030
+ if (a && y > a.valueRange.start || d[y] !== e.Char.COMMENT) return !1;
2031
+ for (let S = f; S < y; ++S) if (d[S] === `
2032
+ `) return !1;
2033
+ return !0;
2034
+ };
2035
+ function qn(f, a) {
2036
+ if (!jn(f)) return;
2037
+ let d = f.getPropValue(0, e.Char.COMMENT, !0), m = !1, y = a.value.commentBefore;
2038
+ if (y && y.startsWith(d)) a.value.commentBefore = y.substr(d.length + 1), m = !0;
2039
+ else {
2040
+ let S = a.value.comment;
2041
+ !f.node && S && S.startsWith(d) && (a.value.comment = S.substr(d.length + 1), m = !0);
2042
+ }
2043
+ m && (a.comment = d);
2044
+ }
2045
+ function Kn(f, a) {
2046
+ let d = [], m = [], y, S = null;
2047
+ for (let N = 0; N < a.items.length; ++N) {
2048
+ let A = a.items[N];
2049
+ switch (A.type) {
2050
+ case e.Type.BLANK_LINE:
2051
+ d.push({ afterKey: !!y, before: m.length });
2052
+ break;
2053
+ case e.Type.COMMENT:
2054
+ d.push({ afterKey: !!y, before: m.length, comment: A.comment });
2055
+ break;
2056
+ case e.Type.MAP_KEY:
2057
+ y !== void 0 && m.push(new j(y)), A.error && f.errors.push(A.error), y = Me(f, A.node), S = null;
2058
+ break;
2059
+ case e.Type.MAP_VALUE:
2060
+ {
2061
+ if (y === void 0 && (y = null), A.error && f.errors.push(A.error), !A.context.atLineStart && A.node && A.node.type === e.Type.MAP && !A.node.context.atLineStart) {
2062
+ let R = "Nested mappings are not allowed in compact mappings";
2063
+ f.errors.push(new e.YAMLSemanticError(A.node, R));
2064
+ }
2065
+ let x = A.node;
2066
+ if (!x && A.props.length > 0) {
2067
+ x = new e.PlainValue(e.Type.PLAIN, []), x.context = { parent: A, src: A.context.src };
2068
+ let R = A.range.start + 1;
2069
+ if (x.range = { start: R, end: R }, x.valueRange = { start: R, end: R }, typeof A.range.origStart == "number") {
2070
+ let W = A.range.origStart + 1;
2071
+ x.range.origStart = x.range.origEnd = W, x.valueRange.origStart = x.valueRange.origEnd = W;
2072
+ }
2073
+ }
2074
+ let k = new j(y, Me(f, x));
2075
+ qn(A, k), m.push(k), y && typeof S == "number" && A.range.start > S + 1024 && f.errors.push(H(a, y)), y = void 0, S = null;
2076
+ }
2077
+ break;
2078
+ default:
2079
+ y !== void 0 && m.push(new j(y)), y = Me(f, A), S = A.range.start, A.error && f.errors.push(A.error);
2080
+ e: for (let x = N + 1; ; ++x) {
2081
+ let k = a.items[x];
2082
+ switch (k && k.type) {
2083
+ case e.Type.BLANK_LINE:
2084
+ case e.Type.COMMENT:
2085
+ continue e;
2086
+ case e.Type.MAP_VALUE:
2087
+ break e;
2088
+ default: {
2089
+ let R = "Implicit map keys need to be followed by map values";
2090
+ f.errors.push(new e.YAMLSemanticError(A, R));
2091
+ break e;
2092
+ }
2093
+ }
2094
+ }
2095
+ if (A.valueRangeContainsNewline) {
2096
+ let x = "Implicit map keys need to be on a single line";
2097
+ f.errors.push(new e.YAMLSemanticError(A, x));
2098
+ }
2099
+ }
2100
+ }
2101
+ return y !== void 0 && m.push(new j(y)), { comments: d, items: m };
2102
+ }
2103
+ function Un(f, a) {
2104
+ let d = [], m = [], y, S = !1, N = "{";
2105
+ for (let A = 0; A < a.items.length; ++A) {
2106
+ let x = a.items[A];
2107
+ if (typeof x.char == "string") {
2108
+ let { char: k, offset: R } = x;
2109
+ if (k === "?" && y === void 0 && !S) {
2110
+ S = !0, N = ":";
2111
+ continue;
2112
+ }
2113
+ if (k === ":") {
2114
+ if (y === void 0 && (y = null), N === ":") {
2115
+ N = ",";
2116
+ continue;
2117
+ }
2118
+ } else if (S && (y === void 0 && k !== "," && (y = null), S = !1), y !== void 0 && (m.push(new j(y)), y = void 0, k === ",")) {
2119
+ N = ":";
2120
+ continue;
2121
+ }
2122
+ if (k === "}") {
2123
+ if (A === a.items.length - 1) continue;
2124
+ } else if (k === N) {
2125
+ N = ":";
2126
+ continue;
2127
+ }
2128
+ let W = `Flow map contains an unexpected ${k}`, re = new e.YAMLSyntaxError(a, W);
2129
+ re.offset = R, f.errors.push(re);
2130
+ } else x.type === e.Type.BLANK_LINE ? d.push({ afterKey: !!y, before: m.length }) : x.type === e.Type.COMMENT ? (K(f.errors, x), d.push({ afterKey: !!y, before: m.length, comment: x.comment })) : y === void 0 ? (N === "," && f.errors.push(new e.YAMLSemanticError(x, "Separator , missing in flow map")), y = Me(f, x)) : (N !== "," && f.errors.push(new e.YAMLSemanticError(x, "Indicator : missing in flow map entry")), m.push(new j(y, Me(f, x))), y = void 0, S = !1);
2131
+ }
2132
+ return Y(f.errors, a), y !== void 0 && m.push(new j(y)), { comments: d, items: m };
2133
+ }
2134
+ function Vn(f, a) {
2135
+ if (a.type !== e.Type.SEQ && a.type !== e.Type.FLOW_SEQ) {
2136
+ let S = `A ${a.type} node cannot be resolved as a sequence`;
2137
+ return f.errors.push(new e.YAMLSyntaxError(a, S)), null;
2138
+ }
2139
+ let { comments: d, items: m } = a.type === e.Type.FLOW_SEQ ? Jn(f, a) : Qn(f, a), y = new Q();
2140
+ if (y.items = m, he(y, d), !f.options.mapAsMap && m.some((S) => S instanceof j && S.key instanceof I)) {
2141
+ let S = "Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";
2142
+ f.warnings.push(new e.YAMLWarning(a, S));
2143
+ }
2144
+ return a.resolved = y, y;
2145
+ }
2146
+ function Qn(f, a) {
2147
+ let d = [], m = [];
2148
+ for (let y = 0; y < a.items.length; ++y) {
2149
+ let S = a.items[y];
2150
+ switch (S.type) {
2151
+ case e.Type.BLANK_LINE:
2152
+ d.push({ before: m.length });
2153
+ break;
2154
+ case e.Type.COMMENT:
2155
+ d.push({ comment: S.comment, before: m.length });
2156
+ break;
2157
+ case e.Type.SEQ_ITEM:
2158
+ if (S.error && f.errors.push(S.error), m.push(Me(f, S.node)), S.hasProps) {
2159
+ let N = "Sequence items cannot have tags or anchors before the - indicator";
2160
+ f.errors.push(new e.YAMLSemanticError(S, N));
2161
+ }
2162
+ break;
2163
+ default:
2164
+ S.error && f.errors.push(S.error), f.errors.push(new e.YAMLSyntaxError(S, `Unexpected ${S.type} node in sequence`));
2165
+ }
2166
+ }
2167
+ return { comments: d, items: m };
2168
+ }
2169
+ function Jn(f, a) {
2170
+ let d = [], m = [], y = !1, S, N = null, A = "[", x = null;
2171
+ for (let k = 0; k < a.items.length; ++k) {
2172
+ let R = a.items[k];
2173
+ if (typeof R.char == "string") {
2174
+ let { char: W, offset: re } = R;
2175
+ if (W !== ":" && (y || S !== void 0) && (y && S === void 0 && (S = A ? m.pop() : null), m.push(new j(S)), y = !1, S = void 0, N = null), W === A) A = null;
2176
+ else if (!A && W === "?") y = !0;
2177
+ else if (A !== "[" && W === ":" && S === void 0) {
2178
+ if (A === ",") {
2179
+ if (S = m.pop(), S instanceof j) {
2180
+ let V = "Chaining flow sequence pairs is invalid", ie = new e.YAMLSemanticError(a, V);
2181
+ ie.offset = re, f.errors.push(ie);
2182
+ }
2183
+ if (!y && typeof N == "number") {
2184
+ let V = R.range ? R.range.start : R.offset;
2185
+ V > N + 1024 && f.errors.push(H(a, S));
2186
+ let { src: ie } = x.context;
2187
+ for (let J = N; J < V; ++J) if (ie[J] === `
2188
+ `) {
2189
+ let te = "Implicit keys of flow sequence pairs need to be on a single line";
2190
+ f.errors.push(new e.YAMLSemanticError(x, te));
2191
+ break;
2192
+ }
2193
+ }
2194
+ } else S = null;
2195
+ N = null, y = !1, A = null;
2196
+ } else if (A === "[" || W !== "]" || k < a.items.length - 1) {
2197
+ let V = `Flow sequence contains an unexpected ${W}`, ie = new e.YAMLSyntaxError(a, V);
2198
+ ie.offset = re, f.errors.push(ie);
2199
+ }
2200
+ } else if (R.type === e.Type.BLANK_LINE) d.push({ before: m.length });
2201
+ else if (R.type === e.Type.COMMENT) K(f.errors, R), d.push({ comment: R.comment, before: m.length });
2202
+ else {
2203
+ if (A) {
2204
+ let re = `Expected a ${A} in flow sequence`;
2205
+ f.errors.push(new e.YAMLSemanticError(R, re));
2206
+ }
2207
+ let W = Me(f, R);
2208
+ S === void 0 ? (m.push(W), x = R) : (m.push(new j(S, W)), S = void 0), N = R.range.start, A = ",";
2209
+ }
2210
+ }
2211
+ return Y(f.errors, a), S !== void 0 && m.push(new j(S)), { comments: d, items: m };
2212
+ }
2213
+ t.Alias = U, t.Collection = I, t.Merge = c, t.Node = g, t.Pair = j, t.Scalar = b, t.YAMLMap = ae, t.YAMLSeq = Q, t.addComment = l, t.binaryOptions = i, t.boolOptions = r, t.findPair = Z, t.intOptions = s, t.isEmptyPath = M, t.nullOptions = o, t.resolveMap = Wn, t.resolveNode = Me, t.resolveSeq = Vn, t.resolveString = we, t.strOptions = p, t.stringifyNumber = D, t.stringifyString = $, t.toJSON = E;
2214
+ }), Jt = Le((t) => {
2215
+ var e = Ie(), n = Ke(), l = { identify: (u) => u instanceof Uint8Array, default: !1, tag: "tag:yaml.org,2002:binary", resolve: (u, h) => {
2216
+ let v = n.resolveString(u, h);
2217
+ if (typeof Buffer == "function") return Buffer.from(v, "base64");
2218
+ if (typeof atob == "function") {
2219
+ let O = atob(v.replace(/[\n\r]/g, "")), C = new Uint8Array(O.length);
2220
+ for (let _ = 0; _ < O.length; ++_) C[_] = O.charCodeAt(_);
2221
+ return C;
2222
+ } else {
2223
+ let O = "This environment does not support reading binary tags; either Buffer or atob is required";
2224
+ return u.errors.push(new e.YAMLReferenceError(h, O)), null;
2225
+ }
2226
+ }, options: n.binaryOptions, stringify: ({ comment: u, type: h, value: v }, O, C, _) => {
2227
+ let F;
2228
+ if (typeof Buffer == "function") F = v instanceof Buffer ? v.toString("base64") : Buffer.from(v.buffer).toString("base64");
2229
+ else if (typeof btoa == "function") {
2230
+ let B = "";
2231
+ for (let q = 0; q < v.length; ++q) B += String.fromCharCode(v[q]);
2232
+ F = btoa(B);
2233
+ } else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");
2234
+ if (h || (h = n.binaryOptions.defaultType), h === e.Type.QUOTE_DOUBLE) v = F;
2235
+ else {
2236
+ let { lineWidth: B } = n.binaryOptions, q = Math.ceil(F.length / B), oe = new Array(q);
2237
+ for (let de = 0, ve = 0; de < q; ++de, ve += B) oe[de] = F.substr(ve, B);
2238
+ v = oe.join(h === e.Type.BLOCK_LITERAL ? `
2239
+ ` : " ");
2240
+ }
2241
+ return n.stringifyString({ comment: u, type: h, value: v }, O, C, _);
2242
+ } };
2243
+ function g(u, h) {
2244
+ let v = n.resolveSeq(u, h);
2245
+ for (let O = 0; O < v.items.length; ++O) {
2246
+ let C = v.items[O];
2247
+ if (!(C instanceof n.Pair)) {
2248
+ if (C instanceof n.YAMLMap) {
2249
+ if (C.items.length > 1) {
2250
+ let F = "Each pair must have its own sequence indicator";
2251
+ throw new e.YAMLSemanticError(h, F);
2252
+ }
2253
+ let _ = C.items[0] || new n.Pair();
2254
+ C.commentBefore && (_.commentBefore = _.commentBefore ? `${C.commentBefore}
2255
+ ${_.commentBefore}` : C.commentBefore), C.comment && (_.comment = _.comment ? `${C.comment}
2256
+ ${_.comment}` : C.comment), C = _;
2257
+ }
2258
+ v.items[O] = C instanceof n.Pair ? C : new n.Pair(C);
2259
+ }
2260
+ }
2261
+ return v;
2262
+ }
2263
+ function E(u, h, v) {
2264
+ let O = new n.YAMLSeq(u);
2265
+ O.tag = "tag:yaml.org,2002:pairs";
2266
+ for (let C of h) {
2267
+ let _, F;
2268
+ if (Array.isArray(C)) if (C.length === 2) _ = C[0], F = C[1];
2269
+ else throw new TypeError(`Expected [key, value] tuple: ${C}`);
2270
+ else if (C && C instanceof Object) {
2271
+ let q = Object.keys(C);
2272
+ if (q.length === 1) _ = q[0], F = C[_];
2273
+ else throw new TypeError(`Expected { key: value } tuple: ${C}`);
2274
+ } else _ = C;
2275
+ let B = u.createPair(_, F, v);
2276
+ O.items.push(B);
2277
+ }
2278
+ return O;
2279
+ }
2280
+ var b = { default: !1, tag: "tag:yaml.org,2002:pairs", resolve: g, createNode: E }, L = class Ht extends n.YAMLSeq {
2281
+ constructor() {
2282
+ super(), e._defineProperty(this, "add", n.YAMLMap.prototype.add.bind(this)), e._defineProperty(this, "delete", n.YAMLMap.prototype.delete.bind(this)), e._defineProperty(this, "get", n.YAMLMap.prototype.get.bind(this)), e._defineProperty(this, "has", n.YAMLMap.prototype.has.bind(this)), e._defineProperty(this, "set", n.YAMLMap.prototype.set.bind(this)), this.tag = Ht.tag;
2283
+ }
2284
+ toJSON(h, v) {
2285
+ let O = /* @__PURE__ */ new Map();
2286
+ v && v.onCreate && v.onCreate(O);
2287
+ for (let C of this.items) {
2288
+ let _, F;
2289
+ if (C instanceof n.Pair ? (_ = n.toJSON(C.key, "", v), F = n.toJSON(C.value, _, v)) : _ = n.toJSON(C, "", v), O.has(_)) throw new Error("Ordered maps must not include duplicate keys");
2290
+ O.set(_, F);
2291
+ }
2292
+ return O;
2293
+ }
2294
+ };
2295
+ e._defineProperty(L, "tag", "tag:yaml.org,2002:omap");
2296
+ function M(u, h) {
2297
+ let v = g(u, h), O = [];
2298
+ for (let { key: C } of v.items) if (C instanceof n.Scalar) if (O.includes(C.value)) {
2299
+ let _ = "Ordered maps must not include duplicate keys";
2300
+ throw new e.YAMLSemanticError(h, _);
2301
+ } else O.push(C.value);
2302
+ return Object.assign(new L(), v);
2303
+ }
2304
+ function I(u, h, v) {
2305
+ let O = E(u, h, v), C = new L();
2306
+ return C.items = O.items, C;
2307
+ }
2308
+ var P = { identify: (u) => u instanceof Map, nodeClass: L, default: !1, tag: "tag:yaml.org,2002:omap", resolve: M, createNode: I }, Q = class Gt extends n.YAMLMap {
2309
+ constructor() {
2310
+ super(), this.tag = Gt.tag;
2311
+ }
2312
+ add(h) {
2313
+ let v = h instanceof n.Pair ? h : new n.Pair(h);
2314
+ n.findPair(this.items, v.key) || this.items.push(v);
2315
+ }
2316
+ get(h, v) {
2317
+ let O = n.findPair(this.items, h);
2318
+ return !v && O instanceof n.Pair ? O.key instanceof n.Scalar ? O.key.value : O.key : O;
2319
+ }
2320
+ set(h, v) {
2321
+ if (typeof v != "boolean") throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof v}`);
2322
+ let O = n.findPair(this.items, h);
2323
+ O && !v ? this.items.splice(this.items.indexOf(O), 1) : !O && v && this.items.push(new n.Pair(h));
2324
+ }
2325
+ toJSON(h, v) {
2326
+ return super.toJSON(h, v, Set);
2327
+ }
2328
+ toString(h, v, O) {
2329
+ if (!h) return JSON.stringify(this);
2330
+ if (this.hasAllNullValues()) return super.toString(h, v, O);
2331
+ throw new Error("Set items must all have null values");
2332
+ }
2333
+ };
2334
+ e._defineProperty(Q, "tag", "tag:yaml.org,2002:set");
2335
+ function ne(u, h) {
2336
+ let v = n.resolveMap(u, h);
2337
+ if (!v.hasAllNullValues()) throw new e.YAMLSemanticError(h, "Set items must all have null values");
2338
+ return Object.assign(new Q(), v);
2339
+ }
2340
+ function j(u, h, v) {
2341
+ let O = new Q();
2342
+ for (let C of h) O.items.push(u.createPair(C, null, v));
2343
+ return O;
2344
+ }
2345
+ var G = { identify: (u) => u instanceof Set, nodeClass: Q, default: !1, tag: "tag:yaml.org,2002:set", resolve: ne, createNode: j }, U = (u, h) => {
2346
+ let v = h.split(":").reduce((O, C) => O * 60 + Number(C), 0);
2347
+ return u === "-" ? -v : v;
2348
+ }, Z = ({ value: u }) => {
2349
+ if (isNaN(u) || !isFinite(u)) return n.stringifyNumber(u);
2350
+ let h = "";
2351
+ u < 0 && (h = "-", u = Math.abs(u));
2352
+ let v = [u % 60];
2353
+ return u < 60 ? v.unshift(0) : (u = Math.round((u - v[0]) / 60), v.unshift(u % 60), u >= 60 && (u = Math.round((u - v[0]) / 60), v.unshift(u))), h + v.map((O) => O < 10 ? "0" + String(O) : String(O)).join(":").replace(/000000\d*$/, "");
2354
+ }, ae = { identify: (u) => typeof u == "number", default: !0, tag: "tag:yaml.org,2002:int", format: "TIME", test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/, resolve: (u, h, v) => U(h, v.replace(/_/g, "")), stringify: Z }, T = { identify: (u) => typeof u == "number", default: !0, tag: "tag:yaml.org,2002:float", format: "TIME", test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/, resolve: (u, h, v) => U(h, v.replace(/_/g, "")), stringify: Z }, c = { identify: (u) => u instanceof Date, default: !0, 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: (u, h, v, O, C, _, F, B, q) => {
2355
+ B && (B = (B + "00").substr(1, 3));
2356
+ let oe = Date.UTC(h, v - 1, O, C || 0, _ || 0, F || 0, B || 0);
2357
+ if (q && q !== "Z") {
2358
+ let de = U(q[0], q.slice(1));
2359
+ Math.abs(de) < 30 && (de *= 60), oe -= 6e4 * de;
2360
+ }
2361
+ return new Date(oe);
2362
+ }, stringify: ({ value: u }) => u.toISOString().replace(/((T00:00)?:00)?\.000Z$/, "") };
2363
+ function i(u) {
2364
+ let h = {};
2365
+ return u ? typeof YAML_SILENCE_DEPRECATION_WARNINGS < "u" ? !YAML_SILENCE_DEPRECATION_WARNINGS : !h.YAML_SILENCE_DEPRECATION_WARNINGS : typeof YAML_SILENCE_WARNINGS < "u" ? !YAML_SILENCE_WARNINGS : !h.YAML_SILENCE_WARNINGS;
2366
+ }
2367
+ function r(u, h) {
2368
+ i(!1) && console.warn(h ? `${h}: ${u}` : u);
2369
+ }
2370
+ function s(u) {
2371
+ if (i(!0)) {
2372
+ let h = u.replace(/.*yaml[/\\]/i, "").replace(/\.js$/, "").replace(/\\/g, "/");
2373
+ r(`The endpoint 'yaml/${h}' will be removed in a future release.`, "DeprecationWarning");
2374
+ }
2375
+ }
2376
+ var o = {};
2377
+ function p(u, h) {
2378
+ if (!o[u] && i(!0)) {
2379
+ o[u] = !0;
2380
+ let v = `The option '${u}' will be removed in a future release`;
2381
+ v += h ? `, use '${h}' instead.` : ".", r(v, "DeprecationWarning");
2382
+ }
2383
+ }
2384
+ t.binary = l, t.floatTime = T, t.intTime = ae, t.omap = P, t.pairs = b, t.set = G, t.timestamp = c, t.warn = r, t.warnFileDeprecation = s, t.warnOptionDeprecation = p;
2385
+ }), Zt = Le((t) => {
2386
+ var e = Ie(), n = Ke(), l = Jt();
2387
+ function g(w, $, D) {
2388
+ let Y = new n.YAMLMap(w);
2389
+ if ($ instanceof Map) for (let [K, H] of $) Y.items.push(w.createPair(K, H, D));
2390
+ else if ($ && typeof $ == "object") for (let K of Object.keys($)) Y.items.push(w.createPair(K, $[K], D));
2391
+ return typeof w.sortMapEntries == "function" && Y.items.sort(w.sortMapEntries), Y;
2392
+ }
2393
+ var E = { createNode: g, default: !0, nodeClass: n.YAMLMap, tag: "tag:yaml.org,2002:map", resolve: n.resolveMap };
2394
+ function b(w, $, D) {
2395
+ let Y = new n.YAMLSeq(w);
2396
+ if ($ && $[Symbol.iterator]) for (let K of $) {
2397
+ let H = w.createNode(K, D.wrapScalars, null, D);
2398
+ Y.items.push(H);
2399
+ }
2400
+ return Y;
2401
+ }
2402
+ var L = { createNode: b, default: !0, nodeClass: n.YAMLSeq, tag: "tag:yaml.org,2002:seq", resolve: n.resolveSeq }, M = { identify: (w) => typeof w == "string", default: !0, tag: "tag:yaml.org,2002:str", resolve: n.resolveString, stringify(w, $, D, Y) {
2403
+ return $ = Object.assign({ actualString: !0 }, $), n.stringifyString(w, $, D, Y);
2404
+ }, options: n.strOptions }, I = [E, L, M], P = (w) => typeof w == "bigint" || Number.isInteger(w), Q = (w, $, D) => n.intOptions.asBigInt ? BigInt(w) : parseInt($, D);
2405
+ function ne(w, $, D) {
2406
+ let { value: Y } = w;
2407
+ return P(Y) && Y >= 0 ? D + Y.toString($) : n.stringifyNumber(w);
2408
+ }
2409
+ var j = { identify: (w) => w == null, createNode: (w, $, D) => D.wrapScalars ? new n.Scalar(null) : null, default: !0, tag: "tag:yaml.org,2002:null", test: /^(?:~|[Nn]ull|NULL)?$/, resolve: () => null, options: n.nullOptions, stringify: () => n.nullOptions.nullStr }, G = { identify: (w) => typeof w == "boolean", default: !0, tag: "tag:yaml.org,2002:bool", test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/, resolve: (w) => w[0] === "t" || w[0] === "T", options: n.boolOptions, stringify: ({ value: w }) => w ? n.boolOptions.trueStr : n.boolOptions.falseStr }, U = { identify: (w) => P(w) && w >= 0, default: !0, tag: "tag:yaml.org,2002:int", format: "OCT", test: /^0o([0-7]+)$/, resolve: (w, $) => Q(w, $, 8), options: n.intOptions, stringify: (w) => ne(w, 8, "0o") }, Z = { identify: P, default: !0, tag: "tag:yaml.org,2002:int", test: /^[-+]?[0-9]+$/, resolve: (w) => Q(w, w, 10), options: n.intOptions, stringify: n.stringifyNumber }, ae = { identify: (w) => P(w) && w >= 0, default: !0, tag: "tag:yaml.org,2002:int", format: "HEX", test: /^0x([0-9a-fA-F]+)$/, resolve: (w, $) => Q(w, $, 16), options: n.intOptions, stringify: (w) => ne(w, 16, "0x") }, T = { identify: (w) => typeof w == "number", default: !0, tag: "tag:yaml.org,2002:float", test: /^(?:[-+]?\.inf|(\.nan))$/i, resolve: (w, $) => $ ? NaN : w[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, stringify: n.stringifyNumber }, c = { identify: (w) => typeof w == "number", default: !0, tag: "tag:yaml.org,2002:float", format: "EXP", test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/, resolve: (w) => parseFloat(w), stringify: ({ value: w }) => Number(w).toExponential() }, i = { identify: (w) => typeof w == "number", default: !0, tag: "tag:yaml.org,2002:float", test: /^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/, resolve(w, $, D) {
2410
+ let Y = $ || D, K = new n.Scalar(parseFloat(w));
2411
+ return Y && Y[Y.length - 1] === "0" && (K.minFractionDigits = Y.length), K;
2412
+ }, stringify: n.stringifyNumber }, r = I.concat([j, G, U, Z, ae, T, c, i]), s = (w) => typeof w == "bigint" || Number.isInteger(w), o = ({ value: w }) => JSON.stringify(w), p = [E, L, { identify: (w) => typeof w == "string", default: !0, tag: "tag:yaml.org,2002:str", resolve: n.resolveString, stringify: o }, { identify: (w) => w == null, createNode: (w, $, D) => D.wrapScalars ? new n.Scalar(null) : null, default: !0, tag: "tag:yaml.org,2002:null", test: /^null$/, resolve: () => null, stringify: o }, { identify: (w) => typeof w == "boolean", default: !0, tag: "tag:yaml.org,2002:bool", test: /^true|false$/, resolve: (w) => w === "true", stringify: o }, { identify: s, default: !0, tag: "tag:yaml.org,2002:int", test: /^-?(?:0|[1-9][0-9]*)$/, resolve: (w) => n.intOptions.asBigInt ? BigInt(w) : parseInt(w, 10), stringify: ({ value: w }) => s(w) ? w.toString() : JSON.stringify(w) }, { identify: (w) => typeof w == "number", default: !0, tag: "tag:yaml.org,2002:float", test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/, resolve: (w) => parseFloat(w), stringify: o }];
2413
+ p.scalarFallback = (w) => {
2414
+ throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(w)}`);
2415
+ };
2416
+ var u = ({ value: w }) => w ? n.boolOptions.trueStr : n.boolOptions.falseStr, h = (w) => typeof w == "bigint" || Number.isInteger(w);
2417
+ function v(w, $, D) {
2418
+ let Y = $.replace(/_/g, "");
2419
+ if (n.intOptions.asBigInt) {
2420
+ switch (D) {
2421
+ case 2:
2422
+ Y = `0b${Y}`;
2423
+ break;
2424
+ case 8:
2425
+ Y = `0o${Y}`;
2426
+ break;
2427
+ case 16:
2428
+ Y = `0x${Y}`;
2429
+ break;
2430
+ }
2431
+ let H = BigInt(Y);
2432
+ return w === "-" ? BigInt(-1) * H : H;
2433
+ }
2434
+ let K = parseInt(Y, D);
2435
+ return w === "-" ? -1 * K : K;
2436
+ }
2437
+ function O(w, $, D) {
2438
+ let { value: Y } = w;
2439
+ if (h(Y)) {
2440
+ let K = Y.toString($);
2441
+ return Y < 0 ? "-" + D + K.substr(1) : D + K;
2442
+ }
2443
+ return n.stringifyNumber(w);
2444
+ }
2445
+ var C = I.concat([{ identify: (w) => w == null, createNode: (w, $, D) => D.wrapScalars ? new n.Scalar(null) : null, default: !0, tag: "tag:yaml.org,2002:null", test: /^(?:~|[Nn]ull|NULL)?$/, resolve: () => null, options: n.nullOptions, stringify: () => n.nullOptions.nullStr }, { identify: (w) => typeof w == "boolean", default: !0, tag: "tag:yaml.org,2002:bool", test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/, resolve: () => !0, options: n.boolOptions, stringify: u }, { identify: (w) => typeof w == "boolean", default: !0, tag: "tag:yaml.org,2002:bool", test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i, resolve: () => !1, options: n.boolOptions, stringify: u }, { identify: h, default: !0, tag: "tag:yaml.org,2002:int", format: "BIN", test: /^([-+]?)0b([0-1_]+)$/, resolve: (w, $, D) => v($, D, 2), stringify: (w) => O(w, 2, "0b") }, { identify: h, default: !0, tag: "tag:yaml.org,2002:int", format: "OCT", test: /^([-+]?)0([0-7_]+)$/, resolve: (w, $, D) => v($, D, 8), stringify: (w) => O(w, 8, "0") }, { identify: h, default: !0, tag: "tag:yaml.org,2002:int", test: /^([-+]?)([0-9][0-9_]*)$/, resolve: (w, $, D) => v($, D, 10), stringify: n.stringifyNumber }, { identify: h, default: !0, tag: "tag:yaml.org,2002:int", format: "HEX", test: /^([-+]?)0x([0-9a-fA-F_]+)$/, resolve: (w, $, D) => v($, D, 16), stringify: (w) => O(w, 16, "0x") }, { identify: (w) => typeof w == "number", default: !0, tag: "tag:yaml.org,2002:float", test: /^(?:[-+]?\.inf|(\.nan))$/i, resolve: (w, $) => $ ? NaN : w[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, stringify: n.stringifyNumber }, { identify: (w) => typeof w == "number", default: !0, tag: "tag:yaml.org,2002:float", format: "EXP", test: /^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/, resolve: (w) => parseFloat(w.replace(/_/g, "")), stringify: ({ value: w }) => Number(w).toExponential() }, { identify: (w) => typeof w == "number", default: !0, tag: "tag:yaml.org,2002:float", test: /^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/, resolve(w, $) {
2446
+ let D = new n.Scalar(parseFloat(w.replace(/_/g, "")));
2447
+ if ($) {
2448
+ let Y = $.replace(/_/g, "");
2449
+ Y[Y.length - 1] === "0" && (D.minFractionDigits = Y.length);
2450
+ }
2451
+ return D;
2452
+ }, stringify: n.stringifyNumber }], l.binary, l.omap, l.pairs, l.set, l.intTime, l.floatTime, l.timestamp), _ = { core: r, failsafe: I, json: p, yaml11: C }, F = { binary: l.binary, bool: G, float: i, floatExp: c, floatNaN: T, floatTime: l.floatTime, int: Z, intHex: ae, intOct: U, intTime: l.intTime, map: E, null: j, omap: l.omap, pairs: l.pairs, seq: L, set: l.set, timestamp: l.timestamp };
2453
+ function B(w, $, D) {
2454
+ if ($) {
2455
+ let Y = D.filter((H) => H.tag === $), K = Y.find((H) => !H.format) || Y[0];
2456
+ if (!K) throw new Error(`Tag ${$} not found`);
2457
+ return K;
2458
+ }
2459
+ return D.find((Y) => (Y.identify && Y.identify(w) || Y.class && w instanceof Y.class) && !Y.format);
2460
+ }
2461
+ function q(w, $, D) {
2462
+ if (w instanceof n.Node) return w;
2463
+ let { defaultPrefix: Y, onTagObj: K, prevObjects: H, schema: he, wrapScalars: we } = D;
2464
+ $ && $.startsWith("!!") && ($ = Y + $.slice(2));
2465
+ let Oe = B(w, $, he.tags);
2466
+ if (!Oe) {
2467
+ if (typeof w.toJSON == "function" && (w = w.toJSON()), !w || typeof w != "object") return we ? new n.Scalar(w) : w;
2468
+ Oe = w instanceof Map ? E : w[Symbol.iterator] ? L : E;
2469
+ }
2470
+ K && (K(Oe), delete D.onTagObj);
2471
+ let Se = { value: void 0, node: void 0 };
2472
+ if (w && typeof w == "object" && H) {
2473
+ let De = H.get(w);
2474
+ if (De) {
2475
+ let Qe = new n.Alias(De);
2476
+ return D.aliasNodes.push(Qe), Qe;
2477
+ }
2478
+ Se.value = w, H.set(w, Se);
2479
+ }
2480
+ return Se.node = Oe.createNode ? Oe.createNode(D.schema, w, D) : we ? new n.Scalar(w) : w, $ && Se.node instanceof n.Node && (Se.node.tag = $), Se.node;
2481
+ }
2482
+ function oe(w, $, D, Y) {
2483
+ let K = w[Y.replace(/\W/g, "")];
2484
+ if (!K) {
2485
+ let H = Object.keys(w).map((he) => JSON.stringify(he)).join(", ");
2486
+ throw new Error(`Unknown schema "${Y}"; use one of ${H}`);
2487
+ }
2488
+ if (Array.isArray(D)) for (let H of D) K = K.concat(H);
2489
+ else typeof D == "function" && (K = D(K.slice()));
2490
+ for (let H = 0; H < K.length; ++H) {
2491
+ let he = K[H];
2492
+ if (typeof he == "string") {
2493
+ let we = $[he];
2494
+ if (!we) {
2495
+ let Oe = Object.keys($).map((Se) => JSON.stringify(Se)).join(", ");
2496
+ throw new Error(`Unknown custom tag "${he}"; use one of ${Oe}`);
2497
+ }
2498
+ K[H] = we;
2499
+ }
2500
+ }
2501
+ return K;
2502
+ }
2503
+ var de = (w, $) => w.key < $.key ? -1 : w.key > $.key ? 1 : 0, ve = class Xt {
2504
+ constructor({ customTags: $, merge: D, schema: Y, sortMapEntries: K, tags: H }) {
2505
+ this.merge = !!D, this.name = Y, this.sortMapEntries = K === !0 ? de : K || null, !$ && H && l.warnOptionDeprecation("tags", "customTags"), this.tags = oe(_, F, $ || H, Y);
2506
+ }
2507
+ createNode($, D, Y, K) {
2508
+ let H = { defaultPrefix: Xt.defaultPrefix, schema: this, wrapScalars: D }, he = K ? Object.assign(K, H) : H;
2509
+ return q($, Y, he);
2510
+ }
2511
+ createPair($, D, Y) {
2512
+ Y || (Y = { wrapScalars: !0 });
2513
+ let K = this.createNode($, Y.wrapScalars, null, Y), H = this.createNode(D, Y.wrapScalars, null, Y);
2514
+ return new n.Pair(K, H);
2515
+ }
2516
+ };
2517
+ e._defineProperty(ve, "defaultPrefix", e.defaultTagPrefix), e._defineProperty(ve, "defaultTags", e.defaultTags), t.Schema = ve;
2518
+ }), sr = Le((t) => {
2519
+ var e = Ie(), n = Ke(), l = Zt(), g = { anchorPrefix: "a", customTags: null, indent: 2, indentSeq: !0, keepCstNodes: !1, keepNodeTypes: !0, keepBlobsInJSON: !0, mapAsMap: !1, maxAliasCount: 100, prettyErrors: !1, simpleKeys: !1, version: "1.2" }, E = { get binary() {
2520
+ return n.binaryOptions;
2521
+ }, set binary(i) {
2522
+ Object.assign(n.binaryOptions, i);
2523
+ }, get bool() {
2524
+ return n.boolOptions;
2525
+ }, set bool(i) {
2526
+ Object.assign(n.boolOptions, i);
2527
+ }, get int() {
2528
+ return n.intOptions;
2529
+ }, set int(i) {
2530
+ Object.assign(n.intOptions, i);
2531
+ }, get null() {
2532
+ return n.nullOptions;
2533
+ }, set null(i) {
2534
+ Object.assign(n.nullOptions, i);
2535
+ }, get str() {
2536
+ return n.strOptions;
2537
+ }, set str(i) {
2538
+ Object.assign(n.strOptions, i);
2539
+ } }, b = { "1.0": { schema: "yaml-1.1", merge: !0, tagPrefixes: [{ handle: "!", prefix: e.defaultTagPrefix }, { handle: "!!", prefix: "tag:private.yaml.org,2002:" }] }, 1.1: { schema: "yaml-1.1", merge: !0, tagPrefixes: [{ handle: "!", prefix: "!" }, { handle: "!!", prefix: e.defaultTagPrefix }] }, 1.2: { schema: "core", merge: !1, tagPrefixes: [{ handle: "!", prefix: "!" }, { handle: "!!", prefix: e.defaultTagPrefix }] } };
2540
+ function L(i, r) {
2541
+ if ((i.version || i.options.version) === "1.0") {
2542
+ let p = r.match(/^tag:private\.yaml\.org,2002:([^:/]+)$/);
2543
+ if (p) return "!" + p[1];
2544
+ let u = r.match(/^tag:([a-zA-Z0-9-]+)\.yaml\.org,2002:(.*)/);
2545
+ return u ? `!${u[1]}/${u[2]}` : `!${r.replace(/^tag:/, "")}`;
2546
+ }
2547
+ let s = i.tagPrefixes.find((p) => r.indexOf(p.prefix) === 0);
2548
+ if (!s) {
2549
+ let p = i.getDefaults().tagPrefixes;
2550
+ s = p && p.find((u) => r.indexOf(u.prefix) === 0);
2551
+ }
2552
+ if (!s) return r[0] === "!" ? r : `!<${r}>`;
2553
+ let o = r.substr(s.prefix.length).replace(/[!,[\]{}]/g, (p) => ({ "!": "%21", ",": "%2C", "[": "%5B", "]": "%5D", "{": "%7B", "}": "%7D" })[p]);
2554
+ return s.handle + o;
2555
+ }
2556
+ function M(i, r) {
2557
+ if (r instanceof n.Alias) return n.Alias;
2558
+ if (r.tag) {
2559
+ let p = i.filter((u) => u.tag === r.tag);
2560
+ if (p.length > 0) return p.find((u) => u.format === r.format) || p[0];
2561
+ }
2562
+ let s, o;
2563
+ if (r instanceof n.Scalar) {
2564
+ o = r.value;
2565
+ let p = i.filter((u) => u.identify && u.identify(o) || u.class && o instanceof u.class);
2566
+ s = p.find((u) => u.format === r.format) || p.find((u) => !u.format);
2567
+ } else o = r, s = i.find((p) => p.nodeClass && o instanceof p.nodeClass);
2568
+ if (!s) {
2569
+ let p = o && o.constructor ? o.constructor.name : typeof o;
2570
+ throw new Error(`Tag not resolved for ${p} value`);
2571
+ }
2572
+ return s;
2573
+ }
2574
+ function I(i, r, { anchors: s, doc: o }) {
2575
+ let p = [], u = o.anchors.getName(i);
2576
+ return u && (s[u] = i, p.push(`&${u}`)), i.tag ? p.push(L(o, i.tag)) : r.default || p.push(L(o, r.tag)), p.join(" ");
2577
+ }
2578
+ function P(i, r, s, o) {
2579
+ let { anchors: p, schema: u } = r.doc, h;
2580
+ if (!(i instanceof n.Node)) {
2581
+ let C = { aliasNodes: [], onTagObj: (_) => h = _, prevObjects: /* @__PURE__ */ new Map() };
2582
+ i = u.createNode(i, !0, null, C);
2583
+ for (let _ of C.aliasNodes) {
2584
+ _.source = _.source.node;
2585
+ let F = p.getName(_.source);
2586
+ F || (F = p.newName(), p.map[F] = _.source);
2587
+ }
2588
+ }
2589
+ if (i instanceof n.Pair) return i.toString(r, s, o);
2590
+ h || (h = M(u.tags, i));
2591
+ let v = I(i, h, r);
2592
+ v.length > 0 && (r.indentAtStart = (r.indentAtStart || 0) + v.length + 1);
2593
+ let O = typeof h.stringify == "function" ? h.stringify(i, r, s, o) : i instanceof n.Scalar ? n.stringifyString(i, r, s, o) : i.toString(r, s, o);
2594
+ return v ? i instanceof n.Scalar || O[0] === "{" || O[0] === "[" ? `${v} ${O}` : `${v}
2595
+ ${r.indent}${O}` : O;
2596
+ }
2597
+ var Q = class zt {
2598
+ static validAnchorNode(r) {
2599
+ return r instanceof n.Scalar || r instanceof n.YAMLSeq || r instanceof n.YAMLMap;
2600
+ }
2601
+ constructor(r) {
2602
+ e._defineProperty(this, "map", /* @__PURE__ */ Object.create(null)), this.prefix = r;
2603
+ }
2604
+ createAlias(r, s) {
2605
+ return this.setAnchor(r, s), new n.Alias(r);
2606
+ }
2607
+ createMergePair(...r) {
2608
+ let s = new n.Merge();
2609
+ return s.value.items = r.map((o) => {
2610
+ if (o instanceof n.Alias) {
2611
+ if (o.source instanceof n.YAMLMap) return o;
2612
+ } else if (o instanceof n.YAMLMap) return this.createAlias(o);
2613
+ throw new Error("Merge sources must be Map nodes or their Aliases");
2614
+ }), s;
2615
+ }
2616
+ getName(r) {
2617
+ let { map: s } = this;
2618
+ return Object.keys(s).find((o) => s[o] === r);
2619
+ }
2620
+ getNames() {
2621
+ return Object.keys(this.map);
2622
+ }
2623
+ getNode(r) {
2624
+ return this.map[r];
2625
+ }
2626
+ newName(r) {
2627
+ r || (r = this.prefix);
2628
+ let s = Object.keys(this.map);
2629
+ for (let o = 1; ; ++o) {
2630
+ let p = `${r}${o}`;
2631
+ if (!s.includes(p)) return p;
2632
+ }
2633
+ }
2634
+ resolveNodes() {
2635
+ let { map: r, _cstAliases: s } = this;
2636
+ Object.keys(r).forEach((o) => {
2637
+ r[o] = r[o].resolved;
2638
+ }), s.forEach((o) => {
2639
+ o.source = o.source.resolved;
2640
+ }), delete this._cstAliases;
2641
+ }
2642
+ setAnchor(r, s) {
2643
+ if (r != null && !zt.validAnchorNode(r)) throw new Error("Anchors may only be set for Scalar, Seq and Map nodes");
2644
+ if (s && /[\x00-\x19\s,[\]{}]/.test(s)) throw new Error("Anchor names must not contain whitespace or control characters");
2645
+ let { map: o } = this, p = r && Object.keys(o).find((u) => o[u] === r);
2646
+ if (p) if (s) p !== s && (delete o[p], o[s] = r);
2647
+ else return p;
2648
+ else {
2649
+ if (!s) {
2650
+ if (!r) return null;
2651
+ s = this.newName();
2652
+ }
2653
+ o[s] = r;
2654
+ }
2655
+ return s;
2656
+ }
2657
+ }, ne = (i, r) => {
2658
+ if (i && typeof i == "object") {
2659
+ let { tag: s } = i;
2660
+ i instanceof n.Collection ? (s && (r[s] = !0), i.items.forEach((o) => ne(o, r))) : i instanceof n.Pair ? (ne(i.key, r), ne(i.value, r)) : i instanceof n.Scalar && s && (r[s] = !0);
2661
+ }
2662
+ return r;
2663
+ }, j = (i) => Object.keys(ne(i, {}));
2664
+ function G(i, r) {
2665
+ let s = { before: [], after: [] }, o, p = !1;
2666
+ for (let u of r) if (u.valueRange) {
2667
+ if (o !== void 0) {
2668
+ let v = "Document contains trailing content not separated by a ... or --- line";
2669
+ i.errors.push(new e.YAMLSyntaxError(u, v));
2670
+ break;
2671
+ }
2672
+ let h = n.resolveNode(i, u);
2673
+ p && (h.spaceBefore = !0, p = !1), o = h;
2674
+ } else u.comment !== null ? (o === void 0 ? s.before : s.after).push(u.comment) : u.type === e.Type.BLANK_LINE && (p = !0, o === void 0 && s.before.length > 0 && !i.commentBefore && (i.commentBefore = s.before.join(`
2675
+ `), s.before = []));
2676
+ if (i.contents = o || null, !o) i.comment = s.before.concat(s.after).join(`
2677
+ `) || null;
2678
+ else {
2679
+ let u = s.before.join(`
2680
+ `);
2681
+ if (u) {
2682
+ let h = o instanceof n.Collection && o.items[0] ? o.items[0] : o;
2683
+ h.commentBefore = h.commentBefore ? `${u}
2684
+ ${h.commentBefore}` : u;
2685
+ }
2686
+ i.comment = s.after.join(`
2687
+ `) || null;
2688
+ }
2689
+ }
2690
+ function U({ tagPrefixes: i }, r) {
2691
+ let [s, o] = r.parameters;
2692
+ if (!s || !o) {
2693
+ let p = "Insufficient parameters given for %TAG directive";
2694
+ throw new e.YAMLSemanticError(r, p);
2695
+ }
2696
+ if (i.some((p) => p.handle === s)) {
2697
+ let p = "The %TAG directive must only be given at most once per handle in the same document.";
2698
+ throw new e.YAMLSemanticError(r, p);
2699
+ }
2700
+ return { handle: s, prefix: o };
2701
+ }
2702
+ function Z(i, r) {
2703
+ let [s] = r.parameters;
2704
+ if (r.name === "YAML:1.0" && (s = "1.0"), !s) {
2705
+ let o = "Insufficient parameters given for %YAML directive";
2706
+ throw new e.YAMLSemanticError(r, o);
2707
+ }
2708
+ if (!b[s]) {
2709
+ let o = `Document will be parsed as YAML ${i.version || i.options.version} rather than YAML ${s}`;
2710
+ i.warnings.push(new e.YAMLWarning(r, o));
2711
+ }
2712
+ return s;
2713
+ }
2714
+ function ae(i, r, s) {
2715
+ let o = [], p = !1;
2716
+ for (let u of r) {
2717
+ let { comment: h, name: v } = u;
2718
+ switch (v) {
2719
+ case "TAG":
2720
+ try {
2721
+ i.tagPrefixes.push(U(i, u));
2722
+ } catch (O) {
2723
+ i.errors.push(O);
2724
+ }
2725
+ p = !0;
2726
+ break;
2727
+ case "YAML":
2728
+ case "YAML:1.0":
2729
+ if (i.version) {
2730
+ let O = "The %YAML directive must only be given at most once per document.";
2731
+ i.errors.push(new e.YAMLSemanticError(u, O));
2732
+ }
2733
+ try {
2734
+ i.version = Z(i, u);
2735
+ } catch (O) {
2736
+ i.errors.push(O);
2737
+ }
2738
+ p = !0;
2739
+ break;
2740
+ default:
2741
+ if (v) {
2742
+ let O = `YAML only supports %TAG and %YAML directives, and not %${v}`;
2743
+ i.warnings.push(new e.YAMLWarning(u, O));
2744
+ }
2745
+ }
2746
+ h && o.push(h);
2747
+ }
2748
+ if (s && !p && (i.version || s.version || i.options.version) === "1.1") {
2749
+ let u = ({ handle: h, prefix: v }) => ({ handle: h, prefix: v });
2750
+ i.tagPrefixes = s.tagPrefixes.map(u), i.version = s.version;
2751
+ }
2752
+ i.commentBefore = o.join(`
2753
+ `) || null;
2754
+ }
2755
+ function T(i) {
2756
+ if (i instanceof n.Collection) return !0;
2757
+ throw new Error("Expected a YAML collection as document contents");
2758
+ }
2759
+ var c = class pt {
2760
+ constructor(r) {
2761
+ this.anchors = new Q(r.anchorPrefix), this.commentBefore = null, this.comment = null, this.contents = null, this.directivesEndMarker = null, this.errors = [], this.options = r, this.schema = null, this.tagPrefixes = [], this.version = null, this.warnings = [];
2762
+ }
2763
+ add(r) {
2764
+ return T(this.contents), this.contents.add(r);
2765
+ }
2766
+ addIn(r, s) {
2767
+ T(this.contents), this.contents.addIn(r, s);
2768
+ }
2769
+ delete(r) {
2770
+ return T(this.contents), this.contents.delete(r);
2771
+ }
2772
+ deleteIn(r) {
2773
+ return n.isEmptyPath(r) ? this.contents == null ? !1 : (this.contents = null, !0) : (T(this.contents), this.contents.deleteIn(r));
2774
+ }
2775
+ getDefaults() {
2776
+ return pt.defaults[this.version] || pt.defaults[this.options.version] || {};
2777
+ }
2778
+ get(r, s) {
2779
+ return this.contents instanceof n.Collection ? this.contents.get(r, s) : void 0;
2780
+ }
2781
+ getIn(r, s) {
2782
+ return n.isEmptyPath(r) ? !s && this.contents instanceof n.Scalar ? this.contents.value : this.contents : this.contents instanceof n.Collection ? this.contents.getIn(r, s) : void 0;
2783
+ }
2784
+ has(r) {
2785
+ return this.contents instanceof n.Collection ? this.contents.has(r) : !1;
2786
+ }
2787
+ hasIn(r) {
2788
+ return n.isEmptyPath(r) ? this.contents !== void 0 : this.contents instanceof n.Collection ? this.contents.hasIn(r) : !1;
2789
+ }
2790
+ set(r, s) {
2791
+ T(this.contents), this.contents.set(r, s);
2792
+ }
2793
+ setIn(r, s) {
2794
+ n.isEmptyPath(r) ? this.contents = s : (T(this.contents), this.contents.setIn(r, s));
2795
+ }
2796
+ setSchema(r, s) {
2797
+ if (!r && !s && this.schema) return;
2798
+ typeof r == "number" && (r = r.toFixed(1)), r === "1.0" || r === "1.1" || r === "1.2" ? (this.version ? this.version = r : this.options.version = r, delete this.options.schema) : r && typeof r == "string" && (this.options.schema = r), Array.isArray(s) && (this.options.customTags = s);
2799
+ let o = Object.assign({}, this.getDefaults(), this.options);
2800
+ this.schema = new l.Schema(o);
2801
+ }
2802
+ parse(r, s) {
2803
+ this.options.keepCstNodes && (this.cstNode = r), this.options.keepNodeTypes && (this.type = "DOCUMENT");
2804
+ let { directives: o = [], contents: p = [], directivesEndMarker: u, error: h, valueRange: v } = r;
2805
+ if (h && (h.source || (h.source = this), this.errors.push(h)), ae(this, o, s), u && (this.directivesEndMarker = !0), this.range = v ? [v.start, v.end] : null, this.setSchema(), this.anchors._cstAliases = [], G(this, p), this.anchors.resolveNodes(), this.options.prettyErrors) {
2806
+ for (let O of this.errors) O instanceof e.YAMLError && O.makePretty();
2807
+ for (let O of this.warnings) O instanceof e.YAMLError && O.makePretty();
2808
+ }
2809
+ return this;
2810
+ }
2811
+ listNonDefaultTags() {
2812
+ return j(this.contents).filter((r) => r.indexOf(l.Schema.defaultPrefix) !== 0);
2813
+ }
2814
+ setTagPrefix(r, s) {
2815
+ if (r[0] !== "!" || r[r.length - 1] !== "!") throw new Error("Handle must start and end with !");
2816
+ if (s) {
2817
+ let o = this.tagPrefixes.find((p) => p.handle === r);
2818
+ o ? o.prefix = s : this.tagPrefixes.push({ handle: r, prefix: s });
2819
+ } else this.tagPrefixes = this.tagPrefixes.filter((o) => o.handle !== r);
2820
+ }
2821
+ toJSON(r, s) {
2822
+ let { keepBlobsInJSON: o, mapAsMap: p, maxAliasCount: u } = this.options, h = o && (typeof r != "string" || !(this.contents instanceof n.Scalar)), v = { doc: this, indentStep: " ", keep: h, mapAsMap: h && !!p, maxAliasCount: u, stringify: P }, O = Object.keys(this.anchors.map);
2823
+ O.length > 0 && (v.anchors = new Map(O.map((_) => [this.anchors.map[_], { alias: [], aliasCount: 0, count: 1 }])));
2824
+ let C = n.toJSON(this.contents, r, v);
2825
+ if (typeof s == "function" && v.anchors) for (let { count: _, res: F } of v.anchors.values()) s(F, _);
2826
+ return C;
2827
+ }
2828
+ toString() {
2829
+ if (this.errors.length > 0) throw new Error("Document with errors cannot be stringified");
2830
+ let r = this.options.indent;
2831
+ if (!Number.isInteger(r) || r <= 0) {
2832
+ let O = JSON.stringify(r);
2833
+ throw new Error(`"indent" option must be a positive integer, not ${O}`);
2834
+ }
2835
+ this.setSchema();
2836
+ let s = [], o = !1;
2837
+ if (this.version) {
2838
+ let O = "%YAML 1.2";
2839
+ this.schema.name === "yaml-1.1" && (this.version === "1.0" ? O = "%YAML:1.0" : this.version === "1.1" && (O = "%YAML 1.1")), s.push(O), o = !0;
2840
+ }
2841
+ let p = this.listNonDefaultTags();
2842
+ this.tagPrefixes.forEach(({ handle: O, prefix: C }) => {
2843
+ p.some((_) => _.indexOf(C) === 0) && (s.push(`%TAG ${O} ${C}`), o = !0);
2844
+ }), (o || this.directivesEndMarker) && s.push("---"), this.commentBefore && ((o || !this.directivesEndMarker) && s.unshift(""), s.unshift(this.commentBefore.replace(/^/gm, "#")));
2845
+ let u = { anchors: /* @__PURE__ */ Object.create(null), doc: this, indent: "", indentStep: " ".repeat(r), stringify: P }, h = !1, v = null;
2846
+ if (this.contents) {
2847
+ this.contents instanceof n.Node && (this.contents.spaceBefore && (o || this.directivesEndMarker) && s.push(""), this.contents.commentBefore && s.push(this.contents.commentBefore.replace(/^/gm, "#")), u.forceBlockIndent = !!this.comment, v = this.contents.comment);
2848
+ let O = v ? null : () => h = !0, C = P(this.contents, u, () => v = null, O);
2849
+ s.push(n.addComment(C, "", v));
2850
+ } else this.contents !== void 0 && s.push(P(this.contents, u));
2851
+ return this.comment && ((!h || v) && s[s.length - 1] !== "" && s.push(""), s.push(this.comment.replace(/^/gm, "#"))), s.join(`
2852
+ `) + `
2853
+ `;
2854
+ }
2855
+ };
2856
+ e._defineProperty(c, "defaults", b), t.Document = c, t.defaultOptions = g, t.scalarOptions = E;
2857
+ }), or = Le((t) => {
2858
+ var e = ir(), n = sr(), l = Zt(), g = Ie(), E = Jt();
2859
+ Ke();
2860
+ function b(j, G = !0, U) {
2861
+ U === void 0 && typeof G == "string" && (U = G, G = !0);
2862
+ let Z = Object.assign({}, n.Document.defaults[n.defaultOptions.version], n.defaultOptions);
2863
+ return new l.Schema(Z).createNode(j, G, U);
2864
+ }
2865
+ var L = class extends n.Document {
2866
+ constructor(j) {
2867
+ super(Object.assign({}, n.defaultOptions, j));
2868
+ }
2869
+ };
2870
+ function M(j, G) {
2871
+ let U = [], Z;
2872
+ for (let ae of e.parse(j)) {
2873
+ let T = new L(G);
2874
+ T.parse(ae, Z), U.push(T), Z = T;
2875
+ }
2876
+ return U;
2877
+ }
2878
+ function I(j, G) {
2879
+ let U = e.parse(j), Z = new L(G).parse(U[0]);
2880
+ if (U.length > 1) {
2881
+ let ae = "Source contains multiple documents; please use YAML.parseAllDocuments()";
2882
+ Z.errors.unshift(new g.YAMLSemanticError(U[1], ae));
2883
+ }
2884
+ return Z;
2885
+ }
2886
+ function P(j, G) {
2887
+ let U = I(j, G);
2888
+ if (U.warnings.forEach((Z) => E.warn(Z)), U.errors.length > 0) throw U.errors[0];
2889
+ return U.toJSON();
2890
+ }
2891
+ function Q(j, G) {
2892
+ let U = new L(G);
2893
+ return U.contents = j, String(U);
2894
+ }
2895
+ var ne = { createNode: b, defaultOptions: n.defaultOptions, Document: L, parse: P, parseAllDocuments: M, parseCST: e.parse, parseDocument: I, scalarOptions: n.scalarOptions, stringify: Q };
2896
+ t.YAML = ne;
2897
+ }), ar = Le((t, e) => {
2898
+ e.exports = or().YAML;
2899
+ }), lr = Le((t) => {
2900
+ var e = Ke(), n = Ie();
2901
+ t.findPair = e.findPair, t.parseMap = e.resolveMap, t.parseSeq = e.resolveSeq, t.stringifyNumber = e.stringifyNumber, t.stringifyString = e.stringifyString, t.toJSON = e.toJSON, t.Type = n.Type, t.YAMLError = n.YAMLError, t.YAMLReferenceError = n.YAMLReferenceError, t.YAMLSemanticError = n.YAMLSemanticError, t.YAMLSyntaxError = n.YAMLSyntaxError, t.YAMLWarning = n.YAMLWarning;
2902
+ }), en = {};
2903
+ Wt(en, { languages: () => pi, options: () => hi, parsers: () => On, printers: () => $s });
2904
+ var cr = (t, e, n, l) => {
2905
+ if (!(t && e == null)) return e.replaceAll ? e.replaceAll(n, l) : n.global ? e.replace(n, l) : e.split(n).join(l);
2906
+ }, st = cr, tn = "string", nn = "array", rn = "cursor", sn = "indent", St = "align", on = "trim", bt = "group", wt = "fill", Ot = "if-break", an = "indent-if-break", Nt = "line-suffix", ln = "line-suffix-boundary", Ye = "line", cn = "label", At = "break-parent", un = /* @__PURE__ */ new Set([rn, sn, St, on, bt, wt, Ot, an, Nt, ln, Ye, cn, At]);
2907
+ function ur(t) {
2908
+ if (typeof t == "string") return tn;
2909
+ if (Array.isArray(t)) return nn;
2910
+ if (!t) return;
2911
+ let { type: e } = t;
2912
+ if (un.has(e)) return e;
2913
+ }
2914
+ var fn = ur, fr = (t) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(t);
2915
+ function pr(t) {
2916
+ let e = t === null ? "null" : typeof t;
2917
+ if (e !== "string" && e !== "object") return `Unexpected doc '${e}',
2918
+ Expected it to be 'string' or 'object'.`;
2919
+ if (fn(t)) throw new Error("doc is valid.");
2920
+ let n = Object.prototype.toString.call(t);
2921
+ if (n !== "[object Object]") return `Unexpected doc '${n}'.`;
2922
+ let l = fr([...un].map((g) => `'${g}'`));
2923
+ return `Unexpected doc.type '${t.type}'.
2924
+ Expected it to be ${l}.`;
2925
+ }
2926
+ var dr = class extends Error {
2927
+ constructor(e) {
2928
+ super(pr(e));
2929
+ it(this, "name", "InvalidDocError");
2930
+ this.doc = e;
2931
+ }
2932
+ }, hr = dr, mr = () => {
2933
+ }, gr = mr;
2934
+ function tt(t, e) {
2935
+ return { type: St, contents: e, n: t };
2936
+ }
2937
+ function Ze(t, e = {}) {
2938
+ return gr(e.expandedStates), { type: bt, id: e.id, contents: t, break: !!e.shouldBreak, expandedStates: e.expandedStates };
2939
+ }
2940
+ function Ct(t) {
2941
+ return tt(Number.NEGATIVE_INFINITY, t);
2942
+ }
2943
+ function yr(t) {
2944
+ return tt({ type: "root" }, t);
2945
+ }
2946
+ function vr(t) {
2947
+ return tt(-1, t);
2948
+ }
2949
+ function kt(t, e) {
2950
+ return Ze(t[0], { ...e, expandedStates: t });
2951
+ }
2952
+ function pn(t) {
2953
+ return { type: wt, parts: t };
2954
+ }
2955
+ function dt(t, e = "", n = {}) {
2956
+ return { type: Ot, breakContents: t, flatContents: e, groupId: n.groupId };
2957
+ }
2958
+ function Er(t) {
2959
+ return { type: Nt, contents: t };
2960
+ }
2961
+ var Lt = { type: At }, Sr = { type: Ye, hard: !0 }, br = { type: Ye, hard: !0, literal: !0 }, Ue = { type: Ye }, dn = { type: Ye, soft: !0 }, z = [Sr, Lt], ht = [br, Lt];
2962
+ function fe(t, e) {
2963
+ let n = [];
2964
+ for (let l = 0; l < e.length; l++) l !== 0 && n.push(t), n.push(e[l]);
2965
+ return n;
2966
+ }
2967
+ var wr = (t, e, n) => {
2968
+ if (!(t && e == null)) return Array.isArray(e) || typeof e == "string" ? e[n < 0 ? e.length + n : n] : e.at(n);
2969
+ }, ge = wr;
2970
+ function Or(t, e) {
2971
+ if (typeof t == "string") return e(t);
2972
+ let n = /* @__PURE__ */ new Map();
2973
+ return l(t);
2974
+ function l(E) {
2975
+ if (n.has(E)) return n.get(E);
2976
+ let b = g(E);
2977
+ return n.set(E, b), b;
2978
+ }
2979
+ function g(E) {
2980
+ switch (fn(E)) {
2981
+ case nn:
2982
+ return e(E.map(l));
2983
+ case wt:
2984
+ return e({ ...E, parts: E.parts.map(l) });
2985
+ case Ot:
2986
+ return e({ ...E, breakContents: l(E.breakContents), flatContents: l(E.flatContents) });
2987
+ case bt: {
2988
+ let { expandedStates: b, contents: L } = E;
2989
+ return b ? (b = b.map(l), L = b[0]) : L = l(L), e({ ...E, contents: L, expandedStates: b });
2990
+ }
2991
+ case St:
2992
+ case sn:
2993
+ case an:
2994
+ case cn:
2995
+ case Nt:
2996
+ return e({ ...E, contents: l(E.contents) });
2997
+ case tn:
2998
+ case rn:
2999
+ case on:
3000
+ case ln:
3001
+ case Ye:
3002
+ case At:
3003
+ return e(E);
3004
+ default:
3005
+ throw new hr(E);
3006
+ }
3007
+ }
3008
+ }
3009
+ function Nr(t, e = ht) {
3010
+ return Or(t, (n) => typeof n == "string" ? fe(e, n.split(`
3011
+ `)) : n);
3012
+ }
3013
+ function Ar(t) {
3014
+ return (e, n, l) => {
3015
+ let g = !!(l != null && l.backwards);
3016
+ if (n === !1) return !1;
3017
+ let { length: E } = e, b = n;
3018
+ for (; b >= 0 && b < E; ) {
3019
+ let L = e.charAt(b);
3020
+ if (t instanceof RegExp) {
3021
+ if (!t.test(L)) return b;
3022
+ } else if (!t.includes(L)) return b;
3023
+ g ? b-- : b++;
3024
+ }
3025
+ return b === -1 || b === E ? b : !1;
3026
+ };
3027
+ }
3028
+ var It = Ar(" ");
3029
+ function Lr(t, e, n) {
3030
+ let l = !!(n != null && n.backwards);
3031
+ if (e === !1) return !1;
3032
+ let g = t.charAt(e);
3033
+ if (l) {
3034
+ if (t.charAt(e - 1) === "\r" && g === `
3035
+ `) return e - 2;
3036
+ if (g === `
3037
+ ` || g === "\r" || g === "\u2028" || g === "\u2029") return e - 1;
3038
+ } else {
3039
+ if (g === "\r" && t.charAt(e + 1) === `
3040
+ `) return e + 2;
3041
+ if (g === `
3042
+ ` || g === "\r" || g === "\u2028" || g === "\u2029") return e + 1;
3043
+ }
3044
+ return e;
3045
+ }
3046
+ var Pt = Lr;
3047
+ function Mr(t, e) {
3048
+ let n = e - 1;
3049
+ n = It(t, n, { backwards: !0 }), n = Pt(t, n, { backwards: !0 }), n = It(t, n, { backwards: !0 });
3050
+ let l = Pt(t, n, { backwards: !0 });
3051
+ return n !== l;
3052
+ }
3053
+ var Tr = Mr, xr = class extends Error {
3054
+ constructor(e, n, l = "type") {
3055
+ super(`Unexpected ${n} node ${l}: ${JSON.stringify(e[l])}.`);
3056
+ it(this, "name", "UnexpectedNodeError");
3057
+ this.node = e;
3058
+ }
3059
+ }, Cr = xr;
3060
+ function hn(t, e) {
3061
+ let { node: n } = t;
3062
+ if (n.type === "root" && e.filepath && /(?:[/\\]|^)\.(?:prettier|stylelint|lintstaged)rc$/u.test(e.filepath)) return async (l) => {
3063
+ let g = await l(e.originalText, { parser: "json" });
3064
+ return g ? [g, z] : void 0;
3065
+ };
3066
+ }
3067
+ hn.getVisitorKeys = () => [];
3068
+ var kr = hn, Fe = null;
3069
+ function qe(t) {
3070
+ if (Fe !== null && typeof Fe.property) {
3071
+ let e = Fe;
3072
+ return Fe = qe.prototype = null, e;
3073
+ }
3074
+ return Fe = qe.prototype = t ?? /* @__PURE__ */ Object.create(null), new qe();
3075
+ }
3076
+ var Ir = 10;
3077
+ for (let t = 0; t <= Ir; t++) qe();
3078
+ function Pr(t) {
3079
+ return qe(t);
3080
+ }
3081
+ function $r(t, e = "type") {
3082
+ Pr(t);
3083
+ function n(l) {
3084
+ let g = l[e], E = t[g];
3085
+ if (!Array.isArray(E)) throw Object.assign(new Error(`Missing visitor keys for '${g}'.`), { node: l });
3086
+ return E;
3087
+ }
3088
+ return n;
3089
+ }
3090
+ var Rr = $r, _r = Object.fromEntries(Object.entries({ root: ["children"], document: ["head", "body", "children"], documentHead: ["children"], documentBody: ["children"], directive: [], alias: [], blockLiteral: [], blockFolded: ["children"], plain: ["children"], quoteSingle: [], quoteDouble: [], mapping: ["children"], mappingItem: ["key", "value", "children"], mappingKey: ["content", "children"], mappingValue: ["content", "children"], sequence: ["children"], sequenceItem: ["content", "children"], flowMapping: ["children"], flowMappingItem: ["key", "value", "children"], flowSequence: ["children"], flowSequenceItem: ["content", "children"], comment: [], tag: [], anchor: [] }).map(([t, e]) => [t, [...e, "anchor", "tag", "indicatorComment", "leadingComments", "middleComments", "trailingComment", "endComments"]])), Yr = _r, Br = Rr(Yr), Dr = Br;
3091
+ function Xe(t) {
3092
+ return t.position.start.offset;
3093
+ }
3094
+ function Fr(t) {
3095
+ return t.position.end.offset;
3096
+ }
3097
+ function Wr(t) {
3098
+ return /^\s*@(?:prettier|format)\s*$/u.test(t);
3099
+ }
3100
+ function jr(t) {
3101
+ return /^\s*#[^\S\n]*@(?:prettier|format)\s*?(?:\n|$)/u.test(t);
3102
+ }
3103
+ function qr(t) {
3104
+ return `# @format
3105
+
3106
+ ${t}`;
3107
+ }
3108
+ function Kr(t) {
3109
+ return Array.isArray(t) && t.length > 0;
3110
+ }
3111
+ var Ve = Kr;
3112
+ function Ae(t, e) {
3113
+ return typeof (t == null ? void 0 : t.type) == "string" && (!e || e.includes(t.type));
3114
+ }
3115
+ function mn(t, e, n) {
3116
+ return e("children" in t ? { ...t, children: t.children.map((l) => mn(l, e, t)) } : t, n);
3117
+ }
3118
+ function We(t, e, n) {
3119
+ Object.defineProperty(t, e, { get: n, enumerable: !1 });
3120
+ }
3121
+ function Ur(t, e) {
3122
+ let n = 0, l = e.length;
3123
+ for (let g = t.position.end.offset - 1; g < l; g++) {
3124
+ let E = e[g];
3125
+ if (E === `
3126
+ ` && n++, n === 1 && /\S/u.test(E)) return !1;
3127
+ if (n === 2) return !0;
3128
+ }
3129
+ return !1;
3130
+ }
3131
+ function gn(t) {
3132
+ let { node: e } = t;
3133
+ switch (e.type) {
3134
+ case "tag":
3135
+ case "anchor":
3136
+ case "comment":
3137
+ return !1;
3138
+ }
3139
+ let n = t.stack.length;
3140
+ for (let l = 1; l < n; l++) {
3141
+ let g = t.stack[l], E = t.stack[l - 1];
3142
+ if (Array.isArray(E) && typeof g == "number" && g !== E.length - 1) return !1;
3143
+ }
3144
+ return !0;
3145
+ }
3146
+ function mt(t) {
3147
+ return Ve(t.children) ? mt(ge(!1, t.children, -1)) : t;
3148
+ }
3149
+ function $t(t) {
3150
+ return t.value.trim() === "prettier-ignore";
3151
+ }
3152
+ function Vr(t) {
3153
+ let { node: e } = t;
3154
+ if (e.type === "documentBody") {
3155
+ let n = t.parent.head;
3156
+ return Ee(n) && $t(ge(!1, n.endComments, -1));
3157
+ }
3158
+ return Te(e) && $t(ge(!1, e.leadingComments, -1));
3159
+ }
3160
+ function ze(t) {
3161
+ return !Ve(t.children) && !Qr(t);
3162
+ }
3163
+ function Qr(t) {
3164
+ return Te(t) || Re(t) || yn(t) || be(t) || Ee(t);
3165
+ }
3166
+ function Te(t) {
3167
+ return Ve(t == null ? void 0 : t.leadingComments);
3168
+ }
3169
+ function Re(t) {
3170
+ return Ve(t == null ? void 0 : t.middleComments);
3171
+ }
3172
+ function yn(t) {
3173
+ return t == null ? void 0 : t.indicatorComment;
3174
+ }
3175
+ function be(t) {
3176
+ return t == null ? void 0 : t.trailingComment;
3177
+ }
3178
+ function Ee(t) {
3179
+ return Ve(t == null ? void 0 : t.endComments);
3180
+ }
3181
+ function vn(t) {
3182
+ let e = [], n;
3183
+ for (let l of t.split(/( +)/u)) l !== " " ? n === " " ? e.push(l) : e.push((e.pop() || "") + l) : n === void 0 && e.unshift(""), n = l;
3184
+ return n === " " && e.push((e.pop() || "") + " "), e[0] === "" && (e.shift(), e.unshift(" " + (e.shift() || ""))), e;
3185
+ }
3186
+ function Jr(t, e, n) {
3187
+ let l = e.split(`
3188
+ `).map((g, E, b) => E === 0 && E === b.length - 1 ? g : E !== 0 && E !== b.length - 1 ? g.trim() : E === 0 ? g.trimEnd() : g.trimStart());
3189
+ return n.proseWrap === "preserve" ? l.map((g) => g.length === 0 ? [] : [g]) : l.map((g) => g.length === 0 ? [] : vn(g)).reduce((g, E, b) => b !== 0 && l[b - 1].length > 0 && E.length > 0 && !(t === "quoteDouble" && ge(!1, ge(!1, g, -1), -1).endsWith("\\")) ? [...g.slice(0, -1), [...ge(!1, g, -1), ...E]] : [...g, E], []).map((g) => n.proseWrap === "never" ? [g.join(" ")] : g);
3190
+ }
3191
+ function Hr(t, { parentIndent: e, isLastDescendant: n, options: l }) {
3192
+ let g = t.position.start.line === t.position.end.line ? "" : l.originalText.slice(t.position.start.offset, t.position.end.offset).match(/^[^\n]*\n(.*)$/su)[1], E;
3193
+ if (t.indent === null) {
3194
+ let M = g.match(/^(?<leadingSpace> *)[^\n\r ]/mu);
3195
+ E = M ? M.groups.leadingSpace.length : Number.POSITIVE_INFINITY;
3196
+ } else E = t.indent - 1 + e;
3197
+ let b = g.split(`
3198
+ `).map((M) => M.slice(E));
3199
+ if (l.proseWrap === "preserve" || t.type === "blockLiteral") return L(b.map((M) => M.length === 0 ? [] : [M]));
3200
+ return L(b.map((M) => M.length === 0 ? [] : vn(M)).reduce((M, I, P) => P !== 0 && b[P - 1].length > 0 && I.length > 0 && !/^\s/u.test(I[0]) && !/^\s|\s$/u.test(ge(!1, M, -1)) ? [...M.slice(0, -1), [...ge(!1, M, -1), ...I]] : [...M, I], []).map((M) => M.reduce((I, P) => I.length > 0 && /\s$/u.test(ge(!1, I, -1)) ? [...I.slice(0, -1), ge(!1, I, -1) + " " + P] : [...I, P], [])).map((M) => l.proseWrap === "never" ? [M.join(" ")] : M));
3201
+ function L(M) {
3202
+ if (t.chomping === "keep") return ge(!1, M, -1).length === 0 ? M.slice(0, -1) : M;
3203
+ let I = 0;
3204
+ for (let P = M.length - 1; P >= 0 && M[P].length === 0; P--) I++;
3205
+ return I === 0 ? M : I >= 2 && !n ? M.slice(0, -(I - 1)) : M.slice(0, -I);
3206
+ }
3207
+ }
3208
+ function gt(t) {
3209
+ if (!t) return !0;
3210
+ switch (t.type) {
3211
+ case "plain":
3212
+ case "quoteDouble":
3213
+ case "quoteSingle":
3214
+ case "alias":
3215
+ case "flowMapping":
3216
+ case "flowSequence":
3217
+ return !0;
3218
+ default:
3219
+ return !1;
3220
+ }
3221
+ }
3222
+ var ot = /* @__PURE__ */ new WeakMap();
3223
+ function En(t, e) {
3224
+ let { node: n, root: l } = t, g;
3225
+ return ot.has(l) ? g = ot.get(l) : (g = /* @__PURE__ */ new Set(), ot.set(l, g)), !g.has(n.position.end.line) && (g.add(n.position.end.line), Ur(n, e) && !Sn(t.parent)) ? dn : "";
3226
+ }
3227
+ function Sn(t) {
3228
+ return Ee(t) && !Ae(t, ["documentHead", "documentBody", "flowMapping", "flowSequence"]);
3229
+ }
3230
+ function me(t, e) {
3231
+ return tt(" ".repeat(t), e);
3232
+ }
3233
+ function Gr(t, e, n) {
3234
+ let { node: l } = t, g = t.ancestors.filter((I) => I.type === "sequence" || I.type === "mapping").length, E = gn(t), b = [l.type === "blockFolded" ? ">" : "|"];
3235
+ l.indent !== null && b.push(l.indent.toString()), l.chomping !== "clip" && b.push(l.chomping === "keep" ? "+" : "-"), yn(l) && b.push(" ", e("indicatorComment"));
3236
+ let L = Hr(l, { parentIndent: g, isLastDescendant: E, options: n }), M = [];
3237
+ for (let [I, P] of L.entries()) I === 0 && M.push(z), M.push(pn(fe(Ue, P))), I !== L.length - 1 ? M.push(P.length === 0 ? z : yr(ht)) : l.chomping === "keep" && E && M.push(Ct(P.length === 0 ? z : ht));
3238
+ return l.indent === null ? b.push(vr(me(n.tabWidth, M))) : b.push(Ct(me(l.indent - 1 + g, M))), b;
3239
+ }
3240
+ var Zr = Gr;
3241
+ function Rt(t, e, n) {
3242
+ let { node: l } = t, g = l.type === "flowMapping", E = g ? "{" : "[", b = g ? "}" : "]", L = dn;
3243
+ g && l.children.length > 0 && n.bracketSpacing && (L = Ue);
3244
+ let M = ge(!1, l.children, -1), I = (M == null ? void 0 : M.type) === "flowMappingItem" && ze(M.key) && ze(M.value);
3245
+ return [E, me(n.tabWidth, [L, Xr(t, e, n), n.trailingComma === "none" ? "" : dt(","), Ee(l) ? [z, fe(z, t.map(e, "endComments"))] : ""]), I ? "" : L, b];
3246
+ }
3247
+ function Xr(t, e, n) {
3248
+ return t.map(({ isLast: l, node: g, next: E }) => [e(), l ? "" : [",", Ue, g.position.start.line !== E.position.start.line ? En(t, n.originalText) : ""]], "children");
3249
+ }
3250
+ function zr(t, e, n) {
3251
+ var l;
3252
+ let { node: g, parent: E } = t, { key: b, value: L } = g, M = ze(b), I = ze(L);
3253
+ if (M && I) return ": ";
3254
+ let P = e("key"), Q = ei(g) ? " " : "";
3255
+ if (I) return g.type === "flowMappingItem" && E.type === "flowMapping" ? P : g.type === "mappingItem" && at(b.content, n) && !be(b.content) && ((l = E.tag) == null ? void 0 : l.value) !== "tag:yaml.org,2002:set" ? [P, Q, ":"] : ["? ", me(2, P)];
3256
+ let ne = e("value");
3257
+ if (M) return [": ", me(2, ne)];
3258
+ if (Te(L) || !gt(b.content)) return ["? ", me(2, P), z, ...t.map(() => [e(), z], "value", "leadingComments"), ": ", me(2, ne)];
3259
+ if (ti(b.content) && !Te(b.content) && !Re(b.content) && !be(b.content) && !Ee(b) && !Te(L.content) && !Re(L.content) && !Ee(L) && at(L.content, n)) return [P, Q, ": ", ne];
3260
+ let j = Symbol("mappingKey"), G = Ze([dt("? "), Ze(me(2, P), { id: j })]), U = [z, ": ", me(2, ne)], Z = [Q, ":"];
3261
+ Te(L.content) || Ee(L) && L.content && !Ae(L.content, ["mapping", "sequence"]) || E.type === "mapping" && be(b.content) && gt(L.content) || Ae(L.content, ["mapping", "sequence"]) && L.content.tag === null && L.content.anchor === null ? Z.push(z) : L.content && Z.push(Ue), Z.push(ne);
3262
+ let ae = me(n.tabWidth, Z);
3263
+ return at(b.content, n) && !Te(b.content) && !Re(b.content) && !Ee(b) ? kt([[P, ae]]) : kt([[G, dt(U, ae, { groupId: j })]]);
3264
+ }
3265
+ function at(t, e) {
3266
+ if (!t) return !0;
3267
+ switch (t.type) {
3268
+ case "plain":
3269
+ case "quoteSingle":
3270
+ case "quoteDouble":
3271
+ break;
3272
+ case "alias":
3273
+ return !0;
3274
+ default:
3275
+ return !1;
3276
+ }
3277
+ if (e.proseWrap === "preserve") return t.position.start.line === t.position.end.line;
3278
+ if (/\\$/mu.test(e.originalText.slice(t.position.start.offset, t.position.end.offset))) return !1;
3279
+ switch (e.proseWrap) {
3280
+ case "never":
3281
+ return !t.value.includes(`
3282
+ `);
3283
+ case "always":
3284
+ return !/[\n ]/u.test(t.value);
3285
+ default:
3286
+ return !1;
3287
+ }
3288
+ }
3289
+ function ei(t) {
3290
+ var e;
3291
+ return ((e = t.key.content) == null ? void 0 : e.type) === "alias";
3292
+ }
3293
+ function ti(t) {
3294
+ if (!t) return !0;
3295
+ switch (t.type) {
3296
+ case "plain":
3297
+ case "quoteDouble":
3298
+ case "quoteSingle":
3299
+ return t.position.start.line === t.position.end.line;
3300
+ case "alias":
3301
+ return !0;
3302
+ default:
3303
+ return !1;
3304
+ }
3305
+ }
3306
+ var ni = zr;
3307
+ function ri(t) {
3308
+ return mn(t, ii);
3309
+ }
3310
+ function ii(t) {
3311
+ switch (t.type) {
3312
+ case "document":
3313
+ We(t, "head", () => t.children[0]), We(t, "body", () => t.children[1]);
3314
+ break;
3315
+ case "documentBody":
3316
+ case "sequenceItem":
3317
+ case "flowSequenceItem":
3318
+ case "mappingKey":
3319
+ case "mappingValue":
3320
+ We(t, "content", () => t.children[0]);
3321
+ break;
3322
+ case "mappingItem":
3323
+ case "flowMappingItem":
3324
+ We(t, "key", () => t.children[0]), We(t, "value", () => t.children[1]);
3325
+ break;
3326
+ }
3327
+ return t;
3328
+ }
3329
+ var si = ri;
3330
+ function oi(t, e, n) {
3331
+ let { node: l } = t, g = [];
3332
+ l.type !== "mappingValue" && Te(l) && g.push([fe(z, t.map(n, "leadingComments")), z]);
3333
+ let { tag: E, anchor: b } = l;
3334
+ E && g.push(n("tag")), E && b && g.push(" "), b && g.push(n("anchor"));
3335
+ let L = "";
3336
+ return Ae(l, ["mapping", "sequence", "comment", "directive", "mappingItem", "sequenceItem"]) && !gn(t) && (L = En(t, e.originalText)), (E || b) && (Ae(l, ["sequence", "mapping"]) && !Re(l) ? g.push(z) : g.push(" ")), Re(l) && g.push([l.middleComments.length === 1 ? "" : z, fe(z, t.map(n, "middleComments")), z]), Vr(t) ? g.push(Nr(e.originalText.slice(l.position.start.offset, l.position.end.offset).trimEnd())) : g.push(Ze(ai(t, e, n))), be(l) && !Ae(l, ["document", "documentHead"]) && g.push(Er([l.type === "mappingValue" && !l.content ? "" : " ", t.parent.type === "mappingKey" && t.getParentNode(2).type === "mapping" && gt(l) ? "" : Lt, n("trailingComment")])), Sn(l) && g.push(me(l.type === "sequenceItem" ? 2 : 0, [z, fe(z, t.map(({ node: M }) => [Tr(e.originalText, Xe(M)) ? z : "", n()], "endComments"))])), g.push(L), g;
3337
+ }
3338
+ function ai(t, e, n) {
3339
+ let { node: l } = t;
3340
+ switch (l.type) {
3341
+ case "root": {
3342
+ let g = [];
3343
+ t.each(({ node: b, next: L, isFirst: M }) => {
3344
+ M || g.push(z), g.push(n()), bn(b, L) ? (g.push(z, "..."), be(b) && g.push(" ", n("trailingComment"))) : L && !be(L.head) && g.push(z, "---");
3345
+ }, "children");
3346
+ let E = mt(l);
3347
+ return (!Ae(E, ["blockLiteral", "blockFolded"]) || E.chomping !== "keep") && g.push(z), g;
3348
+ }
3349
+ case "document": {
3350
+ let g = [];
3351
+ return ci(t, e) === "head" && ((l.head.children.length > 0 || l.head.endComments.length > 0) && g.push(n("head")), be(l.head) ? g.push(["---", " ", n(["head", "trailingComment"])]) : g.push("---")), li(l) && g.push(n("body")), fe(z, g);
3352
+ }
3353
+ case "documentHead":
3354
+ return fe(z, [...t.map(n, "children"), ...t.map(n, "endComments")]);
3355
+ case "documentBody": {
3356
+ let { children: g, endComments: E } = l, b = "";
3357
+ if (g.length > 0 && E.length > 0) {
3358
+ let L = mt(l);
3359
+ Ae(L, ["blockFolded", "blockLiteral"]) ? L.chomping !== "keep" && (b = [z, z]) : b = z;
3360
+ }
3361
+ return [fe(z, t.map(n, "children")), b, fe(z, t.map(n, "endComments"))];
3362
+ }
3363
+ case "directive":
3364
+ return ["%", fe(" ", [l.name, ...l.parameters])];
3365
+ case "comment":
3366
+ return ["#", l.value];
3367
+ case "alias":
3368
+ return ["*", l.value];
3369
+ case "tag":
3370
+ return e.originalText.slice(l.position.start.offset, l.position.end.offset);
3371
+ case "anchor":
3372
+ return ["&", l.value];
3373
+ case "plain":
3374
+ return je(l.type, e.originalText.slice(l.position.start.offset, l.position.end.offset), e);
3375
+ case "quoteDouble":
3376
+ case "quoteSingle": {
3377
+ let g = "'", E = '"', b = e.originalText.slice(l.position.start.offset + 1, l.position.end.offset - 1);
3378
+ if (l.type === "quoteSingle" && b.includes("\\") || l.type === "quoteDouble" && /\\[^"]/u.test(b)) {
3379
+ let M = l.type === "quoteDouble" ? E : g;
3380
+ return [M, je(l.type, b, e), M];
3381
+ }
3382
+ if (b.includes(E)) return [g, je(l.type, l.type === "quoteDouble" ? st(!1, st(!1, b, String.raw`\"`, E), "'", g.repeat(2)) : b, e), g];
3383
+ if (b.includes(g)) return [E, je(l.type, l.type === "quoteSingle" ? st(!1, b, "''", g) : b, e), E];
3384
+ let L = e.singleQuote ? g : E;
3385
+ return [L, je(l.type, b, e), L];
3386
+ }
3387
+ case "blockFolded":
3388
+ case "blockLiteral":
3389
+ return Zr(t, n, e);
3390
+ case "mapping":
3391
+ case "sequence":
3392
+ return fe(z, t.map(n, "children"));
3393
+ case "sequenceItem":
3394
+ return ["- ", me(2, l.content ? n("content") : "")];
3395
+ case "mappingKey":
3396
+ case "mappingValue":
3397
+ return l.content ? n("content") : "";
3398
+ case "mappingItem":
3399
+ case "flowMappingItem":
3400
+ return ni(t, n, e);
3401
+ case "flowMapping":
3402
+ return Rt(t, n, e);
3403
+ case "flowSequence":
3404
+ return Rt(t, n, e);
3405
+ case "flowSequenceItem":
3406
+ return n("content");
3407
+ default:
3408
+ throw new Cr(l, "YAML");
3409
+ }
3410
+ }
3411
+ function li(t) {
3412
+ return t.body.children.length > 0 || Ee(t.body);
3413
+ }
3414
+ function bn(t, e) {
3415
+ return be(t) || e && (e.head.children.length > 0 || Ee(e.head));
3416
+ }
3417
+ function ci(t, e) {
3418
+ let n = t.node;
3419
+ if (t.isFirst && /---(?:\s|$)/u.test(e.originalText.slice(Xe(n), Xe(n) + 4)) || n.head.children.length > 0 || Ee(n.head) || be(n.head)) return "head";
3420
+ let l = t.next;
3421
+ return bn(n, l) ? !1 : l ? "root" : !1;
3422
+ }
3423
+ function je(t, e, n) {
3424
+ let l = Jr(t, e, n);
3425
+ return fe(z, l.map((g) => pn(fe(Ue, g))));
3426
+ }
3427
+ function wn(t, e) {
3428
+ if (Ae(t)) switch (t.type) {
3429
+ case "comment":
3430
+ if (Wr(t.value)) return null;
3431
+ break;
3432
+ case "quoteDouble":
3433
+ case "quoteSingle":
3434
+ e.type = "quote";
3435
+ break;
3436
+ }
3437
+ }
3438
+ wn.ignoredProperties = /* @__PURE__ */ new Set(["position"]);
3439
+ var ui = { preprocess: si, embed: kr, print: oi, massageAstNode: wn, insertPragma: qr, getVisitorKeys: Dr }, fi = ui, pi = [{ linguistLanguageId: 407, name: "YAML", type: "data", color: "#cb171e", tmScope: "source.yaml", aliases: ["yml"], extensions: [".yml", ".mir", ".reek", ".rviz", ".sublime-syntax", ".syntax", ".yaml", ".yaml-tmlanguage", ".yaml.sed", ".yml.mysql"], filenames: [".clang-format", ".clang-tidy", ".gemrc", "CITATION.cff", "glide.lock", ".prettierrc", ".stylelintrc", ".lintstagedrc"], aceMode: "yaml", codemirrorMode: "yaml", codemirrorMimeType: "text/x-yaml", parsers: ["yaml"], vscodeLanguageIds: ["yaml", "ansible", "home-assistant"] }], lt = { bracketSpacing: { category: "Common", type: "boolean", default: !0, description: "Print spaces between brackets.", oppositeDescription: "Do not print spaces between brackets." }, singleQuote: { category: "Common", type: "boolean", default: !1, description: "Use single quotes instead of double quotes." }, proseWrap: { category: "Common", type: "choice", default: "preserve", description: "How to wrap prose.", choices: [{ value: "always", description: "Wrap prose if it exceeds the print width." }, { value: "never", description: "Do not wrap prose." }, { value: "preserve", description: "Wrap prose as-is." }] }, bracketSameLine: { category: "Common", type: "boolean", default: !1, description: "Put > of opening tags on the last line instead of on a new line." }, singleAttributePerLine: { category: "Common", type: "boolean", default: !1, description: "Enforce single attribute per line in HTML, Vue and JSX." } }, di = { bracketSpacing: lt.bracketSpacing, singleQuote: lt.singleQuote, proseWrap: lt.proseWrap }, hi = di, On = {};
3440
+ Wt(On, { yaml: () => Ps });
3441
+ var Je = `
3442
+ `, _t = "\r", mi = function() {
3443
+ function t(e) {
3444
+ this.length = e.length;
3445
+ for (var n = [0], l = 0; l < e.length; ) switch (e[l]) {
3446
+ case Je:
3447
+ l += Je.length, n.push(l);
3448
+ break;
3449
+ case _t:
3450
+ l += _t.length, e[l] === Je && (l += Je.length), n.push(l);
3451
+ break;
3452
+ default:
3453
+ l++;
3454
+ break;
3455
+ }
3456
+ this.offsets = n;
3457
+ }
3458
+ return t.prototype.locationForIndex = function(e) {
3459
+ if (e < 0 || e > this.length) return null;
3460
+ for (var n = 0, l = this.offsets; l[n + 1] <= e; ) n++;
3461
+ var g = e - l[n];
3462
+ return { line: n, column: g };
3463
+ }, t.prototype.indexForLocation = function(e) {
3464
+ var n = e.line, l = e.column;
3465
+ return n < 0 || n >= this.offsets.length || l < 0 || l > this.lengthOfLine(n) ? null : this.offsets[n] + l;
3466
+ }, t.prototype.lengthOfLine = function(e) {
3467
+ var n = this.offsets[e], l = e === this.offsets.length - 1 ? this.length : this.offsets[e + 1];
3468
+ return l - n;
3469
+ }, t;
3470
+ }();
3471
+ function pe(t, e = null) {
3472
+ "children" in t && t.children.forEach((n) => pe(n, t)), "anchor" in t && t.anchor && pe(t.anchor, t), "tag" in t && t.tag && pe(t.tag, t), "leadingComments" in t && t.leadingComments.forEach((n) => pe(n, t)), "middleComments" in t && t.middleComments.forEach((n) => pe(n, t)), "indicatorComment" in t && t.indicatorComment && pe(t.indicatorComment, t), "trailingComment" in t && t.trailingComment && pe(t.trailingComment, t), "endComments" in t && t.endComments.forEach((n) => pe(n, t)), Object.defineProperty(t, "_parent", { value: e, enumerable: !1 });
3473
+ }
3474
+ function et(t) {
3475
+ return `${t.line}:${t.column}`;
3476
+ }
3477
+ function gi(t) {
3478
+ pe(t);
3479
+ let e = yi(t), n = t.children.slice();
3480
+ t.comments.sort((l, g) => l.position.start.offset - g.position.end.offset).filter((l) => !l._parent).forEach((l) => {
3481
+ for (; n.length > 1 && l.position.start.line > n[0].position.end.line; ) n.shift();
3482
+ vi(l, e, n[0]);
3483
+ });
3484
+ }
3485
+ function yi(t) {
3486
+ let e = Array.from(new Array(t.position.end.line), () => ({}));
3487
+ for (let n of t.comments) e[n.position.start.line - 1].comment = n;
3488
+ return Nn(e, t), e;
3489
+ }
3490
+ function Nn(t, e) {
3491
+ if (e.position.start.offset !== e.position.end.offset) {
3492
+ if ("leadingComments" in e) {
3493
+ let { start: n } = e.position, { leadingAttachableNode: l } = t[n.line - 1];
3494
+ (!l || n.column < l.position.start.column) && (t[n.line - 1].leadingAttachableNode = e);
3495
+ }
3496
+ if ("trailingComment" in e && e.position.end.column > 1 && e.type !== "document" && e.type !== "documentHead") {
3497
+ let { end: n } = e.position, { trailingAttachableNode: l } = t[n.line - 1];
3498
+ (!l || n.column >= l.position.end.column) && (t[n.line - 1].trailingAttachableNode = e);
3499
+ }
3500
+ if (e.type !== "root" && e.type !== "document" && e.type !== "documentHead" && e.type !== "documentBody") {
3501
+ let { start: n, end: l } = e.position, g = [l.line].concat(n.line === l.line ? [] : n.line);
3502
+ for (let E of g) {
3503
+ let b = t[E - 1].trailingNode;
3504
+ (!b || l.column >= b.position.end.column) && (t[E - 1].trailingNode = e);
3505
+ }
3506
+ }
3507
+ "children" in e && e.children.forEach((n) => {
3508
+ Nn(t, n);
3509
+ });
3510
+ }
3511
+ }
3512
+ function vi(t, e, n) {
3513
+ let l = t.position.start.line, { trailingAttachableNode: g } = e[l - 1];
3514
+ if (g) {
3515
+ if (g.trailingComment) throw new Error(`Unexpected multiple trailing comment at ${et(t.position.start)}`);
3516
+ pe(t, g), g.trailingComment = t;
3517
+ return;
3518
+ }
3519
+ for (let b = l; b >= n.position.start.line; b--) {
3520
+ let { trailingNode: L } = e[b - 1], M;
3521
+ if (L) M = L;
3522
+ else if (b !== l && e[b - 1].comment) M = e[b - 1].comment._parent;
3523
+ else continue;
3524
+ if ((M.type === "sequence" || M.type === "mapping") && (M = M.children[0]), M.type === "mappingItem") {
3525
+ let [I, P] = M.children;
3526
+ M = An(I) ? I : P;
3527
+ }
3528
+ for (; ; ) {
3529
+ if (Ei(M, t)) {
3530
+ pe(t, M), M.endComments.push(t);
3531
+ return;
3532
+ }
3533
+ if (!M._parent) break;
3534
+ M = M._parent;
3535
+ }
3536
+ break;
3537
+ }
3538
+ for (let b = l + 1; b <= n.position.end.line; b++) {
3539
+ let { leadingAttachableNode: L } = e[b - 1];
3540
+ if (L) {
3541
+ pe(t, L), L.leadingComments.push(t);
3542
+ return;
3543
+ }
3544
+ }
3545
+ let E = n.children[1];
3546
+ pe(t, E), E.endComments.push(t);
3547
+ }
3548
+ function Ei(t, e) {
3549
+ if (t.position.start.offset < e.position.start.offset && t.position.end.offset > e.position.end.offset) switch (t.type) {
3550
+ case "flowMapping":
3551
+ case "flowSequence":
3552
+ return t.children.length === 0 || e.position.start.line > t.children[t.children.length - 1].position.end.line;
3553
+ }
3554
+ if (e.position.end.offset < t.position.end.offset) return !1;
3555
+ switch (t.type) {
3556
+ case "sequenceItem":
3557
+ return e.position.start.column > t.position.start.column;
3558
+ case "mappingKey":
3559
+ case "mappingValue":
3560
+ return e.position.start.column > t._parent.position.start.column && (t.children.length === 0 || t.children.length === 1 && t.children[0].type !== "blockFolded" && t.children[0].type !== "blockLiteral") && (t.type === "mappingValue" || An(t));
3561
+ default:
3562
+ return !1;
3563
+ }
3564
+ }
3565
+ function An(t) {
3566
+ return t.position.start !== t.position.end && (t.children.length === 0 || t.position.start.offset !== t.children[0].position.start.offset);
3567
+ }
3568
+ function le(t, e) {
3569
+ return { type: t, position: e };
3570
+ }
3571
+ function Si(t, e, n) {
3572
+ return { ...le("root", t), children: e, comments: n };
3573
+ }
3574
+ function Ge(t) {
3575
+ switch (t.type) {
3576
+ case "DOCUMENT":
3577
+ for (let e = t.contents.length - 1; e >= 0; e--) t.contents[e].type === "BLANK_LINE" ? t.contents.splice(e, 1) : Ge(t.contents[e]);
3578
+ for (let e = t.directives.length - 1; e >= 0; e--) t.directives[e].type === "BLANK_LINE" && t.directives.splice(e, 1);
3579
+ break;
3580
+ case "FLOW_MAP":
3581
+ case "FLOW_SEQ":
3582
+ case "MAP":
3583
+ case "SEQ":
3584
+ for (let e = t.items.length - 1; e >= 0; e--) {
3585
+ let n = t.items[e];
3586
+ "char" in n || (n.type === "BLANK_LINE" ? t.items.splice(e, 1) : Ge(n));
3587
+ }
3588
+ break;
3589
+ case "MAP_KEY":
3590
+ case "MAP_VALUE":
3591
+ case "SEQ_ITEM":
3592
+ t.node && Ge(t.node);
3593
+ break;
3594
+ case "ALIAS":
3595
+ case "BLANK_LINE":
3596
+ case "BLOCK_FOLDED":
3597
+ case "BLOCK_LITERAL":
3598
+ case "COMMENT":
3599
+ case "DIRECTIVE":
3600
+ case "PLAIN":
3601
+ case "QUOTE_DOUBLE":
3602
+ case "QUOTE_SINGLE":
3603
+ break;
3604
+ default:
3605
+ throw new Error(`Unexpected node type ${JSON.stringify(t.type)}`);
3606
+ }
3607
+ }
3608
+ function Be() {
3609
+ return { leadingComments: [] };
3610
+ }
3611
+ function nt(t = null) {
3612
+ return { trailingComment: t };
3613
+ }
3614
+ function Pe() {
3615
+ return { ...Be(), ...nt() };
3616
+ }
3617
+ function bi(t, e, n) {
3618
+ return { ...le("alias", t), ...Pe(), ...e, value: n };
3619
+ }
3620
+ function wi(t, e) {
3621
+ let n = t.cstNode;
3622
+ return bi(e.transformRange({ origStart: n.valueRange.origStart - 1, origEnd: n.valueRange.origEnd }), e.transformContent(t), n.rawValue);
3623
+ }
3624
+ function Oi(t) {
3625
+ return { ...t, type: "blockFolded" };
3626
+ }
3627
+ function Ni(t, e, n, l, g, E) {
3628
+ return { ...le("blockValue", t), ...Be(), ...e, chomping: n, indent: l, value: g, indicatorComment: E };
3629
+ }
3630
+ var _e;
3631
+ (function(t) {
3632
+ t.Tag = "!", t.Anchor = "&", t.Comment = "#";
3633
+ })(_e || (_e = {}));
3634
+ function Ai(t, e) {
3635
+ return { ...le("anchor", t), value: e };
3636
+ }
3637
+ function Mt(t, e) {
3638
+ return { ...le("comment", t), value: e };
3639
+ }
3640
+ function Li(t, e, n) {
3641
+ return { anchor: e, tag: t, middleComments: n };
3642
+ }
3643
+ function Mi(t, e) {
3644
+ return { ...le("tag", t), value: e };
3645
+ }
3646
+ function Ln(t, e, n = () => !1) {
3647
+ let l = t.cstNode, g = [], E = null, b = null, L = null;
3648
+ for (let M of l.props) {
3649
+ let I = e.text[M.origStart];
3650
+ switch (I) {
3651
+ case _e.Tag:
3652
+ E = E || M, b = Mi(e.transformRange(M), t.tag);
3653
+ break;
3654
+ case _e.Anchor:
3655
+ E = E || M, L = Ai(e.transformRange(M), l.anchor);
3656
+ break;
3657
+ case _e.Comment: {
3658
+ let P = Mt(e.transformRange(M), e.text.slice(M.origStart + 1, M.origEnd));
3659
+ e.comments.push(P), !n(P) && E && E.origEnd <= M.origStart && M.origEnd <= l.valueRange.origStart && g.push(P);
3660
+ break;
3661
+ }
3662
+ default:
3663
+ throw new Error(`Unexpected leading character ${JSON.stringify(I)}`);
3664
+ }
3665
+ }
3666
+ return Li(b, L, g);
3667
+ }
3668
+ var yt;
3669
+ (function(t) {
3670
+ t.CLIP = "clip", t.STRIP = "strip", t.KEEP = "keep";
3671
+ })(yt || (yt = {}));
3672
+ function Mn(t, e) {
3673
+ let n = t.cstNode, l = 1, g = n.chomping === "CLIP" ? 0 : 1, E = n.header.origEnd - n.header.origStart - l - g !== 0, b = e.transformRange({ origStart: n.header.origStart, origEnd: n.valueRange.origEnd }), L = null, M = Ln(t, e, (I) => {
3674
+ if (!(b.start.offset < I.position.start.offset && I.position.end.offset < b.end.offset)) return !1;
3675
+ if (L) throw new Error(`Unexpected multiple indicator comments at ${et(I.position.start)}`);
3676
+ return L = I, !0;
3677
+ });
3678
+ return Ni(b, M, yt[n.chomping], E ? n.blockIndent : null, n.strValue, L);
3679
+ }
3680
+ function Ti(t, e) {
3681
+ return Oi(Mn(t, e));
3682
+ }
3683
+ function xi(t) {
3684
+ return { ...t, type: "blockLiteral" };
3685
+ }
3686
+ function Ci(t, e) {
3687
+ return xi(Mn(t, e));
3688
+ }
3689
+ function ki(t, e) {
3690
+ return Mt(e.transformRange(t.range), t.comment);
3691
+ }
3692
+ function Ii(t, e, n) {
3693
+ return { ...le("directive", t), ...Pe(), name: e, parameters: n };
3694
+ }
3695
+ function Tt(t, e) {
3696
+ for (let n of t.props) {
3697
+ let l = e.text[n.origStart];
3698
+ switch (l) {
3699
+ case _e.Comment:
3700
+ e.comments.push(Mt(e.transformRange(n), e.text.slice(n.origStart + 1, n.origEnd)));
3701
+ break;
3702
+ default:
3703
+ throw new Error(`Unexpected leading character ${JSON.stringify(l)}`);
3704
+ }
3705
+ }
3706
+ }
3707
+ function Pi(t, e) {
3708
+ return Tt(t, e), Ii(e.transformRange(t.range), t.name, t.parameters);
3709
+ }
3710
+ function $i(t, e, n, l) {
3711
+ return { ...le("document", t), ...nt(l), children: [e, n] };
3712
+ }
3713
+ function ke(t, e) {
3714
+ return { start: t, end: e };
3715
+ }
3716
+ function Yt(t) {
3717
+ return { start: t, end: t };
3718
+ }
3719
+ function $e(t = []) {
3720
+ return { endComments: t };
3721
+ }
3722
+ function Ri(t, e, n) {
3723
+ return { ...le("documentBody", t), ...$e(n), children: e ? [e] : [] };
3724
+ }
3725
+ function xe(t) {
3726
+ return t[t.length - 1];
3727
+ }
3728
+ function Tn(t, e) {
3729
+ let n = t.match(e);
3730
+ return n ? n.index : -1;
3731
+ }
3732
+ function _i(t, e, n) {
3733
+ let l = t.cstNode, { comments: g, endComments: E, documentTrailingComment: b, documentHeadTrailingComment: L } = Yi(l, e, n), M = e.transformNode(t.contents), { position: I, documentEndPoint: P } = Bi(l, M, e);
3734
+ return e.comments.push(...g, ...E), { documentBody: Ri(I, M, E), documentEndPoint: P, documentTrailingComment: b, documentHeadTrailingComment: L };
3735
+ }
3736
+ function Yi(t, e, n) {
3737
+ let l = [], g = [], E = [], b = [], L = !1;
3738
+ for (let M = t.contents.length - 1; M >= 0; M--) {
3739
+ let I = t.contents[M];
3740
+ if (I.type === "COMMENT") {
3741
+ let P = e.transformNode(I);
3742
+ n && n.line === P.position.start.line ? b.unshift(P) : L ? l.unshift(P) : P.position.start.offset >= t.valueRange.origEnd ? E.unshift(P) : l.unshift(P);
3743
+ } else L = !0;
3744
+ }
3745
+ if (E.length > 1) throw new Error(`Unexpected multiple document trailing comments at ${et(E[1].position.start)}`);
3746
+ if (b.length > 1) throw new Error(`Unexpected multiple documentHead trailing comments at ${et(b[1].position.start)}`);
3747
+ return { comments: l, endComments: g, documentTrailingComment: xe(E) || null, documentHeadTrailingComment: xe(b) || null };
3748
+ }
3749
+ function Bi(t, e, n) {
3750
+ let l = Tn(n.text.slice(t.valueRange.origEnd), /^\.\.\./), g = l === -1 ? t.valueRange.origEnd : Math.max(0, t.valueRange.origEnd - 1);
3751
+ n.text[g - 1] === "\r" && g--;
3752
+ let E = n.transformRange({ origStart: e !== null ? e.position.start.offset : g, origEnd: g }), b = l === -1 ? E.end : n.transformOffset(t.valueRange.origEnd + 3);
3753
+ return { position: E, documentEndPoint: b };
3754
+ }
3755
+ function Di(t, e, n, l) {
3756
+ return { ...le("documentHead", t), ...$e(n), ...nt(l), children: e };
3757
+ }
3758
+ function Fi(t, e) {
3759
+ let n = t.cstNode, { directives: l, comments: g, endComments: E } = Wi(n, e), { position: b, endMarkerPoint: L } = ji(n, l, e);
3760
+ return e.comments.push(...g, ...E), { createDocumentHeadWithTrailingComment: (M) => (M && e.comments.push(M), Di(b, l, E, M)), documentHeadEndMarkerPoint: L };
3761
+ }
3762
+ function Wi(t, e) {
3763
+ let n = [], l = [], g = [], E = !1;
3764
+ for (let b = t.directives.length - 1; b >= 0; b--) {
3765
+ let L = e.transformNode(t.directives[b]);
3766
+ L.type === "comment" ? E ? l.unshift(L) : g.unshift(L) : (E = !0, n.unshift(L));
3767
+ }
3768
+ return { directives: n, comments: l, endComments: g };
3769
+ }
3770
+ function ji(t, e, n) {
3771
+ let l = Tn(n.text.slice(0, t.valueRange.origStart), /---\s*$/);
3772
+ l > 0 && !/[\r\n]/.test(n.text[l - 1]) && (l = -1);
3773
+ let g = l === -1 ? { origStart: t.valueRange.origStart, origEnd: t.valueRange.origStart } : { origStart: l, origEnd: l + 3 };
3774
+ return e.length !== 0 && (g.origStart = e[0].position.start.offset), { position: n.transformRange(g), endMarkerPoint: l === -1 ? null : n.transformOffset(l) };
3775
+ }
3776
+ function qi(t, e) {
3777
+ let { createDocumentHeadWithTrailingComment: n, documentHeadEndMarkerPoint: l } = Fi(t, e), { documentBody: g, documentEndPoint: E, documentTrailingComment: b, documentHeadTrailingComment: L } = _i(t, e, l), M = n(L);
3778
+ return b && e.comments.push(b), $i(ke(M.position.start, E), M, g, b);
3779
+ }
3780
+ function xn(t, e, n) {
3781
+ return { ...le("flowCollection", t), ...Pe(), ...$e(), ...e, children: n };
3782
+ }
3783
+ function Ki(t, e, n) {
3784
+ return { ...xn(t, e, n), type: "flowMapping" };
3785
+ }
3786
+ function Cn(t, e, n) {
3787
+ return { ...le("flowMappingItem", t), ...Be(), children: [e, n] };
3788
+ }
3789
+ function rt(t, e) {
3790
+ let n = [];
3791
+ for (let l of t) l && "type" in l && l.type === "COMMENT" ? e.comments.push(e.transformNode(l)) : n.push(l);
3792
+ return n;
3793
+ }
3794
+ function kn(t) {
3795
+ let [e, n] = ["?", ":"].map((l) => {
3796
+ let g = t.find((E) => "char" in E && E.char === l);
3797
+ return g ? { origStart: g.origOffset, origEnd: g.origOffset + 1 } : null;
3798
+ });
3799
+ return { additionalKeyRange: e, additionalValueRange: n };
3800
+ }
3801
+ function In(t, e) {
3802
+ let n = e;
3803
+ return (l) => t.slice(n, n = l);
3804
+ }
3805
+ function Pn(t) {
3806
+ let e = [], n = In(t, 1), l = !1;
3807
+ for (let g = 1; g < t.length - 1; g++) {
3808
+ let E = t[g];
3809
+ if ("char" in E && E.char === ",") {
3810
+ e.push(n(g)), n(g + 1), l = !1;
3811
+ continue;
3812
+ }
3813
+ l = !0;
3814
+ }
3815
+ return l && e.push(n(t.length - 1)), e;
3816
+ }
3817
+ function Bt(t, e) {
3818
+ return { ...le("mappingKey", t), ...nt(), ...$e(), children: e ? [e] : [] };
3819
+ }
3820
+ function Dt(t, e) {
3821
+ return { ...le("mappingValue", t), ...Pe(), ...$e(), children: e ? [e] : [] };
3822
+ }
3823
+ function xt(t, e, n, l, g) {
3824
+ let E = e.transformNode(t.key), b = e.transformNode(t.value), L = E || l ? Bt(e.transformRange({ origStart: l ? l.origStart : E.position.start.offset, origEnd: E ? E.position.end.offset : l.origStart + 1 }), E) : null, M = b || g ? Dt(e.transformRange({ origStart: g ? g.origStart : b.position.start.offset, origEnd: b ? b.position.end.offset : g.origStart + 1 }), b) : null;
3825
+ return n(ke(L ? L.position.start : M.position.start, M ? M.position.end : L.position.end), L || Bt(Yt(M.position.start), null), M || Dt(Yt(L.position.end), null));
3826
+ }
3827
+ function Ui(t, e) {
3828
+ let n = rt(t.cstNode.items, e), l = Pn(n), g = t.items.map((L, M) => {
3829
+ let I = l[M], { additionalKeyRange: P, additionalValueRange: Q } = kn(I);
3830
+ return xt(L, e, Cn, P, Q);
3831
+ }), E = n[0], b = xe(n);
3832
+ return Ki(e.transformRange({ origStart: E.origOffset, origEnd: b.origOffset + 1 }), e.transformContent(t), g);
3833
+ }
3834
+ function Vi(t, e, n) {
3835
+ return { ...xn(t, e, n), type: "flowSequence" };
3836
+ }
3837
+ function Qi(t, e) {
3838
+ return { ...le("flowSequenceItem", t), children: [e] };
3839
+ }
3840
+ function Ji(t, e) {
3841
+ let n = rt(t.cstNode.items, e), l = Pn(n), g = t.items.map((L, M) => {
3842
+ if (L.type !== "PAIR") {
3843
+ let I = e.transformNode(L);
3844
+ return Qi(ke(I.position.start, I.position.end), I);
3845
+ } else {
3846
+ let I = l[M], { additionalKeyRange: P, additionalValueRange: Q } = kn(I);
3847
+ return xt(L, e, Cn, P, Q);
3848
+ }
3849
+ }), E = n[0], b = xe(n);
3850
+ return Vi(e.transformRange({ origStart: E.origOffset, origEnd: b.origOffset + 1 }), e.transformContent(t), g);
3851
+ }
3852
+ function Hi(t, e, n) {
3853
+ return { ...le("mapping", t), ...Be(), ...e, children: n };
3854
+ }
3855
+ function Gi(t, e, n) {
3856
+ return { ...le("mappingItem", t), ...Be(), children: [e, n] };
3857
+ }
3858
+ function Zi(t, e) {
3859
+ let n = t.cstNode;
3860
+ n.items.filter((b) => b.type === "MAP_KEY" || b.type === "MAP_VALUE").forEach((b) => Tt(b, e));
3861
+ let l = rt(n.items, e), g = Xi(l), E = t.items.map((b, L) => {
3862
+ let M = g[L], [I, P] = M[0].type === "MAP_VALUE" ? [null, M[0].range] : [M[0].range, M.length === 1 ? null : M[1].range];
3863
+ return xt(b, e, Gi, I, P);
3864
+ });
3865
+ return Hi(ke(E[0].position.start, xe(E).position.end), e.transformContent(t), E);
3866
+ }
3867
+ function Xi(t) {
3868
+ let e = [], n = In(t, 0), l = !1;
3869
+ for (let g = 0; g < t.length; g++) {
3870
+ if (t[g].type === "MAP_VALUE") {
3871
+ e.push(n(g + 1)), l = !1;
3872
+ continue;
3873
+ }
3874
+ l && e.push(n(g)), l = !0;
3875
+ }
3876
+ return l && e.push(n(1 / 0)), e;
3877
+ }
3878
+ function zi(t, e, n) {
3879
+ return { ...le("plain", t), ...Pe(), ...e, value: n };
3880
+ }
3881
+ function es(t, e, n) {
3882
+ for (let l = e; l >= 0; l--) if (n.test(t[l])) return l;
3883
+ return -1;
3884
+ }
3885
+ function ts(t, e) {
3886
+ let n = t.cstNode;
3887
+ return zi(e.transformRange({ origStart: n.valueRange.origStart, origEnd: es(e.text, n.valueRange.origEnd - 1, /\S/) + 1 }), e.transformContent(t), n.strValue);
3888
+ }
3889
+ function ns(t) {
3890
+ return { ...t, type: "quoteDouble" };
3891
+ }
3892
+ function rs(t, e, n) {
3893
+ return { ...le("quoteValue", t), ...e, ...Pe(), value: n };
3894
+ }
3895
+ function $n(t, e) {
3896
+ let n = t.cstNode;
3897
+ return rs(e.transformRange(n.valueRange), e.transformContent(t), n.strValue);
3898
+ }
3899
+ function is(t, e) {
3900
+ return ns($n(t, e));
3901
+ }
3902
+ function ss(t) {
3903
+ return { ...t, type: "quoteSingle" };
3904
+ }
3905
+ function os(t, e) {
3906
+ return ss($n(t, e));
3907
+ }
3908
+ function as(t, e, n) {
3909
+ return { ...le("sequence", t), ...Be(), ...$e(), ...e, children: n };
3910
+ }
3911
+ function ls(t, e) {
3912
+ return { ...le("sequenceItem", t), ...Pe(), ...$e(), children: e ? [e] : [] };
3913
+ }
3914
+ function cs(t, e) {
3915
+ let n = rt(t.cstNode.items, e).map((l, g) => {
3916
+ Tt(l, e);
3917
+ let E = e.transformNode(t.items[g]);
3918
+ return ls(ke(e.transformOffset(l.valueRange.origStart), E === null ? e.transformOffset(l.valueRange.origStart + 1) : E.position.end), E);
3919
+ });
3920
+ return as(ke(n[0].position.start, xe(n).position.end), e.transformContent(t), n);
3921
+ }
3922
+ function us(t, e) {
3923
+ if (t === null || t.type === void 0 && t.value === null) return null;
3924
+ switch (t.type) {
3925
+ case "ALIAS":
3926
+ return wi(t, e);
3927
+ case "BLOCK_FOLDED":
3928
+ return Ti(t, e);
3929
+ case "BLOCK_LITERAL":
3930
+ return Ci(t, e);
3931
+ case "COMMENT":
3932
+ return ki(t, e);
3933
+ case "DIRECTIVE":
3934
+ return Pi(t, e);
3935
+ case "DOCUMENT":
3936
+ return qi(t, e);
3937
+ case "FLOW_MAP":
3938
+ return Ui(t, e);
3939
+ case "FLOW_SEQ":
3940
+ return Ji(t, e);
3941
+ case "MAP":
3942
+ return Zi(t, e);
3943
+ case "PLAIN":
3944
+ return ts(t, e);
3945
+ case "QUOTE_DOUBLE":
3946
+ return is(t, e);
3947
+ case "QUOTE_SINGLE":
3948
+ return os(t, e);
3949
+ case "SEQ":
3950
+ return cs(t, e);
3951
+ default:
3952
+ throw new Error(`Unexpected node type ${t.type}`);
3953
+ }
3954
+ }
3955
+ function fs(t, e, n) {
3956
+ let l = new SyntaxError(t);
3957
+ return l.name = "YAMLSyntaxError", l.source = e, l.position = n, l;
3958
+ }
3959
+ function ps(t, e) {
3960
+ let n = t.source.range || t.source.valueRange;
3961
+ return fs(t.message, e.text, e.transformRange(n));
3962
+ }
3963
+ function ds(t, e, n) {
3964
+ return { offset: t, line: e, column: n };
3965
+ }
3966
+ function hs(t, e) {
3967
+ t < 0 ? t = 0 : t > e.text.length && (t = e.text.length);
3968
+ let n = e.locator.locationForIndex(t);
3969
+ return ds(t, n.line + 1, n.column + 1);
3970
+ }
3971
+ function ms(t, e) {
3972
+ return ke(e.transformOffset(t.origStart), e.transformOffset(t.origEnd));
3973
+ }
3974
+ function gs(t) {
3975
+ if (!t.setOrigRanges()) {
3976
+ let e = (n) => {
3977
+ if (ys(n)) return n.origStart = n.start, n.origEnd = n.end, !0;
3978
+ if (vs(n)) return n.origOffset = n.offset, !0;
3979
+ };
3980
+ t.forEach((n) => vt(n, e));
3981
+ }
3982
+ }
3983
+ function vt(t, e) {
3984
+ if (!(!t || typeof t != "object") && e(t) !== !0) for (let n of Object.keys(t)) {
3985
+ if (n === "context" || n === "error") continue;
3986
+ let l = t[n];
3987
+ Array.isArray(l) ? l.forEach((g) => vt(g, e)) : vt(l, e);
3988
+ }
3989
+ }
3990
+ function ys(t) {
3991
+ return typeof t.start == "number";
3992
+ }
3993
+ function vs(t) {
3994
+ return typeof t.offset == "number";
3995
+ }
3996
+ function Rn(t) {
3997
+ if ("children" in t) {
3998
+ if (t.children.length === 1) {
3999
+ let e = t.children[0];
4000
+ if (e.type === "plain" && e.tag === null && e.anchor === null && e.value === "") return t.children.splice(0, 1), t;
4001
+ }
4002
+ t.children.forEach(Rn);
4003
+ }
4004
+ return t;
4005
+ }
4006
+ function Ft(t, e, n, l) {
4007
+ let g = e(t);
4008
+ return (E) => {
4009
+ l(g, E) && n(t, g = E);
4010
+ };
4011
+ }
4012
+ function _n(t) {
4013
+ if (t === null || !("children" in t)) return;
4014
+ let e = t.children;
4015
+ if (e.forEach(_n), t.type === "document") {
4016
+ let [E, b] = t.children;
4017
+ E.position.start.offset === E.position.end.offset ? E.position.start = E.position.end = b.position.start : b.position.start.offset === b.position.end.offset && (b.position.start = b.position.end = E.position.end);
4018
+ }
4019
+ let n = Ft(t.position, Es, Ss, Os), l = Ft(t.position, bs, ws, Ns);
4020
+ "endComments" in t && t.endComments.length !== 0 && (n(t.endComments[0].position.start), l(xe(t.endComments).position.end));
4021
+ let g = e.filter((E) => E !== null);
4022
+ if (g.length !== 0) {
4023
+ let E = g[0], b = xe(g);
4024
+ n(E.position.start), l(b.position.end), "leadingComments" in E && E.leadingComments.length !== 0 && n(E.leadingComments[0].position.start), "tag" in E && E.tag && n(E.tag.position.start), "anchor" in E && E.anchor && n(E.anchor.position.start), "trailingComment" in b && b.trailingComment && l(b.trailingComment.position.end);
4025
+ }
4026
+ }
4027
+ function Es(t) {
4028
+ return t.start;
4029
+ }
4030
+ function Ss(t, e) {
4031
+ t.start = e;
4032
+ }
4033
+ function bs(t) {
4034
+ return t.end;
4035
+ }
4036
+ function ws(t, e) {
4037
+ t.end = e;
4038
+ }
4039
+ function Os(t, e) {
4040
+ return e.offset < t.offset;
4041
+ }
4042
+ function Ns(t, e) {
4043
+ return e.offset > t.offset;
4044
+ }
4045
+ var As = jt(ar()), ye = jt(lr());
4046
+ ye.default.findPair;
4047
+ ye.default.toJSON;
4048
+ ye.default.parseMap;
4049
+ ye.default.parseSeq;
4050
+ ye.default.stringifyNumber;
4051
+ ye.default.stringifyString;
4052
+ ye.default.Type;
4053
+ ye.default.YAMLError;
4054
+ ye.default.YAMLReferenceError;
4055
+ var Ls = ye.default.YAMLSemanticError;
4056
+ ye.default.YAMLSyntaxError;
4057
+ ye.default.YAMLWarning;
4058
+ var { Document: Ms, parseCST: Ts } = As.default;
4059
+ function xs(t) {
4060
+ let e = Ts(t);
4061
+ gs(e);
4062
+ let n = e.map((L) => new Ms({ merge: !1, keepCstNodes: !0 }).parse(L)), l = new mi(t), g = [], E = { text: t, locator: l, comments: g, transformOffset: (L) => hs(L, E), transformRange: (L) => ms(L, E), transformNode: (L) => us(L, E), transformContent: (L) => Ln(L, E) };
4063
+ for (let L of n) for (let M of L.errors) if (!(M instanceof Ls && M.message === 'Map keys must be unique; "<<" is repeated')) throw ps(M, E);
4064
+ n.forEach((L) => Ge(L.cstNode));
4065
+ let b = Si(E.transformRange({ origStart: 0, origEnd: E.text.length }), n.map(E.transformNode), g);
4066
+ return gi(b), _n(b), Rn(b), b;
4067
+ }
4068
+ function Cs(t, e) {
4069
+ let n = new SyntaxError(t + " (" + e.loc.start.line + ":" + e.loc.start.column + ")");
4070
+ return Object.assign(n, e);
4071
+ }
4072
+ var ks = Cs;
4073
+ function Is(t) {
4074
+ try {
4075
+ let e = xs(t);
4076
+ return delete e.comments, e;
4077
+ } catch (e) {
4078
+ throw e != null && e.position ? ks(e.message, { loc: e.position, cause: e }) : e;
4079
+ }
4080
+ }
4081
+ var Ps = { astFormat: "yaml", parse: Is, hasPragma: jr, locStart: Xe, locEnd: Fr }, $s = { yaml: fi }, _s = en;
4082
+ export {
4083
+ _s as default,
4084
+ pi as languages,
4085
+ hi as options,
4086
+ On as parsers,
4087
+ $s as printers
4088
+ };