@redocly/replay 0.30.0-next.6 → 0.30.0-next.7

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 (61) hide show
  1. package/dist/{replay-AiChatProvider-DoRCY0EW.js → replay-AiChatProvider-BM8abqH8.js} +6 -6
  2. package/dist/{replay-AiChatProvider-C3qDrsGk.js → replay-AiChatProvider-LxWuWgjK.js} +1 -1
  3. package/dist/{replay-AiChatSqliteDBStorage-diN4PlB2.js → replay-AiChatSqliteDBStorage-ByM_jjvw.js} +1 -1
  4. package/dist/{replay-AiChatSqliteDBStorage-wwTMmol9.js → replay-AiChatSqliteDBStorage-C4tdDPBf.js} +1 -1
  5. package/dist/{replay-AiPanel-PzteJq_7.js → replay-AiPanel-DD1S543u.js} +1 -1
  6. package/dist/{replay-AiPanel-DZYI1gxl.js → replay-AiPanel-LQPU7h0J.js} +4 -4
  7. package/dist/{replay-FileWatcher-V3WDtOcM.js → replay-FileWatcher-BbFbSH7-.js} +2 -2
  8. package/dist/{replay-FileWatcher-C_6jy3Wh.js → replay-FileWatcher-BwY_TKXE.js} +1 -1
  9. package/dist/{replay-SemanticSearchService-D2inCMQ3.js → replay-SemanticSearchService-C2OaJcha.js} +1 -1
  10. package/dist/{replay-SemanticSearchService-AmeM3LJw.js → replay-SemanticSearchService-CVxK2RB-.js} +1 -1
  11. package/dist/{replay-SqliteDBStorage--5fINH4H.js → replay-SqliteDBStorage-BYMeLBll.js} +1 -1
  12. package/dist/{replay-SqliteDBStorage-CInxoFxc.js → replay-SqliteDBStorage-BiutW7pD.js} +1 -1
  13. package/dist/{replay-TauriFileSystemAdapter-A_qqPM6T.js → replay-TauriFileSystemAdapter-DOPckV5d.js} +1 -1
  14. package/dist/{replay-TauriFileSystemAdapter-DCsSYZBB.js → replay-TauriFileSystemAdapter-SpIElzCj.js} +1 -1
  15. package/dist/{replay-TauriRootStorage-CIMNjNWA.js → replay-TauriRootStorage-Cs8FdTRB.js} +1 -1
  16. package/dist/{replay-TauriRootStorage-B_sv-ME6.js → replay-TauriRootStorage-qdWzMQnK.js} +2 -2
  17. package/dist/{replay-agent-loop-uNRsrxPP.js → replay-agent-loop-CbONmEpU.js} +3 -3
  18. package/dist/{replay-agent-loop-BeQ_YIIx.js → replay-agent-loop-D20Uo83P.js} +1 -1
  19. package/dist/{replay-ai-chat-mappers-DNtt_SPh.js → replay-ai-chat-mappers-BoD5va2S.js} +1 -1
  20. package/dist/{replay-ai-chat-mappers-BBXGbAOR.js → replay-ai-chat-mappers-BqjA6a1R.js} +1 -1
  21. package/dist/{replay-create-model-CtOtNyrw.js → replay-create-model-ByXMw0Mz.js} +3 -3
  22. package/dist/{replay-create-model-AY_iX35Q.js → replay-create-model-iK8UnqLH.js} +3 -3
  23. package/dist/{replay-db-D-XadOSV.js → replay-db-BAptE3HS.js} +1 -1
  24. package/dist/{replay-db-uDj6nNNy.js → replay-db-KVbyscDg.js} +1 -1
  25. package/dist/{replay-external-resolver-DrlxaL8f.js → replay-external-resolver-CPTL9YMt.js} +1 -1
  26. package/dist/{replay-external-resolver-CsrESo8u.js → replay-external-resolver-yhrzSVh-.js} +2 -2
  27. package/dist/{replay-index-ChYZ25aj.js → replay-index-7c2fdTRw.js} +19214 -19044
  28. package/dist/{replay-index-ESb8_grh.js → replay-index-B7Ax7uI3.js} +1 -1
  29. package/dist/{replay-index-BPpkDtwi.js → replay-index-BJuio1mk.js} +1 -1
  30. package/dist/{replay-index--7gH3kdD.js → replay-index-C1rF4MIj.js} +1 -1
  31. package/dist/{replay-index-DwIgVIgf.js → replay-index-CRekxOYt.js} +5 -5
  32. package/dist/{replay-index-DUUea7Dh.js → replay-index-D66UFxK0.js} +1 -1
  33. package/dist/{replay-index-r7LIobSc.js → replay-index-DGVKGau4.js} +1230 -1133
  34. package/dist/replay-index-DcselHjq.js +4 -0
  35. package/dist/{replay-index-vwbyGRlg.js → replay-index-Dglne1rU.js} +1 -1
  36. package/dist/{replay-index-vCUeMo-a.js → replay-index-DsB14Sfy.js} +1 -1
  37. package/dist/{replay-index-CM6Nx3oe.js → replay-index-Du_9zDOG.js} +1 -1
  38. package/dist/{replay-index-dTSk_oL0.js → replay-index-TMDJfwog.js} +1 -1
  39. package/dist/{replay-lint-BC0x90Al.js → replay-lint-7C6uDSRh.js} +3 -3
  40. package/dist/{replay-lint-BtZoplmt.js → replay-lint-BmCBitNn.js} +3 -3
  41. package/dist/{replay-lint-graphql-B3l8e2SW.js → replay-lint-graphql--lxWSyCB.js} +1 -1
  42. package/dist/{replay-lint-graphql-DauCPK72.js → replay-lint-graphql-DbU8ryFL.js} +2 -2
  43. package/dist/{replay-periodic-revalidation-DvYq4LBE.js → replay-periodic-revalidation-C-RY1iAP.js} +1 -1
  44. package/dist/{replay-periodic-revalidation-CzWLzx7V.js → replay-periodic-revalidation-NOc0MUCR.js} +1 -1
  45. package/dist/replay-resolve-27HxVuKM.js +53 -0
  46. package/dist/replay-resolve-D1Ex_R0P.js +3879 -0
  47. package/dist/{replay-respect-run-D5Greqj8.js → replay-respect-run-9NB18649.js} +3 -3
  48. package/dist/{replay-respect-run-DMbPJCHl.js → replay-respect-run-Ba0IqCSQ.js} +1 -1
  49. package/dist/{replay-tauri-path-DFiAydTm.js → replay-tauri-path-L81YjxNO.js} +1 -1
  50. package/dist/{replay-tauri-path-DSX6AiF8.js → replay-tauri-path-WDQCkBMZ.js} +2 -2
  51. package/dist/{replay-useAiChatQueries-C6kn5QUT.js → replay-useAiChatQueries-CeNsH7jY.js} +1 -1
  52. package/dist/{replay-useAiChatQueries-P9UVQTUB.js → replay-useAiChatQueries-ChvOULLB.js} +4 -4
  53. package/dist/{replay-validate-key-Lp6NCJGM.js → replay-validate-key-BC0hj8Un.js} +1 -1
  54. package/dist/{replay-validate-key-BHt9qPog.js → replay-validate-key-DpZjfsH8.js} +2 -2
  55. package/dist/replay.cjs +1 -1
  56. package/dist/replay.d.ts +3 -0
  57. package/dist/replay.js +1 -1
  58. package/package.json +2 -2
  59. package/dist/replay-index-tLBGijHm.js +0 -4
  60. package/dist/replay-resolve-B51mYb48.js +0 -47
  61. package/dist/replay-resolve-DSJCGK18.js +0 -3739
