@kubb/oas 4.5.1 → 4.5.2

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/index.cjs CHANGED
@@ -5,38 +5,4303 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __esm = (fn, res) => function() {
9
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
+ };
11
+ var __commonJS = (cb, mod) => function() {
12
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13
+ };
14
+ var __export$1 = (all) => {
15
+ let target = {};
16
+ for (var name in all) __defProp(target, name, {
17
+ get: all[name],
18
+ enumerable: true
19
+ });
20
+ return target;
21
+ };
8
22
  var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
- key = keys[i];
23
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i$1 = 0, n = keys.length, key; i$1 < n; i$1++) {
24
+ key = keys[i$1];
11
25
  if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
26
  get: ((k) => from[k]).bind(null, key),
13
27
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
28
  });
15
29
  }
16
- return to;
17
- };
18
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
- value: mod,
20
- enumerable: true
21
- }) : target, mod));
30
+ return to;
31
+ };
32
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
33
+ value: mod,
34
+ enumerable: true
35
+ }) : target, mod));
36
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
+
38
+ //#endregion
39
+ let oas_utils = require("oas/utils");
40
+ oas_utils = __toESM(oas_utils);
41
+ let jsonpointer = require("jsonpointer");
42
+ jsonpointer = __toESM(jsonpointer);
43
+ let oas = require("oas");
44
+ oas = __toESM(oas);
45
+ let oas_normalize = require("oas-normalize");
46
+ oas_normalize = __toESM(oas_normalize);
47
+ let node_path = require("node:path");
48
+ node_path = __toESM(node_path);
49
+ let remeda = require("remeda");
50
+ remeda = __toESM(remeda);
51
+ let oas_types = require("oas/types");
52
+ oas_types = __toESM(oas_types);
53
+ let swagger2openapi = require("swagger2openapi");
54
+ swagger2openapi = __toESM(swagger2openapi);
55
+
56
+ //#region ../../node_modules/.pnpm/camelcase@8.0.0/node_modules/camelcase/index.js
57
+ const UPPERCASE = /[\p{Lu}]/u;
58
+ const LOWERCASE = /[\p{Ll}]/u;
59
+ const LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu;
60
+ const IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u;
61
+ const SEPARATORS = /[_.\- ]+/;
62
+ const LEADING_SEPARATORS = /* @__PURE__ */ new RegExp("^" + SEPARATORS.source);
63
+ const SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, "gu");
64
+ const NUMBERS_AND_IDENTIFIER = new RegExp("\\d+" + IDENTIFIER.source, "gu");
65
+ const preserveCamelCase = (string, toLowerCase, toUpperCase, preserveConsecutiveUppercase$1) => {
66
+ let isLastCharLower = false;
67
+ let isLastCharUpper = false;
68
+ let isLastLastCharUpper = false;
69
+ let isLastLastCharPreserved = false;
70
+ for (let index = 0; index < string.length; index++) {
71
+ const character = string[index];
72
+ isLastLastCharPreserved = index > 2 ? string[index - 3] === "-" : true;
73
+ if (isLastCharLower && UPPERCASE.test(character)) {
74
+ string = string.slice(0, index) + "-" + string.slice(index);
75
+ isLastCharLower = false;
76
+ isLastLastCharUpper = isLastCharUpper;
77
+ isLastCharUpper = true;
78
+ index++;
79
+ } else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character) && (!isLastLastCharPreserved || preserveConsecutiveUppercase$1)) {
80
+ string = string.slice(0, index - 1) + "-" + string.slice(index - 1);
81
+ isLastLastCharUpper = isLastCharUpper;
82
+ isLastCharUpper = false;
83
+ isLastCharLower = true;
84
+ } else {
85
+ isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;
86
+ isLastLastCharUpper = isLastCharUpper;
87
+ isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;
88
+ }
89
+ }
90
+ return string;
91
+ };
92
+ const preserveConsecutiveUppercase = (input, toLowerCase) => {
93
+ LEADING_CAPITAL.lastIndex = 0;
94
+ return input.replaceAll(LEADING_CAPITAL, (match) => toLowerCase(match));
95
+ };
96
+ const postProcess = (input, toUpperCase) => {
97
+ SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
98
+ NUMBERS_AND_IDENTIFIER.lastIndex = 0;
99
+ return input.replaceAll(NUMBERS_AND_IDENTIFIER, (match, pattern, offset) => ["_", "-"].includes(input.charAt(offset + match.length)) ? match : toUpperCase(match)).replaceAll(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier));
100
+ };
101
+ function camelCase$1(input, options) {
102
+ if (!(typeof input === "string" || Array.isArray(input))) throw new TypeError("Expected the input to be `string | string[]`");
103
+ options = {
104
+ pascalCase: false,
105
+ preserveConsecutiveUppercase: false,
106
+ ...options
107
+ };
108
+ if (Array.isArray(input)) input = input.map((x) => x.trim()).filter((x) => x.length).join("-");
109
+ else input = input.trim();
110
+ if (input.length === 0) return "";
111
+ const toLowerCase = options.locale === false ? (string) => string.toLowerCase() : (string) => string.toLocaleLowerCase(options.locale);
112
+ const toUpperCase = options.locale === false ? (string) => string.toUpperCase() : (string) => string.toLocaleUpperCase(options.locale);
113
+ if (input.length === 1) {
114
+ if (SEPARATORS.test(input)) return "";
115
+ return options.pascalCase ? toUpperCase(input) : toLowerCase(input);
116
+ }
117
+ if (input !== toLowerCase(input)) input = preserveCamelCase(input, toLowerCase, toUpperCase, options.preserveConsecutiveUppercase);
118
+ input = input.replace(LEADING_SEPARATORS, "");
119
+ input = options.preserveConsecutiveUppercase ? preserveConsecutiveUppercase(input, toLowerCase) : toLowerCase(input);
120
+ if (options.pascalCase) input = toUpperCase(input.charAt(0)) + input.slice(1);
121
+ return postProcess(input, toUpperCase);
122
+ }
123
+
124
+ //#endregion
125
+ //#region ../core/src/transformers/casing.ts
126
+ function camelCase(text, { isFile, prefix = "", suffix = "" } = {}) {
127
+ if (isFile) {
128
+ const splitArray = text.split(".");
129
+ return splitArray.map((item, i$1) => i$1 === splitArray.length - 1 ? camelCase(item, {
130
+ prefix,
131
+ suffix
132
+ }) : camelCase(item)).join("/");
133
+ }
134
+ return camelCase$1(`${prefix} ${text} ${suffix}`, {
135
+ pascalCase: false,
136
+ preserveConsecutiveUppercase: true
137
+ }).replace(/[^a-zA-Z0-9]/g, "");
138
+ }
139
+
140
+ //#endregion
141
+ //#region ../core/src/transformers/transformReservedWord.ts
142
+ function isValidVarName(name) {
143
+ try {
144
+ Function(`var ${name}`);
145
+ } catch (_e) {
146
+ return false;
147
+ }
148
+ return true;
149
+ }
150
+
151
+ //#endregion
152
+ //#region ../core/src/utils/URLPath.ts
153
+ var URLPath = class {
154
+ path;
155
+ #options;
156
+ constructor(path$1, options = {}) {
157
+ this.path = path$1;
158
+ this.#options = options;
159
+ return this;
160
+ }
161
+ /**
162
+ * Convert Swagger path to URLPath(syntax of Express)
163
+ * @example /pet/{petId} => /pet/:petId
164
+ */
165
+ get URL() {
166
+ return this.toURLPath();
167
+ }
168
+ get isURL() {
169
+ try {
170
+ if (new URL(this.path)?.href) return true;
171
+ } catch (_error) {
172
+ return false;
173
+ }
174
+ return false;
175
+ }
176
+ /**
177
+ * Convert Swagger path to template literals/ template strings(camelcase)
178
+ * @example /pet/{petId} => `/pet/${petId}`
179
+ * @example /account/monetary-accountID => `/account/${monetaryAccountId}`
180
+ * @example /account/userID => `/account/${userId}`
181
+ */
182
+ get template() {
183
+ return this.toTemplateString();
184
+ }
185
+ get object() {
186
+ return this.toObject();
187
+ }
188
+ get params() {
189
+ return this.getParams();
190
+ }
191
+ toObject({ type = "path", replacer, stringify } = {}) {
192
+ const object = {
193
+ url: type === "path" ? this.toURLPath() : this.toTemplateString({ replacer }),
194
+ params: this.getParams()
195
+ };
196
+ if (stringify) {
197
+ if (type === "template") return JSON.stringify(object).replaceAll("'", "").replaceAll(`"`, "");
198
+ if (object.params) return `{ url: '${object.url}', params: ${JSON.stringify(object.params).replaceAll("'", "").replaceAll(`"`, "")} }`;
199
+ return `{ url: '${object.url}' }`;
200
+ }
201
+ return object;
202
+ }
203
+ /**
204
+ * Convert Swagger path to template literals/ template strings(camelcase)
205
+ * @example /pet/{petId} => `/pet/${petId}`
206
+ * @example /account/monetary-accountID => `/account/${monetaryAccountId}`
207
+ * @example /account/userID => `/account/${userId}`
208
+ */
209
+ toTemplateString({ prefix = "", replacer } = {}) {
210
+ const found = this.path.match(/{(\w|-)*}/g);
211
+ let newPath = this.path.replaceAll("{", "${");
212
+ if (found) newPath = found.reduce((prev, path$1) => {
213
+ const pathWithoutBrackets = path$1.replaceAll("{", "").replaceAll("}", "");
214
+ let param = isValidVarName(pathWithoutBrackets) ? pathWithoutBrackets : camelCase(pathWithoutBrackets);
215
+ if (this.#options.casing === "camelcase") param = camelCase(param);
216
+ return prev.replace(path$1, `\${${replacer ? replacer(param) : param}}`);
217
+ }, this.path);
218
+ return `\`${prefix}${newPath}\``;
219
+ }
220
+ getParams(replacer) {
221
+ const found = this.path.match(/{(\w|-)*}/g);
222
+ if (!found) return;
223
+ const params = {};
224
+ found.forEach((item) => {
225
+ item = item.replaceAll("{", "").replaceAll("}", "");
226
+ let param = isValidVarName(item) ? item : camelCase(item);
227
+ if (this.#options.casing === "camelcase") param = camelCase(param);
228
+ const key = replacer ? replacer(param) : param;
229
+ params[key] = key;
230
+ }, this.path);
231
+ return params;
232
+ }
233
+ /**
234
+ * Convert Swagger path to URLPath(syntax of Express)
235
+ * @example /pet/{petId} => /pet/:petId
236
+ */
237
+ toURLPath() {
238
+ return this.path.replaceAll("{", ":").replaceAll("}", "");
239
+ }
240
+ };
241
+
242
+ //#endregion
243
+ //#region ../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs
244
+ var tslib_es6_exports = /* @__PURE__ */ __export$1({
245
+ __addDisposableResource: () => __addDisposableResource,
246
+ __assign: () => __assign,
247
+ __asyncDelegator: () => __asyncDelegator,
248
+ __asyncGenerator: () => __asyncGenerator,
249
+ __asyncValues: () => __asyncValues,
250
+ __await: () => __await,
251
+ __awaiter: () => __awaiter,
252
+ __classPrivateFieldGet: () => __classPrivateFieldGet,
253
+ __classPrivateFieldIn: () => __classPrivateFieldIn,
254
+ __classPrivateFieldSet: () => __classPrivateFieldSet,
255
+ __createBinding: () => __createBinding,
256
+ __decorate: () => __decorate,
257
+ __disposeResources: () => __disposeResources,
258
+ __esDecorate: () => __esDecorate,
259
+ __exportStar: () => __exportStar,
260
+ __extends: () => __extends,
261
+ __generator: () => __generator,
262
+ __importDefault: () => __importDefault,
263
+ __importStar: () => __importStar,
264
+ __makeTemplateObject: () => __makeTemplateObject,
265
+ __metadata: () => __metadata,
266
+ __param: () => __param,
267
+ __propKey: () => __propKey,
268
+ __read: () => __read,
269
+ __rest: () => __rest,
270
+ __rewriteRelativeImportExtension: () => __rewriteRelativeImportExtension,
271
+ __runInitializers: () => __runInitializers,
272
+ __setFunctionName: () => __setFunctionName,
273
+ __spread: () => __spread,
274
+ __spreadArray: () => __spreadArray,
275
+ __spreadArrays: () => __spreadArrays,
276
+ __values: () => __values,
277
+ default: () => tslib_es6_default
278
+ });
279
+ function __extends(d, b) {
280
+ if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
281
+ extendStatics(d, b);
282
+ function __() {
283
+ this.constructor = d;
284
+ }
285
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
286
+ }
287
+ function __rest(s, e) {
288
+ var t = {};
289
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
290
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") {
291
+ for (var i$1 = 0, p = Object.getOwnPropertySymbols(s); i$1 < p.length; i$1++) if (e.indexOf(p[i$1]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i$1])) t[p[i$1]] = s[p[i$1]];
292
+ }
293
+ return t;
294
+ }
295
+ function __decorate(decorators, target, key, desc) {
296
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
297
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
298
+ else for (var i$1 = decorators.length - 1; i$1 >= 0; i$1--) if (d = decorators[i$1]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
299
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
300
+ }
301
+ function __param(paramIndex, decorator) {
302
+ return function(target, key) {
303
+ decorator(target, key, paramIndex);
304
+ };
305
+ }
306
+ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
307
+ function accept(f) {
308
+ if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
309
+ return f;
310
+ }
311
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
312
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
313
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
314
+ var _, done = false;
315
+ for (var i$1 = decorators.length - 1; i$1 >= 0; i$1--) {
316
+ var context = {};
317
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
318
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
319
+ context.addInitializer = function(f) {
320
+ if (done) throw new TypeError("Cannot add initializers after decoration has completed");
321
+ extraInitializers.push(accept(f || null));
322
+ };
323
+ var result = (0, decorators[i$1])(kind === "accessor" ? {
324
+ get: descriptor.get,
325
+ set: descriptor.set
326
+ } : descriptor[key], context);
327
+ if (kind === "accessor") {
328
+ if (result === void 0) continue;
329
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
330
+ if (_ = accept(result.get)) descriptor.get = _;
331
+ if (_ = accept(result.set)) descriptor.set = _;
332
+ if (_ = accept(result.init)) initializers.unshift(_);
333
+ } else if (_ = accept(result)) if (kind === "field") initializers.unshift(_);
334
+ else descriptor[key] = _;
335
+ }
336
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
337
+ done = true;
338
+ }
339
+ function __runInitializers(thisArg, initializers, value) {
340
+ var useValue = arguments.length > 2;
341
+ for (var i$1 = 0; i$1 < initializers.length; i$1++) value = useValue ? initializers[i$1].call(thisArg, value) : initializers[i$1].call(thisArg);
342
+ return useValue ? value : void 0;
343
+ }
344
+ function __propKey(x) {
345
+ return typeof x === "symbol" ? x : "".concat(x);
346
+ }
347
+ function __setFunctionName(f, name, prefix) {
348
+ if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
349
+ return Object.defineProperty(f, "name", {
350
+ configurable: true,
351
+ value: prefix ? "".concat(prefix, " ", name) : name
352
+ });
353
+ }
354
+ function __metadata(metadataKey, metadataValue) {
355
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
356
+ }
357
+ function __awaiter(thisArg, _arguments, P, generator) {
358
+ function adopt(value) {
359
+ return value instanceof P ? value : new P(function(resolve) {
360
+ resolve(value);
361
+ });
362
+ }
363
+ return new (P || (P = Promise))(function(resolve, reject) {
364
+ function fulfilled(value) {
365
+ try {
366
+ step(generator.next(value));
367
+ } catch (e) {
368
+ reject(e);
369
+ }
370
+ }
371
+ function rejected(value) {
372
+ try {
373
+ step(generator["throw"](value));
374
+ } catch (e) {
375
+ reject(e);
376
+ }
377
+ }
378
+ function step(result) {
379
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
380
+ }
381
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
382
+ });
383
+ }
384
+ function __generator(thisArg, body) {
385
+ var _ = {
386
+ label: 0,
387
+ sent: function() {
388
+ if (t[0] & 1) throw t[1];
389
+ return t[1];
390
+ },
391
+ trys: [],
392
+ ops: []
393
+ }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
394
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
395
+ return this;
396
+ }), g;
397
+ function verb(n) {
398
+ return function(v) {
399
+ return step([n, v]);
400
+ };
401
+ }
402
+ function step(op) {
403
+ if (f) throw new TypeError("Generator is already executing.");
404
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
405
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
406
+ if (y = 0, t) op = [op[0] & 2, t.value];
407
+ switch (op[0]) {
408
+ case 0:
409
+ case 1:
410
+ t = op;
411
+ break;
412
+ case 4:
413
+ _.label++;
414
+ return {
415
+ value: op[1],
416
+ done: false
417
+ };
418
+ case 5:
419
+ _.label++;
420
+ y = op[1];
421
+ op = [0];
422
+ continue;
423
+ case 7:
424
+ op = _.ops.pop();
425
+ _.trys.pop();
426
+ continue;
427
+ default:
428
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
429
+ _ = 0;
430
+ continue;
431
+ }
432
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
433
+ _.label = op[1];
434
+ break;
435
+ }
436
+ if (op[0] === 6 && _.label < t[1]) {
437
+ _.label = t[1];
438
+ t = op;
439
+ break;
440
+ }
441
+ if (t && _.label < t[2]) {
442
+ _.label = t[2];
443
+ _.ops.push(op);
444
+ break;
445
+ }
446
+ if (t[2]) _.ops.pop();
447
+ _.trys.pop();
448
+ continue;
449
+ }
450
+ op = body.call(thisArg, _);
451
+ } catch (e) {
452
+ op = [6, e];
453
+ y = 0;
454
+ } finally {
455
+ f = t = 0;
456
+ }
457
+ if (op[0] & 5) throw op[1];
458
+ return {
459
+ value: op[0] ? op[1] : void 0,
460
+ done: true
461
+ };
462
+ }
463
+ }
464
+ function __exportStar(m, o) {
465
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
466
+ }
467
+ function __values(o) {
468
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i$1 = 0;
469
+ if (m) return m.call(o);
470
+ if (o && typeof o.length === "number") return { next: function() {
471
+ if (o && i$1 >= o.length) o = void 0;
472
+ return {
473
+ value: o && o[i$1++],
474
+ done: !o
475
+ };
476
+ } };
477
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
478
+ }
479
+ function __read(o, n) {
480
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
481
+ if (!m) return o;
482
+ var i$1 = m.call(o), r, ar = [], e;
483
+ try {
484
+ while ((n === void 0 || n-- > 0) && !(r = i$1.next()).done) ar.push(r.value);
485
+ } catch (error) {
486
+ e = { error };
487
+ } finally {
488
+ try {
489
+ if (r && !r.done && (m = i$1["return"])) m.call(i$1);
490
+ } finally {
491
+ if (e) throw e.error;
492
+ }
493
+ }
494
+ return ar;
495
+ }
496
+ /** @deprecated */
497
+ function __spread() {
498
+ for (var ar = [], i$1 = 0; i$1 < arguments.length; i$1++) ar = ar.concat(__read(arguments[i$1]));
499
+ return ar;
500
+ }
501
+ /** @deprecated */
502
+ function __spreadArrays() {
503
+ for (var s = 0, i$1 = 0, il = arguments.length; i$1 < il; i$1++) s += arguments[i$1].length;
504
+ for (var r = Array(s), k = 0, i$1 = 0; i$1 < il; i$1++) for (var a = arguments[i$1], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
505
+ return r;
506
+ }
507
+ function __spreadArray(to, from, pack) {
508
+ if (pack || arguments.length === 2) {
509
+ for (var i$1 = 0, l = from.length, ar; i$1 < l; i$1++) if (ar || !(i$1 in from)) {
510
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i$1);
511
+ ar[i$1] = from[i$1];
512
+ }
513
+ }
514
+ return to.concat(ar || Array.prototype.slice.call(from));
515
+ }
516
+ function __await(v) {
517
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
518
+ }
519
+ function __asyncGenerator(thisArg, _arguments, generator) {
520
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
521
+ var g = generator.apply(thisArg, _arguments || []), i$1, q = [];
522
+ return i$1 = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i$1[Symbol.asyncIterator] = function() {
523
+ return this;
524
+ }, i$1;
525
+ function awaitReturn(f) {
526
+ return function(v) {
527
+ return Promise.resolve(v).then(f, reject);
528
+ };
529
+ }
530
+ function verb(n, f) {
531
+ if (g[n]) {
532
+ i$1[n] = function(v) {
533
+ return new Promise(function(a, b) {
534
+ q.push([
535
+ n,
536
+ v,
537
+ a,
538
+ b
539
+ ]) > 1 || resume(n, v);
540
+ });
541
+ };
542
+ if (f) i$1[n] = f(i$1[n]);
543
+ }
544
+ }
545
+ function resume(n, v) {
546
+ try {
547
+ step(g[n](v));
548
+ } catch (e) {
549
+ settle(q[0][3], e);
550
+ }
551
+ }
552
+ function step(r) {
553
+ r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
554
+ }
555
+ function fulfill(value) {
556
+ resume("next", value);
557
+ }
558
+ function reject(value) {
559
+ resume("throw", value);
560
+ }
561
+ function settle(f, v) {
562
+ if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
563
+ }
564
+ }
565
+ function __asyncDelegator(o) {
566
+ var i$1, p;
567
+ return i$1 = {}, verb("next"), verb("throw", function(e) {
568
+ throw e;
569
+ }), verb("return"), i$1[Symbol.iterator] = function() {
570
+ return this;
571
+ }, i$1;
572
+ function verb(n, f) {
573
+ i$1[n] = o[n] ? function(v) {
574
+ return (p = !p) ? {
575
+ value: __await(o[n](v)),
576
+ done: false
577
+ } : f ? f(v) : v;
578
+ } : f;
579
+ }
580
+ }
581
+ function __asyncValues(o) {
582
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
583
+ var m = o[Symbol.asyncIterator], i$1;
584
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i$1 = {}, verb("next"), verb("throw"), verb("return"), i$1[Symbol.asyncIterator] = function() {
585
+ return this;
586
+ }, i$1);
587
+ function verb(n) {
588
+ i$1[n] = o[n] && function(v) {
589
+ return new Promise(function(resolve, reject) {
590
+ v = o[n](v), settle(resolve, reject, v.done, v.value);
591
+ });
592
+ };
593
+ }
594
+ function settle(resolve, reject, d, v) {
595
+ Promise.resolve(v).then(function(v$1) {
596
+ resolve({
597
+ value: v$1,
598
+ done: d
599
+ });
600
+ }, reject);
601
+ }
602
+ }
603
+ function __makeTemplateObject(cooked, raw) {
604
+ if (Object.defineProperty) Object.defineProperty(cooked, "raw", { value: raw });
605
+ else cooked.raw = raw;
606
+ return cooked;
607
+ }
608
+ function __importStar(mod) {
609
+ if (mod && mod.__esModule) return mod;
610
+ var result = {};
611
+ if (mod != null) {
612
+ for (var k = ownKeys(mod), i$1 = 0; i$1 < k.length; i$1++) if (k[i$1] !== "default") __createBinding(result, mod, k[i$1]);
613
+ }
614
+ __setModuleDefault(result, mod);
615
+ return result;
616
+ }
617
+ function __importDefault(mod) {
618
+ return mod && mod.__esModule ? mod : { default: mod };
619
+ }
620
+ function __classPrivateFieldGet(receiver, state, kind, f) {
621
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
622
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
623
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
624
+ }
625
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
626
+ if (kind === "m") throw new TypeError("Private method is not writable");
627
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
628
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
629
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
630
+ }
631
+ function __classPrivateFieldIn(state, receiver) {
632
+ if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") throw new TypeError("Cannot use 'in' operator on non-object");
633
+ return typeof state === "function" ? receiver === state : state.has(receiver);
634
+ }
635
+ function __addDisposableResource(env, value, async) {
636
+ if (value !== null && value !== void 0) {
637
+ if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
638
+ var dispose, inner;
639
+ if (async) {
640
+ if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
641
+ dispose = value[Symbol.asyncDispose];
642
+ }
643
+ if (dispose === void 0) {
644
+ if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
645
+ dispose = value[Symbol.dispose];
646
+ if (async) inner = dispose;
647
+ }
648
+ if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
649
+ if (inner) dispose = function() {
650
+ try {
651
+ inner.call(this);
652
+ } catch (e) {
653
+ return Promise.reject(e);
654
+ }
655
+ };
656
+ env.stack.push({
657
+ value,
658
+ dispose,
659
+ async
660
+ });
661
+ } else if (async) env.stack.push({ async: true });
662
+ return value;
663
+ }
664
+ function __disposeResources(env) {
665
+ function fail(e) {
666
+ env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
667
+ env.hasError = true;
668
+ }
669
+ var r, s = 0;
670
+ function next() {
671
+ while (r = env.stack.pop()) try {
672
+ if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
673
+ if (r.dispose) {
674
+ var result = r.dispose.call(r.value);
675
+ if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) {
676
+ fail(e);
677
+ return next();
678
+ });
679
+ } else s |= 1;
680
+ } catch (e) {
681
+ fail(e);
682
+ }
683
+ if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
684
+ if (env.hasError) throw env.error;
685
+ }
686
+ return next();
687
+ }
688
+ function __rewriteRelativeImportExtension(path$1, preserveJsx) {
689
+ if (typeof path$1 === "string" && /^\.\.?\//.test(path$1)) return path$1.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
690
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
691
+ });
692
+ return path$1;
693
+ }
694
+ var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default;
695
+ var init_tslib_es6 = __esm({ "../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs": (() => {
696
+ extendStatics = function(d, b) {
697
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d$1, b$1) {
698
+ d$1.__proto__ = b$1;
699
+ } || function(d$1, b$1) {
700
+ for (var p in b$1) if (Object.prototype.hasOwnProperty.call(b$1, p)) d$1[p] = b$1[p];
701
+ };
702
+ return extendStatics(d, b);
703
+ };
704
+ __assign = function() {
705
+ __assign = Object.assign || function __assign$1(t) {
706
+ for (var s, i$1 = 1, n = arguments.length; i$1 < n; i$1++) {
707
+ s = arguments[i$1];
708
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
709
+ }
710
+ return t;
711
+ };
712
+ return __assign.apply(this, arguments);
713
+ };
714
+ __createBinding = Object.create ? (function(o, m, k, k2) {
715
+ if (k2 === void 0) k2 = k;
716
+ var desc = Object.getOwnPropertyDescriptor(m, k);
717
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
718
+ enumerable: true,
719
+ get: function() {
720
+ return m[k];
721
+ }
722
+ };
723
+ Object.defineProperty(o, k2, desc);
724
+ }) : (function(o, m, k, k2) {
725
+ if (k2 === void 0) k2 = k;
726
+ o[k2] = m[k];
727
+ });
728
+ __setModuleDefault = Object.create ? (function(o, v) {
729
+ Object.defineProperty(o, "default", {
730
+ enumerable: true,
731
+ value: v
732
+ });
733
+ }) : function(o, v) {
734
+ o["default"] = v;
735
+ };
736
+ ownKeys = function(o) {
737
+ ownKeys = Object.getOwnPropertyNames || function(o$1) {
738
+ var ar = [];
739
+ for (var k in o$1) if (Object.prototype.hasOwnProperty.call(o$1, k)) ar[ar.length] = k;
740
+ return ar;
741
+ };
742
+ return ownKeys(o);
743
+ };
744
+ _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
745
+ var e = new Error(message);
746
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
747
+ };
748
+ tslib_es6_default = {
749
+ __extends,
750
+ __assign,
751
+ __rest,
752
+ __decorate,
753
+ __param,
754
+ __esDecorate,
755
+ __runInitializers,
756
+ __propKey,
757
+ __setFunctionName,
758
+ __metadata,
759
+ __awaiter,
760
+ __generator,
761
+ __createBinding,
762
+ __exportStar,
763
+ __values,
764
+ __read,
765
+ __spread,
766
+ __spreadArrays,
767
+ __spreadArray,
768
+ __await,
769
+ __asyncGenerator,
770
+ __asyncDelegator,
771
+ __asyncValues,
772
+ __makeTemplateObject,
773
+ __importStar,
774
+ __importDefault,
775
+ __classPrivateFieldGet,
776
+ __classPrivateFieldSet,
777
+ __classPrivateFieldIn,
778
+ __addDisposableResource,
779
+ __disposeResources,
780
+ __rewriteRelativeImportExtension
781
+ };
782
+ }) });
783
+
784
+ //#endregion
785
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/yamlAST.js
786
+ var require_yamlAST = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/yamlAST.js": ((exports) => {
787
+ Object.defineProperty(exports, "__esModule", { value: true });
788
+ var Kind;
789
+ (function(Kind$1) {
790
+ Kind$1[Kind$1["SCALAR"] = 0] = "SCALAR";
791
+ Kind$1[Kind$1["MAPPING"] = 1] = "MAPPING";
792
+ Kind$1[Kind$1["MAP"] = 2] = "MAP";
793
+ Kind$1[Kind$1["SEQ"] = 3] = "SEQ";
794
+ Kind$1[Kind$1["ANCHOR_REF"] = 4] = "ANCHOR_REF";
795
+ Kind$1[Kind$1["INCLUDE_REF"] = 5] = "INCLUDE_REF";
796
+ })(Kind = exports.Kind || (exports.Kind = {}));
797
+ function newMapping(key, value) {
798
+ var end = value ? value.endPosition : key.endPosition + 1;
799
+ return {
800
+ key,
801
+ value,
802
+ startPosition: key.startPosition,
803
+ endPosition: end,
804
+ kind: Kind.MAPPING,
805
+ parent: null,
806
+ errors: []
807
+ };
808
+ }
809
+ exports.newMapping = newMapping;
810
+ function newAnchorRef(key, start, end, value) {
811
+ return {
812
+ errors: [],
813
+ referencesAnchor: key,
814
+ value,
815
+ startPosition: start,
816
+ endPosition: end,
817
+ kind: Kind.ANCHOR_REF,
818
+ parent: null
819
+ };
820
+ }
821
+ exports.newAnchorRef = newAnchorRef;
822
+ function newScalar(v = "") {
823
+ const result = {
824
+ errors: [],
825
+ startPosition: -1,
826
+ endPosition: -1,
827
+ value: "" + v,
828
+ kind: Kind.SCALAR,
829
+ parent: null,
830
+ doubleQuoted: false,
831
+ rawValue: "" + v
832
+ };
833
+ if (typeof v !== "string") result.valueObject = v;
834
+ return result;
835
+ }
836
+ exports.newScalar = newScalar;
837
+ function newItems() {
838
+ return {
839
+ errors: [],
840
+ startPosition: -1,
841
+ endPosition: -1,
842
+ items: [],
843
+ kind: Kind.SEQ,
844
+ parent: null
845
+ };
846
+ }
847
+ exports.newItems = newItems;
848
+ function newSeq() {
849
+ return newItems();
850
+ }
851
+ exports.newSeq = newSeq;
852
+ function newMap(mappings) {
853
+ return {
854
+ errors: [],
855
+ startPosition: -1,
856
+ endPosition: -1,
857
+ mappings: mappings ? mappings : [],
858
+ kind: Kind.MAP,
859
+ parent: null
860
+ };
861
+ }
862
+ exports.newMap = newMap;
863
+ }) });
864
+
865
+ //#endregion
866
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/common.js
867
+ var require_common = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/common.js": ((exports) => {
868
+ Object.defineProperty(exports, "__esModule", { value: true });
869
+ function isNothing(subject) {
870
+ return typeof subject === "undefined" || null === subject;
871
+ }
872
+ exports.isNothing = isNothing;
873
+ function isObject$1(subject) {
874
+ return typeof subject === "object" && null !== subject;
875
+ }
876
+ exports.isObject = isObject$1;
877
+ function toArray(sequence) {
878
+ if (Array.isArray(sequence)) return sequence;
879
+ else if (isNothing(sequence)) return [];
880
+ return [sequence];
881
+ }
882
+ exports.toArray = toArray;
883
+ function extend(target, source) {
884
+ var index, length, key, sourceKeys;
885
+ if (source) {
886
+ sourceKeys = Object.keys(source);
887
+ for (index = 0, length = sourceKeys.length; index < length; index += 1) {
888
+ key = sourceKeys[index];
889
+ target[key] = source[key];
890
+ }
891
+ }
892
+ return target;
893
+ }
894
+ exports.extend = extend;
895
+ function repeat(string, count) {
896
+ var result = "", cycle;
897
+ for (cycle = 0; cycle < count; cycle += 1) result += string;
898
+ return result;
899
+ }
900
+ exports.repeat = repeat;
901
+ function isNegativeZero(number) {
902
+ return 0 === number && Number.NEGATIVE_INFINITY === 1 / number;
903
+ }
904
+ exports.isNegativeZero = isNegativeZero;
905
+ }) });
906
+
907
+ //#endregion
908
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/exception.js
909
+ var require_exception = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/exception.js": ((exports, module) => {
910
+ var YAMLException$4 = class YAMLException$4 {
911
+ constructor(reason, mark = null, isWarning = false) {
912
+ this.name = "YAMLException";
913
+ this.reason = reason;
914
+ this.mark = mark;
915
+ this.message = this.toString(false);
916
+ this.isWarning = isWarning;
917
+ }
918
+ static isInstance(instance) {
919
+ if (instance != null && instance.getClassIdentifier && typeof instance.getClassIdentifier == "function") {
920
+ for (let currentIdentifier of instance.getClassIdentifier()) if (currentIdentifier == YAMLException$4.CLASS_IDENTIFIER) return true;
921
+ }
922
+ return false;
923
+ }
924
+ getClassIdentifier() {
925
+ return [].concat(YAMLException$4.CLASS_IDENTIFIER);
926
+ }
927
+ toString(compact = false) {
928
+ var result = "JS-YAML: " + (this.reason || "(unknown reason)");
929
+ if (!compact && this.mark) result += " " + this.mark.toString();
930
+ return result;
931
+ }
932
+ };
933
+ YAMLException$4.CLASS_IDENTIFIER = "yaml-ast-parser.YAMLException";
934
+ module.exports = YAMLException$4;
935
+ }) });
936
+
937
+ //#endregion
938
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/mark.js
939
+ var require_mark = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/mark.js": ((exports, module) => {
940
+ const common$5 = require_common();
941
+ var Mark$1 = class {
942
+ constructor(name, buffer, position, line, column) {
943
+ this.name = name;
944
+ this.buffer = buffer;
945
+ this.position = position;
946
+ this.line = line;
947
+ this.column = column;
948
+ }
949
+ getSnippet(indent = 0, maxLength = 75) {
950
+ var head, start, tail, end, snippet;
951
+ if (!this.buffer) return null;
952
+ indent = indent || 4;
953
+ maxLength = maxLength || 75;
954
+ head = "";
955
+ start = this.position;
956
+ while (start > 0 && -1 === "\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(start - 1))) {
957
+ start -= 1;
958
+ if (this.position - start > maxLength / 2 - 1) {
959
+ head = " ... ";
960
+ start += 5;
961
+ break;
962
+ }
963
+ }
964
+ tail = "";
965
+ end = this.position;
966
+ while (end < this.buffer.length && -1 === "\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(end))) {
967
+ end += 1;
968
+ if (end - this.position > maxLength / 2 - 1) {
969
+ tail = " ... ";
970
+ end -= 5;
971
+ break;
972
+ }
973
+ }
974
+ snippet = this.buffer.slice(start, end);
975
+ return common$5.repeat(" ", indent) + head + snippet + tail + "\n" + common$5.repeat(" ", indent + this.position - start + head.length) + "^";
976
+ }
977
+ toString(compact = true) {
978
+ var snippet, where = "";
979
+ if (this.name) where += "in \"" + this.name + "\" ";
980
+ where += "at line " + (this.line + 1) + ", column " + (this.column + 1);
981
+ if (!compact) {
982
+ snippet = this.getSnippet();
983
+ if (snippet) where += ":\n" + snippet;
984
+ }
985
+ return where;
986
+ }
987
+ };
988
+ module.exports = Mark$1;
989
+ }) });
990
+
991
+ //#endregion
992
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type.js
993
+ var require_type = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type.js": ((exports) => {
994
+ Object.defineProperty(exports, "__esModule", { value: true });
995
+ const YAMLException$3 = require_exception();
996
+ var TYPE_CONSTRUCTOR_OPTIONS = [
997
+ "kind",
998
+ "resolve",
999
+ "construct",
1000
+ "instanceOf",
1001
+ "predicate",
1002
+ "represent",
1003
+ "defaultStyle",
1004
+ "styleAliases"
1005
+ ];
1006
+ var YAML_NODE_KINDS = [
1007
+ "scalar",
1008
+ "sequence",
1009
+ "mapping"
1010
+ ];
1011
+ function compileStyleAliases(map) {
1012
+ var result = {};
1013
+ if (null !== map) Object.keys(map).forEach(function(style) {
1014
+ map[style].forEach(function(alias) {
1015
+ result[String(alias)] = style;
1016
+ });
1017
+ });
1018
+ return result;
1019
+ }
1020
+ var Type = class {
1021
+ constructor(tag, options) {
1022
+ options = options || {};
1023
+ Object.keys(options).forEach(function(name) {
1024
+ if (-1 === TYPE_CONSTRUCTOR_OPTIONS.indexOf(name)) throw new YAMLException$3("Unknown option \"" + name + "\" is met in definition of \"" + tag + "\" YAML type.");
1025
+ });
1026
+ this.tag = tag;
1027
+ this.kind = options["kind"] || null;
1028
+ this.resolve = options["resolve"] || function() {
1029
+ return true;
1030
+ };
1031
+ this.construct = options["construct"] || function(data) {
1032
+ return data;
1033
+ };
1034
+ this.instanceOf = options["instanceOf"] || null;
1035
+ this.predicate = options["predicate"] || null;
1036
+ this.represent = options["represent"] || null;
1037
+ this.defaultStyle = options["defaultStyle"] || null;
1038
+ this.styleAliases = compileStyleAliases(options["styleAliases"] || null);
1039
+ if (-1 === YAML_NODE_KINDS.indexOf(this.kind)) throw new YAMLException$3("Unknown kind \"" + this.kind + "\" is specified for \"" + tag + "\" YAML type.");
1040
+ }
1041
+ };
1042
+ exports.Type = Type;
1043
+ }) });
1044
+
1045
+ //#endregion
1046
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/schema.js
1047
+ var require_schema = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/schema.js": ((exports) => {
1048
+ Object.defineProperty(exports, "__esModule", { value: true });
1049
+ const common$4 = require_common();
1050
+ const YAMLException$2 = require_exception();
1051
+ const type_1$15 = require_type();
1052
+ function compileList(schema$2, name, result) {
1053
+ var exclude = [];
1054
+ schema$2.include.forEach(function(includedSchema) {
1055
+ result = compileList(includedSchema, name, result);
1056
+ });
1057
+ schema$2[name].forEach(function(currentType) {
1058
+ result.forEach(function(previousType, previousIndex) {
1059
+ if (previousType.tag === currentType.tag) exclude.push(previousIndex);
1060
+ });
1061
+ result.push(currentType);
1062
+ });
1063
+ return result.filter(function(type, index) {
1064
+ return -1 === exclude.indexOf(index);
1065
+ });
1066
+ }
1067
+ function compileMap() {
1068
+ var result = {}, index, length;
1069
+ function collectType(type) {
1070
+ result[type.tag] = type;
1071
+ }
1072
+ for (index = 0, length = arguments.length; index < length; index += 1) arguments[index].forEach(collectType);
1073
+ return result;
1074
+ }
1075
+ var Schema = class {
1076
+ constructor(definition) {
1077
+ this.include = definition.include || [];
1078
+ this.implicit = definition.implicit || [];
1079
+ this.explicit = definition.explicit || [];
1080
+ this.implicit.forEach(function(type) {
1081
+ if (type.loadKind && "scalar" !== type.loadKind) throw new YAMLException$2("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
1082
+ });
1083
+ this.compiledImplicit = compileList(this, "implicit", []);
1084
+ this.compiledExplicit = compileList(this, "explicit", []);
1085
+ this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit);
1086
+ }
1087
+ };
1088
+ exports.Schema = Schema;
1089
+ Schema.DEFAULT = null;
1090
+ Schema.create = function createSchema() {
1091
+ var schemas, types;
1092
+ switch (arguments.length) {
1093
+ case 1:
1094
+ schemas = Schema.DEFAULT;
1095
+ types = arguments[0];
1096
+ break;
1097
+ case 2:
1098
+ schemas = arguments[0];
1099
+ types = arguments[1];
1100
+ break;
1101
+ default: throw new YAMLException$2("Wrong number of arguments for Schema.create function");
1102
+ }
1103
+ schemas = common$4.toArray(schemas);
1104
+ types = common$4.toArray(types);
1105
+ if (!schemas.every(function(schema$2) {
1106
+ return schema$2 instanceof Schema;
1107
+ })) throw new YAMLException$2("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");
1108
+ if (!types.every(function(type) {
1109
+ return type instanceof type_1$15.Type;
1110
+ })) throw new YAMLException$2("Specified list of YAML types (or a single Type object) contains a non-Type object.");
1111
+ return new Schema({
1112
+ include: schemas,
1113
+ explicit: types
1114
+ });
1115
+ };
1116
+ }) });
1117
+
1118
+ //#endregion
1119
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/str.js
1120
+ var require_str = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/str.js": ((exports, module) => {
1121
+ const type_1$14 = require_type();
1122
+ module.exports = new type_1$14.Type("tag:yaml.org,2002:str", {
1123
+ kind: "scalar",
1124
+ construct: function(data) {
1125
+ return null !== data ? data : "";
1126
+ }
1127
+ });
1128
+ }) });
1129
+
1130
+ //#endregion
1131
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/seq.js
1132
+ var require_seq = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/seq.js": ((exports, module) => {
1133
+ const type_1$13 = require_type();
1134
+ module.exports = new type_1$13.Type("tag:yaml.org,2002:seq", {
1135
+ kind: "sequence",
1136
+ construct: function(data) {
1137
+ return null !== data ? data : [];
1138
+ }
1139
+ });
1140
+ }) });
1141
+
1142
+ //#endregion
1143
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/map.js
1144
+ var require_map = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/map.js": ((exports, module) => {
1145
+ const type_1$12 = require_type();
1146
+ module.exports = new type_1$12.Type("tag:yaml.org,2002:map", {
1147
+ kind: "mapping",
1148
+ construct: function(data) {
1149
+ return null !== data ? data : {};
1150
+ }
1151
+ });
1152
+ }) });
1153
+
1154
+ //#endregion
1155
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/schema/failsafe.js
1156
+ var require_failsafe = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/schema/failsafe.js": ((exports, module) => {
1157
+ const schema_1$3 = require_schema();
1158
+ module.exports = new schema_1$3.Schema({ explicit: [
1159
+ require_str(),
1160
+ require_seq(),
1161
+ require_map()
1162
+ ] });
1163
+ }) });
1164
+
1165
+ //#endregion
1166
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/null.js
1167
+ var require_null = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/null.js": ((exports, module) => {
1168
+ const type_1$11 = require_type();
1169
+ function resolveYamlNull(data) {
1170
+ if (null === data) return true;
1171
+ var max = data.length;
1172
+ return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL");
1173
+ }
1174
+ function constructYamlNull() {
1175
+ return null;
1176
+ }
1177
+ function isNull(object) {
1178
+ return null === object;
1179
+ }
1180
+ module.exports = new type_1$11.Type("tag:yaml.org,2002:null", {
1181
+ kind: "scalar",
1182
+ resolve: resolveYamlNull,
1183
+ construct: constructYamlNull,
1184
+ predicate: isNull,
1185
+ represent: {
1186
+ canonical: function() {
1187
+ return "~";
1188
+ },
1189
+ lowercase: function() {
1190
+ return "null";
1191
+ },
1192
+ uppercase: function() {
1193
+ return "NULL";
1194
+ },
1195
+ camelcase: function() {
1196
+ return "Null";
1197
+ }
1198
+ },
1199
+ defaultStyle: "lowercase"
1200
+ });
1201
+ }) });
1202
+
1203
+ //#endregion
1204
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/bool.js
1205
+ var require_bool = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/bool.js": ((exports, module) => {
1206
+ const type_1$10 = require_type();
1207
+ function resolveYamlBoolean(data) {
1208
+ if (null === data) return false;
1209
+ var max = data.length;
1210
+ return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE");
1211
+ }
1212
+ function constructYamlBoolean(data) {
1213
+ return data === "true" || data === "True" || data === "TRUE";
1214
+ }
1215
+ function isBoolean(object) {
1216
+ return "[object Boolean]" === Object.prototype.toString.call(object);
1217
+ }
1218
+ module.exports = new type_1$10.Type("tag:yaml.org,2002:bool", {
1219
+ kind: "scalar",
1220
+ resolve: resolveYamlBoolean,
1221
+ construct: constructYamlBoolean,
1222
+ predicate: isBoolean,
1223
+ represent: {
1224
+ lowercase: function(object) {
1225
+ return object ? "true" : "false";
1226
+ },
1227
+ uppercase: function(object) {
1228
+ return object ? "TRUE" : "FALSE";
1229
+ },
1230
+ camelcase: function(object) {
1231
+ return object ? "True" : "False";
1232
+ }
1233
+ },
1234
+ defaultStyle: "lowercase"
1235
+ });
1236
+ }) });
1237
+
1238
+ //#endregion
1239
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/int.js
1240
+ var require_int = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/int.js": ((exports, module) => {
1241
+ const common$3 = require_common();
1242
+ const type_1$9 = require_type();
1243
+ function isHexCode(c) {
1244
+ return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102;
1245
+ }
1246
+ function isOctCode(c) {
1247
+ return 48 <= c && c <= 55;
1248
+ }
1249
+ function isDecCode(c) {
1250
+ return 48 <= c && c <= 57;
1251
+ }
1252
+ function resolveYamlInteger(data) {
1253
+ if (null === data) return false;
1254
+ var max = data.length, index = 0, hasDigits = false, ch;
1255
+ if (!max) return false;
1256
+ ch = data[index];
1257
+ if (ch === "-" || ch === "+") ch = data[++index];
1258
+ if (ch === "0") {
1259
+ if (index + 1 === max) return true;
1260
+ ch = data[++index];
1261
+ if (ch === "b") {
1262
+ index++;
1263
+ for (; index < max; index++) {
1264
+ ch = data[index];
1265
+ if (ch === "_") continue;
1266
+ if (ch !== "0" && ch !== "1") return false;
1267
+ hasDigits = true;
1268
+ }
1269
+ return hasDigits;
1270
+ }
1271
+ if (ch === "x") {
1272
+ index++;
1273
+ for (; index < max; index++) {
1274
+ ch = data[index];
1275
+ if (ch === "_") continue;
1276
+ if (!isHexCode(data.charCodeAt(index))) return false;
1277
+ hasDigits = true;
1278
+ }
1279
+ return hasDigits;
1280
+ }
1281
+ for (; index < max; index++) {
1282
+ ch = data[index];
1283
+ if (ch === "_") continue;
1284
+ if (!isOctCode(data.charCodeAt(index))) {
1285
+ hasDigits = false;
1286
+ break;
1287
+ }
1288
+ hasDigits = true;
1289
+ }
1290
+ if (hasDigits) return hasDigits;
1291
+ }
1292
+ for (; index < max; index++) {
1293
+ ch = data[index];
1294
+ if (ch === "_") continue;
1295
+ if (ch === ":") break;
1296
+ if (!isDecCode(data.charCodeAt(index))) return false;
1297
+ hasDigits = true;
1298
+ }
1299
+ if (!hasDigits) return false;
1300
+ if (ch !== ":") return true;
1301
+ return /^(:[0-5]?[0-9])+$/.test(data.slice(index));
1302
+ }
1303
+ function constructYamlInteger(data) {
1304
+ var value = data, sign = 1, ch, base, digits = [];
1305
+ if (value.indexOf("_") !== -1) value = value.replace(/_/g, "");
1306
+ ch = value[0];
1307
+ if (ch === "-" || ch === "+") {
1308
+ if (ch === "-") sign = -1;
1309
+ value = value.slice(1);
1310
+ ch = value[0];
1311
+ }
1312
+ if ("0" === value) return 0;
1313
+ if (ch === "0") {
1314
+ if (value[1] === "b") return sign * parseInt(value.slice(2), 2);
1315
+ if (value[1] === "x") return sign * parseInt(value, 16);
1316
+ return sign * parseInt(value, 8);
1317
+ }
1318
+ if (value.indexOf(":") !== -1) {
1319
+ value.split(":").forEach(function(v) {
1320
+ digits.unshift(parseInt(v, 10));
1321
+ });
1322
+ value = 0;
1323
+ base = 1;
1324
+ digits.forEach(function(d) {
1325
+ value += d * base;
1326
+ base *= 60;
1327
+ });
1328
+ return sign * value;
1329
+ }
1330
+ return sign * parseInt(value, 10);
1331
+ }
1332
+ function isInteger(object) {
1333
+ const type = Object.prototype.toString.call(object);
1334
+ return "[object Number]" === type && 0 === object % 1 && !common$3.isNegativeZero(object) || "[object BigInt]" === type;
1335
+ }
1336
+ module.exports = new type_1$9.Type("tag:yaml.org,2002:int", {
1337
+ kind: "scalar",
1338
+ resolve: resolveYamlInteger,
1339
+ construct: constructYamlInteger,
1340
+ predicate: isInteger,
1341
+ represent: {
1342
+ binary: function(object) {
1343
+ return "0b" + object.toString(2);
1344
+ },
1345
+ octal: function(object) {
1346
+ return "0" + object.toString(8);
1347
+ },
1348
+ decimal: function(object) {
1349
+ return object.toString(10);
1350
+ },
1351
+ hexadecimal: function(object) {
1352
+ return "0x" + object.toString(16).toUpperCase();
1353
+ }
1354
+ },
1355
+ defaultStyle: "decimal",
1356
+ styleAliases: {
1357
+ binary: [2, "bin"],
1358
+ octal: [8, "oct"],
1359
+ decimal: [10, "dec"],
1360
+ hexadecimal: [16, "hex"]
1361
+ }
1362
+ });
1363
+ }) });
1364
+
1365
+ //#endregion
1366
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/float.js
1367
+ var require_float = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/float.js": ((exports, module) => {
1368
+ const common$2 = require_common();
1369
+ const type_1$8 = require_type();
1370
+ var YAML_FLOAT_PATTERN = /* @__PURE__ */ new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
1371
+ function resolveYamlFloat(data) {
1372
+ if (null === data) return false;
1373
+ if (!YAML_FLOAT_PATTERN.test(data)) return false;
1374
+ return true;
1375
+ }
1376
+ function constructYamlFloat(data) {
1377
+ var value = data.replace(/_/g, "").toLowerCase(), sign = "-" === value[0] ? -1 : 1, base, digits = [];
1378
+ if (0 <= "+-".indexOf(value[0])) value = value.slice(1);
1379
+ if (".inf" === value) return 1 === sign ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
1380
+ else if (".nan" === value) return NaN;
1381
+ else if (0 <= value.indexOf(":")) {
1382
+ value.split(":").forEach(function(v) {
1383
+ digits.unshift(parseFloat(v, 10));
1384
+ });
1385
+ value = 0;
1386
+ base = 1;
1387
+ digits.forEach(function(d) {
1388
+ value += d * base;
1389
+ base *= 60;
1390
+ });
1391
+ return sign * value;
1392
+ }
1393
+ return sign * parseFloat(value, 10);
1394
+ }
1395
+ function representYamlFloat(object, style) {
1396
+ if (isNaN(object)) switch (style) {
1397
+ case "lowercase": return ".nan";
1398
+ case "uppercase": return ".NAN";
1399
+ case "camelcase": return ".NaN";
1400
+ }
1401
+ else if (Number.POSITIVE_INFINITY === object) switch (style) {
1402
+ case "lowercase": return ".inf";
1403
+ case "uppercase": return ".INF";
1404
+ case "camelcase": return ".Inf";
1405
+ }
1406
+ else if (Number.NEGATIVE_INFINITY === object) switch (style) {
1407
+ case "lowercase": return "-.inf";
1408
+ case "uppercase": return "-.INF";
1409
+ case "camelcase": return "-.Inf";
1410
+ }
1411
+ else if (common$2.isNegativeZero(object)) return "-0.0";
1412
+ return object.toString(10);
1413
+ }
1414
+ function isFloat(object) {
1415
+ return "[object Number]" === Object.prototype.toString.call(object) && (0 !== object % 1 || common$2.isNegativeZero(object));
1416
+ }
1417
+ module.exports = new type_1$8.Type("tag:yaml.org,2002:float", {
1418
+ kind: "scalar",
1419
+ resolve: resolveYamlFloat,
1420
+ construct: constructYamlFloat,
1421
+ predicate: isFloat,
1422
+ represent: representYamlFloat,
1423
+ defaultStyle: "lowercase"
1424
+ });
1425
+ }) });
1426
+
1427
+ //#endregion
1428
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/schema/json.js
1429
+ var require_json = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/schema/json.js": ((exports, module) => {
1430
+ const schema_1$2 = require_schema();
1431
+ module.exports = new schema_1$2.Schema({
1432
+ include: [require_failsafe()],
1433
+ implicit: [
1434
+ require_null(),
1435
+ require_bool(),
1436
+ require_int(),
1437
+ require_float()
1438
+ ]
1439
+ });
1440
+ }) });
1441
+
1442
+ //#endregion
1443
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/schema/core.js
1444
+ var require_core = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/schema/core.js": ((exports, module) => {
1445
+ const schema_1$1 = require_schema();
1446
+ module.exports = new schema_1$1.Schema({ include: [require_json()] });
1447
+ }) });
1448
+
1449
+ //#endregion
1450
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/timestamp.js
1451
+ var require_timestamp = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/timestamp.js": ((exports, module) => {
1452
+ const type_1$7 = require_type();
1453
+ var YAML_TIMESTAMP_REGEXP = /* @__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]))?))?)?$");
1454
+ function resolveYamlTimestamp(data) {
1455
+ if (null === data) return false;
1456
+ if (null === YAML_TIMESTAMP_REGEXP.exec(data)) return false;
1457
+ return true;
1458
+ }
1459
+ function constructYamlTimestamp(data) {
1460
+ var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
1461
+ match = YAML_TIMESTAMP_REGEXP.exec(data);
1462
+ if (null === match) throw new Error("Date resolve error");
1463
+ year = +match[1];
1464
+ month = +match[2] - 1;
1465
+ day = +match[3];
1466
+ if (!match[4]) return new Date(Date.UTC(year, month, day));
1467
+ hour = +match[4];
1468
+ minute = +match[5];
1469
+ second = +match[6];
1470
+ if (match[7]) {
1471
+ fraction = match[7].slice(0, 3);
1472
+ while (fraction.length < 3) fraction = fraction + "0";
1473
+ fraction = +fraction;
1474
+ }
1475
+ if (match[9]) {
1476
+ tz_hour = +match[10];
1477
+ tz_minute = +(match[11] || 0);
1478
+ delta = (tz_hour * 60 + tz_minute) * 6e4;
1479
+ if ("-" === match[9]) delta = -delta;
1480
+ }
1481
+ date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
1482
+ if (delta) date.setTime(date.getTime() - delta);
1483
+ return date;
1484
+ }
1485
+ function representYamlTimestamp(object) {
1486
+ return object.toISOString();
1487
+ }
1488
+ module.exports = new type_1$7.Type("tag:yaml.org,2002:timestamp", {
1489
+ kind: "scalar",
1490
+ resolve: resolveYamlTimestamp,
1491
+ construct: constructYamlTimestamp,
1492
+ instanceOf: Date,
1493
+ represent: representYamlTimestamp
1494
+ });
1495
+ }) });
1496
+
1497
+ //#endregion
1498
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/merge.js
1499
+ var require_merge = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/merge.js": ((exports, module) => {
1500
+ const type_1$6 = require_type();
1501
+ function resolveYamlMerge(data) {
1502
+ return "<<" === data || null === data;
1503
+ }
1504
+ module.exports = new type_1$6.Type("tag:yaml.org,2002:merge", {
1505
+ kind: "scalar",
1506
+ resolve: resolveYamlMerge
1507
+ });
1508
+ }) });
1509
+
1510
+ //#endregion
1511
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/binary.js
1512
+ var require_binary = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/binary.js": ((exports, module) => {
1513
+ var NodeBuffer = require("buffer").Buffer;
1514
+ const type_1$5 = require_type();
1515
+ var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
1516
+ function resolveYamlBinary(data) {
1517
+ if (null === data) return false;
1518
+ var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
1519
+ for (idx = 0; idx < max; idx++) {
1520
+ code = map.indexOf(data.charAt(idx));
1521
+ if (code > 64) continue;
1522
+ if (code < 0) return false;
1523
+ bitlen += 6;
1524
+ }
1525
+ return bitlen % 8 === 0;
1526
+ }
1527
+ function constructYamlBinary(data) {
1528
+ var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map = BASE64_MAP, bits = 0, result = [];
1529
+ for (idx = 0; idx < max; idx++) {
1530
+ if (idx % 4 === 0 && idx) {
1531
+ result.push(bits >> 16 & 255);
1532
+ result.push(bits >> 8 & 255);
1533
+ result.push(bits & 255);
1534
+ }
1535
+ bits = bits << 6 | map.indexOf(input.charAt(idx));
1536
+ }
1537
+ tailbits = max % 4 * 6;
1538
+ if (tailbits === 0) {
1539
+ result.push(bits >> 16 & 255);
1540
+ result.push(bits >> 8 & 255);
1541
+ result.push(bits & 255);
1542
+ } else if (tailbits === 18) {
1543
+ result.push(bits >> 10 & 255);
1544
+ result.push(bits >> 2 & 255);
1545
+ } else if (tailbits === 12) result.push(bits >> 4 & 255);
1546
+ if (NodeBuffer) return new NodeBuffer(result);
1547
+ return result;
1548
+ }
1549
+ function representYamlBinary(object) {
1550
+ var result = "", bits = 0, idx, tail, max = object.length, map = BASE64_MAP;
1551
+ for (idx = 0; idx < max; idx++) {
1552
+ if (idx % 3 === 0 && idx) {
1553
+ result += map[bits >> 18 & 63];
1554
+ result += map[bits >> 12 & 63];
1555
+ result += map[bits >> 6 & 63];
1556
+ result += map[bits & 63];
1557
+ }
1558
+ bits = (bits << 8) + object[idx];
1559
+ }
1560
+ tail = max % 3;
1561
+ if (tail === 0) {
1562
+ result += map[bits >> 18 & 63];
1563
+ result += map[bits >> 12 & 63];
1564
+ result += map[bits >> 6 & 63];
1565
+ result += map[bits & 63];
1566
+ } else if (tail === 2) {
1567
+ result += map[bits >> 10 & 63];
1568
+ result += map[bits >> 4 & 63];
1569
+ result += map[bits << 2 & 63];
1570
+ result += map[64];
1571
+ } else if (tail === 1) {
1572
+ result += map[bits >> 2 & 63];
1573
+ result += map[bits << 4 & 63];
1574
+ result += map[64];
1575
+ result += map[64];
1576
+ }
1577
+ return result;
1578
+ }
1579
+ function isBinary(object) {
1580
+ return NodeBuffer && NodeBuffer.isBuffer(object);
1581
+ }
1582
+ module.exports = new type_1$5.Type("tag:yaml.org,2002:binary", {
1583
+ kind: "scalar",
1584
+ resolve: resolveYamlBinary,
1585
+ construct: constructYamlBinary,
1586
+ predicate: isBinary,
1587
+ represent: representYamlBinary
1588
+ });
1589
+ }) });
1590
+
1591
+ //#endregion
1592
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/omap.js
1593
+ var require_omap = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/omap.js": ((exports, module) => {
1594
+ const type_1$4 = require_type();
1595
+ var _hasOwnProperty$2 = Object.prototype.hasOwnProperty;
1596
+ var _toString$2 = Object.prototype.toString;
1597
+ function resolveYamlOmap(data) {
1598
+ if (null === data) return true;
1599
+ var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data;
1600
+ for (index = 0, length = object.length; index < length; index += 1) {
1601
+ pair = object[index];
1602
+ pairHasKey = false;
1603
+ if ("[object Object]" !== _toString$2.call(pair)) return false;
1604
+ for (pairKey in pair) if (_hasOwnProperty$2.call(pair, pairKey)) if (!pairHasKey) pairHasKey = true;
1605
+ else return false;
1606
+ if (!pairHasKey) return false;
1607
+ if (-1 === objectKeys.indexOf(pairKey)) objectKeys.push(pairKey);
1608
+ else return false;
1609
+ }
1610
+ return true;
1611
+ }
1612
+ function constructYamlOmap(data) {
1613
+ return null !== data ? data : [];
1614
+ }
1615
+ module.exports = new type_1$4.Type("tag:yaml.org,2002:omap", {
1616
+ kind: "sequence",
1617
+ resolve: resolveYamlOmap,
1618
+ construct: constructYamlOmap
1619
+ });
1620
+ }) });
1621
+
1622
+ //#endregion
1623
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/pairs.js
1624
+ var require_pairs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/pairs.js": ((exports, module) => {
1625
+ const type_1$3 = require_type();
1626
+ const ast$2 = require_yamlAST();
1627
+ var _toString$1 = Object.prototype.toString;
1628
+ function resolveYamlPairs(data) {
1629
+ if (null === data) return true;
1630
+ if (data.kind != ast$2.Kind.SEQ) return false;
1631
+ var index, length, pair, object = data.items;
1632
+ for (index = 0, length = object.length; index < length; index += 1) {
1633
+ pair = object[index];
1634
+ if ("[object Object]" !== _toString$1.call(pair)) return false;
1635
+ if (!Array.isArray(pair.mappings)) return false;
1636
+ if (1 !== pair.mappings.length) return false;
1637
+ }
1638
+ return true;
1639
+ }
1640
+ function constructYamlPairs(data) {
1641
+ if (null === data || !Array.isArray(data.items)) return [];
1642
+ let index, length, result, object = data.items;
1643
+ result = ast$2.newItems();
1644
+ result.parent = data.parent;
1645
+ result.startPosition = data.startPosition;
1646
+ result.endPosition = data.endPosition;
1647
+ for (index = 0, length = object.length; index < length; index += 1) {
1648
+ let mapping = object[index].mappings[0];
1649
+ let pairSeq = ast$2.newItems();
1650
+ pairSeq.parent = result;
1651
+ pairSeq.startPosition = mapping.key.startPosition;
1652
+ pairSeq.endPosition = mapping.value.startPosition;
1653
+ mapping.key.parent = pairSeq;
1654
+ mapping.value.parent = pairSeq;
1655
+ pairSeq.items = [mapping.key, mapping.value];
1656
+ result.items.push(pairSeq);
1657
+ }
1658
+ return result;
1659
+ }
1660
+ module.exports = new type_1$3.Type("tag:yaml.org,2002:pairs", {
1661
+ kind: "sequence",
1662
+ resolve: resolveYamlPairs,
1663
+ construct: constructYamlPairs
1664
+ });
1665
+ }) });
1666
+
1667
+ //#endregion
1668
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/set.js
1669
+ var require_set = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/set.js": ((exports, module) => {
1670
+ const type_1$2 = require_type();
1671
+ const ast$1 = require_yamlAST();
1672
+ function resolveYamlSet(data) {
1673
+ if (null === data) return true;
1674
+ if (data.kind != ast$1.Kind.MAP) return false;
1675
+ return true;
1676
+ }
1677
+ function constructYamlSet(data) {
1678
+ return null !== data ? data : {};
1679
+ }
1680
+ module.exports = new type_1$2.Type("tag:yaml.org,2002:set", {
1681
+ kind: "mapping",
1682
+ resolve: resolveYamlSet,
1683
+ construct: constructYamlSet
1684
+ });
1685
+ }) });
1686
+
1687
+ //#endregion
1688
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/schema/default_safe.js
1689
+ var require_default_safe = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/schema/default_safe.js": ((exports, module) => {
1690
+ var schema$1 = new (require_schema()).Schema({
1691
+ include: [require_core()],
1692
+ implicit: [require_timestamp(), require_merge()],
1693
+ explicit: [
1694
+ require_binary(),
1695
+ require_omap(),
1696
+ require_pairs(),
1697
+ require_set()
1698
+ ]
1699
+ });
1700
+ module.exports = schema$1;
1701
+ }) });
1702
+
1703
+ //#endregion
1704
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/js/undefined.js
1705
+ var require_undefined = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/js/undefined.js": ((exports, module) => {
1706
+ const type_1$1 = require_type();
1707
+ function resolveJavascriptUndefined() {
1708
+ return true;
1709
+ }
1710
+ function constructJavascriptUndefined() {}
1711
+ function representJavascriptUndefined() {
1712
+ return "";
1713
+ }
1714
+ function isUndefined(object) {
1715
+ return "undefined" === typeof object;
1716
+ }
1717
+ module.exports = new type_1$1.Type("tag:yaml.org,2002:js/undefined", {
1718
+ kind: "scalar",
1719
+ resolve: resolveJavascriptUndefined,
1720
+ construct: constructJavascriptUndefined,
1721
+ predicate: isUndefined,
1722
+ represent: representJavascriptUndefined
1723
+ });
1724
+ }) });
1725
+
1726
+ //#endregion
1727
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/js/regexp.js
1728
+ var require_regexp = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/type/js/regexp.js": ((exports, module) => {
1729
+ const type_1 = require_type();
1730
+ function resolveJavascriptRegExp(data) {
1731
+ if (null === data) return false;
1732
+ if (0 === data.length) return false;
1733
+ var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = "";
1734
+ if ("/" === regexp[0]) {
1735
+ if (tail) modifiers = tail[1];
1736
+ if (modifiers.length > 3) return false;
1737
+ if (regexp[regexp.length - modifiers.length - 1] !== "/") return false;
1738
+ regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
1739
+ }
1740
+ try {
1741
+ return true;
1742
+ } catch (error) {
1743
+ return false;
1744
+ }
1745
+ }
1746
+ function constructJavascriptRegExp(data) {
1747
+ var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = "";
1748
+ if ("/" === regexp[0]) {
1749
+ if (tail) modifiers = tail[1];
1750
+ regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
1751
+ }
1752
+ return new RegExp(regexp, modifiers);
1753
+ }
1754
+ function representJavascriptRegExp(object) {
1755
+ var result = "/" + object.source + "/";
1756
+ if (object.global) result += "g";
1757
+ if (object.multiline) result += "m";
1758
+ if (object.ignoreCase) result += "i";
1759
+ return result;
1760
+ }
1761
+ function isRegExp(object) {
1762
+ return "[object RegExp]" === Object.prototype.toString.call(object);
1763
+ }
1764
+ module.exports = new type_1.Type("tag:yaml.org,2002:js/regexp", {
1765
+ kind: "scalar",
1766
+ resolve: resolveJavascriptRegExp,
1767
+ construct: constructJavascriptRegExp,
1768
+ predicate: isRegExp,
1769
+ represent: representJavascriptRegExp
1770
+ });
1771
+ }) });
1772
+
1773
+ //#endregion
1774
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/schema/default_full.js
1775
+ var require_default_full = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/schema/default_full.js": ((exports, module) => {
1776
+ const schema_1 = require_schema();
1777
+ var schema = new schema_1.Schema({
1778
+ include: [require_default_safe()],
1779
+ explicit: [require_undefined(), require_regexp()]
1780
+ });
1781
+ schema_1.Schema.DEFAULT = schema;
1782
+ module.exports = schema;
1783
+ }) });
1784
+
1785
+ //#endregion
1786
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/loader.js
1787
+ var require_loader = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/loader.js": ((exports, module) => {
1788
+ Object.defineProperty(exports, "__esModule", { value: true });
1789
+ const ast = require_yamlAST();
1790
+ const common$1 = require_common();
1791
+ const YAMLException$1 = require_exception();
1792
+ const Mark = require_mark();
1793
+ const DEFAULT_SAFE_SCHEMA$1 = require_default_safe();
1794
+ const DEFAULT_FULL_SCHEMA$1 = require_default_full();
1795
+ var _hasOwnProperty$1 = Object.prototype.hasOwnProperty;
1796
+ var CONTEXT_FLOW_IN = 1;
1797
+ var CONTEXT_FLOW_OUT = 2;
1798
+ var CONTEXT_BLOCK_IN = 3;
1799
+ var CONTEXT_BLOCK_OUT = 4;
1800
+ var CHOMPING_CLIP = 1;
1801
+ var CHOMPING_STRIP = 2;
1802
+ var CHOMPING_KEEP = 3;
1803
+ var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
1804
+ var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
1805
+ var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
1806
+ var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
1807
+ var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
1808
+ function is_EOL(c) {
1809
+ return c === 10 || c === 13;
1810
+ }
1811
+ function is_WHITE_SPACE(c) {
1812
+ return c === 9 || c === 32;
1813
+ }
1814
+ function is_WS_OR_EOL(c) {
1815
+ return c === 9 || c === 32 || c === 10 || c === 13;
1816
+ }
1817
+ function is_FLOW_INDICATOR(c) {
1818
+ return 44 === c || 91 === c || 93 === c || 123 === c || 125 === c;
1819
+ }
1820
+ function fromHexCode(c) {
1821
+ var lc;
1822
+ if (48 <= c && c <= 57) return c - 48;
1823
+ lc = c | 32;
1824
+ if (97 <= lc && lc <= 102) return lc - 97 + 10;
1825
+ return -1;
1826
+ }
1827
+ function escapedHexLen(c) {
1828
+ if (c === 120) return 2;
1829
+ if (c === 117) return 4;
1830
+ if (c === 85) return 8;
1831
+ return 0;
1832
+ }
1833
+ function fromDecimalCode(c) {
1834
+ if (48 <= c && c <= 57) return c - 48;
1835
+ return -1;
1836
+ }
1837
+ function simpleEscapeSequence(c) {
1838
+ return c === 48 ? "\0" : c === 97 ? "\x07" : c === 98 ? "\b" : c === 116 ? " " : c === 9 ? " " : c === 110 ? "\n" : c === 118 ? "\v" : c === 102 ? "\f" : c === 114 ? "\r" : c === 101 ? "\x1B" : c === 32 ? " " : c === 34 ? "\"" : c === 47 ? "/" : c === 92 ? "\\" : c === 78 ? "…" : c === 95 ? "\xA0" : c === 76 ? "\u2028" : c === 80 ? "\u2029" : "";
1839
+ }
1840
+ function charFromCodepoint(c) {
1841
+ if (c <= 65535) return String.fromCharCode(c);
1842
+ return String.fromCharCode((c - 65536 >> 10) + 55296, (c - 65536 & 1023) + 56320);
1843
+ }
1844
+ var simpleEscapeCheck = new Array(256);
1845
+ var simpleEscapeMap = new Array(256);
1846
+ var customEscapeCheck = new Array(256);
1847
+ var customEscapeMap = new Array(256);
1848
+ for (var i = 0; i < 256; i++) {
1849
+ customEscapeMap[i] = simpleEscapeMap[i] = simpleEscapeSequence(i);
1850
+ simpleEscapeCheck[i] = simpleEscapeMap[i] ? 1 : 0;
1851
+ customEscapeCheck[i] = 1;
1852
+ if (!simpleEscapeCheck[i]) customEscapeMap[i] = "\\" + String.fromCharCode(i);
1853
+ }
1854
+ var State$1 = class {
1855
+ constructor(input, options) {
1856
+ this.errorMap = {};
1857
+ this.errors = [];
1858
+ this.lines = [];
1859
+ this.input = input;
1860
+ this.filename = options["filename"] || null;
1861
+ this.schema = options["schema"] || DEFAULT_FULL_SCHEMA$1;
1862
+ this.onWarning = options["onWarning"] || null;
1863
+ this.legacy = options["legacy"] || false;
1864
+ this.allowAnyEscape = options["allowAnyEscape"] || false;
1865
+ this.ignoreDuplicateKeys = options["ignoreDuplicateKeys"] || false;
1866
+ this.implicitTypes = this.schema.compiledImplicit;
1867
+ this.typeMap = this.schema.compiledTypeMap;
1868
+ this.length = input.length;
1869
+ this.position = 0;
1870
+ this.line = 0;
1871
+ this.lineStart = 0;
1872
+ this.lineIndent = 0;
1873
+ this.documents = [];
1874
+ }
1875
+ };
1876
+ function generateError(state, message, isWarning = false) {
1877
+ return new YAMLException$1(message, new Mark(state.filename, state.input, state.position, state.line, state.position - state.lineStart), isWarning);
1878
+ }
1879
+ function throwErrorFromPosition(state, position, message, isWarning = false, toLineEnd = false) {
1880
+ var line = positionToLine(state, position);
1881
+ if (!line) return;
1882
+ var hash = message + position;
1883
+ if (state.errorMap[hash]) return;
1884
+ var mark = new Mark(state.filename, state.input, position, line.line, position - line.start);
1885
+ if (toLineEnd) mark.toLineEnd = true;
1886
+ var error = new YAMLException$1(message, mark, isWarning);
1887
+ state.errors.push(error);
1888
+ }
1889
+ function throwError(state, message) {
1890
+ var error = generateError(state, message);
1891
+ var hash = error.message + error.mark.position;
1892
+ if (state.errorMap[hash]) return;
1893
+ state.errors.push(error);
1894
+ state.errorMap[hash] = 1;
1895
+ var or = state.position;
1896
+ while (true) {
1897
+ if (state.position >= state.input.length - 1) return;
1898
+ var c = state.input.charAt(state.position);
1899
+ if (c == "\n") {
1900
+ state.position--;
1901
+ if (state.position == or) state.position += 1;
1902
+ return;
1903
+ }
1904
+ if (c == "\r") {
1905
+ state.position--;
1906
+ if (state.position == or) state.position += 1;
1907
+ return;
1908
+ }
1909
+ state.position++;
1910
+ }
1911
+ }
1912
+ function throwWarning(state, message) {
1913
+ var error = generateError(state, message);
1914
+ if (state.onWarning) state.onWarning.call(null, error);
1915
+ }
1916
+ var directiveHandlers = {
1917
+ YAML: function handleYamlDirective(state, name, args) {
1918
+ var match, major, minor;
1919
+ if (null !== state.version) throwError(state, "duplication of %YAML directive");
1920
+ if (1 !== args.length) throwError(state, "YAML directive accepts exactly one argument");
1921
+ match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
1922
+ if (null === match) throwError(state, "ill-formed argument of the YAML directive");
1923
+ major = parseInt(match[1], 10);
1924
+ minor = parseInt(match[2], 10);
1925
+ if (1 !== major) throwError(state, "found incompatible YAML document (version 1.2 is required)");
1926
+ state.version = args[0];
1927
+ state.checkLineBreaks = minor < 2;
1928
+ if (2 !== minor) throwError(state, "found incompatible YAML document (version 1.2 is required)");
1929
+ },
1930
+ TAG: function handleTagDirective(state, name, args) {
1931
+ var handle, prefix;
1932
+ if (2 !== args.length) throwError(state, "TAG directive accepts exactly two arguments");
1933
+ handle = args[0];
1934
+ prefix = args[1];
1935
+ if (!PATTERN_TAG_HANDLE.test(handle)) throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
1936
+ if (_hasOwnProperty$1.call(state.tagMap, handle)) throwError(state, "there is a previously declared suffix for \"" + handle + "\" tag handle");
1937
+ if (!PATTERN_TAG_URI.test(prefix)) throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
1938
+ state.tagMap[handle] = prefix;
1939
+ }
1940
+ };
1941
+ function captureSegment(state, start, end, checkJson) {
1942
+ var _position, _length, _character, _result;
1943
+ var scalar = state.result;
1944
+ if (scalar.startPosition == -1) scalar.startPosition = start;
1945
+ if (start <= end) {
1946
+ _result = state.input.slice(start, end);
1947
+ if (checkJson) for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
1948
+ _character = _result.charCodeAt(_position);
1949
+ if (!(9 === _character || 32 <= _character && _character <= 1114111)) throwError(state, "expected valid JSON character");
1950
+ }
1951
+ else if (PATTERN_NON_PRINTABLE.test(_result)) throwError(state, "the stream contains non-printable characters");
1952
+ scalar.value += _result;
1953
+ scalar.endPosition = end;
1954
+ }
1955
+ }
1956
+ function storeMappingPair(state, _result, keyTag, keyNode, valueNode) {
1957
+ if (keyNode == null) return;
1958
+ if (null === _result) _result = {
1959
+ startPosition: keyNode.startPosition,
1960
+ endPosition: valueNode.endPosition,
1961
+ parent: null,
1962
+ errors: [],
1963
+ mappings: [],
1964
+ kind: ast.Kind.MAP
1965
+ };
1966
+ var mapping = ast.newMapping(keyNode, valueNode);
1967
+ mapping.parent = _result;
1968
+ keyNode.parent = mapping;
1969
+ if (valueNode != null) valueNode.parent = mapping;
1970
+ !state.ignoreDuplicateKeys && _result.mappings.forEach((sibling) => {
1971
+ if (sibling.key && sibling.key.value === (mapping.key && mapping.key.value)) {
1972
+ throwErrorFromPosition(state, mapping.key.startPosition, "duplicate key");
1973
+ throwErrorFromPosition(state, sibling.key.startPosition, "duplicate key");
1974
+ }
1975
+ });
1976
+ _result.mappings.push(mapping);
1977
+ _result.endPosition = valueNode ? valueNode.endPosition : keyNode.endPosition + 1;
1978
+ return _result;
1979
+ }
1980
+ function readLineBreak(state) {
1981
+ var ch = state.input.charCodeAt(state.position);
1982
+ if (10 === ch) state.position++;
1983
+ else if (13 === ch) {
1984
+ state.position++;
1985
+ if (10 === state.input.charCodeAt(state.position)) state.position++;
1986
+ } else throwError(state, "a line break is expected");
1987
+ state.line += 1;
1988
+ state.lineStart = state.position;
1989
+ state.lines.push({
1990
+ start: state.lineStart,
1991
+ line: state.line
1992
+ });
1993
+ }
1994
+ function positionToLine(state, position) {
1995
+ var line;
1996
+ for (var i$1 = 0; i$1 < state.lines.length; i$1++) {
1997
+ if (state.lines[i$1].start > position) break;
1998
+ line = state.lines[i$1];
1999
+ }
2000
+ if (!line) return {
2001
+ start: 0,
2002
+ line: 0
2003
+ };
2004
+ return line;
2005
+ }
2006
+ function readComment(state) {
2007
+ var ch = 0, _position = state.position;
2008
+ do
2009
+ ch = state.input.charCodeAt(++state.position);
2010
+ while (0 !== ch && !is_EOL(ch));
2011
+ state.comments.push({
2012
+ startPosition: _position,
2013
+ endPosition: state.position,
2014
+ value: state.input.slice(_position + 1, state.position)
2015
+ });
2016
+ }
2017
+ function skipSeparationSpace(state, allowComments, checkIndent) {
2018
+ var lineBreaks = 0, ch = state.input.charCodeAt(state.position);
2019
+ while (0 !== ch) {
2020
+ while (is_WHITE_SPACE(ch)) {
2021
+ if (ch === 9) state.errors.push(generateError(state, "Using tabs can lead to unpredictable results", true));
2022
+ ch = state.input.charCodeAt(++state.position);
2023
+ }
2024
+ if (allowComments && 35 === ch) {
2025
+ readComment(state);
2026
+ ch = state.input.charCodeAt(state.position);
2027
+ }
2028
+ if (is_EOL(ch)) {
2029
+ readLineBreak(state);
2030
+ ch = state.input.charCodeAt(state.position);
2031
+ lineBreaks++;
2032
+ state.lineIndent = 0;
2033
+ while (32 === ch) {
2034
+ state.lineIndent++;
2035
+ ch = state.input.charCodeAt(++state.position);
2036
+ }
2037
+ } else break;
2038
+ }
2039
+ if (-1 !== checkIndent && 0 !== lineBreaks && state.lineIndent < checkIndent) throwWarning(state, "deficient indentation");
2040
+ return lineBreaks;
2041
+ }
2042
+ function testDocumentSeparator(state) {
2043
+ var _position = state.position, ch = state.input.charCodeAt(_position);
2044
+ if ((45 === ch || 46 === ch) && state.input.charCodeAt(_position + 1) === ch && state.input.charCodeAt(_position + 2) === ch) {
2045
+ _position += 3;
2046
+ ch = state.input.charCodeAt(_position);
2047
+ if (ch === 0 || is_WS_OR_EOL(ch)) return true;
2048
+ }
2049
+ return false;
2050
+ }
2051
+ function writeFoldedLines(state, scalar, count) {
2052
+ if (1 === count) scalar.value += " ";
2053
+ else if (count > 1) scalar.value += common$1.repeat("\n", count - 1);
2054
+ }
2055
+ function readPlainScalar(state, nodeIndent, withinFlowCollection) {
2056
+ var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch;
2057
+ var state_result = ast.newScalar();
2058
+ state_result.plainScalar = true;
2059
+ state.result = state_result;
2060
+ ch = state.input.charCodeAt(state.position);
2061
+ if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || 35 === ch || 38 === ch || 42 === ch || 33 === ch || 124 === ch || 62 === ch || 39 === ch || 34 === ch || 37 === ch || 64 === ch || 96 === ch) return false;
2062
+ if (63 === ch || 45 === ch) {
2063
+ following = state.input.charCodeAt(state.position + 1);
2064
+ if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) return false;
2065
+ }
2066
+ state.kind = "scalar";
2067
+ captureStart = captureEnd = state.position;
2068
+ hasPendingContent = false;
2069
+ while (0 !== ch) {
2070
+ if (58 === ch) {
2071
+ following = state.input.charCodeAt(state.position + 1);
2072
+ if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) break;
2073
+ } else if (35 === ch) {
2074
+ preceding = state.input.charCodeAt(state.position - 1);
2075
+ if (is_WS_OR_EOL(preceding)) break;
2076
+ } else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) break;
2077
+ else if (is_EOL(ch)) {
2078
+ _line = state.line;
2079
+ _lineStart = state.lineStart;
2080
+ _lineIndent = state.lineIndent;
2081
+ skipSeparationSpace(state, false, -1);
2082
+ if (state.lineIndent >= nodeIndent) {
2083
+ hasPendingContent = true;
2084
+ ch = state.input.charCodeAt(state.position);
2085
+ continue;
2086
+ } else {
2087
+ state.position = captureEnd;
2088
+ state.line = _line;
2089
+ state.lineStart = _lineStart;
2090
+ state.lineIndent = _lineIndent;
2091
+ break;
2092
+ }
2093
+ }
2094
+ if (hasPendingContent) {
2095
+ captureSegment(state, captureStart, captureEnd, false);
2096
+ writeFoldedLines(state, state_result, state.line - _line);
2097
+ captureStart = captureEnd = state.position;
2098
+ hasPendingContent = false;
2099
+ }
2100
+ if (!is_WHITE_SPACE(ch)) captureEnd = state.position + 1;
2101
+ ch = state.input.charCodeAt(++state.position);
2102
+ if (state.position >= state.input.length) return false;
2103
+ }
2104
+ captureSegment(state, captureStart, captureEnd, false);
2105
+ if (state.result.startPosition != -1) {
2106
+ state_result.rawValue = state.input.substring(state_result.startPosition, state_result.endPosition);
2107
+ return true;
2108
+ }
2109
+ state.kind = _kind;
2110
+ state.result = _result;
2111
+ return false;
2112
+ }
2113
+ function readSingleQuotedScalar(state, nodeIndent) {
2114
+ var ch = state.input.charCodeAt(state.position), captureStart, captureEnd;
2115
+ if (39 !== ch) return false;
2116
+ var scalar = ast.newScalar();
2117
+ scalar.singleQuoted = true;
2118
+ state.kind = "scalar";
2119
+ state.result = scalar;
2120
+ scalar.startPosition = state.position;
2121
+ state.position++;
2122
+ captureStart = captureEnd = state.position;
2123
+ while (0 !== (ch = state.input.charCodeAt(state.position))) if (39 === ch) {
2124
+ captureSegment(state, captureStart, state.position, true);
2125
+ ch = state.input.charCodeAt(++state.position);
2126
+ scalar.endPosition = state.position;
2127
+ if (39 === ch) {
2128
+ captureStart = captureEnd = state.position;
2129
+ state.position++;
2130
+ } else return true;
2131
+ } else if (is_EOL(ch)) {
2132
+ captureSegment(state, captureStart, captureEnd, true);
2133
+ writeFoldedLines(state, scalar, skipSeparationSpace(state, false, nodeIndent));
2134
+ captureStart = captureEnd = state.position;
2135
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, "unexpected end of the document within a single quoted scalar");
2136
+ else {
2137
+ state.position++;
2138
+ captureEnd = state.position;
2139
+ scalar.endPosition = state.position;
2140
+ }
2141
+ throwError(state, "unexpected end of the stream within a single quoted scalar");
2142
+ }
2143
+ function readDoubleQuotedScalar(state, nodeIndent) {
2144
+ var captureStart, captureEnd, hexLength, hexResult, tmp, ch = state.input.charCodeAt(state.position);
2145
+ if (34 !== ch) return false;
2146
+ state.kind = "scalar";
2147
+ var scalar = ast.newScalar();
2148
+ scalar.doubleQuoted = true;
2149
+ state.result = scalar;
2150
+ scalar.startPosition = state.position;
2151
+ state.position++;
2152
+ captureStart = captureEnd = state.position;
2153
+ while (0 !== (ch = state.input.charCodeAt(state.position))) if (34 === ch) {
2154
+ captureSegment(state, captureStart, state.position, true);
2155
+ state.position++;
2156
+ scalar.endPosition = state.position;
2157
+ scalar.rawValue = state.input.substring(scalar.startPosition, scalar.endPosition);
2158
+ return true;
2159
+ } else if (92 === ch) {
2160
+ captureSegment(state, captureStart, state.position, true);
2161
+ ch = state.input.charCodeAt(++state.position);
2162
+ if (is_EOL(ch)) skipSeparationSpace(state, false, nodeIndent);
2163
+ else if (ch < 256 && (state.allowAnyEscape ? customEscapeCheck[ch] : simpleEscapeCheck[ch])) {
2164
+ scalar.value += state.allowAnyEscape ? customEscapeMap[ch] : simpleEscapeMap[ch];
2165
+ state.position++;
2166
+ } else if ((tmp = escapedHexLen(ch)) > 0) {
2167
+ hexLength = tmp;
2168
+ hexResult = 0;
2169
+ for (; hexLength > 0; hexLength--) {
2170
+ ch = state.input.charCodeAt(++state.position);
2171
+ if ((tmp = fromHexCode(ch)) >= 0) hexResult = (hexResult << 4) + tmp;
2172
+ else throwError(state, "expected hexadecimal character");
2173
+ }
2174
+ scalar.value += charFromCodepoint(hexResult);
2175
+ state.position++;
2176
+ } else throwError(state, "unknown escape sequence");
2177
+ captureStart = captureEnd = state.position;
2178
+ } else if (is_EOL(ch)) {
2179
+ captureSegment(state, captureStart, captureEnd, true);
2180
+ writeFoldedLines(state, scalar, skipSeparationSpace(state, false, nodeIndent));
2181
+ captureStart = captureEnd = state.position;
2182
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, "unexpected end of the document within a double quoted scalar");
2183
+ else {
2184
+ state.position++;
2185
+ captureEnd = state.position;
2186
+ }
2187
+ throwError(state, "unexpected end of the stream within a double quoted scalar");
2188
+ }
2189
+ function readFlowCollection(state, nodeIndent) {
2190
+ var readNext = true, _line, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, keyNode, keyTag, valueNode, ch = state.input.charCodeAt(state.position);
2191
+ if (ch === 91) {
2192
+ terminator = 93;
2193
+ isMapping = false;
2194
+ _result = ast.newItems();
2195
+ _result.startPosition = state.position;
2196
+ } else if (ch === 123) {
2197
+ terminator = 125;
2198
+ isMapping = true;
2199
+ _result = ast.newMap();
2200
+ _result.startPosition = state.position;
2201
+ } else return false;
2202
+ if (null !== state.anchor) {
2203
+ _result.anchorId = state.anchor;
2204
+ state.anchorMap[state.anchor] = _result;
2205
+ }
2206
+ ch = state.input.charCodeAt(++state.position);
2207
+ while (0 !== ch) {
2208
+ skipSeparationSpace(state, true, nodeIndent);
2209
+ ch = state.input.charCodeAt(state.position);
2210
+ if (ch === terminator) {
2211
+ state.position++;
2212
+ state.tag = _tag;
2213
+ state.anchor = _anchor;
2214
+ state.kind = isMapping ? "mapping" : "sequence";
2215
+ state.result = _result;
2216
+ _result.endPosition = state.position;
2217
+ return true;
2218
+ } else if (!readNext) {
2219
+ var p = state.position;
2220
+ throwError(state, "missed comma between flow collection entries");
2221
+ state.position = p + 1;
2222
+ }
2223
+ keyTag = keyNode = valueNode = null;
2224
+ isPair = isExplicitPair = false;
2225
+ if (63 === ch) {
2226
+ following = state.input.charCodeAt(state.position + 1);
2227
+ if (is_WS_OR_EOL(following)) {
2228
+ isPair = isExplicitPair = true;
2229
+ state.position++;
2230
+ skipSeparationSpace(state, true, nodeIndent);
2231
+ }
2232
+ }
2233
+ _line = state.line;
2234
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
2235
+ keyTag = state.tag;
2236
+ keyNode = state.result;
2237
+ skipSeparationSpace(state, true, nodeIndent);
2238
+ ch = state.input.charCodeAt(state.position);
2239
+ if ((isExplicitPair || state.line === _line) && 58 === ch) {
2240
+ isPair = true;
2241
+ ch = state.input.charCodeAt(++state.position);
2242
+ skipSeparationSpace(state, true, nodeIndent);
2243
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
2244
+ valueNode = state.result;
2245
+ }
2246
+ if (isMapping) storeMappingPair(state, _result, keyTag, keyNode, valueNode);
2247
+ else if (isPair) {
2248
+ var mp = storeMappingPair(state, null, keyTag, keyNode, valueNode);
2249
+ mp.parent = _result;
2250
+ _result.items.push(mp);
2251
+ } else {
2252
+ if (keyNode) keyNode.parent = _result;
2253
+ _result.items.push(keyNode);
2254
+ }
2255
+ _result.endPosition = state.position + 1;
2256
+ skipSeparationSpace(state, true, nodeIndent);
2257
+ ch = state.input.charCodeAt(state.position);
2258
+ if (44 === ch) {
2259
+ readNext = true;
2260
+ ch = state.input.charCodeAt(++state.position);
2261
+ } else readNext = false;
2262
+ }
2263
+ throwError(state, "unexpected end of the stream within a flow collection");
2264
+ }
2265
+ function readBlockScalar(state, nodeIndent) {
2266
+ var captureStart, folding, chomping = CHOMPING_CLIP, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch = state.input.charCodeAt(state.position);
2267
+ if (ch === 124) folding = false;
2268
+ else if (ch === 62) folding = true;
2269
+ else return false;
2270
+ var sc = ast.newScalar();
2271
+ state.kind = "scalar";
2272
+ state.result = sc;
2273
+ sc.startPosition = state.position;
2274
+ while (0 !== ch) {
2275
+ ch = state.input.charCodeAt(++state.position);
2276
+ if (43 === ch || 45 === ch) if (CHOMPING_CLIP === chomping) chomping = 43 === ch ? CHOMPING_KEEP : CHOMPING_STRIP;
2277
+ else throwError(state, "repeat of a chomping mode identifier");
2278
+ else if ((tmp = fromDecimalCode(ch)) >= 0) if (tmp === 0) throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
2279
+ else if (!detectedIndent) {
2280
+ textIndent = nodeIndent + tmp - 1;
2281
+ detectedIndent = true;
2282
+ } else throwError(state, "repeat of an indentation width identifier");
2283
+ else break;
2284
+ }
2285
+ if (is_WHITE_SPACE(ch)) {
2286
+ do
2287
+ ch = state.input.charCodeAt(++state.position);
2288
+ while (is_WHITE_SPACE(ch));
2289
+ if (35 === ch) {
2290
+ readComment(state);
2291
+ ch = state.input.charCodeAt(state.position);
2292
+ }
2293
+ }
2294
+ while (0 !== ch) {
2295
+ readLineBreak(state);
2296
+ state.lineIndent = 0;
2297
+ ch = state.input.charCodeAt(state.position);
2298
+ while ((!detectedIndent || state.lineIndent < textIndent) && 32 === ch) {
2299
+ state.lineIndent++;
2300
+ ch = state.input.charCodeAt(++state.position);
2301
+ }
2302
+ if (!detectedIndent && state.lineIndent > textIndent) textIndent = state.lineIndent;
2303
+ if (is_EOL(ch)) {
2304
+ emptyLines++;
2305
+ continue;
2306
+ }
2307
+ if (state.lineIndent < textIndent) {
2308
+ if (chomping === CHOMPING_KEEP) sc.value += common$1.repeat("\n", emptyLines);
2309
+ else if (chomping === CHOMPING_CLIP) {
2310
+ if (detectedIndent) sc.value += "\n";
2311
+ }
2312
+ break;
2313
+ }
2314
+ if (folding) if (is_WHITE_SPACE(ch)) {
2315
+ atMoreIndented = true;
2316
+ sc.value += common$1.repeat("\n", emptyLines + 1);
2317
+ } else if (atMoreIndented) {
2318
+ atMoreIndented = false;
2319
+ sc.value += common$1.repeat("\n", emptyLines + 1);
2320
+ } else if (0 === emptyLines) {
2321
+ if (detectedIndent) sc.value += " ";
2322
+ } else sc.value += common$1.repeat("\n", emptyLines);
2323
+ else if (detectedIndent) sc.value += common$1.repeat("\n", emptyLines + 1);
2324
+ detectedIndent = true;
2325
+ emptyLines = 0;
2326
+ captureStart = state.position;
2327
+ while (!is_EOL(ch) && 0 !== ch) ch = state.input.charCodeAt(++state.position);
2328
+ captureSegment(state, captureStart, state.position, false);
2329
+ }
2330
+ sc.endPosition = state.position;
2331
+ var i$1 = state.position - 1;
2332
+ var needMinus = false;
2333
+ while (true) {
2334
+ var c = state.input[i$1];
2335
+ if (c == "\r" || c == "\n") {
2336
+ if (needMinus) i$1--;
2337
+ break;
2338
+ }
2339
+ if (c != " " && c != " ") break;
2340
+ i$1--;
2341
+ }
2342
+ sc.endPosition = i$1;
2343
+ sc.rawValue = state.input.substring(sc.startPosition, sc.endPosition);
2344
+ return true;
2345
+ }
2346
+ function readBlockSequence(state, nodeIndent) {
2347
+ var _line, _tag = state.tag, _anchor = state.anchor, _result = ast.newItems(), following, detected = false, ch;
2348
+ if (null !== state.anchor) {
2349
+ _result.anchorId = state.anchor;
2350
+ state.anchorMap[state.anchor] = _result;
2351
+ }
2352
+ _result.startPosition = state.position;
2353
+ ch = state.input.charCodeAt(state.position);
2354
+ while (0 !== ch) {
2355
+ if (45 !== ch) break;
2356
+ following = state.input.charCodeAt(state.position + 1);
2357
+ if (!is_WS_OR_EOL(following)) break;
2358
+ detected = true;
2359
+ state.position++;
2360
+ if (skipSeparationSpace(state, true, -1)) {
2361
+ if (state.lineIndent <= nodeIndent) {
2362
+ _result.items.push(null);
2363
+ ch = state.input.charCodeAt(state.position);
2364
+ continue;
2365
+ }
2366
+ }
2367
+ _line = state.line;
2368
+ composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
2369
+ if (state.result) {
2370
+ state.result.parent = _result;
2371
+ _result.items.push(state.result);
2372
+ }
2373
+ skipSeparationSpace(state, true, -1);
2374
+ ch = state.input.charCodeAt(state.position);
2375
+ if ((state.line === _line || state.lineIndent > nodeIndent) && 0 !== ch) throwError(state, "bad indentation of a sequence entry");
2376
+ else if (state.lineIndent < nodeIndent) break;
2377
+ }
2378
+ _result.endPosition = state.position;
2379
+ if (detected) {
2380
+ state.tag = _tag;
2381
+ state.anchor = _anchor;
2382
+ state.kind = "sequence";
2383
+ state.result = _result;
2384
+ _result.endPosition = state.position;
2385
+ return true;
2386
+ }
2387
+ return false;
2388
+ }
2389
+ function readBlockMapping(state, nodeIndent, flowIndent) {
2390
+ var following, allowCompact, _line, _tag = state.tag, _anchor = state.anchor, _result = ast.newMap(), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
2391
+ _result.startPosition = state.position;
2392
+ if (null !== state.anchor) {
2393
+ _result.anchorId = state.anchor;
2394
+ state.anchorMap[state.anchor] = _result;
2395
+ }
2396
+ ch = state.input.charCodeAt(state.position);
2397
+ while (0 !== ch) {
2398
+ following = state.input.charCodeAt(state.position + 1);
2399
+ _line = state.line;
2400
+ if ((63 === ch || 58 === ch) && is_WS_OR_EOL(following)) {
2401
+ if (63 === ch) {
2402
+ if (atExplicitKey) {
2403
+ storeMappingPair(state, _result, keyTag, keyNode, null);
2404
+ keyTag = keyNode = valueNode = null;
2405
+ }
2406
+ detected = true;
2407
+ atExplicitKey = true;
2408
+ allowCompact = true;
2409
+ } else if (atExplicitKey) {
2410
+ atExplicitKey = false;
2411
+ allowCompact = true;
2412
+ } else throwError(state, "incomplete explicit mapping pair; a key node is missed");
2413
+ state.position += 1;
2414
+ ch = following;
2415
+ } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) if (state.line === _line) {
2416
+ ch = state.input.charCodeAt(state.position);
2417
+ while (is_WHITE_SPACE(ch)) ch = state.input.charCodeAt(++state.position);
2418
+ if (58 === ch) {
2419
+ ch = state.input.charCodeAt(++state.position);
2420
+ if (!is_WS_OR_EOL(ch)) throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
2421
+ if (atExplicitKey) {
2422
+ storeMappingPair(state, _result, keyTag, keyNode, null);
2423
+ keyTag = keyNode = valueNode = null;
2424
+ }
2425
+ detected = true;
2426
+ atExplicitKey = false;
2427
+ allowCompact = false;
2428
+ keyTag = state.tag;
2429
+ keyNode = state.result;
2430
+ } else if (state.position == state.lineStart && testDocumentSeparator(state)) break;
2431
+ else if (detected) throwError(state, "can not read an implicit mapping pair; a colon is missed");
2432
+ else {
2433
+ state.tag = _tag;
2434
+ state.anchor = _anchor;
2435
+ return true;
2436
+ }
2437
+ } else if (detected) {
2438
+ throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
2439
+ while (state.position > 0) {
2440
+ ch = state.input.charCodeAt(--state.position);
2441
+ if (is_EOL(ch)) {
2442
+ state.position++;
2443
+ break;
2444
+ }
2445
+ }
2446
+ } else {
2447
+ state.tag = _tag;
2448
+ state.anchor = _anchor;
2449
+ return true;
2450
+ }
2451
+ else break;
2452
+ if (state.line === _line || state.lineIndent > nodeIndent) {
2453
+ if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) if (atExplicitKey) keyNode = state.result;
2454
+ else valueNode = state.result;
2455
+ if (!atExplicitKey) {
2456
+ storeMappingPair(state, _result, keyTag, keyNode, valueNode);
2457
+ keyTag = keyNode = valueNode = null;
2458
+ }
2459
+ skipSeparationSpace(state, true, -1);
2460
+ ch = state.input.charCodeAt(state.position);
2461
+ }
2462
+ if (state.lineIndent > nodeIndent && 0 !== ch) throwError(state, "bad indentation of a mapping entry");
2463
+ else if (state.lineIndent < nodeIndent) break;
2464
+ }
2465
+ if (atExplicitKey) storeMappingPair(state, _result, keyTag, keyNode, null);
2466
+ if (detected) {
2467
+ state.tag = _tag;
2468
+ state.anchor = _anchor;
2469
+ state.kind = "mapping";
2470
+ state.result = _result;
2471
+ }
2472
+ return detected;
2473
+ }
2474
+ function readTagProperty(state) {
2475
+ var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch = state.input.charCodeAt(state.position);
2476
+ if (33 !== ch) return false;
2477
+ if (null !== state.tag) throwError(state, "duplication of a tag property");
2478
+ ch = state.input.charCodeAt(++state.position);
2479
+ if (60 === ch) {
2480
+ isVerbatim = true;
2481
+ ch = state.input.charCodeAt(++state.position);
2482
+ } else if (33 === ch) {
2483
+ isNamed = true;
2484
+ tagHandle = "!!";
2485
+ ch = state.input.charCodeAt(++state.position);
2486
+ } else tagHandle = "!";
2487
+ _position = state.position;
2488
+ if (isVerbatim) {
2489
+ do
2490
+ ch = state.input.charCodeAt(++state.position);
2491
+ while (0 !== ch && 62 !== ch);
2492
+ if (state.position < state.length) {
2493
+ tagName = state.input.slice(_position, state.position);
2494
+ ch = state.input.charCodeAt(++state.position);
2495
+ } else throwError(state, "unexpected end of the stream within a verbatim tag");
2496
+ } else {
2497
+ while (0 !== ch && !is_WS_OR_EOL(ch)) {
2498
+ if (33 === ch) if (!isNamed) {
2499
+ tagHandle = state.input.slice(_position - 1, state.position + 1);
2500
+ if (!PATTERN_TAG_HANDLE.test(tagHandle)) throwError(state, "named tag handle cannot contain such characters");
2501
+ isNamed = true;
2502
+ _position = state.position + 1;
2503
+ } else throwError(state, "tag suffix cannot contain exclamation marks");
2504
+ ch = state.input.charCodeAt(++state.position);
2505
+ }
2506
+ tagName = state.input.slice(_position, state.position);
2507
+ if (PATTERN_FLOW_INDICATORS.test(tagName)) throwError(state, "tag suffix cannot contain flow indicator characters");
2508
+ }
2509
+ if (tagName && !PATTERN_TAG_URI.test(tagName)) throwError(state, "tag name cannot contain such characters: " + tagName);
2510
+ if (isVerbatim) state.tag = tagName;
2511
+ else if (_hasOwnProperty$1.call(state.tagMap, tagHandle)) state.tag = state.tagMap[tagHandle] + tagName;
2512
+ else if ("!" === tagHandle) state.tag = "!" + tagName;
2513
+ else if ("!!" === tagHandle) state.tag = "tag:yaml.org,2002:" + tagName;
2514
+ else throwError(state, "undeclared tag handle \"" + tagHandle + "\"");
2515
+ return true;
2516
+ }
2517
+ function readAnchorProperty(state) {
2518
+ var _position, ch = state.input.charCodeAt(state.position);
2519
+ if (38 !== ch) return false;
2520
+ if (null !== state.anchor) throwError(state, "duplication of an anchor property");
2521
+ ch = state.input.charCodeAt(++state.position);
2522
+ _position = state.position;
2523
+ while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) ch = state.input.charCodeAt(++state.position);
2524
+ if (state.position === _position) throwError(state, "name of an anchor node must contain at least one character");
2525
+ state.anchor = state.input.slice(_position, state.position);
2526
+ return true;
2527
+ }
2528
+ function readAlias(state) {
2529
+ var _position, alias;
2530
+ state.length;
2531
+ state.input;
2532
+ var ch = state.input.charCodeAt(state.position);
2533
+ if (42 !== ch) return false;
2534
+ ch = state.input.charCodeAt(++state.position);
2535
+ _position = state.position;
2536
+ while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) ch = state.input.charCodeAt(++state.position);
2537
+ if (state.position <= _position) {
2538
+ throwError(state, "name of an alias node must contain at least one character");
2539
+ state.position = _position + 1;
2540
+ }
2541
+ alias = state.input.slice(_position, state.position);
2542
+ if (!state.anchorMap.hasOwnProperty(alias)) {
2543
+ throwError(state, "unidentified alias \"" + alias + "\"");
2544
+ if (state.position <= _position) state.position = _position + 1;
2545
+ }
2546
+ state.result = ast.newAnchorRef(alias, _position, state.position, state.anchorMap[alias]);
2547
+ skipSeparationSpace(state, true, -1);
2548
+ return true;
2549
+ }
2550
+ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
2551
+ var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, type, flowIndent, blockIndent;
2552
+ state.tag = null;
2553
+ state.anchor = null;
2554
+ state.kind = null;
2555
+ state.result = null;
2556
+ allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
2557
+ if (allowToSeek) {
2558
+ if (skipSeparationSpace(state, true, -1)) {
2559
+ atNewLine = true;
2560
+ if (state.lineIndent > parentIndent) indentStatus = 1;
2561
+ else if (state.lineIndent === parentIndent) indentStatus = 0;
2562
+ else if (state.lineIndent < parentIndent) indentStatus = -1;
2563
+ }
2564
+ }
2565
+ let tagStart = state.position;
2566
+ state.position - state.lineStart;
2567
+ if (1 === indentStatus) while (readTagProperty(state) || readAnchorProperty(state)) if (skipSeparationSpace(state, true, -1)) {
2568
+ atNewLine = true;
2569
+ allowBlockCollections = allowBlockStyles;
2570
+ if (state.lineIndent > parentIndent) indentStatus = 1;
2571
+ else if (state.lineIndent === parentIndent) indentStatus = 0;
2572
+ else if (state.lineIndent < parentIndent) indentStatus = -1;
2573
+ } else allowBlockCollections = false;
2574
+ if (allowBlockCollections) allowBlockCollections = atNewLine || allowCompact;
2575
+ if (1 === indentStatus || CONTEXT_BLOCK_OUT === nodeContext) {
2576
+ if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) flowIndent = parentIndent;
2577
+ else flowIndent = parentIndent + 1;
2578
+ blockIndent = state.position - state.lineStart;
2579
+ if (1 === indentStatus) if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) hasContent = true;
2580
+ else {
2581
+ if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) hasContent = true;
2582
+ else if (readAlias(state)) {
2583
+ hasContent = true;
2584
+ if (null !== state.tag || null !== state.anchor) throwError(state, "alias node should not have any properties");
2585
+ } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
2586
+ hasContent = true;
2587
+ if (null === state.tag) state.tag = "?";
2588
+ }
2589
+ if (null !== state.anchor) {
2590
+ state.anchorMap[state.anchor] = state.result;
2591
+ state.result.anchorId = state.anchor;
2592
+ }
2593
+ }
2594
+ else if (0 === indentStatus) hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
2595
+ }
2596
+ if (null !== state.tag && "!" !== state.tag) if (state.tag == "!include") {
2597
+ if (!state.result) {
2598
+ state.result = ast.newScalar();
2599
+ state.result.startPosition = state.position;
2600
+ state.result.endPosition = state.position;
2601
+ throwError(state, "!include without value");
2602
+ }
2603
+ state.result.kind = ast.Kind.INCLUDE_REF;
2604
+ } else if ("?" === state.tag) for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
2605
+ type = state.implicitTypes[typeIndex];
2606
+ var vl = state.result["value"];
2607
+ if (type.resolve(vl)) {
2608
+ state.result.valueObject = type.construct(state.result["value"]);
2609
+ state.tag = type.tag;
2610
+ if (null !== state.anchor) {
2611
+ state.result.anchorId = state.anchor;
2612
+ state.anchorMap[state.anchor] = state.result;
2613
+ }
2614
+ break;
2615
+ }
2616
+ }
2617
+ else if (_hasOwnProperty$1.call(state.typeMap, state.tag)) {
2618
+ type = state.typeMap[state.tag];
2619
+ if (null !== state.result && type.kind !== state.kind) throwError(state, "unacceptable node kind for !<" + state.tag + "> tag; it should be \"" + type.kind + "\", not \"" + state.kind + "\"");
2620
+ if (!type.resolve(state.result)) throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
2621
+ else {
2622
+ state.result = type.construct(state.result);
2623
+ if (null !== state.anchor) {
2624
+ state.result.anchorId = state.anchor;
2625
+ state.anchorMap[state.anchor] = state.result;
2626
+ }
2627
+ }
2628
+ } else throwErrorFromPosition(state, tagStart, "unknown tag <" + state.tag + ">", false, true);
2629
+ return null !== state.tag || null !== state.anchor || hasContent;
2630
+ }
2631
+ function readDocument(state) {
2632
+ var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
2633
+ state.version = null;
2634
+ state.checkLineBreaks = state.legacy;
2635
+ state.tagMap = {};
2636
+ state.anchorMap = {};
2637
+ state.comments = [];
2638
+ while (0 !== (ch = state.input.charCodeAt(state.position))) {
2639
+ skipSeparationSpace(state, true, -1);
2640
+ ch = state.input.charCodeAt(state.position);
2641
+ if (state.lineIndent > 0 || 37 !== ch) break;
2642
+ hasDirectives = true;
2643
+ ch = state.input.charCodeAt(++state.position);
2644
+ _position = state.position;
2645
+ while (0 !== ch && !is_WS_OR_EOL(ch)) ch = state.input.charCodeAt(++state.position);
2646
+ directiveName = state.input.slice(_position, state.position);
2647
+ directiveArgs = [];
2648
+ if (directiveName.length < 1) throwError(state, "directive name must not be less than one character in length");
2649
+ while (0 !== ch) {
2650
+ while (is_WHITE_SPACE(ch)) ch = state.input.charCodeAt(++state.position);
2651
+ if (35 === ch) {
2652
+ readComment(state);
2653
+ ch = state.input.charCodeAt(state.position);
2654
+ break;
2655
+ }
2656
+ if (is_EOL(ch)) break;
2657
+ _position = state.position;
2658
+ while (0 !== ch && !is_WS_OR_EOL(ch)) ch = state.input.charCodeAt(++state.position);
2659
+ directiveArgs.push(state.input.slice(_position, state.position));
2660
+ }
2661
+ if (0 !== ch) readLineBreak(state);
2662
+ if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) directiveHandlers[directiveName](state, directiveName, directiveArgs);
2663
+ else {
2664
+ throwWarning(state, "unknown document directive \"" + directiveName + "\"");
2665
+ state.position++;
2666
+ }
2667
+ }
2668
+ skipSeparationSpace(state, true, -1);
2669
+ if (0 === state.lineIndent && 45 === state.input.charCodeAt(state.position) && 45 === state.input.charCodeAt(state.position + 1) && 45 === state.input.charCodeAt(state.position + 2)) {
2670
+ state.position += 3;
2671
+ skipSeparationSpace(state, true, -1);
2672
+ } else if (hasDirectives) throwError(state, "directives end mark is expected");
2673
+ composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
2674
+ skipSeparationSpace(state, true, -1);
2675
+ if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) throwWarning(state, "non-ASCII line breaks are interpreted as content");
2676
+ state.result.comments = state.comments;
2677
+ state.documents.push(state.result);
2678
+ if (state.position === state.lineStart && testDocumentSeparator(state)) {
2679
+ if (46 === state.input.charCodeAt(state.position)) {
2680
+ state.position += 3;
2681
+ skipSeparationSpace(state, true, -1);
2682
+ }
2683
+ return;
2684
+ }
2685
+ if (state.position < state.length - 1) throwError(state, "end of the stream or a document separator is expected");
2686
+ else return;
2687
+ }
2688
+ function loadDocuments(input, options) {
2689
+ input = String(input);
2690
+ options = options || {};
2691
+ let inputLength = input.length;
2692
+ if (inputLength !== 0) {
2693
+ if (10 !== input.charCodeAt(inputLength - 1) && 13 !== input.charCodeAt(inputLength - 1)) input += "\n";
2694
+ if (input.charCodeAt(0) === 65279) input = input.slice(1);
2695
+ }
2696
+ var state = new State$1(input, options);
2697
+ state.input += "\0";
2698
+ while (32 === state.input.charCodeAt(state.position)) {
2699
+ state.lineIndent += 1;
2700
+ state.position += 1;
2701
+ }
2702
+ while (state.position < state.length - 1) {
2703
+ var q = state.position;
2704
+ readDocument(state);
2705
+ if (state.position <= q) {
2706
+ for (; state.position < state.length - 1; state.position++) if (state.input.charAt(state.position) == "\n") break;
2707
+ }
2708
+ }
2709
+ let documents = state.documents;
2710
+ let docsCount = documents.length;
2711
+ if (docsCount > 0) documents[docsCount - 1].endPosition = inputLength;
2712
+ for (let x of documents) {
2713
+ x.errors = state.errors;
2714
+ if (x.startPosition > x.endPosition) x.startPosition = x.endPosition;
2715
+ }
2716
+ return documents;
2717
+ }
2718
+ function loadAll(input, iterator, options = {}) {
2719
+ var documents = loadDocuments(input, options), index, length;
2720
+ for (index = 0, length = documents.length; index < length; index += 1) iterator(documents[index]);
2721
+ }
2722
+ exports.loadAll = loadAll;
2723
+ function load(input, options = {}) {
2724
+ var documents = loadDocuments(input, options);
2725
+ if (0 === documents.length) return;
2726
+ else if (1 === documents.length) return documents[0];
2727
+ var e = new YAMLException$1("expected a single document in the stream, but found more");
2728
+ e.mark = new Mark("", "", 0, 0, 0);
2729
+ e.mark.position = documents[0].endPosition;
2730
+ documents[0].errors.push(e);
2731
+ return documents[0];
2732
+ }
2733
+ exports.load = load;
2734
+ function safeLoadAll(input, output, options = {}) {
2735
+ loadAll(input, output, common$1.extend({ schema: DEFAULT_SAFE_SCHEMA$1 }, options));
2736
+ }
2737
+ exports.safeLoadAll = safeLoadAll;
2738
+ function safeLoad(input, options = {}) {
2739
+ return load(input, common$1.extend({ schema: DEFAULT_SAFE_SCHEMA$1 }, options));
2740
+ }
2741
+ exports.safeLoad = safeLoad;
2742
+ module.exports.loadAll = loadAll;
2743
+ module.exports.load = load;
2744
+ module.exports.safeLoadAll = safeLoadAll;
2745
+ module.exports.safeLoad = safeLoad;
2746
+ }) });
2747
+
2748
+ //#endregion
2749
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/dumper.js
2750
+ var require_dumper = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/dumper.js": ((exports) => {
2751
+ Object.defineProperty(exports, "__esModule", { value: true });
2752
+ var common = require_common();
2753
+ var YAMLException = require_exception();
2754
+ var DEFAULT_FULL_SCHEMA = require_default_full();
2755
+ var DEFAULT_SAFE_SCHEMA = require_default_safe();
2756
+ var _toString = Object.prototype.toString;
2757
+ var _hasOwnProperty = Object.prototype.hasOwnProperty;
2758
+ var CHAR_TAB = 9;
2759
+ var CHAR_LINE_FEED = 10;
2760
+ var CHAR_CARRIAGE_RETURN = 13;
2761
+ var CHAR_SPACE = 32;
2762
+ var CHAR_EXCLAMATION = 33;
2763
+ var CHAR_DOUBLE_QUOTE = 34;
2764
+ var CHAR_SHARP = 35;
2765
+ var CHAR_PERCENT = 37;
2766
+ var CHAR_AMPERSAND = 38;
2767
+ var CHAR_SINGLE_QUOTE = 39;
2768
+ var CHAR_ASTERISK = 42;
2769
+ var CHAR_COMMA = 44;
2770
+ var CHAR_MINUS = 45;
2771
+ var CHAR_COLON = 58;
2772
+ var CHAR_EQUALS = 61;
2773
+ var CHAR_GREATER_THAN = 62;
2774
+ var CHAR_QUESTION = 63;
2775
+ var CHAR_COMMERCIAL_AT = 64;
2776
+ var CHAR_LEFT_SQUARE_BRACKET = 91;
2777
+ var CHAR_RIGHT_SQUARE_BRACKET = 93;
2778
+ var CHAR_GRAVE_ACCENT = 96;
2779
+ var CHAR_LEFT_CURLY_BRACKET = 123;
2780
+ var CHAR_VERTICAL_LINE = 124;
2781
+ var CHAR_RIGHT_CURLY_BRACKET = 125;
2782
+ var ESCAPE_SEQUENCES = {};
2783
+ ESCAPE_SEQUENCES[0] = "\\0";
2784
+ ESCAPE_SEQUENCES[7] = "\\a";
2785
+ ESCAPE_SEQUENCES[8] = "\\b";
2786
+ ESCAPE_SEQUENCES[9] = "\\t";
2787
+ ESCAPE_SEQUENCES[10] = "\\n";
2788
+ ESCAPE_SEQUENCES[11] = "\\v";
2789
+ ESCAPE_SEQUENCES[12] = "\\f";
2790
+ ESCAPE_SEQUENCES[13] = "\\r";
2791
+ ESCAPE_SEQUENCES[27] = "\\e";
2792
+ ESCAPE_SEQUENCES[34] = "\\\"";
2793
+ ESCAPE_SEQUENCES[92] = "\\\\";
2794
+ ESCAPE_SEQUENCES[133] = "\\N";
2795
+ ESCAPE_SEQUENCES[160] = "\\_";
2796
+ ESCAPE_SEQUENCES[8232] = "\\L";
2797
+ ESCAPE_SEQUENCES[8233] = "\\P";
2798
+ var DEPRECATED_BOOLEANS_SYNTAX = [
2799
+ "y",
2800
+ "Y",
2801
+ "yes",
2802
+ "Yes",
2803
+ "YES",
2804
+ "on",
2805
+ "On",
2806
+ "ON",
2807
+ "n",
2808
+ "N",
2809
+ "no",
2810
+ "No",
2811
+ "NO",
2812
+ "off",
2813
+ "Off",
2814
+ "OFF"
2815
+ ];
2816
+ function compileStyleMap(schema$2, map) {
2817
+ var result, keys, index, length, tag, style, type;
2818
+ if (map === null) return {};
2819
+ result = {};
2820
+ keys = Object.keys(map);
2821
+ for (index = 0, length = keys.length; index < length; index += 1) {
2822
+ tag = keys[index];
2823
+ style = String(map[tag]);
2824
+ if (tag.slice(0, 2) === "!!") tag = "tag:yaml.org,2002:" + tag.slice(2);
2825
+ type = schema$2.compiledTypeMap["fallback"][tag];
2826
+ if (type && _hasOwnProperty.call(type.styleAliases, style)) style = type.styleAliases[style];
2827
+ result[tag] = style;
2828
+ }
2829
+ return result;
2830
+ }
2831
+ function encodeHex(character) {
2832
+ var string = character.toString(16).toUpperCase(), handle, length;
2833
+ if (character <= 255) {
2834
+ handle = "x";
2835
+ length = 2;
2836
+ } else if (character <= 65535) {
2837
+ handle = "u";
2838
+ length = 4;
2839
+ } else if (character <= 4294967295) {
2840
+ handle = "U";
2841
+ length = 8;
2842
+ } else throw new YAMLException("code point within a string may not be greater than 0xFFFFFFFF");
2843
+ return "\\" + handle + common.repeat("0", length - string.length) + string;
2844
+ }
2845
+ function State(options) {
2846
+ this.schema = options["schema"] || DEFAULT_FULL_SCHEMA;
2847
+ this.indent = Math.max(1, options["indent"] || 2);
2848
+ this.noArrayIndent = options["noArrayIndent"] || false;
2849
+ this.skipInvalid = options["skipInvalid"] || false;
2850
+ this.flowLevel = common.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"];
2851
+ this.styleMap = compileStyleMap(this.schema, options["styles"] || null);
2852
+ this.sortKeys = options["sortKeys"] || false;
2853
+ this.lineWidth = options["lineWidth"] || 80;
2854
+ this.noRefs = options["noRefs"] || false;
2855
+ this.noCompatMode = options["noCompatMode"] || false;
2856
+ this.condenseFlow = options["condenseFlow"] || false;
2857
+ this.implicitTypes = this.schema.compiledImplicit;
2858
+ this.explicitTypes = this.schema.compiledExplicit;
2859
+ this.comments = options["comments"] || {};
2860
+ this.tag = null;
2861
+ this.result = "";
2862
+ this.duplicates = [];
2863
+ this.usedDuplicates = null;
2864
+ }
2865
+ function indentString(string, spaces) {
2866
+ var ind = common.repeat(" ", spaces), position = 0, next = -1, result = "", line, length = string.length;
2867
+ while (position < length) {
2868
+ next = string.indexOf("\n", position);
2869
+ if (next === -1) {
2870
+ line = string.slice(position);
2871
+ position = length;
2872
+ } else {
2873
+ line = string.slice(position, next + 1);
2874
+ position = next + 1;
2875
+ }
2876
+ if (line.length && line !== "\n") result += ind;
2877
+ result += line;
2878
+ }
2879
+ return result;
2880
+ }
2881
+ function generateNextLine(state, level) {
2882
+ return "\n" + common.repeat(" ", state.indent * level);
2883
+ }
2884
+ function testImplicitResolving(state, str) {
2885
+ var index, length, type;
2886
+ for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
2887
+ type = state.implicitTypes[index];
2888
+ if (type.resolve(str)) return true;
2889
+ }
2890
+ return false;
2891
+ }
2892
+ function isWhitespace(c) {
2893
+ return c === CHAR_SPACE || c === CHAR_TAB;
2894
+ }
2895
+ function isPrintable(c) {
2896
+ return 32 <= c && c <= 126 || 161 <= c && c <= 55295 && c !== 8232 && c !== 8233 || 57344 <= c && c <= 65533 && c !== 65279 || 65536 <= c && c <= 1114111;
2897
+ }
2898
+ function isNsChar(c) {
2899
+ return isPrintable(c) && !isWhitespace(c) && c !== 65279 && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
2900
+ }
2901
+ function isPlainSafe(c, prev) {
2902
+ return isPrintable(c) && c !== 65279 && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_COLON && (c !== CHAR_SHARP || prev && isNsChar(prev));
2903
+ }
2904
+ function isPlainSafeFirst(c) {
2905
+ return isPrintable(c) && c !== 65279 && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT;
2906
+ }
2907
+ function needIndentIndicator(string) {
2908
+ return /^\n* /.test(string);
2909
+ }
2910
+ var STYLE_PLAIN = 1, STYLE_SINGLE = 2, STYLE_LITERAL = 3, STYLE_FOLDED = 4, STYLE_DOUBLE = 5;
2911
+ function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) {
2912
+ var i$1;
2913
+ var char, prev_char;
2914
+ var hasLineBreak = false;
2915
+ var hasFoldableLine = false;
2916
+ var shouldTrackWidth = lineWidth !== -1;
2917
+ var previousLineBreak = -1;
2918
+ var plain = isPlainSafeFirst(string.charCodeAt(0)) && !isWhitespace(string.charCodeAt(string.length - 1));
2919
+ if (singleLineOnly) for (i$1 = 0; i$1 < string.length; i$1++) {
2920
+ char = string.charCodeAt(i$1);
2921
+ if (!isPrintable(char)) return STYLE_DOUBLE;
2922
+ prev_char = i$1 > 0 ? string.charCodeAt(i$1 - 1) : null;
2923
+ plain = plain && isPlainSafe(char, prev_char);
2924
+ }
2925
+ else {
2926
+ for (i$1 = 0; i$1 < string.length; i$1++) {
2927
+ char = string.charCodeAt(i$1);
2928
+ if (char === CHAR_LINE_FEED) {
2929
+ hasLineBreak = true;
2930
+ if (shouldTrackWidth) {
2931
+ hasFoldableLine = hasFoldableLine || i$1 - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
2932
+ previousLineBreak = i$1;
2933
+ }
2934
+ } else if (!isPrintable(char)) return STYLE_DOUBLE;
2935
+ prev_char = i$1 > 0 ? string.charCodeAt(i$1 - 1) : null;
2936
+ plain = plain && isPlainSafe(char, prev_char);
2937
+ }
2938
+ hasFoldableLine = hasFoldableLine || shouldTrackWidth && i$1 - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
2939
+ }
2940
+ if (!hasLineBreak && !hasFoldableLine) return plain && !testAmbiguousType(string) ? STYLE_PLAIN : STYLE_SINGLE;
2941
+ if (indentPerLevel > 9 && needIndentIndicator(string)) return STYLE_DOUBLE;
2942
+ return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
2943
+ }
2944
+ function writeScalar(state, string, level, iskey, pointer) {
2945
+ var _result = function() {
2946
+ if (string.length === 0) return "''";
2947
+ if (!state.noCompatMode && DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) return "'" + string + "'";
2948
+ var indent = state.indent * Math.max(1, level);
2949
+ var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
2950
+ var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel;
2951
+ function testAmbiguity(string$1) {
2952
+ return testImplicitResolving(state, string$1);
2953
+ }
2954
+ switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) {
2955
+ case STYLE_PLAIN: return string;
2956
+ case STYLE_SINGLE: return "'" + string.replace(/'/g, "''") + "'";
2957
+ case STYLE_LITERAL: return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent));
2958
+ case STYLE_FOLDED: return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
2959
+ case STYLE_DOUBLE: return "\"" + escapeString(string) + "\"";
2960
+ default: throw new YAMLException("impossible error: invalid scalar style");
2961
+ }
2962
+ }();
2963
+ if (!iskey) {
2964
+ let comment = new Comments$1(state, pointer).write(level, "before-eol");
2965
+ if (comment !== "") _result += " " + comment;
2966
+ }
2967
+ state.dump = _result;
2968
+ }
2969
+ function blockHeader(string, indentPerLevel) {
2970
+ var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
2971
+ var clip = string[string.length - 1] === "\n";
2972
+ return indentIndicator + (clip && (string[string.length - 2] === "\n" || string === "\n") ? "+" : clip ? "" : "-") + "\n";
2973
+ }
2974
+ function dropEndingNewline(string) {
2975
+ return string[string.length - 1] === "\n" ? string.slice(0, -1) : string;
2976
+ }
2977
+ function foldString(string, width) {
2978
+ var lineRe = /(\n+)([^\n]*)/g;
2979
+ var result = function() {
2980
+ var nextLF = string.indexOf("\n");
2981
+ nextLF = nextLF !== -1 ? nextLF : string.length;
2982
+ lineRe.lastIndex = nextLF;
2983
+ return foldLine(string.slice(0, nextLF), width);
2984
+ }();
2985
+ var prevMoreIndented = string[0] === "\n" || string[0] === " ";
2986
+ var moreIndented;
2987
+ var match;
2988
+ while (match = lineRe.exec(string)) {
2989
+ var prefix = match[1], line = match[2];
2990
+ moreIndented = line[0] === " ";
2991
+ result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width);
2992
+ prevMoreIndented = moreIndented;
2993
+ }
2994
+ return result;
2995
+ }
2996
+ function foldLine(line, width) {
2997
+ if (line === "" || line[0] === " ") return line;
2998
+ var breakRe = / [^ ]/g;
2999
+ var match;
3000
+ var start = 0, end, curr = 0, next = 0;
3001
+ var result = "";
3002
+ while (match = breakRe.exec(line)) {
3003
+ next = match.index;
3004
+ if (next - start > width) {
3005
+ end = curr > start ? curr : next;
3006
+ result += "\n" + line.slice(start, end);
3007
+ start = end + 1;
3008
+ }
3009
+ curr = next;
3010
+ }
3011
+ result += "\n";
3012
+ if (line.length - start > width && curr > start) result += line.slice(start, curr) + "\n" + line.slice(curr + 1);
3013
+ else result += line.slice(start);
3014
+ return result.slice(1);
3015
+ }
3016
+ function escapeString(string) {
3017
+ var result = "";
3018
+ var char, nextChar;
3019
+ var escapeSeq;
3020
+ for (var i$1 = 0; i$1 < string.length; i$1++) {
3021
+ char = string.charCodeAt(i$1);
3022
+ if (char >= 55296 && char <= 56319) {
3023
+ nextChar = string.charCodeAt(i$1 + 1);
3024
+ if (nextChar >= 56320 && nextChar <= 57343) {
3025
+ result += encodeHex((char - 55296) * 1024 + nextChar - 56320 + 65536);
3026
+ i$1++;
3027
+ continue;
3028
+ }
3029
+ }
3030
+ escapeSeq = ESCAPE_SEQUENCES[char];
3031
+ result += !escapeSeq && isPrintable(char) ? string[i$1] : escapeSeq || encodeHex(char);
3032
+ }
3033
+ return result;
3034
+ }
3035
+ function writeFlowSequence(state, level, object, pointer) {
3036
+ var _result = "", _tag = state.tag, index, length;
3037
+ for (index = 0, length = object.length; index < length; index += 1) if (writeNode(state, level, object[index], false, false, false, pointer)) {
3038
+ if (index !== 0) _result += "," + (!state.condenseFlow ? " " : "");
3039
+ _result += state.dump;
3040
+ }
3041
+ state.tag = _tag;
3042
+ state.dump = "[" + _result + "]";
3043
+ }
3044
+ function writeBlockSequence(state, level, object, compact, pointer) {
3045
+ var _result = "", _tag = state.tag, index, length;
3046
+ var comments = new Comments$1(state, pointer);
3047
+ _result += comments.write(level, "before-eol");
3048
+ _result += comments.write(level, "leading");
3049
+ for (index = 0, length = object.length; index < length; index += 1) {
3050
+ _result += comments.writeAt(String(index), level, "before");
3051
+ if (writeNode(state, level + 1, object[index], true, true, false, `${pointer}/${index}`)) {
3052
+ if (!compact || index !== 0) _result += generateNextLine(state, level);
3053
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) _result += "-";
3054
+ else _result += "- ";
3055
+ _result += state.dump;
3056
+ }
3057
+ _result += comments.writeAt(String(index), level, "after");
3058
+ }
3059
+ state.tag = _tag;
3060
+ state.dump = _result || "[]";
3061
+ state.dump += comments.write(level, "trailing");
3062
+ }
3063
+ function writeFlowMapping(state, level, object, pointer) {
3064
+ var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, pairBuffer;
3065
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
3066
+ pairBuffer = "";
3067
+ if (index !== 0) pairBuffer += ", ";
3068
+ if (state.condenseFlow) pairBuffer += "\"";
3069
+ objectKey = objectKeyList[index];
3070
+ objectValue = object[objectKey];
3071
+ if (!writeNode(state, level, objectKey, false, false, false, pointer)) continue;
3072
+ if (state.dump.length > 1024) pairBuffer += "? ";
3073
+ pairBuffer += state.dump + (state.condenseFlow ? "\"" : "") + ":" + (state.condenseFlow ? "" : " ");
3074
+ if (!writeNode(state, level, objectValue, false, false, false, pointer)) continue;
3075
+ pairBuffer += state.dump;
3076
+ _result += pairBuffer;
3077
+ }
3078
+ state.tag = _tag;
3079
+ state.dump = "{" + _result + "}";
3080
+ }
3081
+ function writeBlockMapping(state, level, object, compact, pointer) {
3082
+ var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, explicitPair, pairBuffer;
3083
+ if (state.sortKeys === true) objectKeyList.sort();
3084
+ else if (typeof state.sortKeys === "function") objectKeyList.sort(state.sortKeys);
3085
+ else if (state.sortKeys) throw new YAMLException("sortKeys must be a boolean or a function");
3086
+ var comments = new Comments$1(state, pointer);
3087
+ _result += comments.write(level, "before-eol");
3088
+ _result += comments.write(level, "leading");
3089
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
3090
+ pairBuffer = "";
3091
+ if (!compact || index !== 0) pairBuffer += generateNextLine(state, level);
3092
+ objectKey = objectKeyList[index];
3093
+ objectValue = object[objectKey];
3094
+ _result += comments.writeAt(objectKey, level, "before");
3095
+ if (!writeNode(state, level + 1, objectKey, true, true, true, pointer)) continue;
3096
+ explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024;
3097
+ if (explicitPair) if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) pairBuffer += "?";
3098
+ else pairBuffer += "? ";
3099
+ pairBuffer += state.dump;
3100
+ if (explicitPair) pairBuffer += generateNextLine(state, level);
3101
+ if (!writeNode(state, level + 1, objectValue, true, explicitPair, false, `${pointer}/${encodeSegment$1(objectKey)}`)) continue;
3102
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) pairBuffer += ":";
3103
+ else pairBuffer += ": ";
3104
+ pairBuffer += state.dump;
3105
+ _result += pairBuffer;
3106
+ _result += comments.writeAt(level, objectKey, "after");
3107
+ }
3108
+ state.tag = _tag;
3109
+ state.dump = _result || "{}";
3110
+ state.dump += comments.write(level, "trailing");
3111
+ }
3112
+ function detectType(state, object, explicit) {
3113
+ var _result, typeList = explicit ? state.explicitTypes : state.implicitTypes, index, length, type, style;
3114
+ for (index = 0, length = typeList.length; index < length; index += 1) {
3115
+ type = typeList[index];
3116
+ if ((type.instanceOf || type.predicate) && (!type.instanceOf || typeof object === "object" && object instanceof type.instanceOf) && (!type.predicate || type.predicate(object))) {
3117
+ state.tag = explicit ? type.tag : "?";
3118
+ if (type.represent) {
3119
+ style = state.styleMap[type.tag] || type.defaultStyle;
3120
+ if (_toString.call(type.represent) === "[object Function]") _result = type.represent(object, style);
3121
+ else if (_hasOwnProperty.call(type.represent, style)) _result = type.represent[style](object, style);
3122
+ else throw new YAMLException("!<" + type.tag + "> tag resolver accepts not \"" + style + "\" style");
3123
+ state.dump = _result;
3124
+ }
3125
+ return true;
3126
+ }
3127
+ }
3128
+ return false;
3129
+ }
3130
+ function writeNode(state, level, object, block, compact, iskey, pointer) {
3131
+ state.tag = null;
3132
+ state.dump = object;
3133
+ if (!detectType(state, object, false)) detectType(state, object, true);
3134
+ var type = _toString.call(state.dump);
3135
+ if (block) block = state.flowLevel < 0 || state.flowLevel > level;
3136
+ if (state.tag !== null && state.tag !== "?" || state.indent !== 2 && level > 0) compact = false;
3137
+ var objectOrArray = type === "[object Object]" || type === "[object Array]", duplicateIndex, duplicate;
3138
+ if (objectOrArray) {
3139
+ duplicateIndex = state.duplicates.indexOf(object);
3140
+ duplicate = duplicateIndex !== -1;
3141
+ }
3142
+ if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) compact = false;
3143
+ if (duplicate && state.usedDuplicates[duplicateIndex]) state.dump = "*ref_" + duplicateIndex;
3144
+ else {
3145
+ if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) state.usedDuplicates[duplicateIndex] = true;
3146
+ if (type === "[object Object]") if (block && Object.keys(state.dump).length !== 0) {
3147
+ writeBlockMapping(state, level, state.dump, compact, pointer);
3148
+ if (duplicate) state.dump = "&ref_" + duplicateIndex + state.dump;
3149
+ } else {
3150
+ writeFlowMapping(state, level, state.dump, pointer);
3151
+ if (duplicate) state.dump = "&ref_" + duplicateIndex + " " + state.dump;
3152
+ }
3153
+ else if (type === "[object Array]") {
3154
+ var arrayLevel = state.noArrayIndent && level > 0 ? level - 1 : level;
3155
+ if (block && state.dump.length !== 0) {
3156
+ writeBlockSequence(state, arrayLevel, state.dump, compact, pointer);
3157
+ if (duplicate) state.dump = "&ref_" + duplicateIndex + state.dump;
3158
+ } else {
3159
+ writeFlowSequence(state, arrayLevel, state.dump, pointer);
3160
+ if (duplicate) state.dump = "&ref_" + duplicateIndex + " " + state.dump;
3161
+ }
3162
+ } else if (type === "[object String]") {
3163
+ if (state.tag !== "?") writeScalar(state, state.dump, level, iskey, pointer);
3164
+ } else {
3165
+ if (state.skipInvalid) return false;
3166
+ throw new YAMLException("unacceptable kind of an object to dump " + type);
3167
+ }
3168
+ if (state.tag !== null && state.tag !== "?") state.dump = "!<" + state.tag + "> " + state.dump;
3169
+ }
3170
+ return true;
3171
+ }
3172
+ function getDuplicateReferences(object, state) {
3173
+ var objects = [], duplicatesIndexes = [], index, length;
3174
+ inspectNode(object, objects, duplicatesIndexes);
3175
+ for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) state.duplicates.push(objects[duplicatesIndexes[index]]);
3176
+ state.usedDuplicates = new Array(length);
3177
+ }
3178
+ function inspectNode(object, objects, duplicatesIndexes) {
3179
+ var objectKeyList, index, length;
3180
+ if (object !== null && typeof object === "object") {
3181
+ index = objects.indexOf(object);
3182
+ if (index !== -1) {
3183
+ if (duplicatesIndexes.indexOf(index) === -1) duplicatesIndexes.push(index);
3184
+ } else {
3185
+ objects.push(object);
3186
+ if (Array.isArray(object)) for (index = 0, length = object.length; index < length; index += 1) inspectNode(object[index], objects, duplicatesIndexes);
3187
+ else {
3188
+ objectKeyList = Object.keys(object);
3189
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
3190
+ }
3191
+ }
3192
+ }
3193
+ }
3194
+ function dump(input, options) {
3195
+ options = options || {};
3196
+ var state = new State(options);
3197
+ if (!options.noRefs) getDuplicateReferences(input, state);
3198
+ if (writeNode(state, 0, input, true, true, false, "#")) return state.dump + "\n";
3199
+ return "";
3200
+ }
3201
+ exports.dump = dump;
3202
+ function safeDump(input, options) {
3203
+ return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
3204
+ }
3205
+ exports.safeDump = safeDump;
3206
+ const TILDE_REGEXP$1 = /~/g;
3207
+ const SLASH_REGEXP$1 = /\//g;
3208
+ function encodeSegment$1(input) {
3209
+ return input.replace(TILDE_REGEXP$1, "~0").replace(SLASH_REGEXP$1, "~1");
3210
+ }
3211
+ function Comments$1(state, pointer) {
3212
+ this.state = state;
3213
+ this.comments = {
3214
+ "before-eol": /* @__PURE__ */ new Set(),
3215
+ leading: /* @__PURE__ */ new Set(),
3216
+ trailing: /* @__PURE__ */ new Set(),
3217
+ before: /* @__PURE__ */ new Map(),
3218
+ after: /* @__PURE__ */ new Map()
3219
+ };
3220
+ this.written = /* @__PURE__ */ new WeakSet();
3221
+ if (state.comments !== null && pointer in state.comments) for (let comment of state.comments[pointer]) switch (comment.placement) {
3222
+ case "before-eol":
3223
+ case "leading":
3224
+ case "trailing":
3225
+ this.comments[comment.placement].add(comment);
3226
+ break;
3227
+ case "between":
3228
+ let before = this.comments.before.get(comment.between[1]);
3229
+ if (!before) this.comments.before.set(comment.between[1], new Set([comment]));
3230
+ else before.add(comment);
3231
+ let after = this.comments.after.get(comment.between[0]);
3232
+ if (!after) this.comments.after.set(comment.between[0], new Set([comment]));
3233
+ else after.add(comment);
3234
+ break;
3235
+ }
3236
+ }
3237
+ Comments$1.prototype.write = function(level, placement) {
3238
+ let result = "";
3239
+ for (let comment of this.comments[placement]) result += this._write(comment, level);
3240
+ return result;
3241
+ };
3242
+ Comments$1.prototype.writeAt = function(key, level, placement) {
3243
+ let result = "";
3244
+ let comments = this.comments[placement].get(key);
3245
+ if (comments) for (let comment of comments) result += this._write(comment, level);
3246
+ return result;
3247
+ };
3248
+ Comments$1.prototype._write = function(comment, level) {
3249
+ if (this.written.has(comment)) return "";
3250
+ this.written.add(comment);
3251
+ let result = "#" + comment.value;
3252
+ if (comment.placement === "before-eol") return result;
3253
+ else if (level === 0 && comment.placement === "leading") return result + "\n";
3254
+ else return generateNextLine(this.state, level) + result;
3255
+ };
3256
+ }) });
3257
+
3258
+ //#endregion
3259
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/scalarInference.js
3260
+ var require_scalarInference = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/scalarInference.js": ((exports) => {
3261
+ Object.defineProperty(exports, "__esModule", { value: true });
3262
+ function parseYamlBoolean(input) {
3263
+ if ([
3264
+ "true",
3265
+ "True",
3266
+ "TRUE"
3267
+ ].lastIndexOf(input) >= 0) return true;
3268
+ else if ([
3269
+ "false",
3270
+ "False",
3271
+ "FALSE"
3272
+ ].lastIndexOf(input) >= 0) return false;
3273
+ throw `Invalid boolean "${input}"`;
3274
+ }
3275
+ exports.parseYamlBoolean = parseYamlBoolean;
3276
+ function safeParseYamlInteger(input) {
3277
+ if (input.lastIndexOf("0o", 0) === 0) return parseInt(input.substring(2), 8);
3278
+ return parseInt(input);
3279
+ }
3280
+ function parseYamlInteger(input) {
3281
+ const result = safeParseYamlInteger(input);
3282
+ if (Number.isNaN(result)) throw `Invalid integer "${input}"`;
3283
+ return result;
3284
+ }
3285
+ exports.parseYamlInteger = parseYamlInteger;
3286
+ function parseYamlBigInteger(input) {
3287
+ const result = parseYamlInteger(input);
3288
+ if (result > Number.MAX_SAFE_INTEGER && input.lastIndexOf("0o", 0) === -1) return BigInt(input);
3289
+ return result;
3290
+ }
3291
+ exports.parseYamlBigInteger = parseYamlBigInteger;
3292
+ function parseYamlFloat(input) {
3293
+ if ([
3294
+ ".nan",
3295
+ ".NaN",
3296
+ ".NAN"
3297
+ ].lastIndexOf(input) >= 0) return NaN;
3298
+ const match = /^([-+])?(?:\.inf|\.Inf|\.INF)$/.exec(input);
3299
+ if (match) return match[1] === "-" ? -Infinity : Infinity;
3300
+ const result = parseFloat(input);
3301
+ if (!isNaN(result)) return result;
3302
+ throw `Invalid float "${input}"`;
3303
+ }
3304
+ exports.parseYamlFloat = parseYamlFloat;
3305
+ var ScalarType;
3306
+ (function(ScalarType$1) {
3307
+ ScalarType$1[ScalarType$1["null"] = 0] = "null";
3308
+ ScalarType$1[ScalarType$1["bool"] = 1] = "bool";
3309
+ ScalarType$1[ScalarType$1["int"] = 2] = "int";
3310
+ ScalarType$1[ScalarType$1["float"] = 3] = "float";
3311
+ ScalarType$1[ScalarType$1["string"] = 4] = "string";
3312
+ })(ScalarType = exports.ScalarType || (exports.ScalarType = {}));
3313
+ function determineScalarType(node) {
3314
+ if (node === void 0) return ScalarType.null;
3315
+ if (node.doubleQuoted || !node.plainScalar || node["singleQuoted"]) return ScalarType.string;
3316
+ const value = node.value;
3317
+ if ([
3318
+ "null",
3319
+ "Null",
3320
+ "NULL",
3321
+ "~",
3322
+ ""
3323
+ ].indexOf(value) >= 0) return ScalarType.null;
3324
+ if (value === null || value === void 0) return ScalarType.null;
3325
+ if ([
3326
+ "true",
3327
+ "True",
3328
+ "TRUE",
3329
+ "false",
3330
+ "False",
3331
+ "FALSE"
3332
+ ].indexOf(value) >= 0) return ScalarType.bool;
3333
+ if (/^[-+]?[0-9]+$/.test(value) || /^0o[0-7]+$/.test(value) || /^0x[0-9a-fA-F]+$/.test(value)) return ScalarType.int;
3334
+ if (/^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$/.test(value) || /^[-+]?(\.inf|\.Inf|\.INF)$/.test(value) || [
3335
+ ".nan",
3336
+ ".NaN",
3337
+ ".NAN"
3338
+ ].indexOf(value) >= 0) return ScalarType.float;
3339
+ return ScalarType.string;
3340
+ }
3341
+ exports.determineScalarType = determineScalarType;
3342
+ }) });
3343
+
3344
+ //#endregion
3345
+ //#region ../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/index.js
3346
+ var require_src$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml-ast-parser@0.0.50/node_modules/@stoplight/yaml-ast-parser/dist/src/index.js": ((exports) => {
3347
+ function __export(m) {
3348
+ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
3349
+ }
3350
+ Object.defineProperty(exports, "__esModule", { value: true });
3351
+ var loader_1 = require_loader();
3352
+ exports.load = loader_1.load;
3353
+ exports.loadAll = loader_1.loadAll;
3354
+ exports.safeLoad = loader_1.safeLoad;
3355
+ exports.safeLoadAll = loader_1.safeLoadAll;
3356
+ var dumper_1 = require_dumper();
3357
+ exports.dump = dumper_1.dump;
3358
+ exports.safeDump = dumper_1.safeDump;
3359
+ exports.YAMLException = require_exception();
3360
+ __export(require_yamlAST());
3361
+ __export(require_scalarInference());
3362
+ }) });
3363
+
3364
+ //#endregion
3365
+ //#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/types.js
3366
+ var require_types = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/types.js": ((exports) => {
3367
+ Object.defineProperty(exports, "__esModule", { value: true });
3368
+ const yaml_ast_parser_1$2 = require_src$1();
3369
+ exports.Kind = yaml_ast_parser_1$2.Kind;
3370
+ exports.ScalarType = yaml_ast_parser_1$2.ScalarType;
3371
+ }) });
3372
+
3373
+ //#endregion
3374
+ //#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/utils.js
3375
+ var require_utils = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/utils.js": ((exports) => {
3376
+ Object.defineProperty(exports, "__esModule", { value: true });
3377
+ exports.isObject = (sth) => sth !== null && typeof sth === "object";
3378
+ }) });
3379
+
3380
+ //#endregion
3381
+ //#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/buildJsonPath.js
3382
+ var require_buildJsonPath = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/buildJsonPath.js": ((exports) => {
3383
+ Object.defineProperty(exports, "__esModule", { value: true });
3384
+ const types_1$4 = require_types();
3385
+ const utils_1$4 = require_utils();
3386
+ function buildJsonPath(node) {
3387
+ const path$1 = [];
3388
+ let prevNode = node;
3389
+ while (node) {
3390
+ switch (node.kind) {
3391
+ case types_1$4.Kind.SCALAR:
3392
+ path$1.unshift(node.value);
3393
+ break;
3394
+ case types_1$4.Kind.MAPPING:
3395
+ if (prevNode !== node.key) if (path$1.length > 0 && utils_1$4.isObject(node.value) && node.value.value === path$1[0]) path$1[0] = node.key.value;
3396
+ else path$1.unshift(node.key.value);
3397
+ break;
3398
+ case types_1$4.Kind.SEQ:
3399
+ if (prevNode) {
3400
+ const index = node.items.indexOf(prevNode);
3401
+ if (prevNode.kind === types_1$4.Kind.SCALAR) path$1[0] = index;
3402
+ else if (index !== -1) path$1.unshift(index);
3403
+ }
3404
+ break;
3405
+ }
3406
+ prevNode = node;
3407
+ node = node.parent;
3408
+ }
3409
+ return path$1;
3410
+ }
3411
+ exports.buildJsonPath = buildJsonPath;
3412
+ }) });
3413
+
3414
+ //#endregion
3415
+ //#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/dereferenceAnchor.js
3416
+ var require_dereferenceAnchor = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/dereferenceAnchor.js": ((exports) => {
3417
+ Object.defineProperty(exports, "__esModule", { value: true });
3418
+ const types_1$3 = require_types();
3419
+ const utils_1$3 = require_utils();
3420
+ exports.dereferenceAnchor = (node, anchorId) => {
3421
+ if (!utils_1$3.isObject(node)) return node;
3422
+ if (node.kind === types_1$3.Kind.ANCHOR_REF && node.referencesAnchor === anchorId) return null;
3423
+ switch (node.kind) {
3424
+ case types_1$3.Kind.MAP: return Object.assign({}, node, { mappings: node.mappings.map((mapping) => exports.dereferenceAnchor(mapping, anchorId)) });
3425
+ case types_1$3.Kind.SEQ: return Object.assign({}, node, { items: node.items.map((item) => exports.dereferenceAnchor(item, anchorId)) });
3426
+ case types_1$3.Kind.MAPPING: return Object.assign({}, node, { value: exports.dereferenceAnchor(node.value, anchorId) });
3427
+ case types_1$3.Kind.SCALAR: return node;
3428
+ case types_1$3.Kind.ANCHOR_REF:
3429
+ if (utils_1$3.isObject(node.value) && isSelfReferencingAnchorRef(node)) return null;
3430
+ return node;
3431
+ default: return node;
3432
+ }
3433
+ };
3434
+ const isSelfReferencingAnchorRef = (anchorRef) => {
3435
+ const { referencesAnchor } = anchorRef;
3436
+ let node = anchorRef;
3437
+ while (node = node.parent) if ("anchorId" in node && node.anchorId === referencesAnchor) return true;
3438
+ return false;
3439
+ };
3440
+ }) });
3441
+
3442
+ //#endregion
3443
+ //#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/getJsonPathForPosition.js
3444
+ var require_getJsonPathForPosition = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/getJsonPathForPosition.js": ((exports) => {
3445
+ Object.defineProperty(exports, "__esModule", { value: true });
3446
+ const buildJsonPath_1$1 = require_buildJsonPath();
3447
+ const types_1$2 = require_types();
3448
+ const utils_1$2 = require_utils();
3449
+ exports.getJsonPathForPosition = ({ ast: ast$3, lineMap }, { line, character }) => {
3450
+ if (line >= lineMap.length || character >= lineMap[line]) return;
3451
+ const startOffset = line === 0 ? 0 : lineMap[line - 1] + 1;
3452
+ const node = findClosestScalar(ast$3, Math.min(lineMap[line] - 1, startOffset + character), line, lineMap);
3453
+ if (!utils_1$2.isObject(node)) return;
3454
+ const path$1 = buildJsonPath_1$1.buildJsonPath(node);
3455
+ if (path$1.length === 0) return;
3456
+ return path$1;
3457
+ };
3458
+ function* walk(node) {
3459
+ switch (node.kind) {
3460
+ case types_1$2.Kind.MAP:
3461
+ if (node.mappings.length !== 0) {
3462
+ for (const mapping of node.mappings) if (utils_1$2.isObject(mapping)) yield mapping;
3463
+ }
3464
+ break;
3465
+ case types_1$2.Kind.MAPPING:
3466
+ if (utils_1$2.isObject(node.key)) yield node.key;
3467
+ if (utils_1$2.isObject(node.value)) yield node.value;
3468
+ break;
3469
+ case types_1$2.Kind.SEQ:
3470
+ if (node.items.length !== 0) {
3471
+ for (const item of node.items) if (utils_1$2.isObject(item)) yield item;
3472
+ }
3473
+ break;
3474
+ case types_1$2.Kind.SCALAR:
3475
+ yield node;
3476
+ break;
3477
+ }
3478
+ }
3479
+ function getFirstScalarChild(node, line, lineMap) {
3480
+ const startOffset = lineMap[line - 1] + 1;
3481
+ const endOffset = lineMap[line];
3482
+ switch (node.kind) {
3483
+ case types_1$2.Kind.MAPPING: return node.key;
3484
+ case types_1$2.Kind.MAP:
3485
+ if (node.mappings.length !== 0) {
3486
+ for (const mapping of node.mappings) if (mapping.startPosition > startOffset && mapping.startPosition <= endOffset) return getFirstScalarChild(mapping, line, lineMap);
3487
+ }
3488
+ break;
3489
+ case types_1$2.Kind.SEQ:
3490
+ if (node.items.length !== 0) {
3491
+ for (const item of node.items) if (item !== null && item.startPosition > startOffset && item.startPosition <= endOffset) return getFirstScalarChild(item, line, lineMap);
3492
+ }
3493
+ break;
3494
+ }
3495
+ return node;
3496
+ }
3497
+ function findClosestScalar(container, offset, line, lineMap) {
3498
+ for (const node of walk(container)) if (node.startPosition <= offset && offset <= node.endPosition) return node.kind === types_1$2.Kind.SCALAR ? node : findClosestScalar(node, offset, line, lineMap);
3499
+ if (lineMap[line - 1] === lineMap[line] - 1) return container;
3500
+ if (container.startPosition < lineMap[line - 1] && offset <= container.endPosition) {
3501
+ if (container.kind !== types_1$2.Kind.MAPPING) return getFirstScalarChild(container, line, lineMap);
3502
+ if (container.value && container.key.endPosition < offset) return getFirstScalarChild(container.value, line, lineMap);
3503
+ }
3504
+ return container;
3505
+ }
3506
+ }) });
3507
+
3508
+ //#endregion
3509
+ //#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/lineForPosition.js
3510
+ var require_lineForPosition = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/lineForPosition.js": ((exports) => {
3511
+ Object.defineProperty(exports, "__esModule", { value: true });
3512
+ exports.lineForPosition = (pos, lines, start = 0, end) => {
3513
+ if (pos === 0 || lines.length === 0 || pos < lines[0]) return 0;
3514
+ if (typeof end === "undefined") end = lines.length;
3515
+ const target = Math.floor((end - start) / 2) + start;
3516
+ if (pos >= lines[target] && !lines[target + 1]) return target + 1;
3517
+ const nextLinePos = lines[Math.min(target + 1, lines.length)];
3518
+ if (pos === lines[target] - 1) return target;
3519
+ if (pos >= lines[target] && pos <= nextLinePos) {
3520
+ if (pos === nextLinePos) return target + 2;
3521
+ return target + 1;
3522
+ }
3523
+ if (pos > lines[target]) return exports.lineForPosition(pos, lines, target + 1, end);
3524
+ else return exports.lineForPosition(pos, lines, start, target - 1);
3525
+ };
3526
+ }) });
3527
+
3528
+ //#endregion
3529
+ //#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/getLocationForJsonPath.js
3530
+ var require_getLocationForJsonPath = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/getLocationForJsonPath.js": ((exports) => {
3531
+ Object.defineProperty(exports, "__esModule", { value: true });
3532
+ const lineForPosition_1$1 = require_lineForPosition();
3533
+ const types_1$1 = require_types();
3534
+ const utils_1$1 = require_utils();
3535
+ exports.getLocationForJsonPath = ({ ast: ast$3, lineMap, metadata }, path$1, closest = false) => {
3536
+ const node = findNodeAtPath(ast$3, path$1, {
3537
+ closest,
3538
+ mergeKeys: metadata !== void 0 && metadata.mergeKeys === true
3539
+ });
3540
+ if (node === void 0) return;
3541
+ return getLoc(lineMap, {
3542
+ start: getStartPosition(node, lineMap.length > 0 ? lineMap[0] : 0),
3543
+ end: getEndPosition(node)
3544
+ });
3545
+ };
3546
+ function getStartPosition(node, offset) {
3547
+ if (node.parent && node.parent.kind === types_1$1.Kind.MAPPING) {
3548
+ if (node.parent.value === null) return node.parent.endPosition;
3549
+ if (node.kind !== types_1$1.Kind.SCALAR) return node.parent.key.endPosition + 1;
3550
+ }
3551
+ if (node.parent === null && offset - node.startPosition === 0) return 0;
3552
+ return node.startPosition;
3553
+ }
3554
+ function getEndPosition(node) {
3555
+ switch (node.kind) {
3556
+ case types_1$1.Kind.SEQ:
3557
+ const { items } = node;
3558
+ if (items.length !== 0) {
3559
+ const lastItem = items[items.length - 1];
3560
+ if (lastItem !== null) return getEndPosition(lastItem);
3561
+ }
3562
+ break;
3563
+ case types_1$1.Kind.MAPPING:
3564
+ if (node.value !== null) return getEndPosition(node.value);
3565
+ break;
3566
+ case types_1$1.Kind.MAP:
3567
+ if (node.value !== null && node.mappings.length !== 0) return getEndPosition(node.mappings[node.mappings.length - 1]);
3568
+ break;
3569
+ case types_1$1.Kind.SCALAR:
3570
+ if (node.parent !== null && node.parent.kind === types_1$1.Kind.MAPPING && node.parent.value === null) return node.parent.endPosition;
3571
+ break;
3572
+ }
3573
+ return node.endPosition;
3574
+ }
3575
+ function findNodeAtPath(node, path$1, { closest, mergeKeys }) {
3576
+ pathLoop: for (const segment of path$1) {
3577
+ if (!utils_1$1.isObject(node)) return closest ? node : void 0;
3578
+ switch (node.kind) {
3579
+ case types_1$1.Kind.MAP:
3580
+ const mappings = getMappings(node.mappings, mergeKeys);
3581
+ for (let i$1 = mappings.length - 1; i$1 >= 0; i$1--) {
3582
+ const item = mappings[i$1];
3583
+ if (item.key.value === segment) {
3584
+ if (item.value === null) node = item.key;
3585
+ else node = item.value;
3586
+ continue pathLoop;
3587
+ }
3588
+ }
3589
+ return closest ? node : void 0;
3590
+ case types_1$1.Kind.SEQ:
3591
+ for (let i$1 = 0; i$1 < node.items.length; i$1++) if (i$1 === Number(segment)) {
3592
+ const item = node.items[i$1];
3593
+ if (item === null) break;
3594
+ node = item;
3595
+ continue pathLoop;
3596
+ }
3597
+ return closest ? node : void 0;
3598
+ default: return closest ? node : void 0;
3599
+ }
3600
+ }
3601
+ return node;
3602
+ }
3603
+ function getMappings(mappings, mergeKeys) {
3604
+ if (!mergeKeys) return mappings;
3605
+ return mappings.reduce((mergedMappings, mapping) => {
3606
+ if (utils_1$1.isObject(mapping)) if (mapping.key.value === "<<") mergedMappings.push(...reduceMergeKeys$1(mapping.value));
3607
+ else mergedMappings.push(mapping);
3608
+ return mergedMappings;
3609
+ }, []);
3610
+ }
3611
+ function reduceMergeKeys$1(node) {
3612
+ if (!utils_1$1.isObject(node)) return [];
3613
+ switch (node.kind) {
3614
+ case types_1$1.Kind.SEQ: return node.items.reduceRight((items, item) => {
3615
+ items.push(...reduceMergeKeys$1(item));
3616
+ return items;
3617
+ }, []);
3618
+ case types_1$1.Kind.MAP: return node.mappings;
3619
+ case types_1$1.Kind.ANCHOR_REF: return reduceMergeKeys$1(node.value);
3620
+ default: return [];
3621
+ }
3622
+ }
3623
+ const getLoc = (lineMap, { start = 0, end = 0 }) => {
3624
+ const startLine = lineForPosition_1$1.lineForPosition(start, lineMap);
3625
+ const endLine = lineForPosition_1$1.lineForPosition(end, lineMap);
3626
+ return { range: {
3627
+ start: {
3628
+ line: startLine,
3629
+ character: start - (startLine === 0 ? 0 : lineMap[startLine - 1])
3630
+ },
3631
+ end: {
3632
+ line: endLine,
3633
+ character: end - (endLine === 0 ? 0 : lineMap[endLine - 1])
3634
+ }
3635
+ } };
3636
+ };
3637
+ }) });
22
3638
 
