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