@@ -1,3739 +0,0 @@
1
- import { X as gr, a6 as Qe, a7 as be } from "./replay-index-ChYZ25aj.js";
2
- function mr(e) {
3
- return !!e;
4
- }
5
- var bt = {}, vt, pn;
6
- function gt() {
7
- if (pn) return vt;
8
- pn = 1;
9
- const e = "\\\\/", t = `[^${e}]`, n = 0, r = "\\.", i = "\\+", o = "\\?", a = "\\/", s = "(?=.)", l = "[^/]", u = `(?:${a}|$)`, c = `(?:^|${a})`, S = `${r}{1,2}${u}`, m = `(?!${r})`, C = `(?!${c}${S})`, E = `(?!${r}{0,1}${u})`, w = `(?!${S})`, M = `[^.${a}]`, N = `${l}*?`, y = {
10
- DOT_LITERAL: r,
11
- PLUS_LITERAL: i,
12
- QMARK_LITERAL: o,
13
- SLASH_LITERAL: a,
14
- ONE_CHAR: s,
15
- QMARK: l,
16
- END_ANCHOR: u,
17
- DOTS_SLASH: S,
18
- NO_DOT: m,
19
- NO_DOTS: C,
20
- NO_DOT_SLASH: E,
21
- NO_DOTS_SLASH: w,
22
- QMARK_NO_DOT: M,
23
- STAR: N,
24
- START_ANCHOR: c,
25
- SEP: "/"
26
- }, R = {
27
- ...y,
28
- SLASH_LITERAL: `[${e}]`,
29
- QMARK: t,
30
- STAR: `${t}*?`,
31
- DOTS_SLASH: `${r}{1,2}(?:[${e}]|$)`,
32
- NO_DOT: `(?!${r})`,
33
- NO_DOTS: `(?!(?:^|[${e}])${r}{1,2}(?:[${e}]|$))`,
34
- NO_DOT_SLASH: `(?!${r}{0,1}(?:[${e}]|$))`,
35
- NO_DOTS_SLASH: `(?!${r}{1,2}(?:[${e}]|$))`,
36
- QMARK_NO_DOT: `[^.${e}]`,
37
- START_ANCHOR: `(?:^|[${e}])`,
38
- END_ANCHOR: `(?:[${e}]|$)`,
39
- SEP: "\\"
40
- }, f = {
41
- __proto__: null,
42
- alnum: "a-zA-Z0-9",
43
- alpha: "a-zA-Z",
44
- ascii: "\\x00-\\x7F",
45
- blank: " \\t",
46
- cntrl: "\\x00-\\x1F\\x7F",
47
- digit: "0-9",
48
- graph: "\\x21-\\x7E",
49
- lower: "a-z",
50
- print: "\\x20-\\x7E ",
51
- punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
52
- space: " \\t\\r\\n\\v\\f",
53
- upper: "A-Z",
54
- word: "A-Za-z0-9_",
55
- xdigit: "A-Fa-f0-9"
56
- };
57
- return vt = {
58
- DEFAULT_MAX_EXTGLOB_RECURSION: n,
59
- MAX_LENGTH: 1024 * 64,
60
- POSIX_REGEX_SOURCE: f,
61
- // regular expressions
62
- REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
63
- REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
64
- REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
65
- REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
66
- REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
67
- REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
68
- // Replace globs with equivalent patterns to reduce parsing time.
69
- REPLACEMENTS: {
70
- __proto__: null,
71
- "***": "*",
72
- "**/**": "**",
73
- "**/**/**": "**"
74
- },
75
- // Digits
76
- CHAR_0: 48,
77
- /* 0 */
78
- CHAR_9: 57,
79
- /* 9 */
80
- // Alphabet chars.
81
- CHAR_UPPERCASE_A: 65,
82
- /* A */
83
- CHAR_LOWERCASE_A: 97,
84
- /* a */
85
- CHAR_UPPERCASE_Z: 90,
86
- /* Z */
87
- CHAR_LOWERCASE_Z: 122,
88
- /* z */
89
- CHAR_LEFT_PARENTHESES: 40,
90
- /* ( */
91
- CHAR_RIGHT_PARENTHESES: 41,
92
- /* ) */
93
- CHAR_ASTERISK: 42,
94
- /* * */
95
- // Non-alphabetic chars.
96
- CHAR_AMPERSAND: 38,
97
- /* & */
98
- CHAR_AT: 64,
99
- /* @ */
100
- CHAR_BACKWARD_SLASH: 92,
101
- /* \ */
102
- CHAR_CARRIAGE_RETURN: 13,
103
- /* \r */
104
- CHAR_CIRCUMFLEX_ACCENT: 94,
105
- /* ^ */
106
- CHAR_COLON: 58,
107
- /* : */
108
- CHAR_COMMA: 44,
109
- /* , */
110
- CHAR_DOT: 46,
111
- /* . */
112
- CHAR_DOUBLE_QUOTE: 34,
113
- /* " */
114
- CHAR_EQUAL: 61,
115
- /* = */
116
- CHAR_EXCLAMATION_MARK: 33,
117
- /* ! */
118
- CHAR_FORM_FEED: 12,
119
- /* \f */
120
- CHAR_FORWARD_SLASH: 47,
121
- /* / */
122
- CHAR_GRAVE_ACCENT: 96,
123
- /* ` */
124
- CHAR_HASH: 35,
125
- /* # */
126
- CHAR_HYPHEN_MINUS: 45,
127
- /* - */
128
- CHAR_LEFT_ANGLE_BRACKET: 60,
129
- /* < */
130
- CHAR_LEFT_CURLY_BRACE: 123,
131
- /* { */
132
- CHAR_LEFT_SQUARE_BRACKET: 91,
133
- /* [ */
134
- CHAR_LINE_FEED: 10,
135
- /* \n */
136
- CHAR_NO_BREAK_SPACE: 160,
137
- /* \u00A0 */
138
- CHAR_PERCENT: 37,
139
- /* % */
140
- CHAR_PLUS: 43,
141
- /* + */
142
- CHAR_QUESTION_MARK: 63,
143
- /* ? */
144
- CHAR_RIGHT_ANGLE_BRACKET: 62,
145
- /* > */
146
- CHAR_RIGHT_CURLY_BRACE: 125,
147
- /* } */
148
- CHAR_RIGHT_SQUARE_BRACKET: 93,
149
- /* ] */
150
- CHAR_SEMICOLON: 59,
151
- /* ; */
152
- CHAR_SINGLE_QUOTE: 39,
153
- /* ' */
154
- CHAR_SPACE: 32,
155
- /* */
156
- CHAR_TAB: 9,
157
- /* \t */
158
- CHAR_UNDERSCORE: 95,
159
- /* _ */
160
- CHAR_VERTICAL_LINE: 124,
161
- /* | */
162
- CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
163
- /* \uFEFF */
164
- /**
165
- * Create EXTGLOB_CHARS
166
- */
167
- extglobChars(I) {
168
- return {
169
- "!": { type: "negate", open: "(?:(?!(?:", close: `))${I.STAR})` },
170
- "?": { type: "qmark", open: "(?:", close: ")?" },
171
- "+": { type: "plus", open: "(?:", close: ")+" },
172
- "*": { type: "star", open: "(?:", close: ")*" },
173
- "@": { type: "at", open: "(?:", close: ")" }
174
- };
175
- },
176
- /**
177
- * Create GLOB_CHARS
178
- */
179
- globChars(I) {
180
- return I === !0 ? R : y;
181
- }
182
- }, vt;
183
- }
184
- var dn;
185
- function mt() {
186
- return dn || (dn = 1, (function(e) {
187
- const {
188
- REGEX_BACKSLASH: t,
189
- REGEX_REMOVE_BACKSLASH: n,
190
- REGEX_SPECIAL_CHARS: r,
191
- REGEX_SPECIAL_CHARS_GLOBAL: i
192
- } = /* @__PURE__ */ gt();
193
- e.isObject = (o) => o !== null && typeof o == "object" && !Array.isArray(o), e.hasRegexChars = (o) => r.test(o), e.isRegexChar = (o) => o.length === 1 && e.hasRegexChars(o), e.escapeRegex = (o) => o.replace(i, "\\$1"), e.toPosixSlashes = (o) => o.replace(t, "/"), e.isWindows = () => {
194
- if (typeof navigator < "u" && navigator.platform) {
195
- const o = navigator.platform.toLowerCase();
196
- return o === "win32" || o === "windows";
197
- }
198
- return typeof process < "u" && process.platform ? process.platform === "win32" : !1;
199
- }, e.removeBackslashes = (o) => o.replace(n, (a) => a === "\\" ? "" : a), e.escapeLast = (o, a, s) => {
200
- const l = o.lastIndexOf(a, s);
201
- return l === -1 ? o : o[l - 1] === "\\" ? e.escapeLast(o, a, l - 1) : `${o.slice(0, l)}\\${o.slice(l)}`;
202
- }, e.removePrefix = (o, a = {}) => {
203
- let s = o;
204
- return s.startsWith("./") && (s = s.slice(2), a.prefix = "./"), s;
205
- }, e.wrapOutput = (o, a = {}, s = {}) => {
206
- const l = s.contains ? "" : "^", u = s.contains ? "" : "$";
207
- let c = `${l}(?:${o})${u}`;
208
- return a.negated === !0 && (c = `(?:^(?!${c}).*$)`), c;
209
- }, e.basename = (o, { windows: a } = {}) => {
210
- const s = o.split(a ? /[\\/]/ : "/"), l = s[s.length - 1];
211
- return l === "" ? s[s.length - 2] : l;
212
- };
213
- })(bt)), bt;
214
- }
215
- var Rt, hn;
216
- function Ar() {
217
- if (hn) return Rt;
218
- hn = 1;
219
- const e = /* @__PURE__ */ mt(), {
220
- CHAR_ASTERISK: t,
221
- /* * */
222
- CHAR_AT: n,
223
- /* @ */
224
- CHAR_BACKWARD_SLASH: r,
225
- /* \ */
226
- CHAR_COMMA: i,
227
- /* , */
228
- CHAR_DOT: o,
229
- /* . */
230
- CHAR_EXCLAMATION_MARK: a,
231
- /* ! */
232
- CHAR_FORWARD_SLASH: s,
233
- /* / */
234
- CHAR_LEFT_CURLY_BRACE: l,
235
- /* { */
236
- CHAR_LEFT_PARENTHESES: u,
237
- /* ( */
238
- CHAR_LEFT_SQUARE_BRACKET: c,
239
- /* [ */
240
- CHAR_PLUS: S,
241
- /* + */
242
- CHAR_QUESTION_MARK: m,
243
- /* ? */
244
- CHAR_RIGHT_CURLY_BRACE: C,
245
- /* } */
246
- CHAR_RIGHT_PARENTHESES: E,
247
- /* ) */
248
- CHAR_RIGHT_SQUARE_BRACKET: w
249
- /* ] */
250
- } = /* @__PURE__ */ gt(), M = (y) => y === s || y === r, N = (y) => {
251
- y.isPrefix !== !0 && (y.depth = y.isGlobstar ? 1 / 0 : 1);
252
- };
253
- return Rt = (y, R) => {
254
- const f = R || {}, I = y.length - 1, v = f.parts === !0 || f.tokens === !0 || f.scanToEnd === !0, A = [], g = [], x = [];
255
- let W = y, L = -1, U = 0, fe = 0, le = !1, he = !1, j = !1, ye = !1, Re = !1, ge = !1, K = !1, me = !1, xe = !1, ne = !1, J = 0, ce, $, F = { value: "", depth: 0, isGlob: !1 };
256
- const p = () => L >= I, re = () => W.charCodeAt(L + 1), X = () => (ce = $, W.charCodeAt(++L));
257
- for (; L < I; ) {
258
- $ = X();
259
- let D;
260
- if ($ === r) {
261
- K = F.backslashes = !0, $ = X(), $ === l && (ge = !0);
262
- continue;
263
- }
264
- if (ge === !0 || $ === l) {
265
- for (J++; p() !== !0 && ($ = X()); ) {
266
- if ($ === r) {
267
- K = F.backslashes = !0, X();
268
- continue;
269
- }
270
- if ($ === l) {
271
- J++;
272
- continue;
273
- }
274
- if (ge !== !0 && $ === o && ($ = X()) === o) {
275
- if (le = F.isBrace = !0, j = F.isGlob = !0, ne = !0, v === !0)
276
- continue;
277
- break;
278
- }
279
- if (ge !== !0 && $ === i) {
280
- if (le = F.isBrace = !0, j = F.isGlob = !0, ne = !0, v === !0)
281
- continue;
282
- break;
283
- }
284
- if ($ === C && (J--, J === 0)) {
285
- ge = !1, le = F.isBrace = !0, ne = !0;
286
- break;
287
- }
288
- }
289
- if (v === !0)
290
- continue;
291
- break;
292
- }
293
- if ($ === s) {
294
- if (A.push(L), g.push(F), F = { value: "", depth: 0, isGlob: !1 }, ne === !0) continue;
295
- if (ce === o && L === U + 1) {
296
- U += 2;
297
- continue;
298
- }
299
- fe = L + 1;
300
- continue;
301
- }
302
- if (f.noext !== !0 && ($ === S || $ === n || $ === t || $ === m || $ === a) === !0 && re() === u) {
303
- if (j = F.isGlob = !0, ye = F.isExtglob = !0, ne = !0, $ === a && L === U && (xe = !0), v === !0) {
304
- let ue = 0;
305
- for (; p() !== !0 && ($ = X()); ) {
306
- if ($ === r) {
307
- K = F.backslashes = !0, X();
308
- continue;
309
- }
310
- if ($ === u) {
311
- ue++;
312
- continue;
313
- }
314
- if ($ === E && --ue === 0) {
315
- ne = !0;
316
- break;
317
- }
318
- }
319
- continue;
320
- }
321
- break;
322
- }
323
- if ($ === t) {
324
- if (ce === t && (Re = F.isGlobstar = !0), j = F.isGlob = !0, ne = !0, v === !0)
325
- continue;
326
- break;
327
- }
328
- if ($ === m) {
329
- if (j = F.isGlob = !0, ne = !0, v === !0)
330
- continue;
331
- break;
332
- }
333
- if ($ === c) {
334
- for (; p() !== !0 && (D = X()); ) {
335
- if (D === r) {
336
- K = F.backslashes = !0, X();
337
- continue;
338
- }
339
- if (D === w) {
340
- he = F.isBracket = !0, j = F.isGlob = !0, ne = !0;
341
- break;
342
- }
343
- }
344
- if (v === !0)
345
- continue;
346
- break;
347
- }
348
- if (f.nonegate !== !0 && $ === a && L === U) {
349
- me = F.negated = !0, U++;
350
- continue;
351
- }
352
- if (f.noparen !== !0 && $ === u) {
353
- if (j = F.isGlob = !0, v === !0) {
354
- let se = 1;
355
- for (; p() !== !0 && ($ = X()); ) {
356
- if ($ === r) {
357
- K = F.backslashes = !0, X();
358
- continue;
359
- }
360
- if ($ === u) {
361
- se++;
362
- continue;
363
- }
364
- if ($ === E && --se === 0) {
365
- ne = !0;
366
- break;
367
- }
368
- }
369
- continue;
370
- }
371
- break;
372
- }
373
- if (j === !0) {
374
- if (ne = !0, v === !0)
375
- continue;
376
- break;
377
- }
378
- }
379
- f.noext === !0 && (ye = !1, j = !1);
380
- let V = W, h = "", d = "";
381
- U > 0 && (h = W.slice(0, U), W = W.slice(U), fe -= U), V && j === !0 && fe > 0 ? (V = W.slice(0, fe), d = W.slice(fe)) : j === !0 ? (V = "", d = W) : V = W, V && V !== "" && V !== "/" && V !== W && M(V.charCodeAt(V.length - 1)) && (V = V.slice(0, -1)), f.unescape === !0 && (d && (d = e.removeBackslashes(d)), V && K === !0 && (V = e.removeBackslashes(V)));
382
- const pe = {
383
- prefix: h,
384
- input: y,
385
- start: U,
386
- base: V,
387
- glob: d,
388
- isBrace: le,
389
- isBracket: he,
390
- isGlob: j,
391
- isExtglob: ye,
392
- isGlobstar: Re,
393
- negated: me,
394
- negatedExtglob: xe
395
- };
396
- if (f.tokens === !0 && (pe.maxDepth = 0, M($) || g.push(F), pe.tokens = g), f.parts === !0 || f.tokens === !0) {
397
- let D;
398
- for (let z = 0; z < A.length; z++) {
399
- const Fe = D !== void 0 ? D + 1 : U, We = A[z], _e = y.slice(Fe, We);
400
- f.tokens && (z === 0 && U !== 0 ? (g[z].isPrefix = !0, g[z].value = h) : g[z].value = _e, N(g[z]), pe.maxDepth += g[z].depth), We >= U && (x.push(_e), D = We);
401
- }
402
- const se = D !== void 0 ? D + 1 : U, ue = y.slice(se);
403
- x.push(ue), f.tokens && D && D + 1 < y.length && (g[g.length - 1].value = ue, N(g[g.length - 1]), pe.maxDepth += g[g.length - 1].depth), pe.slashes = A, pe.parts = x;
404
- }
405
- return pe;
406
- }, Rt;
407
- }
408
- var xt, gn;
409
- function yr() {
410
- if (gn) return xt;
411
- gn = 1;
412
- const e = /* @__PURE__ */ gt(), t = /* @__PURE__ */ mt(), {
413
- MAX_LENGTH: n,
414
- POSIX_REGEX_SOURCE: r,
415
- REGEX_NON_SPECIAL_CHARS: i,
416
- REGEX_SPECIAL_CHARS_BACKREF: o,
417
- REPLACEMENTS: a
418
- } = e, s = (y, R) => {
419
- if (typeof R.expandRange == "function")
420
- return R.expandRange(...y, R);
421
- y.sort();
422
- const f = `[${y.join("-")}]`;
423
- try {
424
- new RegExp(f);
425
- } catch {
426
- return y.map((v) => t.escapeRegex(v)).join("..");
427
- }
428
- return f;
429
- }, l = (y, R) => `Missing ${y}: "${R}" - use "\\\\${R}" to match literal characters`, u = (y) => {
430
- const R = [];
431
- let f = 0, I = 0, v = 0, A = "", g = !1;
432
- for (const x of y) {
433
- if (g === !0) {
434
- A += x, g = !1;
435
- continue;
436
- }
437
- if (x === "\\") {
438
- A += x, g = !0;
439
- continue;
440
- }
441
- if (x === '"') {
442
- v = v === 1 ? 0 : 1, A += x;
443
- continue;
444
- }
445
- if (v === 0) {
446
- if (x === "[")
447
- f++;
448
- else if (x === "]" && f > 0)
449
- f--;
450
- else if (f === 0) {
451
- if (x === "(")
452
- I++;
453
- else if (x === ")" && I > 0)
454
- I--;
455
- else if (x === "|" && I === 0) {
456
- R.push(A), A = "";
457
- continue;
458
- }
459
- }
460
- }
461
- A += x;
462
- }
463
- return R.push(A), R;
464
- }, c = (y) => {
465
- let R = !1;
466
- for (const f of y) {
467
- if (R === !0) {
468
- R = !1;
469
- continue;
470
- }
471
- if (f === "\\") {
472
- R = !0;
473
- continue;
474
- }
475
- if (/[?*+@!()[\]{}]/.test(f))
476
- return !1;
477
- }
478
- return !0;
479
- }, S = (y) => {
480
- let R = y.trim(), f = !0;
481
- for (; f === !0; )
482
- f = !1, /^@\([^\\()[\]{}|]+\)$/.test(R) && (R = R.slice(2, -1), f = !0);
483
- if (c(R))
484
- return R.replace(/\\(.)/g, "$1");
485
- }, m = (y) => {
486
- const R = y.map(S).filter(Boolean);
487
- for (let f = 0; f < R.length; f++)
488
- for (let I = f + 1; I < R.length; I++) {
489
- const v = R[f], A = R[I], g = v[0];
490
- if (!(!g || v !== g.repeat(v.length) || A !== g.repeat(A.length)) && (v === A || v.startsWith(A) || A.startsWith(v)))
491
- return !0;
492
- }
493
- return !1;
494
- }, C = (y, R = !0) => {
495
- if (y[0] !== "+" && y[0] !== "*" || y[1] !== "(")
496
- return;
497
- let f = 0, I = 0, v = 0, A = !1;
498
- for (let g = 1; g < y.length; g++) {
499
- const x = y[g];
500
- if (A === !0) {
501
- A = !1;
502
- continue;
503
- }
504
- if (x === "\\") {
505
- A = !0;
506
- continue;
507
- }
508
- if (x === '"') {
509
- v = v === 1 ? 0 : 1;
510
- continue;
511
- }
512
- if (v !== 1) {
513
- if (x === "[") {
514
- f++;
515
- continue;
516
- }
517
- if (x === "]" && f > 0) {
518
- f--;
519
- continue;
520
- }
521
- if (!(f > 0)) {
522
- if (x === "(") {
523
- I++;
524
- continue;
525
- }
526
- if (x === ")" && (I--, I === 0))
527
- return R === !0 && g !== y.length - 1 ? void 0 : {
528
- type: y[0],
529
- body: y.slice(2, g),
530
- end: g
531
- };
532
- }
533
- }
534
- }
535
- }, E = (y) => `${y.length === 1 ? t.escapeRegex(y[0]) : `[${y.map((f) => t.escapeRegex(f)).join("")}]`}*`, w = (y) => {
536
- let R = 0;
537
- const f = [];
538
- for (; R < y.length; ) {
539
- const I = C(y.slice(R), !1);
540
- if (!I || I.type !== "*")
541
- return;
542
- const v = u(I.body).map((g) => g.trim());
543
- if (v.length !== 1)
544
- return;
545
- const A = S(v[0]);
546
- if (!A || A.length !== 1)
547
- return;
548
- f.push(A), R += I.end + 1;
549
- }
550
- if (!(f.length < 1))
551
- return f;
552
- }, M = (y) => {
553
- let R = 0, f = y.trim(), I = C(f);
554
- for (; I; )
555
- R++, f = I.body.trim(), I = C(f);
556
- return R;
557
- }, N = (y, R) => {
558
- if (R.maxExtglobRecursion === !1)
559
- return { risky: !1 };
560
- const f = typeof R.maxExtglobRecursion == "number" ? R.maxExtglobRecursion : e.DEFAULT_MAX_EXTGLOB_RECURSION, I = u(y).map((x) => x.trim());
561
- if (I.length > 1 && (I.some((x) => x === "") || I.some((x) => /^[*?]+$/.test(x)) || m(I)))
562
- return { risky: !0 };
563
- const v = [];
564
- let A = !1, g = !0;
565
- for (const x of I) {
566
- const W = w(x);
567
- if (W) {
568
- A = !0, v.push(...W);
569
- continue;
570
- }
571
- const L = S(x);
572
- if (L && L.length === 1) {
573
- v.push(L);
574
- continue;
575
- }
576
- if (g = !1, M(x) > f)
577
- return { risky: !0 };
578
- }
579
- return A ? g ? { risky: !0, safeOutput: E([...new Set(v)]) } : { risky: !0 } : { risky: !1 };
580
- }, k = (y, R) => {
581
- if (typeof y != "string")
582
- throw new TypeError("Expected a string");
583
- y = a[y] || y;
584
- const f = { ...R }, I = typeof f.maxLength == "number" ? Math.min(n, f.maxLength) : n;
585
- let v = y.length;
586
- if (v > I)
587
- throw new SyntaxError(`Input length: ${v}, exceeds maximum allowed length: ${I}`);
588
- const A = { type: "bos", value: "", output: f.prepend || "" }, g = [A], x = f.capture ? "" : "?:", W = e.globChars(f.windows), L = e.extglobChars(W), {
589
- DOT_LITERAL: U,
590
- PLUS_LITERAL: fe,
591
- SLASH_LITERAL: le,
592
- ONE_CHAR: he,
593
- DOTS_SLASH: j,
594
- NO_DOT: ye,
595
- NO_DOT_SLASH: Re,
596
- NO_DOTS_SLASH: ge,
597
- QMARK: K,
598
- QMARK_NO_DOT: me,
599
- STAR: xe,
600
- START_ANCHOR: ne
601
- } = W, J = (b) => `(${x}(?:(?!${ne}${b.dot ? j : U}).)*?)`, ce = f.dot ? "" : ye, $ = f.dot ? K : me;
602
- let F = f.bash === !0 ? J(f) : xe;
603
- f.capture && (F = `(${F})`), typeof f.noext == "boolean" && (f.noextglob = f.noext);
604
- const p = {
605
- input: y,
606
- index: -1,
607
- start: 0,
608
- dot: f.dot === !0,
609
- consumed: "",
610
- output: "",
611
- prefix: "",
612
- backtrack: !1,
613
- negated: !1,
614
- brackets: 0,
615
- braces: 0,
616
- parens: 0,
617
- quotes: 0,
618
- globstar: !1,
619
- tokens: g
620
- };
621
- y = t.removePrefix(y, p), v = y.length;
622
- const re = [], X = [], V = [];
623
- let h = A, d;
624
- const pe = () => p.index === v - 1, D = p.peek = (b = 1) => y[p.index + b], se = p.advance = () => y[++p.index] || "", ue = () => y.slice(p.index + 1), z = (b = "", Y = 0) => {
625
- p.consumed += b, p.index += Y;
626
- }, Fe = (b) => {
627
- p.output += b.output != null ? b.output : b.value, z(b.value);
628
- }, We = () => {
629
- let b = 1;
630
- for (; D() === "!" && (D(2) !== "(" || D(3) === "?"); )
631
- se(), p.start++, b++;
632
- return b % 2 === 0 ? !1 : (p.negated = !0, p.start++, !0);
633
- }, _e = (b) => {
634
- p[b]++, V.push(b);
635
- }, Ce = (b) => {
636
- p[b]--, V.pop();
637
- }, O = (b) => {
638
- if (h.type === "globstar") {
639
- const Y = p.braces > 0 && (b.type === "comma" || b.type === "brace"), T = b.extglob === !0 || re.length && (b.type === "pipe" || b.type === "paren");
640
- b.type !== "slash" && b.type !== "paren" && !Y && !T && (p.output = p.output.slice(0, -h.output.length), h.type = "star", h.value = "*", h.output = F, p.output += h.output);
641
- }
642
- if (re.length && b.type !== "paren" && (re[re.length - 1].inner += b.value), (b.value || b.output) && Fe(b), h && h.type === "text" && b.type === "text") {
643
- h.output = (h.output || h.value) + b.value, h.value += b.value;
644
- return;
645
- }
646
- b.prev = h, g.push(b), h = b;
647
- }, nt = (b, Y) => {
648
- const T = { ...L[Y], conditions: 1, inner: "" };
649
- T.prev = h, T.parens = p.parens, T.output = p.output, T.startIndex = p.index, T.tokensIndex = g.length;
650
- const P = (f.capture ? "(" : "") + T.open;
651
- _e("parens"), O({ type: b, value: Y, output: p.output ? "" : he }), O({ type: "paren", extglob: !0, value: se(), output: P }), re.push(T);
652
- }, hr = (b) => {
653
- const Y = y.slice(b.startIndex, p.index + 1), T = y.slice(b.startIndex + 2, p.index), P = N(T, f);
654
- if ((b.type === "plus" || b.type === "star") && P.risky) {
655
- const q = P.safeOutput ? (b.output ? "" : he) + (f.capture ? `(${P.safeOutput})` : P.safeOutput) : void 0, Ae = g[b.tokensIndex];
656
- Ae.type = "text", Ae.value = Y, Ae.output = q || t.escapeRegex(Y);
657
- for (let we = b.tokensIndex + 1; we < g.length; we++)
658
- g[we].value = "", g[we].output = "", delete g[we].suffix;
659
- p.output = b.output + Ae.output, p.backtrack = !0, O({ type: "paren", extglob: !0, value: d, output: "" }), Ce("parens");
660
- return;
661
- }
662
- let G = b.close + (f.capture ? ")" : ""), Q;
663
- if (b.type === "negate") {
664
- let q = F;
665
- if (b.inner && b.inner.length > 1 && b.inner.includes("/") && (q = J(f)), (q !== F || pe() || /^\)+$/.test(ue())) && (G = b.close = `)$))${q}`), b.inner.includes("*") && (Q = ue()) && /^\.[^\\/.]+$/.test(Q)) {
666
- const Ae = k(Q, { ...R, fastpaths: !1 }).output;
667
- G = b.close = `)${Ae})${q})`;
668
- }
669
- b.prev.type === "bos" && (p.negatedExtglob = !0);
670
- }
671
- O({ type: "paren", extglob: !0, value: d, output: G }), Ce("parens");
672
- };
673
- if (f.fastpaths !== !1 && !/(^[*!]|[/()[\]{}"])/.test(y)) {
674
- let b = !1, Y = y.replace(o, (T, P, G, Q, q, Ae) => Q === "\\" ? (b = !0, T) : Q === "?" ? P ? P + Q + (q ? K.repeat(q.length) : "") : Ae === 0 ? $ + (q ? K.repeat(q.length) : "") : K.repeat(G.length) : Q === "." ? U.repeat(G.length) : Q === "*" ? P ? P + Q + (q ? F : "") : F : P ? T : `\\${T}`);
675
- return b === !0 && (f.unescape === !0 ? Y = Y.replace(/\\/g, "") : Y = Y.replace(/\\+/g, (T) => T.length % 2 === 0 ? "\\\\" : T ? "\\" : "")), Y === y && f.contains === !0 ? (p.output = y, p) : (p.output = t.wrapOutput(Y, p, R), p);
676
- }
677
- for (; !pe(); ) {
678
- if (d = se(), d === "\0")
679
- continue;
680
- if (d === "\\") {
681
- const T = D();
682
- if (T === "/" && f.bash !== !0 || T === "." || T === ";")
683
- continue;
684
- if (!T) {
685
- d += "\\", O({ type: "text", value: d });
686
- continue;
687
- }
688
- const P = /^\\+/.exec(ue());
689
- let G = 0;
690
- if (P && P[0].length > 2 && (G = P[0].length, p.index += G, G % 2 !== 0 && (d += "\\")), f.unescape === !0 ? d = se() : d += se(), p.brackets === 0) {
691
- O({ type: "text", value: d });
692
- continue;
693
- }
694
- }
695
- if (p.brackets > 0 && (d !== "]" || h.value === "[" || h.value === "[^")) {
696
- if (f.posix !== !1 && d === ":") {
697
- const T = h.value.slice(1);
698
- if (T.includes("[") && (h.posix = !0, T.includes(":"))) {
699
- const P = h.value.lastIndexOf("["), G = h.value.slice(0, P), Q = h.value.slice(P + 2), q = r[Q];
700
- if (q) {
701
- h.value = G + q, p.backtrack = !0, se(), !A.output && g.indexOf(h) === 1 && (A.output = he);
702
- continue;
703
- }
704
- }
705
- }
706
- (d === "[" && D() !== ":" || d === "-" && D() === "]") && (d = `\\${d}`), d === "]" && (h.value === "[" || h.value === "[^") && (d = `\\${d}`), f.posix === !0 && d === "!" && h.value === "[" && (d = "^"), h.value += d, Fe({ value: d });
707
- continue;
708
- }
709
- if (p.quotes === 1 && d !== '"') {
710
- d = t.escapeRegex(d), h.value += d, Fe({ value: d });
711
- continue;
712
- }
713
- if (d === '"') {
714
- p.quotes = p.quotes === 1 ? 0 : 1, f.keepQuotes === !0 && O({ type: "text", value: d });
715
- continue;
716
- }
717
- if (d === "(") {
718
- _e("parens"), O({ type: "paren", value: d });
719
- continue;
720
- }
721
- if (d === ")") {
722
- if (p.parens === 0 && f.strictBrackets === !0)
723
- throw new SyntaxError(l("opening", "("));
724
- const T = re[re.length - 1];
725
- if (T && p.parens === T.parens + 1) {
726
- hr(re.pop());
727
- continue;
728
- }
729
- O({ type: "paren", value: d, output: p.parens ? ")" : "\\)" }), Ce("parens");
730
- continue;
731
- }
732
- if (d === "[") {
733
- if (f.nobracket === !0 || !ue().includes("]")) {
734
- if (f.nobracket !== !0 && f.strictBrackets === !0)
735
- throw new SyntaxError(l("closing", "]"));
736
- d = `\\${d}`;
737
- } else
738
- _e("brackets");
739
- O({ type: "bracket", value: d });
740
- continue;
741
- }
742
- if (d === "]") {
743
- if (f.nobracket === !0 || h && h.type === "bracket" && h.value.length === 1) {
744
- O({ type: "text", value: d, output: `\\${d}` });
745
- continue;
746
- }
747
- if (p.brackets === 0) {
748
- if (f.strictBrackets === !0)
749
- throw new SyntaxError(l("opening", "["));
750
- O({ type: "text", value: d, output: `\\${d}` });
751
- continue;
752
- }
753
- Ce("brackets");
754
- const T = h.value.slice(1);
755
- if (h.posix !== !0 && T[0] === "^" && !T.includes("/") && (d = `/${d}`), h.value += d, Fe({ value: d }), f.literalBrackets === !1 || t.hasRegexChars(T))
756
- continue;
757
- const P = t.escapeRegex(h.value);
758
- if (p.output = p.output.slice(0, -h.value.length), f.literalBrackets === !0) {
759
- p.output += P, h.value = P;
760
- continue;
761
- }
762
- h.value = `(${x}${P}|${h.value})`, p.output += h.value;
763
- continue;
764
- }
765
- if (d === "{" && f.nobrace !== !0) {
766
- _e("braces");
767
- const T = {
768
- type: "brace",
769
- value: d,
770
- output: "(",
771
- outputIndex: p.output.length,
772
- tokensIndex: p.tokens.length
773
- };
774
- X.push(T), O(T);
775
- continue;
776
- }
777
- if (d === "}") {
778
- const T = X[X.length - 1];
779
- if (f.nobrace === !0 || !T) {
780
- O({ type: "text", value: d, output: d });
781
- continue;
782
- }
783
- let P = ")";
784
- if (T.dots === !0) {
785
- const G = g.slice(), Q = [];
786
- for (let q = G.length - 1; q >= 0 && (g.pop(), G[q].type !== "brace"); q--)
787
- G[q].type !== "dots" && Q.unshift(G[q].value);
788
- P = s(Q, f), p.backtrack = !0;
789
- }
790
- if (T.comma !== !0 && T.dots !== !0) {
791
- const G = p.output.slice(0, T.outputIndex), Q = p.tokens.slice(T.tokensIndex);
792
- T.value = T.output = "\\{", d = P = "\\}", p.output = G;
793
- for (const q of Q)
794
- p.output += q.output || q.value;
795
- }
796
- O({ type: "brace", value: d, output: P }), Ce("braces"), X.pop();
797
- continue;
798
- }
799
- if (d === "|") {
800
- re.length > 0 && re[re.length - 1].conditions++, O({ type: "text", value: d });
801
- continue;
802
- }
803
- if (d === ",") {
804
- let T = d;
805
- const P = X[X.length - 1];
806
- P && V[V.length - 1] === "braces" && (P.comma = !0, T = "|"), O({ type: "comma", value: d, output: T });
807
- continue;
808
- }
809
- if (d === "/") {
810
- if (h.type === "dot" && p.index === p.start + 1) {
811
- p.start = p.index + 1, p.consumed = "", p.output = "", g.pop(), h = A;
812
- continue;
813
- }
814
- O({ type: "slash", value: d, output: le });
815
- continue;
816
- }
817
- if (d === ".") {
818
- if (p.braces > 0 && h.type === "dot") {
819
- h.value === "." && (h.output = U);
820
- const T = X[X.length - 1];
821
- h.type = "dots", h.output += d, h.value += d, T.dots = !0;
822
- continue;
823
- }
824
- if (p.braces + p.parens === 0 && h.type !== "bos" && h.type !== "slash") {
825
- O({ type: "text", value: d, output: U });
826
- continue;
827
- }
828
- O({ type: "dot", value: d, output: U });
829
- continue;
830
- }
831
- if (d === "?") {
832
- if (!(h && h.value === "(") && f.noextglob !== !0 && D() === "(" && D(2) !== "?") {
833
- nt("qmark", d);
834
- continue;
835
- }
836
- if (h && h.type === "paren") {
837
- const P = D();
838
- let G = d;
839
- (h.value === "(" && !/[!=<:]/.test(P) || P === "<" && !/<([!=]|\w+>)/.test(ue())) && (G = `\\${d}`), O({ type: "text", value: d, output: G });
840
- continue;
841
- }
842
- if (f.dot !== !0 && (h.type === "slash" || h.type === "bos")) {
843
- O({ type: "qmark", value: d, output: me });
844
- continue;
845
- }
846
- O({ type: "qmark", value: d, output: K });
847
- continue;
848
- }
849
- if (d === "!") {
850
- if (f.noextglob !== !0 && D() === "(" && (D(2) !== "?" || !/[!=<:]/.test(D(3)))) {
851
- nt("negate", d);
852
- continue;
853
- }
854
- if (f.nonegate !== !0 && p.index === 0) {
855
- We();
856
- continue;
857
- }
858
- }
859
- if (d === "+") {
860
- if (f.noextglob !== !0 && D() === "(" && D(2) !== "?") {
861
- nt("plus", d);
862
- continue;
863
- }
864
- if (h && h.value === "(" || f.regex === !1) {
865
- O({ type: "plus", value: d, output: fe });
866
- continue;
867
- }
868
- if (h && (h.type === "bracket" || h.type === "paren" || h.type === "brace") || p.parens > 0) {
869
- O({ type: "plus", value: d });
870
- continue;
871
- }
872
- O({ type: "plus", value: fe });
873
- continue;
874
- }
875
- if (d === "@") {
876
- if (f.noextglob !== !0 && D() === "(" && D(2) !== "?") {
877
- O({ type: "at", extglob: !0, value: d, output: "" });
878
- continue;
879
- }
880
- O({ type: "text", value: d });
881
- continue;
882
- }
883
- if (d !== "*") {
884
- (d === "$" || d === "^") && (d = `\\${d}`);
885
- const T = i.exec(ue());
886
- T && (d += T[0], p.index += T[0].length), O({ type: "text", value: d });
887
- continue;
888
- }
889
- if (h && (h.type === "globstar" || h.star === !0)) {
890
- h.type = "star", h.star = !0, h.value += d, h.output = F, p.backtrack = !0, p.globstar = !0, z(d);
891
- continue;
892
- }
893
- let b = ue();
894
- if (f.noextglob !== !0 && /^\([^?]/.test(b)) {
895
- nt("star", d);
896
- continue;
897
- }
898
- if (h.type === "star") {
899
- if (f.noglobstar === !0) {
900
- z(d);
901
- continue;
902
- }
903
- const T = h.prev, P = T.prev, G = T.type === "slash" || T.type === "bos", Q = P && (P.type === "star" || P.type === "globstar");
904
- if (f.bash === !0 && (!G || b[0] && b[0] !== "/")) {
905
- O({ type: "star", value: d, output: "" });
906
- continue;
907
- }
908
- const q = p.braces > 0 && (T.type === "comma" || T.type === "brace"), Ae = re.length && (T.type === "pipe" || T.type === "paren");
909
- if (!G && T.type !== "paren" && !q && !Ae) {
910
- O({ type: "star", value: d, output: "" });
911
- continue;
912
- }
913
- for (; b.slice(0, 3) === "/**"; ) {
914
- const He = y[p.index + 4];
915
- if (He && He !== "/")
916
- break;
917
- b = b.slice(3), z("/**", 3);
918
- }
919
- const we = pe() || p.parens > 0 && b === ")".repeat(p.parens) && !re.some((He) => He.type === "negate");
920
- if (T.type === "bos" && pe()) {
921
- h.type = "globstar", h.value += d, h.output = J(f), p.output = h.output, p.globstar = !0, z(d);
922
- continue;
923
- }
924
- if (T.type === "slash" && T.prev.type !== "bos" && !Q && we) {
925
- p.output = p.output.slice(0, -(T.output + h.output).length), T.output = `(?:${T.output}`, h.type = "globstar", h.output = J(f) + (f.strictSlashes ? ")" : "|$)"), h.value += d, p.globstar = !0, p.output += T.output + h.output, z(d);
926
- continue;
927
- }
928
- if (T.type === "slash" && T.prev.type !== "bos" && b[0] === "/") {
929
- const He = b[1] !== void 0 ? "|$" : "";
930
- p.output = p.output.slice(0, -(T.output + h.output).length), T.output = `(?:${T.output}`, h.type = "globstar", h.output = `${J(f)}${le}|${le}${He})`, h.value += d, p.output += T.output + h.output, p.globstar = !0, z(d + se()), O({ type: "slash", value: "/", output: "" });
931
- continue;
932
- }
933
- if (T.type === "bos" && b[0] === "/") {
934
- h.type = "globstar", h.value += d, h.output = `(?:^|${le}|${J(f)}${le})`, p.output = h.output, p.globstar = !0, z(d + se()), O({ type: "slash", value: "/", output: "" });
935
- continue;
936
- }
937
- p.output = p.output.slice(0, -h.output.length), h.type = "globstar", h.output = J(f), h.value += d, p.output += h.output, p.globstar = !0, z(d);
938
- continue;
939
- }
940
- const Y = { type: "star", value: d, output: F };
941
- if (f.bash === !0) {
942
- Y.output = ".*?", (h.type === "bos" || h.type === "slash") && (Y.output = ce + Y.output), O(Y);
943
- continue;
944
- }
945
- if (h && (h.type === "bracket" || h.type === "paren") && f.regex === !0) {
946
- Y.output = d, O(Y);
947
- continue;
948
- }
949
- (p.index === p.start || h.type === "slash" || h.type === "dot") && (h.type === "dot" ? (p.output += Re, h.output += Re) : f.dot === !0 ? (p.output += ge, h.output += ge) : (p.output += ce, h.output += ce), D() !== "*" && (p.output += he, h.output += he)), O(Y);
950
- }
951
- for (; p.brackets > 0; ) {
952
- if (f.strictBrackets === !0) throw new SyntaxError(l("closing", "]"));
953
- p.output = t.escapeLast(p.output, "["), Ce("brackets");
954
- }
955
- for (; p.parens > 0; ) {
956
- if (f.strictBrackets === !0) throw new SyntaxError(l("closing", ")"));
957
- p.output = t.escapeLast(p.output, "("), Ce("parens");
958
- }
959
- for (; p.braces > 0; ) {
960
- if (f.strictBrackets === !0) throw new SyntaxError(l("closing", "}"));
961
- p.output = t.escapeLast(p.output, "{"), Ce("braces");
962
- }
963
- if (f.strictSlashes !== !0 && (h.type === "star" || h.type === "bracket") && O({ type: "maybe_slash", value: "", output: `${le}?` }), p.backtrack === !0) {
964
- p.output = "";
965
- for (const b of p.tokens)
966
- p.output += b.output != null ? b.output : b.value, b.suffix && (p.output += b.suffix);
967
- }
968
- return p;
969
- };
970
- return k.fastpaths = (y, R) => {
971
- const f = { ...R }, I = typeof f.maxLength == "number" ? Math.min(n, f.maxLength) : n, v = y.length;
972
- if (v > I)
973
- throw new SyntaxError(`Input length: ${v}, exceeds maximum allowed length: ${I}`);
974
- y = a[y] || y;
975
- const {
976
- DOT_LITERAL: A,
977
- SLASH_LITERAL: g,
978
- ONE_CHAR: x,
979
- DOTS_SLASH: W,
980
- NO_DOT: L,
981
- NO_DOTS: U,
982
- NO_DOTS_SLASH: fe,
983
- STAR: le,
984
- START_ANCHOR: he
985
- } = e.globChars(f.windows), j = f.dot ? U : L, ye = f.dot ? fe : L, Re = f.capture ? "" : "?:", ge = { negated: !1, prefix: "" };
986
- let K = f.bash === !0 ? ".*?" : le;
987
- f.capture && (K = `(${K})`);
988
- const me = (ce) => ce.noglobstar === !0 ? K : `(${Re}(?:(?!${he}${ce.dot ? W : A}).)*?)`, xe = (ce) => {
989
- switch (ce) {
990
- case "*":
991
- return `${j}${x}${K}`;
992
- case ".*":
993
- return `${A}${x}${K}`;
994
- case "*.*":
995
- return `${j}${K}${A}${x}${K}`;
996
- case "*/*":
997
- return `${j}${K}${g}${x}${ye}${K}`;
998
- case "**":
999
- return j + me(f);
1000
- case "**/*":
1001
- return `(?:${j}${me(f)}${g})?${ye}${x}${K}`;
1002
- case "**/*.*":
1003
- return `(?:${j}${me(f)}${g})?${ye}${K}${A}${x}${K}`;
1004
- case "**/.*":
1005
- return `(?:${j}${me(f)}${g})?${A}${x}${K}`;
1006
- default: {
1007
- const $ = /^(.*?)\.(\w+)$/.exec(ce);
1008
- if (!$) return;
1009
- const F = xe($[1]);
1010
- return F ? F + A + $[2] : void 0;
1011
- }
1012
- }
1013
- }, ne = t.removePrefix(y, ge);
1014
- let J = xe(ne);
1015
- return J && f.strictSlashes !== !0 && (J += `${g}?`), J;
1016
- }, xt = k, xt;
1017
- }
1018
- var _t, mn;
1019
- function Sr() {
1020
- if (mn) return _t;
1021
- mn = 1;
1022
- const e = /* @__PURE__ */ Ar(), t = /* @__PURE__ */ yr(), n = /* @__PURE__ */ mt(), r = /* @__PURE__ */ gt(), i = (a) => a && typeof a == "object" && !Array.isArray(a), o = (a, s, l = !1) => {
1023
- if (Array.isArray(a)) {
1024
- const M = a.map((k) => o(k, s, l));
1025
- return (k) => {
1026
- for (const y of M) {
1027
- const R = y(k);
1028
- if (R) return R;
1029
- }
1030
- return !1;
1031
- };
1032
- }
1033
- const u = i(a) && a.tokens && a.input;
1034
- if (a === "" || typeof a != "string" && !u)
1035
- throw new TypeError("Expected pattern to be a non-empty string");
1036
- const c = s || {}, S = c.windows, m = u ? o.compileRe(a, s) : o.makeRe(a, s, !1, !0), C = m.state;
1037
- delete m.state;
1038
- let E = () => !1;
1039
- if (c.ignore) {
1040
- const M = { ...s, ignore: null, onMatch: null, onResult: null };
1041
- E = o(c.ignore, M, l);
1042
- }
1043
- const w = (M, N = !1) => {
1044
- const { isMatch: k, match: y, output: R } = o.test(M, m, s, { glob: a, posix: S }), f = { glob: a, state: C, regex: m, posix: S, input: M, output: R, match: y, isMatch: k };
1045
- return typeof c.onResult == "function" && c.onResult(f), k === !1 ? (f.isMatch = !1, N ? f : !1) : E(M) ? (typeof c.onIgnore == "function" && c.onIgnore(f), f.isMatch = !1, N ? f : !1) : (typeof c.onMatch == "function" && c.onMatch(f), N ? f : !0);
1046
- };
1047
- return l && (w.state = C), w;
1048
- };
1049
- return o.test = (a, s, l, { glob: u, posix: c } = {}) => {
1050
- if (typeof a != "string")
1051
- throw new TypeError("Expected input to be a string");
1052
- if (a === "")
1053
- return { isMatch: !1, output: "" };
1054
- const S = l || {}, m = S.format || (c ? n.toPosixSlashes : null);
1055
- let C = a === u, E = C && m ? m(a) : a;
1056
- return C === !1 && (E = m ? m(a) : a, C = E === u), (C === !1 || S.capture === !0) && (S.matchBase === !0 || S.basename === !0 ? C = o.matchBase(a, s, l, c) : C = s.exec(E)), { isMatch: !!C, match: C, output: E };
1057
- }, o.matchBase = (a, s, l, u = l && l.windows) => (s instanceof RegExp ? s : o.makeRe(s, l)).test(n.basename(a, { windows: u })), o.isMatch = (a, s, l) => o(s, l)(a), o.parse = (a, s) => Array.isArray(a) ? a.map((l) => o.parse(l, s)) : t(a, { ...s, fastpaths: !1 }), o.scan = (a, s) => e(a, s), o.compileRe = (a, s, l = !1, u = !1) => {
1058
- if (l === !0)
1059
- return a.output;
1060
- const c = s || {}, S = c.contains ? "" : "^", m = c.contains ? "" : "$";
1061
- let C = `${S}(?:${a.output})${m}`;
1062
- a && a.negated === !0 && (C = `^(?!${C}).*$`);
1063
- const E = o.toRegex(C, s);
1064
- return u === !0 && (E.state = a), E;
1065
- }, o.makeRe = (a, s = {}, l = !1, u = !1) => {
1066
- if (!a || typeof a != "string")
1067
- throw new TypeError("Expected a non-empty string");
1068
- let c = { negated: !1, fastpaths: !0 };
1069
- return s.fastpaths !== !1 && (a[0] === "." || a[0] === "*") && (c.output = t.fastpaths(a, s)), c.output || (c = t(a, s)), o.compileRe(c, s, l, u);
1070
- }, o.toRegex = (a, s) => {
1071
- try {
1072
- const l = s || {};
1073
- return new RegExp(a, l.flags || (l.nocase ? "i" : ""));
1074
- } catch (l) {
1075
- if (s && s.debug === !0) throw l;
1076
- return /$^/;
1077
- }
1078
- }, o.constants = r, _t = o, _t;
1079
- }
1080
- var wt, An;
1081
- function Er() {
1082
- if (An) return wt;
1083
- An = 1;
1084
- const e = /* @__PURE__ */ Sr(), t = /* @__PURE__ */ mt();
1085
- function n(r, i, o = !1) {
1086
- return i && (i.windows === null || i.windows === void 0) && (i = { ...i, windows: t.isWindows() }), e(r, i, o);
1087
- }
1088
- return Object.assign(n, e), wt = n, wt;
1089
- }
1090
- var Cr = /* @__PURE__ */ Er();
1091
- const Tr = /* @__PURE__ */ gr(Cr), br = typeof window < "u" || typeof process > "u" || process?.platform === "browser", vr = br ? {} : process.env || {};
1092
- async function Rr(e, t) {
1093
- const n = {};
1094
- for (const i of t.headers)
1095
- xr(e, i.matches) && (n[i.name] = i.envVariable !== void 0 ? vr[i.envVariable] || "" : i.value);
1096
- const r = await (t.customFetch || fetch)(e, {
1097
- headers: n
1098
- });
1099
- if (!r.ok)
1100
- throw new Error(`Failed to load ${e}: ${r.status} ${r.statusText}`);
1101
- return { body: await r.text(), mimeType: r.headers.get("content-type") };
1102
- }
1103
- function xr(e, t) {
1104
- return t.match(/^https?:\/\//) || (e = e.replace(/^https?:\/\//, "")), Tr.isMatch(e, t);
1105
- }
1106
- function ma(e, t = {}) {
1107
- return {
1108
- name: `${e}List`,
1109
- properties: {},
1110
- items: e,
1111
- ...t
1112
- };
1113
- }
1114
- function Aa(e, t = {}) {
1115
- return {
1116
- name: `${e}Map`,
1117
- properties: {},
1118
- additionalProperties: () => e,
1119
- ...t
1120
- };
1121
- }
1122
- const at = {
1123
- name: "SpecExtension",
1124
- properties: {},
1125
- // skip validation of additional properties for unknown extensions
1126
- additionalProperties: { resolvable: !0 }
1127
- };
1128
- function ya(e, t = {}) {
1129
- const n = {};
1130
- for (const o of Object.keys(e))
1131
- n[o] = {
1132
- ...e[o],
1133
- name: o
1134
- };
1135
- for (const o of Object.values(n))
1136
- r(o);
1137
- return n.SpecExtension = at, n;
1138
- function r(o) {
1139
- if (o.additionalProperties && (o.additionalProperties = i(o.additionalProperties)), o.items && (o.items = i(o.items)), o.properties) {
1140
- const a = {};
1141
- for (const [s, l] of Object.entries(o.properties))
1142
- a[s] = i(l), t.doNotResolveExamples && l && l.isExample && (a[s] = {
1143
- ...l,
1144
- resolvable: !1
1145
- });
1146
- o.properties = a;
1147
- }
1148
- }
1149
- function i(o) {
1150
- if (typeof o == "string") {
1151
- if (!n[o])
1152
- throw new Error(`Unknown type name found: ${o}`);
1153
- return n[o];
1154
- } else return typeof o == "function" ? (a, s) => i(o(a, s)) : st(o) ? (o = { ...o }, r(o), o) : o?.directResolveAs !== void 0 ? {
1155
- ...o,
1156
- directResolveAs: i(o.directResolveAs) ?? void 0
1157
- } : o;
1158
- }
1159
- }
1160
- function st(e) {
1161
- return typeof e?.name == "string";
1162
- }
1163
- function Te(e, t) {
1164
- return e === "" && (e = "#/"), e[e.length - 1] === "/" ? e + t : e + "/" + t;
1165
- }
1166
- function lt(e) {
1167
- return be(e) && typeof e.$ref == "string";
1168
- }
1169
- function _r(e) {
1170
- return lt(e) && Object.keys(e).length > 1;
1171
- }
1172
- function wr(e) {
1173
- return be(e) && typeof e.externalValue == "string";
1174
- }
1175
- class ft {
1176
- source;
1177
- pointer;
1178
- constructor(t, n) {
1179
- this.source = t, this.pointer = n;
1180
- }
1181
- child(t) {
1182
- return new ft(this.source, Te(this.pointer, (Array.isArray(t) ? t : [t]).map(Me).join("/")));
1183
- }
1184
- key() {
1185
- return Object.assign(Object.create(ft.prototype), this, { reportOnKey: !0 });
1186
- }
1187
- get absolutePointer() {
1188
- return this.source.absoluteRef + (this.pointer === "#/" ? "" : this.pointer);
1189
- }
1190
- }
1191
- function Ir(e) {
1192
- const t = e.indexOf("~") === -1 ? e : e.replaceAll("~1", "/").replaceAll("~0", "~");
1193
- try {
1194
- return decodeURIComponent(t);
1195
- } catch {
1196
- return t;
1197
- }
1198
- }
1199
- function Me(e) {
1200
- return typeof e == "number" || e.indexOf("/") === -1 && e.indexOf("~") === -1 ? e : e.replaceAll("~", "~0").replaceAll("/", "~1");
1201
- }
1202
- function Nr(e) {
1203
- const [t, n = ""] = e.split("#/");
1204
- return {
1205
- uri: (t.endsWith("#") ? t.slice(0, -1) : t) || null,
1206
- pointer: $r(n)
1207
- };
1208
- }
1209
- function $r(e) {
1210
- return e.split("/").map(Ir).filter(mr);
1211
- }
1212
- function Sa(e) {
1213
- const t = e.split("/");
1214
- return t[t.length - 1];
1215
- }
1216
- function Ea(e) {
1217
- const t = e.split(/[\/\\]/);
1218
- return t[t.length - 1].replace(/\.[^.]+$/, "");
1219
- }
1220
- function Ne(e) {
1221
- return e.startsWith("http://") || e.startsWith("https://") || e.startsWith("file://") || e.startsWith("data:");
1222
- }
1223
- function Ca(e) {
1224
- return Qe.extname(e) ? Ne(e) ? e.substring(0, e.lastIndexOf("/")) : Qe.dirname(e) : e;
1225
- }
1226
- function Ta(e, t) {
1227
- return Ne(e) ? new URL(t, e.endsWith("/") ? e : `${e}/`).href : Qe.resolve(e, t);
1228
- }
1229
- function ba(e) {
1230
- return typeof e == "string" && (e.startsWith("#") || Ne(e) || e.startsWith("./") || e.startsWith("../") || e.indexOf("/") > -1 || /\.(ya?ml|json)$/i.test(e));
1231
- }
1232
- function kr(e) {
1233
- return /^#[A-Za-z][A-Za-z0-9\-_:.]*$/.test(e);
1234
- }
1235
- function va(e, t, n) {
1236
- if (!be(t.node) && n.parent) {
1237
- n.parent[n.key] = t.node;
1238
- return;
1239
- }
1240
- delete e.$ref, be(t.node) && Object.assign(e, { ...t.node, ...e });
1241
- }
1242
- var H = /* @__PURE__ */ Symbol("NOT_RESOLVED"), Jt = /* @__PURE__ */ Symbol("MERGE_KEY");
1243
- function ee(e, t) {
1244
- return {
1245
- tagName: e,
1246
- nodeKind: "scalar",
1247
- implicit: t.implicit ?? !1,
1248
- matchByTagPrefix: t.matchByTagPrefix ?? !1,
1249
- implicitFirstChars: t.implicitFirstChars ?? null,
1250
- resolve: t.resolve,
1251
- identify: t.identify ?? null,
1252
- represent: t.represent ?? ((n) => String(n)),
1253
- representTagName: t.representTagName ?? null
1254
- };
1255
- }
1256
- function en(e, t) {
1257
- const n = t.finalize === void 0;
1258
- return {
1259
- tagName: e,
1260
- nodeKind: "sequence",
1261
- implicit: !1,
1262
- matchByTagPrefix: t.matchByTagPrefix ?? !1,
1263
- create: t.create,
1264
- addItem: t.addItem,
1265
- finalize: t.finalize ?? ((r) => r),
1266
- carrierIsResult: n,
1267
- identify: t.identify ?? null,
1268
- represent: t.represent ?? ((r) => r),
1269
- representTagName: t.representTagName ?? null
1270
- };
1271
- }
1272
- function At(e, t) {
1273
- const n = t.finalize === void 0;
1274
- return {
1275
- tagName: e,
1276
- nodeKind: "mapping",
1277
- implicit: !1,
1278
- matchByTagPrefix: t.matchByTagPrefix ?? !1,
1279
- create: t.create,
1280
- addPair: t.addPair,
1281
- has: t.has,
1282
- keys: t.keys,
1283
- get: t.get,
1284
- finalize: t.finalize ?? ((r) => r),
1285
- carrierIsResult: n,
1286
- identify: t.identify ?? null,
1287
- represent: t.represent ?? ((r) => r),
1288
- representTagName: t.representTagName ?? null
1289
- };
1290
- }
1291
- var Lr = ee("tag:yaml.org,2002:str", {
1292
- resolve: (e) => e,
1293
- identify: (e) => typeof e == "string"
1294
- }), Or = [
1295
- "",
1296
- "~",
1297
- "null",
1298
- "Null",
1299
- "NULL"
1300
- ], Pr = ee("tag:yaml.org,2002:null", {
1301
- implicit: !0,
1302
- implicitFirstChars: [
1303
- "",
1304
- "~",
1305
- "n",
1306
- "N"
1307
- ],
1308
- resolve: (e) => Or.indexOf(e) !== -1 ? null : H,
1309
- identify: (e) => e === null,
1310
- represent: () => "null"
1311
- }), Fr = ee("tag:yaml.org,2002:null", {
1312
- implicit: !0,
1313
- implicitFirstChars: ["n"],
1314
- resolve: (e, t) => e === "null" || t && e === "" ? null : H,
1315
- identify: (e) => e === null,
1316
- represent: () => "null"
1317
- }), Hr = [
1318
- "",
1319
- "~",
1320
- "null",
1321
- "Null",
1322
- "NULL"
1323
- ], Mr = ee("tag:yaml.org,2002:null", {
1324
- implicit: !0,
1325
- implicitFirstChars: [
1326
- "",
1327
- "~",
1328
- "n",
1329
- "N"
1330
- ],
1331
- resolve: (e) => Hr.indexOf(e) !== -1 ? null : H,
1332
- identify: (e) => e === null,
1333
- represent: () => "null"
1334
- }), Br = [
1335
- "true",
1336
- "True",
1337
- "TRUE"
1338
- ], Dr = [
1339
- "false",
1340
- "False",
1341
- "FALSE"
1342
- ], Ur = ee("tag:yaml.org,2002:bool", {
1343
- implicit: !0,
1344
- implicitFirstChars: [
1345
- "t",
1346
- "T",
1347
- "f",
1348
- "F"
1349
- ],
1350
- resolve: (e) => Br.indexOf(e) !== -1 ? !0 : Dr.indexOf(e) !== -1 ? !1 : H,
1351
- identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
1352
- represent: (e) => e ? "true" : "false"
1353
- }), Kr = ["true"], qr = ["false"], Gr = ee("tag:yaml.org,2002:bool", {
1354
- implicit: !0,
1355
- implicitFirstChars: ["t", "f"],
1356
- resolve: (e) => Kr.indexOf(e) !== -1 ? !0 : qr.indexOf(e) !== -1 ? !1 : H,
1357
- identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
1358
- represent: (e) => e ? "true" : "false"
1359
- }), Yr = [
1360
- "true",
1361
- "True",
1362
- "TRUE",
1363
- "y",
1364
- "Y",
1365
- "yes",
1366
- "Yes",
1367
- "YES",
1368
- "on",
1369
- "On",
1370
- "ON"
1371
- ], Wr = [
1372
- "false",
1373
- "False",
1374
- "FALSE",
1375
- "n",
1376
- "N",
1377
- "no",
1378
- "No",
1379
- "NO",
1380
- "off",
1381
- "Off",
1382
- "OFF"
1383
- ], jr = ee("tag:yaml.org,2002:bool", {
1384
- implicit: !0,
1385
- implicitFirstChars: [
1386
- "y",
1387
- "Y",
1388
- "n",
1389
- "N",
1390
- "t",
1391
- "T",
1392
- "f",
1393
- "F",
1394
- "o",
1395
- "O"
1396
- ],
1397
- resolve: (e) => Yr.indexOf(e) !== -1 ? !0 : Wr.indexOf(e) !== -1 ? !1 : H,
1398
- identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
1399
- represent: (e) => e ? "true" : "false"
1400
- }), Vr = /* @__PURE__ */ new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"), Xr = /* @__PURE__ */ new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");
1401
- function zr(e) {
1402
- let t = e, n = 1;
1403
- return (t[0] === "-" || t[0] === "+") && (t[0] === "-" && (n = -1), t = t.slice(1)), t.startsWith("0b") ? n * parseInt(t.slice(2), 2) : t.startsWith("0o") ? n * parseInt(t.slice(2), 8) : t.startsWith("0x") ? n * parseInt(t.slice(2), 16) : n * parseInt(t, 10);
1404
- }
1405
- function Qr(e, t) {
1406
- if (t) {
1407
- if (!Xr.test(e)) return H;
1408
- } else if (!Vr.test(e)) return H;
1409
- const n = zr(e);
1410
- return Number.isFinite(n) ? n : H;
1411
- }
1412
- var Mn = ee("tag:yaml.org,2002:int", {
1413
- implicit: !0,
1414
- implicitFirstChars: [
1415
- "-",
1416
- "+",
1417
- ..."0123456789"
1418
- ],
1419
- resolve: Qr,
1420
- identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf("e") < 0,
1421
- represent: (e) => e.toString(10)
1422
- }), Zr = /* @__PURE__ */ new RegExp("^-?(?:0|[1-9][0-9]*)$"), Jr = /* @__PURE__ */ new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");
1423
- function ei(e) {
1424
- let t = e, n = 1;
1425
- return (t[0] === "-" || t[0] === "+") && (t[0] === "-" && (n = -1), t = t.slice(1)), t.startsWith("0b") ? n * parseInt(t.slice(2), 2) : t.startsWith("0o") ? n * parseInt(t.slice(2), 8) : t.startsWith("0x") ? n * parseInt(t.slice(2), 16) : n * parseInt(t, 10);
1426
- }
1427
- function ti(e, t) {
1428
- if (t) {
1429
- if (!Jr.test(e)) return H;
1430
- } else if (!Zr.test(e)) return H;
1431
- const n = ei(e);
1432
- return Number.isFinite(n) ? n : H;
1433
- }
1434
- var ni = ee("tag:yaml.org,2002:int", {
1435
- implicit: !0,
1436
- implicitFirstChars: ["-", ..."0123456789"],
1437
- resolve: ti,
1438
- identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf("e") < 0,
1439
- represent: (e) => e.toString(10)
1440
- }), ri = /* @__PURE__ */ new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");
1441
- function ii(e) {
1442
- let t = e.replace(/_/g, ""), n = 1;
1443
- if ((t[0] === "-" || t[0] === "+") && (t[0] === "-" && (n = -1), t = t.slice(1)), t.startsWith("0b")) return n * parseInt(t.slice(2), 2);
1444
- if (t.startsWith("0x")) return n * parseInt(t.slice(2), 16);
1445
- if (t.includes(":")) {
1446
- let r = 0;
1447
- for (const i of t.split(":")) r = r * 60 + Number(i);
1448
- return n * r;
1449
- }
1450
- return t !== "0" && t[0] === "0" ? n * parseInt(t, 8) : n * parseInt(t, 10);
1451
- }
1452
- function oi(e) {
1453
- if (!ri.test(e)) return H;
1454
- const t = ii(e);
1455
- return Number.isFinite(t) ? t : H;
1456
- }
1457
- var Ft = ee("tag:yaml.org,2002:int", {
1458
- implicit: !0,
1459
- implicitFirstChars: [
1460
- "-",
1461
- "+",
1462
- ..."0123456789"
1463
- ],
1464
- resolve: oi,
1465
- identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf("e") < 0,
1466
- represent: (e) => e.toString(10)
1467
- }), ai = /* @__PURE__ */ new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"), si = /* @__PURE__ */ new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
1468
- function li(e) {
1469
- if (!ai.test(e)) return H;
1470
- let t = e.toLowerCase();
1471
- const n = t[0] === "-" ? -1 : 1;
1472
- if ("+-".includes(t[0]) && (t = t.slice(1)), t === ".inf") return n === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
1473
- if (t === ".nan") return NaN;
1474
- const r = n * parseFloat(t);
1475
- return Number.isFinite(r) || si.test(e) ? r : H;
1476
- }
1477
- function ci(e) {
1478
- if (isNaN(e)) return ".nan";
1479
- if (e === Number.POSITIVE_INFINITY) return ".inf";
1480
- if (e === Number.NEGATIVE_INFINITY) return "-.inf";
1481
- if (Object.is(e, -0)) return "-0.0";
1482
- const t = e.toString(10);
1483
- return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
1484
- }
1485
- var Bn = ee("tag:yaml.org,2002:float", {
1486
- implicit: !0,
1487
- implicitFirstChars: [
1488
- "-",
1489
- "+",
1490
- ".",
1491
- ..."0123456789"
1492
- ],
1493
- resolve: li,
1494
- identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
1495
- represent: ci
1496
- }), ui = /* @__PURE__ */ new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"), fi = /* @__PURE__ */ new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
1497
- function pi(e, t) {
1498
- if (t) {
1499
- if (!fi.test(e)) return H;
1500
- let r = e.toLowerCase();
1501
- const i = r[0] === "-" ? -1 : 1;
1502
- if ("+-".includes(r[0]) && (r = r.slice(1)), r === ".inf") return i === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
1503
- if (r === ".nan") return NaN;
1504
- const o = i * parseFloat(r);
1505
- return Number.isFinite(o) ? o : H;
1506
- }
1507
- if (!ui.test(e)) return H;
1508
- const n = Number(e);
1509
- return Number.isFinite(n) ? n : H;
1510
- }
1511
- function di(e) {
1512
- if (isNaN(e)) return ".nan";
1513
- if (e === Number.POSITIVE_INFINITY) return ".inf";
1514
- if (e === Number.NEGATIVE_INFINITY) return "-.inf";
1515
- if (Object.is(e, -0)) return "-0.0";
1516
- const t = e.toString(10);
1517
- return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
1518
- }
1519
- var hi = ee("tag:yaml.org,2002:float", {
1520
- implicit: !0,
1521
- implicitFirstChars: ["-", ..."0123456789"],
1522
- resolve: pi,
1523
- identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
1524
- represent: di
1525
- }), gi = /* @__PURE__ */ new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"), mi = /* @__PURE__ */ new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
1526
- function Ai(e) {
1527
- if (!gi.test(e)) return H;
1528
- let t = e.toLowerCase().replace(/_/g, "");
1529
- const n = t[0] === "-" ? -1 : 1;
1530
- if ("+-".includes(t[0]) && (t = t.slice(1)), t === ".inf") return n === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
1531
- if (t === ".nan") return NaN;
1532
- let r = 0;
1533
- if (t.includes(":")) {
1534
- for (const i of t.split(":")) r = r * 60 + Number(i);
1535
- r *= n;
1536
- } else r = n * parseFloat(t);
1537
- return Number.isFinite(r) || mi.test(e) ? r : H;
1538
- }
1539
- function yi(e) {
1540
- if (isNaN(e)) return ".nan";
1541
- if (e === Number.POSITIVE_INFINITY) return ".inf";
1542
- if (e === Number.NEGATIVE_INFINITY) return "-.inf";
1543
- if (Object.is(e, -0)) return "-0.0";
1544
- const t = e.toString(10);
1545
- return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
1546
- }
1547
- var Ht = ee("tag:yaml.org,2002:float", {
1548
- implicit: !0,
1549
- implicitFirstChars: [
1550
- "-",
1551
- "+",
1552
- ".",
1553
- ..."0123456789"
1554
- ],
1555
- resolve: Ai,
1556
- identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
1557
- represent: yi
1558
- }), Dn = ee("tag:yaml.org,2002:merge", {
1559
- implicit: !0,
1560
- implicitFirstChars: ["<"],
1561
- resolve: (e, t) => e === "<<" || t && e === "" ? Jt : H
1562
- }), Si = /^[A-Za-z0-9+/]*={0,2}$/;
1563
- function Ei(e) {
1564
- const t = e.replace(/\s/g, "");
1565
- if (t.length % 4 !== 0 || !Si.test(t)) return H;
1566
- const n = atob(t), r = new Uint8Array(n.length);
1567
- for (let i = 0; i < n.length; i++) r[i] = n.charCodeAt(i);
1568
- return r;
1569
- }
1570
- function Ci(e) {
1571
- let t = "";
1572
- for (let n = 0; n < e.length; n++) t += String.fromCharCode(e[n]);
1573
- return btoa(t);
1574
- }
1575
- var Un = ee("tag:yaml.org,2002:binary", {
1576
- resolve: Ei,
1577
- identify: (e) => Object.prototype.toString.call(e) === "[object Uint8Array]",
1578
- represent: Ci
1579
- }), Ti = /* @__PURE__ */ new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"), bi = /* @__PURE__ */ new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");
1580
- function yn(e, t, n, r = 0, i = 0, o = 0, a = 0) {
1581
- const s = new Date(Date.UTC(e, t, n, r, i, o, a));
1582
- return s.setUTCFullYear(e, t, n), s;
1583
- }
1584
- function vi(e) {
1585
- let t = Ti.exec(e);
1586
- if (t === null && (t = bi.exec(e)), t === null) return H;
1587
- const n = +t[1], r = +t[2] - 1, i = +t[3];
1588
- if (!t[4]) {
1589
- const c = yn(n, r, i);
1590
- return c.getUTCFullYear() !== n || c.getUTCMonth() !== r || c.getUTCDate() !== i ? H : c;
1591
- }
1592
- const o = +t[4], a = +t[5], s = +t[6];
1593
- let l = 0;
1594
- if (o > 23 || a > 59 || s > 59) return H;
1595
- if (t[7]) {
1596
- let c = t[7].slice(0, 3);
1597
- for (; c.length < 3; ) c += "0";
1598
- l = +c;
1599
- }
1600
- const u = yn(n, r, i, o, a, s, l);
1601
- if (u.getUTCFullYear() !== n || u.getUTCMonth() !== r || u.getUTCDate() !== i) return H;
1602
- if (t[9]) {
1603
- const c = +t[10], S = +(t[11] || 0);
1604
- if (c > 23 || S > 59) return H;
1605
- const m = (c * 60 + S) * 6e4;
1606
- u.setTime(u.getTime() - (t[9] === "-" ? -m : m));
1607
- }
1608
- return u;
1609
- }
1610
- var Ri = ee("tag:yaml.org,2002:timestamp", {
1611
- implicit: !0,
1612
- implicitFirstChars: [..."0123456789"],
1613
- resolve: vi,
1614
- identify: (e) => e instanceof Date,
1615
- represent: (e) => e.toISOString()
1616
- }), xi = en("tag:yaml.org,2002:seq", {
1617
- create: () => [],
1618
- addItem: (e, t) => {
1619
- e.push(t);
1620
- },
1621
- identify: Array.isArray
1622
- });
1623
- function yt(e) {
1624
- if (e === null || typeof e != "object" || Array.isArray(e)) return !1;
1625
- const t = Object.getPrototypeOf(e);
1626
- return t === null || t === Object.prototype;
1627
- }
1628
- function Mt(e, t) {
1629
- const n = {};
1630
- for (const r of t) e[r] !== void 0 && (n[r] = e[r]);
1631
- return n;
1632
- }
1633
- var Kn = en("tag:yaml.org,2002:omap", {
1634
- create: () => ({
1635
- list: [],
1636
- seen: /* @__PURE__ */ new Set()
1637
- }),
1638
- addItem: (e, t) => {
1639
- let n;
1640
- if (t instanceof Map) {
1641
- if (t.size !== 1) return "cannot resolve an ordered map item";
1642
- n = t.keys().next().value;
1643
- } else if (yt(t)) {
1644
- const r = Object.keys(t);
1645
- if (r.length !== 1) return "cannot resolve an ordered map item";
1646
- n = r[0];
1647
- } else return "cannot resolve an ordered map item";
1648
- return e.seen.has(n) ? "duplicate key in ordered map" : (e.seen.add(n), e.list.push(t), "");
1649
- },
1650
- finalize: (e) => e.list
1651
- }), qn = en("tag:yaml.org,2002:pairs", {
1652
- create: () => [],
1653
- addItem: (e, t) => {
1654
- if (t instanceof Map)
1655
- return t.size !== 1 ? "cannot resolve a pairs item" : (e.push(t.entries().next().value), "");
1656
- if (Object.prototype.toString.call(t) !== "[object Object]") return "cannot resolve a pairs item";
1657
- const n = t, r = Object.keys(n);
1658
- return r.length !== 1 ? "cannot resolve a pairs item" : (e.push([r[0], n[r[0]]]), "");
1659
- }
1660
- }), _i = At("tag:yaml.org,2002:map", {
1661
- create: () => ({}),
1662
- identify: yt,
1663
- represent: (e) => {
1664
- const t = /* @__PURE__ */ new Map();
1665
- for (const n of Object.keys(e)) t.set(n, e[n]);
1666
- return t;
1667
- },
1668
- addPair: (e, t, n) => {
1669
- if (t !== null && typeof t == "object") return "object-based map does not support complex keys";
1670
- const r = String(t);
1671
- return r === "__proto__" ? Object.defineProperty(e, r, {
1672
- value: n,
1673
- enumerable: !0,
1674
- configurable: !0,
1675
- writable: !0
1676
- }) : e[r] = n, "";
1677
- },
1678
- has: (e, t) => t !== null && typeof t == "object" ? !1 : Object.prototype.hasOwnProperty.call(e, String(t)),
1679
- keys: (e) => Object.keys(e),
1680
- get: (e, t) => {
1681
- const n = String(t);
1682
- return Object.prototype.hasOwnProperty.call(e, n) ? e[n] : null;
1683
- }
1684
- }), Gn = At("tag:yaml.org,2002:set", {
1685
- create: () => /* @__PURE__ */ new Set(),
1686
- identify: (e) => e instanceof Set,
1687
- represent: (e) => {
1688
- const t = /* @__PURE__ */ new Map();
1689
- for (const n of e) t.set(n, null);
1690
- return t;
1691
- },
1692
- addPair: (e, t, n) => n !== null ? "cannot resolve a set item" : (e.add(t), ""),
1693
- has: (e, t) => e.has(t),
1694
- keys: (e) => e.keys(),
1695
- get: () => null
1696
- });
1697
- function wi() {
1698
- return {
1699
- scalar: /* @__PURE__ */ Object.create(null),
1700
- sequence: /* @__PURE__ */ Object.create(null),
1701
- mapping: /* @__PURE__ */ Object.create(null)
1702
- };
1703
- }
1704
- function Ii() {
1705
- return {
1706
- scalar: [],
1707
- sequence: [],
1708
- mapping: []
1709
- };
1710
- }
1711
- function Ni(e) {
1712
- const t = [];
1713
- for (const n of e) {
1714
- let r = t.length;
1715
- for (let i = 0; i < t.length; i++) {
1716
- const o = t[i];
1717
- if (o.nodeKind === n.nodeKind && o.tagName === n.tagName && o.matchByTagPrefix === n.matchByTagPrefix) {
1718
- r = i;
1719
- break;
1720
- }
1721
- }
1722
- t[r] = n;
1723
- }
1724
- return t;
1725
- }
1726
- var St = class Yn {
1727
- tags;
1728
- implicitScalarTags;
1729
- implicitScalarByFirstChar;
1730
- implicitScalarAnyFirstChar;
1731
- defaultScalarTag;
1732
- defaultSequenceTag;
1733
- defaultMappingTag;
1734
- exact;
1735
- prefix;
1736
- constructor(t) {
1737
- const n = Ni(t), r = [], i = wi(), o = Ii();
1738
- for (const c of n) {
1739
- if (c.nodeKind === "scalar" && c.implicit) {
1740
- if (c.matchByTagPrefix) throw new Error("Implicit scalar tags cannot match by tag prefix");
1741
- r.push(c);
1742
- }
1743
- switch (c.nodeKind) {
1744
- case "scalar":
1745
- c.matchByTagPrefix ? o.scalar.push(c) : i.scalar[c.tagName] = c;
1746
- break;
1747
- case "sequence":
1748
- c.matchByTagPrefix ? o.sequence.push(c) : i.sequence[c.tagName] = c;
1749
- break;
1750
- case "mapping":
1751
- c.matchByTagPrefix ? o.mapping.push(c) : i.mapping[c.tagName] = c;
1752
- break;
1753
- }
1754
- }
1755
- const a = r.filter((c) => c.implicitFirstChars === null), s = /* @__PURE__ */ new Set();
1756
- for (const c of r) if (c.implicitFirstChars !== null) for (const S of c.implicitFirstChars) s.add(S);
1757
- const l = /* @__PURE__ */ new Map();
1758
- for (const c of s) l.set(c, r.filter((S) => S.implicitFirstChars === null || S.implicitFirstChars.indexOf(c) !== -1));
1759
- const u = i.scalar["tag:yaml.org,2002:str"];
1760
- if (!u) throw new Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");
1761
- this.tags = n, this.implicitScalarTags = r, this.implicitScalarByFirstChar = l, this.implicitScalarAnyFirstChar = a, this.defaultScalarTag = u, this.defaultSequenceTag = i.sequence["tag:yaml.org,2002:seq"], this.defaultMappingTag = i.mapping["tag:yaml.org,2002:map"], this.exact = i, this.prefix = o;
1762
- }
1763
- withTags(...t) {
1764
- let n = [];
1765
- for (const r of t) n = n.concat(r);
1766
- return new Yn([...this.tags, ...n]);
1767
- }
1768
- }, tn = new St([
1769
- Lr,
1770
- xi,
1771
- _i
1772
- ]);
1773
- new St([
1774
- ...tn.tags,
1775
- Fr,
1776
- Gr,
1777
- ni,
1778
- hi
1779
- ]);
1780
- var Wn = new St([
1781
- ...tn.tags,
1782
- Pr,
1783
- Ur,
1784
- Mn,
1785
- Bn
1786
- ]), $i = new St([
1787
- ...tn.tags,
1788
- Mr,
1789
- jr,
1790
- Ft,
1791
- Ht,
1792
- Ri,
1793
- Dn,
1794
- Un,
1795
- Kn,
1796
- qn,
1797
- Gn
1798
- ]);
1799
- At("tag:yaml.org,2002:map", {
1800
- create: () => /* @__PURE__ */ new Map(),
1801
- addPair: (e, t, n) => (e.set(t, n), ""),
1802
- has: (e, t) => e.has(t),
1803
- keys: (e) => e.keys(),
1804
- get: (e, t) => e.get(t),
1805
- identify: (e) => e instanceof Map || yt(e),
1806
- represent: (e) => {
1807
- if (e instanceof Map) return e;
1808
- const t = /* @__PURE__ */ new Map(), n = e;
1809
- for (const r of Object.keys(n)) t.set(r, n[r]);
1810
- return t;
1811
- }
1812
- });
1813
- function Sn(e) {
1814
- if (Array.isArray(e)) {
1815
- const t = Array.prototype.slice.call(e);
1816
- for (let n = 0; n < t.length; n++) {
1817
- if (Array.isArray(t[n])) return null;
1818
- typeof t[n] == "object" && Object.prototype.toString.call(t[n]) === "[object Object]" && (t[n] = "[object Object]");
1819
- }
1820
- return String(t);
1821
- }
1822
- return typeof e == "object" && Object.prototype.toString.call(e) === "[object Object]" ? "[object Object]" : String(e);
1823
- }
1824
- At("tag:yaml.org,2002:map", {
1825
- create: () => ({}),
1826
- identify: yt,
1827
- represent: (e) => {
1828
- const t = /* @__PURE__ */ new Map();
1829
- for (const n of Object.keys(e)) t.set(n, e[n]);
1830
- return t;
1831
- },
1832
- addPair: (e, t, n) => {
1833
- const r = Sn(t);
1834
- return r === null ? "nested arrays are not supported inside keys" : (r === "__proto__" ? Object.defineProperty(e, r, {
1835
- value: n,
1836
- enumerable: !0,
1837
- configurable: !0,
1838
- writable: !0
1839
- }) : e[r] = n, "");
1840
- },
1841
- has: (e, t) => {
1842
- const n = Sn(t);
1843
- return n !== null && Object.prototype.hasOwnProperty.call(e, n);
1844
- },
1845
- keys: (e) => Object.keys(e),
1846
- get: (e, t) => {
1847
- const n = String(t);
1848
- return Object.prototype.hasOwnProperty.call(e, n) ? e[n] : null;
1849
- }
1850
- });
1851
- var ki = {
1852
- maxLength: 79,
1853
- indent: 1,
1854
- linesBefore: 3,
1855
- linesAfter: 2
1856
- };
1857
- function It(e, t, n, r, i) {
1858
- let o = "", a = "";
1859
- const s = Math.floor(i / 2) - 1;
1860
- return r - t > s && (o = " ... ", t = r - s + o.length), n - r > s && (a = " ...", n = r + s - a.length), {
1861
- str: o + e.slice(t, n).replace(/\t/g, "→") + a,
1862
- pos: r - t + o.length
1863
- };
1864
- }
1865
- function Nt(e, t) {
1866
- return " ".repeat(Math.max(t - e.length, 0)) + e;
1867
- }
1868
- function Li(e, t) {
1869
- if (!e.buffer) return null;
1870
- const n = {
1871
- ...ki,
1872
- ...t
1873
- }, r = /\r?\n|\r|\0/g, i = [0], o = [];
1874
- let a, s = -1;
1875
- for (; a = r.exec(e.buffer); )
1876
- o.push(a.index), i.push(a.index + a[0].length), e.position <= a.index && s < 0 && (s = i.length - 2);
1877
- s < 0 && (s = i.length - 1);
1878
- let l = "";
1879
- const u = Math.min(e.line + n.linesAfter, o.length).toString().length, c = n.maxLength - (n.indent + u + 3);
1880
- for (let m = 1; m <= n.linesBefore && !(s - m < 0); m++) {
1881
- const C = It(e.buffer, i[s - m], o[s - m], e.position - (i[s] - i[s - m]), c);
1882
- l = `${" ".repeat(n.indent)}${Nt((e.line - m + 1).toString(), u)} | ${C.str}
1883
- ${l}`;
1884
- }
1885
- const S = It(e.buffer, i[s], o[s], e.position, c);
1886
- l += `${" ".repeat(n.indent)}${Nt((e.line + 1).toString(), u)} | ${S.str}
1887
- `, l += `${"-".repeat(n.indent + u + 3 + S.pos)}^
1888
- `;
1889
- for (let m = 1; m <= n.linesAfter && !(s + m >= o.length); m++) {
1890
- const C = It(e.buffer, i[s + m], o[s + m], e.position - (i[s] - i[s + m]), c);
1891
- l += `${" ".repeat(n.indent)}${Nt((e.line + m + 1).toString(), u)} | ${C.str}
1892
- `;
1893
- }
1894
- return l.replace(/\n$/, "");
1895
- }
1896
- function En(e, t) {
1897
- let n = "";
1898
- return e.mark ? (e.mark.name && (n += `in "${e.mark.name}" `), n += `(${e.mark.line + 1}:${e.mark.column + 1})`, !t && e.mark.snippet && (n += `
1899
-
1900
- ${e.mark.snippet}`), `${e.reason} ${n}`) : e.reason;
1901
- }
1902
- var Et = class extends Error {
1903
- reason;
1904
- mark;
1905
- constructor(e, t) {
1906
- super(), this.name = "YAMLException", this.reason = e, this.mark = t, this.message = En(this, !1), Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
1907
- }
1908
- toString(e) {
1909
- return `${this.name}: ${En(this, e)}`;
1910
- }
1911
- };
1912
- function Ct(e, t, n, r = "") {
1913
- let i = 0, o = 0;
1914
- for (let s = 0; s < t; s++) {
1915
- const l = e.charCodeAt(s);
1916
- l === 10 ? (i++, o = s + 1) : l === 13 && (i++, e.charCodeAt(s + 1) === 10 && s++, o = s + 1);
1917
- }
1918
- const a = {
1919
- name: r,
1920
- buffer: e,
1921
- position: t,
1922
- line: i,
1923
- column: t - o
1924
- };
1925
- throw a.snippet = Li(a), new Et(n, a);
1926
- }
1927
- var Oi = -1;
1928
- function Cn(e) {
1929
- switch (e) {
1930
- case 48:
1931
- return "\0";
1932
- case 97:
1933
- return "\x07";
1934
- case 98:
1935
- return "\b";
1936
- case 116:
1937
- return " ";
1938
- case 9:
1939
- return " ";
1940
- case 110:
1941
- return `
1942
- `;
1943
- case 118:
1944
- return "\v";
1945
- case 102:
1946
- return "\f";
1947
- case 114:
1948
- return "\r";
1949
- case 101:
1950
- return "\x1B";
1951
- case 32:
1952
- return " ";
1953
- case 34:
1954
- return '"';
1955
- case 47:
1956
- return "/";
1957
- case 92:
1958
- return "\\";
1959
- case 78:
1960
- return "…";
1961
- case 95:
1962
- return " ";
1963
- case 76:
1964
- return "\u2028";
1965
- case 80:
1966
- return "\u2029";
1967
- default:
1968
- return "";
1969
- }
1970
- }
1971
- var jn = new Array(256), Vn = new Array(256);
1972
- for (let e = 0; e < 256; e++)
1973
- jn[e] = Cn(e) ? 1 : 0, Vn[e] = Cn(e);
1974
- function Pi(e) {
1975
- return e <= 65535 ? String.fromCharCode(e) : String.fromCharCode((e - 65536 >> 10) + 55296, (e - 65536 & 1023) + 56320);
1976
- }
1977
- function Fi(e) {
1978
- return e >= 48 && e <= 57 ? e - 48 : (e | 32) - 97 + 10;
1979
- }
1980
- function Hi(e) {
1981
- return e === 120 ? 2 : e === 117 ? 4 : 8;
1982
- }
1983
- function pt(e, t, n) {
1984
- let r = 0;
1985
- for (; t < n; ) {
1986
- const i = e.charCodeAt(t);
1987
- if (i === 10)
1988
- r++, t++;
1989
- else if (i === 13)
1990
- r++, t++, e.charCodeAt(t) === 10 && t++;
1991
- else if (i === 32 || i === 9) t++;
1992
- else break;
1993
- }
1994
- return {
1995
- position: t,
1996
- breaks: r
1997
- };
1998
- }
1999
- function nn(e) {
2000
- return e === 1 ? " " : `
2001
- `.repeat(e - 1);
2002
- }
2003
- function Mi(e, t, n) {
2004
- let r = "", i = t, o = t, a = t;
2005
- for (; i < n; ) {
2006
- const s = e.charCodeAt(i);
2007
- if (s === 10 || s === 13) {
2008
- r += e.slice(o, a);
2009
- const l = pt(e, i, n);
2010
- r += nn(l.breaks), i = o = a = l.position;
2011
- } else
2012
- i++, s !== 32 && s !== 9 && (a = i);
2013
- }
2014
- return r + e.slice(o, a);
2015
- }
2016
- function Bi(e, t, n) {
2017
- let r = "", i = t, o = t, a = t;
2018
- for (; i < n; ) {
2019
- const s = e.charCodeAt(i);
2020
- if (s === 39)
2021
- r += e.slice(o, i) + "'", i += 2, o = a = i;
2022
- else if (s === 10 || s === 13) {
2023
- r += e.slice(o, a);
2024
- const l = pt(e, i, n);
2025
- r += nn(l.breaks), i = o = a = l.position;
2026
- } else
2027
- i++, s !== 32 && s !== 9 && (a = i);
2028
- }
2029
- return r + e.slice(o, n);
2030
- }
2031
- function Di(e, t, n) {
2032
- let r = "", i = t, o = t, a = t;
2033
- for (; i < n; ) {
2034
- const s = e.charCodeAt(i);
2035
- if (s === 92) {
2036
- r += e.slice(o, i), i++;
2037
- const l = e.charCodeAt(i);
2038
- if (l === 10 || l === 13) i = pt(e, i, n).position;
2039
- else if (l < 256 && jn[l])
2040
- r += Vn[l], i++;
2041
- else {
2042
- let u = Hi(l), c = 0;
2043
- for (; u > 0; u--) {
2044
- i++;
2045
- const S = Fi(e.charCodeAt(i));
2046
- c = (c << 4) + S;
2047
- }
2048
- r += Pi(c), i++;
2049
- }
2050
- o = a = i;
2051
- } else if (s === 10 || s === 13) {
2052
- r += e.slice(o, a);
2053
- const l = pt(e, i, n);
2054
- r += nn(l.breaks), i = o = a = l.position;
2055
- } else
2056
- i++, s !== 32 && s !== 9 && (a = i);
2057
- }
2058
- return r + e.slice(o, n);
2059
- }
2060
- function Tn(e, t, n, r, i, o) {
2061
- const a = r < 0 ? 0 : r, s = e.slice(t, n).replace(/\r\n?/g, `
2062
- `), l = s === "" ? [] : (s.endsWith(`
2063
- `) ? s.slice(0, -1) : s).split(`
2064
- `);
2065
- let u = "", c = !1, S = 0, m = !1;
2066
- for (const C of l) {
2067
- let E = 0;
2068
- for (; E < a && C.charCodeAt(E) === 32; ) E++;
2069
- if (r < 0 || E >= C.length) {
2070
- S++;
2071
- continue;
2072
- }
2073
- const w = C.slice(a), M = w.charCodeAt(0);
2074
- o ? M === 32 || M === 9 ? (m = !0, u += `
2075
- `.repeat(c ? 1 + S : S)) : m ? (m = !1, u += `
2076
- `.repeat(S + 1)) : S === 0 ? c && (u += " ") : u += `
2077
- `.repeat(S) : u += `
2078
- `.repeat(c ? 1 + S : S), u += w, c = !0, S = 0;
2079
- }
2080
- return i === 3 ? u += `
2081
- `.repeat(c ? 1 + S : S) : i !== 2 && c && (u += `
2082
- `), u;
2083
- }
2084
- function Ui(e, t) {
2085
- if (t.valueStart === Oi) return "";
2086
- const { valueStart: n, valueEnd: r } = t;
2087
- if (t.fast) return e.slice(n, r);
2088
- switch (t.style) {
2089
- case 2:
2090
- return Bi(e, n, r);
2091
- case 3:
2092
- return Di(e, n, r);
2093
- case 4:
2094
- return Tn(e, n, r, t.indent, t.chomping, !1);
2095
- case 5:
2096
- return Tn(e, n, r, t.indent, t.chomping, !0);
2097
- default:
2098
- return Mi(e, n, r);
2099
- }
2100
- }
2101
- var Ki = Object.assign(/* @__PURE__ */ Object.create(null), {
2102
- "!": "!",
2103
- "!!": "tag:yaml.org,2002:"
2104
- });
2105
- function $t(e) {
2106
- return encodeURI(e).replace(/!/g, "%21");
2107
- }
2108
- function Xn(e, t) {
2109
- if (e.startsWith("!<") && e.endsWith(">")) return decodeURIComponent(e.slice(2, -1));
2110
- const n = e.indexOf("!", 1), r = n === -1 ? "!" : e.slice(0, n + 1), i = t?.[r] ?? Ki[r] ?? r;
2111
- return decodeURIComponent(i) + decodeURIComponent(e.slice(r.length));
2112
- }
2113
- function zn(e) {
2114
- let t = e;
2115
- return t.charCodeAt(0) === 33 ? (t = t.slice(1), `!${$t(t)}`) : t.slice(0, 18) === "tag:yaml.org,2002:" ? `!!${$t(t.slice(18))}` : `!<${$t(t)}>`;
2116
- }
2117
- var Be = -1, rn = {
2118
- filename: "",
2119
- schema: Wn,
2120
- json: !1,
2121
- maxTotalMergeKeys: 1e4,
2122
- maxAliases: -1
2123
- };
2124
- function qi(e) {
2125
- return "tagStart" in e && e.tagStart !== Be ? e.tagStart : "anchorStart" in e && e.anchorStart !== Be ? e.anchorStart : "valueStart" in e && e.valueStart !== Be ? e.valueStart : "start" in e ? e.start : 0;
2126
- }
2127
- function ae(e, t) {
2128
- Ct(e.source, e.position, t, e.filename);
2129
- }
2130
- function Qn(e, t, n, r) {
2131
- try {
2132
- return n.finalize(r);
2133
- } catch (i) {
2134
- if (i instanceof Et) throw i;
2135
- Ct(e.source, t, i instanceof Error ? i.message : String(i), e.filename);
2136
- }
2137
- }
2138
- function ct(e, t, n) {
2139
- const r = e[n];
2140
- if (r) return r;
2141
- for (const i of t) if (n.startsWith(i.tagName)) return i;
2142
- }
2143
- function Gi(e, t, n, r, i) {
2144
- const o = ct(t, n, r);
2145
- if (o) return o;
2146
- ae(e, `unknown ${i} tag !<${r}>`);
2147
- }
2148
- function Yi(e, t) {
2149
- const n = Ui(e.source, t), r = t.tagStart === Be ? "" : e.source.slice(t.tagStart, t.tagEnd), i = e.schema.defaultScalarTag;
2150
- if (r !== "") {
2151
- if (r === "!") return {
2152
- value: n,
2153
- tag: i
2154
- };
2155
- const o = Xn(r, e.tagHandlers), a = ct(e.schema.exact.scalar, e.schema.prefix.scalar, o);
2156
- if (a) {
2157
- const l = a.resolve(n, !0, o);
2158
- return l === H && ae(e, `cannot resolve a node with !<${o}> explicit tag`), {
2159
- value: l,
2160
- tag: a
2161
- };
2162
- }
2163
- const s = ct(e.schema.exact.mapping, e.schema.prefix.mapping, o) ?? ct(e.schema.exact.sequence, e.schema.prefix.sequence, o);
2164
- if (s) {
2165
- n !== "" && ae(e, `cannot resolve a node with !<${o}> explicit tag`);
2166
- const l = s.create(o);
2167
- return {
2168
- value: s.carrierIsResult ? l : Qn(e, e.position, s, l),
2169
- tag: s
2170
- };
2171
- }
2172
- ae(e, `unknown scalar tag !<${o}>`);
2173
- }
2174
- if (t.style === 1) {
2175
- const o = e.schema.implicitScalarByFirstChar.get(n.charAt(0)) ?? e.schema.implicitScalarAnyFirstChar;
2176
- for (const a of o) {
2177
- const s = a.resolve(n, !1, a.tagName);
2178
- if (s !== H) return {
2179
- value: s,
2180
- tag: a
2181
- };
2182
- }
2183
- }
2184
- return {
2185
- value: i.resolve(n, !1, i.tagName),
2186
- tag: i
2187
- };
2188
- }
2189
- function bn(e, t, n, r, i, o) {
2190
- const a = t.tagStart === Be ? "" : e.source.slice(t.tagStart, t.tagEnd), s = a === "" || a === "!" ? i : Xn(a, e.tagHandlers);
2191
- return {
2192
- tagName: s,
2193
- tag: Gi(e, n, r, s, o)
2194
- };
2195
- }
2196
- function Zn(e) {
2197
- return e.nodeKind === "mapping";
2198
- }
2199
- function vn(e, t, n, r) {
2200
- for (const i of r.keys(n)) {
2201
- if (e.maxTotalMergeKeys !== -1 && ++e.totalMergeKeys > e.maxTotalMergeKeys && ae(e, `merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`), t.tag.has(t.value, i)) continue;
2202
- const o = t.tag.addPair(t.value, i, r.get(n, i));
2203
- o && ae(e, o), (t.overridable ??= /* @__PURE__ */ new Set()).add(i);
2204
- }
2205
- }
2206
- function Wi(e, t, n, r) {
2207
- if (e.position = t.keyPosition, Zn(r)) vn(e, t, n, r);
2208
- else if (r.nodeKind === "sequence" && Array.isArray(n)) for (const i of n) vn(e, t, i, t.tag);
2209
- else ae(e, "cannot merge mappings; the provided source object is unacceptable");
2210
- }
2211
- function ji(e, t, n, r, i) {
2212
- if (e.position = t.keyPosition, n === Jt) {
2213
- Wi(e, t, r, i);
2214
- return;
2215
- }
2216
- !e.json && t.tag.has(t.value, n) && !t.overridable?.has(n) && ae(e, "duplicated mapping key");
2217
- const o = t.tag.addPair(t.value, n, r);
2218
- o && ae(e, o), t.overridable?.delete(n);
2219
- }
2220
- function kt(e, t, n) {
2221
- const r = e.frames[e.frames.length - 1];
2222
- if (r.kind === "document")
2223
- r.value = t, r.hasValue = !0;
2224
- else if (r.kind === "sequence") {
2225
- r.merge && (Zn(n) || ae(e, "cannot merge mappings; the provided source object is unacceptable"));
2226
- const i = r.tag.addItem(r.value, t, r.index++);
2227
- i && ae(e, i);
2228
- } else if (r.hasKey) {
2229
- const i = r.key;
2230
- r.key = void 0, r.hasKey = !1, ji(e, r, i, t, n);
2231
- } else
2232
- r.key = t, r.keyPosition = e.position, r.hasKey = !0;
2233
- }
2234
- function Lt(e, t, n, r, i) {
2235
- if (t.anchorStart !== Be) {
2236
- const o = {
2237
- value: n,
2238
- tag: r,
2239
- isValueFinal: i
2240
- };
2241
- return e.anchors.set(e.source.slice(t.anchorStart, t.anchorEnd), o), o;
2242
- }
2243
- return null;
2244
- }
2245
- function Vi(e, t) {
2246
- const n = {
2247
- ...rn,
2248
- ...t,
2249
- events: e,
2250
- documents: [],
2251
- eventIndex: 0,
2252
- position: 0,
2253
- frames: [],
2254
- anchors: /* @__PURE__ */ new Map(),
2255
- tagHandlers: /* @__PURE__ */ Object.create(null),
2256
- totalMergeKeys: 0,
2257
- aliasCount: 0
2258
- };
2259
- for (; n.eventIndex < n.events.length; ) {
2260
- const r = n.events[n.eventIndex++];
2261
- switch (n.position = qi(r), r.type) {
2262
- case 1:
2263
- n.anchors = /* @__PURE__ */ new Map(), n.aliasCount = 0, n.tagHandlers = /* @__PURE__ */ Object.create(null);
2264
- for (const i of r.directives) i.kind === "tag" && (n.tagHandlers[i.handle] = i.prefix);
2265
- n.frames.push({
2266
- kind: "document",
2267
- position: n.position,
2268
- value: void 0,
2269
- hasValue: !1
2270
- });
2271
- break;
2272
- case 4: {
2273
- const { value: i, tag: o } = Yi(n, r);
2274
- Lt(n, r, i, o, !0), kt(n, i, o);
2275
- break;
2276
- }
2277
- case 2: {
2278
- const i = bn(n, r, n.schema.exact.sequence, n.schema.prefix.sequence, "tag:yaml.org,2002:seq", "sequence"), o = i.tag.create(i.tagName), a = Lt(n, r, o, i.tag, i.tag.carrierIsResult), s = n.frames[n.frames.length - 1], l = s !== void 0 && s.kind === "mapping" && s.hasKey && s.key === Jt;
2279
- n.frames.push({
2280
- kind: "sequence",
2281
- position: n.position,
2282
- value: o,
2283
- tag: i.tag,
2284
- anchor: a,
2285
- index: 0,
2286
- merge: l
2287
- });
2288
- break;
2289
- }
2290
- case 3: {
2291
- const i = bn(n, r, n.schema.exact.mapping, n.schema.prefix.mapping, "tag:yaml.org,2002:map", "mapping"), o = i.tag.create(i.tagName), a = Lt(n, r, o, i.tag, i.tag.carrierIsResult);
2292
- n.frames.push({
2293
- kind: "mapping",
2294
- position: n.position,
2295
- value: o,
2296
- tag: i.tag,
2297
- anchor: a,
2298
- key: void 0,
2299
- keyPosition: n.position,
2300
- hasKey: !1,
2301
- overridable: null
2302
- });
2303
- break;
2304
- }
2305
- case 5: {
2306
- n.maxAliases !== -1 && ++n.aliasCount > n.maxAliases && ae(n, `aliases exceeded maxAliases (${n.maxAliases})`);
2307
- const i = n.source.slice(r.anchorStart, r.anchorEnd), o = n.anchors.get(i);
2308
- o || ae(n, `unidentified alias "${i}"`), o.isValueFinal || ae(n, `recursive alias "${i}" is not supported for tag ${o.tag.tagName} because it uses finalize()`), kt(n, o.value, o.tag);
2309
- break;
2310
- }
2311
- case 6: {
2312
- const i = n.frames.pop();
2313
- if (i.kind === "mapping" && i.hasKey && (n.position = i.keyPosition, ae(n, "incomplete mapping pair in event stream")), i.kind === "document") n.documents.push(i.value);
2314
- else {
2315
- const o = i.tag.carrierIsResult ? i.value : Qn(n, i.position, i.tag, i.value);
2316
- i.anchor && (i.anchor.value = o, i.anchor.isValueFinal = !0), kt(n, o, i.tag);
2317
- }
2318
- break;
2319
- }
2320
- }
2321
- }
2322
- return n.documents;
2323
- }
2324
- var B = -1, Jn = Object.prototype.hasOwnProperty, qe = 1, Bt = 2, er = 3, dt = 4, Xi = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, zi = /[,\[\]{}]/, tr = /^(?:!|!!|![0-9A-Za-z-]+!)$/, Dt = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`, nr = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`, Qi = new RegExp(`^(?:${Dt})*$`), Zi = new RegExp(`^(?:${nr})+$`), Ji = new RegExp(`^(?:!(?:${Dt})*|${nr}(?:${Dt})*)$`), on = {
2325
- filename: "",
2326
- maxDepth: 100
2327
- };
2328
- function eo(e, t, n) {
2329
- e.events.push({
2330
- type: 1,
2331
- explicitStart: t,
2332
- explicitEnd: n,
2333
- directives: e.directives
2334
- });
2335
- }
2336
- function rr(e, t, n, r, i, o, a) {
2337
- e.events.push({
2338
- type: 2,
2339
- start: t,
2340
- anchorStart: n,
2341
- anchorEnd: r,
2342
- tagStart: i,
2343
- tagEnd: o,
2344
- style: a
2345
- });
2346
- }
2347
- function Ut(e, t, n, r, i, o, a) {
2348
- e.events.push({
2349
- type: 3,
2350
- start: t,
2351
- anchorStart: n,
2352
- anchorEnd: r,
2353
- tagStart: i,
2354
- tagEnd: o,
2355
- style: a
2356
- });
2357
- }
2358
- function Rn(e, t) {
2359
- e.events.splice(t.eventsLength, 0, {
2360
- type: 3,
2361
- start: t.position,
2362
- anchorStart: B,
2363
- anchorEnd: B,
2364
- tagStart: B,
2365
- tagEnd: B,
2366
- style: 2
2367
- });
2368
- }
2369
- function Ye(e, t, n, r, i, o, a, s, l = 1, u = -1, c = !1) {
2370
- e.events.push({
2371
- type: 4,
2372
- valueStart: t,
2373
- valueEnd: n,
2374
- anchorStart: r,
2375
- anchorEnd: i,
2376
- tagStart: o,
2377
- tagEnd: a,
2378
- style: s,
2379
- chomping: l,
2380
- indent: u,
2381
- fast: c
2382
- });
2383
- }
2384
- function to(e, t, n) {
2385
- e.events.push({
2386
- type: 5,
2387
- anchorStart: t,
2388
- anchorEnd: n
2389
- });
2390
- }
2391
- function De(e) {
2392
- e.events.push({ type: 6 });
2393
- }
2394
- function ie(e) {
2395
- Ye(e, B, B, B, B, B, B, 1);
2396
- }
2397
- function xn() {
2398
- return {
2399
- anchorStart: B,
2400
- anchorEnd: B,
2401
- tagStart: B,
2402
- tagEnd: B
2403
- };
2404
- }
2405
- function Xe(e) {
2406
- return {
2407
- position: e.position,
2408
- line: e.line,
2409
- lineStart: e.lineStart,
2410
- lineIndent: e.lineIndent,
2411
- firstTabInLine: e.firstTabInLine,
2412
- eventsLength: e.events.length
2413
- };
2414
- }
2415
- function Ue(e, t) {
2416
- e.position = t.position, e.line = t.line, e.lineStart = t.lineStart, e.lineIndent = t.lineIndent, e.firstTabInLine = t.firstTabInLine, e.events.length = t.eventsLength;
2417
- }
2418
- function _(e, t) {
2419
- Ct(e.input.slice(0, e.length), e.position, t, e.filename);
2420
- }
2421
- function Z(e) {
2422
- return e === 10 || e === 13;
2423
- }
2424
- function Le(e) {
2425
- return e === 9 || e === 32;
2426
- }
2427
- function de(e) {
2428
- return Le(e) || Z(e);
2429
- }
2430
- function Se(e) {
2431
- return e === 0 || de(e);
2432
- }
2433
- function Oe(e) {
2434
- return e === 44 || e === 91 || e === 93 || e === 123 || e === 125;
2435
- }
2436
- function no(e) {
2437
- return e >= 48 && e <= 57 ? e - 48 : -1;
2438
- }
2439
- function ro(e) {
2440
- if (e >= 48 && e <= 57) return e - 48;
2441
- const t = e | 32;
2442
- return t >= 97 && t <= 102 ? t - 97 + 10 : -1;
2443
- }
2444
- function io(e) {
2445
- return e === 120 ? 2 : e === 117 ? 4 : e === 85 ? 8 : 0;
2446
- }
2447
- function oo(e) {
2448
- return e === 48 || e === 97 || e === 98 || e === 116 || e === 9 || e === 110 || e === 118 || e === 102 || e === 114 || e === 101 || e === 32 || e === 34 || e === 47 || e === 92 || e === 78 || e === 95 || e === 76 || e === 80;
2449
- }
2450
- function ht(e) {
2451
- e.input.charCodeAt(e.position) === 10 ? e.position++ : (e.position++, e.input.charCodeAt(e.position) === 10 && e.position++), e.line++, e.lineStart = e.position, e.lineIndent = 0, e.firstTabInLine = -1;
2452
- }
2453
- function oe(e, t) {
2454
- let n = 0, r = e.input.charCodeAt(e.position), i = e.position === e.lineStart || de(e.input.charCodeAt(e.position - 1));
2455
- for (; r !== 0; ) {
2456
- for (; Le(r); )
2457
- i = !0, r === 9 && e.firstTabInLine === -1 && (e.firstTabInLine = e.position), r = e.input.charCodeAt(++e.position);
2458
- if (t && i && r === 35) do
2459
- r = e.input.charCodeAt(++e.position);
2460
- while (!Z(r) && r !== 0);
2461
- if (!Z(r)) break;
2462
- for (ht(e), n++, i = !0, r = e.input.charCodeAt(e.position); r === 32; )
2463
- e.lineIndent++, r = e.input.charCodeAt(++e.position);
2464
- }
2465
- return n;
2466
- }
2467
- function $e(e, t = e.position) {
2468
- const n = e.input.charCodeAt(t);
2469
- if ((n === 45 || n === 46) && n === e.input.charCodeAt(t + 1) && n === e.input.charCodeAt(t + 2)) {
2470
- const r = e.input.charCodeAt(t + 3);
2471
- return r === 0 || de(r);
2472
- }
2473
- return !1;
2474
- }
2475
- function _n(e) {
2476
- let t = e.input.charCodeAt(e.position);
2477
- for (; t !== 0 && !Z(t); ) t = e.input.charCodeAt(++e.position);
2478
- }
2479
- function ir(e, t, n) {
2480
- Xi.test(e.input.slice(t, n)) && _(e, "the stream contains non-printable characters");
2481
- }
2482
- function ao(e, t, n) {
2483
- if (e.input.charCodeAt(e.position) !== 33) return !1;
2484
- t.tagStart !== B && _(e, "duplication of a tag property");
2485
- const r = e.position;
2486
- let i = !1, o = !1, a = "!", s = e.input.charCodeAt(++e.position);
2487
- s === 60 ? (i = !0, s = e.input.charCodeAt(++e.position)) : s === 33 && (o = !0, a = "!!", s = e.input.charCodeAt(++e.position));
2488
- let l = e.position, u;
2489
- if (i) {
2490
- for (; s !== 0 && s !== 62; ) s = e.input.charCodeAt(++e.position);
2491
- s !== 62 && _(e, "unexpected end of the stream within a verbatim tag"), u = e.input.slice(l, e.position), e.position++;
2492
- } else {
2493
- for (; s !== 0 && !de(s) && !(n && Oe(s)); )
2494
- s === 33 && (o ? _(e, "tag suffix cannot contain exclamation marks") : (a = e.input.slice(l - 1, e.position + 1), tr.test(a) || _(e, "named tag handle cannot contain such characters"), o = !0, l = e.position + 1)), s = e.input.charCodeAt(++e.position);
2495
- u = e.input.slice(l, e.position), zi.test(u) && _(e, "tag suffix cannot contain flow indicator characters");
2496
- }
2497
- return u && !(i ? Qi.test(u) : Zi.test(u)) && _(e, `tag name cannot contain such characters: ${u}`), !i && a !== "!" && a !== "!!" && !Jn.call(e.tagHandlers, a) && _(e, `undeclared tag handle "${a}"`), t.tagStart = r, t.tagEnd = e.position, !0;
2498
- }
2499
- function so(e, t) {
2500
- if (e.input.charCodeAt(e.position) !== 38) return !1;
2501
- t.anchorStart !== B && _(e, "duplication of an anchor property"), e.position++;
2502
- const n = e.position;
2503
- for (; e.input.charCodeAt(e.position) !== 0 && !de(e.input.charCodeAt(e.position)) && !Oe(e.input.charCodeAt(e.position)); ) e.position++;
2504
- return e.position === n && _(e, "name of an anchor node must contain at least one character"), t.anchorStart = n, t.anchorEnd = e.position, !0;
2505
- }
2506
- function lo(e, t) {
2507
- if (e.input.charCodeAt(e.position) !== 42) return !1;
2508
- (t.anchorStart !== B || t.tagStart !== B) && _(e, "alias node should not have any properties"), e.position++;
2509
- const n = e.position;
2510
- for (; e.input.charCodeAt(e.position) !== 0 && !de(e.input.charCodeAt(e.position)) && !Oe(e.input.charCodeAt(e.position)); ) e.position++;
2511
- return e.position === n && _(e, "name of an alias node must contain at least one character"), to(e, n, e.position), !0;
2512
- }
2513
- function Kt(e, t) {
2514
- oe(e, !1), e.lineIndent < t && _(e, "deficient indentation");
2515
- }
2516
- function co(e, t, n) {
2517
- if (e.input.charCodeAt(e.position) !== 39) return !1;
2518
- e.position++;
2519
- const r = e.position;
2520
- let i = !0;
2521
- for (; e.input.charCodeAt(e.position) !== 0; ) {
2522
- const o = e.input.charCodeAt(e.position);
2523
- if (o === 39) {
2524
- if (e.input.charCodeAt(e.position + 1) === 39) {
2525
- i = !1, e.position += 2;
2526
- continue;
2527
- }
2528
- const a = e.position;
2529
- return e.position++, Ye(e, r, a, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 2, 1, -1, i), !0;
2530
- }
2531
- Z(o) ? (i = !1, Kt(e, t)) : e.position === e.lineStart && $e(e) ? _(e, "unexpected end of the document within a single quoted scalar") : o !== 9 && o < 32 ? _(e, "expected valid JSON character") : e.position++;
2532
- }
2533
- _(e, "unexpected end of the stream within a single quoted scalar");
2534
- }
2535
- function uo(e, t, n) {
2536
- if (e.input.charCodeAt(e.position) !== 34) return !1;
2537
- e.position++;
2538
- const r = e.position;
2539
- let i = !0;
2540
- for (; e.input.charCodeAt(e.position) !== 0; ) {
2541
- const o = e.input.charCodeAt(e.position);
2542
- if (o === 34) {
2543
- const a = e.position;
2544
- return e.position++, Ye(e, r, a, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 3, 1, -1, i), !0;
2545
- }
2546
- if (o === 92) {
2547
- i = !1;
2548
- const a = e.input.charCodeAt(++e.position);
2549
- if (Z(a)) Kt(e, t);
2550
- else if (oo(a)) e.position++;
2551
- else {
2552
- let s = io(a);
2553
- for (s === 0 && _(e, "unknown escape sequence"); s-- > 0; )
2554
- e.position++, ro(e.input.charCodeAt(e.position)) < 0 && _(e, "expected hexadecimal character");
2555
- e.position++;
2556
- }
2557
- } else Z(o) ? (i = !1, Kt(e, t)) : e.position === e.lineStart && $e(e) ? _(e, "unexpected end of the document within a double quoted scalar") : o !== 9 && o < 32 ? _(e, "expected valid JSON character") : e.position++;
2558
- }
2559
- _(e, "unexpected end of the stream within a double quoted scalar");
2560
- }
2561
- function fo(e, t, n) {
2562
- const r = e.input.charCodeAt(e.position);
2563
- let i = 1, o = -1, a = !1;
2564
- if (r !== 124 && r !== 62) return !1;
2565
- const s = r === 124 ? 4 : 5;
2566
- for (e.position++; e.input.charCodeAt(e.position) !== 0; ) {
2567
- const C = e.input.charCodeAt(e.position), E = no(C);
2568
- if (C === 43 || C === 45)
2569
- i !== 1 && _(e, "repeat of a chomping mode identifier"), i = C === 43 ? 3 : 2, e.position++;
2570
- else if (E >= 0)
2571
- E === 0 && _(e, "bad explicit indentation width of a block scalar; it cannot be less than one"), a && _(e, "repeat of an indentation width identifier"), o = t + E - 1, a = !0, e.position++;
2572
- else break;
2573
- }
2574
- let l = !1;
2575
- for (; Le(e.input.charCodeAt(e.position)); )
2576
- l = !0, e.position++;
2577
- l && e.input.charCodeAt(e.position) === 35 && _n(e), Z(e.input.charCodeAt(e.position)) ? ht(e) : e.input.charCodeAt(e.position) !== 0 && _(e, "a line break is expected");
2578
- let u = a ? o : -1, c = 0;
2579
- const S = e.position;
2580
- let m = e.position;
2581
- for (; e.input.charCodeAt(e.position) !== 0; ) {
2582
- const C = e.position;
2583
- let E = 0;
2584
- for (; e.input.charCodeAt(C + E) === 32; ) E++;
2585
- const w = e.input.charCodeAt(C + E);
2586
- if (w === 0) {
2587
- u >= 0 ? E > u && (m = C + E) : E > 0 && (m = C + E);
2588
- break;
2589
- }
2590
- if (C === e.lineStart && $e(e, C)) break;
2591
- if (!a && u === -1 && Z(w) && (c = Math.max(c, E)), !a && u === -1 && !Z(w) && (w === 9 && E < t && (e.position = C + E, _(e, "tab characters must not be used in indentation")), E < c && (e.position = C + E, _(e, "bad indentation of a mapping entry"))), u === -1 && w !== 0 && !Z(w) && E < t) {
2592
- e.lineIndent = E, e.position = C + E;
2593
- break;
2594
- }
2595
- !a && w !== 0 && !Z(w) && u === -1 && (u = E);
2596
- const M = u === -1 ? t + 1 : u;
2597
- if (w !== 0 && !Z(w) && E < M) {
2598
- e.lineIndent = E, e.position = C + E;
2599
- break;
2600
- }
2601
- _n(e), m = e.position, Z(e.input.charCodeAt(e.position)) && (ht(e), m = e.position);
2602
- }
2603
- return ir(e, S, m), Ye(e, S, m, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, s, i, u), !0;
2604
- }
2605
- function po(e, t) {
2606
- const n = e.input.charCodeAt(e.position), r = t === qe;
2607
- if (n === 0 || de(n) || n === 35 || n === 38 || n === 42 || n === 33 || n === 124 || n === 62 || n === 39 || n === 34 || n === 37 || n === 64 || n === 96 || r && Oe(n)) return !1;
2608
- if (n === 63 || n === 45) {
2609
- const i = e.input.charCodeAt(e.position + 1);
2610
- if (Se(i) || r && Oe(i)) return !1;
2611
- }
2612
- return !0;
2613
- }
2614
- function ho(e, t, n, r) {
2615
- if (!po(e, n)) return !1;
2616
- const i = e.position;
2617
- let o = e.position, a = e.input.charCodeAt(e.position);
2618
- const s = n === qe;
2619
- let l = !1;
2620
- for (; a !== 0 && !(e.position === e.lineStart && $e(e)); ) {
2621
- if (a === 58) {
2622
- const u = e.input.charCodeAt(e.position + 1);
2623
- if (Se(u) || s && Oe(u)) break;
2624
- } else if (a === 35) {
2625
- if (de(e.input.charCodeAt(e.position - 1))) break;
2626
- } else {
2627
- if (s && Oe(a)) break;
2628
- if (Z(a)) {
2629
- const u = e.position, c = e.line, S = e.lineStart, m = e.lineIndent;
2630
- if (oe(e, !1), e.lineIndent >= t) {
2631
- l = !0, a = e.input.charCodeAt(e.position);
2632
- continue;
2633
- }
2634
- e.position = u, e.line = c, e.lineStart = S, e.lineIndent = m;
2635
- break;
2636
- }
2637
- }
2638
- Le(a) || (o = e.position + 1), a = e.input.charCodeAt(++e.position);
2639
- }
2640
- return o === i ? !1 : (ir(e, i, o), Ye(e, i, o, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, 1, 1, -1, !l), !0);
2641
- }
2642
- function je(e, t) {
2643
- const n = e.line;
2644
- oe(e, !0), (e.line > n && e.lineIndent < t || e.firstTabInLine !== -1 && e.lineIndent < t) && _(e, "deficient indentation");
2645
- }
2646
- function go(e, t, n) {
2647
- const r = e.input.charCodeAt(e.position), i = r === 123, o = e.position;
2648
- let a = !0;
2649
- if (r !== 91 && r !== 123) return !1;
2650
- const s = i ? 125 : 93;
2651
- for (i ? Ut(e, o, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 2) : rr(e, o, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 2), e.position++; e.input.charCodeAt(e.position) !== 0; ) {
2652
- je(e, t);
2653
- let l = e.input.charCodeAt(e.position);
2654
- if (l === s)
2655
- return e.position++, De(e), !0;
2656
- a ? l === 44 && _(e, "expected the node content, but found ','") : _(e, "missed comma between flow collection entries");
2657
- let u = !1, c = !1;
2658
- l === 63 && de(e.input.charCodeAt(e.position + 1)) && (u = c = !0, e.position += 1, je(e, t));
2659
- const S = e.line, m = Xe(e), C = ke(e, t, qe, !1, !0);
2660
- je(e, t), l = e.input.charCodeAt(e.position), (i || c || e.line === S) && l === 58 ? (u = !0, e.position++, je(e, t), i || Rn(e, m), C || ie(e), ke(e, t, qe, !1, !0) || ie(e), je(e, t), i || De(e)) : i && u ? (C || ie(e), ie(e)) : i ? ie(e) : u && (Rn(e, m), C || ie(e), ie(e), De(e)), l = e.input.charCodeAt(e.position), l === 44 ? (a = !0, e.position++) : a = !1;
2661
- }
2662
- _(e, "unexpected end of the stream within a flow collection");
2663
- }
2664
- function wn(e, t, n) {
2665
- if (e.firstTabInLine !== -1 || e.input.charCodeAt(e.position) !== 45 || !Se(e.input.charCodeAt(e.position + 1))) return !1;
2666
- for (rr(e, e.position, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 1); e.input.charCodeAt(e.position) === 45 && Se(e.input.charCodeAt(e.position + 1)); ) {
2667
- e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, _(e, "tab characters must not be used in indentation"));
2668
- const r = e.line;
2669
- e.position++;
2670
- const i = oe(e, !0) > 0;
2671
- if (e.firstTabInLine !== -1 && e.input.charCodeAt(e.position) === 45 && Se(e.input.charCodeAt(e.position + 1)) && _(e, "bad indentation of a sequence entry"), i && e.lineIndent <= t ? ie(e) : ke(e, t, er, !1, !0), oe(e, !0), e.lineIndent < t || e.position >= e.length) break;
2672
- e.lineIndent > t && _(e, "bad indentation of a sequence entry"), e.line === r && e.input.charCodeAt(e.position) === 45 && Se(e.input.charCodeAt(e.position + 1)) && _(e, "bad indentation of a sequence entry");
2673
- }
2674
- return De(e), !0;
2675
- }
2676
- function Ot(e, t, n, r) {
2677
- let i = !1, o = !1, a = !1, s = !1;
2678
- if (e.firstTabInLine !== -1) return !1;
2679
- let l = e.input.charCodeAt(e.position);
2680
- for (; l !== 0; ) {
2681
- !i && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, _(e, "tab characters must not be used in indentation"));
2682
- const u = e.input.charCodeAt(e.position + 1), c = e.line;
2683
- if ((l === 63 || l === 58) && Se(u))
2684
- a || (Ut(e, e.position, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, 1), a = !0), l === 63 ? (i && ie(e), o = !0, i = !0) : (i || (ie(e), o = !0), i = !1), e.position += 1, s = !0;
2685
- else {
2686
- i && (ie(e), i = !1);
2687
- const S = Xe(e);
2688
- if (!ke(e, n, Bt, !1, !0)) break;
2689
- if (e.line === c) {
2690
- for (l = e.input.charCodeAt(e.position); Le(l); ) l = e.input.charCodeAt(++e.position);
2691
- if (l === 58) {
2692
- if (l = e.input.charCodeAt(++e.position), Se(l) || _(e, "a whitespace character is expected after the key-value separator within a block mapping"), !a) {
2693
- for (Ue(e, S), Ut(e, S.position, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, 1), a = !0, ke(e, n, Bt, !1, !0), l = e.input.charCodeAt(e.position); Le(l); ) l = e.input.charCodeAt(++e.position);
2694
- e.position++;
2695
- }
2696
- o = !0, i = !1, s = !1;
2697
- } else if (o) _(e, "expected ':' after a mapping key");
2698
- else
2699
- return r.anchorStart !== B || r.tagStart !== B ? (Ue(e, S), !1) : !0;
2700
- } else if (o) _(e, "can not read a block mapping entry; a multiline key may not be an implicit key");
2701
- else
2702
- return r.anchorStart !== B || r.tagStart !== B ? (Ue(e, S), !1) : !0;
2703
- }
2704
- if (ke(e, t, dt, !0, s) && (s = !1), i || s && (ie(e), s = !1), oe(e, !0), l = e.input.charCodeAt(e.position), (e.line === c || e.lineIndent > t) && l !== 0) _(e, "bad indentation of a mapping entry");
2705
- else if (e.lineIndent < t) break;
2706
- }
2707
- return o ? (i && ie(e), a && De(e), !0) : !1;
2708
- }
2709
- function ke(e, t, n, r, i, o = !0) {
2710
- e.depth >= e.maxDepth && _(e, `nesting exceeded maxDepth (${e.maxDepth})`), e.depth++;
2711
- let a = 1, s = !1, l = !1, u = null;
2712
- const c = xn();
2713
- let S = n === dt || n === er, m = S;
2714
- const C = S;
2715
- if (r && oe(e, !0) && (s = !0, e.lineIndent > t ? a = 1 : e.lineIndent === t ? a = 0 : a = -1), a === 1) for (; ; ) {
2716
- const E = e.input.charCodeAt(e.position), w = Xe(e);
2717
- if (s && a !== 1 && (E === 33 || E === 38)) break;
2718
- if (s && C && (c.tagStart !== B || c.anchorStart !== B) && (E === 33 || E === 38)) {
2719
- const M = Xe(e), N = t + 1;
2720
- if (Ot(e, e.position - e.lineStart, N, c) && e.events[M.eventsLength]?.type === 3)
2721
- return e.depth--, !0;
2722
- Ue(e, M);
2723
- }
2724
- if (s && (E === 33 && c.tagStart !== B || E === 38 && c.anchorStart !== B) || !ao(e, c, n === qe) && !so(e, c)) break;
2725
- u === null && (u = w), oe(e, !0) ? (s = !0, m = C, e.lineIndent > t ? a = 1 : e.lineIndent === t ? a = 0 : a = -1) : m = !1;
2726
- }
2727
- if (m && (m = s || i), a === 1 || n === dt) {
2728
- const E = n === qe || n === Bt ? t : t + 1, w = e.position - e.lineStart;
2729
- if (a === 1) if (m && (wn(e, w, c) || Ot(e, w, E, c)) || go(e, E, c)) l = !0;
2730
- else {
2731
- const M = e.input.charCodeAt(e.position);
2732
- if (u !== null && o && C && !m && M !== 124 && M !== 62) {
2733
- const N = Xe(e), k = u.position - u.lineStart;
2734
- Ue(e, u), Ot(e, k, E, xn()) && e.events[N.eventsLength]?.type === 3 ? l = !0 : Ue(e, N);
2735
- }
2736
- !l && (S && fo(e, E, c) || co(e, E, c) || uo(e, E, c) || lo(e, c) || ho(e, E, n, c)) && (l = !0);
2737
- }
2738
- else a === 0 && (l = m && wn(e, w, c));
2739
- }
2740
- return S = S && !l, !l && (c.anchorStart !== B || c.tagStart !== B || S) && (Ye(e, B, B, c.anchorStart, c.anchorEnd, c.tagStart, c.tagEnd, 1), l = !0), e.depth--, l || c.anchorStart !== B || c.tagStart !== B;
2741
- }
2742
- function mo(e) {
2743
- if (e.lineIndent > 0 || e.input.charCodeAt(e.position) !== 37) return !1;
2744
- e.position++;
2745
- const t = e.position;
2746
- for (; e.input.charCodeAt(e.position) !== 0 && !de(e.input.charCodeAt(e.position)); ) e.position++;
2747
- const n = e.input.slice(t, e.position), r = [];
2748
- for (n.length === 0 && _(e, "directive name must not be less than one character in length"); e.input.charCodeAt(e.position) !== 0 && !Z(e.input.charCodeAt(e.position)); ) {
2749
- for (; Le(e.input.charCodeAt(e.position)); ) e.position++;
2750
- if (e.input.charCodeAt(e.position) === 35 || Z(e.input.charCodeAt(e.position)) || e.input.charCodeAt(e.position) === 0) break;
2751
- const i = e.position;
2752
- for (; e.input.charCodeAt(e.position) !== 0 && !de(e.input.charCodeAt(e.position)); ) e.position++;
2753
- r.push(e.input.slice(i, e.position));
2754
- }
2755
- if (Z(e.input.charCodeAt(e.position)) && ht(e), n === "YAML") {
2756
- e.directives.some((o) => o.kind === "yaml") && _(e, "duplication of %YAML directive"), r.length !== 1 && _(e, "YAML directive accepts exactly one argument");
2757
- const i = /^([0-9]+)\.([0-9]+)$/.exec(r[0]);
2758
- i === null && _(e, "ill-formed argument of the YAML directive"), parseInt(i[1], 10) !== 1 && _(e, "unacceptable YAML version of the document"), e.directives.push({
2759
- kind: "yaml",
2760
- version: r[0]
2761
- });
2762
- } else if (n === "TAG") {
2763
- r.length !== 2 && _(e, "TAG directive accepts exactly two arguments");
2764
- const [i, o] = r;
2765
- tr.test(i) || _(e, "ill-formed tag handle (first argument) of the TAG directive"), Jn.call(e.tagHandlers, i) && _(e, `there is a previously declared suffix for "${i}" tag handle`), Ji.test(o) || _(e, "ill-formed tag prefix (second argument) of the TAG directive"), e.tagHandlers[i] = o, e.directives.push({
2766
- kind: "tag",
2767
- handle: i,
2768
- prefix: o
2769
- });
2770
- }
2771
- return !0;
2772
- }
2773
- function Ao(e) {
2774
- e.directives = [], e.tagHandlers = /* @__PURE__ */ Object.create(null);
2775
- let t = !1;
2776
- for (oe(e, !0); mo(e); )
2777
- t = !0, oe(e, !0);
2778
- let n = !1, r = !1, i = !0;
2779
- if (e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 && Se(e.input.charCodeAt(e.position + 3))) {
2780
- n = !0;
2781
- const s = e.line;
2782
- e.position += 3, oe(e, !0), i = e.line > s;
2783
- } else t && _(e, "directives end mark is expected");
2784
- const o = e.events.length;
2785
- if (!n && e.position === e.lineStart && e.input.charCodeAt(e.position) === 46 && $e(e)) {
2786
- e.position += 3, oe(e, !0);
2787
- return;
2788
- }
2789
- if (eo(e, n, !1), ke(e, e.lineIndent - 1, dt, !1, i, i) || ie(e), oe(e, !0), e.position === e.lineStart && $e(e) && (r = e.input.charCodeAt(e.position) === 46, r)) {
2790
- const s = e.line;
2791
- e.position += 3, oe(e, !0), e.line === s && e.position < e.length && _(e, "end of the stream or a document separator is expected");
2792
- }
2793
- const a = e.events[o];
2794
- a?.type === 1 && (a.explicitEnd = r), De(e), !r && e.position < e.length && !(e.position === e.lineStart && $e(e)) && _(e, "end of the stream or a document separator is expected");
2795
- }
2796
- function yo(e, t) {
2797
- const n = e.length, r = {
2798
- ...on,
2799
- ...t,
2800
- input: `${e}\0`,
2801
- length: n,
2802
- position: 0,
2803
- line: 0,
2804
- lineStart: 0,
2805
- lineIndent: 0,
2806
- firstTabInLine: -1,
2807
- depth: 0,
2808
- directives: [],
2809
- tagHandlers: /* @__PURE__ */ Object.create(null),
2810
- events: []
2811
- }, i = e.indexOf("\0");
2812
- for (i !== -1 && Ct(e, i, "null byte is not allowed in input", r.filename), r.input.charCodeAt(r.position) === 65279 && r.position++; r.position < r.length && (oe(r, !0), !(r.position >= r.length)); ) {
2813
- const o = r.position;
2814
- Ao(r), r.position === o && _(r, "can not read a document");
2815
- }
2816
- return r.events;
2817
- }
2818
- var So = {
2819
- ...on,
2820
- ...rn
2821
- };
2822
- function Eo(e, t = {}) {
2823
- const n = {
2824
- ...So,
2825
- ...t
2826
- }, r = String(e), i = Object.keys(on), o = Object.keys(rn);
2827
- return Vi(yo(r, Mt(n, i)), {
2828
- ...Mt(n, o),
2829
- source: r
2830
- });
2831
- }
2832
- function Co(e, t, n) {
2833
- let r = null;
2834
- typeof t == "function" ? r = t : t !== null && typeof t == "object" && (n = t);
2835
- const i = Eo(e, n);
2836
- if (r === null) return i;
2837
- for (const o of i) r(o);
2838
- }
2839
- var rt = class {
2840
- tagged = !1;
2841
- flow = !1;
2842
- singleQuoted = !1;
2843
- doubleQuoted = !1;
2844
- literal = !1;
2845
- folded = !1;
2846
- }, Ie = /* @__PURE__ */ Symbol("INVALID");
2847
- function To(e) {
2848
- const t = new Set([
2849
- e.defaultScalarTag,
2850
- e.defaultSequenceTag,
2851
- e.defaultMappingTag
2852
- ].filter((o) => o !== void 0)), n = e.implicitScalarTags, r = e.tags.filter((o) => !(o.nodeKind === "scalar" && o.implicit) && !t.has(o)), i = e.tags.filter((o) => t.has(o));
2853
- return [
2854
- ...n.map((o) => ({
2855
- tag: o,
2856
- implicitTag: !0
2857
- })),
2858
- ...r.map((o) => ({
2859
- tag: o,
2860
- implicitTag: !1
2861
- })),
2862
- ...i.map((o) => ({
2863
- tag: o,
2864
- implicitTag: !0
2865
- }))
2866
- ];
2867
- }
2868
- function bo(e, t) {
2869
- for (let n = 0, r = e.representTypes.length; n < r; n += 1) {
2870
- const { tag: i, implicitTag: o } = e.representTypes[n];
2871
- if (i.identify && i.identify(t)) {
2872
- let a;
2873
- return i.matchByTagPrefix && i.representTagName ? a = i.representTagName(t) : a = i.tagName, {
2874
- tag: i,
2875
- tagName: a,
2876
- implicitTag: o
2877
- };
2878
- }
2879
- }
2880
- return null;
2881
- }
2882
- function Ve(e, t) {
2883
- if (!e.noRefs && t !== null && typeof t == "object") {
2884
- const c = e.refs.get(t);
2885
- if (c)
2886
- return c.anchor === void 0 && (c.anchor = `ref_${e.refCounter++}`), {
2887
- kind: "alias",
2888
- tag: "",
2889
- style: new rt(),
2890
- anchor: c.anchor
2891
- };
2892
- }
2893
- const n = bo(e, t);
2894
- if (!n) {
2895
- if (t === void 0 || e.skipInvalid) return Ie;
2896
- throw new Et(`unacceptable kind of an object to dump ${Object.prototype.toString.call(t)}`);
2897
- }
2898
- const { tag: r, tagName: i, implicitTag: o } = n, a = o ? i : zn(i);
2899
- if (r.nodeKind === "scalar") {
2900
- const c = new rt();
2901
- return c.tagged = !o, {
2902
- kind: "scalar",
2903
- tag: a,
2904
- style: c,
2905
- value: r.represent(t)
2906
- };
2907
- }
2908
- if (r.nodeKind === "sequence") {
2909
- const c = r.represent(t), S = new rt();
2910
- S.tagged = !o;
2911
- const m = {
2912
- kind: "sequence",
2913
- tag: a,
2914
- style: S,
2915
- items: []
2916
- };
2917
- e.noRefs || e.refs.set(t, m);
2918
- for (let C = 0, E = c.length; C < E; C += 1) {
2919
- let w = Ve(e, c[C]);
2920
- w === Ie && c[C] === void 0 && (w = Ve(e, null)), w !== Ie && m.items.push(w);
2921
- }
2922
- return m;
2923
- }
2924
- const s = r.represent(t), l = new rt();
2925
- l.tagged = !o;
2926
- const u = {
2927
- kind: "mapping",
2928
- tag: a,
2929
- style: l,
2930
- items: []
2931
- };
2932
- e.noRefs || e.refs.set(t, u);
2933
- for (const [c, S] of s) {
2934
- const m = Ve(e, c);
2935
- if (m === Ie) continue;
2936
- const C = Ve(e, S);
2937
- C !== Ie && u.items.push({
2938
- key: m,
2939
- value: C
2940
- });
2941
- }
2942
- return u;
2943
- }
2944
- function vo(e, t, n = {}) {
2945
- const r = Ve({
2946
- representTypes: To(t),
2947
- noRefs: n.noRefs ?? !1,
2948
- skipInvalid: n.skipInvalid ?? !1,
2949
- refs: /* @__PURE__ */ new Map(),
2950
- refCounter: 0
2951
- }, e);
2952
- return [{
2953
- contents: r === Ie ? null : r,
2954
- directives: []
2955
- }];
2956
- }
2957
- var Ro = /* @__PURE__ */ Symbol("visit:break"), or = /* @__PURE__ */ Symbol("visit:skip");
2958
- function ut(e, t, n) {
2959
- const r = t(e, n);
2960
- if (r === Ro) return !0;
2961
- if (r === or) return !1;
2962
- const i = n.depth + 1;
2963
- switch (e.kind) {
2964
- case "sequence":
2965
- for (const o of e.items) if (ut(o, t, {
2966
- depth: i,
2967
- parent: e,
2968
- isKey: !1
2969
- })) return !0;
2970
- break;
2971
- case "mapping":
2972
- for (const { key: o, value: a } of e.items)
2973
- if (ut(o, t, {
2974
- depth: i,
2975
- parent: e,
2976
- isKey: !0
2977
- }) || ut(a, t, {
2978
- depth: i,
2979
- parent: e,
2980
- isKey: !1
2981
- })) return !0;
2982
- break;
2983
- }
2984
- return !1;
2985
- }
2986
- function xo(e, t) {
2987
- for (const n of e) if (n.contents && ut(n.contents, t, {
2988
- depth: 0,
2989
- parent: null,
2990
- isKey: !1
2991
- })) return;
2992
- }
2993
- var an = 65279, _o = 9, Pe = 10, ar = 13, wo = 32, Io = 33, sr = 34, qt = 35, No = 37, $o = 38, lr = 39, ko = 42, Gt = 44, sn = 45, Ze = 58, Lo = 61, Oo = 62, cr = 63, Po = 64, Yt = 91, Wt = 93, Fo = 96, jt = 123, Ho = 124, Vt = 125, te = {};
2994
- te[0] = "\\0";
2995
- te[7] = "\\a";
2996
- te[8] = "\\b";
2997
- te[9] = "\\t";
2998
- te[10] = "\\n";
2999
- te[11] = "\\v";
3000
- te[12] = "\\f";
3001
- te[13] = "\\r";
3002
- te[27] = "\\e";
3003
- te[34] = '\\"';
3004
- te[92] = "\\\\";
3005
- te[133] = "\\N";
3006
- te[160] = "\\_";
3007
- te[8232] = "\\L";
3008
- te[8233] = "\\P";
3009
- var ln = {
3010
- indent: 2,
3011
- seqNoIndent: !1,
3012
- seqInlineFirst: !0,
3013
- sortKeys: !1,
3014
- lineWidth: 80,
3015
- flowBracketPadding: !1,
3016
- flowSkipCommaSpace: !1,
3017
- flowSkipColonSpace: !1,
3018
- quoteFlowKeys: !1,
3019
- quoteStyle: "single",
3020
- forceQuotes: !1,
3021
- tagBeforeAnchor: !1
3022
- };
3023
- function Mo(e) {
3024
- return e.style.tagged ? e.tag : zn(e.tag);
3025
- }
3026
- function Bo(e) {
3027
- const t = {
3028
- ...ln,
3029
- ...e
3030
- };
3031
- return {
3032
- ...t,
3033
- defaultScalarTagName: t.schema.defaultScalarTag.tagName,
3034
- implicitResolvers: t.schema.implicitScalarTags
3035
- };
3036
- }
3037
- function Do(e) {
3038
- const t = e.toString(16).toUpperCase(), n = e <= 255 ? "x" : "u", r = e <= 255 ? 2 : 4;
3039
- return `\\${n}${"0".repeat(r - t.length)}${t}`;
3040
- }
3041
- function In(e, t) {
3042
- const n = " ".repeat(t);
3043
- let r = 0, i = "";
3044
- const o = e.length;
3045
- for (; r < o; ) {
3046
- let a;
3047
- const s = e.indexOf(`
3048
- `, r);
3049
- s === -1 ? (a = e.slice(r), r = o) : (a = e.slice(r, s + 1), r = s + 1), a.length && a !== `
3050
- ` && (i += n), i += a;
3051
- }
3052
- return i;
3053
- }
3054
- function Xt(e, t) {
3055
- return `
3056
- ${" ".repeat(e.indent * t)}`;
3057
- }
3058
- function Uo(e, t) {
3059
- const n = e.indent * Math.max(1, t);
3060
- return {
3061
- indent: n,
3062
- blockIndent: t === 0 ? e.indent + 1 : e.indent,
3063
- lineWidth: e.lineWidth === -1 ? -1 : Math.max(Math.min(e.lineWidth, 40), e.lineWidth - n)
3064
- };
3065
- }
3066
- function Nn(e, t) {
3067
- for (let n = 0, r = e.implicitResolvers.length; n < r; n += 1) {
3068
- const i = e.implicitResolvers[n];
3069
- if (i.resolve(t, !1, i.tagName) !== H) return i.tagName;
3070
- }
3071
- return e.defaultScalarTagName;
3072
- }
3073
- function Ge(e) {
3074
- return e === wo || e === _o;
3075
- }
3076
- function Ko(e) {
3077
- const t = e.charCodeAt(0);
3078
- if (t !== sn && t !== 46 || e.charCodeAt(1) !== t || e.charCodeAt(2) !== t) return !1;
3079
- if (e.length === 3) return !0;
3080
- const n = e.charCodeAt(3);
3081
- return Ge(n) || n === ar || n === Pe;
3082
- }
3083
- function Je(e) {
3084
- return e >= 32 && e <= 126 || e >= 161 && e <= 55295 && e !== 8232 && e !== 8233 || e >= 57344 && e <= 65533 && e !== an || e >= 65536 && e <= 1114111;
3085
- }
3086
- function $n(e) {
3087
- return Je(e) && e !== an && e !== ar && e !== Pe;
3088
- }
3089
- function zt(e, t, n) {
3090
- const r = $n(e), i = r && !Ge(e);
3091
- return (n ? r : r && e !== Gt && e !== Yt && e !== Wt && e !== jt && e !== Vt) && e !== qt && !(t === Ze && !i) || $n(t) && !Ge(t) && e === qt || t === Ze && i && (n || e !== Gt && e !== Yt && e !== Wt && e !== jt && e !== Vt);
3092
- }
3093
- function qo(e) {
3094
- return Je(e) && e !== an && !Ge(e) && e !== sn && e !== cr && e !== Ze && e !== Gt && e !== Yt && e !== Wt && e !== jt && e !== Vt && e !== qt && e !== $o && e !== ko && e !== Io && e !== Ho && e !== Lo && e !== Oo && e !== lr && e !== sr && e !== No && e !== Po && e !== Fo;
3095
- }
3096
- function Go(e, t) {
3097
- const n = Ke(e, 0);
3098
- if (qo(n)) return !0;
3099
- if (e.length > 1 && (n === sn || n === cr || n === Ze)) {
3100
- const r = Ke(e, 1);
3101
- return !Ge(r) && zt(r, n, t);
3102
- }
3103
- return !1;
3104
- }
3105
- function Yo(e) {
3106
- return !Ge(e) && e !== Ze;
3107
- }
3108
- function Ke(e, t) {
3109
- const n = e.charCodeAt(t);
3110
- let r;
3111
- return n >= 55296 && n <= 56319 && t + 1 < e.length && (r = e.charCodeAt(t + 1), r >= 56320 && r <= 57343) ? (n - 55296) * 1024 + r - 56320 + 65536 : n;
3112
- }
3113
- function ur(e) {
3114
- return /^\n* /.test(e);
3115
- }
3116
- var et = 1, ze = 2, cn = 3, un = 4, ve = 5;
3117
- function Wo(e, t, n, r, i, o) {
3118
- const { blockIndent: a, lineWidth: s } = n;
3119
- let l, u = 0, c = -1, S = !1, m = !1;
3120
- const C = s !== -1;
3121
- let E = -1, w = !Ko(t) && Go(t, o) && Yo(Ke(t, t.length - 1));
3122
- if (r || i) for (l = 0; l < t.length; u >= 65536 ? l += 2 : l++) {
3123
- if (u = Ke(t, l), !Je(u)) return ve;
3124
- w = w && zt(u, c, o), c = u;
3125
- }
3126
- else {
3127
- for (l = 0; l < t.length; u >= 65536 ? l += 2 : l++) {
3128
- if (u = Ke(t, l), u === Pe)
3129
- S = !0, C && (m = m || l - E - 1 > s && !tt(t[E + 1]), E = l);
3130
- else if (!Je(u)) return ve;
3131
- w = w && zt(u, c, o), c = u;
3132
- }
3133
- m = m || C && l - E - 1 > s && !tt(t[E + 1]);
3134
- }
3135
- return !S && !m ? w && !i ? et : e.quoteStyle === "double" ? ve : ze : a > 9 && ur(t) ? ve : m ? un : cn;
3136
- }
3137
- function jo(e, t, n) {
3138
- const { indent: r, blockIndent: i, lineWidth: o } = n;
3139
- switch (t) {
3140
- case et:
3141
- return Ln(e, r);
3142
- case ze:
3143
- return `'${Ln(e, r).replace(/'/g, "''")}'`;
3144
- case cn:
3145
- return "|" + kn(e, i) + On(In(e, r));
3146
- case un:
3147
- return ">" + kn(e, i) + On(In(Xo(e, o), r));
3148
- case ve:
3149
- return `"${zo(e)}"`;
3150
- }
3151
- }
3152
- function Vo(e, t, n, r, i) {
3153
- const o = r || !i;
3154
- if (t.style.singleQuoted) return ze;
3155
- if (t.style.doubleQuoted) return ve;
3156
- if (!o) {
3157
- if (t.style.literal) return cn;
3158
- if (t.style.folded) return un;
3159
- }
3160
- const a = t.value;
3161
- if (a.length === 0)
3162
- return t.style.tagged || Nn(e, a) === t.tag ? et : e.quoteStyle === "double" ? ve : ze;
3163
- const s = Wo(e, a, n, o, e.forceQuotes && !r, i);
3164
- return s === et && !t.style.tagged && Nn(e, a) !== t.tag ? e.quoteStyle === "double" ? ve : ze : s;
3165
- }
3166
- function kn(e, t) {
3167
- const n = ur(e) ? String(t) : "", r = e[e.length - 1] === `
3168
- `;
3169
- return `${n}${r && (e[e.length - 2] === `
3170
- ` || e === `
3171
- `) ? "+" : r ? "" : "-"}
3172
- `;
3173
- }
3174
- function Ln(e, t) {
3175
- let n = e.indexOf(`
3176
- `);
3177
- if (n === -1) return e;
3178
- const r = " ".repeat(t);
3179
- let i = e.slice(0, n);
3180
- const o = /(\n+)([^\n]*)/g;
3181
- o.lastIndex = n;
3182
- let a;
3183
- for (; a = o.exec(e); ) {
3184
- const s = a[1].length, l = a[2];
3185
- i += `
3186
- `.repeat(s + 1) + r + l;
3187
- }
3188
- return i;
3189
- }
3190
- function On(e) {
3191
- return e[e.length - 1] === `
3192
- ` ? e.slice(0, -1) : e;
3193
- }
3194
- function tt(e) {
3195
- return e === " " || e === " ";
3196
- }
3197
- function Xo(e, t) {
3198
- const n = /(\n+)([^\n]*)/g;
3199
- let r = e.indexOf(`
3200
- `);
3201
- r === -1 && (r = e.length), n.lastIndex = r;
3202
- let i = Pn(e.slice(0, r), t), o = e[0] === `
3203
- ` || tt(e[0]), a, s;
3204
- for (; s = n.exec(e); ) {
3205
- const l = s[1], u = s[2];
3206
- a = u !== "" && tt(u[0]), i += l + (!o && !a && u !== "" ? `
3207
- ` : "") + Pn(u, t), o = a;
3208
- }
3209
- return i;
3210
- }
3211
- function Pn(e, t) {
3212
- if (e === "" || tt(e[0])) return e;
3213
- const n = / [^ \t]/g;
3214
- let r, i = 0, o, a = 0, s = 0, l = "";
3215
- for (; r = n.exec(e); )
3216
- s = r.index, s - i > t && (o = a > i ? a : s, l += `
3217
- ${e.slice(i, o)}`, i = o + 1), a = s;
3218
- return l += `
3219
- `, e.length - i > t && a > i ? l += `${e.slice(i, a)}
3220
- ${e.slice(a + 1)}` : l += e.slice(i), l.slice(1);
3221
- }
3222
- function zo(e) {
3223
- let t = "", n = 0;
3224
- for (let r = 0; r < e.length; n >= 65536 ? r += 2 : r++) {
3225
- n = Ke(e, r);
3226
- const i = te[n];
3227
- if (i) {
3228
- t += i;
3229
- continue;
3230
- }
3231
- if (Je(n)) {
3232
- t += e[r], n >= 65536 && (t += e[r + 1]);
3233
- continue;
3234
- }
3235
- t += Do(n);
3236
- }
3237
- return t;
3238
- }
3239
- function Qo(e, t, n) {
3240
- let r = "";
3241
- for (let o = 0, a = n.items.length; o < a; o += 1) {
3242
- const s = Ee(e, t, n.items[o], {});
3243
- r !== "" && (r += `,${e.flowSkipCommaSpace ? "" : " "}`), r += s;
3244
- }
3245
- const i = e.flowBracketPadding && r !== "" ? " " : "";
3246
- return `[${i}${r}${i}]`;
3247
- }
3248
- function Fn(e, t, n, r) {
3249
- let i = "";
3250
- for (let o = 0, a = n.items.length; o < a; o += 1) {
3251
- const s = Ee(e, t + 1, n.items[o], {
3252
- block: !0,
3253
- compact: e.seqInlineFirst,
3254
- isblockseq: !0
3255
- });
3256
- (!r || i !== "") && (i += Xt(e, t)), s === "" || Pe === s.charCodeAt(0) ? i += "-" : i += "- ", i += s;
3257
- }
3258
- return i;
3259
- }
3260
- function Zo(e, t, n) {
3261
- let r = "";
3262
- const i = fr(e, n.items);
3263
- for (const { key: a, value: s } of i) {
3264
- let l = "";
3265
- r !== "" && (l += `,${e.flowSkipCommaSpace ? "" : " "}`);
3266
- const u = Ee(e, t, a, { iskey: !0 }), c = u.length > 1024;
3267
- c ? l += "? " : e.quoteFlowKeys && (l += '"');
3268
- const S = Ee(e, t, s, {}), m = e.flowSkipColonSpace || S === "" ? "" : " ";
3269
- l += `${u}${e.quoteFlowKeys && !c ? '"' : ""}:${m}${S}`, r += l;
3270
- }
3271
- const o = e.flowBracketPadding && r !== "" ? " " : "";
3272
- return `{${o}${r}${o}}`;
3273
- }
3274
- function it(e) {
3275
- return e.kind === "scalar" ? e.value : e;
3276
- }
3277
- function fr(e, t) {
3278
- if (!e.sortKeys) return t;
3279
- const n = t.slice();
3280
- if (e.sortKeys === !0) n.sort((r, i) => {
3281
- const o = it(r.key), a = it(i.key);
3282
- return o < a ? -1 : o > a ? 1 : 0;
3283
- });
3284
- else {
3285
- const r = e.sortKeys;
3286
- n.sort((i, o) => r(it(i.key), it(o.key)));
3287
- }
3288
- return n;
3289
- }
3290
- function Jo(e, t, n, r) {
3291
- let i = "";
3292
- const o = fr(e, n.items);
3293
- for (let a = 0, s = o.length; a < s; a += 1) {
3294
- let l = "";
3295
- (!r || i !== "") && (l += Xt(e, t));
3296
- const { key: u, value: c } = o[a], S = (u.kind === "mapping" || u.kind === "sequence") && !u.style.flow && u.items.length !== 0 || u.kind === "scalar" && (u.style.literal || u.style.folded), m = S ? Ee(e, t + 1, u, {
3297
- block: !0,
3298
- compact: !0,
3299
- isblockseq: !Qt(e, u, t + 1)
3300
- }) : Ee(e, t + 1, u, {
3301
- block: !0,
3302
- compact: !0,
3303
- iskey: !0
3304
- }), C = u.kind === "scalar" && u.value.indexOf(`
3305
- `) !== -1, E = S || C || m.length > 1024;
3306
- E && (m && Pe === m.charCodeAt(0) ? l += "?" : l += "? "), l += m, E && (l += Xt(e, t));
3307
- const w = Ee(e, t + 1, c, {
3308
- block: !0,
3309
- compact: E,
3310
- isblockseq: E && !Qt(e, c, t + 1)
3311
- }), M = u.kind === "scalar" && u.value === "" && m !== "" && m.charCodeAt(m.length - 1) !== lr && m.charCodeAt(m.length - 1) !== sr, N = !E && (u.kind === "alias" || M) ? " " : "";
3312
- w === "" || Pe === w.charCodeAt(0) ? l += `${N}:` : l += `${N}: `, l += w, i += l;
3313
- }
3314
- return i;
3315
- }
3316
- function Qt(e, t, n) {
3317
- return t.style.tagged || t.anchor !== void 0 || e.indent < 2 && n > 0;
3318
- }
3319
- function Ee(e, t, n, r) {
3320
- if (n.kind === "alias") return `*${n.anchor}`;
3321
- const { block: i = !1, iskey: o = !1, isblockseq: a = !1 } = r;
3322
- let s = r.compact ?? !1;
3323
- const l = n.anchor !== void 0;
3324
- Qt(e, n, t) && (s = !1);
3325
- let u, c = n.style.tagged;
3326
- const S = i && (n.kind === "mapping" || n.kind === "sequence") && !n.style.flow && n.items.length !== 0;
3327
- if (n.kind === "mapping") S ? u = Jo(e, t, n, s) : u = Zo(e, t, n);
3328
- else if (n.kind === "sequence") S ? e.seqNoIndent && !a && t > 0 ? u = Fn(e, t - 1, n, s) : u = Fn(e, t, n, s) : u = Qo(e, t, n);
3329
- else {
3330
- const m = Uo(e, t), C = Vo(e, n, m, o, i);
3331
- u = jo(n.value, C, m), c = n.style.tagged || C !== et && n.tag !== e.defaultScalarTagName;
3332
- }
3333
- if (S && s && t > 0 && e.indent > 2 && (u = `${" ".repeat(e.indent - 2)}${u}`), c || l) {
3334
- const m = [], C = c ? Mo(n) : null, E = l ? `&${n.anchor}` : null;
3335
- e.tagBeforeAnchor ? (C !== null && m.push(C), E !== null && m.push(E)) : (E !== null && m.push(E), C !== null && m.push(C));
3336
- const w = u === "" || u.charCodeAt(0) === Pe ? "" : " ";
3337
- u = `${m.join(" ")}${w}${u}`;
3338
- }
3339
- return u;
3340
- }
3341
- function ea(e) {
3342
- return (e.kind === "sequence" || e.kind === "mapping") && !e.style.flow && e.items.length !== 0 && !e.style.tagged && e.anchor === void 0;
3343
- }
3344
- function ta(e) {
3345
- let t = e;
3346
- for (; (t.kind === "sequence" || t.kind === "mapping") && !t.style.flow && t.items.length !== 0; ) t = t.kind === "sequence" ? t.items[t.items.length - 1] : t.items[t.items.length - 1].value;
3347
- if (t.kind !== "scalar" || !(t.style.literal || t.style.folded)) return !1;
3348
- const { value: n } = t;
3349
- return n.endsWith(`
3350
-
3351
- `) || n === `
3352
- `;
3353
- }
3354
- function na(e) {
3355
- let t = "";
3356
- for (const n of e.directives) {
3357
- if (n.kind === "yaml") {
3358
- t += `%YAML ${n.version}
3359
- `;
3360
- continue;
3361
- }
3362
- const { handle: r, prefix: i } = n;
3363
- t += `%TAG ${r} ${i}
3364
- `;
3365
- }
3366
- return t;
3367
- }
3368
- function ra(e, t) {
3369
- const n = Bo(t);
3370
- let r = "", i = !1;
3371
- for (let o = 0; o < e.length; o += 1) {
3372
- const a = e[o], s = na(a), l = s !== "", u = a.explicitStart || l || o > 0 && !i;
3373
- if (r += s, a.contents === null)
3374
- u && (r += `---
3375
- `);
3376
- else if (u) {
3377
- const c = Ee(n, 0, a.contents, {
3378
- block: !0,
3379
- compact: !0
3380
- }), S = c === "" ? "" : l || ea(a.contents) ? `
3381
- ` : " ";
3382
- r += `---${S}${c}
3383
- `;
3384
- } else r += Ee(n, 0, a.contents, {
3385
- block: !0,
3386
- compact: !0
3387
- }) + `
3388
- `;
3389
- i = a.explicitEnd || a.contents !== null && ta(a.contents), i && (r += `...
3390
- `);
3391
- }
3392
- return r;
3393
- }
3394
- var ia = $i.withTags({
3395
- ...Ft,
3396
- resolve: (e, t, n) => {
3397
- const r = Ft.resolve(e, t, n);
3398
- return r === H ? Mn.resolve(e, t, n) : r;
3399
- }
3400
- }, {
3401
- ...Ht,
3402
- resolve: (e, t, n) => {
3403
- const r = Ht.resolve(e, t, n);
3404
- return r === H ? Bn.resolve(e, t, n) : r;
3405
- }
3406
- }), oa = {
3407
- ...ln,
3408
- schema: ia,
3409
- skipInvalid: !1,
3410
- noRefs: !1,
3411
- flowLevel: -1,
3412
- transform: () => {
3413
- }
3414
- };
3415
- function aa(e, t = {}) {
3416
- const n = {
3417
- ...oa,
3418
- ...t
3419
- }, r = vo(e, n.schema, {
3420
- noRefs: n.noRefs,
3421
- skipInvalid: n.skipInvalid
3422
- });
3423
- return n.flowLevel >= 0 && xo(r, (i, o) => {
3424
- if (!(o.depth < n.flowLevel))
3425
- return i.style.flow = !0, or;
3426
- }), n.transform(r), ra(r, {
3427
- ...Mt(n, Object.keys(ln)),
3428
- schema: n.schema
3429
- });
3430
- }
3431
- const sa = Wn.withTags(Dn, Un, Kn, qn, Gn), pr = (e, t) => {
3432
- const n = Co(e, { schema: sa, ...t });
3433
- if (n.length === 0)
3434
- return e.trim() === "" ? void 0 : null;
3435
- if (n.length > 1)
3436
- throw new Et("expected a single document in the stream, but found more");
3437
- return n[0];
3438
- }, Ra = (e, t) => aa(e, t), la = /\((\d+):(\d+)\)$/;
3439
- class Tt extends Error {
3440
- originalError;
3441
- source;
3442
- col;
3443
- line;
3444
- constructor(t, n) {
3445
- super(t.message.split(`
3446
- `)[0]), this.originalError = t, this.source = n, Object.setPrototypeOf(this, Tt.prototype);
3447
- const [, r, i] = this.message.match(la) || [];
3448
- this.line = parseInt(r, 10), this.col = parseInt(i, 10);
3449
- }
3450
- }
3451
- const ca = [".graphql", ".gql"];
3452
- function dr(e) {
3453
- const t = e.toLowerCase();
3454
- return ca.some((n) => t.endsWith(n));
3455
- }
3456
- function ua(e, t) {
3457
- return e.hasOwnProperty(t) ? e[t] : void 0;
3458
- }
3459
- function fa(e) {
3460
- return e.endsWith(".yaml") || e.endsWith(".yml") || e.endsWith(".json");
3461
- }
3462
- function Pt(e, t) {
3463
- return e + "::" + t;
3464
- }
3465
- function pa() {
3466
- return new Promise((e) => {
3467
- setTimeout(e);
3468
- });
3469
- }
3470
- class Zt {
3471
- absoluteRef;
3472
- body;
3473
- mimeType;
3474
- constructor(t, n, r) {
3475
- this.absoluteRef = t, this.body = n, this.mimeType = r;
3476
- }
3477
- #e;
3478
- #t;
3479
- // pass safeLoad as argument to separate it from browser bundle
3480
- getAst(t) {
3481
- return this.#e === void 0 && (this.#e = t(this.body, { filename: this.absoluteRef }) ?? void 0, this.#e && this.#e.kind === 0 && // KIND.scalar = 0
3482
- this.#e.value === "" && this.#e.startPosition !== 1 && (this.#e.startPosition = 1, this.#e.endPosition = 1)), this.#e;
3483
- }
3484
- getLines() {
3485
- return this.#t === void 0 && (this.#t = this.body.split(/\r\n|[\n\r]/g)), this.#t;
3486
- }
3487
- }
3488
- class fn extends Error {
3489
- originalError;
3490
- constructor(t) {
3491
- super(t.message), this.originalError = t, Object.setPrototypeOf(this, fn.prototype);
3492
- }
3493
- }
3494
- function xa(e, t) {
3495
- const n = new Zt(t, e);
3496
- if (dr(t))
3497
- return { source: n, parsed: e };
3498
- try {
3499
- return {
3500
- source: n,
3501
- parsed: pr(e, { filename: t })
3502
- };
3503
- } catch (r) {
3504
- throw new Tt(r, n);
3505
- }
3506
- }
3507
- class _a {
3508
- config;
3509
- cache = /* @__PURE__ */ new Map();
3510
- constructor(t = { http: { headers: [] } }) {
3511
- this.config = t;
3512
- }
3513
- getFiles() {
3514
- return new Set(Array.from(this.cache.keys()));
3515
- }
3516
- resolveExternalRef(t, n) {
3517
- return Ne(n) ? n : t && Ne(t) ? new URL(n, t).href : Qe.resolve(t ? Qe.dirname(t) : process.cwd(), n);
3518
- }
3519
- async loadExternalRef(t) {
3520
- try {
3521
- if (Ne(t)) {
3522
- const { body: n, mimeType: r } = await Rr(t, this.config.http);
3523
- return new Zt(t, n, r);
3524
- } else {
3525
- if ((void 0)(t).isDirectory())
3526
- throw new Error(`Expected a file but received a folder at ${t}.`);
3527
- const n = await (void 0).readFile(t, "utf-8");
3528
- return new Zt(t, n.replace(/\r\n/g, `
3529
- `));
3530
- }
3531
- } catch (n) {
3532
- throw n.message = n.message.replace(", lstat", ""), new fn(n);
3533
- }
3534
- }
3535
- parseDocument(t, n = !1) {
3536
- if (dr(t.absoluteRef))
3537
- return { source: t, parsed: t.body };
3538
- const r = Ne(t.absoluteRef) ? new URL(t.absoluteRef).pathname : t.absoluteRef;
3539
- if (!fa(r) && !t.mimeType?.match(/(json|yaml|openapi)/) && !n)
3540
- return { source: t, parsed: t.body };
3541
- try {
3542
- return {
3543
- source: t,
3544
- parsed: pr(t.body, { filename: t.absoluteRef })
3545
- };
3546
- } catch (i) {
3547
- throw new Tt(i, t);
3548
- }
3549
- }
3550
- async resolveDocument(t, n, r = !1) {
3551
- const i = this.resolveExternalRef(t, n), o = this.cache.get(i);
3552
- if (o)
3553
- return o;
3554
- const a = this.loadExternalRef(i).then((s) => this.parseDocument(s, r));
3555
- return this.cache.set(i, a), a;
3556
- }
3557
- }
3558
- function Hn(e, t) {
3559
- return {
3560
- prev: e,
3561
- node: t
3562
- };
3563
- }
3564
- function da(e, t) {
3565
- for (; e; ) {
3566
- if (e.node === t)
3567
- return !0;
3568
- e = e.prev;
3569
- }
3570
- return !1;
3571
- }
3572
- const ot = { name: "unknown", properties: {} }, ha = { name: "scalar", properties: {} };
3573
- async function wa(e) {
3574
- const { rootDocument: t, externalRefResolver: n, rootType: r } = e, i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), a = [];
3575
- l(t.parsed, t, "#/", r);
3576
- let s;
3577
- do
3578
- s = await Promise.all(a);
3579
- while (a.length !== s.length);
3580
- return i;
3581
- function l(u, c, S, m) {
3582
- const C = c.source.absoluteRef, E = /* @__PURE__ */ new Map();
3583
- w(u, m, C + S);
3584
- function w(N, k, y) {
3585
- if (!be(N) && !Array.isArray(N))
3586
- return;
3587
- const R = `${k.name}::${y}`;
3588
- if (o.has(R))
3589
- return;
3590
- if (o.add(R), Array.isArray(N)) {
3591
- const v = k.items;
3592
- if (v === void 0 && k !== ot && k !== at)
3593
- return;
3594
- const A = typeof v == "function";
3595
- for (let g = 0; g < N.length; g++) {
3596
- let x = A ? v(N[g], Te(y, g)) : v;
3597
- if (x === void 0 && k !== ot && k !== at)
3598
- continue;
3599
- const W = x?.directResolveAs ? { $ref: N[g] } : N[g];
3600
- x = x?.directResolveAs || x, w(W, st(x) ? x : ot, Te(y, g));
3601
- }
3602
- return;
3603
- }
3604
- const [f, I] = Object.entries(N).find(([v]) => v === "$anchor") || [];
3605
- I && E.set(`#${I}`, N);
3606
- for (const v of Object.keys(N)) {
3607
- let A = N[v], g = ua(k.properties, v);
3608
- const x = k.extensionsPrefix !== void 0 && v.startsWith(k.extensionsPrefix);
3609
- g === void 0 && !x && (g = k.additionalProperties), typeof g == "function" && (g = g(A, v)), x && g === void 0 && (g = at), g === void 0 && (g = ot), !st(g) && g?.directResolveAs && (g = g.directResolveAs, A = { $ref: A }), g && g.name === void 0 && g.resolvable !== !1 && (g = ha), !(!st(g) || !(be(A) || Array.isArray(A))) && w(A, g, Te(y, Me(v)));
3610
- }
3611
- if (lt(N)) {
3612
- const v = M(c, N, {
3613
- prev: null,
3614
- node: N
3615
- }).then((A) => {
3616
- if (A.resolved) {
3617
- l(A.node, A.document, A.nodePointer, k);
3618
- for (const g of A.chain ?? [])
3619
- l(g.node, g.document, g.location.pointer, k);
3620
- }
3621
- });
3622
- a.push(v);
3623
- }
3624
- if (wr(N)) {
3625
- const v = M(c, { $ref: N.externalValue }, {
3626
- prev: null,
3627
- node: N
3628
- }).then((A) => {
3629
- A.resolved && l(A.node, A.document, A.nodePointer, k);
3630
- });
3631
- a.push(v);
3632
- }
3633
- }
3634
- async function M(N, k, y) {
3635
- if (da(y.prev, k))
3636
- throw new Error("Self-referencing circular pointer");
3637
- if (kr(k.$ref)) {
3638
- await pa();
3639
- const L = {
3640
- resolved: !0,
3641
- isRemote: !1,
3642
- node: E.get(k.$ref),
3643
- document: N,
3644
- nodePointer: k.$ref
3645
- }, U = Pt(N.source.absoluteRef, k.$ref);
3646
- return i.set(U, L), L;
3647
- }
3648
- const { uri: R, pointer: f } = Nr(k.$ref), I = R !== null && n.resolveExternalRef(N.source.absoluteRef, R) !== N.source.absoluteRef;
3649
- let v;
3650
- try {
3651
- v = I ? await n.resolveDocument(N.source.absoluteRef, R) : N;
3652
- } catch (L) {
3653
- const U = {
3654
- resolved: !1,
3655
- isRemote: I,
3656
- document: void 0,
3657
- error: L
3658
- }, fe = Pt(N.source.absoluteRef, k.$ref);
3659
- return i.set(fe, U), U;
3660
- }
3661
- let A = {
3662
- resolved: !0,
3663
- document: v,
3664
- isRemote: I,
3665
- node: N.parsed,
3666
- nodePointer: "#/"
3667
- }, g = v.parsed;
3668
- const x = f;
3669
- for (const L of x)
3670
- if (be(g) && g[L] !== void 0)
3671
- g = g[L], A.nodePointer = Te(A.nodePointer, Me(L));
3672
- else if (Array.isArray(g) && g[+L] !== void 0)
3673
- g = g[+L], A.nodePointer = Te(A.nodePointer, Me(L));
3674
- else if (lt(g))
3675
- if (A = await M(v, g, Hn(y, g)), A.chain = void 0, v = A.document || v, be(A.node))
3676
- g = A.node[L], A.nodePointer = Te(A.nodePointer, Me(L));
3677
- else if (Array.isArray(A.node))
3678
- g = A.node[+L], A.nodePointer = Te(A.nodePointer, Me(L));
3679
- else {
3680
- g = void 0;
3681
- break;
3682
- }
3683
- else {
3684
- g = void 0;
3685
- break;
3686
- }
3687
- A.node = g, A.document = v;
3688
- const W = Pt(N.source.absoluteRef, k.$ref);
3689
- if (A.document && lt(g)) {
3690
- const L = _r(g) ? {
3691
- node: g,
3692
- document: A.document,
3693
- location: new ft(A.document.source, A.nodePointer)
3694
- } : void 0;
3695
- A = await M(A.document, g, Hn(y, g)), L && A.resolved && (A = { ...A, chain: [L, ...A.chain ?? []] });
3696
- }
3697
- return i.set(W, A), { ...A };
3698
- }
3699
- }
3700
- }
3701
- export {
3702
- Pt as A,
3703
- _a as B,
3704
- wr as C,
3705
- Sa as D,
3706
- Ea as E,
3707
- $r as F,
3708
- vr as G,
3709
- ft as L,
3710
- fn as R,
3711
- Zt as S,
3712
- Tt as Y,
3713
- wa as a,
3714
- Ne as b,
3715
- br as c,
3716
- dr as d,
3717
- Me as e,
3718
- ba as f,
3719
- Ca as g,
3720
- fa as h,
3721
- lt as i,
3722
- mr as j,
3723
- Ta as k,
3724
- ma as l,
3725
- xa as m,
3726
- ya as n,
3727
- Aa as o,
3728
- pr as p,
3729
- _r as q,
3730
- Rr as r,
3731
- Ra as s,
3732
- Te as t,
3733
- Ir as u,
3734
- Nr as v,
3735
- ua as w,
3736
- at as x,
3737
- st as y,
3738
- va as z
3739
- };