23
3639
  //#endregion
24
- let oas_utils = require("oas/utils");
25
- oas_utils = __toESM(oas_utils);
26
- let jsonpointer = require("jsonpointer");
27
- jsonpointer = __toESM(jsonpointer);
28
- let oas = require("oas");
29
- oas = __toESM(oas);
30
- let oas_normalize = require("oas-normalize");
31
- oas_normalize = __toESM(oas_normalize);
32
- let oas_types = require("oas/types");
33
- oas_types = __toESM(oas_types);
34
- let remeda = require("remeda");
35
- remeda = __toESM(remeda);
36
- let swagger2openapi = require("swagger2openapi");
37
- swagger2openapi = __toESM(swagger2openapi);
3640
+ //#region ../../node_modules/.pnpm/@stoplight+ordered-object-literal@1.0.5/node_modules/@stoplight/ordered-object-literal/src/index.cjs
3641
+ var require_src = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+ordered-object-literal@1.0.5/node_modules/@stoplight/ordered-object-literal/src/index.cjs": ((exports) => {
3642
+ Object.defineProperty(exports, "__esModule", { value: true });
3643
+ const ORDER_KEY_ID = `__object_order_${Math.floor(Date.now() / 36e5)}__`;
3644
+ const ORDER_KEY = Symbol.for(ORDER_KEY_ID);
3645
+ const STRINGIFIED_ORDER_KEY = String(ORDER_KEY);
3646
+ const traps$1 = {
3647
+ defineProperty(target, key, descriptor) {
3648
+ if (!Object.prototype.hasOwnProperty.call(target, key) && ORDER_KEY in target) target[ORDER_KEY].push(key);
3649
+ else if ("value" in descriptor && key === ORDER_KEY && descriptor.value.lastIndexOf(ORDER_KEY) === -1) descriptor.value.push(ORDER_KEY);
3650
+ return Reflect.defineProperty(target, key, descriptor);
3651
+ },
3652
+ deleteProperty(target, key) {
3653
+ const hasKey = Object.prototype.hasOwnProperty.call(target, key);
3654
+ const deleted = Reflect.deleteProperty(target, key);
3655
+ if (deleted && hasKey && ORDER_KEY in target) {
3656
+ const index = target[ORDER_KEY].indexOf(key);
3657
+ if (index !== -1) target[ORDER_KEY].splice(index, 1);
3658
+ }
3659
+ return deleted;
3660
+ },
3661
+ ownKeys(target) {
3662
+ if (ORDER_KEY in target) return target[ORDER_KEY];
3663
+ return Reflect.ownKeys(target);
3664
+ },
3665
+ set(target, key, value) {
3666
+ const hasKey = Object.prototype.hasOwnProperty.call(target, key);
3667
+ const set = Reflect.set(target, key, value);
3668
+ if (set && !hasKey && ORDER_KEY in target) target[ORDER_KEY].push(key);
3669
+ return set;
3670
+ }
3671
+ };
3672
+ function createObj(target, order = Reflect.ownKeys(target)) {
3673
+ assertObjectLiteral(target);
3674
+ const t = new Proxy(target, traps$1);
3675
+ setOrder(t, order);
3676
+ return t;
3677
+ }
3678
+ function setOrder(target, order) {
3679
+ if (ORDER_KEY in target) {
3680
+ target[ORDER_KEY].length = 0;
3681
+ target[ORDER_KEY].push(...order);
3682
+ return true;
3683
+ } else return Reflect.defineProperty(target, ORDER_KEY, {
3684
+ configurable: true,
3685
+ value: order
3686
+ });
3687
+ }
3688
+ function getOrder(target) {
3689
+ return target[ORDER_KEY];
3690
+ }
3691
+ function serializeArray(target) {
3692
+ const newTarget = target.slice();
3693
+ for (let i$1 = 0; i$1 < newTarget.length; i$1 += 1) {
3694
+ const value = newTarget[i$1];
3695
+ if (isObject(value)) newTarget[i$1] = Array.isArray(value) ? serializeArray(value) : serialize(value, true);
3696
+ }
3697
+ return newTarget;
3698
+ }
3699
+ function serialize(target, deep) {
3700
+ assertObjectLiteral(target, "Invalid target provided");
3701
+ const newTarget = { ...target };
3702
+ if (ORDER_KEY in target) Object.defineProperty(newTarget, STRINGIFIED_ORDER_KEY, {
3703
+ enumerable: true,
3704
+ value: target[ORDER_KEY].filter((item) => item !== ORDER_KEY)
3705
+ });
3706
+ if (deep) for (const key of Object.keys(target)) {
3707
+ if (key === STRINGIFIED_ORDER_KEY) continue;
3708
+ const value = target[key];
3709
+ if (isObject(value)) newTarget[key] = Array.isArray(value) ? serializeArray(value) : serialize(value, true);
3710
+ }
3711
+ return newTarget;
3712
+ }
3713
+ function deserializeArray(target) {
3714
+ for (let i$1 = 0; i$1 < target.length; i$1 += 1) {
3715
+ const value = target[i$1];
3716
+ if (isObject(value)) target[i$1] = Array.isArray(value) ? deserializeArray(value) : deserialize(value, true);
3717
+ }
3718
+ return target;
3719
+ }
3720
+ function deserialize(target, deep) {
3721
+ assertObjectLiteral(target, "Invalid target provided");
3722
+ const newTarget = createObj(target, STRINGIFIED_ORDER_KEY in target ? target[STRINGIFIED_ORDER_KEY] : Reflect.ownKeys(target));
3723
+ delete newTarget[STRINGIFIED_ORDER_KEY];
3724
+ if (deep) for (const key of Object.keys(target)) {
3725
+ const value = target[key];
3726
+ if (isObject(value)) target[key] = Array.isArray(value) ? deserializeArray(value) : deserialize(value, true);
3727
+ }
3728
+ return newTarget;
3729
+ }
3730
+ function isOrderedObject(target) {
3731
+ return ORDER_KEY in target;
3732
+ }
3733
+ function isObject(maybeObj) {
3734
+ return maybeObj !== null && typeof maybeObj === "object";
3735
+ }
3736
+ function isObjectLiteral(obj) {
3737
+ if (!isObject(obj)) return false;
3738
+ if (obj[Symbol.toStringTag] !== void 0) {
3739
+ const proto = Object.getPrototypeOf(obj);
3740
+ return proto === null || proto === Object.prototype;
3741
+ }
3742
+ return toStringTag(obj) === "Object";
3743
+ }
3744
+ function toStringTag(obj) {
3745
+ const tag = obj[Symbol.toStringTag];
3746
+ if (typeof tag === "string") return tag;
3747
+ const name = Reflect.apply(Object.prototype.toString, obj, []);
3748
+ return name.slice(8, name.length - 1);
3749
+ }
3750
+ function assertObjectLiteral(maybeObj, message) {
3751
+ if (isDevEnv() && !isObjectLiteral(maybeObj)) throw new TypeError(message);
3752
+ }
3753
+ function isDevEnv() {
3754
+ if (typeof process === "undefined" || !isObject(process) || !isObject(process.env)) return false;
3755
+ return process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test";
3756
+ }
3757
+ exports.ORDER_KEY_ID = ORDER_KEY_ID;
3758
+ exports.default = createObj;
3759
+ exports.deserialize = deserialize;
3760
+ exports.getOrder = getOrder;
3761
+ exports.isOrderedObject = isOrderedObject;
3762
+ exports.serialize = serialize;
3763
+ exports.setOrder = setOrder;
3764
+ }) });
3765
+
3766
+ //#endregion
3767
+ //#region ../../node_modules/.pnpm/@stoplight+types@14.1.1/node_modules/@stoplight/types/dist/index.js
3768
+ var require_dist = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+types@14.1.1/node_modules/@stoplight/types/dist/index.js": ((exports) => {
3769
+ Object.defineProperty(exports, "__esModule", { value: true });
3770
+ exports.HttpOperationSecurityDeclarationTypes = void 0;
3771
+ (function(HttpOperationSecurityDeclarationTypes) {
3772
+ /** Indicates that the operation has no security declarations. */
3773
+ HttpOperationSecurityDeclarationTypes["None"] = "none";
3774
+ /** Indicates that the operation has explicit security declarations. */
3775
+ HttpOperationSecurityDeclarationTypes["Declared"] = "declared";
3776
+ /** Indicates that the operation inherits its security declarations from the service. */
3777
+ HttpOperationSecurityDeclarationTypes["InheritedFromService"] = "inheritedFromService";
3778
+ })(exports.HttpOperationSecurityDeclarationTypes || (exports.HttpOperationSecurityDeclarationTypes = {}));
3779
+ exports.HttpParamStyles = void 0;
3780
+ (function(HttpParamStyles) {
3781
+ /** Used when OAS2 type !== array */
3782
+ HttpParamStyles["Unspecified"] = "unspecified";
3783
+ /**
3784
+ * OAS 3.x style simple
3785
+ * OAS 2 collectionFormat csv
3786
+ */
3787
+ HttpParamStyles["Simple"] = "simple";
3788
+ /**
3789
+ * OAS 3.x style matrix
3790
+ * OAS 2 collectionFormat no support
3791
+ */
3792
+ HttpParamStyles["Matrix"] = "matrix";
3793
+ /**
3794
+ * OAS 3.x style label
3795
+ * OAS 2 collectionFormat no support
3796
+ */
3797
+ HttpParamStyles["Label"] = "label";
3798
+ /**
3799
+ * OAS 3.x style form
3800
+ * OAS 2 collectionFormat
3801
+ * * csv, when explode === false
3802
+ * * multi, when explode === true
3803
+ */
3804
+ HttpParamStyles["Form"] = "form";
3805
+ /**
3806
+ * OAS 3.x no support
3807
+ * OAS 2 collectionFormat csv when explode === undefined
3808
+ */
3809
+ HttpParamStyles["CommaDelimited"] = "commaDelimited";
3810
+ /**
3811
+ * OAS 3.x style spaceDelimited
3812
+ * OAS 2 collectionFormat ssv
3813
+ */
3814
+ HttpParamStyles["SpaceDelimited"] = "spaceDelimited";
3815
+ /**
3816
+ * OAS 3.x style spaceDelimited
3817
+ * OAS 2 collectionFormat pipes
3818
+ */
3819
+ HttpParamStyles["PipeDelimited"] = "pipeDelimited";
3820
+ /**
3821
+ * OAS 3.x style deepObject
3822
+ * OAS 2 collectionFormat no support
3823
+ */
3824
+ HttpParamStyles["DeepObject"] = "deepObject";
3825
+ /**
3826
+ * OAS 3.x style no support
3827
+ * OAS 2 collectionFormat tsv
3828
+ */
3829
+ HttpParamStyles["TabDelimited"] = "tabDelimited";
3830
+ })(exports.HttpParamStyles || (exports.HttpParamStyles = {}));
3831
+ /**
3832
+ * Represents the severity of diagnostics.
3833
+ */
3834
+ exports.DiagnosticSeverity = void 0;
3835
+ (function(DiagnosticSeverity) {
3836
+ /**
3837
+ * Something not allowed by the rules of a language or other means.
3838
+ */
3839
+ DiagnosticSeverity[DiagnosticSeverity["Error"] = 0] = "Error";
3840
+ /**
3841
+ * Something suspicious but allowed.
3842
+ */
3843
+ DiagnosticSeverity[DiagnosticSeverity["Warning"] = 1] = "Warning";
3844
+ /**
3845
+ * Something to inform about but not a problem.
3846
+ */
3847
+ DiagnosticSeverity[DiagnosticSeverity["Information"] = 2] = "Information";
3848
+ /**
3849
+ * Something to hint to a better way of doing it, like proposing
3850
+ * a refactoring.
3851
+ */
3852
+ DiagnosticSeverity[DiagnosticSeverity["Hint"] = 3] = "Hint";
3853
+ })(exports.DiagnosticSeverity || (exports.DiagnosticSeverity = {}));
3854
+ /**
3855
+ * Stoplight node types
3856
+ */
3857
+ exports.NodeType = void 0;
3858
+ (function(NodeType) {
3859
+ NodeType["Article"] = "article";
3860
+ NodeType["HttpService"] = "http_service";
3861
+ NodeType["HttpServer"] = "http_server";
3862
+ NodeType["HttpOperation"] = "http_operation";
3863
+ NodeType["HttpCallback"] = "http_callback";
3864
+ NodeType["HttpWebhook"] = "http_webhook";
3865
+ NodeType["Model"] = "model";
3866
+ NodeType["Generic"] = "generic";
3867
+ NodeType["Unknown"] = "unknown";
3868
+ NodeType["TableOfContents"] = "table_of_contents";
3869
+ NodeType["SpectralRuleset"] = "spectral_ruleset";
3870
+ NodeType["Styleguide"] = "styleguide";
3871
+ NodeType["Image"] = "image";
3872
+ NodeType["StoplightResolutions"] = "stoplight_resolutions";
3873
+ NodeType["StoplightOverride"] = "stoplight_override";
3874
+ })(exports.NodeType || (exports.NodeType = {}));
3875
+ /**
3876
+ * Node data formats
3877
+ */
3878
+ exports.NodeFormat = void 0;
3879
+ (function(NodeFormat) {
3880
+ NodeFormat["Json"] = "json";
3881
+ NodeFormat["Markdown"] = "markdown";
3882
+ NodeFormat["Yaml"] = "yaml";
3883
+ NodeFormat["Javascript"] = "javascript";
3884
+ NodeFormat["Apng"] = "apng";
3885
+ NodeFormat["Avif"] = "avif";
3886
+ NodeFormat["Bmp"] = "bmp";
3887
+ NodeFormat["Gif"] = "gif";
3888
+ NodeFormat["Jpeg"] = "jpeg";
3889
+ NodeFormat["Png"] = "png";
3890
+ NodeFormat["Svg"] = "svg";
3891
+ NodeFormat["Webp"] = "webp";
3892
+ })(exports.NodeFormat || (exports.NodeFormat = {}));
3893
+ }) });
3894
+
3895
+ //#endregion
3896
+ //#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/parseWithPointers.js
3897
+ var require_parseWithPointers = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/parseWithPointers.js": ((exports) => {
3898
+ Object.defineProperty(exports, "__esModule", { value: true });
3899
+ const ordered_object_literal_1$1 = require_src();
3900
+ const types_1 = require_dist();
3901
+ const yaml_ast_parser_1$1 = require_src$1();
3902
+ const buildJsonPath_1 = require_buildJsonPath();
3903
+ const dereferenceAnchor_1 = require_dereferenceAnchor();
3904
+ const lineForPosition_1 = require_lineForPosition();
3905
+ const types_2 = require_types();
3906
+ const utils_1 = require_utils();
3907
+ exports.parseWithPointers = (value, options) => {
3908
+ const lineMap = computeLineMap(value);
3909
+ const ast$3 = yaml_ast_parser_1$1.load(value, Object.assign({}, options, { ignoreDuplicateKeys: true }));
3910
+ const parsed = {
3911
+ ast: ast$3,
3912
+ lineMap,
3913
+ data: void 0,
3914
+ diagnostics: [],
3915
+ metadata: options,
3916
+ comments: {}
3917
+ };
3918
+ if (!ast$3) return parsed;
3919
+ const normalizedOptions = normalizeOptions(options);
3920
+ const comments = new Comments(parsed.comments, Comments.mapComments(normalizedOptions.attachComments && ast$3.comments ? ast$3.comments : [], lineMap), ast$3, lineMap, "#");
3921
+ parsed.data = walkAST({
3922
+ lineMap,
3923
+ diagnostics: parsed.diagnostics
3924
+ }, ast$3, comments, normalizedOptions);
3925
+ if (ast$3.errors) parsed.diagnostics.push(...transformErrors(ast$3.errors, lineMap));
3926
+ if (parsed.diagnostics.length > 0) parsed.diagnostics.sort((itemA, itemB) => itemA.range.start.line - itemB.range.start.line);
3927
+ if (Array.isArray(parsed.ast.errors)) parsed.ast.errors.length = 0;
3928
+ return parsed;
3929
+ };
3930
+ const TILDE_REGEXP = /~/g;
3931
+ const SLASH_REGEXP = /\//g;
3932
+ function encodeSegment(input) {
3933
+ return input.replace(TILDE_REGEXP, "~0").replace(SLASH_REGEXP, "~1");
3934
+ }
3935
+ const walkAST = (ctx, node, comments, options) => {
3936
+ if (node) switch (node.kind) {
3937
+ case types_2.Kind.MAP: {
3938
+ const mapComments = comments.enter(node);
3939
+ const { lineMap, diagnostics } = ctx;
3940
+ const { preserveKeyOrder, ignoreDuplicateKeys, json, mergeKeys } = options;
3941
+ const container = createMapContainer(preserveKeyOrder);
3942
+ const seenKeys = [];
3943
+ const handleMergeKeys = mergeKeys;
3944
+ const yamlMode = !json;
3945
+ const handleDuplicates = !ignoreDuplicateKeys;
3946
+ for (const mapping of node.mappings) {
3947
+ if (!validateMappingKey(mapping, lineMap, diagnostics, yamlMode)) continue;
3948
+ const key = String(getScalarValue(mapping.key));
3949
+ const mappingComments = mapComments.enter(mapping, encodeSegment(key));
3950
+ if ((yamlMode || handleDuplicates) && (!handleMergeKeys || key !== "<<")) if (seenKeys.includes(key)) {
3951
+ if (yamlMode) throw new Error("Duplicate YAML mapping key encountered");
3952
+ if (handleDuplicates) diagnostics.push(createYAMLException(mapping.key, lineMap, "duplicate key"));
3953
+ } else seenKeys.push(key);
3954
+ if (handleMergeKeys && key === "<<") {
3955
+ const reduced = reduceMergeKeys(walkAST(ctx, mapping.value, mappingComments, options), preserveKeyOrder);
3956
+ Object.assign(container, reduced);
3957
+ } else {
3958
+ container[key] = walkAST(ctx, mapping.value, mappingComments, options);
3959
+ if (preserveKeyOrder) pushKey(container, key);
3960
+ }
3961
+ mappingComments.attachComments();
3962
+ }
3963
+ mapComments.attachComments();
3964
+ return container;
3965
+ }
3966
+ case types_2.Kind.SEQ: {
3967
+ const nodeComments = comments.enter(node);
3968
+ const container = node.items.map((item, i$1) => {
3969
+ if (item !== null) {
3970
+ const sequenceItemComments = nodeComments.enter(item, i$1);
3971
+ const walked = walkAST(ctx, item, sequenceItemComments, options);
3972
+ sequenceItemComments.attachComments();
3973
+ return walked;
3974
+ } else return null;
3975
+ });
3976
+ nodeComments.attachComments();
3977
+ return container;
3978
+ }
3979
+ case types_2.Kind.SCALAR: {
3980
+ const value = getScalarValue(node);
3981
+ return !options.bigInt && typeof value === "bigint" ? Number(value) : value;
3982
+ }
3983
+ case types_2.Kind.ANCHOR_REF:
3984
+ if (utils_1.isObject(node.value)) node.value = dereferenceAnchor_1.dereferenceAnchor(node.value, node.referencesAnchor);
3985
+ return walkAST(ctx, node.value, comments, options);
3986
+ default: return null;
3987
+ }
3988
+ return node;
3989
+ };
3990
+ function getScalarValue(node) {
3991
+ switch (yaml_ast_parser_1$1.determineScalarType(node)) {
3992
+ case types_2.ScalarType.null: return null;
3993
+ case types_2.ScalarType.string: return String(node.value);
3994
+ case types_2.ScalarType.bool: return yaml_ast_parser_1$1.parseYamlBoolean(node.value);
3995
+ case types_2.ScalarType.int: return yaml_ast_parser_1$1.parseYamlBigInteger(node.value);
3996
+ case types_2.ScalarType.float: return yaml_ast_parser_1$1.parseYamlFloat(node.value);
3997
+ }
3998
+ }
3999
+ const computeLineMap = (input) => {
4000
+ const lineMap = [];
4001
+ let i$1 = 0;
4002
+ for (; i$1 < input.length; i$1++) if (input[i$1] === "\n") lineMap.push(i$1 + 1);
4003
+ lineMap.push(i$1 + 1);
4004
+ return lineMap;
4005
+ };
4006
+ function getLineLength(lineMap, line) {
4007
+ if (line === 0) return Math.max(0, lineMap[0] - 1);
4008
+ return Math.max(0, lineMap[line] - lineMap[line - 1] - 1);
4009
+ }
4010
+ const transformErrors = (errors, lineMap) => {
4011
+ const validations = [];
4012
+ let possiblyUnexpectedFlow = -1;
4013
+ let i$1 = 0;
4014
+ for (const error of errors) {
4015
+ const validation = {
4016
+ code: error.name,
4017
+ message: error.reason,
4018
+ severity: error.isWarning ? types_1.DiagnosticSeverity.Warning : types_1.DiagnosticSeverity.Error,
4019
+ range: {
4020
+ start: {
4021
+ line: error.mark.line,
4022
+ character: error.mark.column
4023
+ },
4024
+ end: {
4025
+ line: error.mark.line,
4026
+ character: error.mark.toLineEnd ? getLineLength(lineMap, error.mark.line) : error.mark.column
4027
+ }
4028
+ }
4029
+ };
4030
+ if (error.reason === "missed comma between flow collection entries") possiblyUnexpectedFlow = possiblyUnexpectedFlow === -1 ? i$1 : possiblyUnexpectedFlow;
4031
+ else if (possiblyUnexpectedFlow !== -1) {
4032
+ validations[possiblyUnexpectedFlow].range.end = validation.range.end;
4033
+ validations[possiblyUnexpectedFlow].message = "invalid mixed usage of block and flow styles";
4034
+ validations.length = possiblyUnexpectedFlow + 1;
4035
+ i$1 = validations.length;
4036
+ possiblyUnexpectedFlow = -1;
4037
+ }
4038
+ validations.push(validation);
4039
+ i$1++;
4040
+ }
4041
+ return validations;
4042
+ };
4043
+ const reduceMergeKeys = (items, preserveKeyOrder) => {
4044
+ if (Array.isArray(items)) return items.reduceRight(preserveKeyOrder ? (merged, item) => {
4045
+ const keys = Object.keys(item);
4046
+ Object.assign(merged, item);
4047
+ for (let i$1 = keys.length - 1; i$1 >= 0; i$1--) unshiftKey(merged, keys[i$1]);
4048
+ return merged;
4049
+ } : (merged, item) => Object.assign(merged, item), createMapContainer(preserveKeyOrder));
4050
+ return typeof items !== "object" || items === null ? null : Object(items);
4051
+ };
4052
+ function createMapContainer(preserveKeyOrder) {
4053
+ return preserveKeyOrder ? ordered_object_literal_1$1.default({}) : {};
4054
+ }
4055
+ function deleteKey(container, key) {
4056
+ if (!(key in container)) return;
4057
+ const order = ordered_object_literal_1$1.getOrder(container);
4058
+ const index = order.indexOf(key);
4059
+ if (index !== -1) order.splice(index, 1);
4060
+ }
4061
+ function unshiftKey(container, key) {
4062
+ deleteKey(container, key);
4063
+ ordered_object_literal_1$1.getOrder(container).unshift(key);
4064
+ }
4065
+ function pushKey(container, key) {
4066
+ deleteKey(container, key);
4067
+ ordered_object_literal_1$1.getOrder(container).push(key);
4068
+ }
4069
+ function validateMappingKey(mapping, lineMap, diagnostics, yamlMode) {
4070
+ if (mapping.key.kind !== types_2.Kind.SCALAR) {
4071
+ if (!yamlMode) diagnostics.push(createYAMLIncompatibilityException(mapping.key, lineMap, "mapping key must be a string scalar", yamlMode));
4072
+ return false;
4073
+ }
4074
+ if (!yamlMode) {
4075
+ const type = typeof getScalarValue(mapping.key);
4076
+ if (type !== "string") diagnostics.push(createYAMLIncompatibilityException(mapping.key, lineMap, `mapping key must be a string scalar rather than ${mapping.key.valueObject === null ? "null" : type}`, yamlMode));
4077
+ }
4078
+ return true;
4079
+ }
4080
+ function createYAMLIncompatibilityException(node, lineMap, message, yamlMode) {
4081
+ const exception = createYAMLException(node, lineMap, message);
4082
+ exception.code = "YAMLIncompatibleValue";
4083
+ exception.severity = yamlMode ? types_1.DiagnosticSeverity.Hint : types_1.DiagnosticSeverity.Warning;
4084
+ return exception;
4085
+ }
4086
+ function createYAMLException(node, lineMap, message) {
4087
+ return {
4088
+ code: "YAMLException",
4089
+ message,
4090
+ severity: types_1.DiagnosticSeverity.Error,
4091
+ path: buildJsonPath_1.buildJsonPath(node),
4092
+ range: getRange(lineMap, node.startPosition, node.endPosition)
4093
+ };
4094
+ }
4095
+ function getRange(lineMap, startPosition, endPosition) {
4096
+ const startLine = lineForPosition_1.lineForPosition(startPosition, lineMap);
4097
+ const endLine = lineForPosition_1.lineForPosition(endPosition, lineMap);
4098
+ return {
4099
+ start: {
4100
+ line: startLine,
4101
+ character: startLine === 0 ? startPosition : startPosition - lineMap[startLine - 1]
4102
+ },
4103
+ end: {
4104
+ line: endLine,
4105
+ character: endLine === 0 ? endPosition : endPosition - lineMap[endLine - 1]
4106
+ }
4107
+ };
4108
+ }
4109
+ var Comments = class Comments {
4110
+ constructor(attachedComments, comments, node, lineMap, pointer) {
4111
+ this.attachedComments = attachedComments;
4112
+ this.node = node;
4113
+ this.lineMap = lineMap;
4114
+ this.pointer = pointer;
4115
+ if (comments.length === 0) this.comments = [];
4116
+ else {
4117
+ const startPosition = this.getStartPosition(node);
4118
+ const endPosition = this.getEndPosition(node);
4119
+ const startLine = lineForPosition_1.lineForPosition(startPosition, this.lineMap);
4120
+ const endLine = lineForPosition_1.lineForPosition(endPosition, this.lineMap);
4121
+ const matchingComments = [];
4122
+ for (let i$1 = comments.length - 1; i$1 >= 0; i$1--) {
4123
+ const comment = comments[i$1];
4124
+ if (comment.range.start.line >= startLine && comment.range.end.line <= endLine) {
4125
+ matchingComments.push(comment);
4126
+ comments.splice(i$1, 1);
4127
+ }
4128
+ }
4129
+ this.comments = matchingComments;
4130
+ }
4131
+ }
4132
+ getStartPosition(node) {
4133
+ if (node.parent === null) return 0;
4134
+ return node.kind === types_2.Kind.MAPPING ? node.key.startPosition : node.startPosition;
4135
+ }
4136
+ getEndPosition(node) {
4137
+ switch (node.kind) {
4138
+ case types_2.Kind.MAPPING: return node.value === null ? node.endPosition : this.getEndPosition(node.value);
4139
+ case types_2.Kind.MAP: return node.mappings.length === 0 ? node.endPosition : node.mappings[node.mappings.length - 1].endPosition;
4140
+ case types_2.Kind.SEQ: {
4141
+ if (node.items.length === 0) return node.endPosition;
4142
+ const lastItem = node.items[node.items.length - 1];
4143
+ return lastItem === null ? node.endPosition : lastItem.endPosition;
4144
+ }
4145
+ default: return node.endPosition;
4146
+ }
4147
+ }
4148
+ static mapComments(comments, lineMap) {
4149
+ return comments.map((comment) => ({
4150
+ value: comment.value,
4151
+ range: getRange(lineMap, comment.startPosition, comment.endPosition),
4152
+ startPosition: comment.startPosition,
4153
+ endPosition: comment.endPosition
4154
+ }));
4155
+ }
4156
+ enter(node, key) {
4157
+ return new Comments(this.attachedComments, this.comments, node, this.lineMap, key === void 0 ? this.pointer : `${this.pointer}/${key}`);
4158
+ }
4159
+ static isLeading(node, startPosition) {
4160
+ switch (node.kind) {
4161
+ case types_2.Kind.MAP: return node.mappings.length === 0 || node.mappings[0].startPosition > startPosition;
4162
+ case types_2.Kind.SEQ: {
4163
+ if (node.items.length === 0) return true;
4164
+ const firstItem = node.items[0];
4165
+ return firstItem === null || firstItem.startPosition > startPosition;
4166
+ }
4167
+ case types_2.Kind.MAPPING: return node.value === null || node.value.startPosition > startPosition;
4168
+ default: return false;
4169
+ }
4170
+ }
4171
+ static isTrailing(node, endPosition) {
4172
+ switch (node.kind) {
4173
+ case types_2.Kind.MAP: return node.mappings.length > 0 && endPosition > node.mappings[node.mappings.length - 1].endPosition;
4174
+ case types_2.Kind.SEQ:
4175
+ if (node.items.length === 0) return false;
4176
+ const lastItem = node.items[node.items.length - 1];
4177
+ return lastItem !== null && endPosition > lastItem.endPosition;
4178
+ case types_2.Kind.MAPPING: return node.value !== null && endPosition > node.value.endPosition;
4179
+ default: return false;
4180
+ }
4181
+ }
4182
+ static findBetween(node, startPosition, endPosition) {
4183
+ switch (node.kind) {
4184
+ case types_2.Kind.MAP: {
4185
+ let left;
4186
+ for (const mapping of node.mappings) if (startPosition > mapping.startPosition) left = mapping.key.value;
4187
+ else if (left !== void 0 && mapping.startPosition > endPosition) return [left, mapping.key.value];
4188
+ return null;
4189
+ }
4190
+ case types_2.Kind.SEQ: {
4191
+ let left;
4192
+ for (let i$1 = 0; i$1 < node.items.length; i$1++) {
4193
+ const item = node.items[i$1];
4194
+ if (item === null) continue;
4195
+ if (startPosition > item.startPosition) left = String(i$1);
4196
+ else if (left !== void 0 && item.startPosition > endPosition) return [left, String(i$1)];
4197
+ }
4198
+ return null;
4199
+ }
4200
+ default: return null;
4201
+ }
4202
+ }
4203
+ isBeforeEOL(comment) {
4204
+ return this.node.kind === types_2.Kind.SCALAR || this.node.kind === types_2.Kind.MAPPING && comment.range.end.line === lineForPosition_1.lineForPosition(this.node.key.endPosition, this.lineMap);
4205
+ }
4206
+ attachComments() {
4207
+ if (this.comments.length === 0) return;
4208
+ const attachedComments = this.attachedComments[this.pointer] = this.attachedComments[this.pointer] || [];
4209
+ for (const comment of this.comments) if (this.isBeforeEOL(comment)) attachedComments.push({
4210
+ value: comment.value,
4211
+ placement: "before-eol"
4212
+ });
4213
+ else if (Comments.isLeading(this.node, comment.startPosition)) attachedComments.push({
4214
+ value: comment.value,
4215
+ placement: "leading"
4216
+ });
4217
+ else if (Comments.isTrailing(this.node, comment.endPosition)) attachedComments.push({
4218
+ value: comment.value,
4219
+ placement: "trailing"
4220
+ });
4221
+ else {
4222
+ const between = Comments.findBetween(this.node, comment.startPosition, comment.endPosition);
4223
+ if (between !== null) attachedComments.push({
4224
+ value: comment.value,
4225
+ placement: "between",
4226
+ between
4227
+ });
4228
+ else attachedComments.push({
4229
+ value: comment.value,
4230
+ placement: "trailing"
4231
+ });
4232
+ }
4233
+ }
4234
+ };
4235
+ function normalizeOptions(options) {
4236
+ if (options === void 0) return {
4237
+ attachComments: false,
4238
+ preserveKeyOrder: false,
4239
+ bigInt: false,
4240
+ mergeKeys: false,
4241
+ json: true,
4242
+ ignoreDuplicateKeys: false
4243
+ };
4244
+ return Object.assign({}, options, {
4245
+ attachComments: options.attachComments === true,
4246
+ preserveKeyOrder: options.preserveKeyOrder === true,
4247
+ bigInt: options.bigInt === true,
4248
+ mergeKeys: options.mergeKeys === true,
4249
+ json: options.json !== false,
4250
+ ignoreDuplicateKeys: options.ignoreDuplicateKeys !== false
4251
+ });
4252
+ }
4253
+ }) });
4254
+
4255
+ //#endregion
4256
+ //#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/parse.js
4257
+ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/parse.js": ((exports) => {
4258
+ Object.defineProperty(exports, "__esModule", { value: true });
4259
+ const parseWithPointers_1$1 = require_parseWithPointers();
4260
+ exports.parse = (value) => parseWithPointers_1$1.parseWithPointers(value).data;
4261
+ }) });
4262
+
4263
+ //#endregion
4264
+ //#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/safeStringify.js
4265
+ var require_safeStringify = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/safeStringify.js": ((exports) => {
4266
+ Object.defineProperty(exports, "__esModule", { value: true });
4267
+ const yaml_ast_parser_1 = require_src$1();
4268
+ exports.safeStringify = (value, options) => typeof value === "string" ? value : yaml_ast_parser_1.safeDump(value, options);
4269
+ }) });
38
4270
 
