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