4271
+ //#endregion
4272
+ //#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/trapAccess.js
4273
+ var require_trapAccess = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/trapAccess.js": ((exports) => {
4274
+ Object.defineProperty(exports, "__esModule", { value: true });
4275
+ const ordered_object_literal_1 = require_src();
4276
+ exports.KEYS = Symbol.for(ordered_object_literal_1.ORDER_KEY_ID);
4277
+ const traps = { ownKeys(target) {
4278
+ return exports.KEYS in target ? target[exports.KEYS] : Reflect.ownKeys(target);
4279
+ } };
4280
+ exports.trapAccess = (target) => new Proxy(target, traps);
4281
+ }) });
4282
+
4283
+ //#endregion
4284
+ //#region ../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/index.js
4285
+ var require_yaml = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@stoplight+yaml@4.3.0/node_modules/@stoplight/yaml/index.js": ((exports) => {
4286
+ Object.defineProperty(exports, "__esModule", { value: true });
4287
+ const tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
4288
+ tslib_1.__exportStar(require_buildJsonPath(), exports);
4289
+ tslib_1.__exportStar(require_dereferenceAnchor(), exports);
4290
+ tslib_1.__exportStar(require_getJsonPathForPosition(), exports);
4291
+ tslib_1.__exportStar(require_getLocationForJsonPath(), exports);
4292
+ tslib_1.__exportStar(require_lineForPosition(), exports);
4293
+ var parse_1 = require_parse();
4294
+ exports.parse = parse_1.parse;
4295
+ var parseWithPointers_1 = require_parseWithPointers();
4296
+ exports.parseWithPointers = parseWithPointers_1.parseWithPointers;
4297
+ tslib_1.__exportStar(require_safeStringify(), exports);
4298
+ tslib_1.__exportStar(require_types(), exports);
4299
+ tslib_1.__exportStar(require_trapAccess(), exports);
4300
+ }) });
4301
+
4302
+ //#endregion
39
4303
  //#region src/utils.ts
4304
+ var import_yaml = /* @__PURE__ */ __toESM(require_yaml(), 1);
40
4305
  function isOpenApiV2Document(doc) {
41
4306
  return doc && (0, remeda.isPlainObject)(doc) && !("openapi" in doc);
42
4307
  }
@@ -52,8 +4317,8 @@ function isParameterObject(obj) {
52
4317
  * @param schema - The schema object to check.
53
4318
  * @returns `true` if the schema is marked as nullable; otherwise, `false`.
54
4319
  */
55
- function isNullable(schema) {
56
- return schema?.nullable ?? schema?.["x-nullable"] ?? false;
4320
+ function isNullable(schema$2) {
4321
+ return schema$2?.nullable ?? schema$2?.["x-nullable"] ?? false;
57
4322
  }
58
4323
  /**
59
4324
  * Determines if the given object is an OpenAPI ReferenceObject.
@@ -79,12 +4344,12 @@ function isDiscriminator(obj) {
79
4344
  * @param schema - The schema object to check.
80
4345
  * @returns True if the schema is required; otherwise, false.
81
4346
  */
82
- function isRequired(schema) {
83
- if (!schema) return false;
84
- return Array.isArray(schema.required) ? !!schema.required?.length : !!schema.required;
4347
+ function isRequired(schema$2) {
4348
+ if (!schema$2) return false;
4349
+ return Array.isArray(schema$2.required) ? !!schema$2.required?.length : !!schema$2.required;
85
4350
  }
86
- function isOptional(schema) {
87
- return !isRequired(schema);
4351
+ function isOptional(schema$2) {
4352
+ return !isRequired(schema$2);
88
4353
  }
89
4354
  async function parse(pathOrApi, { oasClass = Oas, canBundle = true, enablePaths = true } = {}) {
90
4355
  const { loadConfig, bundle } = await import("@redocly/openapi-core");
@@ -122,6 +4387,19 @@ async function merge(pathOrApi, { oasClass = Oas } = {}) {
122
4387
  components: { schemas: {} }
123
4388
  }), { oasClass });
124
4389
  }
4390
+ function parseFromConfig(config, oasClass = Oas) {
4391
+ if ("data" in config.input) {
4392
+ if (typeof config.input.data === "object") return parse(JSON.parse(JSON.stringify(config.input.data)), { oasClass });
4393
+ try {
4394
+ return parse(import_yaml.parse(config.input.data), { oasClass });
4395
+ } catch (_e) {
4396
+ return parse(config.input.data, { oasClass });
4397
+ }
4398
+ }
4399
+ if (Array.isArray(config.input)) return merge(config.input.map((input) => node_path.default.resolve(config.root, input.path)), { oasClass });
4400
+ if (new URLPath(config.input.path).isURL) return parse(config.input.path, { oasClass });
4401
+ return parse(node_path.default.resolve(config.root, config.input.path), { oasClass });
4402
+ }
125
4403
 
126
4404
  //#endregion
127
4405
  //#region src/Oas.ts
@@ -161,9 +4439,9 @@ var Oas = class extends oas.default {
161
4439
  jsonpointer.default.set(this.api, $ref, value);
162
4440
  }
163
4441
  }
164
- getDiscriminator(schema) {
165
- if (!isDiscriminator(schema)) return;
166
- const { mapping = {}, propertyName } = schema.discriminator;
4442
+ getDiscriminator(schema$2) {
4443
+ if (!isDiscriminator(schema$2)) return;
4444
+ const { mapping = {}, propertyName } = schema$2.discriminator;
167
4445
  if (this.#options.discriminator === "inherit") Object.entries(mapping).forEach(([mappingKey, mappingValue]) => {
168
4446
  if (mappingValue) {
169
4447
  const childSchema = this.get(mappingValue);
@@ -179,36 +4457,36 @@ var Oas = class extends oas.default {
179
4457
  }
180
4458
  }
181
4459
  });
182
- if (schema.oneOf) schema.oneOf.forEach((schema$1) => {
183
- if (isReference(schema$1)) {
184
- const key = this.getKey(schema$1.$ref);
185
- const propertySchema = this.get(schema$1.$ref).properties?.[propertyName];
186
- const canAdd = key && !Object.values(mapping).includes(schema$1.$ref);
187
- if (canAdd && propertySchema?.enum?.length === 1) mapping[propertySchema.enum[0]] = schema$1.$ref;
188
- else if (canAdd) mapping[key] = schema$1.$ref;
4460
+ if (schema$2.oneOf) schema$2.oneOf.forEach((schema$3) => {
4461
+ if (isReference(schema$3)) {
4462
+ const key = this.getKey(schema$3.$ref);
4463
+ const propertySchema = this.get(schema$3.$ref).properties?.[propertyName];
4464
+ const canAdd = key && !Object.values(mapping).includes(schema$3.$ref);
4465
+ if (canAdd && propertySchema?.enum?.length === 1) mapping[propertySchema.enum[0]] = schema$3.$ref;
4466
+ else if (canAdd) mapping[key] = schema$3.$ref;
189
4467
  }
190
4468
  });
191
- if (schema.anyOf) schema.anyOf.forEach((schema$1) => {
192
- if (isReference(schema$1)) {
193
- const key = this.getKey(schema$1.$ref);
194
- const propertySchema = this.get(schema$1.$ref).properties?.[propertyName];
195
- const canAdd = key && !Object.values(mapping).includes(schema$1.$ref);
196
- if (canAdd && propertySchema?.enum?.length === 1) mapping[propertySchema.enum[0]] = schema$1.$ref;
197
- else if (canAdd) mapping[key] = schema$1.$ref;
4469
+ if (schema$2.anyOf) schema$2.anyOf.forEach((schema$3) => {
4470
+ if (isReference(schema$3)) {
4471
+ const key = this.getKey(schema$3.$ref);
4472
+ const propertySchema = this.get(schema$3.$ref).properties?.[propertyName];
4473
+ const canAdd = key && !Object.values(mapping).includes(schema$3.$ref);
4474
+ if (canAdd && propertySchema?.enum?.length === 1) mapping[propertySchema.enum[0]] = schema$3.$ref;
4475
+ else if (canAdd) mapping[key] = schema$3.$ref;
198
4476
  }
199
4477
  });
200
4478
  return {
201
- ...schema.discriminator,
4479
+ ...schema$2.discriminator,
202
4480
  mapping
203
4481
  };
204
4482
  }
205
- dereferenceWithRef(schema) {
206
- if (isReference(schema)) return {
207
- ...schema,
208
- ...this.get(schema.$ref),
209
- $ref: schema.$ref
4483
+ dereferenceWithRef(schema$2) {
4484
+ if (isReference(schema$2)) return {
4485
+ ...schema$2,
4486
+ ...this.get(schema$2.$ref),
4487
+ $ref: schema$2.$ref
210
4488
  };
211
- return schema;
4489
+ return schema$2;
212
4490
  }
213
4491
  /**
214
4492
  * Oas does not have a getResponseBody(contentType)
@@ -243,44 +4521,44 @@ var Oas = class extends oas.default {
243
4521
  }
244
4522
  getResponseSchema(operation, statusCode) {
245
4523
  if (operation.schema.responses) Object.keys(operation.schema.responses).forEach((key) => {
246
- const schema$1 = operation.schema.responses[key];
247
- const $ref = isReference(schema$1) ? schema$1.$ref : void 0;
248
- if (schema$1 && $ref) operation.schema.responses[key] = this.get($ref);
4524
+ const schema$3 = operation.schema.responses[key];
4525
+ const $ref = isReference(schema$3) ? schema$3.$ref : void 0;
4526
+ if (schema$3 && $ref) operation.schema.responses[key] = this.get($ref);
249
4527
  });
250
4528
  const getResponseBody = this.#getResponseBodyFactory(operation.getResponseByStatusCode(statusCode));
251
4529
  const { contentType } = this.#options;
252
4530
  const responseBody = getResponseBody(contentType);
253
4531
  if (responseBody === false) return {};
254
- const schema = Array.isArray(responseBody) ? responseBody[1].schema : responseBody.schema;
255
- if (!schema) return {};
256
- return this.dereferenceWithRef(schema);
4532
+ const schema$2 = Array.isArray(responseBody) ? responseBody[1].schema : responseBody.schema;
4533
+ if (!schema$2) return {};
4534
+ return this.dereferenceWithRef(schema$2);
257
4535
  }
258
4536
  getRequestSchema(operation) {
259
4537
  const { contentType } = this.#options;
260
4538
  if (operation.schema.requestBody) operation.schema.requestBody = this.dereferenceWithRef(operation.schema.requestBody);
261
4539
  const requestBody = operation.getRequestBody(contentType);
262
4540
  if (requestBody === false) return;
263
- const schema = Array.isArray(requestBody) ? requestBody[1].schema : requestBody.schema;
264
- if (!schema) return;
265
- return this.dereferenceWithRef(schema);
4541
+ const schema$2 = Array.isArray(requestBody) ? requestBody[1].schema : requestBody.schema;
4542
+ if (!schema$2) return;
4543
+ return this.dereferenceWithRef(schema$2);
266
4544
  }
267
4545
  getParametersSchema(operation, inKey) {
268
4546
  const { contentType = operation.getContentType() } = this.#options;
269
- const params = operation.getParameters().map((schema) => {
270
- return this.dereferenceWithRef(schema);
4547
+ const params = operation.getParameters().map((schema$2) => {
4548
+ return this.dereferenceWithRef(schema$2);
271
4549
  }).filter((v) => v.in === inKey);
272
4550
  if (!params.length) return null;
273
- return params.reduce((schema, pathParameters) => {
4551
+ return params.reduce((schema$2, pathParameters) => {
274
4552
  const property = pathParameters.content?.[contentType]?.schema ?? pathParameters.schema;
275
- const required = [...schema.required || [], pathParameters.required ? pathParameters.name : void 0].filter(Boolean);
4553
+ const required = [...schema$2.required || [], pathParameters.required ? pathParameters.name : void 0].filter(Boolean);
276
4554
  return {
277
- ...schema,
278
- description: schema.description,
279
- deprecated: schema.deprecated,
280
- example: schema.example,
4555
+ ...schema$2,
4556
+ description: schema$2.description,
4557
+ deprecated: schema$2.deprecated,
4558
+ example: schema$2.example,
281
4559
  required,
282
4560
  properties: {
283
- ...schema.properties,
4561
+ ...schema$2.properties,
284
4562
  [pathParameters.name]: {
285
4563
  description: pathParameters.description,
286
4564
  ...property
@@ -317,6 +4595,7 @@ const HttpMethods = {
317
4595
  //#endregion
318
4596
  exports.HttpMethods = HttpMethods;
319
4597
  exports.Oas = Oas;
4598
+ exports.__toCommonJS = __toCommonJS;
320
4599
  Object.defineProperty(exports, 'findSchemaDefinition', {
321
4600
  enumerable: true,
322
4601
  get: function () {
@@ -338,4 +4617,5 @@ Object.defineProperty(exports, 'matchesMimeType', {
338
4617
  });
339
4618
  exports.merge = merge;
340
4619
  exports.parse = parse;
4620
+ exports.parseFromConfig = parseFromConfig;
341
4621
  //# sourceMappingURL=index.cjs.map