UNPKG

731 kBJavaScriptView Raw
1import { createRequire as __prettierCreateRequire } from "module";
2import { fileURLToPath as __prettierFileUrlToPath } from "url";
3import { dirname as __prettierDirname } from "path";
4const require = __prettierCreateRequire(import.meta.url);
5const __filename = __prettierFileUrlToPath(import.meta.url);
6const __dirname = __prettierDirname(__filename);
7
8var __create = Object.create;
9var __defProp = Object.defineProperty;
10var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11var __getOwnPropNames = Object.getOwnPropertyNames;
12var __getProtoOf = Object.getPrototypeOf;
13var __hasOwnProp = Object.prototype.hasOwnProperty;
14var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
15 get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
16}) : x)(function(x) {
17 if (typeof require !== "undefined")
18 return require.apply(this, arguments);
19 throw Error('Dynamic require of "' + x + '" is not supported');
20});
21var __esm = (fn, res) => function __init() {
22 return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
23};
24var __commonJS = (cb, mod) => function __require2() {
25 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
26};
27var __export = (target, all) => {
28 for (var name in all)
29 __defProp(target, name, { get: all[name], enumerable: true });
30};
31var __copyProps = (to, from, except, desc) => {
32 if (from && typeof from === "object" || typeof from === "function") {
33 for (let key of __getOwnPropNames(from))
34 if (!__hasOwnProp.call(to, key) && key !== except)
35 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
36 }
37 return to;
38};
39var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
40 // If the importer is in node compatibility mode or this is not an ESM
41 // file that has been converted to a CommonJS file using a Babel-
42 // compatible transform (i.e. "__esModule" has not been set), then set
43 // "default" to the CommonJS "module.exports" for node compatibility.
44 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
45 mod
46));
47var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
48var __accessCheck = (obj, member, msg) => {
49 if (!member.has(obj))
50 throw TypeError("Cannot " + msg);
51};
52var __privateAdd = (obj, member, value) => {
53 if (member.has(obj))
54 throw TypeError("Cannot add the same private member more than once");
55 member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
56};
57var __privateMethod = (obj, member, method) => {
58 __accessCheck(obj, member, "access private method");
59 return method;
60};
61
62// node_modules/vnopts/node_modules/tslib/tslib.es6.js
63var tslib_es6_exports = {};
64__export(tslib_es6_exports, {
65 __assign: () => __assign,
66 __asyncDelegator: () => __asyncDelegator,
67 __asyncGenerator: () => __asyncGenerator,
68 __asyncValues: () => __asyncValues,
69 __await: () => __await,
70 __awaiter: () => __awaiter,
71 __classPrivateFieldGet: () => __classPrivateFieldGet,
72 __classPrivateFieldSet: () => __classPrivateFieldSet,
73 __createBinding: () => __createBinding,
74 __decorate: () => __decorate,
75 __exportStar: () => __exportStar,
76 __extends: () => __extends,
77 __generator: () => __generator,
78 __importDefault: () => __importDefault,
79 __importStar: () => __importStar,
80 __makeTemplateObject: () => __makeTemplateObject,
81 __metadata: () => __metadata,
82 __param: () => __param,
83 __read: () => __read,
84 __rest: () => __rest,
85 __spread: () => __spread,
86 __spreadArrays: () => __spreadArrays,
87 __values: () => __values
88});
89function __extends(d, b) {
90 extendStatics(d, b);
91 function __() {
92 this.constructor = d;
93 }
94 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
95}
96function __rest(s, e) {
97 var t = {};
98 for (var p in s)
99 if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
100 t[p] = s[p];
101 if (s != null && typeof Object.getOwnPropertySymbols === "function")
102 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
103 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
104 t[p[i]] = s[p[i]];
105 }
106 return t;
107}
108function __decorate(decorators, target, key, desc) {
109 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
110 if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
111 r = Reflect.decorate(decorators, target, key, desc);
112 else
113 for (var i = decorators.length - 1; i >= 0; i--)
114 if (d = decorators[i])
115 r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
116 return c > 3 && r && Object.defineProperty(target, key, r), r;
117}
118function __param(paramIndex, decorator) {
119 return function(target, key) {
120 decorator(target, key, paramIndex);
121 };
122}
123function __metadata(metadataKey, metadataValue) {
124 if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
125 return Reflect.metadata(metadataKey, metadataValue);
126}
127function __awaiter(thisArg, _arguments, P, generator) {
128 function adopt(value) {
129 return value instanceof P ? value : new P(function(resolve2) {
130 resolve2(value);
131 });
132 }
133 return new (P || (P = Promise))(function(resolve2, reject) {
134 function fulfilled(value) {
135 try {
136 step(generator.next(value));
137 } catch (e) {
138 reject(e);
139 }
140 }
141 function rejected(value) {
142 try {
143 step(generator["throw"](value));
144 } catch (e) {
145 reject(e);
146 }
147 }
148 function step(result) {
149 result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
150 }
151 step((generator = generator.apply(thisArg, _arguments || [])).next());
152 });
153}
154function __generator(thisArg, body) {
155 var _ = { label: 0, sent: function() {
156 if (t[0] & 1)
157 throw t[1];
158 return t[1];
159 }, trys: [], ops: [] }, f, y, t, g;
160 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
161 return this;
162 }), g;
163 function verb(n) {
164 return function(v) {
165 return step([n, v]);
166 };
167 }
168 function step(op) {
169 if (f)
170 throw new TypeError("Generator is already executing.");
171 while (_)
172 try {
173 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)
174 return t;
175 if (y = 0, t)
176 op = [op[0] & 2, t.value];
177 switch (op[0]) {
178 case 0:
179 case 1:
180 t = op;
181 break;
182 case 4:
183 _.label++;
184 return { value: op[1], done: false };
185 case 5:
186 _.label++;
187 y = op[1];
188 op = [0];
189 continue;
190 case 7:
191 op = _.ops.pop();
192 _.trys.pop();
193 continue;
194 default:
195 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
196 _ = 0;
197 continue;
198 }
199 if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
200 _.label = op[1];
201 break;
202 }
203 if (op[0] === 6 && _.label < t[1]) {
204 _.label = t[1];
205 t = op;
206 break;
207 }
208 if (t && _.label < t[2]) {
209 _.label = t[2];
210 _.ops.push(op);
211 break;
212 }
213 if (t[2])
214 _.ops.pop();
215 _.trys.pop();
216 continue;
217 }
218 op = body.call(thisArg, _);
219 } catch (e) {
220 op = [6, e];
221 y = 0;
222 } finally {
223 f = t = 0;
224 }
225 if (op[0] & 5)
226 throw op[1];
227 return { value: op[0] ? op[1] : void 0, done: true };
228 }
229}
230function __createBinding(o, m, k, k2) {
231 if (k2 === void 0)
232 k2 = k;
233 o[k2] = m[k];
234}
235function __exportStar(m, exports) {
236 for (var p in m)
237 if (p !== "default" && !exports.hasOwnProperty(p))
238 exports[p] = m[p];
239}
240function __values(o) {
241 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
242 if (m)
243 return m.call(o);
244 if (o && typeof o.length === "number")
245 return {
246 next: function() {
247 if (o && i >= o.length)
248 o = void 0;
249 return { value: o && o[i++], done: !o };
250 }
251 };
252 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
253}
254function __read(o, n) {
255 var m = typeof Symbol === "function" && o[Symbol.iterator];
256 if (!m)
257 return o;
258 var i = m.call(o), r, ar = [], e;
259 try {
260 while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
261 ar.push(r.value);
262 } catch (error) {
263 e = { error };
264 } finally {
265 try {
266 if (r && !r.done && (m = i["return"]))
267 m.call(i);
268 } finally {
269 if (e)
270 throw e.error;
271 }
272 }
273 return ar;
274}
275function __spread() {
276 for (var ar = [], i = 0; i < arguments.length; i++)
277 ar = ar.concat(__read(arguments[i]));
278 return ar;
279}
280function __spreadArrays() {
281 for (var s = 0, i = 0, il = arguments.length; i < il; i++)
282 s += arguments[i].length;
283 for (var r = Array(s), k = 0, i = 0; i < il; i++)
284 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
285 r[k] = a[j];
286 return r;
287}
288function __await(v) {
289 return this instanceof __await ? (this.v = v, this) : new __await(v);
290}
291function __asyncGenerator(thisArg, _arguments, generator) {
292 if (!Symbol.asyncIterator)
293 throw new TypeError("Symbol.asyncIterator is not defined.");
294 var g = generator.apply(thisArg, _arguments || []), i, q = [];
295 return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
296 return this;
297 }, i;
298 function verb(n) {
299 if (g[n])
300 i[n] = function(v) {
301 return new Promise(function(a, b) {
302 q.push([n, v, a, b]) > 1 || resume(n, v);
303 });
304 };
305 }
306 function resume(n, v) {
307 try {
308 step(g[n](v));
309 } catch (e) {
310 settle(q[0][3], e);
311 }
312 }
313 function step(r) {
314 r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
315 }
316 function fulfill(value) {
317 resume("next", value);
318 }
319 function reject(value) {
320 resume("throw", value);
321 }
322 function settle(f, v) {
323 if (f(v), q.shift(), q.length)
324 resume(q[0][0], q[0][1]);
325 }
326}
327function __asyncDelegator(o) {
328 var i, p;
329 return i = {}, verb("next"), verb("throw", function(e) {
330 throw e;
331 }), verb("return"), i[Symbol.iterator] = function() {
332 return this;
333 }, i;
334 function verb(n, f) {
335 i[n] = o[n] ? function(v) {
336 return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v;
337 } : f;
338 }
339}
340function __asyncValues(o) {
341 if (!Symbol.asyncIterator)
342 throw new TypeError("Symbol.asyncIterator is not defined.");
343 var m = o[Symbol.asyncIterator], i;
344 return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
345 return this;
346 }, i);
347 function verb(n) {
348 i[n] = o[n] && function(v) {
349 return new Promise(function(resolve2, reject) {
350 v = o[n](v), settle(resolve2, reject, v.done, v.value);
351 });
352 };
353 }
354 function settle(resolve2, reject, d, v) {
355 Promise.resolve(v).then(function(v2) {
356 resolve2({ value: v2, done: d });
357 }, reject);
358 }
359}
360function __makeTemplateObject(cooked, raw) {
361 if (Object.defineProperty) {
362 Object.defineProperty(cooked, "raw", { value: raw });
363 } else {
364 cooked.raw = raw;
365 }
366 return cooked;
367}
368function __importStar(mod) {
369 if (mod && mod.__esModule)
370 return mod;
371 var result = {};
372 if (mod != null) {
373 for (var k in mod)
374 if (Object.hasOwnProperty.call(mod, k))
375 result[k] = mod[k];
376 }
377 result.default = mod;
378 return result;
379}
380function __importDefault(mod) {
381 return mod && mod.__esModule ? mod : { default: mod };
382}
383function __classPrivateFieldGet(receiver, privateMap) {
384 if (!privateMap.has(receiver)) {
385 throw new TypeError("attempted to get private field on non-instance");
386 }
387 return privateMap.get(receiver);
388}
389function __classPrivateFieldSet(receiver, privateMap, value) {
390 if (!privateMap.has(receiver)) {
391 throw new TypeError("attempted to set private field on non-instance");
392 }
393 privateMap.set(receiver, value);
394 return value;
395}
396var extendStatics, __assign;
397var init_tslib_es6 = __esm({
398 "node_modules/vnopts/node_modules/tslib/tslib.es6.js"() {
399 extendStatics = function(d, b) {
400 extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
401 d2.__proto__ = b2;
402 } || function(d2, b2) {
403 for (var p in b2)
404 if (b2.hasOwnProperty(p))
405 d2[p] = b2[p];
406 };
407 return extendStatics(d, b);
408 };
409 __assign = function() {
410 __assign = Object.assign || function __assign2(t) {
411 for (var s, i = 1, n = arguments.length; i < n; i++) {
412 s = arguments[i];
413 for (var p in s)
414 if (Object.prototype.hasOwnProperty.call(s, p))
415 t[p] = s[p];
416 }
417 return t;
418 };
419 return __assign.apply(this, arguments);
420 };
421 }
422});
423
424// node_modules/vnopts/lib/descriptors/api.js
425var require_api = __commonJS({
426 "node_modules/vnopts/lib/descriptors/api.js"(exports) {
427 "use strict";
428 Object.defineProperty(exports, "__esModule", { value: true });
429 exports.apiDescriptor = {
430 key: (key) => /^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(key) ? key : JSON.stringify(key),
431 value(value) {
432 if (value === null || typeof value !== "object") {
433 return JSON.stringify(value);
434 }
435 if (Array.isArray(value)) {
436 return `[${value.map((subValue) => exports.apiDescriptor.value(subValue)).join(", ")}]`;
437 }
438 const keys = Object.keys(value);
439 return keys.length === 0 ? "{}" : `{ ${keys.map((key) => `${exports.apiDescriptor.key(key)}: ${exports.apiDescriptor.value(value[key])}`).join(", ")} }`;
440 },
441 pair: ({ key, value }) => exports.apiDescriptor.value({ [key]: value })
442 };
443 }
444});
445
446// node_modules/vnopts/lib/descriptors/index.js
447var require_descriptors = __commonJS({
448 "node_modules/vnopts/lib/descriptors/index.js"(exports) {
449 "use strict";
450 Object.defineProperty(exports, "__esModule", { value: true });
451 var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
452 tslib_1.__exportStar(require_api(), exports);
453 }
454});
455
456// node_modules/vnopts/node_modules/escape-string-regexp/index.js
457var require_escape_string_regexp = __commonJS({
458 "node_modules/vnopts/node_modules/escape-string-regexp/index.js"(exports, module) {
459 "use strict";
460 var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
461 module.exports = function(str) {
462 if (typeof str !== "string") {
463 throw new TypeError("Expected a string");
464 }
465 return str.replace(matchOperatorsRe, "\\$&");
466 };
467 }
468});
469
470// node_modules/color-name/index.js
471var require_color_name = __commonJS({
472 "node_modules/color-name/index.js"(exports, module) {
473 "use strict";
474 module.exports = {
475 "aliceblue": [240, 248, 255],
476 "antiquewhite": [250, 235, 215],
477 "aqua": [0, 255, 255],
478 "aquamarine": [127, 255, 212],
479 "azure": [240, 255, 255],
480 "beige": [245, 245, 220],
481 "bisque": [255, 228, 196],
482 "black": [0, 0, 0],
483 "blanchedalmond": [255, 235, 205],
484 "blue": [0, 0, 255],
485 "blueviolet": [138, 43, 226],
486 "brown": [165, 42, 42],
487 "burlywood": [222, 184, 135],
488 "cadetblue": [95, 158, 160],
489 "chartreuse": [127, 255, 0],
490 "chocolate": [210, 105, 30],
491 "coral": [255, 127, 80],
492 "cornflowerblue": [100, 149, 237],
493 "cornsilk": [255, 248, 220],
494 "crimson": [220, 20, 60],
495 "cyan": [0, 255, 255],
496 "darkblue": [0, 0, 139],
497 "darkcyan": [0, 139, 139],
498 "darkgoldenrod": [184, 134, 11],
499 "darkgray": [169, 169, 169],
500 "darkgreen": [0, 100, 0],
501 "darkgrey": [169, 169, 169],
502 "darkkhaki": [189, 183, 107],
503 "darkmagenta": [139, 0, 139],
504 "darkolivegreen": [85, 107, 47],
505 "darkorange": [255, 140, 0],
506 "darkorchid": [153, 50, 204],
507 "darkred": [139, 0, 0],
508 "darksalmon": [233, 150, 122],
509 "darkseagreen": [143, 188, 143],
510 "darkslateblue": [72, 61, 139],
511 "darkslategray": [47, 79, 79],
512 "darkslategrey": [47, 79, 79],
513 "darkturquoise": [0, 206, 209],
514 "darkviolet": [148, 0, 211],
515 "deeppink": [255, 20, 147],
516 "deepskyblue": [0, 191, 255],
517 "dimgray": [105, 105, 105],
518 "dimgrey": [105, 105, 105],
519 "dodgerblue": [30, 144, 255],
520 "firebrick": [178, 34, 34],
521 "floralwhite": [255, 250, 240],
522 "forestgreen": [34, 139, 34],
523 "fuchsia": [255, 0, 255],
524 "gainsboro": [220, 220, 220],
525 "ghostwhite": [248, 248, 255],
526 "gold": [255, 215, 0],
527 "goldenrod": [218, 165, 32],
528 "gray": [128, 128, 128],
529 "green": [0, 128, 0],
530 "greenyellow": [173, 255, 47],
531 "grey": [128, 128, 128],
532 "honeydew": [240, 255, 240],
533 "hotpink": [255, 105, 180],
534 "indianred": [205, 92, 92],
535 "indigo": [75, 0, 130],
536 "ivory": [255, 255, 240],
537 "khaki": [240, 230, 140],
538 "lavender": [230, 230, 250],
539 "lavenderblush": [255, 240, 245],
540 "lawngreen": [124, 252, 0],
541 "lemonchiffon": [255, 250, 205],
542 "lightblue": [173, 216, 230],
543 "lightcoral": [240, 128, 128],
544 "lightcyan": [224, 255, 255],
545 "lightgoldenrodyellow": [250, 250, 210],
546 "lightgray": [211, 211, 211],
547 "lightgreen": [144, 238, 144],
548 "lightgrey": [211, 211, 211],
549 "lightpink": [255, 182, 193],
550 "lightsalmon": [255, 160, 122],
551 "lightseagreen": [32, 178, 170],
552 "lightskyblue": [135, 206, 250],
553 "lightslategray": [119, 136, 153],
554 "lightslategrey": [119, 136, 153],
555 "lightsteelblue": [176, 196, 222],
556 "lightyellow": [255, 255, 224],
557 "lime": [0, 255, 0],
558 "limegreen": [50, 205, 50],
559 "linen": [250, 240, 230],
560 "magenta": [255, 0, 255],
561 "maroon": [128, 0, 0],
562 "mediumaquamarine": [102, 205, 170],
563 "mediumblue": [0, 0, 205],
564 "mediumorchid": [186, 85, 211],
565 "mediumpurple": [147, 112, 219],
566 "mediumseagreen": [60, 179, 113],
567 "mediumslateblue": [123, 104, 238],
568 "mediumspringgreen": [0, 250, 154],
569 "mediumturquoise": [72, 209, 204],
570 "mediumvioletred": [199, 21, 133],
571 "midnightblue": [25, 25, 112],
572 "mintcream": [245, 255, 250],
573 "mistyrose": [255, 228, 225],
574 "moccasin": [255, 228, 181],
575 "navajowhite": [255, 222, 173],
576 "navy": [0, 0, 128],
577 "oldlace": [253, 245, 230],
578 "olive": [128, 128, 0],
579 "olivedrab": [107, 142, 35],
580 "orange": [255, 165, 0],
581 "orangered": [255, 69, 0],
582 "orchid": [218, 112, 214],
583 "palegoldenrod": [238, 232, 170],
584 "palegreen": [152, 251, 152],
585 "paleturquoise": [175, 238, 238],
586 "palevioletred": [219, 112, 147],
587 "papayawhip": [255, 239, 213],
588 "peachpuff": [255, 218, 185],
589 "peru": [205, 133, 63],
590 "pink": [255, 192, 203],
591 "plum": [221, 160, 221],
592 "powderblue": [176, 224, 230],
593 "purple": [128, 0, 128],
594 "rebeccapurple": [102, 51, 153],
595 "red": [255, 0, 0],
596 "rosybrown": [188, 143, 143],
597 "royalblue": [65, 105, 225],
598 "saddlebrown": [139, 69, 19],
599 "salmon": [250, 128, 114],
600 "sandybrown": [244, 164, 96],
601 "seagreen": [46, 139, 87],
602 "seashell": [255, 245, 238],
603 "sienna": [160, 82, 45],
604 "silver": [192, 192, 192],
605 "skyblue": [135, 206, 235],
606 "slateblue": [106, 90, 205],
607 "slategray": [112, 128, 144],
608 "slategrey": [112, 128, 144],
609 "snow": [255, 250, 250],
610 "springgreen": [0, 255, 127],
611 "steelblue": [70, 130, 180],
612 "tan": [210, 180, 140],
613 "teal": [0, 128, 128],
614 "thistle": [216, 191, 216],
615 "tomato": [255, 99, 71],
616 "turquoise": [64, 224, 208],
617 "violet": [238, 130, 238],
618 "wheat": [245, 222, 179],
619 "white": [255, 255, 255],
620 "whitesmoke": [245, 245, 245],
621 "yellow": [255, 255, 0],
622 "yellowgreen": [154, 205, 50]
623 };
624 }
625});
626
627// node_modules/color-convert/conversions.js
628var require_conversions = __commonJS({
629 "node_modules/color-convert/conversions.js"(exports, module) {
630 var cssKeywords = require_color_name();
631 var reverseKeywords = {};
632 for (key in cssKeywords) {
633 if (cssKeywords.hasOwnProperty(key)) {
634 reverseKeywords[cssKeywords[key]] = key;
635 }
636 }
637 var key;
638 var convert = module.exports = {
639 rgb: { channels: 3, labels: "rgb" },
640 hsl: { channels: 3, labels: "hsl" },
641 hsv: { channels: 3, labels: "hsv" },
642 hwb: { channels: 3, labels: "hwb" },
643 cmyk: { channels: 4, labels: "cmyk" },
644 xyz: { channels: 3, labels: "xyz" },
645 lab: { channels: 3, labels: "lab" },
646 lch: { channels: 3, labels: "lch" },
647 hex: { channels: 1, labels: ["hex"] },
648 keyword: { channels: 1, labels: ["keyword"] },
649 ansi16: { channels: 1, labels: ["ansi16"] },
650 ansi256: { channels: 1, labels: ["ansi256"] },
651 hcg: { channels: 3, labels: ["h", "c", "g"] },
652 apple: { channels: 3, labels: ["r16", "g16", "b16"] },
653 gray: { channels: 1, labels: ["gray"] }
654 };
655 for (model in convert) {
656 if (convert.hasOwnProperty(model)) {
657 if (!("channels" in convert[model])) {
658 throw new Error("missing channels property: " + model);
659 }
660 if (!("labels" in convert[model])) {
661 throw new Error("missing channel labels property: " + model);
662 }
663 if (convert[model].labels.length !== convert[model].channels) {
664 throw new Error("channel and label counts mismatch: " + model);
665 }
666 channels = convert[model].channels;
667 labels = convert[model].labels;
668 delete convert[model].channels;
669 delete convert[model].labels;
670 Object.defineProperty(convert[model], "channels", { value: channels });
671 Object.defineProperty(convert[model], "labels", { value: labels });
672 }
673 }
674 var channels;
675 var labels;
676 var model;
677 convert.rgb.hsl = function(rgb) {
678 var r = rgb[0] / 255;
679 var g = rgb[1] / 255;
680 var b = rgb[2] / 255;
681 var min = Math.min(r, g, b);
682 var max = Math.max(r, g, b);
683 var delta = max - min;
684 var h;
685 var s;
686 var l;
687 if (max === min) {
688 h = 0;
689 } else if (r === max) {
690 h = (g - b) / delta;
691 } else if (g === max) {
692 h = 2 + (b - r) / delta;
693 } else if (b === max) {
694 h = 4 + (r - g) / delta;
695 }
696 h = Math.min(h * 60, 360);
697 if (h < 0) {
698 h += 360;
699 }
700 l = (min + max) / 2;
701 if (max === min) {
702 s = 0;
703 } else if (l <= 0.5) {
704 s = delta / (max + min);
705 } else {
706 s = delta / (2 - max - min);
707 }
708 return [h, s * 100, l * 100];
709 };
710 convert.rgb.hsv = function(rgb) {
711 var rdif;
712 var gdif;
713 var bdif;
714 var h;
715 var s;
716 var r = rgb[0] / 255;
717 var g = rgb[1] / 255;
718 var b = rgb[2] / 255;
719 var v = Math.max(r, g, b);
720 var diff = v - Math.min(r, g, b);
721 var diffc = function(c) {
722 return (v - c) / 6 / diff + 1 / 2;
723 };
724 if (diff === 0) {
725 h = s = 0;
726 } else {
727 s = diff / v;
728 rdif = diffc(r);
729 gdif = diffc(g);
730 bdif = diffc(b);
731 if (r === v) {
732 h = bdif - gdif;
733 } else if (g === v) {
734 h = 1 / 3 + rdif - bdif;
735 } else if (b === v) {
736 h = 2 / 3 + gdif - rdif;
737 }
738 if (h < 0) {
739 h += 1;
740 } else if (h > 1) {
741 h -= 1;
742 }
743 }
744 return [
745 h * 360,
746 s * 100,
747 v * 100
748 ];
749 };
750 convert.rgb.hwb = function(rgb) {
751 var r = rgb[0];
752 var g = rgb[1];
753 var b = rgb[2];
754 var h = convert.rgb.hsl(rgb)[0];
755 var w = 1 / 255 * Math.min(r, Math.min(g, b));
756 b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
757 return [h, w * 100, b * 100];
758 };
759 convert.rgb.cmyk = function(rgb) {
760 var r = rgb[0] / 255;
761 var g = rgb[1] / 255;
762 var b = rgb[2] / 255;
763 var c;
764 var m;
765 var y;
766 var k;
767 k = Math.min(1 - r, 1 - g, 1 - b);
768 c = (1 - r - k) / (1 - k) || 0;
769 m = (1 - g - k) / (1 - k) || 0;
770 y = (1 - b - k) / (1 - k) || 0;
771 return [c * 100, m * 100, y * 100, k * 100];
772 };
773 function comparativeDistance(x, y) {
774 return Math.pow(x[0] - y[0], 2) + Math.pow(x[1] - y[1], 2) + Math.pow(x[2] - y[2], 2);
775 }
776 convert.rgb.keyword = function(rgb) {
777 var reversed = reverseKeywords[rgb];
778 if (reversed) {
779 return reversed;
780 }
781 var currentClosestDistance = Infinity;
782 var currentClosestKeyword;
783 for (var keyword in cssKeywords) {
784 if (cssKeywords.hasOwnProperty(keyword)) {
785 var value = cssKeywords[keyword];
786 var distance = comparativeDistance(rgb, value);
787 if (distance < currentClosestDistance) {
788 currentClosestDistance = distance;
789 currentClosestKeyword = keyword;
790 }
791 }
792 }
793 return currentClosestKeyword;
794 };
795 convert.keyword.rgb = function(keyword) {
796 return cssKeywords[keyword];
797 };
798 convert.rgb.xyz = function(rgb) {
799 var r = rgb[0] / 255;
800 var g = rgb[1] / 255;
801 var b = rgb[2] / 255;
802 r = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92;
803 g = g > 0.04045 ? Math.pow((g + 0.055) / 1.055, 2.4) : g / 12.92;
804 b = b > 0.04045 ? Math.pow((b + 0.055) / 1.055, 2.4) : b / 12.92;
805 var x = r * 0.4124 + g * 0.3576 + b * 0.1805;
806 var y = r * 0.2126 + g * 0.7152 + b * 0.0722;
807 var z = r * 0.0193 + g * 0.1192 + b * 0.9505;
808 return [x * 100, y * 100, z * 100];
809 };
810 convert.rgb.lab = function(rgb) {
811 var xyz = convert.rgb.xyz(rgb);
812 var x = xyz[0];
813 var y = xyz[1];
814 var z = xyz[2];
815 var l;
816 var a;
817 var b;
818 x /= 95.047;
819 y /= 100;
820 z /= 108.883;
821 x = x > 8856e-6 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;
822 y = y > 8856e-6 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;
823 z = z > 8856e-6 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;
824 l = 116 * y - 16;
825 a = 500 * (x - y);
826 b = 200 * (y - z);
827 return [l, a, b];
828 };
829 convert.hsl.rgb = function(hsl) {
830 var h = hsl[0] / 360;
831 var s = hsl[1] / 100;
832 var l = hsl[2] / 100;
833 var t1;
834 var t2;
835 var t3;
836 var rgb;
837 var val;
838 if (s === 0) {
839 val = l * 255;
840 return [val, val, val];
841 }
842 if (l < 0.5) {
843 t2 = l * (1 + s);
844 } else {
845 t2 = l + s - l * s;
846 }
847 t1 = 2 * l - t2;
848 rgb = [0, 0, 0];
849 for (var i = 0; i < 3; i++) {
850 t3 = h + 1 / 3 * -(i - 1);
851 if (t3 < 0) {
852 t3++;
853 }
854 if (t3 > 1) {
855 t3--;
856 }
857 if (6 * t3 < 1) {
858 val = t1 + (t2 - t1) * 6 * t3;
859 } else if (2 * t3 < 1) {
860 val = t2;
861 } else if (3 * t3 < 2) {
862 val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
863 } else {
864 val = t1;
865 }
866 rgb[i] = val * 255;
867 }
868 return rgb;
869 };
870 convert.hsl.hsv = function(hsl) {
871 var h = hsl[0];
872 var s = hsl[1] / 100;
873 var l = hsl[2] / 100;
874 var smin = s;
875 var lmin = Math.max(l, 0.01);
876 var sv;
877 var v;
878 l *= 2;
879 s *= l <= 1 ? l : 2 - l;
880 smin *= lmin <= 1 ? lmin : 2 - lmin;
881 v = (l + s) / 2;
882 sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
883 return [h, sv * 100, v * 100];
884 };
885 convert.hsv.rgb = function(hsv) {
886 var h = hsv[0] / 60;
887 var s = hsv[1] / 100;
888 var v = hsv[2] / 100;
889 var hi = Math.floor(h) % 6;
890 var f = h - Math.floor(h);
891 var p = 255 * v * (1 - s);
892 var q = 255 * v * (1 - s * f);
893 var t = 255 * v * (1 - s * (1 - f));
894 v *= 255;
895 switch (hi) {
896 case 0:
897 return [v, t, p];
898 case 1:
899 return [q, v, p];
900 case 2:
901 return [p, v, t];
902 case 3:
903 return [p, q, v];
904 case 4:
905 return [t, p, v];
906 case 5:
907 return [v, p, q];
908 }
909 };
910 convert.hsv.hsl = function(hsv) {
911 var h = hsv[0];
912 var s = hsv[1] / 100;
913 var v = hsv[2] / 100;
914 var vmin = Math.max(v, 0.01);
915 var lmin;
916 var sl;
917 var l;
918 l = (2 - s) * v;
919 lmin = (2 - s) * vmin;
920 sl = s * vmin;
921 sl /= lmin <= 1 ? lmin : 2 - lmin;
922 sl = sl || 0;
923 l /= 2;
924 return [h, sl * 100, l * 100];
925 };
926 convert.hwb.rgb = function(hwb) {
927 var h = hwb[0] / 360;
928 var wh = hwb[1] / 100;
929 var bl = hwb[2] / 100;
930 var ratio = wh + bl;
931 var i;
932 var v;
933 var f;
934 var n;
935 if (ratio > 1) {
936 wh /= ratio;
937 bl /= ratio;
938 }
939 i = Math.floor(6 * h);
940 v = 1 - bl;
941 f = 6 * h - i;
942 if ((i & 1) !== 0) {
943 f = 1 - f;
944 }
945 n = wh + f * (v - wh);
946 var r;
947 var g;
948 var b;
949 switch (i) {
950 default:
951 case 6:
952 case 0:
953 r = v;
954 g = n;
955 b = wh;
956 break;
957 case 1:
958 r = n;
959 g = v;
960 b = wh;
961 break;
962 case 2:
963 r = wh;
964 g = v;
965 b = n;
966 break;
967 case 3:
968 r = wh;
969 g = n;
970 b = v;
971 break;
972 case 4:
973 r = n;
974 g = wh;
975 b = v;
976 break;
977 case 5:
978 r = v;
979 g = wh;
980 b = n;
981 break;
982 }
983 return [r * 255, g * 255, b * 255];
984 };
985 convert.cmyk.rgb = function(cmyk) {
986 var c = cmyk[0] / 100;
987 var m = cmyk[1] / 100;
988 var y = cmyk[2] / 100;
989 var k = cmyk[3] / 100;
990 var r;
991 var g;
992 var b;
993 r = 1 - Math.min(1, c * (1 - k) + k);
994 g = 1 - Math.min(1, m * (1 - k) + k);
995 b = 1 - Math.min(1, y * (1 - k) + k);
996 return [r * 255, g * 255, b * 255];
997 };
998 convert.xyz.rgb = function(xyz) {
999 var x = xyz[0] / 100;
1000 var y = xyz[1] / 100;
1001 var z = xyz[2] / 100;
1002 var r;
1003 var g;
1004 var b;
1005 r = x * 3.2406 + y * -1.5372 + z * -0.4986;
1006 g = x * -0.9689 + y * 1.8758 + z * 0.0415;
1007 b = x * 0.0557 + y * -0.204 + z * 1.057;
1008 r = r > 31308e-7 ? 1.055 * Math.pow(r, 1 / 2.4) - 0.055 : r * 12.92;
1009 g = g > 31308e-7 ? 1.055 * Math.pow(g, 1 / 2.4) - 0.055 : g * 12.92;
1010 b = b > 31308e-7 ? 1.055 * Math.pow(b, 1 / 2.4) - 0.055 : b * 12.92;
1011 r = Math.min(Math.max(0, r), 1);
1012 g = Math.min(Math.max(0, g), 1);
1013 b = Math.min(Math.max(0, b), 1);
1014 return [r * 255, g * 255, b * 255];
1015 };
1016 convert.xyz.lab = function(xyz) {
1017 var x = xyz[0];
1018 var y = xyz[1];
1019 var z = xyz[2];
1020 var l;
1021 var a;
1022 var b;
1023 x /= 95.047;
1024 y /= 100;
1025 z /= 108.883;
1026 x = x > 8856e-6 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;
1027 y = y > 8856e-6 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;
1028 z = z > 8856e-6 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;
1029 l = 116 * y - 16;
1030 a = 500 * (x - y);
1031 b = 200 * (y - z);
1032 return [l, a, b];
1033 };
1034 convert.lab.xyz = function(lab) {
1035 var l = lab[0];
1036 var a = lab[1];
1037 var b = lab[2];
1038 var x;
1039 var y;
1040 var z;
1041 y = (l + 16) / 116;
1042 x = a / 500 + y;
1043 z = y - b / 200;
1044 var y2 = Math.pow(y, 3);
1045 var x2 = Math.pow(x, 3);
1046 var z2 = Math.pow(z, 3);
1047 y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
1048 x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
1049 z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
1050 x *= 95.047;
1051 y *= 100;
1052 z *= 108.883;
1053 return [x, y, z];
1054 };
1055 convert.lab.lch = function(lab) {
1056 var l = lab[0];
1057 var a = lab[1];
1058 var b = lab[2];
1059 var hr;
1060 var h;
1061 var c;
1062 hr = Math.atan2(b, a);
1063 h = hr * 360 / 2 / Math.PI;
1064 if (h < 0) {
1065 h += 360;
1066 }
1067 c = Math.sqrt(a * a + b * b);
1068 return [l, c, h];
1069 };
1070 convert.lch.lab = function(lch) {
1071 var l = lch[0];
1072 var c = lch[1];
1073 var h = lch[2];
1074 var a;
1075 var b;
1076 var hr;
1077 hr = h / 360 * 2 * Math.PI;
1078 a = c * Math.cos(hr);
1079 b = c * Math.sin(hr);
1080 return [l, a, b];
1081 };
1082 convert.rgb.ansi16 = function(args) {
1083 var r = args[0];
1084 var g = args[1];
1085 var b = args[2];
1086 var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2];
1087 value = Math.round(value / 50);
1088 if (value === 0) {
1089 return 30;
1090 }
1091 var ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
1092 if (value === 2) {
1093 ansi += 60;
1094 }
1095 return ansi;
1096 };
1097 convert.hsv.ansi16 = function(args) {
1098 return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
1099 };
1100 convert.rgb.ansi256 = function(args) {
1101 var r = args[0];
1102 var g = args[1];
1103 var b = args[2];
1104 if (r === g && g === b) {
1105 if (r < 8) {
1106 return 16;
1107 }
1108 if (r > 248) {
1109 return 231;
1110 }
1111 return Math.round((r - 8) / 247 * 24) + 232;
1112 }
1113 var ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
1114 return ansi;
1115 };
1116 convert.ansi16.rgb = function(args) {
1117 var color = args % 10;
1118 if (color === 0 || color === 7) {
1119 if (args > 50) {
1120 color += 3.5;
1121 }
1122 color = color / 10.5 * 255;
1123 return [color, color, color];
1124 }
1125 var mult = (~~(args > 50) + 1) * 0.5;
1126 var r = (color & 1) * mult * 255;
1127 var g = (color >> 1 & 1) * mult * 255;
1128 var b = (color >> 2 & 1) * mult * 255;
1129 return [r, g, b];
1130 };
1131 convert.ansi256.rgb = function(args) {
1132 if (args >= 232) {
1133 var c = (args - 232) * 10 + 8;
1134 return [c, c, c];
1135 }
1136 args -= 16;
1137 var rem;
1138 var r = Math.floor(args / 36) / 5 * 255;
1139 var g = Math.floor((rem = args % 36) / 6) / 5 * 255;
1140 var b = rem % 6 / 5 * 255;
1141 return [r, g, b];
1142 };
1143 convert.rgb.hex = function(args) {
1144 var integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
1145 var string = integer.toString(16).toUpperCase();
1146 return "000000".substring(string.length) + string;
1147 };
1148 convert.hex.rgb = function(args) {
1149 var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
1150 if (!match) {
1151 return [0, 0, 0];
1152 }
1153 var colorString = match[0];
1154 if (match[0].length === 3) {
1155 colorString = colorString.split("").map(function(char) {
1156 return char + char;
1157 }).join("");
1158 }
1159 var integer = parseInt(colorString, 16);
1160 var r = integer >> 16 & 255;
1161 var g = integer >> 8 & 255;
1162 var b = integer & 255;
1163 return [r, g, b];
1164 };
1165 convert.rgb.hcg = function(rgb) {
1166 var r = rgb[0] / 255;
1167 var g = rgb[1] / 255;
1168 var b = rgb[2] / 255;
1169 var max = Math.max(Math.max(r, g), b);
1170 var min = Math.min(Math.min(r, g), b);
1171 var chroma = max - min;
1172 var grayscale;
1173 var hue;
1174 if (chroma < 1) {
1175 grayscale = min / (1 - chroma);
1176 } else {
1177 grayscale = 0;
1178 }
1179 if (chroma <= 0) {
1180 hue = 0;
1181 } else if (max === r) {
1182 hue = (g - b) / chroma % 6;
1183 } else if (max === g) {
1184 hue = 2 + (b - r) / chroma;
1185 } else {
1186 hue = 4 + (r - g) / chroma + 4;
1187 }
1188 hue /= 6;
1189 hue %= 1;
1190 return [hue * 360, chroma * 100, grayscale * 100];
1191 };
1192 convert.hsl.hcg = function(hsl) {
1193 var s = hsl[1] / 100;
1194 var l = hsl[2] / 100;
1195 var c = 1;
1196 var f = 0;
1197 if (l < 0.5) {
1198 c = 2 * s * l;
1199 } else {
1200 c = 2 * s * (1 - l);
1201 }
1202 if (c < 1) {
1203 f = (l - 0.5 * c) / (1 - c);
1204 }
1205 return [hsl[0], c * 100, f * 100];
1206 };
1207 convert.hsv.hcg = function(hsv) {
1208 var s = hsv[1] / 100;
1209 var v = hsv[2] / 100;
1210 var c = s * v;
1211 var f = 0;
1212 if (c < 1) {
1213 f = (v - c) / (1 - c);
1214 }
1215 return [hsv[0], c * 100, f * 100];
1216 };
1217 convert.hcg.rgb = function(hcg) {
1218 var h = hcg[0] / 360;
1219 var c = hcg[1] / 100;
1220 var g = hcg[2] / 100;
1221 if (c === 0) {
1222 return [g * 255, g * 255, g * 255];
1223 }
1224 var pure = [0, 0, 0];
1225 var hi = h % 1 * 6;
1226 var v = hi % 1;
1227 var w = 1 - v;
1228 var mg = 0;
1229 switch (Math.floor(hi)) {
1230 case 0:
1231 pure[0] = 1;
1232 pure[1] = v;
1233 pure[2] = 0;
1234 break;
1235 case 1:
1236 pure[0] = w;
1237 pure[1] = 1;
1238 pure[2] = 0;
1239 break;
1240 case 2:
1241 pure[0] = 0;
1242 pure[1] = 1;
1243 pure[2] = v;
1244 break;
1245 case 3:
1246 pure[0] = 0;
1247 pure[1] = w;
1248 pure[2] = 1;
1249 break;
1250 case 4:
1251 pure[0] = v;
1252 pure[1] = 0;
1253 pure[2] = 1;
1254 break;
1255 default:
1256 pure[0] = 1;
1257 pure[1] = 0;
1258 pure[2] = w;
1259 }
1260 mg = (1 - c) * g;
1261 return [
1262 (c * pure[0] + mg) * 255,
1263 (c * pure[1] + mg) * 255,
1264 (c * pure[2] + mg) * 255
1265 ];
1266 };
1267 convert.hcg.hsv = function(hcg) {
1268 var c = hcg[1] / 100;
1269 var g = hcg[2] / 100;
1270 var v = c + g * (1 - c);
1271 var f = 0;
1272 if (v > 0) {
1273 f = c / v;
1274 }
1275 return [hcg[0], f * 100, v * 100];
1276 };
1277 convert.hcg.hsl = function(hcg) {
1278 var c = hcg[1] / 100;
1279 var g = hcg[2] / 100;
1280 var l = g * (1 - c) + 0.5 * c;
1281 var s = 0;
1282 if (l > 0 && l < 0.5) {
1283 s = c / (2 * l);
1284 } else if (l >= 0.5 && l < 1) {
1285 s = c / (2 * (1 - l));
1286 }
1287 return [hcg[0], s * 100, l * 100];
1288 };
1289 convert.hcg.hwb = function(hcg) {
1290 var c = hcg[1] / 100;
1291 var g = hcg[2] / 100;
1292 var v = c + g * (1 - c);
1293 return [hcg[0], (v - c) * 100, (1 - v) * 100];
1294 };
1295 convert.hwb.hcg = function(hwb) {
1296 var w = hwb[1] / 100;
1297 var b = hwb[2] / 100;
1298 var v = 1 - b;
1299 var c = v - w;
1300 var g = 0;
1301 if (c < 1) {
1302 g = (v - c) / (1 - c);
1303 }
1304 return [hwb[0], c * 100, g * 100];
1305 };
1306 convert.apple.rgb = function(apple) {
1307 return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
1308 };
1309 convert.rgb.apple = function(rgb) {
1310 return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
1311 };
1312 convert.gray.rgb = function(args) {
1313 return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
1314 };
1315 convert.gray.hsl = convert.gray.hsv = function(args) {
1316 return [0, 0, args[0]];
1317 };
1318 convert.gray.hwb = function(gray) {
1319 return [0, 100, gray[0]];
1320 };
1321 convert.gray.cmyk = function(gray) {
1322 return [0, 0, 0, gray[0]];
1323 };
1324 convert.gray.lab = function(gray) {
1325 return [gray[0], 0, 0];
1326 };
1327 convert.gray.hex = function(gray) {
1328 var val = Math.round(gray[0] / 100 * 255) & 255;
1329 var integer = (val << 16) + (val << 8) + val;
1330 var string = integer.toString(16).toUpperCase();
1331 return "000000".substring(string.length) + string;
1332 };
1333 convert.rgb.gray = function(rgb) {
1334 var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
1335 return [val / 255 * 100];
1336 };
1337 }
1338});
1339
1340// node_modules/color-convert/route.js
1341var require_route = __commonJS({
1342 "node_modules/color-convert/route.js"(exports, module) {
1343 var conversions = require_conversions();
1344 function buildGraph() {
1345 var graph = {};
1346 var models = Object.keys(conversions);
1347 for (var len = models.length, i = 0; i < len; i++) {
1348 graph[models[i]] = {
1349 // http://jsperf.com/1-vs-infinity
1350 // micro-opt, but this is simple.
1351 distance: -1,
1352 parent: null
1353 };
1354 }
1355 return graph;
1356 }
1357 function deriveBFS(fromModel) {
1358 var graph = buildGraph();
1359 var queue = [fromModel];
1360 graph[fromModel].distance = 0;
1361 while (queue.length) {
1362 var current = queue.pop();
1363 var adjacents = Object.keys(conversions[current]);
1364 for (var len = adjacents.length, i = 0; i < len; i++) {
1365 var adjacent = adjacents[i];
1366 var node = graph[adjacent];
1367 if (node.distance === -1) {
1368 node.distance = graph[current].distance + 1;
1369 node.parent = current;
1370 queue.unshift(adjacent);
1371 }
1372 }
1373 }
1374 return graph;
1375 }
1376 function link(from, to) {
1377 return function(args) {
1378 return to(from(args));
1379 };
1380 }
1381 function wrapConversion(toModel, graph) {
1382 var path9 = [graph[toModel].parent, toModel];
1383 var fn = conversions[graph[toModel].parent][toModel];
1384 var cur = graph[toModel].parent;
1385 while (graph[cur].parent) {
1386 path9.unshift(graph[cur].parent);
1387 fn = link(conversions[graph[cur].parent][cur], fn);
1388 cur = graph[cur].parent;
1389 }
1390 fn.conversion = path9;
1391 return fn;
1392 }
1393 module.exports = function(fromModel) {
1394 var graph = deriveBFS(fromModel);
1395 var conversion = {};
1396 var models = Object.keys(graph);
1397 for (var len = models.length, i = 0; i < len; i++) {
1398 var toModel = models[i];
1399 var node = graph[toModel];
1400 if (node.parent === null) {
1401 continue;
1402 }
1403 conversion[toModel] = wrapConversion(toModel, graph);
1404 }
1405 return conversion;
1406 };
1407 }
1408});
1409
1410// node_modules/color-convert/index.js
1411var require_color_convert = __commonJS({
1412 "node_modules/color-convert/index.js"(exports, module) {
1413 var conversions = require_conversions();
1414 var route = require_route();
1415 var convert = {};
1416 var models = Object.keys(conversions);
1417 function wrapRaw(fn) {
1418 var wrappedFn = function(args) {
1419 if (args === void 0 || args === null) {
1420 return args;
1421 }
1422 if (arguments.length > 1) {
1423 args = Array.prototype.slice.call(arguments);
1424 }
1425 return fn(args);
1426 };
1427 if ("conversion" in fn) {
1428 wrappedFn.conversion = fn.conversion;
1429 }
1430 return wrappedFn;
1431 }
1432 function wrapRounded(fn) {
1433 var wrappedFn = function(args) {
1434 if (args === void 0 || args === null) {
1435 return args;
1436 }
1437 if (arguments.length > 1) {
1438 args = Array.prototype.slice.call(arguments);
1439 }
1440 var result = fn(args);
1441 if (typeof result === "object") {
1442 for (var len = result.length, i = 0; i < len; i++) {
1443 result[i] = Math.round(result[i]);
1444 }
1445 }
1446 return result;
1447 };
1448 if ("conversion" in fn) {
1449 wrappedFn.conversion = fn.conversion;
1450 }
1451 return wrappedFn;
1452 }
1453 models.forEach(function(fromModel) {
1454 convert[fromModel] = {};
1455 Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
1456 Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
1457 var routes = route(fromModel);
1458 var routeModels = Object.keys(routes);
1459 routeModels.forEach(function(toModel) {
1460 var fn = routes[toModel];
1461 convert[fromModel][toModel] = wrapRounded(fn);
1462 convert[fromModel][toModel].raw = wrapRaw(fn);
1463 });
1464 });
1465 module.exports = convert;
1466 }
1467});
1468
1469// node_modules/ansi-styles/index.js
1470var require_ansi_styles = __commonJS({
1471 "node_modules/ansi-styles/index.js"(exports, module) {
1472 "use strict";
1473 var colorConvert = require_color_convert();
1474 var wrapAnsi16 = (fn, offset) => function() {
1475 const code = fn.apply(colorConvert, arguments);
1476 return `\x1B[${code + offset}m`;
1477 };
1478 var wrapAnsi256 = (fn, offset) => function() {
1479 const code = fn.apply(colorConvert, arguments);
1480 return `\x1B[${38 + offset};5;${code}m`;
1481 };
1482 var wrapAnsi16m = (fn, offset) => function() {
1483 const rgb = fn.apply(colorConvert, arguments);
1484 return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
1485 };
1486 function assembleStyles() {
1487 const codes2 = /* @__PURE__ */ new Map();
1488 const styles = {
1489 modifier: {
1490 reset: [0, 0],
1491 // 21 isn't widely supported and 22 does the same thing
1492 bold: [1, 22],
1493 dim: [2, 22],
1494 italic: [3, 23],
1495 underline: [4, 24],
1496 inverse: [7, 27],
1497 hidden: [8, 28],
1498 strikethrough: [9, 29]
1499 },
1500 color: {
1501 black: [30, 39],
1502 red: [31, 39],
1503 green: [32, 39],
1504 yellow: [33, 39],
1505 blue: [34, 39],
1506 magenta: [35, 39],
1507 cyan: [36, 39],
1508 white: [37, 39],
1509 gray: [90, 39],
1510 // Bright color
1511 redBright: [91, 39],
1512 greenBright: [92, 39],
1513 yellowBright: [93, 39],
1514 blueBright: [94, 39],
1515 magentaBright: [95, 39],
1516 cyanBright: [96, 39],
1517 whiteBright: [97, 39]
1518 },
1519 bgColor: {
1520 bgBlack: [40, 49],
1521 bgRed: [41, 49],
1522 bgGreen: [42, 49],
1523 bgYellow: [43, 49],
1524 bgBlue: [44, 49],
1525 bgMagenta: [45, 49],
1526 bgCyan: [46, 49],
1527 bgWhite: [47, 49],
1528 // Bright color
1529 bgBlackBright: [100, 49],
1530 bgRedBright: [101, 49],
1531 bgGreenBright: [102, 49],
1532 bgYellowBright: [103, 49],
1533 bgBlueBright: [104, 49],
1534 bgMagentaBright: [105, 49],
1535 bgCyanBright: [106, 49],
1536 bgWhiteBright: [107, 49]
1537 }
1538 };
1539 styles.color.grey = styles.color.gray;
1540 for (const groupName of Object.keys(styles)) {
1541 const group = styles[groupName];
1542 for (const styleName of Object.keys(group)) {
1543 const style = group[styleName];
1544 styles[styleName] = {
1545 open: `\x1B[${style[0]}m`,
1546 close: `\x1B[${style[1]}m`
1547 };
1548 group[styleName] = styles[styleName];
1549 codes2.set(style[0], style[1]);
1550 }
1551 Object.defineProperty(styles, groupName, {
1552 value: group,
1553 enumerable: false
1554 });
1555 Object.defineProperty(styles, "codes", {
1556 value: codes2,
1557 enumerable: false
1558 });
1559 }
1560 const ansi2ansi = (n) => n;
1561 const rgb2rgb = (r, g, b) => [r, g, b];
1562 styles.color.close = "\x1B[39m";
1563 styles.bgColor.close = "\x1B[49m";
1564 styles.color.ansi = {
1565 ansi: wrapAnsi16(ansi2ansi, 0)
1566 };
1567 styles.color.ansi256 = {
1568 ansi256: wrapAnsi256(ansi2ansi, 0)
1569 };
1570 styles.color.ansi16m = {
1571 rgb: wrapAnsi16m(rgb2rgb, 0)
1572 };
1573 styles.bgColor.ansi = {
1574 ansi: wrapAnsi16(ansi2ansi, 10)
1575 };
1576 styles.bgColor.ansi256 = {
1577 ansi256: wrapAnsi256(ansi2ansi, 10)
1578 };
1579 styles.bgColor.ansi16m = {
1580 rgb: wrapAnsi16m(rgb2rgb, 10)
1581 };
1582 for (let key of Object.keys(colorConvert)) {
1583 if (typeof colorConvert[key] !== "object") {
1584 continue;
1585 }
1586 const suite = colorConvert[key];
1587 if (key === "ansi16") {
1588 key = "ansi";
1589 }
1590 if ("ansi16" in suite) {
1591 styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);
1592 styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10);
1593 }
1594 if ("ansi256" in suite) {
1595 styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0);
1596 styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10);
1597 }
1598 if ("rgb" in suite) {
1599 styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0);
1600 styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10);
1601 }
1602 }
1603 return styles;
1604 }
1605 Object.defineProperty(module, "exports", {
1606 enumerable: true,
1607 get: assembleStyles
1608 });
1609 }
1610});
1611
1612// node_modules/vnopts/node_modules/has-flag/index.js
1613var require_has_flag = __commonJS({
1614 "node_modules/vnopts/node_modules/has-flag/index.js"(exports, module) {
1615 "use strict";
1616 module.exports = (flag, argv) => {
1617 argv = argv || process.argv;
1618 const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
1619 const pos = argv.indexOf(prefix + flag);
1620 const terminatorPos = argv.indexOf("--");
1621 return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
1622 };
1623 }
1624});
1625
1626// node_modules/vnopts/node_modules/supports-color/index.js
1627var require_supports_color = __commonJS({
1628 "node_modules/vnopts/node_modules/supports-color/index.js"(exports, module) {
1629 "use strict";
1630 var os = __require("os");
1631 var hasFlag = require_has_flag();
1632 var env = process.env;
1633 var forceColor;
1634 if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
1635 forceColor = false;
1636 } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
1637 forceColor = true;
1638 }
1639 if ("FORCE_COLOR" in env) {
1640 forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
1641 }
1642 function translateLevel(level) {
1643 if (level === 0) {
1644 return false;
1645 }
1646 return {
1647 level,
1648 hasBasic: true,
1649 has256: level >= 2,
1650 has16m: level >= 3
1651 };
1652 }
1653 function supportsColor(stream) {
1654 if (forceColor === false) {
1655 return 0;
1656 }
1657 if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
1658 return 3;
1659 }
1660 if (hasFlag("color=256")) {
1661 return 2;
1662 }
1663 if (stream && !stream.isTTY && forceColor !== true) {
1664 return 0;
1665 }
1666 const min = forceColor ? 1 : 0;
1667 if (process.platform === "win32") {
1668 const osRelease = os.release().split(".");
1669 if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
1670 return Number(osRelease[2]) >= 14931 ? 3 : 2;
1671 }
1672 return 1;
1673 }
1674 if ("CI" in env) {
1675 if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
1676 return 1;
1677 }
1678 return min;
1679 }
1680 if ("TEAMCITY_VERSION" in env) {
1681 return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
1682 }
1683 if (env.COLORTERM === "truecolor") {
1684 return 3;
1685 }
1686 if ("TERM_PROGRAM" in env) {
1687 const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
1688 switch (env.TERM_PROGRAM) {
1689 case "iTerm.app":
1690 return version >= 3 ? 3 : 2;
1691 case "Apple_Terminal":
1692 return 2;
1693 }
1694 }
1695 if (/-256(color)?$/i.test(env.TERM)) {
1696 return 2;
1697 }
1698 if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
1699 return 1;
1700 }
1701 if ("COLORTERM" in env) {
1702 return 1;
1703 }
1704 if (env.TERM === "dumb") {
1705 return min;
1706 }
1707 return min;
1708 }
1709 function getSupportLevel(stream) {
1710 const level = supportsColor(stream);
1711 return translateLevel(level);
1712 }
1713 module.exports = {
1714 supportsColor: getSupportLevel,
1715 stdout: getSupportLevel(process.stdout),
1716 stderr: getSupportLevel(process.stderr)
1717 };
1718 }
1719});
1720
1721// node_modules/vnopts/node_modules/chalk/templates.js
1722var require_templates = __commonJS({
1723 "node_modules/vnopts/node_modules/chalk/templates.js"(exports, module) {
1724 "use strict";
1725 var TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
1726 var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
1727 var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
1728 var ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;
1729 var ESCAPES = /* @__PURE__ */ new Map([
1730 ["n", "\n"],
1731 ["r", "\r"],
1732 ["t", " "],
1733 ["b", "\b"],
1734 ["f", "\f"],
1735 ["v", "\v"],
1736 ["0", "\0"],
1737 ["\\", "\\"],
1738 ["e", "\x1B"],
1739 ["a", "\x07"]
1740 ]);
1741 function unescape(c) {
1742 if (c[0] === "u" && c.length === 5 || c[0] === "x" && c.length === 3) {
1743 return String.fromCharCode(parseInt(c.slice(1), 16));
1744 }
1745 return ESCAPES.get(c) || c;
1746 }
1747 function parseArguments(name, args) {
1748 const results = [];
1749 const chunks = args.trim().split(/\s*,\s*/g);
1750 let matches;
1751 for (const chunk of chunks) {
1752 if (!isNaN(chunk)) {
1753 results.push(Number(chunk));
1754 } else if (matches = chunk.match(STRING_REGEX)) {
1755 results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape(escape) : chr));
1756 } else {
1757 throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
1758 }
1759 }
1760 return results;
1761 }
1762 function parseStyle(style) {
1763 STYLE_REGEX.lastIndex = 0;
1764 const results = [];
1765 let matches;
1766 while ((matches = STYLE_REGEX.exec(style)) !== null) {
1767 const name = matches[1];
1768 if (matches[2]) {
1769 const args = parseArguments(name, matches[2]);
1770 results.push([name].concat(args));
1771 } else {
1772 results.push([name]);
1773 }
1774 }
1775 return results;
1776 }
1777 function buildStyle(chalk, styles) {
1778 const enabled = {};
1779 for (const layer of styles) {
1780 for (const style of layer.styles) {
1781 enabled[style[0]] = layer.inverse ? null : style.slice(1);
1782 }
1783 }
1784 let current = chalk;
1785 for (const styleName of Object.keys(enabled)) {
1786 if (Array.isArray(enabled[styleName])) {
1787 if (!(styleName in current)) {
1788 throw new Error(`Unknown Chalk style: ${styleName}`);
1789 }
1790 if (enabled[styleName].length > 0) {
1791 current = current[styleName].apply(current, enabled[styleName]);
1792 } else {
1793 current = current[styleName];
1794 }
1795 }
1796 }
1797 return current;
1798 }
1799 module.exports = (chalk, tmp) => {
1800 const styles = [];
1801 const chunks = [];
1802 let chunk = [];
1803 tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => {
1804 if (escapeChar) {
1805 chunk.push(unescape(escapeChar));
1806 } else if (style) {
1807 const str = chunk.join("");
1808 chunk = [];
1809 chunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str));
1810 styles.push({ inverse, styles: parseStyle(style) });
1811 } else if (close) {
1812 if (styles.length === 0) {
1813 throw new Error("Found extraneous } in Chalk template literal");
1814 }
1815 chunks.push(buildStyle(chalk, styles)(chunk.join("")));
1816 chunk = [];
1817 styles.pop();
1818 } else {
1819 chunk.push(chr);
1820 }
1821 });
1822 chunks.push(chunk.join(""));
1823 if (styles.length > 0) {
1824 const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
1825 throw new Error(errMsg);
1826 }
1827 return chunks.join("");
1828 };
1829 }
1830});
1831
1832// node_modules/vnopts/node_modules/chalk/index.js
1833var require_chalk = __commonJS({
1834 "node_modules/vnopts/node_modules/chalk/index.js"(exports, module) {
1835 "use strict";
1836 var escapeStringRegexp2 = require_escape_string_regexp();
1837 var ansiStyles = require_ansi_styles();
1838 var stdoutColor = require_supports_color().stdout;
1839 var template = require_templates();
1840 var isSimpleWindowsTerm = process.platform === "win32" && !(process.env.TERM || "").toLowerCase().startsWith("xterm");
1841 var levelMapping = ["ansi", "ansi", "ansi256", "ansi16m"];
1842 var skipModels = /* @__PURE__ */ new Set(["gray"]);
1843 var styles = /* @__PURE__ */ Object.create(null);
1844 function applyOptions(obj, options8) {
1845 options8 = options8 || {};
1846 const scLevel = stdoutColor ? stdoutColor.level : 0;
1847 obj.level = options8.level === void 0 ? scLevel : options8.level;
1848 obj.enabled = "enabled" in options8 ? options8.enabled : obj.level > 0;
1849 }
1850 function Chalk(options8) {
1851 if (!this || !(this instanceof Chalk) || this.template) {
1852 const chalk = {};
1853 applyOptions(chalk, options8);
1854 chalk.template = function() {
1855 const args = [].slice.call(arguments);
1856 return chalkTag.apply(null, [chalk.template].concat(args));
1857 };
1858 Object.setPrototypeOf(chalk, Chalk.prototype);
1859 Object.setPrototypeOf(chalk.template, chalk);
1860 chalk.template.constructor = Chalk;
1861 return chalk.template;
1862 }
1863 applyOptions(this, options8);
1864 }
1865 if (isSimpleWindowsTerm) {
1866 ansiStyles.blue.open = "\x1B[94m";
1867 }
1868 for (const key of Object.keys(ansiStyles)) {
1869 ansiStyles[key].closeRe = new RegExp(escapeStringRegexp2(ansiStyles[key].close), "g");
1870 styles[key] = {
1871 get() {
1872 const codes2 = ansiStyles[key];
1873 return build.call(this, this._styles ? this._styles.concat(codes2) : [codes2], this._empty, key);
1874 }
1875 };
1876 }
1877 styles.visible = {
1878 get() {
1879 return build.call(this, this._styles || [], true, "visible");
1880 }
1881 };
1882 ansiStyles.color.closeRe = new RegExp(escapeStringRegexp2(ansiStyles.color.close), "g");
1883 for (const model of Object.keys(ansiStyles.color.ansi)) {
1884 if (skipModels.has(model)) {
1885 continue;
1886 }
1887 styles[model] = {
1888 get() {
1889 const level = this.level;
1890 return function() {
1891 const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments);
1892 const codes2 = {
1893 open,
1894 close: ansiStyles.color.close,
1895 closeRe: ansiStyles.color.closeRe
1896 };
1897 return build.call(this, this._styles ? this._styles.concat(codes2) : [codes2], this._empty, model);
1898 };
1899 }
1900 };
1901 }
1902 ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp2(ansiStyles.bgColor.close), "g");
1903 for (const model of Object.keys(ansiStyles.bgColor.ansi)) {
1904 if (skipModels.has(model)) {
1905 continue;
1906 }
1907 const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
1908 styles[bgModel] = {
1909 get() {
1910 const level = this.level;
1911 return function() {
1912 const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments);
1913 const codes2 = {
1914 open,
1915 close: ansiStyles.bgColor.close,
1916 closeRe: ansiStyles.bgColor.closeRe
1917 };
1918 return build.call(this, this._styles ? this._styles.concat(codes2) : [codes2], this._empty, model);
1919 };
1920 }
1921 };
1922 }
1923 var proto = Object.defineProperties(() => {
1924 }, styles);
1925 function build(_styles, _empty, key) {
1926 const builder = function() {
1927 return applyStyle.apply(builder, arguments);
1928 };
1929 builder._styles = _styles;
1930 builder._empty = _empty;
1931 const self = this;
1932 Object.defineProperty(builder, "level", {
1933 enumerable: true,
1934 get() {
1935 return self.level;
1936 },
1937 set(level) {
1938 self.level = level;
1939 }
1940 });
1941 Object.defineProperty(builder, "enabled", {
1942 enumerable: true,
1943 get() {
1944 return self.enabled;
1945 },
1946 set(enabled) {
1947 self.enabled = enabled;
1948 }
1949 });
1950 builder.hasGrey = this.hasGrey || key === "gray" || key === "grey";
1951 builder.__proto__ = proto;
1952 return builder;
1953 }
1954 function applyStyle() {
1955 const args = arguments;
1956 const argsLen = args.length;
1957 let str = String(arguments[0]);
1958 if (argsLen === 0) {
1959 return "";
1960 }
1961 if (argsLen > 1) {
1962 for (let a = 1; a < argsLen; a++) {
1963 str += " " + args[a];
1964 }
1965 }
1966 if (!this.enabled || this.level <= 0 || !str) {
1967 return this._empty ? "" : str;
1968 }
1969 const originalDim = ansiStyles.dim.open;
1970 if (isSimpleWindowsTerm && this.hasGrey) {
1971 ansiStyles.dim.open = "";
1972 }
1973 for (const code of this._styles.slice().reverse()) {
1974 str = code.open + str.replace(code.closeRe, code.open) + code.close;
1975 str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`);
1976 }
1977 ansiStyles.dim.open = originalDim;
1978 return str;
1979 }
1980 function chalkTag(chalk, strings) {
1981 if (!Array.isArray(strings)) {
1982 return [].slice.call(arguments, 1).join(" ");
1983 }
1984 const args = [].slice.call(arguments, 2);
1985 const parts = [strings.raw[0]];
1986 for (let i = 1; i < strings.length; i++) {
1987 parts.push(String(args[i - 1]).replace(/[{}\\]/g, "\\$&"));
1988 parts.push(String(strings.raw[i]));
1989 }
1990 return template(chalk, parts.join(""));
1991 }
1992 Object.defineProperties(Chalk.prototype, styles);
1993 module.exports = Chalk();
1994 module.exports.supportsColor = stdoutColor;
1995 module.exports.default = module.exports;
1996 }
1997});
1998
1999// node_modules/vnopts/lib/handlers/deprecated/common.js
2000var require_common = __commonJS({
2001 "node_modules/vnopts/lib/handlers/deprecated/common.js"(exports) {
2002 "use strict";
2003 Object.defineProperty(exports, "__esModule", { value: true });
2004 var chalk_1 = require_chalk();
2005 exports.commonDeprecatedHandler = (keyOrPair, redirectTo, { descriptor }) => {
2006 const messages2 = [
2007 `${chalk_1.default.yellow(typeof keyOrPair === "string" ? descriptor.key(keyOrPair) : descriptor.pair(keyOrPair))} is deprecated`
2008 ];
2009 if (redirectTo) {
2010 messages2.push(`we now treat it as ${chalk_1.default.blue(typeof redirectTo === "string" ? descriptor.key(redirectTo) : descriptor.pair(redirectTo))}`);
2011 }
2012 return messages2.join("; ") + ".";
2013 };
2014 }
2015});
2016
2017// node_modules/vnopts/lib/handlers/deprecated/index.js
2018var require_deprecated = __commonJS({
2019 "node_modules/vnopts/lib/handlers/deprecated/index.js"(exports) {
2020 "use strict";
2021 Object.defineProperty(exports, "__esModule", { value: true });
2022 var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
2023 tslib_1.__exportStar(require_common(), exports);
2024 }
2025});
2026
2027// node_modules/vnopts/lib/handlers/invalid/common.js
2028var require_common2 = __commonJS({
2029 "node_modules/vnopts/lib/handlers/invalid/common.js"(exports) {
2030 "use strict";
2031 Object.defineProperty(exports, "__esModule", { value: true });
2032 var chalk_1 = require_chalk();
2033 exports.commonInvalidHandler = (key, value, utils) => [
2034 `Invalid ${chalk_1.default.red(utils.descriptor.key(key))} value.`,
2035 `Expected ${chalk_1.default.blue(utils.schemas[key].expected(utils))},`,
2036 `but received ${chalk_1.default.red(utils.descriptor.value(value))}.`
2037 ].join(" ");
2038 }
2039});
2040
2041// node_modules/vnopts/lib/handlers/invalid/index.js
2042var require_invalid = __commonJS({
2043 "node_modules/vnopts/lib/handlers/invalid/index.js"(exports) {
2044 "use strict";
2045 Object.defineProperty(exports, "__esModule", { value: true });
2046 var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
2047 tslib_1.__exportStar(require_common2(), exports);
2048 }
2049});
2050
2051// node_modules/vnopts/node_modules/leven/index.js
2052var require_leven = __commonJS({
2053 "node_modules/vnopts/node_modules/leven/index.js"(exports, module) {
2054 "use strict";
2055 var arr = [];
2056 var charCodeCache = [];
2057 module.exports = function(a, b) {
2058 if (a === b) {
2059 return 0;
2060 }
2061 var swap = a;
2062 if (a.length > b.length) {
2063 a = b;
2064 b = swap;
2065 }
2066 var aLen = a.length;
2067 var bLen = b.length;
2068 if (aLen === 0) {
2069 return bLen;
2070 }
2071 if (bLen === 0) {
2072 return aLen;
2073 }
2074 while (aLen > 0 && a.charCodeAt(~-aLen) === b.charCodeAt(~-bLen)) {
2075 aLen--;
2076 bLen--;
2077 }
2078 if (aLen === 0) {
2079 return bLen;
2080 }
2081 var start = 0;
2082 while (start < aLen && a.charCodeAt(start) === b.charCodeAt(start)) {
2083 start++;
2084 }
2085 aLen -= start;
2086 bLen -= start;
2087 if (aLen === 0) {
2088 return bLen;
2089 }
2090 var bCharCode;
2091 var ret;
2092 var tmp;
2093 var tmp2;
2094 var i = 0;
2095 var j = 0;
2096 while (i < aLen) {
2097 charCodeCache[start + i] = a.charCodeAt(start + i);
2098 arr[i] = ++i;
2099 }
2100 while (j < bLen) {
2101 bCharCode = b.charCodeAt(start + j);
2102 tmp = j++;
2103 ret = j;
2104 for (i = 0; i < aLen; i++) {
2105 tmp2 = bCharCode === charCodeCache[start + i] ? tmp : tmp + 1;
2106 tmp = arr[i];
2107 ret = arr[i] = tmp > ret ? tmp2 > ret ? ret + 1 : tmp2 : tmp2 > tmp ? tmp + 1 : tmp2;
2108 }
2109 }
2110 return ret;
2111 };
2112 }
2113});
2114
2115// node_modules/vnopts/lib/handlers/unknown/leven.js
2116var require_leven2 = __commonJS({
2117 "node_modules/vnopts/lib/handlers/unknown/leven.js"(exports) {
2118 "use strict";
2119 Object.defineProperty(exports, "__esModule", { value: true });
2120 var chalk_1 = require_chalk();
2121 var leven = require_leven();
2122 exports.levenUnknownHandler = (key, value, { descriptor, logger, schemas }) => {
2123 const messages2 = [
2124 `Ignored unknown option ${chalk_1.default.yellow(descriptor.pair({ key, value }))}.`
2125 ];
2126 const suggestion = Object.keys(schemas).sort().find((knownKey) => leven(key, knownKey) < 3);
2127 if (suggestion) {
2128 messages2.push(`Did you mean ${chalk_1.default.blue(descriptor.key(suggestion))}?`);
2129 }
2130 logger.warn(messages2.join(" "));
2131 };
2132 }
2133});
2134
2135// node_modules/vnopts/lib/handlers/unknown/index.js
2136var require_unknown = __commonJS({
2137 "node_modules/vnopts/lib/handlers/unknown/index.js"(exports) {
2138 "use strict";
2139 Object.defineProperty(exports, "__esModule", { value: true });
2140 var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
2141 tslib_1.__exportStar(require_leven2(), exports);
2142 }
2143});
2144
2145// node_modules/vnopts/lib/handlers/index.js
2146var require_handlers = __commonJS({
2147 "node_modules/vnopts/lib/handlers/index.js"(exports) {
2148 "use strict";
2149 Object.defineProperty(exports, "__esModule", { value: true });
2150 var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
2151 tslib_1.__exportStar(require_deprecated(), exports);
2152 tslib_1.__exportStar(require_invalid(), exports);
2153 tslib_1.__exportStar(require_unknown(), exports);
2154 }
2155});
2156
2157// node_modules/vnopts/lib/schema.js
2158var require_schema = __commonJS({
2159 "node_modules/vnopts/lib/schema.js"(exports) {
2160 "use strict";
2161 Object.defineProperty(exports, "__esModule", { value: true });
2162 var HANDLER_KEYS = [
2163 "default",
2164 "expected",
2165 "validate",
2166 "deprecated",
2167 "forward",
2168 "redirect",
2169 "overlap",
2170 "preprocess",
2171 "postprocess"
2172 ];
2173 function createSchema(SchemaConstructor, parameters) {
2174 const schema = new SchemaConstructor(parameters);
2175 const subSchema = Object.create(schema);
2176 for (const handlerKey of HANDLER_KEYS) {
2177 if (handlerKey in parameters) {
2178 subSchema[handlerKey] = normalizeHandler(parameters[handlerKey], schema, Schema.prototype[handlerKey].length);
2179 }
2180 }
2181 return subSchema;
2182 }
2183 exports.createSchema = createSchema;
2184 var Schema = class {
2185 constructor(parameters) {
2186 this.name = parameters.name;
2187 }
2188 static create(parameters) {
2189 return createSchema(this, parameters);
2190 }
2191 default(_utils) {
2192 return void 0;
2193 }
2194 // istanbul ignore next: this is actually an abstract method but we need a placeholder to get `function.length`
2195 expected(_utils) {
2196 return "nothing";
2197 }
2198 // istanbul ignore next: this is actually an abstract method but we need a placeholder to get `function.length`
2199 validate(_value, _utils) {
2200 return false;
2201 }
2202 deprecated(_value, _utils) {
2203 return false;
2204 }
2205 forward(_value, _utils) {
2206 return void 0;
2207 }
2208 redirect(_value, _utils) {
2209 return void 0;
2210 }
2211 overlap(currentValue, _newValue, _utils) {
2212 return currentValue;
2213 }
2214 preprocess(value, _utils) {
2215 return value;
2216 }
2217 postprocess(value, _utils) {
2218 return value;
2219 }
2220 };
2221 exports.Schema = Schema;
2222 function normalizeHandler(handler, superSchema, handlerArgumentsLength) {
2223 return typeof handler === "function" ? (...args) => handler(...args.slice(0, handlerArgumentsLength - 1), superSchema, ...args.slice(handlerArgumentsLength - 1)) : () => handler;
2224 }
2225 }
2226});
2227
2228// node_modules/vnopts/lib/schemas/alias.js
2229var require_alias = __commonJS({
2230 "node_modules/vnopts/lib/schemas/alias.js"(exports) {
2231 "use strict";
2232 Object.defineProperty(exports, "__esModule", { value: true });
2233 var schema_1 = require_schema();
2234 var AliasSchema = class extends schema_1.Schema {
2235 constructor(parameters) {
2236 super(parameters);
2237 this._sourceName = parameters.sourceName;
2238 }
2239 expected(utils) {
2240 return utils.schemas[this._sourceName].expected(utils);
2241 }
2242 validate(value, utils) {
2243 return utils.schemas[this._sourceName].validate(value, utils);
2244 }
2245 redirect(_value, _utils) {
2246 return this._sourceName;
2247 }
2248 };
2249 exports.AliasSchema = AliasSchema;
2250 }
2251});
2252
2253// node_modules/vnopts/lib/schemas/any.js
2254var require_any = __commonJS({
2255 "node_modules/vnopts/lib/schemas/any.js"(exports) {
2256 "use strict";
2257 Object.defineProperty(exports, "__esModule", { value: true });
2258 var schema_1 = require_schema();
2259 var AnySchema = class extends schema_1.Schema {
2260 expected() {
2261 return "anything";
2262 }
2263 validate() {
2264 return true;
2265 }
2266 };
2267 exports.AnySchema = AnySchema;
2268 }
2269});
2270
2271// node_modules/vnopts/lib/schemas/array.js
2272var require_array = __commonJS({
2273 "node_modules/vnopts/lib/schemas/array.js"(exports) {
2274 "use strict";
2275 Object.defineProperty(exports, "__esModule", { value: true });
2276 var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
2277 var schema_1 = require_schema();
2278 var ArraySchema = class extends schema_1.Schema {
2279 constructor(_a) {
2280 var { valueSchema, name = valueSchema.name } = _a, handlers = tslib_1.__rest(_a, ["valueSchema", "name"]);
2281 super(Object.assign({}, handlers, { name }));
2282 this._valueSchema = valueSchema;
2283 }
2284 expected(utils) {
2285 return `an array of ${this._valueSchema.expected(utils)}`;
2286 }
2287 validate(value, utils) {
2288 if (!Array.isArray(value)) {
2289 return false;
2290 }
2291 const invalidValues = [];
2292 for (const subValue of value) {
2293 const subValidateResult = utils.normalizeValidateResult(this._valueSchema.validate(subValue, utils), subValue);
2294 if (subValidateResult !== true) {
2295 invalidValues.push(subValidateResult.value);
2296 }
2297 }
2298 return invalidValues.length === 0 ? true : { value: invalidValues };
2299 }
2300 deprecated(value, utils) {
2301 const deprecatedResult = [];
2302 for (const subValue of value) {
2303 const subDeprecatedResult = utils.normalizeDeprecatedResult(this._valueSchema.deprecated(subValue, utils), subValue);
2304 if (subDeprecatedResult !== false) {
2305 deprecatedResult.push(...subDeprecatedResult.map(({ value: deprecatedValue }) => ({
2306 value: [deprecatedValue]
2307 })));
2308 }
2309 }
2310 return deprecatedResult;
2311 }
2312 forward(value, utils) {
2313 const forwardResult = [];
2314 for (const subValue of value) {
2315 const subForwardResult = utils.normalizeForwardResult(this._valueSchema.forward(subValue, utils), subValue);
2316 forwardResult.push(...subForwardResult.map(wrapTransferResult));
2317 }
2318 return forwardResult;
2319 }
2320 redirect(value, utils) {
2321 const remain = [];
2322 const redirect = [];
2323 for (const subValue of value) {
2324 const subRedirectResult = utils.normalizeRedirectResult(this._valueSchema.redirect(subValue, utils), subValue);
2325 if ("remain" in subRedirectResult) {
2326 remain.push(subRedirectResult.remain);
2327 }
2328 redirect.push(...subRedirectResult.redirect.map(wrapTransferResult));
2329 }
2330 return remain.length === 0 ? { redirect } : { redirect, remain };
2331 }
2332 overlap(currentValue, newValue) {
2333 return currentValue.concat(newValue);
2334 }
2335 };
2336 exports.ArraySchema = ArraySchema;
2337 function wrapTransferResult({ from, to }) {
2338 return { from: [from], to };
2339 }
2340 }
2341});
2342
2343// node_modules/vnopts/lib/schemas/boolean.js
2344var require_boolean = __commonJS({
2345 "node_modules/vnopts/lib/schemas/boolean.js"(exports) {
2346 "use strict";
2347 Object.defineProperty(exports, "__esModule", { value: true });
2348 var schema_1 = require_schema();
2349 var BooleanSchema = class extends schema_1.Schema {
2350 expected() {
2351 return "true or false";
2352 }
2353 validate(value) {
2354 return typeof value === "boolean";
2355 }
2356 };
2357 exports.BooleanSchema = BooleanSchema;
2358 }
2359});
2360
2361// node_modules/vnopts/lib/utils.js
2362var require_utils = __commonJS({
2363 "node_modules/vnopts/lib/utils.js"(exports) {
2364 "use strict";
2365 Object.defineProperty(exports, "__esModule", { value: true });
2366 function recordFromArray(array, mainKey) {
2367 const record = /* @__PURE__ */ Object.create(null);
2368 for (const value of array) {
2369 const key = value[mainKey];
2370 if (record[key]) {
2371 throw new Error(`Duplicate ${mainKey} ${JSON.stringify(key)}`);
2372 }
2373 record[key] = value;
2374 }
2375 return record;
2376 }
2377 exports.recordFromArray = recordFromArray;
2378 function mapFromArray(array, mainKey) {
2379 const map = /* @__PURE__ */ new Map();
2380 for (const value of array) {
2381 const key = value[mainKey];
2382 if (map.has(key)) {
2383 throw new Error(`Duplicate ${mainKey} ${JSON.stringify(key)}`);
2384 }
2385 map.set(key, value);
2386 }
2387 return map;
2388 }
2389 exports.mapFromArray = mapFromArray;
2390 function createAutoChecklist() {
2391 const map = /* @__PURE__ */ Object.create(null);
2392 return (id) => {
2393 const idString = JSON.stringify(id);
2394 if (map[idString]) {
2395 return true;
2396 }
2397 map[idString] = true;
2398 return false;
2399 };
2400 }
2401 exports.createAutoChecklist = createAutoChecklist;
2402 function partition2(array, predicate) {
2403 const trueArray = [];
2404 const falseArray = [];
2405 for (const value of array) {
2406 if (predicate(value)) {
2407 trueArray.push(value);
2408 } else {
2409 falseArray.push(value);
2410 }
2411 }
2412 return [trueArray, falseArray];
2413 }
2414 exports.partition = partition2;
2415 function isInt(value) {
2416 return value === Math.floor(value);
2417 }
2418 exports.isInt = isInt;
2419 function comparePrimitive(a, b) {
2420 if (a === b) {
2421 return 0;
2422 }
2423 const typeofA = typeof a;
2424 const typeofB = typeof b;
2425 const orders = [
2426 "undefined",
2427 "object",
2428 "boolean",
2429 "number",
2430 "string"
2431 ];
2432 if (typeofA !== typeofB) {
2433 return orders.indexOf(typeofA) - orders.indexOf(typeofB);
2434 }
2435 if (typeofA !== "string") {
2436 return Number(a) - Number(b);
2437 }
2438 return a.localeCompare(b);
2439 }
2440 exports.comparePrimitive = comparePrimitive;
2441 function normalizeDefaultResult(result) {
2442 return result === void 0 ? {} : result;
2443 }
2444 exports.normalizeDefaultResult = normalizeDefaultResult;
2445 function normalizeValidateResult(result, value) {
2446 return result === true ? true : result === false ? { value } : result;
2447 }
2448 exports.normalizeValidateResult = normalizeValidateResult;
2449 function normalizeDeprecatedResult(result, value, doNotNormalizeTrue = false) {
2450 return result === false ? false : result === true ? doNotNormalizeTrue ? true : [{ value }] : "value" in result ? [result] : result.length === 0 ? false : result;
2451 }
2452 exports.normalizeDeprecatedResult = normalizeDeprecatedResult;
2453 function normalizeTransferResult(result, value) {
2454 return typeof result === "string" || "key" in result ? { from: value, to: result } : "from" in result ? { from: result.from, to: result.to } : { from: value, to: result.to };
2455 }
2456 exports.normalizeTransferResult = normalizeTransferResult;
2457 function normalizeForwardResult(result, value) {
2458 return result === void 0 ? [] : Array.isArray(result) ? result.map((transferResult) => normalizeTransferResult(transferResult, value)) : [normalizeTransferResult(result, value)];
2459 }
2460 exports.normalizeForwardResult = normalizeForwardResult;
2461 function normalizeRedirectResult(result, value) {
2462 const redirect = normalizeForwardResult(typeof result === "object" && "redirect" in result ? result.redirect : result, value);
2463 return redirect.length === 0 ? { remain: value, redirect } : typeof result === "object" && "remain" in result ? { remain: result.remain, redirect } : { redirect };
2464 }
2465 exports.normalizeRedirectResult = normalizeRedirectResult;
2466 }
2467});
2468
2469// node_modules/vnopts/lib/schemas/choice.js
2470var require_choice = __commonJS({
2471 "node_modules/vnopts/lib/schemas/choice.js"(exports) {
2472 "use strict";
2473 Object.defineProperty(exports, "__esModule", { value: true });
2474 var schema_1 = require_schema();
2475 var utils_1 = require_utils();
2476 var ChoiceSchema = class extends schema_1.Schema {
2477 constructor(parameters) {
2478 super(parameters);
2479 this._choices = utils_1.mapFromArray(parameters.choices.map((choice) => choice && typeof choice === "object" ? choice : { value: choice }), "value");
2480 }
2481 expected({ descriptor }) {
2482 const choiceValues = Array.from(this._choices.keys()).map((value) => this._choices.get(value)).filter((choiceInfo) => !choiceInfo.deprecated).map((choiceInfo) => choiceInfo.value).sort(utils_1.comparePrimitive).map(descriptor.value);
2483 const head = choiceValues.slice(0, -2);
2484 const tail = choiceValues.slice(-2);
2485 return head.concat(tail.join(" or ")).join(", ");
2486 }
2487 validate(value) {
2488 return this._choices.has(value);
2489 }
2490 deprecated(value) {
2491 const choiceInfo = this._choices.get(value);
2492 return choiceInfo && choiceInfo.deprecated ? { value } : false;
2493 }
2494 forward(value) {
2495 const choiceInfo = this._choices.get(value);
2496 return choiceInfo ? choiceInfo.forward : void 0;
2497 }
2498 redirect(value) {
2499 const choiceInfo = this._choices.get(value);
2500 return choiceInfo ? choiceInfo.redirect : void 0;
2501 }
2502 };
2503 exports.ChoiceSchema = ChoiceSchema;
2504 }
2505});
2506
2507// node_modules/vnopts/lib/schemas/number.js
2508var require_number = __commonJS({
2509 "node_modules/vnopts/lib/schemas/number.js"(exports) {
2510 "use strict";
2511 Object.defineProperty(exports, "__esModule", { value: true });
2512 var schema_1 = require_schema();
2513 var NumberSchema = class extends schema_1.Schema {
2514 expected() {
2515 return "a number";
2516 }
2517 validate(value, _utils) {
2518 return typeof value === "number";
2519 }
2520 };
2521 exports.NumberSchema = NumberSchema;
2522 }
2523});
2524
2525// node_modules/vnopts/lib/schemas/integer.js
2526var require_integer = __commonJS({
2527 "node_modules/vnopts/lib/schemas/integer.js"(exports) {
2528 "use strict";
2529 Object.defineProperty(exports, "__esModule", { value: true });
2530 var utils_1 = require_utils();
2531 var number_1 = require_number();
2532 var IntegerSchema = class extends number_1.NumberSchema {
2533 expected() {
2534 return "an integer";
2535 }
2536 validate(value, utils) {
2537 return utils.normalizeValidateResult(super.validate(value, utils), value) === true && utils_1.isInt(value);
2538 }
2539 };
2540 exports.IntegerSchema = IntegerSchema;
2541 }
2542});
2543
2544// node_modules/vnopts/lib/schemas/string.js
2545var require_string = __commonJS({
2546 "node_modules/vnopts/lib/schemas/string.js"(exports) {
2547 "use strict";
2548 Object.defineProperty(exports, "__esModule", { value: true });
2549 var schema_1 = require_schema();
2550 var StringSchema = class extends schema_1.Schema {
2551 expected() {
2552 return "a string";
2553 }
2554 validate(value) {
2555 return typeof value === "string";
2556 }
2557 };
2558 exports.StringSchema = StringSchema;
2559 }
2560});
2561
2562// node_modules/vnopts/lib/schemas/index.js
2563var require_schemas = __commonJS({
2564 "node_modules/vnopts/lib/schemas/index.js"(exports) {
2565 "use strict";
2566 Object.defineProperty(exports, "__esModule", { value: true });
2567 var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
2568 tslib_1.__exportStar(require_alias(), exports);
2569 tslib_1.__exportStar(require_any(), exports);
2570 tslib_1.__exportStar(require_array(), exports);
2571 tslib_1.__exportStar(require_boolean(), exports);
2572 tslib_1.__exportStar(require_choice(), exports);
2573 tslib_1.__exportStar(require_integer(), exports);
2574 tslib_1.__exportStar(require_number(), exports);
2575 tslib_1.__exportStar(require_string(), exports);
2576 }
2577});
2578
2579// node_modules/vnopts/lib/defaults.js
2580var require_defaults = __commonJS({
2581 "node_modules/vnopts/lib/defaults.js"(exports) {
2582 "use strict";
2583 Object.defineProperty(exports, "__esModule", { value: true });
2584 var api_1 = require_api();
2585 var common_1 = require_common();
2586 var invalid_1 = require_invalid();
2587 var leven_1 = require_leven2();
2588 exports.defaultDescriptor = api_1.apiDescriptor;
2589 exports.defaultUnknownHandler = leven_1.levenUnknownHandler;
2590 exports.defaultInvalidHandler = invalid_1.commonInvalidHandler;
2591 exports.defaultDeprecatedHandler = common_1.commonDeprecatedHandler;
2592 }
2593});
2594
2595// node_modules/vnopts/lib/normalize.js
2596var require_normalize = __commonJS({
2597 "node_modules/vnopts/lib/normalize.js"(exports) {
2598 "use strict";
2599 Object.defineProperty(exports, "__esModule", { value: true });
2600 var defaults_1 = require_defaults();
2601 var utils_1 = require_utils();
2602 exports.normalize = (options8, schemas, opts) => new Normalizer(schemas, opts).normalize(options8);
2603 var Normalizer = class {
2604 constructor(schemas, opts) {
2605 const { logger = console, descriptor = defaults_1.defaultDescriptor, unknown = defaults_1.defaultUnknownHandler, invalid = defaults_1.defaultInvalidHandler, deprecated = defaults_1.defaultDeprecatedHandler } = opts || {};
2606 this._utils = {
2607 descriptor,
2608 logger: (
2609 /* istanbul ignore next */
2610 logger || { warn: () => {
2611 } }
2612 ),
2613 schemas: utils_1.recordFromArray(schemas, "name"),
2614 normalizeDefaultResult: utils_1.normalizeDefaultResult,
2615 normalizeDeprecatedResult: utils_1.normalizeDeprecatedResult,
2616 normalizeForwardResult: utils_1.normalizeForwardResult,
2617 normalizeRedirectResult: utils_1.normalizeRedirectResult,
2618 normalizeValidateResult: utils_1.normalizeValidateResult
2619 };
2620 this._unknownHandler = unknown;
2621 this._invalidHandler = invalid;
2622 this._deprecatedHandler = deprecated;
2623 this.cleanHistory();
2624 }
2625 cleanHistory() {
2626 this._hasDeprecationWarned = utils_1.createAutoChecklist();
2627 }
2628 normalize(options8) {
2629 const normalized = {};
2630 const restOptionsArray = [options8];
2631 const applyNormalization = () => {
2632 while (restOptionsArray.length !== 0) {
2633 const currentOptions = restOptionsArray.shift();
2634 const transferredOptionsArray = this._applyNormalization(currentOptions, normalized);
2635 restOptionsArray.push(...transferredOptionsArray);
2636 }
2637 };
2638 applyNormalization();
2639 for (const key of Object.keys(this._utils.schemas)) {
2640 const schema = this._utils.schemas[key];
2641 if (!(key in normalized)) {
2642 const defaultResult = utils_1.normalizeDefaultResult(schema.default(this._utils));
2643 if ("value" in defaultResult) {
2644 restOptionsArray.push({ [key]: defaultResult.value });
2645 }
2646 }
2647 }
2648 applyNormalization();
2649 for (const key of Object.keys(this._utils.schemas)) {
2650 const schema = this._utils.schemas[key];
2651 if (key in normalized) {
2652 normalized[key] = schema.postprocess(normalized[key], this._utils);
2653 }
2654 }
2655 return normalized;
2656 }
2657 _applyNormalization(options8, normalized) {
2658 const transferredOptionsArray = [];
2659 const [knownOptionNames, unknownOptionNames] = utils_1.partition(Object.keys(options8), (key) => key in this._utils.schemas);
2660 for (const key of knownOptionNames) {
2661 const schema = this._utils.schemas[key];
2662 const value = schema.preprocess(options8[key], this._utils);
2663 const validateResult = utils_1.normalizeValidateResult(schema.validate(value, this._utils), value);
2664 if (validateResult !== true) {
2665 const { value: invalidValue } = validateResult;
2666 const errorMessageOrError = this._invalidHandler(key, invalidValue, this._utils);
2667 throw typeof errorMessageOrError === "string" ? new Error(errorMessageOrError) : (
2668 /* istanbul ignore next*/
2669 errorMessageOrError
2670 );
2671 }
2672 const appendTransferredOptions = ({ from, to }) => {
2673 transferredOptionsArray.push(typeof to === "string" ? { [to]: from } : { [to.key]: to.value });
2674 };
2675 const warnDeprecated = ({ value: currentValue, redirectTo }) => {
2676 const deprecatedResult = utils_1.normalizeDeprecatedResult(
2677 schema.deprecated(currentValue, this._utils),
2678 value,
2679 /* doNotNormalizeTrue */
2680 true
2681 );
2682 if (deprecatedResult === false) {
2683 return;
2684 }
2685 if (deprecatedResult === true) {
2686 if (!this._hasDeprecationWarned(key)) {
2687 this._utils.logger.warn(this._deprecatedHandler(key, redirectTo, this._utils));
2688 }
2689 } else {
2690 for (const { value: deprecatedValue } of deprecatedResult) {
2691 const pair = { key, value: deprecatedValue };
2692 if (!this._hasDeprecationWarned(pair)) {
2693 const redirectToPair = typeof redirectTo === "string" ? { key: redirectTo, value: deprecatedValue } : redirectTo;
2694 this._utils.logger.warn(this._deprecatedHandler(pair, redirectToPair, this._utils));
2695 }
2696 }
2697 }
2698 };
2699 const forwardResult = utils_1.normalizeForwardResult(schema.forward(value, this._utils), value);
2700 forwardResult.forEach(appendTransferredOptions);
2701 const redirectResult = utils_1.normalizeRedirectResult(schema.redirect(value, this._utils), value);
2702 redirectResult.redirect.forEach(appendTransferredOptions);
2703 if ("remain" in redirectResult) {
2704 const remainingValue = redirectResult.remain;
2705 normalized[key] = key in normalized ? schema.overlap(normalized[key], remainingValue, this._utils) : remainingValue;
2706 warnDeprecated({ value: remainingValue });
2707 }
2708 for (const { from, to } of redirectResult.redirect) {
2709 warnDeprecated({ value: from, redirectTo: to });
2710 }
2711 }
2712 for (const key of unknownOptionNames) {
2713 const value = options8[key];
2714 const unknownResult = this._unknownHandler(key, value, this._utils);
2715 if (unknownResult) {
2716 for (const unknownKey of Object.keys(unknownResult)) {
2717 const unknownOption = { [unknownKey]: unknownResult[unknownKey] };
2718 if (unknownKey in this._utils.schemas) {
2719 transferredOptionsArray.push(unknownOption);
2720 } else {
2721 Object.assign(normalized, unknownOption);
2722 }
2723 }
2724 }
2725 }
2726 return transferredOptionsArray;
2727 }
2728 };
2729 exports.Normalizer = Normalizer;
2730 }
2731});
2732
2733// node_modules/vnopts/lib/index.js
2734var require_lib = __commonJS({
2735 "node_modules/vnopts/lib/index.js"(exports) {
2736 "use strict";
2737 Object.defineProperty(exports, "__esModule", { value: true });
2738 var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
2739 tslib_1.__exportStar(require_descriptors(), exports);
2740 tslib_1.__exportStar(require_handlers(), exports);
2741 tslib_1.__exportStar(require_schemas(), exports);
2742 tslib_1.__exportStar(require_normalize(), exports);
2743 tslib_1.__exportStar(require_schema(), exports);
2744 }
2745});
2746
2747// node_modules/fast-glob/out/utils/array.js
2748var require_array2 = __commonJS({
2749 "node_modules/fast-glob/out/utils/array.js"(exports) {
2750 "use strict";
2751 Object.defineProperty(exports, "__esModule", { value: true });
2752 exports.splitWhen = exports.flatten = void 0;
2753 function flatten(items) {
2754 return items.reduce((collection, item) => [].concat(collection, item), []);
2755 }
2756 exports.flatten = flatten;
2757 function splitWhen(items, predicate) {
2758 const result = [[]];
2759 let groupIndex = 0;
2760 for (const item of items) {
2761 if (predicate(item)) {
2762 groupIndex++;
2763 result[groupIndex] = [];
2764 } else {
2765 result[groupIndex].push(item);
2766 }
2767 }
2768 return result;
2769 }
2770 exports.splitWhen = splitWhen;
2771 }
2772});
2773
2774// node_modules/fast-glob/out/utils/errno.js
2775var require_errno = __commonJS({
2776 "node_modules/fast-glob/out/utils/errno.js"(exports) {
2777 "use strict";
2778 Object.defineProperty(exports, "__esModule", { value: true });
2779 exports.isEnoentCodeError = void 0;
2780 function isEnoentCodeError(error) {
2781 return error.code === "ENOENT";
2782 }
2783 exports.isEnoentCodeError = isEnoentCodeError;
2784 }
2785});
2786
2787// node_modules/fast-glob/out/utils/fs.js
2788var require_fs = __commonJS({
2789 "node_modules/fast-glob/out/utils/fs.js"(exports) {
2790 "use strict";
2791 Object.defineProperty(exports, "__esModule", { value: true });
2792 exports.createDirentFromStats = void 0;
2793 var DirentFromStats = class {
2794 constructor(name, stats) {
2795 this.name = name;
2796 this.isBlockDevice = stats.isBlockDevice.bind(stats);
2797 this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
2798 this.isDirectory = stats.isDirectory.bind(stats);
2799 this.isFIFO = stats.isFIFO.bind(stats);
2800 this.isFile = stats.isFile.bind(stats);
2801 this.isSocket = stats.isSocket.bind(stats);
2802 this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
2803 }
2804 };
2805 function createDirentFromStats(name, stats) {
2806 return new DirentFromStats(name, stats);
2807 }
2808 exports.createDirentFromStats = createDirentFromStats;
2809 }
2810});
2811
2812// node_modules/fast-glob/out/utils/path.js
2813var require_path = __commonJS({
2814 "node_modules/fast-glob/out/utils/path.js"(exports) {
2815 "use strict";
2816 Object.defineProperty(exports, "__esModule", { value: true });
2817 exports.removeLeadingDotSegment = exports.escape = exports.makeAbsolute = exports.unixify = void 0;
2818 var path9 = __require("path");
2819 var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
2820 var UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;
2821 function unixify(filepath) {
2822 return filepath.replace(/\\/g, "/");
2823 }
2824 exports.unixify = unixify;
2825 function makeAbsolute(cwd, filepath) {
2826 return path9.resolve(cwd, filepath);
2827 }
2828 exports.makeAbsolute = makeAbsolute;
2829 function escape(pattern) {
2830 return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, "\\$2");
2831 }
2832 exports.escape = escape;
2833 function removeLeadingDotSegment(entry) {
2834 if (entry.charAt(0) === ".") {
2835 const secondCharactery = entry.charAt(1);
2836 if (secondCharactery === "/" || secondCharactery === "\\") {
2837 return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
2838 }
2839 }
2840 return entry;
2841 }
2842 exports.removeLeadingDotSegment = removeLeadingDotSegment;
2843 }
2844});
2845
2846// node_modules/is-extglob/index.js
2847var require_is_extglob = __commonJS({
2848 "node_modules/is-extglob/index.js"(exports, module) {
2849 module.exports = function isExtglob(str) {
2850 if (typeof str !== "string" || str === "") {
2851 return false;
2852 }
2853 var match;
2854 while (match = /(\\).|([@?!+*]\(.*\))/g.exec(str)) {
2855 if (match[2])
2856 return true;
2857 str = str.slice(match.index + match[0].length);
2858 }
2859 return false;
2860 };
2861 }
2862});
2863
2864// node_modules/is-glob/index.js
2865var require_is_glob = __commonJS({
2866 "node_modules/is-glob/index.js"(exports, module) {
2867 var isExtglob = require_is_extglob();
2868 var chars = { "{": "}", "(": ")", "[": "]" };
2869 var strictCheck = function(str) {
2870 if (str[0] === "!") {
2871 return true;
2872 }
2873 var index = 0;
2874 var pipeIndex = -2;
2875 var closeSquareIndex = -2;
2876 var closeCurlyIndex = -2;
2877 var closeParenIndex = -2;
2878 var backSlashIndex = -2;
2879 while (index < str.length) {
2880 if (str[index] === "*") {
2881 return true;
2882 }
2883 if (str[index + 1] === "?" && /[\].+)]/.test(str[index])) {
2884 return true;
2885 }
2886 if (closeSquareIndex !== -1 && str[index] === "[" && str[index + 1] !== "]") {
2887 if (closeSquareIndex < index) {
2888 closeSquareIndex = str.indexOf("]", index);
2889 }
2890 if (closeSquareIndex > index) {
2891 if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
2892 return true;
2893 }
2894 backSlashIndex = str.indexOf("\\", index);
2895 if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
2896 return true;
2897 }
2898 }
2899 }
2900 if (closeCurlyIndex !== -1 && str[index] === "{" && str[index + 1] !== "}") {
2901 closeCurlyIndex = str.indexOf("}", index);
2902 if (closeCurlyIndex > index) {
2903 backSlashIndex = str.indexOf("\\", index);
2904 if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) {
2905 return true;
2906 }
2907 }
2908 }
2909 if (closeParenIndex !== -1 && str[index] === "(" && str[index + 1] === "?" && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ")") {
2910 closeParenIndex = str.indexOf(")", index);
2911 if (closeParenIndex > index) {
2912 backSlashIndex = str.indexOf("\\", index);
2913 if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
2914 return true;
2915 }
2916 }
2917 }
2918 if (pipeIndex !== -1 && str[index] === "(" && str[index + 1] !== "|") {
2919 if (pipeIndex < index) {
2920 pipeIndex = str.indexOf("|", index);
2921 }
2922 if (pipeIndex !== -1 && str[pipeIndex + 1] !== ")") {
2923 closeParenIndex = str.indexOf(")", pipeIndex);
2924 if (closeParenIndex > pipeIndex) {
2925 backSlashIndex = str.indexOf("\\", pipeIndex);
2926 if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
2927 return true;
2928 }
2929 }
2930 }
2931 }
2932 if (str[index] === "\\") {
2933 var open = str[index + 1];
2934 index += 2;
2935 var close = chars[open];
2936 if (close) {
2937 var n = str.indexOf(close, index);
2938 if (n !== -1) {
2939 index = n + 1;
2940 }
2941 }
2942 if (str[index] === "!") {
2943 return true;
2944 }
2945 } else {
2946 index++;
2947 }
2948 }
2949 return false;
2950 };
2951 var relaxedCheck = function(str) {
2952 if (str[0] === "!") {
2953 return true;
2954 }
2955 var index = 0;
2956 while (index < str.length) {
2957 if (/[*?{}()[\]]/.test(str[index])) {
2958 return true;
2959 }
2960 if (str[index] === "\\") {
2961 var open = str[index + 1];
2962 index += 2;
2963 var close = chars[open];
2964 if (close) {
2965 var n = str.indexOf(close, index);
2966 if (n !== -1) {
2967 index = n + 1;
2968 }
2969 }
2970 if (str[index] === "!") {
2971 return true;
2972 }
2973 } else {
2974 index++;
2975 }
2976 }
2977 return false;
2978 };
2979 module.exports = function isGlob(str, options8) {
2980 if (typeof str !== "string" || str === "") {
2981 return false;
2982 }
2983 if (isExtglob(str)) {
2984 return true;
2985 }
2986 var check2 = strictCheck;
2987 if (options8 && options8.strict === false) {
2988 check2 = relaxedCheck;
2989 }
2990 return check2(str);
2991 };
2992 }
2993});
2994
2995// node_modules/glob-parent/index.js
2996var require_glob_parent = __commonJS({
2997 "node_modules/glob-parent/index.js"(exports, module) {
2998 "use strict";
2999 var isGlob = require_is_glob();
3000 var pathPosixDirname = __require("path").posix.dirname;
3001 var isWin32 = __require("os").platform() === "win32";
3002 var slash2 = "/";
3003 var backslash = /\\/g;
3004 var enclosure = /[\{\[].*[\}\]]$/;
3005 var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
3006 var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
3007 module.exports = function globParent(str, opts) {
3008 var options8 = Object.assign({ flipBackslashes: true }, opts);
3009 if (options8.flipBackslashes && isWin32 && str.indexOf(slash2) < 0) {
3010 str = str.replace(backslash, slash2);
3011 }
3012 if (enclosure.test(str)) {
3013 str += slash2;
3014 }
3015 str += "a";
3016 do {
3017 str = pathPosixDirname(str);
3018 } while (isGlob(str) || globby.test(str));
3019 return str.replace(escaped, "$1");
3020 };
3021 }
3022});
3023
3024// node_modules/braces/lib/utils.js
3025var require_utils2 = __commonJS({
3026 "node_modules/braces/lib/utils.js"(exports) {
3027 "use strict";
3028 exports.isInteger = (num) => {
3029 if (typeof num === "number") {
3030 return Number.isInteger(num);
3031 }
3032 if (typeof num === "string" && num.trim() !== "") {
3033 return Number.isInteger(Number(num));
3034 }
3035 return false;
3036 };
3037 exports.find = (node, type) => node.nodes.find((node2) => node2.type === type);
3038 exports.exceedsLimit = (min, max, step = 1, limit) => {
3039 if (limit === false)
3040 return false;
3041 if (!exports.isInteger(min) || !exports.isInteger(max))
3042 return false;
3043 return (Number(max) - Number(min)) / Number(step) >= limit;
3044 };
3045 exports.escapeNode = (block, n = 0, type) => {
3046 let node = block.nodes[n];
3047 if (!node)
3048 return;
3049 if (type && node.type === type || node.type === "open" || node.type === "close") {
3050 if (node.escaped !== true) {
3051 node.value = "\\" + node.value;
3052 node.escaped = true;
3053 }
3054 }
3055 };
3056 exports.encloseBrace = (node) => {
3057 if (node.type !== "brace")
3058 return false;
3059 if (node.commas >> 0 + node.ranges >> 0 === 0) {
3060 node.invalid = true;
3061 return true;
3062 }
3063 return false;
3064 };
3065 exports.isInvalidBrace = (block) => {
3066 if (block.type !== "brace")
3067 return false;
3068 if (block.invalid === true || block.dollar)
3069 return true;
3070 if (block.commas >> 0 + block.ranges >> 0 === 0) {
3071 block.invalid = true;
3072 return true;
3073 }
3074 if (block.open !== true || block.close !== true) {
3075 block.invalid = true;
3076 return true;
3077 }
3078 return false;
3079 };
3080 exports.isOpenOrClose = (node) => {
3081 if (node.type === "open" || node.type === "close") {
3082 return true;
3083 }
3084 return node.open === true || node.close === true;
3085 };
3086 exports.reduce = (nodes) => nodes.reduce((acc, node) => {
3087 if (node.type === "text")
3088 acc.push(node.value);
3089 if (node.type === "range")
3090 node.type = "text";
3091 return acc;
3092 }, []);
3093 exports.flatten = (...args) => {
3094 const result = [];
3095 const flat = (arr) => {
3096 for (let i = 0; i < arr.length; i++) {
3097 let ele = arr[i];
3098 Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele);
3099 }
3100 return result;
3101 };
3102 flat(args);
3103 return result;
3104 };
3105 }
3106});
3107
3108// node_modules/braces/lib/stringify.js
3109var require_stringify = __commonJS({
3110 "node_modules/braces/lib/stringify.js"(exports, module) {
3111 "use strict";
3112 var utils = require_utils2();
3113 module.exports = (ast, options8 = {}) => {
3114 let stringify = (node, parent = {}) => {
3115 let invalidBlock = options8.escapeInvalid && utils.isInvalidBrace(parent);
3116 let invalidNode = node.invalid === true && options8.escapeInvalid === true;
3117 let output = "";
3118 if (node.value) {
3119 if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
3120 return "\\" + node.value;
3121 }
3122 return node.value;
3123 }
3124 if (node.value) {
3125 return node.value;
3126 }
3127 if (node.nodes) {
3128 for (let child of node.nodes) {
3129 output += stringify(child);
3130 }
3131 }
3132 return output;
3133 };
3134 return stringify(ast);
3135 };
3136 }
3137});
3138
3139// node_modules/is-number/index.js
3140var require_is_number = __commonJS({
3141 "node_modules/is-number/index.js"(exports, module) {
3142 "use strict";
3143 module.exports = function(num) {
3144 if (typeof num === "number") {
3145 return num - num === 0;
3146 }
3147 if (typeof num === "string" && num.trim() !== "") {
3148 return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
3149 }
3150 return false;
3151 };
3152 }
3153});
3154
3155// node_modules/to-regex-range/index.js
3156var require_to_regex_range = __commonJS({
3157 "node_modules/to-regex-range/index.js"(exports, module) {
3158 "use strict";
3159 var isNumber = require_is_number();
3160 var toRegexRange = (min, max, options8) => {
3161 if (isNumber(min) === false) {
3162 throw new TypeError("toRegexRange: expected the first argument to be a number");
3163 }
3164 if (max === void 0 || min === max) {
3165 return String(min);
3166 }
3167 if (isNumber(max) === false) {
3168 throw new TypeError("toRegexRange: expected the second argument to be a number.");
3169 }
3170 let opts = { relaxZeros: true, ...options8 };
3171 if (typeof opts.strictZeros === "boolean") {
3172 opts.relaxZeros = opts.strictZeros === false;
3173 }
3174 let relax = String(opts.relaxZeros);
3175 let shorthand = String(opts.shorthand);
3176 let capture = String(opts.capture);
3177 let wrap = String(opts.wrap);
3178 let cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap;
3179 if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
3180 return toRegexRange.cache[cacheKey].result;
3181 }
3182 let a = Math.min(min, max);
3183 let b = Math.max(min, max);
3184 if (Math.abs(a - b) === 1) {
3185 let result = min + "|" + max;
3186 if (opts.capture) {
3187 return `(${result})`;
3188 }
3189 if (opts.wrap === false) {
3190 return result;
3191 }
3192 return `(?:${result})`;
3193 }
3194 let isPadded = hasPadding(min) || hasPadding(max);
3195 let state = { min, max, a, b };
3196 let positives = [];
3197 let negatives = [];
3198 if (isPadded) {
3199 state.isPadded = isPadded;
3200 state.maxLen = String(state.max).length;
3201 }
3202 if (a < 0) {
3203 let newMin = b < 0 ? Math.abs(b) : 1;
3204 negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
3205 a = state.a = 0;
3206 }
3207 if (b >= 0) {
3208 positives = splitToPatterns(a, b, state, opts);
3209 }
3210 state.negatives = negatives;
3211 state.positives = positives;
3212 state.result = collatePatterns(negatives, positives, opts);
3213 if (opts.capture === true) {
3214 state.result = `(${state.result})`;
3215 } else if (opts.wrap !== false && positives.length + negatives.length > 1) {
3216 state.result = `(?:${state.result})`;
3217 }
3218 toRegexRange.cache[cacheKey] = state;
3219 return state.result;
3220 };
3221 function collatePatterns(neg, pos, options8) {
3222 let onlyNegative = filterPatterns(neg, pos, "-", false, options8) || [];
3223 let onlyPositive = filterPatterns(pos, neg, "", false, options8) || [];
3224 let intersected = filterPatterns(neg, pos, "-?", true, options8) || [];
3225 let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
3226 return subpatterns.join("|");
3227 }
3228 function splitToRanges(min, max) {
3229 let nines = 1;
3230 let zeros = 1;
3231 let stop = countNines(min, nines);
3232 let stops = /* @__PURE__ */ new Set([max]);
3233 while (min <= stop && stop <= max) {
3234 stops.add(stop);
3235 nines += 1;
3236 stop = countNines(min, nines);
3237 }
3238 stop = countZeros(max + 1, zeros) - 1;
3239 while (min < stop && stop <= max) {
3240 stops.add(stop);
3241 zeros += 1;
3242 stop = countZeros(max + 1, zeros) - 1;
3243 }
3244 stops = [...stops];
3245 stops.sort(compare);
3246 return stops;
3247 }
3248 function rangeToPattern(start, stop, options8) {
3249 if (start === stop) {
3250 return { pattern: start, count: [], digits: 0 };
3251 }
3252 let zipped = zip(start, stop);
3253 let digits = zipped.length;
3254 let pattern = "";
3255 let count = 0;
3256 for (let i = 0; i < digits; i++) {
3257 let [startDigit, stopDigit] = zipped[i];
3258 if (startDigit === stopDigit) {
3259 pattern += startDigit;
3260 } else if (startDigit !== "0" || stopDigit !== "9") {
3261 pattern += toCharacterClass(startDigit, stopDigit, options8);
3262 } else {
3263 count++;
3264 }
3265 }
3266 if (count) {
3267 pattern += options8.shorthand === true ? "\\d" : "[0-9]";
3268 }
3269 return { pattern, count: [count], digits };
3270 }
3271 function splitToPatterns(min, max, tok, options8) {
3272 let ranges = splitToRanges(min, max);
3273 let tokens = [];
3274 let start = min;
3275 let prev;
3276 for (let i = 0; i < ranges.length; i++) {
3277 let max2 = ranges[i];
3278 let obj = rangeToPattern(String(start), String(max2), options8);
3279 let zeros = "";
3280 if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
3281 if (prev.count.length > 1) {
3282 prev.count.pop();
3283 }
3284 prev.count.push(obj.count[0]);
3285 prev.string = prev.pattern + toQuantifier(prev.count);
3286 start = max2 + 1;
3287 continue;
3288 }
3289 if (tok.isPadded) {
3290 zeros = padZeros(max2, tok, options8);
3291 }
3292 obj.string = zeros + obj.pattern + toQuantifier(obj.count);
3293 tokens.push(obj);
3294 start = max2 + 1;
3295 prev = obj;
3296 }
3297 return tokens;
3298 }
3299 function filterPatterns(arr, comparison, prefix, intersection, options8) {
3300 let result = [];
3301 for (let ele of arr) {
3302 let { string } = ele;
3303 if (!intersection && !contains(comparison, "string", string)) {
3304 result.push(prefix + string);
3305 }
3306 if (intersection && contains(comparison, "string", string)) {
3307 result.push(prefix + string);
3308 }
3309 }
3310 return result;
3311 }
3312 function zip(a, b) {
3313 let arr = [];
3314 for (let i = 0; i < a.length; i++)
3315 arr.push([a[i], b[i]]);
3316 return arr;
3317 }
3318 function compare(a, b) {
3319 return a > b ? 1 : b > a ? -1 : 0;
3320 }
3321 function contains(arr, key, val) {
3322 return arr.some((ele) => ele[key] === val);
3323 }
3324 function countNines(min, len) {
3325 return Number(String(min).slice(0, -len) + "9".repeat(len));
3326 }
3327 function countZeros(integer, zeros) {
3328 return integer - integer % Math.pow(10, zeros);
3329 }
3330 function toQuantifier(digits) {
3331 let [start = 0, stop = ""] = digits;
3332 if (stop || start > 1) {
3333 return `{${start + (stop ? "," + stop : "")}}`;
3334 }
3335 return "";
3336 }
3337 function toCharacterClass(a, b, options8) {
3338 return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
3339 }
3340 function hasPadding(str) {
3341 return /^-?(0+)\d/.test(str);
3342 }
3343 function padZeros(value, tok, options8) {
3344 if (!tok.isPadded) {
3345 return value;
3346 }
3347 let diff = Math.abs(tok.maxLen - String(value).length);
3348 let relax = options8.relaxZeros !== false;
3349 switch (diff) {
3350 case 0:
3351 return "";
3352 case 1:
3353 return relax ? "0?" : "0";
3354 case 2:
3355 return relax ? "0{0,2}" : "00";
3356 default: {
3357 return relax ? `0{0,${diff}}` : `0{${diff}}`;
3358 }
3359 }
3360 }
3361 toRegexRange.cache = {};
3362 toRegexRange.clearCache = () => toRegexRange.cache = {};
3363 module.exports = toRegexRange;
3364 }
3365});
3366
3367// node_modules/fill-range/index.js
3368var require_fill_range = __commonJS({
3369 "node_modules/fill-range/index.js"(exports, module) {
3370 "use strict";
3371 var util = __require("util");
3372 var toRegexRange = require_to_regex_range();
3373 var isObject2 = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
3374 var transform2 = (toNumber) => {
3375 return (value) => toNumber === true ? Number(value) : String(value);
3376 };
3377 var isValidValue = (value) => {
3378 return typeof value === "number" || typeof value === "string" && value !== "";
3379 };
3380 var isNumber = (num) => Number.isInteger(+num);
3381 var zeros = (input) => {
3382 let value = `${input}`;
3383 let index = -1;
3384 if (value[0] === "-")
3385 value = value.slice(1);
3386 if (value === "0")
3387 return false;
3388 while (value[++index] === "0")
3389 ;
3390 return index > 0;
3391 };
3392 var stringify = (start, end, options8) => {
3393 if (typeof start === "string" || typeof end === "string") {
3394 return true;
3395 }
3396 return options8.stringify === true;
3397 };
3398 var pad = (input, maxLength, toNumber) => {
3399 if (maxLength > 0) {
3400 let dash = input[0] === "-" ? "-" : "";
3401 if (dash)
3402 input = input.slice(1);
3403 input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0");
3404 }
3405 if (toNumber === false) {
3406 return String(input);
3407 }
3408 return input;
3409 };
3410 var toMaxLen = (input, maxLength) => {
3411 let negative = input[0] === "-" ? "-" : "";
3412 if (negative) {
3413 input = input.slice(1);
3414 maxLength--;
3415 }
3416 while (input.length < maxLength)
3417 input = "0" + input;
3418 return negative ? "-" + input : input;
3419 };
3420 var toSequence = (parts, options8) => {
3421 parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
3422 parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
3423 let prefix = options8.capture ? "" : "?:";
3424 let positives = "";
3425 let negatives = "";
3426 let result;
3427 if (parts.positives.length) {
3428 positives = parts.positives.join("|");
3429 }
3430 if (parts.negatives.length) {
3431 negatives = `-(${prefix}${parts.negatives.join("|")})`;
3432 }
3433 if (positives && negatives) {
3434 result = `${positives}|${negatives}`;
3435 } else {
3436 result = positives || negatives;
3437 }
3438 if (options8.wrap) {
3439 return `(${prefix}${result})`;
3440 }
3441 return result;
3442 };
3443 var toRange = (a, b, isNumbers, options8) => {
3444 if (isNumbers) {
3445 return toRegexRange(a, b, { wrap: false, ...options8 });
3446 }
3447 let start = String.fromCharCode(a);
3448 if (a === b)
3449 return start;
3450 let stop = String.fromCharCode(b);
3451 return `[${start}-${stop}]`;
3452 };
3453 var toRegex = (start, end, options8) => {
3454 if (Array.isArray(start)) {
3455 let wrap = options8.wrap === true;
3456 let prefix = options8.capture ? "" : "?:";
3457 return wrap ? `(${prefix}${start.join("|")})` : start.join("|");
3458 }
3459 return toRegexRange(start, end, options8);
3460 };
3461 var rangeError = (...args) => {
3462 return new RangeError("Invalid range arguments: " + util.inspect(...args));
3463 };
3464 var invalidRange = (start, end, options8) => {
3465 if (options8.strictRanges === true)
3466 throw rangeError([start, end]);
3467 return [];
3468 };
3469 var invalidStep = (step, options8) => {
3470 if (options8.strictRanges === true) {
3471 throw new TypeError(`Expected step "${step}" to be a number`);
3472 }
3473 return [];
3474 };
3475 var fillNumbers = (start, end, step = 1, options8 = {}) => {
3476 let a = Number(start);
3477 let b = Number(end);
3478 if (!Number.isInteger(a) || !Number.isInteger(b)) {
3479 if (options8.strictRanges === true)
3480 throw rangeError([start, end]);
3481 return [];
3482 }
3483 if (a === 0)
3484 a = 0;
3485 if (b === 0)
3486 b = 0;
3487 let descending = a > b;
3488 let startString = String(start);
3489 let endString = String(end);
3490 let stepString = String(step);
3491 step = Math.max(Math.abs(step), 1);
3492 let padded = zeros(startString) || zeros(endString) || zeros(stepString);
3493 let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
3494 let toNumber = padded === false && stringify(start, end, options8) === false;
3495 let format3 = options8.transform || transform2(toNumber);
3496 if (options8.toRegex && step === 1) {
3497 return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options8);
3498 }
3499 let parts = { negatives: [], positives: [] };
3500 let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
3501 let range = [];
3502 let index = 0;
3503 while (descending ? a >= b : a <= b) {
3504 if (options8.toRegex === true && step > 1) {
3505 push(a);
3506 } else {
3507 range.push(pad(format3(a, index), maxLen, toNumber));
3508 }
3509 a = descending ? a - step : a + step;
3510 index++;
3511 }
3512 if (options8.toRegex === true) {
3513 return step > 1 ? toSequence(parts, options8) : toRegex(range, null, { wrap: false, ...options8 });
3514 }
3515 return range;
3516 };
3517 var fillLetters = (start, end, step = 1, options8 = {}) => {
3518 if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) {
3519 return invalidRange(start, end, options8);
3520 }
3521 let format3 = options8.transform || ((val) => String.fromCharCode(val));
3522 let a = `${start}`.charCodeAt(0);
3523 let b = `${end}`.charCodeAt(0);
3524 let descending = a > b;
3525 let min = Math.min(a, b);
3526 let max = Math.max(a, b);
3527 if (options8.toRegex && step === 1) {
3528 return toRange(min, max, false, options8);
3529 }
3530 let range = [];
3531 let index = 0;
3532 while (descending ? a >= b : a <= b) {
3533 range.push(format3(a, index));
3534 a = descending ? a - step : a + step;
3535 index++;
3536 }
3537 if (options8.toRegex === true) {
3538 return toRegex(range, null, { wrap: false, options: options8 });
3539 }
3540 return range;
3541 };
3542 var fill2 = (start, end, step, options8 = {}) => {
3543 if (end == null && isValidValue(start)) {
3544 return [start];
3545 }
3546 if (!isValidValue(start) || !isValidValue(end)) {
3547 return invalidRange(start, end, options8);
3548 }
3549 if (typeof step === "function") {
3550 return fill2(start, end, 1, { transform: step });
3551 }
3552 if (isObject2(step)) {
3553 return fill2(start, end, 0, step);
3554 }
3555 let opts = { ...options8 };
3556 if (opts.capture === true)
3557 opts.wrap = true;
3558 step = step || opts.step || 1;
3559 if (!isNumber(step)) {
3560 if (step != null && !isObject2(step))
3561 return invalidStep(step, opts);
3562 return fill2(start, end, 1, step);
3563 }
3564 if (isNumber(start) && isNumber(end)) {
3565 return fillNumbers(start, end, step, opts);
3566 }
3567 return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
3568 };
3569 module.exports = fill2;
3570 }
3571});
3572
3573// node_modules/braces/lib/compile.js
3574var require_compile = __commonJS({
3575 "node_modules/braces/lib/compile.js"(exports, module) {
3576 "use strict";
3577 var fill2 = require_fill_range();
3578 var utils = require_utils2();
3579 var compile = (ast, options8 = {}) => {
3580 let walk = (node, parent = {}) => {
3581 let invalidBlock = utils.isInvalidBrace(parent);
3582 let invalidNode = node.invalid === true && options8.escapeInvalid === true;
3583 let invalid = invalidBlock === true || invalidNode === true;
3584 let prefix = options8.escapeInvalid === true ? "\\" : "";
3585 let output = "";
3586 if (node.isOpen === true) {
3587 return prefix + node.value;
3588 }
3589 if (node.isClose === true) {
3590 return prefix + node.value;
3591 }
3592 if (node.type === "open") {
3593 return invalid ? prefix + node.value : "(";
3594 }
3595 if (node.type === "close") {
3596 return invalid ? prefix + node.value : ")";
3597 }
3598 if (node.type === "comma") {
3599 return node.prev.type === "comma" ? "" : invalid ? node.value : "|";
3600 }
3601 if (node.value) {
3602 return node.value;
3603 }
3604 if (node.nodes && node.ranges > 0) {
3605 let args = utils.reduce(node.nodes);
3606 let range = fill2(...args, { ...options8, wrap: false, toRegex: true });
3607 if (range.length !== 0) {
3608 return args.length > 1 && range.length > 1 ? `(${range})` : range;
3609 }
3610 }
3611 if (node.nodes) {
3612 for (let child of node.nodes) {
3613 output += walk(child, node);
3614 }
3615 }
3616 return output;
3617 };
3618 return walk(ast);
3619 };
3620 module.exports = compile;
3621 }
3622});
3623
3624// node_modules/braces/lib/expand.js
3625var require_expand = __commonJS({
3626 "node_modules/braces/lib/expand.js"(exports, module) {
3627 "use strict";
3628 var fill2 = require_fill_range();
3629 var stringify = require_stringify();
3630 var utils = require_utils2();
3631 var append = (queue = "", stash = "", enclose = false) => {
3632 let result = [];
3633 queue = [].concat(queue);
3634 stash = [].concat(stash);
3635 if (!stash.length)
3636 return queue;
3637 if (!queue.length) {
3638 return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash;
3639 }
3640 for (let item of queue) {
3641 if (Array.isArray(item)) {
3642 for (let value of item) {
3643 result.push(append(value, stash, enclose));
3644 }
3645 } else {
3646 for (let ele of stash) {
3647 if (enclose === true && typeof ele === "string")
3648 ele = `{${ele}}`;
3649 result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
3650 }
3651 }
3652 }
3653 return utils.flatten(result);
3654 };
3655 var expand = (ast, options8 = {}) => {
3656 let rangeLimit = options8.rangeLimit === void 0 ? 1e3 : options8.rangeLimit;
3657 let walk = (node, parent = {}) => {
3658 node.queue = [];
3659 let p = parent;
3660 let q = parent.queue;
3661 while (p.type !== "brace" && p.type !== "root" && p.parent) {
3662 p = p.parent;
3663 q = p.queue;
3664 }
3665 if (node.invalid || node.dollar) {
3666 q.push(append(q.pop(), stringify(node, options8)));
3667 return;
3668 }
3669 if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
3670 q.push(append(q.pop(), ["{}"]));
3671 return;
3672 }
3673 if (node.nodes && node.ranges > 0) {
3674 let args = utils.reduce(node.nodes);
3675 if (utils.exceedsLimit(...args, options8.step, rangeLimit)) {
3676 throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
3677 }
3678 let range = fill2(...args, options8);
3679 if (range.length === 0) {
3680 range = stringify(node, options8);
3681 }
3682 q.push(append(q.pop(), range));
3683 node.nodes = [];
3684 return;
3685 }
3686 let enclose = utils.encloseBrace(node);
3687 let queue = node.queue;
3688 let block = node;
3689 while (block.type !== "brace" && block.type !== "root" && block.parent) {
3690 block = block.parent;
3691 queue = block.queue;
3692 }
3693 for (let i = 0; i < node.nodes.length; i++) {
3694 let child = node.nodes[i];
3695 if (child.type === "comma" && node.type === "brace") {
3696 if (i === 1)
3697 queue.push("");
3698 queue.push("");
3699 continue;
3700 }
3701 if (child.type === "close") {
3702 q.push(append(q.pop(), queue, enclose));
3703 continue;
3704 }
3705 if (child.value && child.type !== "open") {
3706 queue.push(append(queue.pop(), child.value));
3707 continue;
3708 }
3709 if (child.nodes) {
3710 walk(child, node);
3711 }
3712 }
3713 return queue;
3714 };
3715 return utils.flatten(walk(ast));
3716 };
3717 module.exports = expand;
3718 }
3719});
3720
3721// node_modules/braces/lib/constants.js
3722var require_constants = __commonJS({
3723 "node_modules/braces/lib/constants.js"(exports, module) {
3724 "use strict";
3725 module.exports = {
3726 MAX_LENGTH: 1024 * 64,
3727 // Digits
3728 CHAR_0: "0",
3729 /* 0 */
3730 CHAR_9: "9",
3731 /* 9 */
3732 // Alphabet chars.
3733 CHAR_UPPERCASE_A: "A",
3734 /* A */
3735 CHAR_LOWERCASE_A: "a",
3736 /* a */
3737 CHAR_UPPERCASE_Z: "Z",
3738 /* Z */
3739 CHAR_LOWERCASE_Z: "z",
3740 /* z */
3741 CHAR_LEFT_PARENTHESES: "(",
3742 /* ( */
3743 CHAR_RIGHT_PARENTHESES: ")",
3744 /* ) */
3745 CHAR_ASTERISK: "*",
3746 /* * */
3747 // Non-alphabetic chars.
3748 CHAR_AMPERSAND: "&",
3749 /* & */
3750 CHAR_AT: "@",
3751 /* @ */
3752 CHAR_BACKSLASH: "\\",
3753 /* \ */
3754 CHAR_BACKTICK: "`",
3755 /* ` */
3756 CHAR_CARRIAGE_RETURN: "\r",
3757 /* \r */
3758 CHAR_CIRCUMFLEX_ACCENT: "^",
3759 /* ^ */
3760 CHAR_COLON: ":",
3761 /* : */
3762 CHAR_COMMA: ",",
3763 /* , */
3764 CHAR_DOLLAR: "$",
3765 /* . */
3766 CHAR_DOT: ".",
3767 /* . */
3768 CHAR_DOUBLE_QUOTE: '"',
3769 /* " */
3770 CHAR_EQUAL: "=",
3771 /* = */
3772 CHAR_EXCLAMATION_MARK: "!",
3773 /* ! */
3774 CHAR_FORM_FEED: "\f",
3775 /* \f */
3776 CHAR_FORWARD_SLASH: "/",
3777 /* / */
3778 CHAR_HASH: "#",
3779 /* # */
3780 CHAR_HYPHEN_MINUS: "-",
3781 /* - */
3782 CHAR_LEFT_ANGLE_BRACKET: "<",
3783 /* < */
3784 CHAR_LEFT_CURLY_BRACE: "{",
3785 /* { */
3786 CHAR_LEFT_SQUARE_BRACKET: "[",
3787 /* [ */
3788 CHAR_LINE_FEED: "\n",
3789 /* \n */
3790 CHAR_NO_BREAK_SPACE: "\xA0",
3791 /* \u00A0 */
3792 CHAR_PERCENT: "%",
3793 /* % */
3794 CHAR_PLUS: "+",
3795 /* + */
3796 CHAR_QUESTION_MARK: "?",
3797 /* ? */
3798 CHAR_RIGHT_ANGLE_BRACKET: ">",
3799 /* > */
3800 CHAR_RIGHT_CURLY_BRACE: "}",
3801 /* } */
3802 CHAR_RIGHT_SQUARE_BRACKET: "]",
3803 /* ] */
3804 CHAR_SEMICOLON: ";",
3805 /* ; */
3806 CHAR_SINGLE_QUOTE: "'",
3807 /* ' */
3808 CHAR_SPACE: " ",
3809 /* */
3810 CHAR_TAB: " ",
3811 /* \t */
3812 CHAR_UNDERSCORE: "_",
3813 /* _ */
3814 CHAR_VERTICAL_LINE: "|",
3815 /* | */
3816 CHAR_ZERO_WIDTH_NOBREAK_SPACE: "\uFEFF"
3817 /* \uFEFF */
3818 };
3819 }
3820});
3821
3822// node_modules/braces/lib/parse.js
3823var require_parse = __commonJS({
3824 "node_modules/braces/lib/parse.js"(exports, module) {
3825 "use strict";
3826 var stringify = require_stringify();
3827 var {
3828 MAX_LENGTH,
3829 CHAR_BACKSLASH,
3830 /* \ */
3831 CHAR_BACKTICK,
3832 /* ` */
3833 CHAR_COMMA,
3834 /* , */
3835 CHAR_DOT,
3836 /* . */
3837 CHAR_LEFT_PARENTHESES,
3838 /* ( */
3839 CHAR_RIGHT_PARENTHESES,
3840 /* ) */
3841 CHAR_LEFT_CURLY_BRACE,
3842 /* { */
3843 CHAR_RIGHT_CURLY_BRACE,
3844 /* } */
3845 CHAR_LEFT_SQUARE_BRACKET,
3846 /* [ */
3847 CHAR_RIGHT_SQUARE_BRACKET,
3848 /* ] */
3849 CHAR_DOUBLE_QUOTE,
3850 /* " */
3851 CHAR_SINGLE_QUOTE,
3852 /* ' */
3853 CHAR_NO_BREAK_SPACE,
3854 CHAR_ZERO_WIDTH_NOBREAK_SPACE
3855 } = require_constants();
3856 var parse3 = (input, options8 = {}) => {
3857 if (typeof input !== "string") {
3858 throw new TypeError("Expected a string");
3859 }
3860 let opts = options8 || {};
3861 let max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
3862 if (input.length > max) {
3863 throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
3864 }
3865 let ast = { type: "root", input, nodes: [] };
3866 let stack = [ast];
3867 let block = ast;
3868 let prev = ast;
3869 let brackets = 0;
3870 let length = input.length;
3871 let index = 0;
3872 let depth = 0;
3873 let value;
3874 let memo = {};
3875 const advance = () => input[index++];
3876 const push = (node) => {
3877 if (node.type === "text" && prev.type === "dot") {
3878 prev.type = "text";
3879 }
3880 if (prev && prev.type === "text" && node.type === "text") {
3881 prev.value += node.value;
3882 return;
3883 }
3884 block.nodes.push(node);
3885 node.parent = block;
3886 node.prev = prev;
3887 prev = node;
3888 return node;
3889 };
3890 push({ type: "bos" });
3891 while (index < length) {
3892 block = stack[stack.length - 1];
3893 value = advance();
3894 if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
3895 continue;
3896 }
3897 if (value === CHAR_BACKSLASH) {
3898 push({ type: "text", value: (options8.keepEscaping ? value : "") + advance() });
3899 continue;
3900 }
3901 if (value === CHAR_RIGHT_SQUARE_BRACKET) {
3902 push({ type: "text", value: "\\" + value });
3903 continue;
3904 }
3905 if (value === CHAR_LEFT_SQUARE_BRACKET) {
3906 brackets++;
3907 let closed = true;
3908 let next;
3909 while (index < length && (next = advance())) {
3910 value += next;
3911 if (next === CHAR_LEFT_SQUARE_BRACKET) {
3912 brackets++;
3913 continue;
3914 }
3915 if (next === CHAR_BACKSLASH) {
3916 value += advance();
3917 continue;
3918 }
3919 if (next === CHAR_RIGHT_SQUARE_BRACKET) {
3920 brackets--;
3921 if (brackets === 0) {
3922 break;
3923 }
3924 }
3925 }
3926 push({ type: "text", value });
3927 continue;
3928 }
3929 if (value === CHAR_LEFT_PARENTHESES) {
3930 block = push({ type: "paren", nodes: [] });
3931 stack.push(block);
3932 push({ type: "text", value });
3933 continue;
3934 }
3935 if (value === CHAR_RIGHT_PARENTHESES) {
3936 if (block.type !== "paren") {
3937 push({ type: "text", value });
3938 continue;
3939 }
3940 block = stack.pop();
3941 push({ type: "text", value });
3942 block = stack[stack.length - 1];
3943 continue;
3944 }
3945 if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
3946 let open = value;
3947 let next;
3948 if (options8.keepQuotes !== true) {
3949 value = "";
3950 }
3951 while (index < length && (next = advance())) {
3952 if (next === CHAR_BACKSLASH) {
3953 value += next + advance();
3954 continue;
3955 }
3956 if (next === open) {
3957 if (options8.keepQuotes === true)
3958 value += next;
3959 break;
3960 }
3961 value += next;
3962 }
3963 push({ type: "text", value });
3964 continue;
3965 }
3966 if (value === CHAR_LEFT_CURLY_BRACE) {
3967 depth++;
3968 let dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
3969 let brace = {
3970 type: "brace",
3971 open: true,
3972 close: false,
3973 dollar,
3974 depth,
3975 commas: 0,
3976 ranges: 0,
3977 nodes: []
3978 };
3979 block = push(brace);
3980 stack.push(block);
3981 push({ type: "open", value });
3982 continue;
3983 }
3984 if (value === CHAR_RIGHT_CURLY_BRACE) {
3985 if (block.type !== "brace") {
3986 push({ type: "text", value });
3987 continue;
3988 }
3989 let type = "close";
3990 block = stack.pop();
3991 block.close = true;
3992 push({ type, value });
3993 depth--;
3994 block = stack[stack.length - 1];
3995 continue;
3996 }
3997 if (value === CHAR_COMMA && depth > 0) {
3998 if (block.ranges > 0) {
3999 block.ranges = 0;
4000 let open = block.nodes.shift();
4001 block.nodes = [open, { type: "text", value: stringify(block) }];
4002 }
4003 push({ type: "comma", value });
4004 block.commas++;
4005 continue;
4006 }
4007 if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
4008 let siblings = block.nodes;
4009 if (depth === 0 || siblings.length === 0) {
4010 push({ type: "text", value });
4011 continue;
4012 }
4013 if (prev.type === "dot") {
4014 block.range = [];
4015 prev.value += value;
4016 prev.type = "range";
4017 if (block.nodes.length !== 3 && block.nodes.length !== 5) {
4018 block.invalid = true;
4019 block.ranges = 0;
4020 prev.type = "text";
4021 continue;
4022 }
4023 block.ranges++;
4024 block.args = [];
4025 continue;
4026 }
4027 if (prev.type === "range") {
4028 siblings.pop();
4029 let before = siblings[siblings.length - 1];
4030 before.value += prev.value + value;
4031 prev = before;
4032 block.ranges--;
4033 continue;
4034 }
4035 push({ type: "dot", value });
4036 continue;
4037 }
4038 push({ type: "text", value });
4039 }
4040 do {
4041 block = stack.pop();
4042 if (block.type !== "root") {
4043 block.nodes.forEach((node) => {
4044 if (!node.nodes) {
4045 if (node.type === "open")
4046 node.isOpen = true;
4047 if (node.type === "close")
4048 node.isClose = true;
4049 if (!node.nodes)
4050 node.type = "text";
4051 node.invalid = true;
4052 }
4053 });
4054 let parent = stack[stack.length - 1];
4055 let index2 = parent.nodes.indexOf(block);
4056 parent.nodes.splice(index2, 1, ...block.nodes);
4057 }
4058 } while (stack.length > 0);
4059 push({ type: "eos" });
4060 return ast;
4061 };
4062 module.exports = parse3;
4063 }
4064});
4065
4066// node_modules/braces/index.js
4067var require_braces = __commonJS({
4068 "node_modules/braces/index.js"(exports, module) {
4069 "use strict";
4070 var stringify = require_stringify();
4071 var compile = require_compile();
4072 var expand = require_expand();
4073 var parse3 = require_parse();
4074 var braces = (input, options8 = {}) => {
4075 let output = [];
4076 if (Array.isArray(input)) {
4077 for (let pattern of input) {
4078 let result = braces.create(pattern, options8);
4079 if (Array.isArray(result)) {
4080 output.push(...result);
4081 } else {
4082 output.push(result);
4083 }
4084 }
4085 } else {
4086 output = [].concat(braces.create(input, options8));
4087 }
4088 if (options8 && options8.expand === true && options8.nodupes === true) {
4089 output = [...new Set(output)];
4090 }
4091 return output;
4092 };
4093 braces.parse = (input, options8 = {}) => parse3(input, options8);
4094 braces.stringify = (input, options8 = {}) => {
4095 if (typeof input === "string") {
4096 return stringify(braces.parse(input, options8), options8);
4097 }
4098 return stringify(input, options8);
4099 };
4100 braces.compile = (input, options8 = {}) => {
4101 if (typeof input === "string") {
4102 input = braces.parse(input, options8);
4103 }
4104 return compile(input, options8);
4105 };
4106 braces.expand = (input, options8 = {}) => {
4107 if (typeof input === "string") {
4108 input = braces.parse(input, options8);
4109 }
4110 let result = expand(input, options8);
4111 if (options8.noempty === true) {
4112 result = result.filter(Boolean);
4113 }
4114 if (options8.nodupes === true) {
4115 result = [...new Set(result)];
4116 }
4117 return result;
4118 };
4119 braces.create = (input, options8 = {}) => {
4120 if (input === "" || input.length < 3) {
4121 return [input];
4122 }
4123 return options8.expand !== true ? braces.compile(input, options8) : braces.expand(input, options8);
4124 };
4125 module.exports = braces;
4126 }
4127});
4128
4129// node_modules/picomatch/lib/constants.js
4130var require_constants2 = __commonJS({
4131 "node_modules/picomatch/lib/constants.js"(exports, module) {
4132 "use strict";
4133 var path9 = __require("path");
4134 var WIN_SLASH = "\\\\/";
4135 var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
4136 var DOT_LITERAL = "\\.";
4137 var PLUS_LITERAL = "\\+";
4138 var QMARK_LITERAL = "\\?";
4139 var SLASH_LITERAL = "\\/";
4140 var ONE_CHAR = "(?=.)";
4141 var QMARK = "[^/]";
4142 var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
4143 var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
4144 var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
4145 var NO_DOT = `(?!${DOT_LITERAL})`;
4146 var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
4147 var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
4148 var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
4149 var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
4150 var STAR = `${QMARK}*?`;
4151 var POSIX_CHARS = {
4152 DOT_LITERAL,
4153 PLUS_LITERAL,
4154 QMARK_LITERAL,
4155 SLASH_LITERAL,
4156 ONE_CHAR,
4157 QMARK,
4158 END_ANCHOR,
4159 DOTS_SLASH,
4160 NO_DOT,
4161 NO_DOTS,
4162 NO_DOT_SLASH,
4163 NO_DOTS_SLASH,
4164 QMARK_NO_DOT,
4165 STAR,
4166 START_ANCHOR
4167 };
4168 var WINDOWS_CHARS = {
4169 ...POSIX_CHARS,
4170 SLASH_LITERAL: `[${WIN_SLASH}]`,
4171 QMARK: WIN_NO_SLASH,
4172 STAR: `${WIN_NO_SLASH}*?`,
4173 DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
4174 NO_DOT: `(?!${DOT_LITERAL})`,
4175 NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
4176 NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
4177 NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
4178 QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
4179 START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
4180 END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
4181 };
4182 var POSIX_REGEX_SOURCE = {
4183 alnum: "a-zA-Z0-9",
4184 alpha: "a-zA-Z",
4185 ascii: "\\x00-\\x7F",
4186 blank: " \\t",
4187 cntrl: "\\x00-\\x1F\\x7F",
4188 digit: "0-9",
4189 graph: "\\x21-\\x7E",
4190 lower: "a-z",
4191 print: "\\x20-\\x7E ",
4192 punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
4193 space: " \\t\\r\\n\\v\\f",
4194 upper: "A-Z",
4195 word: "A-Za-z0-9_",
4196 xdigit: "A-Fa-f0-9"
4197 };
4198 module.exports = {
4199 MAX_LENGTH: 1024 * 64,
4200 POSIX_REGEX_SOURCE,
4201 // regular expressions
4202 REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
4203 REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
4204 REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
4205 REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
4206 REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
4207 REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
4208 // Replace globs with equivalent patterns to reduce parsing time.
4209 REPLACEMENTS: {
4210 "***": "*",
4211 "**/**": "**",
4212 "**/**/**": "**"
4213 },
4214 // Digits
4215 CHAR_0: 48,
4216 /* 0 */
4217 CHAR_9: 57,
4218 /* 9 */
4219 // Alphabet chars.
4220 CHAR_UPPERCASE_A: 65,
4221 /* A */
4222 CHAR_LOWERCASE_A: 97,
4223 /* a */
4224 CHAR_UPPERCASE_Z: 90,
4225 /* Z */
4226 CHAR_LOWERCASE_Z: 122,
4227 /* z */
4228 CHAR_LEFT_PARENTHESES: 40,
4229 /* ( */
4230 CHAR_RIGHT_PARENTHESES: 41,
4231 /* ) */
4232 CHAR_ASTERISK: 42,
4233 /* * */
4234 // Non-alphabetic chars.
4235 CHAR_AMPERSAND: 38,
4236 /* & */
4237 CHAR_AT: 64,
4238 /* @ */
4239 CHAR_BACKWARD_SLASH: 92,
4240 /* \ */
4241 CHAR_CARRIAGE_RETURN: 13,
4242 /* \r */
4243 CHAR_CIRCUMFLEX_ACCENT: 94,
4244 /* ^ */
4245 CHAR_COLON: 58,
4246 /* : */
4247 CHAR_COMMA: 44,
4248 /* , */
4249 CHAR_DOT: 46,
4250 /* . */
4251 CHAR_DOUBLE_QUOTE: 34,
4252 /* " */
4253 CHAR_EQUAL: 61,
4254 /* = */
4255 CHAR_EXCLAMATION_MARK: 33,
4256 /* ! */
4257 CHAR_FORM_FEED: 12,
4258 /* \f */
4259 CHAR_FORWARD_SLASH: 47,
4260 /* / */
4261 CHAR_GRAVE_ACCENT: 96,
4262 /* ` */
4263 CHAR_HASH: 35,
4264 /* # */
4265 CHAR_HYPHEN_MINUS: 45,
4266 /* - */
4267 CHAR_LEFT_ANGLE_BRACKET: 60,
4268 /* < */
4269 CHAR_LEFT_CURLY_BRACE: 123,
4270 /* { */
4271 CHAR_LEFT_SQUARE_BRACKET: 91,
4272 /* [ */
4273 CHAR_LINE_FEED: 10,
4274 /* \n */
4275 CHAR_NO_BREAK_SPACE: 160,
4276 /* \u00A0 */
4277 CHAR_PERCENT: 37,
4278 /* % */
4279 CHAR_PLUS: 43,
4280 /* + */
4281 CHAR_QUESTION_MARK: 63,
4282 /* ? */
4283 CHAR_RIGHT_ANGLE_BRACKET: 62,
4284 /* > */
4285 CHAR_RIGHT_CURLY_BRACE: 125,
4286 /* } */
4287 CHAR_RIGHT_SQUARE_BRACKET: 93,
4288 /* ] */
4289 CHAR_SEMICOLON: 59,
4290 /* ; */
4291 CHAR_SINGLE_QUOTE: 39,
4292 /* ' */
4293 CHAR_SPACE: 32,
4294 /* */
4295 CHAR_TAB: 9,
4296 /* \t */
4297 CHAR_UNDERSCORE: 95,
4298 /* _ */
4299 CHAR_VERTICAL_LINE: 124,
4300 /* | */
4301 CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
4302 /* \uFEFF */
4303 SEP: path9.sep,
4304 /**
4305 * Create EXTGLOB_CHARS
4306 */
4307 extglobChars(chars) {
4308 return {
4309 "!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
4310 "?": { type: "qmark", open: "(?:", close: ")?" },
4311 "+": { type: "plus", open: "(?:", close: ")+" },
4312 "*": { type: "star", open: "(?:", close: ")*" },
4313 "@": { type: "at", open: "(?:", close: ")" }
4314 };
4315 },
4316 /**
4317 * Create GLOB_CHARS
4318 */
4319 globChars(win32) {
4320 return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
4321 }
4322 };
4323 }
4324});
4325
4326// node_modules/picomatch/lib/utils.js
4327var require_utils3 = __commonJS({
4328 "node_modules/picomatch/lib/utils.js"(exports) {
4329 "use strict";
4330 var path9 = __require("path");
4331 var win32 = process.platform === "win32";
4332 var {
4333 REGEX_BACKSLASH,
4334 REGEX_REMOVE_BACKSLASH,
4335 REGEX_SPECIAL_CHARS,
4336 REGEX_SPECIAL_CHARS_GLOBAL
4337 } = require_constants2();
4338 exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
4339 exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
4340 exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
4341 exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
4342 exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
4343 exports.removeBackslashes = (str) => {
4344 return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
4345 return match === "\\" ? "" : match;
4346 });
4347 };
4348 exports.supportsLookbehinds = () => {
4349 const segs = process.version.slice(1).split(".").map(Number);
4350 if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {
4351 return true;
4352 }
4353 return false;
4354 };
4355 exports.isWindows = (options8) => {
4356 if (options8 && typeof options8.windows === "boolean") {
4357 return options8.windows;
4358 }
4359 return win32 === true || path9.sep === "\\";
4360 };
4361 exports.escapeLast = (input, char, lastIdx) => {
4362 const idx = input.lastIndexOf(char, lastIdx);
4363 if (idx === -1)
4364 return input;
4365 if (input[idx - 1] === "\\")
4366 return exports.escapeLast(input, char, idx - 1);
4367 return `${input.slice(0, idx)}\\${input.slice(idx)}`;
4368 };
4369 exports.removePrefix = (input, state = {}) => {
4370 let output = input;
4371 if (output.startsWith("./")) {
4372 output = output.slice(2);
4373 state.prefix = "./";
4374 }
4375 return output;
4376 };
4377 exports.wrapOutput = (input, state = {}, options8 = {}) => {
4378 const prepend = options8.contains ? "" : "^";
4379 const append = options8.contains ? "" : "$";
4380 let output = `${prepend}(?:${input})${append}`;
4381 if (state.negated === true) {
4382 output = `(?:^(?!${output}).*$)`;
4383 }
4384 return output;
4385 };
4386 }
4387});
4388
4389// node_modules/picomatch/lib/scan.js
4390var require_scan = __commonJS({
4391 "node_modules/picomatch/lib/scan.js"(exports, module) {
4392 "use strict";
4393 var utils = require_utils3();
4394 var {
4395 CHAR_ASTERISK,
4396 /* * */
4397 CHAR_AT,
4398 /* @ */
4399 CHAR_BACKWARD_SLASH,
4400 /* \ */
4401 CHAR_COMMA,
4402 /* , */
4403 CHAR_DOT,
4404 /* . */
4405 CHAR_EXCLAMATION_MARK,
4406 /* ! */
4407 CHAR_FORWARD_SLASH,
4408 /* / */
4409 CHAR_LEFT_CURLY_BRACE,
4410 /* { */
4411 CHAR_LEFT_PARENTHESES,
4412 /* ( */
4413 CHAR_LEFT_SQUARE_BRACKET,
4414 /* [ */
4415 CHAR_PLUS,
4416 /* + */
4417 CHAR_QUESTION_MARK,
4418 /* ? */
4419 CHAR_RIGHT_CURLY_BRACE,
4420 /* } */
4421 CHAR_RIGHT_PARENTHESES,
4422 /* ) */
4423 CHAR_RIGHT_SQUARE_BRACKET
4424 /* ] */
4425 } = require_constants2();
4426 var isPathSeparator = (code) => {
4427 return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
4428 };
4429 var depth = (token) => {
4430 if (token.isPrefix !== true) {
4431 token.depth = token.isGlobstar ? Infinity : 1;
4432 }
4433 };
4434 var scan = (input, options8) => {
4435 const opts = options8 || {};
4436 const length = input.length - 1;
4437 const scanToEnd = opts.parts === true || opts.scanToEnd === true;
4438 const slashes = [];
4439 const tokens = [];
4440 const parts = [];
4441 let str = input;
4442 let index = -1;
4443 let start = 0;
4444 let lastIndex = 0;
4445 let isBrace = false;
4446 let isBracket = false;
4447 let isGlob = false;
4448 let isExtglob = false;
4449 let isGlobstar = false;
4450 let braceEscaped = false;
4451 let backslashes = false;
4452 let negated = false;
4453 let negatedExtglob = false;
4454 let finished = false;
4455 let braces = 0;
4456 let prev;
4457 let code;
4458 let token = { value: "", depth: 0, isGlob: false };
4459 const eos = () => index >= length;
4460 const peek = () => str.charCodeAt(index + 1);
4461 const advance = () => {
4462 prev = code;
4463 return str.charCodeAt(++index);
4464 };
4465 while (index < length) {
4466 code = advance();
4467 let next;
4468 if (code === CHAR_BACKWARD_SLASH) {
4469 backslashes = token.backslashes = true;
4470 code = advance();
4471 if (code === CHAR_LEFT_CURLY_BRACE) {
4472 braceEscaped = true;
4473 }
4474 continue;
4475 }
4476 if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
4477 braces++;
4478 while (eos() !== true && (code = advance())) {
4479 if (code === CHAR_BACKWARD_SLASH) {
4480 backslashes = token.backslashes = true;
4481 advance();
4482 continue;
4483 }
4484 if (code === CHAR_LEFT_CURLY_BRACE) {
4485 braces++;
4486 continue;
4487 }
4488 if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
4489 isBrace = token.isBrace = true;
4490 isGlob = token.isGlob = true;
4491 finished = true;
4492 if (scanToEnd === true) {
4493 continue;
4494 }
4495 break;
4496 }
4497 if (braceEscaped !== true && code === CHAR_COMMA) {
4498 isBrace = token.isBrace = true;
4499 isGlob = token.isGlob = true;
4500 finished = true;
4501 if (scanToEnd === true) {
4502 continue;
4503 }
4504 break;
4505 }
4506 if (code === CHAR_RIGHT_CURLY_BRACE) {
4507 braces--;
4508 if (braces === 0) {
4509 braceEscaped = false;
4510 isBrace = token.isBrace = true;
4511 finished = true;
4512 break;
4513 }
4514 }
4515 }
4516 if (scanToEnd === true) {
4517 continue;
4518 }
4519 break;
4520 }
4521 if (code === CHAR_FORWARD_SLASH) {
4522 slashes.push(index);
4523 tokens.push(token);
4524 token = { value: "", depth: 0, isGlob: false };
4525 if (finished === true)
4526 continue;
4527 if (prev === CHAR_DOT && index === start + 1) {
4528 start += 2;
4529 continue;
4530 }
4531 lastIndex = index + 1;
4532 continue;
4533 }
4534 if (opts.noext !== true) {
4535 const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
4536 if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
4537 isGlob = token.isGlob = true;
4538 isExtglob = token.isExtglob = true;
4539 finished = true;
4540 if (code === CHAR_EXCLAMATION_MARK && index === start) {
4541 negatedExtglob = true;
4542 }
4543 if (scanToEnd === true) {
4544 while (eos() !== true && (code = advance())) {
4545 if (code === CHAR_BACKWARD_SLASH) {
4546 backslashes = token.backslashes = true;
4547 code = advance();
4548 continue;
4549 }
4550 if (code === CHAR_RIGHT_PARENTHESES) {
4551 isGlob = token.isGlob = true;
4552 finished = true;
4553 break;
4554 }
4555 }
4556 continue;
4557 }
4558 break;
4559 }
4560 }
4561 if (code === CHAR_ASTERISK) {
4562 if (prev === CHAR_ASTERISK)
4563 isGlobstar = token.isGlobstar = true;
4564 isGlob = token.isGlob = true;
4565 finished = true;
4566 if (scanToEnd === true) {
4567 continue;
4568 }
4569 break;
4570 }
4571 if (code === CHAR_QUESTION_MARK) {
4572 isGlob = token.isGlob = true;
4573 finished = true;
4574 if (scanToEnd === true) {
4575 continue;
4576 }
4577 break;
4578 }
4579 if (code === CHAR_LEFT_SQUARE_BRACKET) {
4580 while (eos() !== true && (next = advance())) {
4581 if (next === CHAR_BACKWARD_SLASH) {
4582 backslashes = token.backslashes = true;
4583 advance();
4584 continue;
4585 }
4586 if (next === CHAR_RIGHT_SQUARE_BRACKET) {
4587 isBracket = token.isBracket = true;
4588 isGlob = token.isGlob = true;
4589 finished = true;
4590 break;
4591 }
4592 }
4593 if (scanToEnd === true) {
4594 continue;
4595 }
4596 break;
4597 }
4598 if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
4599 negated = token.negated = true;
4600 start++;
4601 continue;
4602 }
4603 if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
4604 isGlob = token.isGlob = true;
4605 if (scanToEnd === true) {
4606 while (eos() !== true && (code = advance())) {
4607 if (code === CHAR_LEFT_PARENTHESES) {
4608 backslashes = token.backslashes = true;
4609 code = advance();
4610 continue;
4611 }
4612 if (code === CHAR_RIGHT_PARENTHESES) {
4613 finished = true;
4614 break;
4615 }
4616 }
4617 continue;
4618 }
4619 break;
4620 }
4621 if (isGlob === true) {
4622 finished = true;
4623 if (scanToEnd === true) {
4624 continue;
4625 }
4626 break;
4627 }
4628 }
4629 if (opts.noext === true) {
4630 isExtglob = false;
4631 isGlob = false;
4632 }
4633 let base = str;
4634 let prefix = "";
4635 let glob = "";
4636 if (start > 0) {
4637 prefix = str.slice(0, start);
4638 str = str.slice(start);
4639 lastIndex -= start;
4640 }
4641 if (base && isGlob === true && lastIndex > 0) {
4642 base = str.slice(0, lastIndex);
4643 glob = str.slice(lastIndex);
4644 } else if (isGlob === true) {
4645 base = "";
4646 glob = str;
4647 } else {
4648 base = str;
4649 }
4650 if (base && base !== "" && base !== "/" && base !== str) {
4651 if (isPathSeparator(base.charCodeAt(base.length - 1))) {
4652 base = base.slice(0, -1);
4653 }
4654 }
4655 if (opts.unescape === true) {
4656 if (glob)
4657 glob = utils.removeBackslashes(glob);
4658 if (base && backslashes === true) {
4659 base = utils.removeBackslashes(base);
4660 }
4661 }
4662 const state = {
4663 prefix,
4664 input,
4665 start,
4666 base,
4667 glob,
4668 isBrace,
4669 isBracket,
4670 isGlob,
4671 isExtglob,
4672 isGlobstar,
4673 negated,
4674 negatedExtglob
4675 };
4676 if (opts.tokens === true) {
4677 state.maxDepth = 0;
4678 if (!isPathSeparator(code)) {
4679 tokens.push(token);
4680 }
4681 state.tokens = tokens;
4682 }
4683 if (opts.parts === true || opts.tokens === true) {
4684 let prevIndex;
4685 for (let idx = 0; idx < slashes.length; idx++) {
4686 const n = prevIndex ? prevIndex + 1 : start;
4687 const i = slashes[idx];
4688 const value = input.slice(n, i);
4689 if (opts.tokens) {
4690 if (idx === 0 && start !== 0) {
4691 tokens[idx].isPrefix = true;
4692 tokens[idx].value = prefix;
4693 } else {
4694 tokens[idx].value = value;
4695 }
4696 depth(tokens[idx]);
4697 state.maxDepth += tokens[idx].depth;
4698 }
4699 if (idx !== 0 || value !== "") {
4700 parts.push(value);
4701 }
4702 prevIndex = i;
4703 }
4704 if (prevIndex && prevIndex + 1 < input.length) {
4705 const value = input.slice(prevIndex + 1);
4706 parts.push(value);
4707 if (opts.tokens) {
4708 tokens[tokens.length - 1].value = value;
4709 depth(tokens[tokens.length - 1]);
4710 state.maxDepth += tokens[tokens.length - 1].depth;
4711 }
4712 }
4713 state.slashes = slashes;
4714 state.parts = parts;
4715 }
4716 return state;
4717 };
4718 module.exports = scan;
4719 }
4720});
4721
4722// node_modules/picomatch/lib/parse.js
4723var require_parse2 = __commonJS({
4724 "node_modules/picomatch/lib/parse.js"(exports, module) {
4725 "use strict";
4726 var constants = require_constants2();
4727 var utils = require_utils3();
4728 var {
4729 MAX_LENGTH,
4730 POSIX_REGEX_SOURCE,
4731 REGEX_NON_SPECIAL_CHARS,
4732 REGEX_SPECIAL_CHARS_BACKREF,
4733 REPLACEMENTS
4734 } = constants;
4735 var expandRange = (args, options8) => {
4736 if (typeof options8.expandRange === "function") {
4737 return options8.expandRange(...args, options8);
4738 }
4739 args.sort();
4740 const value = `[${args.join("-")}]`;
4741 try {
4742 new RegExp(value);
4743 } catch (ex) {
4744 return args.map((v) => utils.escapeRegex(v)).join("..");
4745 }
4746 return value;
4747 };
4748 var syntaxError = (type, char) => {
4749 return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
4750 };
4751 var parse3 = (input, options8) => {
4752 if (typeof input !== "string") {
4753 throw new TypeError("Expected a string");
4754 }
4755 input = REPLACEMENTS[input] || input;
4756 const opts = { ...options8 };
4757 const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
4758 let len = input.length;
4759 if (len > max) {
4760 throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
4761 }
4762 const bos = { type: "bos", value: "", output: opts.prepend || "" };
4763 const tokens = [bos];
4764 const capture = opts.capture ? "" : "?:";
4765 const win32 = utils.isWindows(options8);
4766 const PLATFORM_CHARS = constants.globChars(win32);
4767 const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
4768 const {
4769 DOT_LITERAL,
4770 PLUS_LITERAL,
4771 SLASH_LITERAL,
4772 ONE_CHAR,
4773 DOTS_SLASH,
4774 NO_DOT,
4775 NO_DOT_SLASH,
4776 NO_DOTS_SLASH,
4777 QMARK,
4778 QMARK_NO_DOT,
4779 STAR,
4780 START_ANCHOR
4781 } = PLATFORM_CHARS;
4782 const globstar = (opts2) => {
4783 return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
4784 };
4785 const nodot = opts.dot ? "" : NO_DOT;
4786 const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
4787 let star = opts.bash === true ? globstar(opts) : STAR;
4788 if (opts.capture) {
4789 star = `(${star})`;
4790 }
4791 if (typeof opts.noext === "boolean") {
4792 opts.noextglob = opts.noext;
4793 }
4794 const state = {
4795 input,
4796 index: -1,
4797 start: 0,
4798 dot: opts.dot === true,
4799 consumed: "",
4800 output: "",
4801 prefix: "",
4802 backtrack: false,
4803 negated: false,
4804 brackets: 0,
4805 braces: 0,
4806 parens: 0,
4807 quotes: 0,
4808 globstar: false,
4809 tokens
4810 };
4811 input = utils.removePrefix(input, state);
4812 len = input.length;
4813 const extglobs = [];
4814 const braces = [];
4815 const stack = [];
4816 let prev = bos;
4817 let value;
4818 const eos = () => state.index === len - 1;
4819 const peek = state.peek = (n = 1) => input[state.index + n];
4820 const advance = state.advance = () => input[++state.index] || "";
4821 const remaining = () => input.slice(state.index + 1);
4822 const consume = (value2 = "", num = 0) => {
4823 state.consumed += value2;
4824 state.index += num;
4825 };
4826 const append = (token) => {
4827 state.output += token.output != null ? token.output : token.value;
4828 consume(token.value);
4829 };
4830 const negate = () => {
4831 let count = 1;
4832 while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
4833 advance();
4834 state.start++;
4835 count++;
4836 }
4837 if (count % 2 === 0) {
4838 return false;
4839 }
4840 state.negated = true;
4841 state.start++;
4842 return true;
4843 };
4844 const increment = (type) => {
4845 state[type]++;
4846 stack.push(type);
4847 };
4848 const decrement = (type) => {
4849 state[type]--;
4850 stack.pop();
4851 };
4852 const push = (tok) => {
4853 if (prev.type === "globstar") {
4854 const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
4855 const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
4856 if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
4857 state.output = state.output.slice(0, -prev.output.length);
4858 prev.type = "star";
4859 prev.value = "*";
4860 prev.output = star;
4861 state.output += prev.output;
4862 }
4863 }
4864 if (extglobs.length && tok.type !== "paren") {
4865 extglobs[extglobs.length - 1].inner += tok.value;
4866 }
4867 if (tok.value || tok.output)
4868 append(tok);
4869 if (prev && prev.type === "text" && tok.type === "text") {
4870 prev.value += tok.value;
4871 prev.output = (prev.output || "") + tok.value;
4872 return;
4873 }
4874 tok.prev = prev;
4875 tokens.push(tok);
4876 prev = tok;
4877 };
4878 const extglobOpen = (type, value2) => {
4879 const token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
4880 token.prev = prev;
4881 token.parens = state.parens;
4882 token.output = state.output;
4883 const output = (opts.capture ? "(" : "") + token.open;
4884 increment("parens");
4885 push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
4886 push({ type: "paren", extglob: true, value: advance(), output });
4887 extglobs.push(token);
4888 };
4889 const extglobClose = (token) => {
4890 let output = token.close + (opts.capture ? ")" : "");
4891 let rest;
4892 if (token.type === "negate") {
4893 let extglobStar = star;
4894 if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
4895 extglobStar = globstar(opts);
4896 }
4897 if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
4898 output = token.close = `)$))${extglobStar}`;
4899 }
4900 if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
4901 const expression = parse3(rest, { ...options8, fastpaths: false }).output;
4902 output = token.close = `)${expression})${extglobStar})`;
4903 }
4904 if (token.prev.type === "bos") {
4905 state.negatedExtglob = true;
4906 }
4907 }
4908 push({ type: "paren", extglob: true, value, output });
4909 decrement("parens");
4910 };
4911 if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
4912 let backslashes = false;
4913 let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
4914 if (first === "\\") {
4915 backslashes = true;
4916 return m;
4917 }
4918 if (first === "?") {
4919 if (esc) {
4920 return esc + first + (rest ? QMARK.repeat(rest.length) : "");
4921 }
4922 if (index === 0) {
4923 return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
4924 }
4925 return QMARK.repeat(chars.length);
4926 }
4927 if (first === ".") {
4928 return DOT_LITERAL.repeat(chars.length);
4929 }
4930 if (first === "*") {
4931 if (esc) {
4932 return esc + first + (rest ? star : "");
4933 }
4934 return star;
4935 }
4936 return esc ? m : `\\${m}`;
4937 });
4938 if (backslashes === true) {
4939 if (opts.unescape === true) {
4940 output = output.replace(/\\/g, "");
4941 } else {
4942 output = output.replace(/\\+/g, (m) => {
4943 return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
4944 });
4945 }
4946 }
4947 if (output === input && opts.contains === true) {
4948 state.output = input;
4949 return state;
4950 }
4951 state.output = utils.wrapOutput(output, state, options8);
4952 return state;
4953 }
4954 while (!eos()) {
4955 value = advance();
4956 if (value === "\0") {
4957 continue;
4958 }
4959 if (value === "\\") {
4960 const next = peek();
4961 if (next === "/" && opts.bash !== true) {
4962 continue;
4963 }
4964 if (next === "." || next === ";") {
4965 continue;
4966 }
4967 if (!next) {
4968 value += "\\";
4969 push({ type: "text", value });
4970 continue;
4971 }
4972 const match = /^\\+/.exec(remaining());
4973 let slashes = 0;
4974 if (match && match[0].length > 2) {
4975 slashes = match[0].length;
4976 state.index += slashes;
4977 if (slashes % 2 !== 0) {
4978 value += "\\";
4979 }
4980 }
4981 if (opts.unescape === true) {
4982 value = advance();
4983 } else {
4984 value += advance();
4985 }
4986 if (state.brackets === 0) {
4987 push({ type: "text", value });
4988 continue;
4989 }
4990 }
4991 if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
4992 if (opts.posix !== false && value === ":") {
4993 const inner = prev.value.slice(1);
4994 if (inner.includes("[")) {
4995 prev.posix = true;
4996 if (inner.includes(":")) {
4997 const idx = prev.value.lastIndexOf("[");
4998 const pre = prev.value.slice(0, idx);
4999 const rest2 = prev.value.slice(idx + 2);
5000 const posix = POSIX_REGEX_SOURCE[rest2];
5001 if (posix) {
5002 prev.value = pre + posix;
5003 state.backtrack = true;
5004 advance();
5005 if (!bos.output && tokens.indexOf(prev) === 1) {
5006 bos.output = ONE_CHAR;
5007 }
5008 continue;
5009 }
5010 }
5011 }
5012 }
5013 if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
5014 value = `\\${value}`;
5015 }
5016 if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
5017 value = `\\${value}`;
5018 }
5019 if (opts.posix === true && value === "!" && prev.value === "[") {
5020 value = "^";
5021 }
5022 prev.value += value;
5023 append({ value });
5024 continue;
5025 }
5026 if (state.quotes === 1 && value !== '"') {
5027 value = utils.escapeRegex(value);
5028 prev.value += value;
5029 append({ value });
5030 continue;
5031 }
5032 if (value === '"') {
5033 state.quotes = state.quotes === 1 ? 0 : 1;
5034 if (opts.keepQuotes === true) {
5035 push({ type: "text", value });
5036 }
5037 continue;
5038 }
5039 if (value === "(") {
5040 increment("parens");
5041 push({ type: "paren", value });
5042 continue;
5043 }
5044 if (value === ")") {
5045 if (state.parens === 0 && opts.strictBrackets === true) {
5046 throw new SyntaxError(syntaxError("opening", "("));
5047 }
5048 const extglob = extglobs[extglobs.length - 1];
5049 if (extglob && state.parens === extglob.parens + 1) {
5050 extglobClose(extglobs.pop());
5051 continue;
5052 }
5053 push({ type: "paren", value, output: state.parens ? ")" : "\\)" });
5054 decrement("parens");
5055 continue;
5056 }
5057 if (value === "[") {
5058 if (opts.nobracket === true || !remaining().includes("]")) {
5059 if (opts.nobracket !== true && opts.strictBrackets === true) {
5060 throw new SyntaxError(syntaxError("closing", "]"));
5061 }
5062 value = `\\${value}`;
5063 } else {
5064 increment("brackets");
5065 }
5066 push({ type: "bracket", value });
5067 continue;
5068 }
5069 if (value === "]") {
5070 if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
5071 push({ type: "text", value, output: `\\${value}` });
5072 continue;
5073 }
5074 if (state.brackets === 0) {
5075 if (opts.strictBrackets === true) {
5076 throw new SyntaxError(syntaxError("opening", "["));
5077 }
5078 push({ type: "text", value, output: `\\${value}` });
5079 continue;
5080 }
5081 decrement("brackets");
5082 const prevValue = prev.value.slice(1);
5083 if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
5084 value = `/${value}`;
5085 }
5086 prev.value += value;
5087 append({ value });
5088 if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
5089 continue;
5090 }
5091 const escaped = utils.escapeRegex(prev.value);
5092 state.output = state.output.slice(0, -prev.value.length);
5093 if (opts.literalBrackets === true) {
5094 state.output += escaped;
5095 prev.value = escaped;
5096 continue;
5097 }
5098 prev.value = `(${capture}${escaped}|${prev.value})`;
5099 state.output += prev.value;
5100 continue;
5101 }
5102 if (value === "{" && opts.nobrace !== true) {
5103 increment("braces");
5104 const open = {
5105 type: "brace",
5106 value,
5107 output: "(",
5108 outputIndex: state.output.length,
5109 tokensIndex: state.tokens.length
5110 };
5111 braces.push(open);
5112 push(open);
5113 continue;
5114 }
5115 if (value === "}") {
5116 const brace = braces[braces.length - 1];
5117 if (opts.nobrace === true || !brace) {
5118 push({ type: "text", value, output: value });
5119 continue;
5120 }
5121 let output = ")";
5122 if (brace.dots === true) {
5123 const arr = tokens.slice();
5124 const range = [];
5125 for (let i = arr.length - 1; i >= 0; i--) {
5126 tokens.pop();
5127 if (arr[i].type === "brace") {
5128 break;
5129 }
5130 if (arr[i].type !== "dots") {
5131 range.unshift(arr[i].value);
5132 }
5133 }
5134 output = expandRange(range, opts);
5135 state.backtrack = true;
5136 }
5137 if (brace.comma !== true && brace.dots !== true) {
5138 const out = state.output.slice(0, brace.outputIndex);
5139 const toks = state.tokens.slice(brace.tokensIndex);
5140 brace.value = brace.output = "\\{";
5141 value = output = "\\}";
5142 state.output = out;
5143 for (const t of toks) {
5144 state.output += t.output || t.value;
5145 }
5146 }
5147 push({ type: "brace", value, output });
5148 decrement("braces");
5149 braces.pop();
5150 continue;
5151 }
5152 if (value === "|") {
5153 if (extglobs.length > 0) {
5154 extglobs[extglobs.length - 1].conditions++;
5155 }
5156 push({ type: "text", value });
5157 continue;
5158 }
5159 if (value === ",") {
5160 let output = value;
5161 const brace = braces[braces.length - 1];
5162 if (brace && stack[stack.length - 1] === "braces") {
5163 brace.comma = true;
5164 output = "|";
5165 }
5166 push({ type: "comma", value, output });
5167 continue;
5168 }
5169 if (value === "/") {
5170 if (prev.type === "dot" && state.index === state.start + 1) {
5171 state.start = state.index + 1;
5172 state.consumed = "";
5173 state.output = "";
5174 tokens.pop();
5175 prev = bos;
5176 continue;
5177 }
5178 push({ type: "slash", value, output: SLASH_LITERAL });
5179 continue;
5180 }
5181 if (value === ".") {
5182 if (state.braces > 0 && prev.type === "dot") {
5183 if (prev.value === ".")
5184 prev.output = DOT_LITERAL;
5185 const brace = braces[braces.length - 1];
5186 prev.type = "dots";
5187 prev.output += value;
5188 prev.value += value;
5189 brace.dots = true;
5190 continue;
5191 }
5192 if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
5193 push({ type: "text", value, output: DOT_LITERAL });
5194 continue;
5195 }
5196 push({ type: "dot", value, output: DOT_LITERAL });
5197 continue;
5198 }
5199 if (value === "?") {
5200 const isGroup = prev && prev.value === "(";
5201 if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
5202 extglobOpen("qmark", value);
5203 continue;
5204 }
5205 if (prev && prev.type === "paren") {
5206 const next = peek();
5207 let output = value;
5208 if (next === "<" && !utils.supportsLookbehinds()) {
5209 throw new Error("Node.js v10 or higher is required for regex lookbehinds");
5210 }
5211 if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
5212 output = `\\${value}`;
5213 }
5214 push({ type: "text", value, output });
5215 continue;
5216 }
5217 if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
5218 push({ type: "qmark", value, output: QMARK_NO_DOT });
5219 continue;
5220 }
5221 push({ type: "qmark", value, output: QMARK });
5222 continue;
5223 }
5224 if (value === "!") {
5225 if (opts.noextglob !== true && peek() === "(") {
5226 if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
5227 extglobOpen("negate", value);
5228 continue;
5229 }
5230 }
5231 if (opts.nonegate !== true && state.index === 0) {
5232 negate();
5233 continue;
5234 }
5235 }
5236 if (value === "+") {
5237 if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
5238 extglobOpen("plus", value);
5239 continue;
5240 }
5241 if (prev && prev.value === "(" || opts.regex === false) {
5242 push({ type: "plus", value, output: PLUS_LITERAL });
5243 continue;
5244 }
5245 if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
5246 push({ type: "plus", value });
5247 continue;
5248 }
5249 push({ type: "plus", value: PLUS_LITERAL });
5250 continue;
5251 }
5252 if (value === "@") {
5253 if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
5254 push({ type: "at", extglob: true, value, output: "" });
5255 continue;
5256 }
5257 push({ type: "text", value });
5258 continue;
5259 }
5260 if (value !== "*") {
5261 if (value === "$" || value === "^") {
5262 value = `\\${value}`;
5263 }
5264 const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
5265 if (match) {
5266 value += match[0];
5267 state.index += match[0].length;
5268 }
5269 push({ type: "text", value });
5270 continue;
5271 }
5272 if (prev && (prev.type === "globstar" || prev.star === true)) {
5273 prev.type = "star";
5274 prev.star = true;
5275 prev.value += value;
5276 prev.output = star;
5277 state.backtrack = true;
5278 state.globstar = true;
5279 consume(value);
5280 continue;
5281 }
5282 let rest = remaining();
5283 if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
5284 extglobOpen("star", value);
5285 continue;
5286 }
5287 if (prev.type === "star") {
5288 if (opts.noglobstar === true) {
5289 consume(value);
5290 continue;
5291 }
5292 const prior = prev.prev;
5293 const before = prior.prev;
5294 const isStart = prior.type === "slash" || prior.type === "bos";
5295 const afterStar = before && (before.type === "star" || before.type === "globstar");
5296 if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
5297 push({ type: "star", value, output: "" });
5298 continue;
5299 }
5300 const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
5301 const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
5302 if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
5303 push({ type: "star", value, output: "" });
5304 continue;
5305 }
5306 while (rest.slice(0, 3) === "/**") {
5307 const after = input[state.index + 4];
5308 if (after && after !== "/") {
5309 break;
5310 }
5311 rest = rest.slice(3);
5312 consume("/**", 3);
5313 }
5314 if (prior.type === "bos" && eos()) {
5315 prev.type = "globstar";
5316 prev.value += value;
5317 prev.output = globstar(opts);
5318 state.output = prev.output;
5319 state.globstar = true;
5320 consume(value);
5321 continue;
5322 }
5323 if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
5324 state.output = state.output.slice(0, -(prior.output + prev.output).length);
5325 prior.output = `(?:${prior.output}`;
5326 prev.type = "globstar";
5327 prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
5328 prev.value += value;
5329 state.globstar = true;
5330 state.output += prior.output + prev.output;
5331 consume(value);
5332 continue;
5333 }
5334 if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
5335 const end = rest[1] !== void 0 ? "|$" : "";
5336 state.output = state.output.slice(0, -(prior.output + prev.output).length);
5337 prior.output = `(?:${prior.output}`;
5338 prev.type = "globstar";
5339 prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
5340 prev.value += value;
5341 state.output += prior.output + prev.output;
5342 state.globstar = true;
5343 consume(value + advance());
5344 push({ type: "slash", value: "/", output: "" });
5345 continue;
5346 }
5347 if (prior.type === "bos" && rest[0] === "/") {
5348 prev.type = "globstar";
5349 prev.value += value;
5350 prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
5351 state.output = prev.output;
5352 state.globstar = true;
5353 consume(value + advance());
5354 push({ type: "slash", value: "/", output: "" });
5355 continue;
5356 }
5357 state.output = state.output.slice(0, -prev.output.length);
5358 prev.type = "globstar";
5359 prev.output = globstar(opts);
5360 prev.value += value;
5361 state.output += prev.output;
5362 state.globstar = true;
5363 consume(value);
5364 continue;
5365 }
5366 const token = { type: "star", value, output: star };
5367 if (opts.bash === true) {
5368 token.output = ".*?";
5369 if (prev.type === "bos" || prev.type === "slash") {
5370 token.output = nodot + token.output;
5371 }
5372 push(token);
5373 continue;
5374 }
5375 if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
5376 token.output = value;
5377 push(token);
5378 continue;
5379 }
5380 if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
5381 if (prev.type === "dot") {
5382 state.output += NO_DOT_SLASH;
5383 prev.output += NO_DOT_SLASH;
5384 } else if (opts.dot === true) {
5385 state.output += NO_DOTS_SLASH;
5386 prev.output += NO_DOTS_SLASH;
5387 } else {
5388 state.output += nodot;
5389 prev.output += nodot;
5390 }
5391 if (peek() !== "*") {
5392 state.output += ONE_CHAR;
5393 prev.output += ONE_CHAR;
5394 }
5395 }
5396 push(token);
5397 }
5398 while (state.brackets > 0) {
5399 if (opts.strictBrackets === true)
5400 throw new SyntaxError(syntaxError("closing", "]"));
5401 state.output = utils.escapeLast(state.output, "[");
5402 decrement("brackets");
5403 }
5404 while (state.parens > 0) {
5405 if (opts.strictBrackets === true)
5406 throw new SyntaxError(syntaxError("closing", ")"));
5407 state.output = utils.escapeLast(state.output, "(");
5408 decrement("parens");
5409 }
5410 while (state.braces > 0) {
5411 if (opts.strictBrackets === true)
5412 throw new SyntaxError(syntaxError("closing", "}"));
5413 state.output = utils.escapeLast(state.output, "{");
5414 decrement("braces");
5415 }
5416 if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
5417 push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` });
5418 }
5419 if (state.backtrack === true) {
5420 state.output = "";
5421 for (const token of state.tokens) {
5422 state.output += token.output != null ? token.output : token.value;
5423 if (token.suffix) {
5424 state.output += token.suffix;
5425 }
5426 }
5427 }
5428 return state;
5429 };
5430 parse3.fastpaths = (input, options8) => {
5431 const opts = { ...options8 };
5432 const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
5433 const len = input.length;
5434 if (len > max) {
5435 throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
5436 }
5437 input = REPLACEMENTS[input] || input;
5438 const win32 = utils.isWindows(options8);
5439 const {
5440 DOT_LITERAL,
5441 SLASH_LITERAL,
5442 ONE_CHAR,
5443 DOTS_SLASH,
5444 NO_DOT,
5445 NO_DOTS,
5446 NO_DOTS_SLASH,
5447 STAR,
5448 START_ANCHOR
5449 } = constants.globChars(win32);
5450 const nodot = opts.dot ? NO_DOTS : NO_DOT;
5451 const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
5452 const capture = opts.capture ? "" : "?:";
5453 const state = { negated: false, prefix: "" };
5454 let star = opts.bash === true ? ".*?" : STAR;
5455 if (opts.capture) {
5456 star = `(${star})`;
5457 }
5458 const globstar = (opts2) => {
5459 if (opts2.noglobstar === true)
5460 return star;
5461 return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
5462 };
5463 const create = (str) => {
5464 switch (str) {
5465 case "*":
5466 return `${nodot}${ONE_CHAR}${star}`;
5467 case ".*":
5468 return `${DOT_LITERAL}${ONE_CHAR}${star}`;
5469 case "*.*":
5470 return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
5471 case "*/*":
5472 return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
5473 case "**":
5474 return nodot + globstar(opts);
5475 case "**/*":
5476 return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
5477 case "**/*.*":
5478 return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
5479 case "**/.*":
5480 return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
5481 default: {
5482 const match = /^(.*?)\.(\w+)$/.exec(str);
5483 if (!match)
5484 return;
5485 const source2 = create(match[1]);
5486 if (!source2)
5487 return;
5488 return source2 + DOT_LITERAL + match[2];
5489 }
5490 }
5491 };
5492 const output = utils.removePrefix(input, state);
5493 let source = create(output);
5494 if (source && opts.strictSlashes !== true) {
5495 source += `${SLASH_LITERAL}?`;
5496 }
5497 return source;
5498 };
5499 module.exports = parse3;
5500 }
5501});
5502
5503// node_modules/picomatch/lib/picomatch.js
5504var require_picomatch = __commonJS({
5505 "node_modules/picomatch/lib/picomatch.js"(exports, module) {
5506 "use strict";
5507 var path9 = __require("path");
5508 var scan = require_scan();
5509 var parse3 = require_parse2();
5510 var utils = require_utils3();
5511 var constants = require_constants2();
5512 var isObject2 = (val) => val && typeof val === "object" && !Array.isArray(val);
5513 var picomatch = (glob, options8, returnState = false) => {
5514 if (Array.isArray(glob)) {
5515 const fns = glob.map((input) => picomatch(input, options8, returnState));
5516 const arrayMatcher = (str) => {
5517 for (const isMatch of fns) {
5518 const state2 = isMatch(str);
5519 if (state2)
5520 return state2;
5521 }
5522 return false;
5523 };
5524 return arrayMatcher;
5525 }
5526 const isState = isObject2(glob) && glob.tokens && glob.input;
5527 if (glob === "" || typeof glob !== "string" && !isState) {
5528 throw new TypeError("Expected pattern to be a non-empty string");
5529 }
5530 const opts = options8 || {};
5531 const posix = utils.isWindows(options8);
5532 const regex = isState ? picomatch.compileRe(glob, options8) : picomatch.makeRe(glob, options8, false, true);
5533 const state = regex.state;
5534 delete regex.state;
5535 let isIgnored2 = () => false;
5536 if (opts.ignore) {
5537 const ignoreOpts = { ...options8, ignore: null, onMatch: null, onResult: null };
5538 isIgnored2 = picomatch(opts.ignore, ignoreOpts, returnState);
5539 }
5540 const matcher = (input, returnObject = false) => {
5541 const { isMatch, match, output } = picomatch.test(input, regex, options8, { glob, posix });
5542 const result = { glob, state, regex, posix, input, output, match, isMatch };
5543 if (typeof opts.onResult === "function") {
5544 opts.onResult(result);
5545 }
5546 if (isMatch === false) {
5547 result.isMatch = false;
5548 return returnObject ? result : false;
5549 }
5550 if (isIgnored2(input)) {
5551 if (typeof opts.onIgnore === "function") {
5552 opts.onIgnore(result);
5553 }
5554 result.isMatch = false;
5555 return returnObject ? result : false;
5556 }
5557 if (typeof opts.onMatch === "function") {
5558 opts.onMatch(result);
5559 }
5560 return returnObject ? result : true;
5561 };
5562 if (returnState) {
5563 matcher.state = state;
5564 }
5565 return matcher;
5566 };
5567 picomatch.test = (input, regex, options8, { glob, posix } = {}) => {
5568 if (typeof input !== "string") {
5569 throw new TypeError("Expected input to be a string");
5570 }
5571 if (input === "") {
5572 return { isMatch: false, output: "" };
5573 }
5574 const opts = options8 || {};
5575 const format3 = opts.format || (posix ? utils.toPosixSlashes : null);
5576 let match = input === glob;
5577 let output = match && format3 ? format3(input) : input;
5578 if (match === false) {
5579 output = format3 ? format3(input) : input;
5580 match = output === glob;
5581 }
5582 if (match === false || opts.capture === true) {
5583 if (opts.matchBase === true || opts.basename === true) {
5584 match = picomatch.matchBase(input, regex, options8, posix);
5585 } else {
5586 match = regex.exec(output);
5587 }
5588 }
5589 return { isMatch: Boolean(match), match, output };
5590 };
5591 picomatch.matchBase = (input, glob, options8, posix = utils.isWindows(options8)) => {
5592 const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options8);
5593 return regex.test(path9.basename(input));
5594 };
5595 picomatch.isMatch = (str, patterns, options8) => picomatch(patterns, options8)(str);
5596 picomatch.parse = (pattern, options8) => {
5597 if (Array.isArray(pattern))
5598 return pattern.map((p) => picomatch.parse(p, options8));
5599 return parse3(pattern, { ...options8, fastpaths: false });
5600 };
5601 picomatch.scan = (input, options8) => scan(input, options8);
5602 picomatch.compileRe = (state, options8, returnOutput = false, returnState = false) => {
5603 if (returnOutput === true) {
5604 return state.output;
5605 }
5606 const opts = options8 || {};
5607 const prepend = opts.contains ? "" : "^";
5608 const append = opts.contains ? "" : "$";
5609 let source = `${prepend}(?:${state.output})${append}`;
5610 if (state && state.negated === true) {
5611 source = `^(?!${source}).*$`;
5612 }
5613 const regex = picomatch.toRegex(source, options8);
5614 if (returnState === true) {
5615 regex.state = state;
5616 }
5617 return regex;
5618 };
5619 picomatch.makeRe = (input, options8 = {}, returnOutput = false, returnState = false) => {
5620 if (!input || typeof input !== "string") {
5621 throw new TypeError("Expected a non-empty string");
5622 }
5623 let parsed = { negated: false, fastpaths: true };
5624 if (options8.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
5625 parsed.output = parse3.fastpaths(input, options8);
5626 }
5627 if (!parsed.output) {
5628 parsed = parse3(input, options8);
5629 }
5630 return picomatch.compileRe(parsed, options8, returnOutput, returnState);
5631 };
5632 picomatch.toRegex = (source, options8) => {
5633 try {
5634 const opts = options8 || {};
5635 return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
5636 } catch (err) {
5637 if (options8 && options8.debug === true)
5638 throw err;
5639 return /$^/;
5640 }
5641 };
5642 picomatch.constants = constants;
5643 module.exports = picomatch;
5644 }
5645});
5646
5647// node_modules/picomatch/index.js
5648var require_picomatch2 = __commonJS({
5649 "node_modules/picomatch/index.js"(exports, module) {
5650 "use strict";
5651 module.exports = require_picomatch();
5652 }
5653});
5654
5655// node_modules/micromatch/index.js
5656var require_micromatch = __commonJS({
5657 "node_modules/micromatch/index.js"(exports, module) {
5658 "use strict";
5659 var util = __require("util");
5660 var braces = require_braces();
5661 var picomatch = require_picomatch2();
5662 var utils = require_utils3();
5663 var isEmptyString = (val) => val === "" || val === "./";
5664 var micromatch2 = (list, patterns, options8) => {
5665 patterns = [].concat(patterns);
5666 list = [].concat(list);
5667 let omit2 = /* @__PURE__ */ new Set();
5668 let keep = /* @__PURE__ */ new Set();
5669 let items = /* @__PURE__ */ new Set();
5670 let negatives = 0;
5671 let onResult = (state) => {
5672 items.add(state.output);
5673 if (options8 && options8.onResult) {
5674 options8.onResult(state);
5675 }
5676 };
5677 for (let i = 0; i < patterns.length; i++) {
5678 let isMatch = picomatch(String(patterns[i]), { ...options8, onResult }, true);
5679 let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
5680 if (negated)
5681 negatives++;
5682 for (let item of list) {
5683 let matched = isMatch(item, true);
5684 let match = negated ? !matched.isMatch : matched.isMatch;
5685 if (!match)
5686 continue;
5687 if (negated) {
5688 omit2.add(matched.output);
5689 } else {
5690 omit2.delete(matched.output);
5691 keep.add(matched.output);
5692 }
5693 }
5694 }
5695 let result = negatives === patterns.length ? [...items] : [...keep];
5696 let matches = result.filter((item) => !omit2.has(item));
5697 if (options8 && matches.length === 0) {
5698 if (options8.failglob === true) {
5699 throw new Error(`No matches found for "${patterns.join(", ")}"`);
5700 }
5701 if (options8.nonull === true || options8.nullglob === true) {
5702 return options8.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
5703 }
5704 }
5705 return matches;
5706 };
5707 micromatch2.match = micromatch2;
5708 micromatch2.matcher = (pattern, options8) => picomatch(pattern, options8);
5709 micromatch2.isMatch = (str, patterns, options8) => picomatch(patterns, options8)(str);
5710 micromatch2.any = micromatch2.isMatch;
5711 micromatch2.not = (list, patterns, options8 = {}) => {
5712 patterns = [].concat(patterns).map(String);
5713 let result = /* @__PURE__ */ new Set();
5714 let items = [];
5715 let onResult = (state) => {
5716 if (options8.onResult)
5717 options8.onResult(state);
5718 items.push(state.output);
5719 };
5720 let matches = new Set(micromatch2(list, patterns, { ...options8, onResult }));
5721 for (let item of items) {
5722 if (!matches.has(item)) {
5723 result.add(item);
5724 }
5725 }
5726 return [...result];
5727 };
5728 micromatch2.contains = (str, pattern, options8) => {
5729 if (typeof str !== "string") {
5730 throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
5731 }
5732 if (Array.isArray(pattern)) {
5733 return pattern.some((p) => micromatch2.contains(str, p, options8));
5734 }
5735 if (typeof pattern === "string") {
5736 if (isEmptyString(str) || isEmptyString(pattern)) {
5737 return false;
5738 }
5739 if (str.includes(pattern) || str.startsWith("./") && str.slice(2).includes(pattern)) {
5740 return true;
5741 }
5742 }
5743 return micromatch2.isMatch(str, pattern, { ...options8, contains: true });
5744 };
5745 micromatch2.matchKeys = (obj, patterns, options8) => {
5746 if (!utils.isObject(obj)) {
5747 throw new TypeError("Expected the first argument to be an object");
5748 }
5749 let keys = micromatch2(Object.keys(obj), patterns, options8);
5750 let res = {};
5751 for (let key of keys)
5752 res[key] = obj[key];
5753 return res;
5754 };
5755 micromatch2.some = (list, patterns, options8) => {
5756 let items = [].concat(list);
5757 for (let pattern of [].concat(patterns)) {
5758 let isMatch = picomatch(String(pattern), options8);
5759 if (items.some((item) => isMatch(item))) {
5760 return true;
5761 }
5762 }
5763 return false;
5764 };
5765 micromatch2.every = (list, patterns, options8) => {
5766 let items = [].concat(list);
5767 for (let pattern of [].concat(patterns)) {
5768 let isMatch = picomatch(String(pattern), options8);
5769 if (!items.every((item) => isMatch(item))) {
5770 return false;
5771 }
5772 }
5773 return true;
5774 };
5775 micromatch2.all = (str, patterns, options8) => {
5776 if (typeof str !== "string") {
5777 throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
5778 }
5779 return [].concat(patterns).every((p) => picomatch(p, options8)(str));
5780 };
5781 micromatch2.capture = (glob, input, options8) => {
5782 let posix = utils.isWindows(options8);
5783 let regex = picomatch.makeRe(String(glob), { ...options8, capture: true });
5784 let match = regex.exec(posix ? utils.toPosixSlashes(input) : input);
5785 if (match) {
5786 return match.slice(1).map((v) => v === void 0 ? "" : v);
5787 }
5788 };
5789 micromatch2.makeRe = (...args) => picomatch.makeRe(...args);
5790 micromatch2.scan = (...args) => picomatch.scan(...args);
5791 micromatch2.parse = (patterns, options8) => {
5792 let res = [];
5793 for (let pattern of [].concat(patterns || [])) {
5794 for (let str of braces(String(pattern), options8)) {
5795 res.push(picomatch.parse(str, options8));
5796 }
5797 }
5798 return res;
5799 };
5800 micromatch2.braces = (pattern, options8) => {
5801 if (typeof pattern !== "string")
5802 throw new TypeError("Expected a string");
5803 if (options8 && options8.nobrace === true || !/\{.*\}/.test(pattern)) {
5804 return [pattern];
5805 }
5806 return braces(pattern, options8);
5807 };
5808 micromatch2.braceExpand = (pattern, options8) => {
5809 if (typeof pattern !== "string")
5810 throw new TypeError("Expected a string");
5811 return micromatch2.braces(pattern, { ...options8, expand: true });
5812 };
5813 module.exports = micromatch2;
5814 }
5815});
5816
5817// node_modules/fast-glob/out/utils/pattern.js
5818var require_pattern = __commonJS({
5819 "node_modules/fast-glob/out/utils/pattern.js"(exports) {
5820 "use strict";
5821 Object.defineProperty(exports, "__esModule", { value: true });
5822 exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0;
5823 var path9 = __require("path");
5824 var globParent = require_glob_parent();
5825 var micromatch2 = require_micromatch();
5826 var GLOBSTAR = "**";
5827 var ESCAPE_SYMBOL = "\\";
5828 var COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
5829 var REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/;
5830 var REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/;
5831 var GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/;
5832 var BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./;
5833 function isStaticPattern(pattern, options8 = {}) {
5834 return !isDynamicPattern(pattern, options8);
5835 }
5836 exports.isStaticPattern = isStaticPattern;
5837 function isDynamicPattern(pattern, options8 = {}) {
5838 if (pattern === "") {
5839 return false;
5840 }
5841 if (options8.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) {
5842 return true;
5843 }
5844 if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) {
5845 return true;
5846 }
5847 if (options8.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) {
5848 return true;
5849 }
5850 if (options8.braceExpansion !== false && hasBraceExpansion(pattern)) {
5851 return true;
5852 }
5853 return false;
5854 }
5855 exports.isDynamicPattern = isDynamicPattern;
5856 function hasBraceExpansion(pattern) {
5857 const openingBraceIndex = pattern.indexOf("{");
5858 if (openingBraceIndex === -1) {
5859 return false;
5860 }
5861 const closingBraceIndex = pattern.indexOf("}", openingBraceIndex + 1);
5862 if (closingBraceIndex === -1) {
5863 return false;
5864 }
5865 const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex);
5866 return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent);
5867 }
5868 function convertToPositivePattern(pattern) {
5869 return isNegativePattern(pattern) ? pattern.slice(1) : pattern;
5870 }
5871 exports.convertToPositivePattern = convertToPositivePattern;
5872 function convertToNegativePattern(pattern) {
5873 return "!" + pattern;
5874 }
5875 exports.convertToNegativePattern = convertToNegativePattern;
5876 function isNegativePattern(pattern) {
5877 return pattern.startsWith("!") && pattern[1] !== "(";
5878 }
5879 exports.isNegativePattern = isNegativePattern;
5880 function isPositivePattern(pattern) {
5881 return !isNegativePattern(pattern);
5882 }
5883 exports.isPositivePattern = isPositivePattern;
5884 function getNegativePatterns(patterns) {
5885 return patterns.filter(isNegativePattern);
5886 }
5887 exports.getNegativePatterns = getNegativePatterns;
5888 function getPositivePatterns(patterns) {
5889 return patterns.filter(isPositivePattern);
5890 }
5891 exports.getPositivePatterns = getPositivePatterns;
5892 function getPatternsInsideCurrentDirectory(patterns) {
5893 return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern));
5894 }
5895 exports.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory;
5896 function getPatternsOutsideCurrentDirectory(patterns) {
5897 return patterns.filter(isPatternRelatedToParentDirectory);
5898 }
5899 exports.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory;
5900 function isPatternRelatedToParentDirectory(pattern) {
5901 return pattern.startsWith("..") || pattern.startsWith("./..");
5902 }
5903 exports.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory;
5904 function getBaseDirectory(pattern) {
5905 return globParent(pattern, { flipBackslashes: false });
5906 }
5907 exports.getBaseDirectory = getBaseDirectory;
5908 function hasGlobStar(pattern) {
5909 return pattern.includes(GLOBSTAR);
5910 }
5911 exports.hasGlobStar = hasGlobStar;
5912 function endsWithSlashGlobStar(pattern) {
5913 return pattern.endsWith("/" + GLOBSTAR);
5914 }
5915 exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
5916 function isAffectDepthOfReadingPattern(pattern) {
5917 const basename = path9.basename(pattern);
5918 return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
5919 }
5920 exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
5921 function expandPatternsWithBraceExpansion(patterns) {
5922 return patterns.reduce((collection, pattern) => {
5923 return collection.concat(expandBraceExpansion(pattern));
5924 }, []);
5925 }
5926 exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
5927 function expandBraceExpansion(pattern) {
5928 return micromatch2.braces(pattern, {
5929 expand: true,
5930 nodupes: true
5931 });
5932 }
5933 exports.expandBraceExpansion = expandBraceExpansion;
5934 function getPatternParts(pattern, options8) {
5935 let { parts } = micromatch2.scan(pattern, Object.assign(Object.assign({}, options8), { parts: true }));
5936 if (parts.length === 0) {
5937 parts = [pattern];
5938 }
5939 if (parts[0].startsWith("/")) {
5940 parts[0] = parts[0].slice(1);
5941 parts.unshift("");
5942 }
5943 return parts;
5944 }
5945 exports.getPatternParts = getPatternParts;
5946 function makeRe(pattern, options8) {
5947 return micromatch2.makeRe(pattern, options8);
5948 }
5949 exports.makeRe = makeRe;
5950 function convertPatternsToRe(patterns, options8) {
5951 return patterns.map((pattern) => makeRe(pattern, options8));
5952 }
5953 exports.convertPatternsToRe = convertPatternsToRe;
5954 function matchAny(entry, patternsRe) {
5955 return patternsRe.some((patternRe) => patternRe.test(entry));
5956 }
5957 exports.matchAny = matchAny;
5958 }
5959});
5960
5961// node_modules/merge2/index.js
5962var require_merge2 = __commonJS({
5963 "node_modules/merge2/index.js"(exports, module) {
5964 "use strict";
5965 var Stream = __require("stream");
5966 var PassThrough = Stream.PassThrough;
5967 var slice = Array.prototype.slice;
5968 module.exports = merge2;
5969 function merge2() {
5970 const streamsQueue = [];
5971 const args = slice.call(arguments);
5972 let merging = false;
5973 let options8 = args[args.length - 1];
5974 if (options8 && !Array.isArray(options8) && options8.pipe == null) {
5975 args.pop();
5976 } else {
5977 options8 = {};
5978 }
5979 const doEnd = options8.end !== false;
5980 const doPipeError = options8.pipeError === true;
5981 if (options8.objectMode == null) {
5982 options8.objectMode = true;
5983 }
5984 if (options8.highWaterMark == null) {
5985 options8.highWaterMark = 64 * 1024;
5986 }
5987 const mergedStream = PassThrough(options8);
5988 function addStream() {
5989 for (let i = 0, len = arguments.length; i < len; i++) {
5990 streamsQueue.push(pauseStreams(arguments[i], options8));
5991 }
5992 mergeStream();
5993 return this;
5994 }
5995 function mergeStream() {
5996 if (merging) {
5997 return;
5998 }
5999 merging = true;
6000 let streams = streamsQueue.shift();
6001 if (!streams) {
6002 process.nextTick(endStream);
6003 return;
6004 }
6005 if (!Array.isArray(streams)) {
6006 streams = [streams];
6007 }
6008 let pipesCount = streams.length + 1;
6009 function next() {
6010 if (--pipesCount > 0) {
6011 return;
6012 }
6013 merging = false;
6014 mergeStream();
6015 }
6016 function pipe(stream) {
6017 function onend() {
6018 stream.removeListener("merge2UnpipeEnd", onend);
6019 stream.removeListener("end", onend);
6020 if (doPipeError) {
6021 stream.removeListener("error", onerror);
6022 }
6023 next();
6024 }
6025 function onerror(err) {
6026 mergedStream.emit("error", err);
6027 }
6028 if (stream._readableState.endEmitted) {
6029 return next();
6030 }
6031 stream.on("merge2UnpipeEnd", onend);
6032 stream.on("end", onend);
6033 if (doPipeError) {
6034 stream.on("error", onerror);
6035 }
6036 stream.pipe(mergedStream, { end: false });
6037 stream.resume();
6038 }
6039 for (let i = 0; i < streams.length; i++) {
6040 pipe(streams[i]);
6041 }
6042 next();
6043 }
6044 function endStream() {
6045 merging = false;
6046 mergedStream.emit("queueDrain");
6047 if (doEnd) {
6048 mergedStream.end();
6049 }
6050 }
6051 mergedStream.setMaxListeners(0);
6052 mergedStream.add = addStream;
6053 mergedStream.on("unpipe", function(stream) {
6054 stream.emit("merge2UnpipeEnd");
6055 });
6056 if (args.length) {
6057 addStream.apply(null, args);
6058 }
6059 return mergedStream;
6060 }
6061 function pauseStreams(streams, options8) {
6062 if (!Array.isArray(streams)) {
6063 if (!streams._readableState && streams.pipe) {
6064 streams = streams.pipe(PassThrough(options8));
6065 }
6066 if (!streams._readableState || !streams.pause || !streams.pipe) {
6067 throw new Error("Only readable stream can be merged.");
6068 }
6069 streams.pause();
6070 } else {
6071 for (let i = 0, len = streams.length; i < len; i++) {
6072 streams[i] = pauseStreams(streams[i], options8);
6073 }
6074 }
6075 return streams;
6076 }
6077 }
6078});
6079
6080// node_modules/fast-glob/out/utils/stream.js
6081var require_stream = __commonJS({
6082 "node_modules/fast-glob/out/utils/stream.js"(exports) {
6083 "use strict";
6084 Object.defineProperty(exports, "__esModule", { value: true });
6085 exports.merge = void 0;
6086 var merge2 = require_merge2();
6087 function merge(streams) {
6088 const mergedStream = merge2(streams);
6089 streams.forEach((stream) => {
6090 stream.once("error", (error) => mergedStream.emit("error", error));
6091 });
6092 mergedStream.once("close", () => propagateCloseEventToSources(streams));
6093 mergedStream.once("end", () => propagateCloseEventToSources(streams));
6094 return mergedStream;
6095 }
6096 exports.merge = merge;
6097 function propagateCloseEventToSources(streams) {
6098 streams.forEach((stream) => stream.emit("close"));
6099 }
6100 }
6101});
6102
6103// node_modules/fast-glob/out/utils/string.js
6104var require_string2 = __commonJS({
6105 "node_modules/fast-glob/out/utils/string.js"(exports) {
6106 "use strict";
6107 Object.defineProperty(exports, "__esModule", { value: true });
6108 exports.isEmpty = exports.isString = void 0;
6109 function isString(input) {
6110 return typeof input === "string";
6111 }
6112 exports.isString = isString;
6113 function isEmpty(input) {
6114 return input === "";
6115 }
6116 exports.isEmpty = isEmpty;
6117 }
6118});
6119
6120// node_modules/fast-glob/out/utils/index.js
6121var require_utils4 = __commonJS({
6122 "node_modules/fast-glob/out/utils/index.js"(exports) {
6123 "use strict";
6124 Object.defineProperty(exports, "__esModule", { value: true });
6125 exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0;
6126 var array = require_array2();
6127 exports.array = array;
6128 var errno = require_errno();
6129 exports.errno = errno;
6130 var fs5 = require_fs();
6131 exports.fs = fs5;
6132 var path9 = require_path();
6133 exports.path = path9;
6134 var pattern = require_pattern();
6135 exports.pattern = pattern;
6136 var stream = require_stream();
6137 exports.stream = stream;
6138 var string = require_string2();
6139 exports.string = string;
6140 }
6141});
6142
6143// node_modules/fast-glob/out/managers/tasks.js
6144var require_tasks = __commonJS({
6145 "node_modules/fast-glob/out/managers/tasks.js"(exports) {
6146 "use strict";
6147 Object.defineProperty(exports, "__esModule", { value: true });
6148 exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
6149 var utils = require_utils4();
6150 function generate(patterns, settings) {
6151 const positivePatterns = getPositivePatterns(patterns);
6152 const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore);
6153 const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings));
6154 const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings));
6155 const staticTasks = convertPatternsToTasks(
6156 staticPatterns,
6157 negativePatterns,
6158 /* dynamic */
6159 false
6160 );
6161 const dynamicTasks = convertPatternsToTasks(
6162 dynamicPatterns,
6163 negativePatterns,
6164 /* dynamic */
6165 true
6166 );
6167 return staticTasks.concat(dynamicTasks);
6168 }
6169 exports.generate = generate;
6170 function convertPatternsToTasks(positive, negative, dynamic) {
6171 const tasks = [];
6172 const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive);
6173 const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive);
6174 const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory);
6175 const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory);
6176 tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic));
6177 if ("." in insideCurrentDirectoryGroup) {
6178 tasks.push(convertPatternGroupToTask(".", patternsInsideCurrentDirectory, negative, dynamic));
6179 } else {
6180 tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic));
6181 }
6182 return tasks;
6183 }
6184 exports.convertPatternsToTasks = convertPatternsToTasks;
6185 function getPositivePatterns(patterns) {
6186 return utils.pattern.getPositivePatterns(patterns);
6187 }
6188 exports.getPositivePatterns = getPositivePatterns;
6189 function getNegativePatternsAsPositive(patterns, ignore) {
6190 const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore);
6191 const positive = negative.map(utils.pattern.convertToPositivePattern);
6192 return positive;
6193 }
6194 exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
6195 function groupPatternsByBaseDirectory(patterns) {
6196 const group = {};
6197 return patterns.reduce((collection, pattern) => {
6198 const base = utils.pattern.getBaseDirectory(pattern);
6199 if (base in collection) {
6200 collection[base].push(pattern);
6201 } else {
6202 collection[base] = [pattern];
6203 }
6204 return collection;
6205 }, group);
6206 }
6207 exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
6208 function convertPatternGroupsToTasks(positive, negative, dynamic) {
6209 return Object.keys(positive).map((base) => {
6210 return convertPatternGroupToTask(base, positive[base], negative, dynamic);
6211 });
6212 }
6213 exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
6214 function convertPatternGroupToTask(base, positive, negative, dynamic) {
6215 return {
6216 dynamic,
6217 positive,
6218 negative,
6219 base,
6220 patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern))
6221 };
6222 }
6223 exports.convertPatternGroupToTask = convertPatternGroupToTask;
6224 }
6225});
6226
6227// node_modules/fast-glob/out/managers/patterns.js
6228var require_patterns = __commonJS({
6229 "node_modules/fast-glob/out/managers/patterns.js"(exports) {
6230 "use strict";
6231 Object.defineProperty(exports, "__esModule", { value: true });
6232 exports.removeDuplicateSlashes = exports.transform = void 0;
6233 var DOUBLE_SLASH_RE = /(?!^)\/{2,}/g;
6234 function transform2(patterns) {
6235 return patterns.map((pattern) => removeDuplicateSlashes(pattern));
6236 }
6237 exports.transform = transform2;
6238 function removeDuplicateSlashes(pattern) {
6239 return pattern.replace(DOUBLE_SLASH_RE, "/");
6240 }
6241 exports.removeDuplicateSlashes = removeDuplicateSlashes;
6242 }
6243});
6244
6245// node_modules/@nodelib/fs.stat/out/providers/async.js
6246var require_async = __commonJS({
6247 "node_modules/@nodelib/fs.stat/out/providers/async.js"(exports) {
6248 "use strict";
6249 Object.defineProperty(exports, "__esModule", { value: true });
6250 exports.read = void 0;
6251 function read2(path9, settings, callback) {
6252 settings.fs.lstat(path9, (lstatError, lstat) => {
6253 if (lstatError !== null) {
6254 callFailureCallback(callback, lstatError);
6255 return;
6256 }
6257 if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
6258 callSuccessCallback(callback, lstat);
6259 return;
6260 }
6261 settings.fs.stat(path9, (statError, stat) => {
6262 if (statError !== null) {
6263 if (settings.throwErrorOnBrokenSymbolicLink) {
6264 callFailureCallback(callback, statError);
6265 return;
6266 }
6267 callSuccessCallback(callback, lstat);
6268 return;
6269 }
6270 if (settings.markSymbolicLink) {
6271 stat.isSymbolicLink = () => true;
6272 }
6273 callSuccessCallback(callback, stat);
6274 });
6275 });
6276 }
6277 exports.read = read2;
6278 function callFailureCallback(callback, error) {
6279 callback(error);
6280 }
6281 function callSuccessCallback(callback, result) {
6282 callback(null, result);
6283 }
6284 }
6285});
6286
6287// node_modules/@nodelib/fs.stat/out/providers/sync.js
6288var require_sync = __commonJS({
6289 "node_modules/@nodelib/fs.stat/out/providers/sync.js"(exports) {
6290 "use strict";
6291 Object.defineProperty(exports, "__esModule", { value: true });
6292 exports.read = void 0;
6293 function read2(path9, settings) {
6294 const lstat = settings.fs.lstatSync(path9);
6295 if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
6296 return lstat;
6297 }
6298 try {
6299 const stat = settings.fs.statSync(path9);
6300 if (settings.markSymbolicLink) {
6301 stat.isSymbolicLink = () => true;
6302 }
6303 return stat;
6304 } catch (error) {
6305 if (!settings.throwErrorOnBrokenSymbolicLink) {
6306 return lstat;
6307 }
6308 throw error;
6309 }
6310 }
6311 exports.read = read2;
6312 }
6313});
6314
6315// node_modules/@nodelib/fs.stat/out/adapters/fs.js
6316var require_fs2 = __commonJS({
6317 "node_modules/@nodelib/fs.stat/out/adapters/fs.js"(exports) {
6318 "use strict";
6319 Object.defineProperty(exports, "__esModule", { value: true });
6320 exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
6321 var fs5 = __require("fs");
6322 exports.FILE_SYSTEM_ADAPTER = {
6323 lstat: fs5.lstat,
6324 stat: fs5.stat,
6325 lstatSync: fs5.lstatSync,
6326 statSync: fs5.statSync
6327 };
6328 function createFileSystemAdapter(fsMethods) {
6329 if (fsMethods === void 0) {
6330 return exports.FILE_SYSTEM_ADAPTER;
6331 }
6332 return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
6333 }
6334 exports.createFileSystemAdapter = createFileSystemAdapter;
6335 }
6336});
6337
6338// node_modules/@nodelib/fs.stat/out/settings.js
6339var require_settings = __commonJS({
6340 "node_modules/@nodelib/fs.stat/out/settings.js"(exports) {
6341 "use strict";
6342 Object.defineProperty(exports, "__esModule", { value: true });
6343 var fs5 = require_fs2();
6344 var Settings = class {
6345 constructor(_options = {}) {
6346 this._options = _options;
6347 this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
6348 this.fs = fs5.createFileSystemAdapter(this._options.fs);
6349 this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
6350 this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
6351 }
6352 _getValue(option, value) {
6353 return option !== null && option !== void 0 ? option : value;
6354 }
6355 };
6356 exports.default = Settings;
6357 }
6358});
6359
6360// node_modules/@nodelib/fs.stat/out/index.js
6361var require_out = __commonJS({
6362 "node_modules/@nodelib/fs.stat/out/index.js"(exports) {
6363 "use strict";
6364 Object.defineProperty(exports, "__esModule", { value: true });
6365 exports.statSync = exports.stat = exports.Settings = void 0;
6366 var async = require_async();
6367 var sync = require_sync();
6368 var settings_1 = require_settings();
6369 exports.Settings = settings_1.default;
6370 function stat(path9, optionsOrSettingsOrCallback, callback) {
6371 if (typeof optionsOrSettingsOrCallback === "function") {
6372 async.read(path9, getSettings(), optionsOrSettingsOrCallback);
6373 return;
6374 }
6375 async.read(path9, getSettings(optionsOrSettingsOrCallback), callback);
6376 }
6377 exports.stat = stat;
6378 function statSync2(path9, optionsOrSettings) {
6379 const settings = getSettings(optionsOrSettings);
6380 return sync.read(path9, settings);
6381 }
6382 exports.statSync = statSync2;
6383 function getSettings(settingsOrOptions = {}) {
6384 if (settingsOrOptions instanceof settings_1.default) {
6385 return settingsOrOptions;
6386 }
6387 return new settings_1.default(settingsOrOptions);
6388 }
6389 }
6390});
6391
6392// node_modules/queue-microtask/index.js
6393var require_queue_microtask = __commonJS({
6394 "node_modules/queue-microtask/index.js"(exports, module) {
6395 var promise;
6396 module.exports = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err) => setTimeout(() => {
6397 throw err;
6398 }, 0));
6399 }
6400});
6401
6402// node_modules/run-parallel/index.js
6403var require_run_parallel = __commonJS({
6404 "node_modules/run-parallel/index.js"(exports, module) {
6405 module.exports = runParallel;
6406 var queueMicrotask2 = require_queue_microtask();
6407 function runParallel(tasks, cb) {
6408 let results, pending, keys;
6409 let isSync = true;
6410 if (Array.isArray(tasks)) {
6411 results = [];
6412 pending = tasks.length;
6413 } else {
6414 keys = Object.keys(tasks);
6415 results = {};
6416 pending = keys.length;
6417 }
6418 function done(err) {
6419 function end() {
6420 if (cb)
6421 cb(err, results);
6422 cb = null;
6423 }
6424 if (isSync)
6425 queueMicrotask2(end);
6426 else
6427 end();
6428 }
6429 function each(i, err, result) {
6430 results[i] = result;
6431 if (--pending === 0 || err) {
6432 done(err);
6433 }
6434 }
6435 if (!pending) {
6436 done(null);
6437 } else if (keys) {
6438 keys.forEach(function(key) {
6439 tasks[key](function(err, result) {
6440 each(key, err, result);
6441 });
6442 });
6443 } else {
6444 tasks.forEach(function(task, i) {
6445 task(function(err, result) {
6446 each(i, err, result);
6447 });
6448 });
6449 }
6450 isSync = false;
6451 }
6452 }
6453});
6454
6455// node_modules/@nodelib/fs.scandir/out/constants.js
6456var require_constants3 = __commonJS({
6457 "node_modules/@nodelib/fs.scandir/out/constants.js"(exports) {
6458 "use strict";
6459 Object.defineProperty(exports, "__esModule", { value: true });
6460 exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0;
6461 var NODE_PROCESS_VERSION_PARTS = process.versions.node.split(".");
6462 if (NODE_PROCESS_VERSION_PARTS[0] === void 0 || NODE_PROCESS_VERSION_PARTS[1] === void 0) {
6463 throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);
6464 }
6465 var MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10);
6466 var MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10);
6467 var SUPPORTED_MAJOR_VERSION = 10;
6468 var SUPPORTED_MINOR_VERSION = 10;
6469 var IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION;
6470 var IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION;
6471 exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR;
6472 }
6473});
6474
6475// node_modules/@nodelib/fs.scandir/out/utils/fs.js
6476var require_fs3 = __commonJS({
6477 "node_modules/@nodelib/fs.scandir/out/utils/fs.js"(exports) {
6478 "use strict";
6479 Object.defineProperty(exports, "__esModule", { value: true });
6480 exports.createDirentFromStats = void 0;
6481 var DirentFromStats = class {
6482 constructor(name, stats) {
6483 this.name = name;
6484 this.isBlockDevice = stats.isBlockDevice.bind(stats);
6485 this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
6486 this.isDirectory = stats.isDirectory.bind(stats);
6487 this.isFIFO = stats.isFIFO.bind(stats);
6488 this.isFile = stats.isFile.bind(stats);
6489 this.isSocket = stats.isSocket.bind(stats);
6490 this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
6491 }
6492 };
6493 function createDirentFromStats(name, stats) {
6494 return new DirentFromStats(name, stats);
6495 }
6496 exports.createDirentFromStats = createDirentFromStats;
6497 }
6498});
6499
6500// node_modules/@nodelib/fs.scandir/out/utils/index.js
6501var require_utils5 = __commonJS({
6502 "node_modules/@nodelib/fs.scandir/out/utils/index.js"(exports) {
6503 "use strict";
6504 Object.defineProperty(exports, "__esModule", { value: true });
6505 exports.fs = void 0;
6506 var fs5 = require_fs3();
6507 exports.fs = fs5;
6508 }
6509});
6510
6511// node_modules/@nodelib/fs.scandir/out/providers/common.js
6512var require_common3 = __commonJS({
6513 "node_modules/@nodelib/fs.scandir/out/providers/common.js"(exports) {
6514 "use strict";
6515 Object.defineProperty(exports, "__esModule", { value: true });
6516 exports.joinPathSegments = void 0;
6517 function joinPathSegments(a, b, separator) {
6518 if (a.endsWith(separator)) {
6519 return a + b;
6520 }
6521 return a + separator + b;
6522 }
6523 exports.joinPathSegments = joinPathSegments;
6524 }
6525});
6526
6527// node_modules/@nodelib/fs.scandir/out/providers/async.js
6528var require_async2 = __commonJS({
6529 "node_modules/@nodelib/fs.scandir/out/providers/async.js"(exports) {
6530 "use strict";
6531 Object.defineProperty(exports, "__esModule", { value: true });
6532 exports.readdir = exports.readdirWithFileTypes = exports.read = void 0;
6533 var fsStat = require_out();
6534 var rpl = require_run_parallel();
6535 var constants_1 = require_constants3();
6536 var utils = require_utils5();
6537 var common = require_common3();
6538 function read2(directory, settings, callback) {
6539 if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
6540 readdirWithFileTypes(directory, settings, callback);
6541 return;
6542 }
6543 readdir(directory, settings, callback);
6544 }
6545 exports.read = read2;
6546 function readdirWithFileTypes(directory, settings, callback) {
6547 settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
6548 if (readdirError !== null) {
6549 callFailureCallback(callback, readdirError);
6550 return;
6551 }
6552 const entries = dirents.map((dirent) => ({
6553 dirent,
6554 name: dirent.name,
6555 path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
6556 }));
6557 if (!settings.followSymbolicLinks) {
6558 callSuccessCallback(callback, entries);
6559 return;
6560 }
6561 const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings));
6562 rpl(tasks, (rplError, rplEntries) => {
6563 if (rplError !== null) {
6564 callFailureCallback(callback, rplError);
6565 return;
6566 }
6567 callSuccessCallback(callback, rplEntries);
6568 });
6569 });
6570 }
6571 exports.readdirWithFileTypes = readdirWithFileTypes;
6572 function makeRplTaskEntry(entry, settings) {
6573 return (done) => {
6574 if (!entry.dirent.isSymbolicLink()) {
6575 done(null, entry);
6576 return;
6577 }
6578 settings.fs.stat(entry.path, (statError, stats) => {
6579 if (statError !== null) {
6580 if (settings.throwErrorOnBrokenSymbolicLink) {
6581 done(statError);
6582 return;
6583 }
6584 done(null, entry);
6585 return;
6586 }
6587 entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
6588 done(null, entry);
6589 });
6590 };
6591 }
6592 function readdir(directory, settings, callback) {
6593 settings.fs.readdir(directory, (readdirError, names) => {
6594 if (readdirError !== null) {
6595 callFailureCallback(callback, readdirError);
6596 return;
6597 }
6598 const tasks = names.map((name) => {
6599 const path9 = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
6600 return (done) => {
6601 fsStat.stat(path9, settings.fsStatSettings, (error, stats) => {
6602 if (error !== null) {
6603 done(error);
6604 return;
6605 }
6606 const entry = {
6607 name,
6608 path: path9,
6609 dirent: utils.fs.createDirentFromStats(name, stats)
6610 };
6611 if (settings.stats) {
6612 entry.stats = stats;
6613 }
6614 done(null, entry);
6615 });
6616 };
6617 });
6618 rpl(tasks, (rplError, entries) => {
6619 if (rplError !== null) {
6620 callFailureCallback(callback, rplError);
6621 return;
6622 }
6623 callSuccessCallback(callback, entries);
6624 });
6625 });
6626 }
6627 exports.readdir = readdir;
6628 function callFailureCallback(callback, error) {
6629 callback(error);
6630 }
6631 function callSuccessCallback(callback, result) {
6632 callback(null, result);
6633 }
6634 }
6635});
6636
6637// node_modules/@nodelib/fs.scandir/out/providers/sync.js
6638var require_sync2 = __commonJS({
6639 "node_modules/@nodelib/fs.scandir/out/providers/sync.js"(exports) {
6640 "use strict";
6641 Object.defineProperty(exports, "__esModule", { value: true });
6642 exports.readdir = exports.readdirWithFileTypes = exports.read = void 0;
6643 var fsStat = require_out();
6644 var constants_1 = require_constants3();
6645 var utils = require_utils5();
6646 var common = require_common3();
6647 function read2(directory, settings) {
6648 if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
6649 return readdirWithFileTypes(directory, settings);
6650 }
6651 return readdir(directory, settings);
6652 }
6653 exports.read = read2;
6654 function readdirWithFileTypes(directory, settings) {
6655 const dirents = settings.fs.readdirSync(directory, { withFileTypes: true });
6656 return dirents.map((dirent) => {
6657 const entry = {
6658 dirent,
6659 name: dirent.name,
6660 path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
6661 };
6662 if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) {
6663 try {
6664 const stats = settings.fs.statSync(entry.path);
6665 entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
6666 } catch (error) {
6667 if (settings.throwErrorOnBrokenSymbolicLink) {
6668 throw error;
6669 }
6670 }
6671 }
6672 return entry;
6673 });
6674 }
6675 exports.readdirWithFileTypes = readdirWithFileTypes;
6676 function readdir(directory, settings) {
6677 const names = settings.fs.readdirSync(directory);
6678 return names.map((name) => {
6679 const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
6680 const stats = fsStat.statSync(entryPath, settings.fsStatSettings);
6681 const entry = {
6682 name,
6683 path: entryPath,
6684 dirent: utils.fs.createDirentFromStats(name, stats)
6685 };
6686 if (settings.stats) {
6687 entry.stats = stats;
6688 }
6689 return entry;
6690 });
6691 }
6692 exports.readdir = readdir;
6693 }
6694});
6695
6696// node_modules/@nodelib/fs.scandir/out/adapters/fs.js
6697var require_fs4 = __commonJS({
6698 "node_modules/@nodelib/fs.scandir/out/adapters/fs.js"(exports) {
6699 "use strict";
6700 Object.defineProperty(exports, "__esModule", { value: true });
6701 exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
6702 var fs5 = __require("fs");
6703 exports.FILE_SYSTEM_ADAPTER = {
6704 lstat: fs5.lstat,
6705 stat: fs5.stat,
6706 lstatSync: fs5.lstatSync,
6707 statSync: fs5.statSync,
6708 readdir: fs5.readdir,
6709 readdirSync: fs5.readdirSync
6710 };
6711 function createFileSystemAdapter(fsMethods) {
6712 if (fsMethods === void 0) {
6713 return exports.FILE_SYSTEM_ADAPTER;
6714 }
6715 return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
6716 }
6717 exports.createFileSystemAdapter = createFileSystemAdapter;
6718 }
6719});
6720
6721// node_modules/@nodelib/fs.scandir/out/settings.js
6722var require_settings2 = __commonJS({
6723 "node_modules/@nodelib/fs.scandir/out/settings.js"(exports) {
6724 "use strict";
6725 Object.defineProperty(exports, "__esModule", { value: true });
6726 var path9 = __require("path");
6727 var fsStat = require_out();
6728 var fs5 = require_fs4();
6729 var Settings = class {
6730 constructor(_options = {}) {
6731 this._options = _options;
6732 this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
6733 this.fs = fs5.createFileSystemAdapter(this._options.fs);
6734 this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path9.sep);
6735 this.stats = this._getValue(this._options.stats, false);
6736 this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
6737 this.fsStatSettings = new fsStat.Settings({
6738 followSymbolicLink: this.followSymbolicLinks,
6739 fs: this.fs,
6740 throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink
6741 });
6742 }
6743 _getValue(option, value) {
6744 return option !== null && option !== void 0 ? option : value;
6745 }
6746 };
6747 exports.default = Settings;
6748 }
6749});
6750
6751// node_modules/@nodelib/fs.scandir/out/index.js
6752var require_out2 = __commonJS({
6753 "node_modules/@nodelib/fs.scandir/out/index.js"(exports) {
6754 "use strict";
6755 Object.defineProperty(exports, "__esModule", { value: true });
6756 exports.Settings = exports.scandirSync = exports.scandir = void 0;
6757 var async = require_async2();
6758 var sync = require_sync2();
6759 var settings_1 = require_settings2();
6760 exports.Settings = settings_1.default;
6761 function scandir(path9, optionsOrSettingsOrCallback, callback) {
6762 if (typeof optionsOrSettingsOrCallback === "function") {
6763 async.read(path9, getSettings(), optionsOrSettingsOrCallback);
6764 return;
6765 }
6766 async.read(path9, getSettings(optionsOrSettingsOrCallback), callback);
6767 }
6768 exports.scandir = scandir;
6769 function scandirSync(path9, optionsOrSettings) {
6770 const settings = getSettings(optionsOrSettings);
6771 return sync.read(path9, settings);
6772 }
6773 exports.scandirSync = scandirSync;
6774 function getSettings(settingsOrOptions = {}) {
6775 if (settingsOrOptions instanceof settings_1.default) {
6776 return settingsOrOptions;
6777 }
6778 return new settings_1.default(settingsOrOptions);
6779 }
6780 }
6781});
6782
6783// node_modules/reusify/reusify.js
6784var require_reusify = __commonJS({
6785 "node_modules/reusify/reusify.js"(exports, module) {
6786 "use strict";
6787 function reusify(Constructor) {
6788 var head = new Constructor();
6789 var tail = head;
6790 function get() {
6791 var current = head;
6792 if (current.next) {
6793 head = current.next;
6794 } else {
6795 head = new Constructor();
6796 tail = head;
6797 }
6798 current.next = null;
6799 return current;
6800 }
6801 function release(obj) {
6802 tail.next = obj;
6803 tail = obj;
6804 }
6805 return {
6806 get,
6807 release
6808 };
6809 }
6810 module.exports = reusify;
6811 }
6812});
6813
6814// node_modules/fastq/queue.js
6815var require_queue = __commonJS({
6816 "node_modules/fastq/queue.js"(exports, module) {
6817 "use strict";
6818 var reusify = require_reusify();
6819 function fastqueue(context, worker, concurrency) {
6820 if (typeof context === "function") {
6821 concurrency = worker;
6822 worker = context;
6823 context = null;
6824 }
6825 if (concurrency < 1) {
6826 throw new Error("fastqueue concurrency must be greater than 1");
6827 }
6828 var cache = reusify(Task);
6829 var queueHead = null;
6830 var queueTail = null;
6831 var _running = 0;
6832 var errorHandler = null;
6833 var self = {
6834 push,
6835 drain: noop2,
6836 saturated: noop2,
6837 pause,
6838 paused: false,
6839 concurrency,
6840 running,
6841 resume,
6842 idle,
6843 length,
6844 getQueue,
6845 unshift,
6846 empty: noop2,
6847 kill,
6848 killAndDrain,
6849 error
6850 };
6851 return self;
6852 function running() {
6853 return _running;
6854 }
6855 function pause() {
6856 self.paused = true;
6857 }
6858 function length() {
6859 var current = queueHead;
6860 var counter = 0;
6861 while (current) {
6862 current = current.next;
6863 counter++;
6864 }
6865 return counter;
6866 }
6867 function getQueue() {
6868 var current = queueHead;
6869 var tasks = [];
6870 while (current) {
6871 tasks.push(current.value);
6872 current = current.next;
6873 }
6874 return tasks;
6875 }
6876 function resume() {
6877 if (!self.paused)
6878 return;
6879 self.paused = false;
6880 for (var i = 0; i < self.concurrency; i++) {
6881 _running++;
6882 release();
6883 }
6884 }
6885 function idle() {
6886 return _running === 0 && self.length() === 0;
6887 }
6888 function push(value, done) {
6889 var current = cache.get();
6890 current.context = context;
6891 current.release = release;
6892 current.value = value;
6893 current.callback = done || noop2;
6894 current.errorHandler = errorHandler;
6895 if (_running === self.concurrency || self.paused) {
6896 if (queueTail) {
6897 queueTail.next = current;
6898 queueTail = current;
6899 } else {
6900 queueHead = current;
6901 queueTail = current;
6902 self.saturated();
6903 }
6904 } else {
6905 _running++;
6906 worker.call(context, current.value, current.worked);
6907 }
6908 }
6909 function unshift(value, done) {
6910 var current = cache.get();
6911 current.context = context;
6912 current.release = release;
6913 current.value = value;
6914 current.callback = done || noop2;
6915 if (_running === self.concurrency || self.paused) {
6916 if (queueHead) {
6917 current.next = queueHead;
6918 queueHead = current;
6919 } else {
6920 queueHead = current;
6921 queueTail = current;
6922 self.saturated();
6923 }
6924 } else {
6925 _running++;
6926 worker.call(context, current.value, current.worked);
6927 }
6928 }
6929 function release(holder) {
6930 if (holder) {
6931 cache.release(holder);
6932 }
6933 var next = queueHead;
6934 if (next) {
6935 if (!self.paused) {
6936 if (queueTail === queueHead) {
6937 queueTail = null;
6938 }
6939 queueHead = next.next;
6940 next.next = null;
6941 worker.call(context, next.value, next.worked);
6942 if (queueTail === null) {
6943 self.empty();
6944 }
6945 } else {
6946 _running--;
6947 }
6948 } else if (--_running === 0) {
6949 self.drain();
6950 }
6951 }
6952 function kill() {
6953 queueHead = null;
6954 queueTail = null;
6955 self.drain = noop2;
6956 }
6957 function killAndDrain() {
6958 queueHead = null;
6959 queueTail = null;
6960 self.drain();
6961 self.drain = noop2;
6962 }
6963 function error(handler) {
6964 errorHandler = handler;
6965 }
6966 }
6967 function noop2() {
6968 }
6969 function Task() {
6970 this.value = null;
6971 this.callback = noop2;
6972 this.next = null;
6973 this.release = noop2;
6974 this.context = null;
6975 this.errorHandler = null;
6976 var self = this;
6977 this.worked = function worked(err, result) {
6978 var callback = self.callback;
6979 var errorHandler = self.errorHandler;
6980 var val = self.value;
6981 self.value = null;
6982 self.callback = noop2;
6983 if (self.errorHandler) {
6984 errorHandler(err, val);
6985 }
6986 callback.call(self.context, err, result);
6987 self.release(self);
6988 };
6989 }
6990 function queueAsPromised(context, worker, concurrency) {
6991 if (typeof context === "function") {
6992 concurrency = worker;
6993 worker = context;
6994 context = null;
6995 }
6996 function asyncWrapper(arg, cb) {
6997 worker.call(this, arg).then(function(res) {
6998 cb(null, res);
6999 }, cb);
7000 }
7001 var queue = fastqueue(context, asyncWrapper, concurrency);
7002 var pushCb = queue.push;
7003 var unshiftCb = queue.unshift;
7004 queue.push = push;
7005 queue.unshift = unshift;
7006 queue.drained = drained;
7007 return queue;
7008 function push(value) {
7009 var p = new Promise(function(resolve2, reject) {
7010 pushCb(value, function(err, result) {
7011 if (err) {
7012 reject(err);
7013 return;
7014 }
7015 resolve2(result);
7016 });
7017 });
7018 p.catch(noop2);
7019 return p;
7020 }
7021 function unshift(value) {
7022 var p = new Promise(function(resolve2, reject) {
7023 unshiftCb(value, function(err, result) {
7024 if (err) {
7025 reject(err);
7026 return;
7027 }
7028 resolve2(result);
7029 });
7030 });
7031 p.catch(noop2);
7032 return p;
7033 }
7034 function drained() {
7035 if (queue.idle()) {
7036 return new Promise(function(resolve2) {
7037 resolve2();
7038 });
7039 }
7040 var previousDrain = queue.drain;
7041 var p = new Promise(function(resolve2) {
7042 queue.drain = function() {
7043 previousDrain();
7044 resolve2();
7045 };
7046 });
7047 return p;
7048 }
7049 }
7050 module.exports = fastqueue;
7051 module.exports.promise = queueAsPromised;
7052 }
7053});
7054
7055// node_modules/@nodelib/fs.walk/out/readers/common.js
7056var require_common4 = __commonJS({
7057 "node_modules/@nodelib/fs.walk/out/readers/common.js"(exports) {
7058 "use strict";
7059 Object.defineProperty(exports, "__esModule", { value: true });
7060 exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
7061 function isFatalError(settings, error) {
7062 if (settings.errorFilter === null) {
7063 return true;
7064 }
7065 return !settings.errorFilter(error);
7066 }
7067 exports.isFatalError = isFatalError;
7068 function isAppliedFilter(filter, value) {
7069 return filter === null || filter(value);
7070 }
7071 exports.isAppliedFilter = isAppliedFilter;
7072 function replacePathSegmentSeparator(filepath, separator) {
7073 return filepath.split(/[/\\]/).join(separator);
7074 }
7075 exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
7076 function joinPathSegments(a, b, separator) {
7077 if (a === "") {
7078 return b;
7079 }
7080 if (a.endsWith(separator)) {
7081 return a + b;
7082 }
7083 return a + separator + b;
7084 }
7085 exports.joinPathSegments = joinPathSegments;
7086 }
7087});
7088
7089// node_modules/@nodelib/fs.walk/out/readers/reader.js
7090var require_reader = __commonJS({
7091 "node_modules/@nodelib/fs.walk/out/readers/reader.js"(exports) {
7092 "use strict";
7093 Object.defineProperty(exports, "__esModule", { value: true });
7094 var common = require_common4();
7095 var Reader = class {
7096 constructor(_root, _settings) {
7097 this._root = _root;
7098 this._settings = _settings;
7099 this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator);
7100 }
7101 };
7102 exports.default = Reader;
7103 }
7104});
7105
7106// node_modules/@nodelib/fs.walk/out/readers/async.js
7107var require_async3 = __commonJS({
7108 "node_modules/@nodelib/fs.walk/out/readers/async.js"(exports) {
7109 "use strict";
7110 Object.defineProperty(exports, "__esModule", { value: true });
7111 var events_1 = __require("events");
7112 var fsScandir = require_out2();
7113 var fastq = require_queue();
7114 var common = require_common4();
7115 var reader_1 = require_reader();
7116 var AsyncReader = class extends reader_1.default {
7117 constructor(_root, _settings) {
7118 super(_root, _settings);
7119 this._settings = _settings;
7120 this._scandir = fsScandir.scandir;
7121 this._emitter = new events_1.EventEmitter();
7122 this._queue = fastq(this._worker.bind(this), this._settings.concurrency);
7123 this._isFatalError = false;
7124 this._isDestroyed = false;
7125 this._queue.drain = () => {
7126 if (!this._isFatalError) {
7127 this._emitter.emit("end");
7128 }
7129 };
7130 }
7131 read() {
7132 this._isFatalError = false;
7133 this._isDestroyed = false;
7134 setImmediate(() => {
7135 this._pushToQueue(this._root, this._settings.basePath);
7136 });
7137 return this._emitter;
7138 }
7139 get isDestroyed() {
7140 return this._isDestroyed;
7141 }
7142 destroy() {
7143 if (this._isDestroyed) {
7144 throw new Error("The reader is already destroyed");
7145 }
7146 this._isDestroyed = true;
7147 this._queue.killAndDrain();
7148 }
7149 onEntry(callback) {
7150 this._emitter.on("entry", callback);
7151 }
7152 onError(callback) {
7153 this._emitter.once("error", callback);
7154 }
7155 onEnd(callback) {
7156 this._emitter.once("end", callback);
7157 }
7158 _pushToQueue(directory, base) {
7159 const queueItem = { directory, base };
7160 this._queue.push(queueItem, (error) => {
7161 if (error !== null) {
7162 this._handleError(error);
7163 }
7164 });
7165 }
7166 _worker(item, done) {
7167 this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => {
7168 if (error !== null) {
7169 done(error, void 0);
7170 return;
7171 }
7172 for (const entry of entries) {
7173 this._handleEntry(entry, item.base);
7174 }
7175 done(null, void 0);
7176 });
7177 }
7178 _handleError(error) {
7179 if (this._isDestroyed || !common.isFatalError(this._settings, error)) {
7180 return;
7181 }
7182 this._isFatalError = true;
7183 this._isDestroyed = true;
7184 this._emitter.emit("error", error);
7185 }
7186 _handleEntry(entry, base) {
7187 if (this._isDestroyed || this._isFatalError) {
7188 return;
7189 }
7190 const fullpath = entry.path;
7191 if (base !== void 0) {
7192 entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
7193 }
7194 if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
7195 this._emitEntry(entry);
7196 }
7197 if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {
7198 this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
7199 }
7200 }
7201 _emitEntry(entry) {
7202 this._emitter.emit("entry", entry);
7203 }
7204 };
7205 exports.default = AsyncReader;
7206 }
7207});
7208
7209// node_modules/@nodelib/fs.walk/out/providers/async.js
7210var require_async4 = __commonJS({
7211 "node_modules/@nodelib/fs.walk/out/providers/async.js"(exports) {
7212 "use strict";
7213 Object.defineProperty(exports, "__esModule", { value: true });
7214 var async_1 = require_async3();
7215 var AsyncProvider = class {
7216 constructor(_root, _settings) {
7217 this._root = _root;
7218 this._settings = _settings;
7219 this._reader = new async_1.default(this._root, this._settings);
7220 this._storage = [];
7221 }
7222 read(callback) {
7223 this._reader.onError((error) => {
7224 callFailureCallback(callback, error);
7225 });
7226 this._reader.onEntry((entry) => {
7227 this._storage.push(entry);
7228 });
7229 this._reader.onEnd(() => {
7230 callSuccessCallback(callback, this._storage);
7231 });
7232 this._reader.read();
7233 }
7234 };
7235 exports.default = AsyncProvider;
7236 function callFailureCallback(callback, error) {
7237 callback(error);
7238 }
7239 function callSuccessCallback(callback, entries) {
7240 callback(null, entries);
7241 }
7242 }
7243});
7244
7245// node_modules/@nodelib/fs.walk/out/providers/stream.js
7246var require_stream2 = __commonJS({
7247 "node_modules/@nodelib/fs.walk/out/providers/stream.js"(exports) {
7248 "use strict";
7249 Object.defineProperty(exports, "__esModule", { value: true });
7250 var stream_1 = __require("stream");
7251 var async_1 = require_async3();
7252 var StreamProvider = class {
7253 constructor(_root, _settings) {
7254 this._root = _root;
7255 this._settings = _settings;
7256 this._reader = new async_1.default(this._root, this._settings);
7257 this._stream = new stream_1.Readable({
7258 objectMode: true,
7259 read: () => {
7260 },
7261 destroy: () => {
7262 if (!this._reader.isDestroyed) {
7263 this._reader.destroy();
7264 }
7265 }
7266 });
7267 }
7268 read() {
7269 this._reader.onError((error) => {
7270 this._stream.emit("error", error);
7271 });
7272 this._reader.onEntry((entry) => {
7273 this._stream.push(entry);
7274 });
7275 this._reader.onEnd(() => {
7276 this._stream.push(null);
7277 });
7278 this._reader.read();
7279 return this._stream;
7280 }
7281 };
7282 exports.default = StreamProvider;
7283 }
7284});
7285
7286// node_modules/@nodelib/fs.walk/out/readers/sync.js
7287var require_sync3 = __commonJS({
7288 "node_modules/@nodelib/fs.walk/out/readers/sync.js"(exports) {
7289 "use strict";
7290 Object.defineProperty(exports, "__esModule", { value: true });
7291 var fsScandir = require_out2();
7292 var common = require_common4();
7293 var reader_1 = require_reader();
7294 var SyncReader = class extends reader_1.default {
7295 constructor() {
7296 super(...arguments);
7297 this._scandir = fsScandir.scandirSync;
7298 this._storage = [];
7299 this._queue = /* @__PURE__ */ new Set();
7300 }
7301 read() {
7302 this._pushToQueue(this._root, this._settings.basePath);
7303 this._handleQueue();
7304 return this._storage;
7305 }
7306 _pushToQueue(directory, base) {
7307 this._queue.add({ directory, base });
7308 }
7309 _handleQueue() {
7310 for (const item of this._queue.values()) {
7311 this._handleDirectory(item.directory, item.base);
7312 }
7313 }
7314 _handleDirectory(directory, base) {
7315 try {
7316 const entries = this._scandir(directory, this._settings.fsScandirSettings);
7317 for (const entry of entries) {
7318 this._handleEntry(entry, base);
7319 }
7320 } catch (error) {
7321 this._handleError(error);
7322 }
7323 }
7324 _handleError(error) {
7325 if (!common.isFatalError(this._settings, error)) {
7326 return;
7327 }
7328 throw error;
7329 }
7330 _handleEntry(entry, base) {
7331 const fullpath = entry.path;
7332 if (base !== void 0) {
7333 entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
7334 }
7335 if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
7336 this._pushToStorage(entry);
7337 }
7338 if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {
7339 this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
7340 }
7341 }
7342 _pushToStorage(entry) {
7343 this._storage.push(entry);
7344 }
7345 };
7346 exports.default = SyncReader;
7347 }
7348});
7349
7350// node_modules/@nodelib/fs.walk/out/providers/sync.js
7351var require_sync4 = __commonJS({
7352 "node_modules/@nodelib/fs.walk/out/providers/sync.js"(exports) {
7353 "use strict";
7354 Object.defineProperty(exports, "__esModule", { value: true });
7355 var sync_1 = require_sync3();
7356 var SyncProvider = class {
7357 constructor(_root, _settings) {
7358 this._root = _root;
7359 this._settings = _settings;
7360 this._reader = new sync_1.default(this._root, this._settings);
7361 }
7362 read() {
7363 return this._reader.read();
7364 }
7365 };
7366 exports.default = SyncProvider;
7367 }
7368});
7369
7370// node_modules/@nodelib/fs.walk/out/settings.js
7371var require_settings3 = __commonJS({
7372 "node_modules/@nodelib/fs.walk/out/settings.js"(exports) {
7373 "use strict";
7374 Object.defineProperty(exports, "__esModule", { value: true });
7375 var path9 = __require("path");
7376 var fsScandir = require_out2();
7377 var Settings = class {
7378 constructor(_options = {}) {
7379 this._options = _options;
7380 this.basePath = this._getValue(this._options.basePath, void 0);
7381 this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY);
7382 this.deepFilter = this._getValue(this._options.deepFilter, null);
7383 this.entryFilter = this._getValue(this._options.entryFilter, null);
7384 this.errorFilter = this._getValue(this._options.errorFilter, null);
7385 this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path9.sep);
7386 this.fsScandirSettings = new fsScandir.Settings({
7387 followSymbolicLinks: this._options.followSymbolicLinks,
7388 fs: this._options.fs,
7389 pathSegmentSeparator: this._options.pathSegmentSeparator,
7390 stats: this._options.stats,
7391 throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink
7392 });
7393 }
7394 _getValue(option, value) {
7395 return option !== null && option !== void 0 ? option : value;
7396 }
7397 };
7398 exports.default = Settings;
7399 }
7400});
7401
7402// node_modules/@nodelib/fs.walk/out/index.js
7403var require_out3 = __commonJS({
7404 "node_modules/@nodelib/fs.walk/out/index.js"(exports) {
7405 "use strict";
7406 Object.defineProperty(exports, "__esModule", { value: true });
7407 exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0;
7408 var async_1 = require_async4();
7409 var stream_1 = require_stream2();
7410 var sync_1 = require_sync4();
7411 var settings_1 = require_settings3();
7412 exports.Settings = settings_1.default;
7413 function walk(directory, optionsOrSettingsOrCallback, callback) {
7414 if (typeof optionsOrSettingsOrCallback === "function") {
7415 new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback);
7416 return;
7417 }
7418 new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback);
7419 }
7420 exports.walk = walk;
7421 function walkSync(directory, optionsOrSettings) {
7422 const settings = getSettings(optionsOrSettings);
7423 const provider = new sync_1.default(directory, settings);
7424 return provider.read();
7425 }
7426 exports.walkSync = walkSync;
7427 function walkStream(directory, optionsOrSettings) {
7428 const settings = getSettings(optionsOrSettings);
7429 const provider = new stream_1.default(directory, settings);
7430 return provider.read();
7431 }
7432 exports.walkStream = walkStream;
7433 function getSettings(settingsOrOptions = {}) {
7434 if (settingsOrOptions instanceof settings_1.default) {
7435 return settingsOrOptions;
7436 }
7437 return new settings_1.default(settingsOrOptions);
7438 }
7439 }
7440});
7441
7442// node_modules/fast-glob/out/readers/reader.js
7443var require_reader2 = __commonJS({
7444 "node_modules/fast-glob/out/readers/reader.js"(exports) {
7445 "use strict";
7446 Object.defineProperty(exports, "__esModule", { value: true });
7447 var path9 = __require("path");
7448 var fsStat = require_out();
7449 var utils = require_utils4();
7450 var Reader = class {
7451 constructor(_settings) {
7452 this._settings = _settings;
7453 this._fsStatSettings = new fsStat.Settings({
7454 followSymbolicLink: this._settings.followSymbolicLinks,
7455 fs: this._settings.fs,
7456 throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
7457 });
7458 }
7459 _getFullEntryPath(filepath) {
7460 return path9.resolve(this._settings.cwd, filepath);
7461 }
7462 _makeEntry(stats, pattern) {
7463 const entry = {
7464 name: pattern,
7465 path: pattern,
7466 dirent: utils.fs.createDirentFromStats(pattern, stats)
7467 };
7468 if (this._settings.stats) {
7469 entry.stats = stats;
7470 }
7471 return entry;
7472 }
7473 _isFatalError(error) {
7474 return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
7475 }
7476 };
7477 exports.default = Reader;
7478 }
7479});
7480
7481// node_modules/fast-glob/out/readers/stream.js
7482var require_stream3 = __commonJS({
7483 "node_modules/fast-glob/out/readers/stream.js"(exports) {
7484 "use strict";
7485 Object.defineProperty(exports, "__esModule", { value: true });
7486 var stream_1 = __require("stream");
7487 var fsStat = require_out();
7488 var fsWalk = require_out3();
7489 var reader_1 = require_reader2();
7490 var ReaderStream = class extends reader_1.default {
7491 constructor() {
7492 super(...arguments);
7493 this._walkStream = fsWalk.walkStream;
7494 this._stat = fsStat.stat;
7495 }
7496 dynamic(root, options8) {
7497 return this._walkStream(root, options8);
7498 }
7499 static(patterns, options8) {
7500 const filepaths = patterns.map(this._getFullEntryPath, this);
7501 const stream = new stream_1.PassThrough({ objectMode: true });
7502 stream._write = (index, _enc, done) => {
7503 return this._getEntry(filepaths[index], patterns[index], options8).then((entry) => {
7504 if (entry !== null && options8.entryFilter(entry)) {
7505 stream.push(entry);
7506 }
7507 if (index === filepaths.length - 1) {
7508 stream.end();
7509 }
7510 done();
7511 }).catch(done);
7512 };
7513 for (let i = 0; i < filepaths.length; i++) {
7514 stream.write(i);
7515 }
7516 return stream;
7517 }
7518 _getEntry(filepath, pattern, options8) {
7519 return this._getStat(filepath).then((stats) => this._makeEntry(stats, pattern)).catch((error) => {
7520 if (options8.errorFilter(error)) {
7521 return null;
7522 }
7523 throw error;
7524 });
7525 }
7526 _getStat(filepath) {
7527 return new Promise((resolve2, reject) => {
7528 this._stat(filepath, this._fsStatSettings, (error, stats) => {
7529 return error === null ? resolve2(stats) : reject(error);
7530 });
7531 });
7532 }
7533 };
7534 exports.default = ReaderStream;
7535 }
7536});
7537
7538// node_modules/fast-glob/out/readers/async.js
7539var require_async5 = __commonJS({
7540 "node_modules/fast-glob/out/readers/async.js"(exports) {
7541 "use strict";
7542 Object.defineProperty(exports, "__esModule", { value: true });
7543 var fsWalk = require_out3();
7544 var reader_1 = require_reader2();
7545 var stream_1 = require_stream3();
7546 var ReaderAsync = class extends reader_1.default {
7547 constructor() {
7548 super(...arguments);
7549 this._walkAsync = fsWalk.walk;
7550 this._readerStream = new stream_1.default(this._settings);
7551 }
7552 dynamic(root, options8) {
7553 return new Promise((resolve2, reject) => {
7554 this._walkAsync(root, options8, (error, entries) => {
7555 if (error === null) {
7556 resolve2(entries);
7557 } else {
7558 reject(error);
7559 }
7560 });
7561 });
7562 }
7563 async static(patterns, options8) {
7564 const entries = [];
7565 const stream = this._readerStream.static(patterns, options8);
7566 return new Promise((resolve2, reject) => {
7567 stream.once("error", reject);
7568 stream.on("data", (entry) => entries.push(entry));
7569 stream.once("end", () => resolve2(entries));
7570 });
7571 }
7572 };
7573 exports.default = ReaderAsync;
7574 }
7575});
7576
7577// node_modules/fast-glob/out/providers/matchers/matcher.js
7578var require_matcher = __commonJS({
7579 "node_modules/fast-glob/out/providers/matchers/matcher.js"(exports) {
7580 "use strict";
7581 Object.defineProperty(exports, "__esModule", { value: true });
7582 var utils = require_utils4();
7583 var Matcher = class {
7584 constructor(_patterns, _settings, _micromatchOptions) {
7585 this._patterns = _patterns;
7586 this._settings = _settings;
7587 this._micromatchOptions = _micromatchOptions;
7588 this._storage = [];
7589 this._fillStorage();
7590 }
7591 _fillStorage() {
7592 const patterns = utils.pattern.expandPatternsWithBraceExpansion(this._patterns);
7593 for (const pattern of patterns) {
7594 const segments = this._getPatternSegments(pattern);
7595 const sections = this._splitSegmentsIntoSections(segments);
7596 this._storage.push({
7597 complete: sections.length <= 1,
7598 pattern,
7599 segments,
7600 sections
7601 });
7602 }
7603 }
7604 _getPatternSegments(pattern) {
7605 const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions);
7606 return parts.map((part) => {
7607 const dynamic = utils.pattern.isDynamicPattern(part, this._settings);
7608 if (!dynamic) {
7609 return {
7610 dynamic: false,
7611 pattern: part
7612 };
7613 }
7614 return {
7615 dynamic: true,
7616 pattern: part,
7617 patternRe: utils.pattern.makeRe(part, this._micromatchOptions)
7618 };
7619 });
7620 }
7621 _splitSegmentsIntoSections(segments) {
7622 return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern));
7623 }
7624 };
7625 exports.default = Matcher;
7626 }
7627});
7628
7629// node_modules/fast-glob/out/providers/matchers/partial.js
7630var require_partial = __commonJS({
7631 "node_modules/fast-glob/out/providers/matchers/partial.js"(exports) {
7632 "use strict";
7633 Object.defineProperty(exports, "__esModule", { value: true });
7634 var matcher_1 = require_matcher();
7635 var PartialMatcher = class extends matcher_1.default {
7636 match(filepath) {
7637 const parts = filepath.split("/");
7638 const levels = parts.length;
7639 const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
7640 for (const pattern of patterns) {
7641 const section = pattern.sections[0];
7642 if (!pattern.complete && levels > section.length) {
7643 return true;
7644 }
7645 const match = parts.every((part, index) => {
7646 const segment = pattern.segments[index];
7647 if (segment.dynamic && segment.patternRe.test(part)) {
7648 return true;
7649 }
7650 if (!segment.dynamic && segment.pattern === part) {
7651 return true;
7652 }
7653 return false;
7654 });
7655 if (match) {
7656 return true;
7657 }
7658 }
7659 return false;
7660 }
7661 };
7662 exports.default = PartialMatcher;
7663 }
7664});
7665
7666// node_modules/fast-glob/out/providers/filters/deep.js
7667var require_deep = __commonJS({
7668 "node_modules/fast-glob/out/providers/filters/deep.js"(exports) {
7669 "use strict";
7670 Object.defineProperty(exports, "__esModule", { value: true });
7671 var utils = require_utils4();
7672 var partial_1 = require_partial();
7673 var DeepFilter = class {
7674 constructor(_settings, _micromatchOptions) {
7675 this._settings = _settings;
7676 this._micromatchOptions = _micromatchOptions;
7677 }
7678 getFilter(basePath, positive, negative) {
7679 const matcher = this._getMatcher(positive);
7680 const negativeRe = this._getNegativePatternsRe(negative);
7681 return (entry) => this._filter(basePath, entry, matcher, negativeRe);
7682 }
7683 _getMatcher(patterns) {
7684 return new partial_1.default(patterns, this._settings, this._micromatchOptions);
7685 }
7686 _getNegativePatternsRe(patterns) {
7687 const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern);
7688 return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
7689 }
7690 _filter(basePath, entry, matcher, negativeRe) {
7691 if (this._isSkippedByDeep(basePath, entry.path)) {
7692 return false;
7693 }
7694 if (this._isSkippedSymbolicLink(entry)) {
7695 return false;
7696 }
7697 const filepath = utils.path.removeLeadingDotSegment(entry.path);
7698 if (this._isSkippedByPositivePatterns(filepath, matcher)) {
7699 return false;
7700 }
7701 return this._isSkippedByNegativePatterns(filepath, negativeRe);
7702 }
7703 _isSkippedByDeep(basePath, entryPath) {
7704 if (this._settings.deep === Infinity) {
7705 return false;
7706 }
7707 return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
7708 }
7709 _getEntryLevel(basePath, entryPath) {
7710 const entryPathDepth = entryPath.split("/").length;
7711 if (basePath === "") {
7712 return entryPathDepth;
7713 }
7714 const basePathDepth = basePath.split("/").length;
7715 return entryPathDepth - basePathDepth;
7716 }
7717 _isSkippedSymbolicLink(entry) {
7718 return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
7719 }
7720 _isSkippedByPositivePatterns(entryPath, matcher) {
7721 return !this._settings.baseNameMatch && !matcher.match(entryPath);
7722 }
7723 _isSkippedByNegativePatterns(entryPath, patternsRe) {
7724 return !utils.pattern.matchAny(entryPath, patternsRe);
7725 }
7726 };
7727 exports.default = DeepFilter;
7728 }
7729});
7730
7731// node_modules/fast-glob/out/providers/filters/entry.js
7732var require_entry = __commonJS({
7733 "node_modules/fast-glob/out/providers/filters/entry.js"(exports) {
7734 "use strict";
7735 Object.defineProperty(exports, "__esModule", { value: true });
7736 var utils = require_utils4();
7737 var EntryFilter = class {
7738 constructor(_settings, _micromatchOptions) {
7739 this._settings = _settings;
7740 this._micromatchOptions = _micromatchOptions;
7741 this.index = /* @__PURE__ */ new Map();
7742 }
7743 getFilter(positive, negative) {
7744 const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions);
7745 const negativeRe = utils.pattern.convertPatternsToRe(negative, this._micromatchOptions);
7746 return (entry) => this._filter(entry, positiveRe, negativeRe);
7747 }
7748 _filter(entry, positiveRe, negativeRe) {
7749 if (this._settings.unique && this._isDuplicateEntry(entry)) {
7750 return false;
7751 }
7752 if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
7753 return false;
7754 }
7755 if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) {
7756 return false;
7757 }
7758 const filepath = this._settings.baseNameMatch ? entry.name : entry.path;
7759 const isDirectory = entry.dirent.isDirectory();
7760 const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(entry.path, negativeRe, isDirectory);
7761 if (this._settings.unique && isMatched) {
7762 this._createIndexRecord(entry);
7763 }
7764 return isMatched;
7765 }
7766 _isDuplicateEntry(entry) {
7767 return this.index.has(entry.path);
7768 }
7769 _createIndexRecord(entry) {
7770 this.index.set(entry.path, void 0);
7771 }
7772 _onlyFileFilter(entry) {
7773 return this._settings.onlyFiles && !entry.dirent.isFile();
7774 }
7775 _onlyDirectoryFilter(entry) {
7776 return this._settings.onlyDirectories && !entry.dirent.isDirectory();
7777 }
7778 _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) {
7779 if (!this._settings.absolute) {
7780 return false;
7781 }
7782 const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath);
7783 return utils.pattern.matchAny(fullpath, patternsRe);
7784 }
7785 _isMatchToPatterns(entryPath, patternsRe, isDirectory) {
7786 const filepath = utils.path.removeLeadingDotSegment(entryPath);
7787 const isMatched = utils.pattern.matchAny(filepath, patternsRe);
7788 if (!isMatched && isDirectory) {
7789 return utils.pattern.matchAny(filepath + "/", patternsRe);
7790 }
7791 return isMatched;
7792 }
7793 };
7794 exports.default = EntryFilter;
7795 }
7796});
7797
7798// node_modules/fast-glob/out/providers/filters/error.js
7799var require_error = __commonJS({
7800 "node_modules/fast-glob/out/providers/filters/error.js"(exports) {
7801 "use strict";
7802 Object.defineProperty(exports, "__esModule", { value: true });
7803 var utils = require_utils4();
7804 var ErrorFilter = class {
7805 constructor(_settings) {
7806 this._settings = _settings;
7807 }
7808 getFilter() {
7809 return (error) => this._isNonFatalError(error);
7810 }
7811 _isNonFatalError(error) {
7812 return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
7813 }
7814 };
7815 exports.default = ErrorFilter;
7816 }
7817});
7818
7819// node_modules/fast-glob/out/providers/transformers/entry.js
7820var require_entry2 = __commonJS({
7821 "node_modules/fast-glob/out/providers/transformers/entry.js"(exports) {
7822 "use strict";
7823 Object.defineProperty(exports, "__esModule", { value: true });
7824 var utils = require_utils4();
7825 var EntryTransformer = class {
7826 constructor(_settings) {
7827 this._settings = _settings;
7828 }
7829 getTransformer() {
7830 return (entry) => this._transform(entry);
7831 }
7832 _transform(entry) {
7833 let filepath = entry.path;
7834 if (this._settings.absolute) {
7835 filepath = utils.path.makeAbsolute(this._settings.cwd, filepath);
7836 filepath = utils.path.unixify(filepath);
7837 }
7838 if (this._settings.markDirectories && entry.dirent.isDirectory()) {
7839 filepath += "/";
7840 }
7841 if (!this._settings.objectMode) {
7842 return filepath;
7843 }
7844 return Object.assign(Object.assign({}, entry), { path: filepath });
7845 }
7846 };
7847 exports.default = EntryTransformer;
7848 }
7849});
7850
7851// node_modules/fast-glob/out/providers/provider.js
7852var require_provider = __commonJS({
7853 "node_modules/fast-glob/out/providers/provider.js"(exports) {
7854 "use strict";
7855 Object.defineProperty(exports, "__esModule", { value: true });
7856 var path9 = __require("path");
7857 var deep_1 = require_deep();
7858 var entry_1 = require_entry();
7859 var error_1 = require_error();
7860 var entry_2 = require_entry2();
7861 var Provider = class {
7862 constructor(_settings) {
7863 this._settings = _settings;
7864 this.errorFilter = new error_1.default(this._settings);
7865 this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
7866 this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
7867 this.entryTransformer = new entry_2.default(this._settings);
7868 }
7869 _getRootDirectory(task) {
7870 return path9.resolve(this._settings.cwd, task.base);
7871 }
7872 _getReaderOptions(task) {
7873 const basePath = task.base === "." ? "" : task.base;
7874 return {
7875 basePath,
7876 pathSegmentSeparator: "/",
7877 concurrency: this._settings.concurrency,
7878 deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
7879 entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
7880 errorFilter: this.errorFilter.getFilter(),
7881 followSymbolicLinks: this._settings.followSymbolicLinks,
7882 fs: this._settings.fs,
7883 stats: this._settings.stats,
7884 throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
7885 transform: this.entryTransformer.getTransformer()
7886 };
7887 }
7888 _getMicromatchOptions() {
7889 return {
7890 dot: this._settings.dot,
7891 matchBase: this._settings.baseNameMatch,
7892 nobrace: !this._settings.braceExpansion,
7893 nocase: !this._settings.caseSensitiveMatch,
7894 noext: !this._settings.extglob,
7895 noglobstar: !this._settings.globstar,
7896 posix: true,
7897 strictSlashes: false
7898 };
7899 }
7900 };
7901 exports.default = Provider;
7902 }
7903});
7904
7905// node_modules/fast-glob/out/providers/async.js
7906var require_async6 = __commonJS({
7907 "node_modules/fast-glob/out/providers/async.js"(exports) {
7908 "use strict";
7909 Object.defineProperty(exports, "__esModule", { value: true });
7910 var async_1 = require_async5();
7911 var provider_1 = require_provider();
7912 var ProviderAsync = class extends provider_1.default {
7913 constructor() {
7914 super(...arguments);
7915 this._reader = new async_1.default(this._settings);
7916 }
7917 async read(task) {
7918 const root = this._getRootDirectory(task);
7919 const options8 = this._getReaderOptions(task);
7920 const entries = await this.api(root, task, options8);
7921 return entries.map((entry) => options8.transform(entry));
7922 }
7923 api(root, task, options8) {
7924 if (task.dynamic) {
7925 return this._reader.dynamic(root, options8);
7926 }
7927 return this._reader.static(task.patterns, options8);
7928 }
7929 };
7930 exports.default = ProviderAsync;
7931 }
7932});
7933
7934// node_modules/fast-glob/out/providers/stream.js
7935var require_stream4 = __commonJS({
7936 "node_modules/fast-glob/out/providers/stream.js"(exports) {
7937 "use strict";
7938 Object.defineProperty(exports, "__esModule", { value: true });
7939 var stream_1 = __require("stream");
7940 var stream_2 = require_stream3();
7941 var provider_1 = require_provider();
7942 var ProviderStream = class extends provider_1.default {
7943 constructor() {
7944 super(...arguments);
7945 this._reader = new stream_2.default(this._settings);
7946 }
7947 read(task) {
7948 const root = this._getRootDirectory(task);
7949 const options8 = this._getReaderOptions(task);
7950 const source = this.api(root, task, options8);
7951 const destination = new stream_1.Readable({ objectMode: true, read: () => {
7952 } });
7953 source.once("error", (error) => destination.emit("error", error)).on("data", (entry) => destination.emit("data", options8.transform(entry))).once("end", () => destination.emit("end"));
7954 destination.once("close", () => source.destroy());
7955 return destination;
7956 }
7957 api(root, task, options8) {
7958 if (task.dynamic) {
7959 return this._reader.dynamic(root, options8);
7960 }
7961 return this._reader.static(task.patterns, options8);
7962 }
7963 };
7964 exports.default = ProviderStream;
7965 }
7966});
7967
7968// node_modules/fast-glob/out/readers/sync.js
7969var require_sync5 = __commonJS({
7970 "node_modules/fast-glob/out/readers/sync.js"(exports) {
7971 "use strict";
7972 Object.defineProperty(exports, "__esModule", { value: true });
7973 var fsStat = require_out();
7974 var fsWalk = require_out3();
7975 var reader_1 = require_reader2();
7976 var ReaderSync = class extends reader_1.default {
7977 constructor() {
7978 super(...arguments);
7979 this._walkSync = fsWalk.walkSync;
7980 this._statSync = fsStat.statSync;
7981 }
7982 dynamic(root, options8) {
7983 return this._walkSync(root, options8);
7984 }
7985 static(patterns, options8) {
7986 const entries = [];
7987 for (const pattern of patterns) {
7988 const filepath = this._getFullEntryPath(pattern);
7989 const entry = this._getEntry(filepath, pattern, options8);
7990 if (entry === null || !options8.entryFilter(entry)) {
7991 continue;
7992 }
7993 entries.push(entry);
7994 }
7995 return entries;
7996 }
7997 _getEntry(filepath, pattern, options8) {
7998 try {
7999 const stats = this._getStat(filepath);
8000 return this._makeEntry(stats, pattern);
8001 } catch (error) {
8002 if (options8.errorFilter(error)) {
8003 return null;
8004 }
8005 throw error;
8006 }
8007 }
8008 _getStat(filepath) {
8009 return this._statSync(filepath, this._fsStatSettings);
8010 }
8011 };
8012 exports.default = ReaderSync;
8013 }
8014});
8015
8016// node_modules/fast-glob/out/providers/sync.js
8017var require_sync6 = __commonJS({
8018 "node_modules/fast-glob/out/providers/sync.js"(exports) {
8019 "use strict";
8020 Object.defineProperty(exports, "__esModule", { value: true });
8021 var sync_1 = require_sync5();
8022 var provider_1 = require_provider();
8023 var ProviderSync = class extends provider_1.default {
8024 constructor() {
8025 super(...arguments);
8026 this._reader = new sync_1.default(this._settings);
8027 }
8028 read(task) {
8029 const root = this._getRootDirectory(task);
8030 const options8 = this._getReaderOptions(task);
8031 const entries = this.api(root, task, options8);
8032 return entries.map(options8.transform);
8033 }
8034 api(root, task, options8) {
8035 if (task.dynamic) {
8036 return this._reader.dynamic(root, options8);
8037 }
8038 return this._reader.static(task.patterns, options8);
8039 }
8040 };
8041 exports.default = ProviderSync;
8042 }
8043});
8044
8045// node_modules/fast-glob/out/settings.js
8046var require_settings4 = __commonJS({
8047 "node_modules/fast-glob/out/settings.js"(exports) {
8048 "use strict";
8049 Object.defineProperty(exports, "__esModule", { value: true });
8050 exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
8051 var fs5 = __require("fs");
8052 var os = __require("os");
8053 var CPU_COUNT = Math.max(os.cpus().length, 1);
8054 exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
8055 lstat: fs5.lstat,
8056 lstatSync: fs5.lstatSync,
8057 stat: fs5.stat,
8058 statSync: fs5.statSync,
8059 readdir: fs5.readdir,
8060 readdirSync: fs5.readdirSync
8061 };
8062 var Settings = class {
8063 constructor(_options = {}) {
8064 this._options = _options;
8065 this.absolute = this._getValue(this._options.absolute, false);
8066 this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);
8067 this.braceExpansion = this._getValue(this._options.braceExpansion, true);
8068 this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);
8069 this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);
8070 this.cwd = this._getValue(this._options.cwd, process.cwd());
8071 this.deep = this._getValue(this._options.deep, Infinity);
8072 this.dot = this._getValue(this._options.dot, false);
8073 this.extglob = this._getValue(this._options.extglob, true);
8074 this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);
8075 this.fs = this._getFileSystemMethods(this._options.fs);
8076 this.globstar = this._getValue(this._options.globstar, true);
8077 this.ignore = this._getValue(this._options.ignore, []);
8078 this.markDirectories = this._getValue(this._options.markDirectories, false);
8079 this.objectMode = this._getValue(this._options.objectMode, false);
8080 this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);
8081 this.onlyFiles = this._getValue(this._options.onlyFiles, true);
8082 this.stats = this._getValue(this._options.stats, false);
8083 this.suppressErrors = this._getValue(this._options.suppressErrors, false);
8084 this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);
8085 this.unique = this._getValue(this._options.unique, true);
8086 if (this.onlyDirectories) {
8087 this.onlyFiles = false;
8088 }
8089 if (this.stats) {
8090 this.objectMode = true;
8091 }
8092 }
8093 _getValue(option, value) {
8094 return option === void 0 ? value : option;
8095 }
8096 _getFileSystemMethods(methods = {}) {
8097 return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
8098 }
8099 };
8100 exports.default = Settings;
8101 }
8102});
8103
8104// node_modules/fast-glob/out/index.js
8105var require_out4 = __commonJS({
8106 "node_modules/fast-glob/out/index.js"(exports, module) {
8107 "use strict";
8108 var taskManager = require_tasks();
8109 var patternManager = require_patterns();
8110 var async_1 = require_async6();
8111 var stream_1 = require_stream4();
8112 var sync_1 = require_sync6();
8113 var settings_1 = require_settings4();
8114 var utils = require_utils4();
8115 async function FastGlob(source, options8) {
8116 assertPatternsInput(source);
8117 const works = getWorks(source, async_1.default, options8);
8118 const result = await Promise.all(works);
8119 return utils.array.flatten(result);
8120 }
8121 (function(FastGlob2) {
8122 function sync(source, options8) {
8123 assertPatternsInput(source);
8124 const works = getWorks(source, sync_1.default, options8);
8125 return utils.array.flatten(works);
8126 }
8127 FastGlob2.sync = sync;
8128 function stream(source, options8) {
8129 assertPatternsInput(source);
8130 const works = getWorks(source, stream_1.default, options8);
8131 return utils.stream.merge(works);
8132 }
8133 FastGlob2.stream = stream;
8134 function generateTasks(source, options8) {
8135 assertPatternsInput(source);
8136 const patterns = patternManager.transform([].concat(source));
8137 const settings = new settings_1.default(options8);
8138 return taskManager.generate(patterns, settings);
8139 }
8140 FastGlob2.generateTasks = generateTasks;
8141 function isDynamicPattern(source, options8) {
8142 assertPatternsInput(source);
8143 const settings = new settings_1.default(options8);
8144 return utils.pattern.isDynamicPattern(source, settings);
8145 }
8146 FastGlob2.isDynamicPattern = isDynamicPattern;
8147 function escapePath(source) {
8148 assertPatternsInput(source);
8149 return utils.path.escape(source);
8150 }
8151 FastGlob2.escapePath = escapePath;
8152 })(FastGlob || (FastGlob = {}));
8153 function getWorks(source, _Provider, options8) {
8154 const patterns = patternManager.transform([].concat(source));
8155 const settings = new settings_1.default(options8);
8156 const tasks = taskManager.generate(patterns, settings);
8157 const provider = new _Provider(settings);
8158 return tasks.map(provider.read, provider);
8159 }
8160 function assertPatternsInput(input) {
8161 const source = [].concat(input);
8162 const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item));
8163 if (!isValidSource) {
8164 throw new TypeError("Patterns must be a string (non empty) or an array of strings");
8165 }
8166 }
8167 module.exports = FastGlob;
8168 }
8169});
8170
8171// node_modules/diff/lib/diff/base.js
8172var require_base = __commonJS({
8173 "node_modules/diff/lib/diff/base.js"(exports) {
8174 "use strict";
8175 Object.defineProperty(exports, "__esModule", {
8176 value: true
8177 });
8178 exports["default"] = Diff;
8179 function Diff() {
8180 }
8181 Diff.prototype = {
8182 /*istanbul ignore start*/
8183 /*istanbul ignore end*/
8184 diff: function diff(oldString, newString) {
8185 var options8 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
8186 var callback = options8.callback;
8187 if (typeof options8 === "function") {
8188 callback = options8;
8189 options8 = {};
8190 }
8191 this.options = options8;
8192 var self = this;
8193 function done(value) {
8194 if (callback) {
8195 setTimeout(function() {
8196 callback(void 0, value);
8197 }, 0);
8198 return true;
8199 } else {
8200 return value;
8201 }
8202 }
8203 oldString = this.castInput(oldString);
8204 newString = this.castInput(newString);
8205 oldString = this.removeEmpty(this.tokenize(oldString));
8206 newString = this.removeEmpty(this.tokenize(newString));
8207 var newLen = newString.length, oldLen = oldString.length;
8208 var editLength = 1;
8209 var maxEditLength = newLen + oldLen;
8210 if (options8.maxEditLength) {
8211 maxEditLength = Math.min(maxEditLength, options8.maxEditLength);
8212 }
8213 var bestPath = [{
8214 newPos: -1,
8215 components: []
8216 }];
8217 var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
8218 if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {
8219 return done([{
8220 value: this.join(newString),
8221 count: newString.length
8222 }]);
8223 }
8224 function execEditLength() {
8225 for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
8226 var basePath = (
8227 /*istanbul ignore start*/
8228 void 0
8229 );
8230 var addPath = bestPath[diagonalPath - 1], removePath = bestPath[diagonalPath + 1], _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
8231 if (addPath) {
8232 bestPath[diagonalPath - 1] = void 0;
8233 }
8234 var canAdd = addPath && addPath.newPos + 1 < newLen, canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;
8235 if (!canAdd && !canRemove) {
8236 bestPath[diagonalPath] = void 0;
8237 continue;
8238 }
8239 if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {
8240 basePath = clonePath(removePath);
8241 self.pushComponent(basePath.components, void 0, true);
8242 } else {
8243 basePath = addPath;
8244 basePath.newPos++;
8245 self.pushComponent(basePath.components, true, void 0);
8246 }
8247 _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath);
8248 if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {
8249 return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));
8250 } else {
8251 bestPath[diagonalPath] = basePath;
8252 }
8253 }
8254 editLength++;
8255 }
8256 if (callback) {
8257 (function exec() {
8258 setTimeout(function() {
8259 if (editLength > maxEditLength) {
8260 return callback();
8261 }
8262 if (!execEditLength()) {
8263 exec();
8264 }
8265 }, 0);
8266 })();
8267 } else {
8268 while (editLength <= maxEditLength) {
8269 var ret = execEditLength();
8270 if (ret) {
8271 return ret;
8272 }
8273 }
8274 }
8275 },
8276 /*istanbul ignore start*/
8277 /*istanbul ignore end*/
8278 pushComponent: function pushComponent(components, added, removed) {
8279 var last = components[components.length - 1];
8280 if (last && last.added === added && last.removed === removed) {
8281 components[components.length - 1] = {
8282 count: last.count + 1,
8283 added,
8284 removed
8285 };
8286 } else {
8287 components.push({
8288 count: 1,
8289 added,
8290 removed
8291 });
8292 }
8293 },
8294 /*istanbul ignore start*/
8295 /*istanbul ignore end*/
8296 extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
8297 var newLen = newString.length, oldLen = oldString.length, newPos = basePath.newPos, oldPos = newPos - diagonalPath, commonCount = 0;
8298 while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
8299 newPos++;
8300 oldPos++;
8301 commonCount++;
8302 }
8303 if (commonCount) {
8304 basePath.components.push({
8305 count: commonCount
8306 });
8307 }
8308 basePath.newPos = newPos;
8309 return oldPos;
8310 },
8311 /*istanbul ignore start*/
8312 /*istanbul ignore end*/
8313 equals: function equals(left, right) {
8314 if (this.options.comparator) {
8315 return this.options.comparator(left, right);
8316 } else {
8317 return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase();
8318 }
8319 },
8320 /*istanbul ignore start*/
8321 /*istanbul ignore end*/
8322 removeEmpty: function removeEmpty(array) {
8323 var ret = [];
8324 for (var i = 0; i < array.length; i++) {
8325 if (array[i]) {
8326 ret.push(array[i]);
8327 }
8328 }
8329 return ret;
8330 },
8331 /*istanbul ignore start*/
8332 /*istanbul ignore end*/
8333 castInput: function castInput(value) {
8334 return value;
8335 },
8336 /*istanbul ignore start*/
8337 /*istanbul ignore end*/
8338 tokenize: function tokenize(value) {
8339 return value.split("");
8340 },
8341 /*istanbul ignore start*/
8342 /*istanbul ignore end*/
8343 join: function join2(chars) {
8344 return chars.join("");
8345 }
8346 };
8347 function buildValues(diff, components, newString, oldString, useLongestToken) {
8348 var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0;
8349 for (; componentPos < componentLen; componentPos++) {
8350 var component = components[componentPos];
8351 if (!component.removed) {
8352 if (!component.added && useLongestToken) {
8353 var value = newString.slice(newPos, newPos + component.count);
8354 value = value.map(function(value2, i) {
8355 var oldValue = oldString[oldPos + i];
8356 return oldValue.length > value2.length ? oldValue : value2;
8357 });
8358 component.value = diff.join(value);
8359 } else {
8360 component.value = diff.join(newString.slice(newPos, newPos + component.count));
8361 }
8362 newPos += component.count;
8363 if (!component.added) {
8364 oldPos += component.count;
8365 }
8366 } else {
8367 component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
8368 oldPos += component.count;
8369 if (componentPos && components[componentPos - 1].added) {
8370 var tmp = components[componentPos - 1];
8371 components[componentPos - 1] = components[componentPos];
8372 components[componentPos] = tmp;
8373 }
8374 }
8375 }
8376 var lastComponent = components[componentLen - 1];
8377 if (componentLen > 1 && typeof lastComponent.value === "string" && (lastComponent.added || lastComponent.removed) && diff.equals("", lastComponent.value)) {
8378 components[componentLen - 2].value += lastComponent.value;
8379 components.pop();
8380 }
8381 return components;
8382 }
8383 function clonePath(path9) {
8384 return {
8385 newPos: path9.newPos,
8386 components: path9.components.slice(0)
8387 };
8388 }
8389 }
8390});
8391
8392// node_modules/diff/lib/diff/array.js
8393var require_array3 = __commonJS({
8394 "node_modules/diff/lib/diff/array.js"(exports) {
8395 "use strict";
8396 Object.defineProperty(exports, "__esModule", {
8397 value: true
8398 });
8399 exports.diffArrays = diffArrays2;
8400 exports.arrayDiff = void 0;
8401 var _base = _interopRequireDefault(require_base());
8402 function _interopRequireDefault(obj) {
8403 return obj && obj.__esModule ? obj : { "default": obj };
8404 }
8405 var arrayDiff = new /*istanbul ignore start*/
8406 _base[
8407 /*istanbul ignore start*/
8408 "default"
8409 /*istanbul ignore end*/
8410 ]();
8411 exports.arrayDiff = arrayDiff;
8412 arrayDiff.tokenize = function(value) {
8413 return value.slice();
8414 };
8415 arrayDiff.join = arrayDiff.removeEmpty = function(value) {
8416 return value;
8417 };
8418 function diffArrays2(oldArr, newArr, callback) {
8419 return arrayDiff.diff(oldArr, newArr, callback);
8420 }
8421 }
8422});
8423
8424// node_modules/n-readlines/readlines.js
8425var require_readlines = __commonJS({
8426 "node_modules/n-readlines/readlines.js"(exports, module) {
8427 "use strict";
8428 var fs5 = __require("fs");
8429 var LineByLine = class {
8430 constructor(file, options8) {
8431 options8 = options8 || {};
8432 if (!options8.readChunk)
8433 options8.readChunk = 1024;
8434 if (!options8.newLineCharacter) {
8435 options8.newLineCharacter = 10;
8436 } else {
8437 options8.newLineCharacter = options8.newLineCharacter.charCodeAt(0);
8438 }
8439 if (typeof file === "number") {
8440 this.fd = file;
8441 } else {
8442 this.fd = fs5.openSync(file, "r");
8443 }
8444 this.options = options8;
8445 this.newLineCharacter = options8.newLineCharacter;
8446 this.reset();
8447 }
8448 _searchInBuffer(buffer, hexNeedle) {
8449 let found = -1;
8450 for (let i = 0; i <= buffer.length; i++) {
8451 let b_byte = buffer[i];
8452 if (b_byte === hexNeedle) {
8453 found = i;
8454 break;
8455 }
8456 }
8457 return found;
8458 }
8459 reset() {
8460 this.eofReached = false;
8461 this.linesCache = [];
8462 this.fdPosition = 0;
8463 }
8464 close() {
8465 fs5.closeSync(this.fd);
8466 this.fd = null;
8467 }
8468 _extractLines(buffer) {
8469 let line2;
8470 const lines = [];
8471 let bufferPosition = 0;
8472 let lastNewLineBufferPosition = 0;
8473 while (true) {
8474 let bufferPositionValue = buffer[bufferPosition++];
8475 if (bufferPositionValue === this.newLineCharacter) {
8476 line2 = buffer.slice(lastNewLineBufferPosition, bufferPosition);
8477 lines.push(line2);
8478 lastNewLineBufferPosition = bufferPosition;
8479 } else if (bufferPositionValue === void 0) {
8480 break;
8481 }
8482 }
8483 let leftovers = buffer.slice(lastNewLineBufferPosition, bufferPosition);
8484 if (leftovers.length) {
8485 lines.push(leftovers);
8486 }
8487 return lines;
8488 }
8489 _readChunk(lineLeftovers) {
8490 let totalBytesRead = 0;
8491 let bytesRead;
8492 const buffers = [];
8493 do {
8494 const readBuffer = Buffer.alloc(this.options.readChunk);
8495 bytesRead = fs5.readSync(this.fd, readBuffer, 0, this.options.readChunk, this.fdPosition);
8496 totalBytesRead = totalBytesRead + bytesRead;
8497 this.fdPosition = this.fdPosition + bytesRead;
8498 buffers.push(readBuffer);
8499 } while (bytesRead && this._searchInBuffer(buffers[buffers.length - 1], this.options.newLineCharacter) === -1);
8500 let bufferData = Buffer.concat(buffers);
8501 if (bytesRead < this.options.readChunk) {
8502 this.eofReached = true;
8503 bufferData = bufferData.slice(0, totalBytesRead);
8504 }
8505 if (totalBytesRead) {
8506 this.linesCache = this._extractLines(bufferData);
8507 if (lineLeftovers) {
8508 this.linesCache[0] = Buffer.concat([lineLeftovers, this.linesCache[0]]);
8509 }
8510 }
8511 return totalBytesRead;
8512 }
8513 next() {
8514 if (!this.fd)
8515 return false;
8516 let line2 = false;
8517 if (this.eofReached && this.linesCache.length === 0) {
8518 return line2;
8519 }
8520 let bytesRead;
8521 if (!this.linesCache.length) {
8522 bytesRead = this._readChunk();
8523 }
8524 if (this.linesCache.length) {
8525 line2 = this.linesCache.shift();
8526 const lastLineCharacter = line2[line2.length - 1];
8527 if (lastLineCharacter !== this.newLineCharacter) {
8528 bytesRead = this._readChunk(line2);
8529 if (bytesRead) {
8530 line2 = this.linesCache.shift();
8531 }
8532 }
8533 }
8534 if (this.eofReached && this.linesCache.length === 0) {
8535 this.close();
8536 }
8537 if (line2 && line2[line2.length - 1] === this.newLineCharacter) {
8538 line2 = line2.slice(0, line2.length - 1);
8539 }
8540 return line2;
8541 }
8542 };
8543 module.exports = LineByLine;
8544 }
8545});
8546
8547// node_modules/js-tokens/index.js
8548var require_js_tokens = __commonJS({
8549 "node_modules/js-tokens/index.js"(exports) {
8550 Object.defineProperty(exports, "__esModule", {
8551 value: true
8552 });
8553 exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;
8554 exports.matchToToken = function(match) {
8555 var token = { type: "invalid", value: match[0], closed: void 0 };
8556 if (match[1])
8557 token.type = "string", token.closed = !!(match[3] || match[4]);
8558 else if (match[5])
8559 token.type = "comment";
8560 else if (match[6])
8561 token.type = "comment", token.closed = !!match[7];
8562 else if (match[8])
8563 token.type = "regex";
8564 else if (match[9])
8565 token.type = "number";
8566 else if (match[10])
8567 token.type = "name";
8568 else if (match[11])
8569 token.type = "punctuator";
8570 else if (match[12])
8571 token.type = "whitespace";
8572 return token;
8573 };
8574 }
8575});
8576
8577// node_modules/@babel/helper-validator-identifier/lib/identifier.js
8578var require_identifier = __commonJS({
8579 "node_modules/@babel/helper-validator-identifier/lib/identifier.js"(exports) {
8580 "use strict";
8581 Object.defineProperty(exports, "__esModule", {
8582 value: true
8583 });
8584 exports.isIdentifierChar = isIdentifierChar;
8585 exports.isIdentifierName = isIdentifierName;
8586 exports.isIdentifierStart = isIdentifierStart;
8587 var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC";
8588 var nonASCIIidentifierChars = "\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F";
8589 var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
8590 var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
8591 nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
8592 var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938, 6, 4191];
8593 var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
8594 function isInAstralSet(code, set) {
8595 let pos = 65536;
8596 for (let i = 0, length = set.length; i < length; i += 2) {
8597 pos += set[i];
8598 if (pos > code)
8599 return false;
8600 pos += set[i + 1];
8601 if (pos >= code)
8602 return true;
8603 }
8604 return false;
8605 }
8606 function isIdentifierStart(code) {
8607 if (code < 65)
8608 return code === 36;
8609 if (code <= 90)
8610 return true;
8611 if (code < 97)
8612 return code === 95;
8613 if (code <= 122)
8614 return true;
8615 if (code <= 65535) {
8616 return code >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code));
8617 }
8618 return isInAstralSet(code, astralIdentifierStartCodes);
8619 }
8620 function isIdentifierChar(code) {
8621 if (code < 48)
8622 return code === 36;
8623 if (code < 58)
8624 return true;
8625 if (code < 65)
8626 return false;
8627 if (code <= 90)
8628 return true;
8629 if (code < 97)
8630 return code === 95;
8631 if (code <= 122)
8632 return true;
8633 if (code <= 65535) {
8634 return code >= 170 && nonASCIIidentifier.test(String.fromCharCode(code));
8635 }
8636 return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
8637 }
8638 function isIdentifierName(name) {
8639 let isFirst = true;
8640 for (let i = 0; i < name.length; i++) {
8641 let cp = name.charCodeAt(i);
8642 if ((cp & 64512) === 55296 && i + 1 < name.length) {
8643 const trail = name.charCodeAt(++i);
8644 if ((trail & 64512) === 56320) {
8645 cp = 65536 + ((cp & 1023) << 10) + (trail & 1023);
8646 }
8647 }
8648 if (isFirst) {
8649 isFirst = false;
8650 if (!isIdentifierStart(cp)) {
8651 return false;
8652 }
8653 } else if (!isIdentifierChar(cp)) {
8654 return false;
8655 }
8656 }
8657 return !isFirst;
8658 }
8659 }
8660});
8661
8662// node_modules/@babel/helper-validator-identifier/lib/keyword.js
8663var require_keyword = __commonJS({
8664 "node_modules/@babel/helper-validator-identifier/lib/keyword.js"(exports) {
8665 "use strict";
8666 Object.defineProperty(exports, "__esModule", {
8667 value: true
8668 });
8669 exports.isKeyword = isKeyword;
8670 exports.isReservedWord = isReservedWord;
8671 exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
8672 exports.isStrictBindReservedWord = isStrictBindReservedWord;
8673 exports.isStrictReservedWord = isStrictReservedWord;
8674 var reservedWords = {
8675 keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
8676 strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
8677 strictBind: ["eval", "arguments"]
8678 };
8679 var keywords = new Set(reservedWords.keyword);
8680 var reservedWordsStrictSet = new Set(reservedWords.strict);
8681 var reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
8682 function isReservedWord(word, inModule) {
8683 return inModule && word === "await" || word === "enum";
8684 }
8685 function isStrictReservedWord(word, inModule) {
8686 return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
8687 }
8688 function isStrictBindOnlyReservedWord(word) {
8689 return reservedWordsStrictBindSet.has(word);
8690 }
8691 function isStrictBindReservedWord(word, inModule) {
8692 return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
8693 }
8694 function isKeyword(word) {
8695 return keywords.has(word);
8696 }
8697 }
8698});
8699
8700// node_modules/@babel/helper-validator-identifier/lib/index.js
8701var require_lib2 = __commonJS({
8702 "node_modules/@babel/helper-validator-identifier/lib/index.js"(exports) {
8703 "use strict";
8704 Object.defineProperty(exports, "__esModule", {
8705 value: true
8706 });
8707 Object.defineProperty(exports, "isIdentifierChar", {
8708 enumerable: true,
8709 get: function() {
8710 return _identifier.isIdentifierChar;
8711 }
8712 });
8713 Object.defineProperty(exports, "isIdentifierName", {
8714 enumerable: true,
8715 get: function() {
8716 return _identifier.isIdentifierName;
8717 }
8718 });
8719 Object.defineProperty(exports, "isIdentifierStart", {
8720 enumerable: true,
8721 get: function() {
8722 return _identifier.isIdentifierStart;
8723 }
8724 });
8725 Object.defineProperty(exports, "isKeyword", {
8726 enumerable: true,
8727 get: function() {
8728 return _keyword.isKeyword;
8729 }
8730 });
8731 Object.defineProperty(exports, "isReservedWord", {
8732 enumerable: true,
8733 get: function() {
8734 return _keyword.isReservedWord;
8735 }
8736 });
8737 Object.defineProperty(exports, "isStrictBindOnlyReservedWord", {
8738 enumerable: true,
8739 get: function() {
8740 return _keyword.isStrictBindOnlyReservedWord;
8741 }
8742 });
8743 Object.defineProperty(exports, "isStrictBindReservedWord", {
8744 enumerable: true,
8745 get: function() {
8746 return _keyword.isStrictBindReservedWord;
8747 }
8748 });
8749 Object.defineProperty(exports, "isStrictReservedWord", {
8750 enumerable: true,
8751 get: function() {
8752 return _keyword.isStrictReservedWord;
8753 }
8754 });
8755 var _identifier = require_identifier();
8756 var _keyword = require_keyword();
8757 }
8758});
8759
8760// node_modules/@babel/highlight/node_modules/escape-string-regexp/index.js
8761var require_escape_string_regexp2 = __commonJS({
8762 "node_modules/@babel/highlight/node_modules/escape-string-regexp/index.js"(exports, module) {
8763 "use strict";
8764 var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
8765 module.exports = function(str) {
8766 if (typeof str !== "string") {
8767 throw new TypeError("Expected a string");
8768 }
8769 return str.replace(matchOperatorsRe, "\\$&");
8770 };
8771 }
8772});
8773
8774// node_modules/@babel/highlight/node_modules/has-flag/index.js
8775var require_has_flag2 = __commonJS({
8776 "node_modules/@babel/highlight/node_modules/has-flag/index.js"(exports, module) {
8777 "use strict";
8778 module.exports = (flag, argv) => {
8779 argv = argv || process.argv;
8780 const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
8781 const pos = argv.indexOf(prefix + flag);
8782 const terminatorPos = argv.indexOf("--");
8783 return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
8784 };
8785 }
8786});
8787
8788// node_modules/@babel/highlight/node_modules/supports-color/index.js
8789var require_supports_color2 = __commonJS({
8790 "node_modules/@babel/highlight/node_modules/supports-color/index.js"(exports, module) {
8791 "use strict";
8792 var os = __require("os");
8793 var hasFlag = require_has_flag2();
8794 var env = process.env;
8795 var forceColor;
8796 if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
8797 forceColor = false;
8798 } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
8799 forceColor = true;
8800 }
8801 if ("FORCE_COLOR" in env) {
8802 forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
8803 }
8804 function translateLevel(level) {
8805 if (level === 0) {
8806 return false;
8807 }
8808 return {
8809 level,
8810 hasBasic: true,
8811 has256: level >= 2,
8812 has16m: level >= 3
8813 };
8814 }
8815 function supportsColor(stream) {
8816 if (forceColor === false) {
8817 return 0;
8818 }
8819 if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
8820 return 3;
8821 }
8822 if (hasFlag("color=256")) {
8823 return 2;
8824 }
8825 if (stream && !stream.isTTY && forceColor !== true) {
8826 return 0;
8827 }
8828 const min = forceColor ? 1 : 0;
8829 if (process.platform === "win32") {
8830 const osRelease = os.release().split(".");
8831 if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
8832 return Number(osRelease[2]) >= 14931 ? 3 : 2;
8833 }
8834 return 1;
8835 }
8836 if ("CI" in env) {
8837 if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
8838 return 1;
8839 }
8840 return min;
8841 }
8842 if ("TEAMCITY_VERSION" in env) {
8843 return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
8844 }
8845 if (env.COLORTERM === "truecolor") {
8846 return 3;
8847 }
8848 if ("TERM_PROGRAM" in env) {
8849 const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
8850 switch (env.TERM_PROGRAM) {
8851 case "iTerm.app":
8852 return version >= 3 ? 3 : 2;
8853 case "Apple_Terminal":
8854 return 2;
8855 }
8856 }
8857 if (/-256(color)?$/i.test(env.TERM)) {
8858 return 2;
8859 }
8860 if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
8861 return 1;
8862 }
8863 if ("COLORTERM" in env) {
8864 return 1;
8865 }
8866 if (env.TERM === "dumb") {
8867 return min;
8868 }
8869 return min;
8870 }
8871 function getSupportLevel(stream) {
8872 const level = supportsColor(stream);
8873 return translateLevel(level);
8874 }
8875 module.exports = {
8876 supportsColor: getSupportLevel,
8877 stdout: getSupportLevel(process.stdout),
8878 stderr: getSupportLevel(process.stderr)
8879 };
8880 }
8881});
8882
8883// node_modules/@babel/highlight/node_modules/chalk/templates.js
8884var require_templates2 = __commonJS({
8885 "node_modules/@babel/highlight/node_modules/chalk/templates.js"(exports, module) {
8886 "use strict";
8887 var TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
8888 var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
8889 var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
8890 var ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;
8891 var ESCAPES = /* @__PURE__ */ new Map([
8892 ["n", "\n"],
8893 ["r", "\r"],
8894 ["t", " "],
8895 ["b", "\b"],
8896 ["f", "\f"],
8897 ["v", "\v"],
8898 ["0", "\0"],
8899 ["\\", "\\"],
8900 ["e", "\x1B"],
8901 ["a", "\x07"]
8902 ]);
8903 function unescape(c) {
8904 if (c[0] === "u" && c.length === 5 || c[0] === "x" && c.length === 3) {
8905 return String.fromCharCode(parseInt(c.slice(1), 16));
8906 }
8907 return ESCAPES.get(c) || c;
8908 }
8909 function parseArguments(name, args) {
8910 const results = [];
8911 const chunks = args.trim().split(/\s*,\s*/g);
8912 let matches;
8913 for (const chunk of chunks) {
8914 if (!isNaN(chunk)) {
8915 results.push(Number(chunk));
8916 } else if (matches = chunk.match(STRING_REGEX)) {
8917 results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape(escape) : chr));
8918 } else {
8919 throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
8920 }
8921 }
8922 return results;
8923 }
8924 function parseStyle(style) {
8925 STYLE_REGEX.lastIndex = 0;
8926 const results = [];
8927 let matches;
8928 while ((matches = STYLE_REGEX.exec(style)) !== null) {
8929 const name = matches[1];
8930 if (matches[2]) {
8931 const args = parseArguments(name, matches[2]);
8932 results.push([name].concat(args));
8933 } else {
8934 results.push([name]);
8935 }
8936 }
8937 return results;
8938 }
8939 function buildStyle(chalk, styles) {
8940 const enabled = {};
8941 for (const layer of styles) {
8942 for (const style of layer.styles) {
8943 enabled[style[0]] = layer.inverse ? null : style.slice(1);
8944 }
8945 }
8946 let current = chalk;
8947 for (const styleName of Object.keys(enabled)) {
8948 if (Array.isArray(enabled[styleName])) {
8949 if (!(styleName in current)) {
8950 throw new Error(`Unknown Chalk style: ${styleName}`);
8951 }
8952 if (enabled[styleName].length > 0) {
8953 current = current[styleName].apply(current, enabled[styleName]);
8954 } else {
8955 current = current[styleName];
8956 }
8957 }
8958 }
8959 return current;
8960 }
8961 module.exports = (chalk, tmp) => {
8962 const styles = [];
8963 const chunks = [];
8964 let chunk = [];
8965 tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => {
8966 if (escapeChar) {
8967 chunk.push(unescape(escapeChar));
8968 } else if (style) {
8969 const str = chunk.join("");
8970 chunk = [];
8971 chunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str));
8972 styles.push({ inverse, styles: parseStyle(style) });
8973 } else if (close) {
8974 if (styles.length === 0) {
8975 throw new Error("Found extraneous } in Chalk template literal");
8976 }
8977 chunks.push(buildStyle(chalk, styles)(chunk.join("")));
8978 chunk = [];
8979 styles.pop();
8980 } else {
8981 chunk.push(chr);
8982 }
8983 });
8984 chunks.push(chunk.join(""));
8985 if (styles.length > 0) {
8986 const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
8987 throw new Error(errMsg);
8988 }
8989 return chunks.join("");
8990 };
8991 }
8992});
8993
8994// node_modules/@babel/highlight/node_modules/chalk/index.js
8995var require_chalk2 = __commonJS({
8996 "node_modules/@babel/highlight/node_modules/chalk/index.js"(exports, module) {
8997 "use strict";
8998 var escapeStringRegexp2 = require_escape_string_regexp2();
8999 var ansiStyles = require_ansi_styles();
9000 var stdoutColor = require_supports_color2().stdout;
9001 var template = require_templates2();
9002 var isSimpleWindowsTerm = process.platform === "win32" && !(process.env.TERM || "").toLowerCase().startsWith("xterm");
9003 var levelMapping = ["ansi", "ansi", "ansi256", "ansi16m"];
9004 var skipModels = /* @__PURE__ */ new Set(["gray"]);
9005 var styles = /* @__PURE__ */ Object.create(null);
9006 function applyOptions(obj, options8) {
9007 options8 = options8 || {};
9008 const scLevel = stdoutColor ? stdoutColor.level : 0;
9009 obj.level = options8.level === void 0 ? scLevel : options8.level;
9010 obj.enabled = "enabled" in options8 ? options8.enabled : obj.level > 0;
9011 }
9012 function Chalk(options8) {
9013 if (!this || !(this instanceof Chalk) || this.template) {
9014 const chalk = {};
9015 applyOptions(chalk, options8);
9016 chalk.template = function() {
9017 const args = [].slice.call(arguments);
9018 return chalkTag.apply(null, [chalk.template].concat(args));
9019 };
9020 Object.setPrototypeOf(chalk, Chalk.prototype);
9021 Object.setPrototypeOf(chalk.template, chalk);
9022 chalk.template.constructor = Chalk;
9023 return chalk.template;
9024 }
9025 applyOptions(this, options8);
9026 }
9027 if (isSimpleWindowsTerm) {
9028 ansiStyles.blue.open = "\x1B[94m";
9029 }
9030 for (const key of Object.keys(ansiStyles)) {
9031 ansiStyles[key].closeRe = new RegExp(escapeStringRegexp2(ansiStyles[key].close), "g");
9032 styles[key] = {
9033 get() {
9034 const codes2 = ansiStyles[key];
9035 return build.call(this, this._styles ? this._styles.concat(codes2) : [codes2], this._empty, key);
9036 }
9037 };
9038 }
9039 styles.visible = {
9040 get() {
9041 return build.call(this, this._styles || [], true, "visible");
9042 }
9043 };
9044 ansiStyles.color.closeRe = new RegExp(escapeStringRegexp2(ansiStyles.color.close), "g");
9045 for (const model of Object.keys(ansiStyles.color.ansi)) {
9046 if (skipModels.has(model)) {
9047 continue;
9048 }
9049 styles[model] = {
9050 get() {
9051 const level = this.level;
9052 return function() {
9053 const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments);
9054 const codes2 = {
9055 open,
9056 close: ansiStyles.color.close,
9057 closeRe: ansiStyles.color.closeRe
9058 };
9059 return build.call(this, this._styles ? this._styles.concat(codes2) : [codes2], this._empty, model);
9060 };
9061 }
9062 };
9063 }
9064 ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp2(ansiStyles.bgColor.close), "g");
9065 for (const model of Object.keys(ansiStyles.bgColor.ansi)) {
9066 if (skipModels.has(model)) {
9067 continue;
9068 }
9069 const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
9070 styles[bgModel] = {
9071 get() {
9072 const level = this.level;
9073 return function() {
9074 const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments);
9075 const codes2 = {
9076 open,
9077 close: ansiStyles.bgColor.close,
9078 closeRe: ansiStyles.bgColor.closeRe
9079 };
9080 return build.call(this, this._styles ? this._styles.concat(codes2) : [codes2], this._empty, model);
9081 };
9082 }
9083 };
9084 }
9085 var proto = Object.defineProperties(() => {
9086 }, styles);
9087 function build(_styles, _empty, key) {
9088 const builder = function() {
9089 return applyStyle.apply(builder, arguments);
9090 };
9091 builder._styles = _styles;
9092 builder._empty = _empty;
9093 const self = this;
9094 Object.defineProperty(builder, "level", {
9095 enumerable: true,
9096 get() {
9097 return self.level;
9098 },
9099 set(level) {
9100 self.level = level;
9101 }
9102 });
9103 Object.defineProperty(builder, "enabled", {
9104 enumerable: true,
9105 get() {
9106 return self.enabled;
9107 },
9108 set(enabled) {
9109 self.enabled = enabled;
9110 }
9111 });
9112 builder.hasGrey = this.hasGrey || key === "gray" || key === "grey";
9113 builder.__proto__ = proto;
9114 return builder;
9115 }
9116 function applyStyle() {
9117 const args = arguments;
9118 const argsLen = args.length;
9119 let str = String(arguments[0]);
9120 if (argsLen === 0) {
9121 return "";
9122 }
9123 if (argsLen > 1) {
9124 for (let a = 1; a < argsLen; a++) {
9125 str += " " + args[a];
9126 }
9127 }
9128 if (!this.enabled || this.level <= 0 || !str) {
9129 return this._empty ? "" : str;
9130 }
9131 const originalDim = ansiStyles.dim.open;
9132 if (isSimpleWindowsTerm && this.hasGrey) {
9133 ansiStyles.dim.open = "";
9134 }
9135 for (const code of this._styles.slice().reverse()) {
9136 str = code.open + str.replace(code.closeRe, code.open) + code.close;
9137 str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`);
9138 }
9139 ansiStyles.dim.open = originalDim;
9140 return str;
9141 }
9142 function chalkTag(chalk, strings) {
9143 if (!Array.isArray(strings)) {
9144 return [].slice.call(arguments, 1).join(" ");
9145 }
9146 const args = [].slice.call(arguments, 2);
9147 const parts = [strings.raw[0]];
9148 for (let i = 1; i < strings.length; i++) {
9149 parts.push(String(args[i - 1]).replace(/[{}\\]/g, "\\$&"));
9150 parts.push(String(strings.raw[i]));
9151 }
9152 return template(chalk, parts.join(""));
9153 }
9154 Object.defineProperties(Chalk.prototype, styles);
9155 module.exports = Chalk();
9156 module.exports.supportsColor = stdoutColor;
9157 module.exports.default = module.exports;
9158 }
9159});
9160
9161// node_modules/@babel/highlight/lib/index.js
9162var require_lib3 = __commonJS({
9163 "node_modules/@babel/highlight/lib/index.js"(exports) {
9164 "use strict";
9165 Object.defineProperty(exports, "__esModule", {
9166 value: true
9167 });
9168 exports.default = highlight;
9169 exports.getChalk = getChalk;
9170 exports.shouldHighlight = shouldHighlight;
9171 var _jsTokens = require_js_tokens();
9172 var _helperValidatorIdentifier = require_lib2();
9173 var _chalk = require_chalk2();
9174 var sometimesKeywords = /* @__PURE__ */ new Set(["as", "async", "from", "get", "of", "set"]);
9175 function getDefs(chalk) {
9176 return {
9177 keyword: chalk.cyan,
9178 capitalized: chalk.yellow,
9179 jsxIdentifier: chalk.yellow,
9180 punctuator: chalk.yellow,
9181 number: chalk.magenta,
9182 string: chalk.green,
9183 regex: chalk.magenta,
9184 comment: chalk.grey,
9185 invalid: chalk.white.bgRed.bold
9186 };
9187 }
9188 var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
9189 var BRACKET = /^[()[\]{}]$/;
9190 var tokenize;
9191 {
9192 const JSX_TAG = /^[a-z][\w-]*$/i;
9193 const getTokenType = function(token, offset, text) {
9194 if (token.type === "name") {
9195 if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isStrictReservedWord)(token.value, true) || sometimesKeywords.has(token.value)) {
9196 return "keyword";
9197 }
9198 if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) == "</")) {
9199 return "jsxIdentifier";
9200 }
9201 if (token.value[0] !== token.value[0].toLowerCase()) {
9202 return "capitalized";
9203 }
9204 }
9205 if (token.type === "punctuator" && BRACKET.test(token.value)) {
9206 return "bracket";
9207 }
9208 if (token.type === "invalid" && (token.value === "@" || token.value === "#")) {
9209 return "punctuator";
9210 }
9211 return token.type;
9212 };
9213 tokenize = function* (text) {
9214 let match;
9215 while (match = _jsTokens.default.exec(text)) {
9216 const token = _jsTokens.matchToToken(match);
9217 yield {
9218 type: getTokenType(token, match.index, text),
9219 value: token.value
9220 };
9221 }
9222 };
9223 }
9224 function highlightTokens(defs, text) {
9225 let highlighted = "";
9226 for (const {
9227 type,
9228 value
9229 } of tokenize(text)) {
9230 const colorize = defs[type];
9231 if (colorize) {
9232 highlighted += value.split(NEWLINE).map((str) => colorize(str)).join("\n");
9233 } else {
9234 highlighted += value;
9235 }
9236 }
9237 return highlighted;
9238 }
9239 function shouldHighlight(options8) {
9240 return !!_chalk.supportsColor || options8.forceColor;
9241 }
9242 function getChalk(options8) {
9243 return options8.forceColor ? new _chalk.constructor({
9244 enabled: true,
9245 level: 1
9246 }) : _chalk;
9247 }
9248 function highlight(code, options8 = {}) {
9249 if (code !== "" && shouldHighlight(options8)) {
9250 const chalk = getChalk(options8);
9251 const defs = getDefs(chalk);
9252 return highlightTokens(defs, code);
9253 } else {
9254 return code;
9255 }
9256 }
9257 }
9258});
9259
9260// node_modules/@babel/code-frame/lib/index.js
9261var require_lib4 = __commonJS({
9262 "node_modules/@babel/code-frame/lib/index.js"(exports) {
9263 "use strict";
9264 Object.defineProperty(exports, "__esModule", {
9265 value: true
9266 });
9267 exports.codeFrameColumns = codeFrameColumns2;
9268 exports.default = _default;
9269 var _highlight = require_lib3();
9270 var deprecationWarningShown = false;
9271 function getDefs(chalk) {
9272 return {
9273 gutter: chalk.grey,
9274 marker: chalk.red.bold,
9275 message: chalk.red.bold
9276 };
9277 }
9278 var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
9279 function getMarkerLines(loc, source, opts) {
9280 const startLoc = Object.assign({
9281 column: 0,
9282 line: -1
9283 }, loc.start);
9284 const endLoc = Object.assign({}, startLoc, loc.end);
9285 const {
9286 linesAbove = 2,
9287 linesBelow = 3
9288 } = opts || {};
9289 const startLine = startLoc.line;
9290 const startColumn = startLoc.column;
9291 const endLine = endLoc.line;
9292 const endColumn = endLoc.column;
9293 let start = Math.max(startLine - (linesAbove + 1), 0);
9294 let end = Math.min(source.length, endLine + linesBelow);
9295 if (startLine === -1) {
9296 start = 0;
9297 }
9298 if (endLine === -1) {
9299 end = source.length;
9300 }
9301 const lineDiff = endLine - startLine;
9302 const markerLines = {};
9303 if (lineDiff) {
9304 for (let i = 0; i <= lineDiff; i++) {
9305 const lineNumber = i + startLine;
9306 if (!startColumn) {
9307 markerLines[lineNumber] = true;
9308 } else if (i === 0) {
9309 const sourceLength = source[lineNumber - 1].length;
9310 markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
9311 } else if (i === lineDiff) {
9312 markerLines[lineNumber] = [0, endColumn];
9313 } else {
9314 const sourceLength = source[lineNumber - i].length;
9315 markerLines[lineNumber] = [0, sourceLength];
9316 }
9317 }
9318 } else {
9319 if (startColumn === endColumn) {
9320 if (startColumn) {
9321 markerLines[startLine] = [startColumn, 0];
9322 } else {
9323 markerLines[startLine] = true;
9324 }
9325 } else {
9326 markerLines[startLine] = [startColumn, endColumn - startColumn];
9327 }
9328 }
9329 return {
9330 start,
9331 end,
9332 markerLines
9333 };
9334 }
9335 function codeFrameColumns2(rawLines, loc, opts = {}) {
9336 const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);
9337 const chalk = (0, _highlight.getChalk)(opts);
9338 const defs = getDefs(chalk);
9339 const maybeHighlight = (chalkFn, string) => {
9340 return highlighted ? chalkFn(string) : string;
9341 };
9342 const lines = rawLines.split(NEWLINE);
9343 const {
9344 start,
9345 end,
9346 markerLines
9347 } = getMarkerLines(loc, lines, opts);
9348 const hasColumns = loc.start && typeof loc.start.column === "number";
9349 const numberMaxWidth = String(end).length;
9350 const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines;
9351 let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line2, index) => {
9352 const number = start + 1 + index;
9353 const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
9354 const gutter = ` ${paddedNumber} |`;
9355 const hasMarker = markerLines[number];
9356 const lastMarkerLine = !markerLines[number + 1];
9357 if (hasMarker) {
9358 let markerLine = "";
9359 if (Array.isArray(hasMarker)) {
9360 const markerSpacing = line2.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
9361 const numberOfMarkers = hasMarker[1] || 1;
9362 markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), " ", markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join("");
9363 if (lastMarkerLine && opts.message) {
9364 markerLine += " " + maybeHighlight(defs.message, opts.message);
9365 }
9366 }
9367 return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line2.length > 0 ? ` ${line2}` : "", markerLine].join("");
9368 } else {
9369 return ` ${maybeHighlight(defs.gutter, gutter)}${line2.length > 0 ? ` ${line2}` : ""}`;
9370 }
9371 }).join("\n");
9372 if (opts.message && !hasColumns) {
9373 frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}
9374${frame}`;
9375 }
9376 if (highlighted) {
9377 return chalk.reset(frame);
9378 } else {
9379 return frame;
9380 }
9381 }
9382 function _default(rawLines, lineNumber, colNumber, opts = {}) {
9383 if (!deprecationWarningShown) {
9384 deprecationWarningShown = true;
9385 const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
9386 if (process.emitWarning) {
9387 process.emitWarning(message, "DeprecationWarning");
9388 } else {
9389 const deprecationError = new Error(message);
9390 deprecationError.name = "DeprecationWarning";
9391 console.warn(new Error(message));
9392 }
9393 }
9394 colNumber = Math.max(colNumber, 0);
9395 const location = {
9396 start: {
9397 column: colNumber,
9398 line: lineNumber
9399 }
9400 };
9401 return codeFrameColumns2(rawLines, location, opts);
9402 }
9403 }
9404});
9405
9406// node_modules/p-defer/index.js
9407var require_p_defer = __commonJS({
9408 "node_modules/p-defer/index.js"(exports, module) {
9409 "use strict";
9410 module.exports = () => {
9411 const ret = {};
9412 ret.promise = new Promise((resolve2, reject) => {
9413 ret.resolve = resolve2;
9414 ret.reject = reject;
9415 });
9416 return ret;
9417 };
9418 }
9419});
9420
9421// node_modules/map-age-cleaner/dist/index.js
9422var require_dist = __commonJS({
9423 "node_modules/map-age-cleaner/dist/index.js"(exports, module) {
9424 "use strict";
9425 var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
9426 return new (P || (P = Promise))(function(resolve2, reject) {
9427 function fulfilled(value) {
9428 try {
9429 step(generator.next(value));
9430 } catch (e) {
9431 reject(e);
9432 }
9433 }
9434 function rejected(value) {
9435 try {
9436 step(generator["throw"](value));
9437 } catch (e) {
9438 reject(e);
9439 }
9440 }
9441 function step(result) {
9442 result.done ? resolve2(result.value) : new P(function(resolve3) {
9443 resolve3(result.value);
9444 }).then(fulfilled, rejected);
9445 }
9446 step((generator = generator.apply(thisArg, _arguments || [])).next());
9447 });
9448 };
9449 var __importDefault2 = exports && exports.__importDefault || function(mod) {
9450 return mod && mod.__esModule ? mod : { "default": mod };
9451 };
9452 Object.defineProperty(exports, "__esModule", { value: true });
9453 var p_defer_1 = __importDefault2(require_p_defer());
9454 function mapAgeCleaner2(map, property = "maxAge") {
9455 let processingKey;
9456 let processingTimer;
9457 let processingDeferred;
9458 const cleanup = () => __awaiter2(this, void 0, void 0, function* () {
9459 if (processingKey !== void 0) {
9460 return;
9461 }
9462 const setupTimer = (item) => __awaiter2(this, void 0, void 0, function* () {
9463 processingDeferred = p_defer_1.default();
9464 const delay = item[1][property] - Date.now();
9465 if (delay <= 0) {
9466 map.delete(item[0]);
9467 processingDeferred.resolve();
9468 return;
9469 }
9470 processingKey = item[0];
9471 processingTimer = setTimeout(() => {
9472 map.delete(item[0]);
9473 if (processingDeferred) {
9474 processingDeferred.resolve();
9475 }
9476 }, delay);
9477 if (typeof processingTimer.unref === "function") {
9478 processingTimer.unref();
9479 }
9480 return processingDeferred.promise;
9481 });
9482 try {
9483 for (const entry of map) {
9484 yield setupTimer(entry);
9485 }
9486 } catch (_a) {
9487 }
9488 processingKey = void 0;
9489 });
9490 const reset = () => {
9491 processingKey = void 0;
9492 if (processingTimer !== void 0) {
9493 clearTimeout(processingTimer);
9494 processingTimer = void 0;
9495 }
9496 if (processingDeferred !== void 0) {
9497 processingDeferred.reject(void 0);
9498 processingDeferred = void 0;
9499 }
9500 };
9501 const originalSet = map.set.bind(map);
9502 map.set = (key, value) => {
9503 if (map.has(key)) {
9504 map.delete(key);
9505 }
9506 const result = originalSet(key, value);
9507 if (processingKey && processingKey === key) {
9508 reset();
9509 }
9510 cleanup();
9511 return result;
9512 };
9513 cleanup();
9514 return map;
9515 }
9516 exports.default = mapAgeCleaner2;
9517 module.exports = mapAgeCleaner2;
9518 module.exports.default = mapAgeCleaner2;
9519 }
9520});
9521
9522// node_modules/semver/internal/debug.js
9523var require_debug = __commonJS({
9524 "node_modules/semver/internal/debug.js"(exports, module) {
9525 var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
9526 };
9527 module.exports = debug;
9528 }
9529});
9530
9531// node_modules/semver/internal/constants.js
9532var require_constants4 = __commonJS({
9533 "node_modules/semver/internal/constants.js"(exports, module) {
9534 var SEMVER_SPEC_VERSION = "2.0.0";
9535 var MAX_LENGTH = 256;
9536 var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
9537 9007199254740991;
9538 var MAX_SAFE_COMPONENT_LENGTH = 16;
9539 var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
9540 var RELEASE_TYPES = [
9541 "major",
9542 "premajor",
9543 "minor",
9544 "preminor",
9545 "patch",
9546 "prepatch",
9547 "prerelease"
9548 ];
9549 module.exports = {
9550 MAX_LENGTH,
9551 MAX_SAFE_COMPONENT_LENGTH,
9552 MAX_SAFE_BUILD_LENGTH,
9553 MAX_SAFE_INTEGER,
9554 RELEASE_TYPES,
9555 SEMVER_SPEC_VERSION,
9556 FLAG_INCLUDE_PRERELEASE: 1,
9557 FLAG_LOOSE: 2
9558 };
9559 }
9560});
9561
9562// node_modules/semver/internal/re.js
9563var require_re = __commonJS({
9564 "node_modules/semver/internal/re.js"(exports, module) {
9565 var { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH } = require_constants4();
9566 var debug = require_debug();
9567 exports = module.exports = {};
9568 var re = exports.re = [];
9569 var safeRe = exports.safeRe = [];
9570 var src = exports.src = [];
9571 var t = exports.t = {};
9572 var R = 0;
9573 var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
9574 var safeRegexReplacements = [
9575 ["\\s", 1],
9576 ["\\d", MAX_SAFE_COMPONENT_LENGTH],
9577 [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
9578 ];
9579 var makeSafeRegex = (value) => {
9580 for (const [token, max] of safeRegexReplacements) {
9581 value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
9582 }
9583 return value;
9584 };
9585 var createToken = (name, value, isGlobal) => {
9586 const safe = makeSafeRegex(value);
9587 const index = R++;
9588 debug(name, index, value);
9589 t[name] = index;
9590 src[index] = value;
9591 re[index] = new RegExp(value, isGlobal ? "g" : void 0);
9592 safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
9593 };
9594 createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
9595 createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
9596 createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
9597 createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
9598 createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
9599 createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);
9600 createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);
9601 createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
9602 createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
9603 createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
9604 createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
9605 createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
9606 createToken("FULL", `^${src[t.FULLPLAIN]}$`);
9607 createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
9608 createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
9609 createToken("GTLT", "((?:<|>)?=?)");
9610 createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
9611 createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
9612 createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
9613 createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
9614 createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
9615 createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
9616 createToken("COERCE", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:$|[^\\d])`);
9617 createToken("COERCERTL", src[t.COERCE], true);
9618 createToken("LONETILDE", "(?:~>?)");
9619 createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
9620 exports.tildeTrimReplace = "$1~";
9621 createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
9622 createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
9623 createToken("LONECARET", "(?:\\^)");
9624 createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
9625 exports.caretTrimReplace = "$1^";
9626 createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
9627 createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
9628 createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
9629 createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
9630 createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
9631 exports.comparatorTrimReplace = "$1$2$3";
9632 createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
9633 createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
9634 createToken("STAR", "(<|>)?=?\\s*\\*");
9635 createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
9636 createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
9637 }
9638});
9639
9640// node_modules/semver/internal/parse-options.js
9641var require_parse_options = __commonJS({
9642 "node_modules/semver/internal/parse-options.js"(exports, module) {
9643 var looseOption = Object.freeze({ loose: true });
9644 var emptyOpts = Object.freeze({});
9645 var parseOptions = (options8) => {
9646 if (!options8) {
9647 return emptyOpts;
9648 }
9649 if (typeof options8 !== "object") {
9650 return looseOption;
9651 }
9652 return options8;
9653 };
9654 module.exports = parseOptions;
9655 }
9656});
9657
9658// node_modules/semver/internal/identifiers.js
9659var require_identifiers = __commonJS({
9660 "node_modules/semver/internal/identifiers.js"(exports, module) {
9661 var numeric = /^[0-9]+$/;
9662 var compareIdentifiers = (a, b) => {
9663 const anum = numeric.test(a);
9664 const bnum = numeric.test(b);
9665 if (anum && bnum) {
9666 a = +a;
9667 b = +b;
9668 }
9669 return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
9670 };
9671 var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
9672 module.exports = {
9673 compareIdentifiers,
9674 rcompareIdentifiers
9675 };
9676 }
9677});
9678
9679// node_modules/semver/classes/semver.js
9680var require_semver = __commonJS({
9681 "node_modules/semver/classes/semver.js"(exports, module) {
9682 var debug = require_debug();
9683 var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants4();
9684 var { safeRe: re, t } = require_re();
9685 var parseOptions = require_parse_options();
9686 var { compareIdentifiers } = require_identifiers();
9687 var SemVer = class _SemVer {
9688 constructor(version, options8) {
9689 options8 = parseOptions(options8);
9690 if (version instanceof _SemVer) {
9691 if (version.loose === !!options8.loose && version.includePrerelease === !!options8.includePrerelease) {
9692 return version;
9693 } else {
9694 version = version.version;
9695 }
9696 } else if (typeof version !== "string") {
9697 throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
9698 }
9699 if (version.length > MAX_LENGTH) {
9700 throw new TypeError(
9701 `version is longer than ${MAX_LENGTH} characters`
9702 );
9703 }
9704 debug("SemVer", version, options8);
9705 this.options = options8;
9706 this.loose = !!options8.loose;
9707 this.includePrerelease = !!options8.includePrerelease;
9708 const m = version.trim().match(options8.loose ? re[t.LOOSE] : re[t.FULL]);
9709 if (!m) {
9710 throw new TypeError(`Invalid Version: ${version}`);
9711 }
9712 this.raw = version;
9713 this.major = +m[1];
9714 this.minor = +m[2];
9715 this.patch = +m[3];
9716 if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
9717 throw new TypeError("Invalid major version");
9718 }
9719 if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
9720 throw new TypeError("Invalid minor version");
9721 }
9722 if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
9723 throw new TypeError("Invalid patch version");
9724 }
9725 if (!m[4]) {
9726 this.prerelease = [];
9727 } else {
9728 this.prerelease = m[4].split(".").map((id) => {
9729 if (/^[0-9]+$/.test(id)) {
9730 const num = +id;
9731 if (num >= 0 && num < MAX_SAFE_INTEGER) {
9732 return num;
9733 }
9734 }
9735 return id;
9736 });
9737 }
9738 this.build = m[5] ? m[5].split(".") : [];
9739 this.format();
9740 }
9741 format() {
9742 this.version = `${this.major}.${this.minor}.${this.patch}`;
9743 if (this.prerelease.length) {
9744 this.version += `-${this.prerelease.join(".")}`;
9745 }
9746 return this.version;
9747 }
9748 toString() {
9749 return this.version;
9750 }
9751 compare(other) {
9752 debug("SemVer.compare", this.version, this.options, other);
9753 if (!(other instanceof _SemVer)) {
9754 if (typeof other === "string" && other === this.version) {
9755 return 0;
9756 }
9757 other = new _SemVer(other, this.options);
9758 }
9759 if (other.version === this.version) {
9760 return 0;
9761 }
9762 return this.compareMain(other) || this.comparePre(other);
9763 }
9764 compareMain(other) {
9765 if (!(other instanceof _SemVer)) {
9766 other = new _SemVer(other, this.options);
9767 }
9768 return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
9769 }
9770 comparePre(other) {
9771 if (!(other instanceof _SemVer)) {
9772 other = new _SemVer(other, this.options);
9773 }
9774 if (this.prerelease.length && !other.prerelease.length) {
9775 return -1;
9776 } else if (!this.prerelease.length && other.prerelease.length) {
9777 return 1;
9778 } else if (!this.prerelease.length && !other.prerelease.length) {
9779 return 0;
9780 }
9781 let i = 0;
9782 do {
9783 const a = this.prerelease[i];
9784 const b = other.prerelease[i];
9785 debug("prerelease compare", i, a, b);
9786 if (a === void 0 && b === void 0) {
9787 return 0;
9788 } else if (b === void 0) {
9789 return 1;
9790 } else if (a === void 0) {
9791 return -1;
9792 } else if (a === b) {
9793 continue;
9794 } else {
9795 return compareIdentifiers(a, b);
9796 }
9797 } while (++i);
9798 }
9799 compareBuild(other) {
9800 if (!(other instanceof _SemVer)) {
9801 other = new _SemVer(other, this.options);
9802 }
9803 let i = 0;
9804 do {
9805 const a = this.build[i];
9806 const b = other.build[i];
9807 debug("prerelease compare", i, a, b);
9808 if (a === void 0 && b === void 0) {
9809 return 0;
9810 } else if (b === void 0) {
9811 return 1;
9812 } else if (a === void 0) {
9813 return -1;
9814 } else if (a === b) {
9815 continue;
9816 } else {
9817 return compareIdentifiers(a, b);
9818 }
9819 } while (++i);
9820 }
9821 // preminor will bump the version up to the next minor release, and immediately
9822 // down to pre-release. premajor and prepatch work the same way.
9823 inc(release, identifier, identifierBase) {
9824 switch (release) {
9825 case "premajor":
9826 this.prerelease.length = 0;
9827 this.patch = 0;
9828 this.minor = 0;
9829 this.major++;
9830 this.inc("pre", identifier, identifierBase);
9831 break;
9832 case "preminor":
9833 this.prerelease.length = 0;
9834 this.patch = 0;
9835 this.minor++;
9836 this.inc("pre", identifier, identifierBase);
9837 break;
9838 case "prepatch":
9839 this.prerelease.length = 0;
9840 this.inc("patch", identifier, identifierBase);
9841 this.inc("pre", identifier, identifierBase);
9842 break;
9843 case "prerelease":
9844 if (this.prerelease.length === 0) {
9845 this.inc("patch", identifier, identifierBase);
9846 }
9847 this.inc("pre", identifier, identifierBase);
9848 break;
9849 case "major":
9850 if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
9851 this.major++;
9852 }
9853 this.minor = 0;
9854 this.patch = 0;
9855 this.prerelease = [];
9856 break;
9857 case "minor":
9858 if (this.patch !== 0 || this.prerelease.length === 0) {
9859 this.minor++;
9860 }
9861 this.patch = 0;
9862 this.prerelease = [];
9863 break;
9864 case "patch":
9865 if (this.prerelease.length === 0) {
9866 this.patch++;
9867 }
9868 this.prerelease = [];
9869 break;
9870 case "pre": {
9871 const base = Number(identifierBase) ? 1 : 0;
9872 if (!identifier && identifierBase === false) {
9873 throw new Error("invalid increment argument: identifier is empty");
9874 }
9875 if (this.prerelease.length === 0) {
9876 this.prerelease = [base];
9877 } else {
9878 let i = this.prerelease.length;
9879 while (--i >= 0) {
9880 if (typeof this.prerelease[i] === "number") {
9881 this.prerelease[i]++;
9882 i = -2;
9883 }
9884 }
9885 if (i === -1) {
9886 if (identifier === this.prerelease.join(".") && identifierBase === false) {
9887 throw new Error("invalid increment argument: identifier already exists");
9888 }
9889 this.prerelease.push(base);
9890 }
9891 }
9892 if (identifier) {
9893 let prerelease = [identifier, base];
9894 if (identifierBase === false) {
9895 prerelease = [identifier];
9896 }
9897 if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
9898 if (isNaN(this.prerelease[1])) {
9899 this.prerelease = prerelease;
9900 }
9901 } else {
9902 this.prerelease = prerelease;
9903 }
9904 }
9905 break;
9906 }
9907 default:
9908 throw new Error(`invalid increment argument: ${release}`);
9909 }
9910 this.raw = this.format();
9911 if (this.build.length) {
9912 this.raw += `+${this.build.join(".")}`;
9913 }
9914 return this;
9915 }
9916 };
9917 module.exports = SemVer;
9918 }
9919});
9920
9921// node_modules/semver/functions/compare.js
9922var require_compare = __commonJS({
9923 "node_modules/semver/functions/compare.js"(exports, module) {
9924 var SemVer = require_semver();
9925 var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
9926 module.exports = compare;
9927 }
9928});
9929
9930// node_modules/semver/functions/gte.js
9931var require_gte = __commonJS({
9932 "node_modules/semver/functions/gte.js"(exports, module) {
9933 var compare = require_compare();
9934 var gte = (a, b, loose) => compare(a, b, loose) >= 0;
9935 module.exports = gte;
9936 }
9937});
9938
9939// node_modules/pseudomap/pseudomap.js
9940var require_pseudomap = __commonJS({
9941 "node_modules/pseudomap/pseudomap.js"(exports, module) {
9942 var hasOwnProperty2 = Object.prototype.hasOwnProperty;
9943 module.exports = PseudoMap;
9944 function PseudoMap(set2) {
9945 if (!(this instanceof PseudoMap))
9946 throw new TypeError("Constructor PseudoMap requires 'new'");
9947 this.clear();
9948 if (set2) {
9949 if (set2 instanceof PseudoMap || typeof Map === "function" && set2 instanceof Map)
9950 set2.forEach(function(value, key) {
9951 this.set(key, value);
9952 }, this);
9953 else if (Array.isArray(set2))
9954 set2.forEach(function(kv) {
9955 this.set(kv[0], kv[1]);
9956 }, this);
9957 else
9958 throw new TypeError("invalid argument");
9959 }
9960 }
9961 PseudoMap.prototype.forEach = function(fn, thisp) {
9962 thisp = thisp || this;
9963 Object.keys(this._data).forEach(function(k) {
9964 if (k !== "size")
9965 fn.call(thisp, this._data[k].value, this._data[k].key);
9966 }, this);
9967 };
9968 PseudoMap.prototype.has = function(k) {
9969 return !!find(this._data, k);
9970 };
9971 PseudoMap.prototype.get = function(k) {
9972 var res = find(this._data, k);
9973 return res && res.value;
9974 };
9975 PseudoMap.prototype.set = function(k, v) {
9976 set(this._data, k, v);
9977 };
9978 PseudoMap.prototype.delete = function(k) {
9979 var res = find(this._data, k);
9980 if (res) {
9981 delete this._data[res._index];
9982 this._data.size--;
9983 }
9984 };
9985 PseudoMap.prototype.clear = function() {
9986 var data = /* @__PURE__ */ Object.create(null);
9987 data.size = 0;
9988 Object.defineProperty(this, "_data", {
9989 value: data,
9990 enumerable: false,
9991 configurable: true,
9992 writable: false
9993 });
9994 };
9995 Object.defineProperty(PseudoMap.prototype, "size", {
9996 get: function() {
9997 return this._data.size;
9998 },
9999 set: function(n) {
10000 },
10001 enumerable: true,
10002 configurable: true
10003 });
10004 PseudoMap.prototype.values = PseudoMap.prototype.keys = PseudoMap.prototype.entries = function() {
10005 throw new Error("iterators are not implemented in this version");
10006 };
10007 function same(a, b) {
10008 return a === b || a !== a && b !== b;
10009 }
10010 function Entry(k, v, i) {
10011 this.key = k;
10012 this.value = v;
10013 this._index = i;
10014 }
10015 function find(data, k) {
10016 for (var i = 0, s = "_" + k, key = s; hasOwnProperty2.call(data, key); key = s + i++) {
10017 if (same(data[key].key, k))
10018 return data[key];
10019 }
10020 }
10021 function set(data, k, v) {
10022 for (var i = 0, s = "_" + k, key = s; hasOwnProperty2.call(data, key); key = s + i++) {
10023 if (same(data[key].key, k)) {
10024 data[key].value = v;
10025 return;
10026 }
10027 }
10028 data.size++;
10029 data[key] = new Entry(k, v, key);
10030 }
10031 }
10032});
10033
10034// node_modules/pseudomap/map.js
10035var require_map = __commonJS({
10036 "node_modules/pseudomap/map.js"(exports, module) {
10037 if (process.env.npm_package_name === "pseudomap" && process.env.npm_lifecycle_script === "test")
10038 process.env.TEST_PSEUDOMAP = "true";
10039 if (typeof Map === "function" && !process.env.TEST_PSEUDOMAP) {
10040 module.exports = Map;
10041 } else {
10042 module.exports = require_pseudomap();
10043 }
10044 }
10045});
10046
10047// node_modules/editorconfig/node_modules/yallist/yallist.js
10048var require_yallist = __commonJS({
10049 "node_modules/editorconfig/node_modules/yallist/yallist.js"(exports, module) {
10050 module.exports = Yallist;
10051 Yallist.Node = Node;
10052 Yallist.create = Yallist;
10053 function Yallist(list) {
10054 var self = this;
10055 if (!(self instanceof Yallist)) {
10056 self = new Yallist();
10057 }
10058 self.tail = null;
10059 self.head = null;
10060 self.length = 0;
10061 if (list && typeof list.forEach === "function") {
10062 list.forEach(function(item) {
10063 self.push(item);
10064 });
10065 } else if (arguments.length > 0) {
10066 for (var i = 0, l = arguments.length; i < l; i++) {
10067 self.push(arguments[i]);
10068 }
10069 }
10070 return self;
10071 }
10072 Yallist.prototype.removeNode = function(node) {
10073 if (node.list !== this) {
10074 throw new Error("removing node which does not belong to this list");
10075 }
10076 var next = node.next;
10077 var prev = node.prev;
10078 if (next) {
10079 next.prev = prev;
10080 }
10081 if (prev) {
10082 prev.next = next;
10083 }
10084 if (node === this.head) {
10085 this.head = next;
10086 }
10087 if (node === this.tail) {
10088 this.tail = prev;
10089 }
10090 node.list.length--;
10091 node.next = null;
10092 node.prev = null;
10093 node.list = null;
10094 };
10095 Yallist.prototype.unshiftNode = function(node) {
10096 if (node === this.head) {
10097 return;
10098 }
10099 if (node.list) {
10100 node.list.removeNode(node);
10101 }
10102 var head = this.head;
10103 node.list = this;
10104 node.next = head;
10105 if (head) {
10106 head.prev = node;
10107 }
10108 this.head = node;
10109 if (!this.tail) {
10110 this.tail = node;
10111 }
10112 this.length++;
10113 };
10114 Yallist.prototype.pushNode = function(node) {
10115 if (node === this.tail) {
10116 return;
10117 }
10118 if (node.list) {
10119 node.list.removeNode(node);
10120 }
10121 var tail = this.tail;
10122 node.list = this;
10123 node.prev = tail;
10124 if (tail) {
10125 tail.next = node;
10126 }
10127 this.tail = node;
10128 if (!this.head) {
10129 this.head = node;
10130 }
10131 this.length++;
10132 };
10133 Yallist.prototype.push = function() {
10134 for (var i = 0, l = arguments.length; i < l; i++) {
10135 push(this, arguments[i]);
10136 }
10137 return this.length;
10138 };
10139 Yallist.prototype.unshift = function() {
10140 for (var i = 0, l = arguments.length; i < l; i++) {
10141 unshift(this, arguments[i]);
10142 }
10143 return this.length;
10144 };
10145 Yallist.prototype.pop = function() {
10146 if (!this.tail) {
10147 return void 0;
10148 }
10149 var res = this.tail.value;
10150 this.tail = this.tail.prev;
10151 if (this.tail) {
10152 this.tail.next = null;
10153 } else {
10154 this.head = null;
10155 }
10156 this.length--;
10157 return res;
10158 };
10159 Yallist.prototype.shift = function() {
10160 if (!this.head) {
10161 return void 0;
10162 }
10163 var res = this.head.value;
10164 this.head = this.head.next;
10165 if (this.head) {
10166 this.head.prev = null;
10167 } else {
10168 this.tail = null;
10169 }
10170 this.length--;
10171 return res;
10172 };
10173 Yallist.prototype.forEach = function(fn, thisp) {
10174 thisp = thisp || this;
10175 for (var walker = this.head, i = 0; walker !== null; i++) {
10176 fn.call(thisp, walker.value, i, this);
10177 walker = walker.next;
10178 }
10179 };
10180 Yallist.prototype.forEachReverse = function(fn, thisp) {
10181 thisp = thisp || this;
10182 for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
10183 fn.call(thisp, walker.value, i, this);
10184 walker = walker.prev;
10185 }
10186 };
10187 Yallist.prototype.get = function(n) {
10188 for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
10189 walker = walker.next;
10190 }
10191 if (i === n && walker !== null) {
10192 return walker.value;
10193 }
10194 };
10195 Yallist.prototype.getReverse = function(n) {
10196 for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
10197 walker = walker.prev;
10198 }
10199 if (i === n && walker !== null) {
10200 return walker.value;
10201 }
10202 };
10203 Yallist.prototype.map = function(fn, thisp) {
10204 thisp = thisp || this;
10205 var res = new Yallist();
10206 for (var walker = this.head; walker !== null; ) {
10207 res.push(fn.call(thisp, walker.value, this));
10208 walker = walker.next;
10209 }
10210 return res;
10211 };
10212 Yallist.prototype.mapReverse = function(fn, thisp) {
10213 thisp = thisp || this;
10214 var res = new Yallist();
10215 for (var walker = this.tail; walker !== null; ) {
10216 res.push(fn.call(thisp, walker.value, this));
10217 walker = walker.prev;
10218 }
10219 return res;
10220 };
10221 Yallist.prototype.reduce = function(fn, initial) {
10222 var acc;
10223 var walker = this.head;
10224 if (arguments.length > 1) {
10225 acc = initial;
10226 } else if (this.head) {
10227 walker = this.head.next;
10228 acc = this.head.value;
10229 } else {
10230 throw new TypeError("Reduce of empty list with no initial value");
10231 }
10232 for (var i = 0; walker !== null; i++) {
10233 acc = fn(acc, walker.value, i);
10234 walker = walker.next;
10235 }
10236 return acc;
10237 };
10238 Yallist.prototype.reduceReverse = function(fn, initial) {
10239 var acc;
10240 var walker = this.tail;
10241 if (arguments.length > 1) {
10242 acc = initial;
10243 } else if (this.tail) {
10244 walker = this.tail.prev;
10245 acc = this.tail.value;
10246 } else {
10247 throw new TypeError("Reduce of empty list with no initial value");
10248 }
10249 for (var i = this.length - 1; walker !== null; i--) {
10250 acc = fn(acc, walker.value, i);
10251 walker = walker.prev;
10252 }
10253 return acc;
10254 };
10255 Yallist.prototype.toArray = function() {
10256 var arr = new Array(this.length);
10257 for (var i = 0, walker = this.head; walker !== null; i++) {
10258 arr[i] = walker.value;
10259 walker = walker.next;
10260 }
10261 return arr;
10262 };
10263 Yallist.prototype.toArrayReverse = function() {
10264 var arr = new Array(this.length);
10265 for (var i = 0, walker = this.tail; walker !== null; i++) {
10266 arr[i] = walker.value;
10267 walker = walker.prev;
10268 }
10269 return arr;
10270 };
10271 Yallist.prototype.slice = function(from, to) {
10272 to = to || this.length;
10273 if (to < 0) {
10274 to += this.length;
10275 }
10276 from = from || 0;
10277 if (from < 0) {
10278 from += this.length;
10279 }
10280 var ret = new Yallist();
10281 if (to < from || to < 0) {
10282 return ret;
10283 }
10284 if (from < 0) {
10285 from = 0;
10286 }
10287 if (to > this.length) {
10288 to = this.length;
10289 }
10290 for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
10291 walker = walker.next;
10292 }
10293 for (; walker !== null && i < to; i++, walker = walker.next) {
10294 ret.push(walker.value);
10295 }
10296 return ret;
10297 };
10298 Yallist.prototype.sliceReverse = function(from, to) {
10299 to = to || this.length;
10300 if (to < 0) {
10301 to += this.length;
10302 }
10303 from = from || 0;
10304 if (from < 0) {
10305 from += this.length;
10306 }
10307 var ret = new Yallist();
10308 if (to < from || to < 0) {
10309 return ret;
10310 }
10311 if (from < 0) {
10312 from = 0;
10313 }
10314 if (to > this.length) {
10315 to = this.length;
10316 }
10317 for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
10318 walker = walker.prev;
10319 }
10320 for (; walker !== null && i > from; i--, walker = walker.prev) {
10321 ret.push(walker.value);
10322 }
10323 return ret;
10324 };
10325 Yallist.prototype.reverse = function() {
10326 var head = this.head;
10327 var tail = this.tail;
10328 for (var walker = head; walker !== null; walker = walker.prev) {
10329 var p = walker.prev;
10330 walker.prev = walker.next;
10331 walker.next = p;
10332 }
10333 this.head = tail;
10334 this.tail = head;
10335 return this;
10336 };
10337 function push(self, item) {
10338 self.tail = new Node(item, self.tail, null, self);
10339 if (!self.head) {
10340 self.head = self.tail;
10341 }
10342 self.length++;
10343 }
10344 function unshift(self, item) {
10345 self.head = new Node(item, null, self.head, self);
10346 if (!self.tail) {
10347 self.tail = self.head;
10348 }
10349 self.length++;
10350 }
10351 function Node(value, prev, next, list) {
10352 if (!(this instanceof Node)) {
10353 return new Node(value, prev, next, list);
10354 }
10355 this.list = list;
10356 this.value = value;
10357 if (prev) {
10358 prev.next = this;
10359 this.prev = prev;
10360 } else {
10361 this.prev = null;
10362 }
10363 if (next) {
10364 next.prev = this;
10365 this.next = next;
10366 } else {
10367 this.next = null;
10368 }
10369 }
10370 }
10371});
10372
10373// node_modules/editorconfig/node_modules/lru-cache/index.js
10374var require_lru_cache = __commonJS({
10375 "node_modules/editorconfig/node_modules/lru-cache/index.js"(exports, module) {
10376 "use strict";
10377 module.exports = LRUCache;
10378 var Map2 = require_map();
10379 var util = __require("util");
10380 var Yallist = require_yallist();
10381 var hasSymbol = typeof Symbol === "function" && process.env._nodeLRUCacheForceNoSymbol !== "1";
10382 var makeSymbol;
10383 if (hasSymbol) {
10384 makeSymbol = function(key) {
10385 return Symbol(key);
10386 };
10387 } else {
10388 makeSymbol = function(key) {
10389 return "_" + key;
10390 };
10391 }
10392 var MAX = makeSymbol("max");
10393 var LENGTH = makeSymbol("length");
10394 var LENGTH_CALCULATOR = makeSymbol("lengthCalculator");
10395 var ALLOW_STALE = makeSymbol("allowStale");
10396 var MAX_AGE = makeSymbol("maxAge");
10397 var DISPOSE = makeSymbol("dispose");
10398 var NO_DISPOSE_ON_SET = makeSymbol("noDisposeOnSet");
10399 var LRU_LIST = makeSymbol("lruList");
10400 var CACHE = makeSymbol("cache");
10401 function naiveLength() {
10402 return 1;
10403 }
10404 function LRUCache(options8) {
10405 if (!(this instanceof LRUCache)) {
10406 return new LRUCache(options8);
10407 }
10408 if (typeof options8 === "number") {
10409 options8 = { max: options8 };
10410 }
10411 if (!options8) {
10412 options8 = {};
10413 }
10414 var max = this[MAX] = options8.max;
10415 if (!max || !(typeof max === "number") || max <= 0) {
10416 this[MAX] = Infinity;
10417 }
10418 var lc = options8.length || naiveLength;
10419 if (typeof lc !== "function") {
10420 lc = naiveLength;
10421 }
10422 this[LENGTH_CALCULATOR] = lc;
10423 this[ALLOW_STALE] = options8.stale || false;
10424 this[MAX_AGE] = options8.maxAge || 0;
10425 this[DISPOSE] = options8.dispose;
10426 this[NO_DISPOSE_ON_SET] = options8.noDisposeOnSet || false;
10427 this.reset();
10428 }
10429 Object.defineProperty(LRUCache.prototype, "max", {
10430 set: function(mL) {
10431 if (!mL || !(typeof mL === "number") || mL <= 0) {
10432 mL = Infinity;
10433 }
10434 this[MAX] = mL;
10435 trim2(this);
10436 },
10437 get: function() {
10438 return this[MAX];
10439 },
10440 enumerable: true
10441 });
10442 Object.defineProperty(LRUCache.prototype, "allowStale", {
10443 set: function(allowStale) {
10444 this[ALLOW_STALE] = !!allowStale;
10445 },
10446 get: function() {
10447 return this[ALLOW_STALE];
10448 },
10449 enumerable: true
10450 });
10451 Object.defineProperty(LRUCache.prototype, "maxAge", {
10452 set: function(mA) {
10453 if (!mA || !(typeof mA === "number") || mA < 0) {
10454 mA = 0;
10455 }
10456 this[MAX_AGE] = mA;
10457 trim2(this);
10458 },
10459 get: function() {
10460 return this[MAX_AGE];
10461 },
10462 enumerable: true
10463 });
10464 Object.defineProperty(LRUCache.prototype, "lengthCalculator", {
10465 set: function(lC) {
10466 if (typeof lC !== "function") {
10467 lC = naiveLength;
10468 }
10469 if (lC !== this[LENGTH_CALCULATOR]) {
10470 this[LENGTH_CALCULATOR] = lC;
10471 this[LENGTH] = 0;
10472 this[LRU_LIST].forEach(function(hit) {
10473 hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
10474 this[LENGTH] += hit.length;
10475 }, this);
10476 }
10477 trim2(this);
10478 },
10479 get: function() {
10480 return this[LENGTH_CALCULATOR];
10481 },
10482 enumerable: true
10483 });
10484 Object.defineProperty(LRUCache.prototype, "length", {
10485 get: function() {
10486 return this[LENGTH];
10487 },
10488 enumerable: true
10489 });
10490 Object.defineProperty(LRUCache.prototype, "itemCount", {
10491 get: function() {
10492 return this[LRU_LIST].length;
10493 },
10494 enumerable: true
10495 });
10496 LRUCache.prototype.rforEach = function(fn, thisp) {
10497 thisp = thisp || this;
10498 for (var walker = this[LRU_LIST].tail; walker !== null; ) {
10499 var prev = walker.prev;
10500 forEachStep(this, fn, walker, thisp);
10501 walker = prev;
10502 }
10503 };
10504 function forEachStep(self, fn, node, thisp) {
10505 var hit = node.value;
10506 if (isStale(self, hit)) {
10507 del(self, node);
10508 if (!self[ALLOW_STALE]) {
10509 hit = void 0;
10510 }
10511 }
10512 if (hit) {
10513 fn.call(thisp, hit.value, hit.key, self);
10514 }
10515 }
10516 LRUCache.prototype.forEach = function(fn, thisp) {
10517 thisp = thisp || this;
10518 for (var walker = this[LRU_LIST].head; walker !== null; ) {
10519 var next = walker.next;
10520 forEachStep(this, fn, walker, thisp);
10521 walker = next;
10522 }
10523 };
10524 LRUCache.prototype.keys = function() {
10525 return this[LRU_LIST].toArray().map(function(k) {
10526 return k.key;
10527 }, this);
10528 };
10529 LRUCache.prototype.values = function() {
10530 return this[LRU_LIST].toArray().map(function(k) {
10531 return k.value;
10532 }, this);
10533 };
10534 LRUCache.prototype.reset = function() {
10535 if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
10536 this[LRU_LIST].forEach(function(hit) {
10537 this[DISPOSE](hit.key, hit.value);
10538 }, this);
10539 }
10540 this[CACHE] = new Map2();
10541 this[LRU_LIST] = new Yallist();
10542 this[LENGTH] = 0;
10543 };
10544 LRUCache.prototype.dump = function() {
10545 return this[LRU_LIST].map(function(hit) {
10546 if (!isStale(this, hit)) {
10547 return {
10548 k: hit.key,
10549 v: hit.value,
10550 e: hit.now + (hit.maxAge || 0)
10551 };
10552 }
10553 }, this).toArray().filter(function(h) {
10554 return h;
10555 });
10556 };
10557 LRUCache.prototype.dumpLru = function() {
10558 return this[LRU_LIST];
10559 };
10560 LRUCache.prototype.inspect = function(n, opts) {
10561 var str = "LRUCache {";
10562 var extras = false;
10563 var as = this[ALLOW_STALE];
10564 if (as) {
10565 str += "\n allowStale: true";
10566 extras = true;
10567 }
10568 var max = this[MAX];
10569 if (max && max !== Infinity) {
10570 if (extras) {
10571 str += ",";
10572 }
10573 str += "\n max: " + util.inspect(max, opts);
10574 extras = true;
10575 }
10576 var maxAge = this[MAX_AGE];
10577 if (maxAge) {
10578 if (extras) {
10579 str += ",";
10580 }
10581 str += "\n maxAge: " + util.inspect(maxAge, opts);
10582 extras = true;
10583 }
10584 var lc = this[LENGTH_CALCULATOR];
10585 if (lc && lc !== naiveLength) {
10586 if (extras) {
10587 str += ",";
10588 }
10589 str += "\n length: " + util.inspect(this[LENGTH], opts);
10590 extras = true;
10591 }
10592 var didFirst = false;
10593 this[LRU_LIST].forEach(function(item) {
10594 if (didFirst) {
10595 str += ",\n ";
10596 } else {
10597 if (extras) {
10598 str += ",\n";
10599 }
10600 didFirst = true;
10601 str += "\n ";
10602 }
10603 var key = util.inspect(item.key).split("\n").join("\n ");
10604 var val = { value: item.value };
10605 if (item.maxAge !== maxAge) {
10606 val.maxAge = item.maxAge;
10607 }
10608 if (lc !== naiveLength) {
10609 val.length = item.length;
10610 }
10611 if (isStale(this, item)) {
10612 val.stale = true;
10613 }
10614 val = util.inspect(val, opts).split("\n").join("\n ");
10615 str += key + " => " + val;
10616 });
10617 if (didFirst || extras) {
10618 str += "\n";
10619 }
10620 str += "}";
10621 return str;
10622 };
10623 LRUCache.prototype.set = function(key, value, maxAge) {
10624 maxAge = maxAge || this[MAX_AGE];
10625 var now = maxAge ? Date.now() : 0;
10626 var len = this[LENGTH_CALCULATOR](value, key);
10627 if (this[CACHE].has(key)) {
10628 if (len > this[MAX]) {
10629 del(this, this[CACHE].get(key));
10630 return false;
10631 }
10632 var node = this[CACHE].get(key);
10633 var item = node.value;
10634 if (this[DISPOSE]) {
10635 if (!this[NO_DISPOSE_ON_SET]) {
10636 this[DISPOSE](key, item.value);
10637 }
10638 }
10639 item.now = now;
10640 item.maxAge = maxAge;
10641 item.value = value;
10642 this[LENGTH] += len - item.length;
10643 item.length = len;
10644 this.get(key);
10645 trim2(this);
10646 return true;
10647 }
10648 var hit = new Entry(key, value, len, now, maxAge);
10649 if (hit.length > this[MAX]) {
10650 if (this[DISPOSE]) {
10651 this[DISPOSE](key, value);
10652 }
10653 return false;
10654 }
10655 this[LENGTH] += hit.length;
10656 this[LRU_LIST].unshift(hit);
10657 this[CACHE].set(key, this[LRU_LIST].head);
10658 trim2(this);
10659 return true;
10660 };
10661 LRUCache.prototype.has = function(key) {
10662 if (!this[CACHE].has(key))
10663 return false;
10664 var hit = this[CACHE].get(key).value;
10665 if (isStale(this, hit)) {
10666 return false;
10667 }
10668 return true;
10669 };
10670 LRUCache.prototype.get = function(key) {
10671 return get(this, key, true);
10672 };
10673 LRUCache.prototype.peek = function(key) {
10674 return get(this, key, false);
10675 };
10676 LRUCache.prototype.pop = function() {
10677 var node = this[LRU_LIST].tail;
10678 if (!node)
10679 return null;
10680 del(this, node);
10681 return node.value;
10682 };
10683 LRUCache.prototype.del = function(key) {
10684 del(this, this[CACHE].get(key));
10685 };
10686 LRUCache.prototype.load = function(arr) {
10687 this.reset();
10688 var now = Date.now();
10689 for (var l = arr.length - 1; l >= 0; l--) {
10690 var hit = arr[l];
10691 var expiresAt = hit.e || 0;
10692 if (expiresAt === 0) {
10693 this.set(hit.k, hit.v);
10694 } else {
10695 var maxAge = expiresAt - now;
10696 if (maxAge > 0) {
10697 this.set(hit.k, hit.v, maxAge);
10698 }
10699 }
10700 }
10701 };
10702 LRUCache.prototype.prune = function() {
10703 var self = this;
10704 this[CACHE].forEach(function(value, key) {
10705 get(self, key, false);
10706 });
10707 };
10708 function get(self, key, doUse) {
10709 var node = self[CACHE].get(key);
10710 if (node) {
10711 var hit = node.value;
10712 if (isStale(self, hit)) {
10713 del(self, node);
10714 if (!self[ALLOW_STALE])
10715 hit = void 0;
10716 } else {
10717 if (doUse) {
10718 self[LRU_LIST].unshiftNode(node);
10719 }
10720 }
10721 if (hit)
10722 hit = hit.value;
10723 }
10724 return hit;
10725 }
10726 function isStale(self, hit) {
10727 if (!hit || !hit.maxAge && !self[MAX_AGE]) {
10728 return false;
10729 }
10730 var stale = false;
10731 var diff = Date.now() - hit.now;
10732 if (hit.maxAge) {
10733 stale = diff > hit.maxAge;
10734 } else {
10735 stale = self[MAX_AGE] && diff > self[MAX_AGE];
10736 }
10737 return stale;
10738 }
10739 function trim2(self) {
10740 if (self[LENGTH] > self[MAX]) {
10741 for (var walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null; ) {
10742 var prev = walker.prev;
10743 del(self, walker);
10744 walker = prev;
10745 }
10746 }
10747 }
10748 function del(self, node) {
10749 if (node) {
10750 var hit = node.value;
10751 if (self[DISPOSE]) {
10752 self[DISPOSE](hit.key, hit.value);
10753 }
10754 self[LENGTH] -= hit.length;
10755 self[CACHE].delete(hit.key);
10756 self[LRU_LIST].removeNode(node);
10757 }
10758 }
10759 function Entry(key, value, length, now, maxAge) {
10760 this.key = key;
10761 this.value = value;
10762 this.length = length;
10763 this.now = now;
10764 this.maxAge = maxAge || 0;
10765 }
10766 }
10767});
10768
10769// node_modules/sigmund/sigmund.js
10770var require_sigmund = __commonJS({
10771 "node_modules/sigmund/sigmund.js"(exports, module) {
10772 module.exports = sigmund;
10773 function sigmund(subject, maxSessions) {
10774 maxSessions = maxSessions || 10;
10775 var notes = [];
10776 var analysis = "";
10777 var RE = RegExp;
10778 function psychoAnalyze(subject2, session) {
10779 if (session > maxSessions)
10780 return;
10781 if (typeof subject2 === "function" || typeof subject2 === "undefined") {
10782 return;
10783 }
10784 if (typeof subject2 !== "object" || !subject2 || subject2 instanceof RE) {
10785 analysis += subject2;
10786 return;
10787 }
10788 if (notes.indexOf(subject2) !== -1 || session === maxSessions)
10789 return;
10790 notes.push(subject2);
10791 analysis += "{";
10792 Object.keys(subject2).forEach(function(issue, _, __) {
10793 if (issue.charAt(0) === "_")
10794 return;
10795 var to = typeof subject2[issue];
10796 if (to === "function" || to === "undefined")
10797 return;
10798 analysis += issue;
10799 psychoAnalyze(subject2[issue], session + 1);
10800 });
10801 }
10802 psychoAnalyze(subject, 0);
10803 return analysis;
10804 }
10805 }
10806});
10807
10808// node_modules/editorconfig/src/lib/fnmatch.js
10809var require_fnmatch = __commonJS({
10810 "node_modules/editorconfig/src/lib/fnmatch.js"(exports, module) {
10811 var platform = typeof process === "object" ? process.platform : "win32";
10812 if (module)
10813 module.exports = minimatch;
10814 else
10815 exports.minimatch = minimatch;
10816 minimatch.Minimatch = Minimatch;
10817 var LRU = require_lru_cache();
10818 var cache = minimatch.cache = new LRU({ max: 100 });
10819 var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {};
10820 var sigmund = require_sigmund();
10821 var path9 = __require("path");
10822 var qmark = "[^/]";
10823 var star = qmark + "*?";
10824 var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
10825 var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
10826 var reSpecials = charSet("().*{}+?[]^$\\!");
10827 function charSet(s) {
10828 return s.split("").reduce(function(set, c) {
10829 set[c] = true;
10830 return set;
10831 }, {});
10832 }
10833 var slashSplit = /\/+/;
10834 minimatch.monkeyPatch = monkeyPatch;
10835 function monkeyPatch() {
10836 var desc = Object.getOwnPropertyDescriptor(String.prototype, "match");
10837 var orig = desc.value;
10838 desc.value = function(p) {
10839 if (p instanceof Minimatch)
10840 return p.match(this);
10841 return orig.call(this, p);
10842 };
10843 Object.defineProperty(String.prototype, desc);
10844 }
10845 minimatch.filter = filter;
10846 function filter(pattern, options8) {
10847 options8 = options8 || {};
10848 return function(p, i, list) {
10849 return minimatch(p, pattern, options8);
10850 };
10851 }
10852 function ext(a, b) {
10853 a = a || {};
10854 b = b || {};
10855 var t = {};
10856 Object.keys(b).forEach(function(k) {
10857 t[k] = b[k];
10858 });
10859 Object.keys(a).forEach(function(k) {
10860 t[k] = a[k];
10861 });
10862 return t;
10863 }
10864 minimatch.defaults = function(def) {
10865 if (!def || !Object.keys(def).length)
10866 return minimatch;
10867 var orig = minimatch;
10868 var m = function minimatch2(p, pattern, options8) {
10869 return orig.minimatch(p, pattern, ext(def, options8));
10870 };
10871 m.Minimatch = function Minimatch2(pattern, options8) {
10872 return new orig.Minimatch(pattern, ext(def, options8));
10873 };
10874 return m;
10875 };
10876 Minimatch.defaults = function(def) {
10877 if (!def || !Object.keys(def).length)
10878 return Minimatch;
10879 return minimatch.defaults(def).Minimatch;
10880 };
10881 function minimatch(p, pattern, options8) {
10882 if (typeof pattern !== "string") {
10883 throw new TypeError("glob pattern string required");
10884 }
10885 if (!options8)
10886 options8 = {};
10887 if (!options8.nocomment && pattern.charAt(0) === "#") {
10888 return false;
10889 }
10890 if (pattern.trim() === "")
10891 return p === "";
10892 return new Minimatch(pattern, options8).match(p);
10893 }
10894 function Minimatch(pattern, options8) {
10895 if (!(this instanceof Minimatch)) {
10896 return new Minimatch(pattern, options8, cache);
10897 }
10898 if (typeof pattern !== "string") {
10899 throw new TypeError("glob pattern string required");
10900 }
10901 if (!options8)
10902 options8 = {};
10903 if (platform === "win32") {
10904 pattern = pattern.split("\\").join("/");
10905 }
10906 var cacheKey = pattern + "\n" + sigmund(options8);
10907 var cached = minimatch.cache.get(cacheKey);
10908 if (cached)
10909 return cached;
10910 minimatch.cache.set(cacheKey, this);
10911 this.options = options8;
10912 this.set = [];
10913 this.pattern = pattern;
10914 this.regexp = null;
10915 this.negate = false;
10916 this.comment = false;
10917 this.empty = false;
10918 this.make();
10919 }
10920 Minimatch.prototype.make = make;
10921 function make() {
10922 if (this._made)
10923 return;
10924 var pattern = this.pattern;
10925 var options8 = this.options;
10926 if (!options8.nocomment && pattern.charAt(0) === "#") {
10927 this.comment = true;
10928 return;
10929 }
10930 if (!pattern) {
10931 this.empty = true;
10932 return;
10933 }
10934 this.parseNegate();
10935 var set = this.globSet = this.braceExpand();
10936 if (options8.debug)
10937 console.error(this.pattern, set);
10938 set = this.globParts = set.map(function(s) {
10939 return s.split(slashSplit);
10940 });
10941 if (options8.debug)
10942 console.error(this.pattern, set);
10943 set = set.map(function(s, si, set2) {
10944 return s.map(this.parse, this);
10945 }, this);
10946 if (options8.debug)
10947 console.error(this.pattern, set);
10948 set = set.filter(function(s) {
10949 return -1 === s.indexOf(false);
10950 });
10951 if (options8.debug)
10952 console.error(this.pattern, set);
10953 this.set = set;
10954 }
10955 Minimatch.prototype.parseNegate = parseNegate;
10956 function parseNegate() {
10957 var pattern = this.pattern, negate = false, options8 = this.options, negateOffset = 0;
10958 if (options8.nonegate)
10959 return;
10960 for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) {
10961 negate = !negate;
10962 negateOffset++;
10963 }
10964 if (negateOffset)
10965 this.pattern = pattern.substr(negateOffset);
10966 this.negate = negate;
10967 }
10968 minimatch.braceExpand = function(pattern, options8) {
10969 return new Minimatch(pattern, options8).braceExpand();
10970 };
10971 Minimatch.prototype.braceExpand = braceExpand;
10972 function braceExpand(pattern, options8) {
10973 options8 = options8 || this.options;
10974 pattern = typeof pattern === "undefined" ? this.pattern : pattern;
10975 if (typeof pattern === "undefined") {
10976 throw new Error("undefined pattern");
10977 }
10978 if (options8.nobrace || !pattern.match(/\{.*\}/)) {
10979 return [pattern];
10980 }
10981 var escaping = false;
10982 if (pattern.charAt(0) !== "{") {
10983 var prefix = null;
10984 for (var i = 0, l = pattern.length; i < l; i++) {
10985 var c = pattern.charAt(i);
10986 if (c === "\\") {
10987 escaping = !escaping;
10988 } else if (c === "{" && !escaping) {
10989 prefix = pattern.substr(0, i);
10990 break;
10991 }
10992 }
10993 if (prefix === null) {
10994 return [pattern];
10995 }
10996 var tail = braceExpand(pattern.substr(i), options8);
10997 return tail.map(function(t) {
10998 return prefix + t;
10999 });
11000 }
11001 var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/);
11002 if (numset) {
11003 var suf = braceExpand(pattern.substr(numset[0].length), options8), start = +numset[1], end = +numset[2], inc = start > end ? -1 : 1, set = [];
11004 for (var i = start; i != end + inc; i += inc) {
11005 for (var ii = 0, ll = suf.length; ii < ll; ii++) {
11006 set.push(i + suf[ii]);
11007 }
11008 }
11009 return set;
11010 }
11011 var i = 1, depth = 1, set = [], member = "", sawEnd = false, escaping = false;
11012 function addMember() {
11013 set.push(member);
11014 member = "";
11015 }
11016 FOR:
11017 for (i = 1, l = pattern.length; i < l; i++) {
11018 var c = pattern.charAt(i);
11019 if (escaping) {
11020 escaping = false;
11021 member += "\\" + c;
11022 } else {
11023 switch (c) {
11024 case "\\":
11025 escaping = true;
11026 continue;
11027 case "{":
11028 depth++;
11029 member += "{";
11030 continue;
11031 case "}":
11032 depth--;
11033 if (depth === 0) {
11034 addMember();
11035 i++;
11036 break FOR;
11037 } else {
11038 member += c;
11039 continue;
11040 }
11041 case ",":
11042 if (depth === 1) {
11043 addMember();
11044 } else {
11045 member += c;
11046 }
11047 continue;
11048 default:
11049 member += c;
11050 continue;
11051 }
11052 }
11053 }
11054 if (depth !== 0) {
11055 return braceExpand("\\" + pattern, options8);
11056 }
11057 var suf = braceExpand(pattern.substr(i), options8);
11058 var addBraces = set.length === 1;
11059 set = set.map(function(p) {
11060 return braceExpand(p, options8);
11061 });
11062 set = set.reduce(function(l2, r) {
11063 return l2.concat(r);
11064 });
11065 if (addBraces) {
11066 set = set.map(function(s) {
11067 return "{" + s + "}";
11068 });
11069 }
11070 var ret = [];
11071 for (var i = 0, l = set.length; i < l; i++) {
11072 for (var ii = 0, ll = suf.length; ii < ll; ii++) {
11073 ret.push(set[i] + suf[ii]);
11074 }
11075 }
11076 return ret;
11077 }
11078 Minimatch.prototype.parse = parse3;
11079 var SUBPARSE = {};
11080 function parse3(pattern, isSub) {
11081 var options8 = this.options;
11082 if (!options8.noglobstar && pattern === "**")
11083 return GLOBSTAR;
11084 if (pattern === "")
11085 return "";
11086 var re = "", hasMagic = !!options8.nocase, escaping = false, patternListStack = [], plType, stateChar, inClass = false, reClassStart = -1, classStart = -1, patternStart = pattern.charAt(0) === "." ? "" : options8.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
11087 function clearStateChar() {
11088 if (stateChar) {
11089 switch (stateChar) {
11090 case "*":
11091 re += star;
11092 hasMagic = true;
11093 break;
11094 case "?":
11095 re += qmark;
11096 hasMagic = true;
11097 break;
11098 default:
11099 re += "\\" + stateChar;
11100 break;
11101 }
11102 stateChar = false;
11103 }
11104 }
11105 for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) {
11106 if (options8.debug) {
11107 console.error("%s %s %s %j", pattern, i, re, c);
11108 }
11109 if (escaping && reSpecials[c]) {
11110 re += "\\" + c;
11111 escaping = false;
11112 continue;
11113 }
11114 SWITCH:
11115 switch (c) {
11116 case "/":
11117 return false;
11118 case "\\":
11119 clearStateChar();
11120 escaping = true;
11121 continue;
11122 case "?":
11123 case "*":
11124 case "+":
11125 case "@":
11126 case "!":
11127 if (options8.debug) {
11128 console.error("%s %s %s %j <-- stateChar", pattern, i, re, c);
11129 }
11130 if (inClass) {
11131 if (c === "!" && i === classStart + 1)
11132 c = "^";
11133 re += c;
11134 continue;
11135 }
11136 clearStateChar();
11137 stateChar = c;
11138 if (options8.noext)
11139 clearStateChar();
11140 continue;
11141 case "(":
11142 if (inClass) {
11143 re += "(";
11144 continue;
11145 }
11146 if (!stateChar) {
11147 re += "\\(";
11148 continue;
11149 }
11150 plType = stateChar;
11151 patternListStack.push({
11152 type: plType,
11153 start: i - 1,
11154 reStart: re.length
11155 });
11156 re += stateChar === "!" ? "(?:(?!" : "(?:";
11157 stateChar = false;
11158 continue;
11159 case ")":
11160 if (inClass || !patternListStack.length) {
11161 re += "\\)";
11162 continue;
11163 }
11164 hasMagic = true;
11165 re += ")";
11166 plType = patternListStack.pop().type;
11167 switch (plType) {
11168 case "!":
11169 re += "[^/]*?)";
11170 break;
11171 case "?":
11172 case "+":
11173 case "*":
11174 re += plType;
11175 case "@":
11176 break;
11177 }
11178 continue;
11179 case "|":
11180 if (inClass || !patternListStack.length || escaping) {
11181 re += "\\|";
11182 escaping = false;
11183 continue;
11184 }
11185 re += "|";
11186 continue;
11187 case "[":
11188 clearStateChar();
11189 if (inClass) {
11190 re += "\\" + c;
11191 continue;
11192 }
11193 inClass = true;
11194 classStart = i;
11195 reClassStart = re.length;
11196 re += c;
11197 continue;
11198 case "]":
11199 if (i === classStart + 1 || !inClass) {
11200 re += "\\" + c;
11201 escaping = false;
11202 continue;
11203 }
11204 hasMagic = true;
11205 inClass = false;
11206 re += c;
11207 continue;
11208 default:
11209 clearStateChar();
11210 if (escaping) {
11211 escaping = false;
11212 } else if (reSpecials[c] && !(c === "^" && inClass)) {
11213 re += "\\";
11214 }
11215 re += c;
11216 }
11217 }
11218 if (inClass) {
11219 var cs = pattern.substr(classStart + 1), sp = this.parse(cs, SUBPARSE);
11220 re = re.substr(0, reClassStart) + "\\[" + sp[0];
11221 hasMagic = hasMagic || sp[1];
11222 }
11223 var pl;
11224 while (pl = patternListStack.pop()) {
11225 var tail = re.slice(pl.reStart + 3);
11226 tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function(_, $1, $2) {
11227 if (!$2) {
11228 $2 = "\\";
11229 }
11230 return $1 + $1 + $2 + "|";
11231 });
11232 var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type;
11233 hasMagic = true;
11234 re = re.slice(0, pl.reStart) + t + "\\(" + tail;
11235 }
11236 clearStateChar();
11237 if (escaping) {
11238 re += "\\\\";
11239 }
11240 var addPatternStart = false;
11241 switch (re.charAt(0)) {
11242 case ".":
11243 case "[":
11244 case "(":
11245 addPatternStart = true;
11246 }
11247 if (re !== "" && hasMagic)
11248 re = "(?=.)" + re;
11249 if (addPatternStart)
11250 re = patternStart + re;
11251 if (isSub === SUBPARSE) {
11252 return [re, hasMagic];
11253 }
11254 if (!hasMagic) {
11255 return globUnescape(pattern);
11256 }
11257 var flags = options8.nocase ? "i" : "", regExp = new RegExp("^" + re + "$", flags);
11258 regExp._glob = pattern;
11259 regExp._src = re;
11260 return regExp;
11261 }
11262 minimatch.makeRe = function(pattern, options8) {
11263 return new Minimatch(pattern, options8 || {}).makeRe();
11264 };
11265 Minimatch.prototype.makeRe = makeRe;
11266 function makeRe() {
11267 if (this.regexp || this.regexp === false)
11268 return this.regexp;
11269 var set = this.set;
11270 if (!set.length)
11271 return this.regexp = false;
11272 var options8 = this.options;
11273 var twoStar = options8.noglobstar ? star : options8.dot ? twoStarDot : twoStarNoDot, flags = options8.nocase ? "i" : "";
11274 var re = set.map(function(pattern) {
11275 return pattern.map(function(p) {
11276 return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src;
11277 }).join("\\/");
11278 }).join("|");
11279 re = "^(?:" + re + ")$";
11280 if (this.negate)
11281 re = "^(?!" + re + ").*$";
11282 try {
11283 return this.regexp = new RegExp(re, flags);
11284 } catch (ex) {
11285 return this.regexp = false;
11286 }
11287 }
11288 minimatch.match = function(list, pattern, options8) {
11289 var mm = new Minimatch(pattern, options8);
11290 list = list.filter(function(f) {
11291 return mm.match(f);
11292 });
11293 if (options8.nonull && !list.length) {
11294 list.push(pattern);
11295 }
11296 return list;
11297 };
11298 Minimatch.prototype.match = match;
11299 function match(f, partial) {
11300 if (this.comment)
11301 return false;
11302 if (this.empty)
11303 return f === "";
11304 if (f === "/" && partial)
11305 return true;
11306 var options8 = this.options;
11307 if (platform === "win32") {
11308 f = f.split("\\").join("/");
11309 }
11310 f = f.split(slashSplit);
11311 if (options8.debug) {
11312 console.error(this.pattern, "split", f);
11313 }
11314 var set = this.set;
11315 for (var i = 0, l = set.length; i < l; i++) {
11316 var pattern = set[i];
11317 var hit = this.matchOne(f, pattern, partial);
11318 if (hit) {
11319 if (options8.flipNegate)
11320 return true;
11321 return !this.negate;
11322 }
11323 }
11324 if (options8.flipNegate)
11325 return false;
11326 return this.negate;
11327 }
11328 Minimatch.prototype.matchOne = function(file, pattern, partial) {
11329 var options8 = this.options;
11330 if (options8.debug) {
11331 console.error(
11332 "matchOne",
11333 {
11334 "this": this,
11335 file,
11336 pattern
11337 }
11338 );
11339 }
11340 if (options8.matchBase && pattern.length === 1) {
11341 file = path9.basename(file.join("/")).split("/");
11342 }
11343 if (options8.debug) {
11344 console.error("matchOne", file.length, pattern.length);
11345 }
11346 for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
11347 if (options8.debug) {
11348 console.error("matchOne loop");
11349 }
11350 var p = pattern[pi], f = file[fi];
11351 if (options8.debug) {
11352 console.error(pattern, p, f);
11353 }
11354 if (p === false)
11355 return false;
11356 if (p === GLOBSTAR) {
11357 if (options8.debug)
11358 console.error("GLOBSTAR", [pattern, p, f]);
11359 var fr = fi, pr = pi + 1;
11360 if (pr === pl) {
11361 if (options8.debug)
11362 console.error("** at the end");
11363 for (; fi < fl; fi++) {
11364 if (file[fi] === "." || file[fi] === ".." || !options8.dot && file[fi].charAt(0) === ".")
11365 return false;
11366 }
11367 return true;
11368 }
11369 WHILE:
11370 while (fr < fl) {
11371 var swallowee = file[fr];
11372 if (options8.debug) {
11373 console.error(
11374 "\nglobstar while",
11375 file,
11376 fr,
11377 pattern,
11378 pr,
11379 swallowee
11380 );
11381 }
11382 if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
11383 if (options8.debug)
11384 console.error("globstar found match!", fr, fl, swallowee);
11385 return true;
11386 } else {
11387 if (swallowee === "." || swallowee === ".." || !options8.dot && swallowee.charAt(0) === ".") {
11388 if (options8.debug)
11389 console.error("dot detected!", file, fr, pattern, pr);
11390 break WHILE;
11391 }
11392 if (options8.debug)
11393 console.error("globstar swallow a segment, and continue");
11394 fr++;
11395 }
11396 }
11397 if (partial) {
11398 if (fr === fl)
11399 return true;
11400 }
11401 return false;
11402 }
11403 var hit;
11404 if (typeof p === "string") {
11405 if (options8.nocase) {
11406 hit = f.toLowerCase() === p.toLowerCase();
11407 } else {
11408 hit = f === p;
11409 }
11410 if (options8.debug) {
11411 console.error("string match", p, f, hit);
11412 }
11413 } else {
11414 hit = f.match(p);
11415 if (options8.debug) {
11416 console.error("pattern match", p, f, hit);
11417 }
11418 }
11419 if (!hit)
11420 return false;
11421 }
11422 if (fi === fl && pi === pl) {
11423 return true;
11424 } else if (fi === fl) {
11425 return partial;
11426 } else if (pi === pl) {
11427 var emptyFileEnd = fi === fl - 1 && file[fi] === "";
11428 return emptyFileEnd;
11429 }
11430 throw new Error("wtf?");
11431 };
11432 function globUnescape(s) {
11433 return s.replace(/\\(.)/g, "$1");
11434 }
11435 function regExpEscape(s) {
11436 return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
11437 }
11438 }
11439});
11440
11441// node_modules/editorconfig/src/lib/ini.js
11442var require_ini = __commonJS({
11443 "node_modules/editorconfig/src/lib/ini.js"(exports) {
11444 "use strict";
11445 var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
11446 return new (P || (P = Promise))(function(resolve2, reject) {
11447 function fulfilled(value) {
11448 try {
11449 step(generator.next(value));
11450 } catch (e) {
11451 reject(e);
11452 }
11453 }
11454 function rejected(value) {
11455 try {
11456 step(generator["throw"](value));
11457 } catch (e) {
11458 reject(e);
11459 }
11460 }
11461 function step(result) {
11462 result.done ? resolve2(result.value) : new P(function(resolve3) {
11463 resolve3(result.value);
11464 }).then(fulfilled, rejected);
11465 }
11466 step((generator = generator.apply(thisArg, _arguments || [])).next());
11467 });
11468 };
11469 var __generator2 = exports && exports.__generator || function(thisArg, body) {
11470 var _ = { label: 0, sent: function() {
11471 if (t[0] & 1)
11472 throw t[1];
11473 return t[1];
11474 }, trys: [], ops: [] }, f, y, t, g;
11475 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
11476 return this;
11477 }), g;
11478 function verb(n) {
11479 return function(v) {
11480 return step([n, v]);
11481 };
11482 }
11483 function step(op) {
11484 if (f)
11485 throw new TypeError("Generator is already executing.");
11486 while (_)
11487 try {
11488 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)
11489 return t;
11490 if (y = 0, t)
11491 op = [op[0] & 2, t.value];
11492 switch (op[0]) {
11493 case 0:
11494 case 1:
11495 t = op;
11496 break;
11497 case 4:
11498 _.label++;
11499 return { value: op[1], done: false };
11500 case 5:
11501 _.label++;
11502 y = op[1];
11503 op = [0];
11504 continue;
11505 case 7:
11506 op = _.ops.pop();
11507 _.trys.pop();
11508 continue;
11509 default:
11510 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
11511 _ = 0;
11512 continue;
11513 }
11514 if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
11515 _.label = op[1];
11516 break;
11517 }
11518 if (op[0] === 6 && _.label < t[1]) {
11519 _.label = t[1];
11520 t = op;
11521 break;
11522 }
11523 if (t && _.label < t[2]) {
11524 _.label = t[2];
11525 _.ops.push(op);
11526 break;
11527 }
11528 if (t[2])
11529 _.ops.pop();
11530 _.trys.pop();
11531 continue;
11532 }
11533 op = body.call(thisArg, _);
11534 } catch (e) {
11535 op = [6, e];
11536 y = 0;
11537 } finally {
11538 f = t = 0;
11539 }
11540 if (op[0] & 5)
11541 throw op[1];
11542 return { value: op[0] ? op[1] : void 0, done: true };
11543 }
11544 };
11545 var __importStar2 = exports && exports.__importStar || function(mod) {
11546 if (mod && mod.__esModule)
11547 return mod;
11548 var result = {};
11549 if (mod != null) {
11550 for (var k in mod)
11551 if (Object.hasOwnProperty.call(mod, k))
11552 result[k] = mod[k];
11553 }
11554 result["default"] = mod;
11555 return result;
11556 };
11557 Object.defineProperty(exports, "__esModule", { value: true });
11558 var fs5 = __importStar2(__require("fs"));
11559 var regex = {
11560 section: /^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$/,
11561 param: /^\s*([\w\.\-\_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$/,
11562 comment: /^\s*[#;].*$/
11563 };
11564 function parse3(file) {
11565 return __awaiter2(this, void 0, void 0, function() {
11566 return __generator2(this, function(_a) {
11567 return [2, new Promise(function(resolve2, reject) {
11568 fs5.readFile(file, "utf8", function(err, data) {
11569 if (err) {
11570 reject(err);
11571 return;
11572 }
11573 resolve2(parseString(data));
11574 });
11575 })];
11576 });
11577 });
11578 }
11579 exports.parse = parse3;
11580 function parseSync(file) {
11581 return parseString(fs5.readFileSync(file, "utf8"));
11582 }
11583 exports.parseSync = parseSync;
11584 function parseString(data) {
11585 var sectionBody = {};
11586 var sectionName = null;
11587 var value = [[sectionName, sectionBody]];
11588 var lines = data.split(/\r\n|\r|\n/);
11589 lines.forEach(function(line2) {
11590 var match;
11591 if (regex.comment.test(line2)) {
11592 return;
11593 }
11594 if (regex.param.test(line2)) {
11595 match = line2.match(regex.param);
11596 sectionBody[match[1]] = match[2];
11597 } else if (regex.section.test(line2)) {
11598 match = line2.match(regex.section);
11599 sectionName = match[1];
11600 sectionBody = {};
11601 value.push([sectionName, sectionBody]);
11602 }
11603 });
11604 return value;
11605 }
11606 exports.parseString = parseString;
11607 }
11608});
11609
11610// node_modules/editorconfig/package.json
11611var require_package = __commonJS({
11612 "node_modules/editorconfig/package.json"(exports, module) {
11613 module.exports = {
11614 name: "editorconfig",
11615 version: "0.15.3",
11616 description: "EditorConfig File Locator and Interpreter for Node.js",
11617 keywords: [
11618 "editorconfig",
11619 "core"
11620 ],
11621 main: "src/index.js",
11622 contributors: [
11623 "Hong Xu (topbug.net)",
11624 "Jed Mao (https://github.com/jedmao/)",
11625 "Trey Hunner (http://treyhunner.com)"
11626 ],
11627 directories: {
11628 bin: "./bin",
11629 lib: "./lib"
11630 },
11631 scripts: {
11632 clean: "rimraf dist",
11633 prebuild: "npm run clean",
11634 build: "tsc",
11635 pretest: "npm run lint && npm run build && npm run copy && cmake .",
11636 test: "ctest .",
11637 "pretest:ci": "npm run pretest",
11638 "test:ci": "ctest -VV --output-on-failure .",
11639 lint: "npm run eclint && npm run tslint",
11640 eclint: 'eclint check --indent_size ignore "src/**"',
11641 tslint: "tslint --project tsconfig.json --exclude package.json",
11642 copy: "cpy .npmignore LICENSE README.md CHANGELOG.md dist && cpy bin/* dist/bin && cpy src/lib/fnmatch*.* dist/src/lib",
11643 prepub: "npm run lint && npm run build && npm run copy",
11644 pub: "npm publish ./dist"
11645 },
11646 repository: {
11647 type: "git",
11648 url: "git://github.com/editorconfig/editorconfig-core-js.git"
11649 },
11650 bugs: "https://github.com/editorconfig/editorconfig-core-js/issues",
11651 author: "EditorConfig Team",
11652 license: "MIT",
11653 dependencies: {
11654 commander: "^2.19.0",
11655 "lru-cache": "^4.1.5",
11656 semver: "^5.6.0",
11657 sigmund: "^1.0.1"
11658 },
11659 devDependencies: {
11660 "@types/mocha": "^5.2.6",
11661 "@types/node": "^10.12.29",
11662 "@types/semver": "^5.5.0",
11663 "cpy-cli": "^2.0.0",
11664 eclint: "^2.8.1",
11665 mocha: "^5.2.0",
11666 rimraf: "^2.6.3",
11667 should: "^13.2.3",
11668 tslint: "^5.13.1",
11669 typescript: "^3.3.3333"
11670 }
11671 };
11672 }
11673});
11674
11675// node_modules/editorconfig/src/index.js
11676var require_src = __commonJS({
11677 "node_modules/editorconfig/src/index.js"(exports) {
11678 "use strict";
11679 var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
11680 return new (P || (P = Promise))(function(resolve2, reject) {
11681 function fulfilled(value) {
11682 try {
11683 step(generator.next(value));
11684 } catch (e) {
11685 reject(e);
11686 }
11687 }
11688 function rejected(value) {
11689 try {
11690 step(generator["throw"](value));
11691 } catch (e) {
11692 reject(e);
11693 }
11694 }
11695 function step(result) {
11696 result.done ? resolve2(result.value) : new P(function(resolve3) {
11697 resolve3(result.value);
11698 }).then(fulfilled, rejected);
11699 }
11700 step((generator = generator.apply(thisArg, _arguments || [])).next());
11701 });
11702 };
11703 var __generator2 = exports && exports.__generator || function(thisArg, body) {
11704 var _ = { label: 0, sent: function() {
11705 if (t[0] & 1)
11706 throw t[1];
11707 return t[1];
11708 }, trys: [], ops: [] }, f, y, t, g;
11709 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
11710 return this;
11711 }), g;
11712 function verb(n) {
11713 return function(v) {
11714 return step([n, v]);
11715 };
11716 }
11717 function step(op) {
11718 if (f)
11719 throw new TypeError("Generator is already executing.");
11720 while (_)
11721 try {
11722 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)
11723 return t;
11724 if (y = 0, t)
11725 op = [op[0] & 2, t.value];
11726 switch (op[0]) {
11727 case 0:
11728 case 1:
11729 t = op;
11730 break;
11731 case 4:
11732 _.label++;
11733 return { value: op[1], done: false };
11734 case 5:
11735 _.label++;
11736 y = op[1];
11737 op = [0];
11738 continue;
11739 case 7:
11740 op = _.ops.pop();
11741 _.trys.pop();
11742 continue;
11743 default:
11744 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
11745 _ = 0;
11746 continue;
11747 }
11748 if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
11749 _.label = op[1];
11750 break;
11751 }
11752 if (op[0] === 6 && _.label < t[1]) {
11753 _.label = t[1];
11754 t = op;
11755 break;
11756 }
11757 if (t && _.label < t[2]) {
11758 _.label = t[2];
11759 _.ops.push(op);
11760 break;
11761 }
11762 if (t[2])
11763 _.ops.pop();
11764 _.trys.pop();
11765 continue;
11766 }
11767 op = body.call(thisArg, _);
11768 } catch (e) {
11769 op = [6, e];
11770 y = 0;
11771 } finally {
11772 f = t = 0;
11773 }
11774 if (op[0] & 5)
11775 throw op[1];
11776 return { value: op[0] ? op[1] : void 0, done: true };
11777 }
11778 };
11779 var __importStar2 = exports && exports.__importStar || function(mod) {
11780 if (mod && mod.__esModule)
11781 return mod;
11782 var result = {};
11783 if (mod != null) {
11784 for (var k in mod)
11785 if (Object.hasOwnProperty.call(mod, k))
11786 result[k] = mod[k];
11787 }
11788 result["default"] = mod;
11789 return result;
11790 };
11791 var __importDefault2 = exports && exports.__importDefault || function(mod) {
11792 return mod && mod.__esModule ? mod : { "default": mod };
11793 };
11794 Object.defineProperty(exports, "__esModule", { value: true });
11795 var fs5 = __importStar2(__require("fs"));
11796 var path9 = __importStar2(__require("path"));
11797 var semver = {
11798 gte: require_gte()
11799 };
11800 var fnmatch_1 = __importDefault2(require_fnmatch());
11801 var ini_1 = require_ini();
11802 exports.parseString = ini_1.parseString;
11803 var package_json_1 = __importDefault2(require_package());
11804 var knownProps = {
11805 end_of_line: true,
11806 indent_style: true,
11807 indent_size: true,
11808 insert_final_newline: true,
11809 trim_trailing_whitespace: true,
11810 charset: true
11811 };
11812 function fnmatch(filepath, glob) {
11813 var matchOptions = { matchBase: true, dot: true, noext: true };
11814 glob = glob.replace(/\*\*/g, "{*,**/**/**}");
11815 return fnmatch_1.default(filepath, glob, matchOptions);
11816 }
11817 function getConfigFileNames(filepath, options8) {
11818 var paths = [];
11819 do {
11820 filepath = path9.dirname(filepath);
11821 paths.push(path9.join(filepath, options8.config));
11822 } while (filepath !== options8.root);
11823 return paths;
11824 }
11825 function processMatches(matches, version) {
11826 if ("indent_style" in matches && matches.indent_style === "tab" && !("indent_size" in matches) && semver.gte(version, "0.10.0")) {
11827 matches.indent_size = "tab";
11828 }
11829 if ("indent_size" in matches && !("tab_width" in matches) && matches.indent_size !== "tab") {
11830 matches.tab_width = matches.indent_size;
11831 }
11832 if ("indent_size" in matches && "tab_width" in matches && matches.indent_size === "tab") {
11833 matches.indent_size = matches.tab_width;
11834 }
11835 return matches;
11836 }
11837 function processOptions(options8, filepath) {
11838 if (options8 === void 0) {
11839 options8 = {};
11840 }
11841 return {
11842 config: options8.config || ".editorconfig",
11843 version: options8.version || package_json_1.default.version,
11844 root: path9.resolve(options8.root || path9.parse(filepath).root)
11845 };
11846 }
11847 function buildFullGlob(pathPrefix, glob) {
11848 switch (glob.indexOf("/")) {
11849 case -1:
11850 glob = "**/" + glob;
11851 break;
11852 case 0:
11853 glob = glob.substring(1);
11854 break;
11855 default:
11856 break;
11857 }
11858 return path9.join(pathPrefix, glob);
11859 }
11860 function extendProps(props, options8) {
11861 if (props === void 0) {
11862 props = {};
11863 }
11864 if (options8 === void 0) {
11865 options8 = {};
11866 }
11867 for (var key in options8) {
11868 if (options8.hasOwnProperty(key)) {
11869 var value = options8[key];
11870 var key2 = key.toLowerCase();
11871 var value2 = value;
11872 if (knownProps[key2]) {
11873 value2 = value.toLowerCase();
11874 }
11875 try {
11876 value2 = JSON.parse(value);
11877 } catch (e) {
11878 }
11879 if (typeof value === "undefined" || value === null) {
11880 value2 = String(value);
11881 }
11882 props[key2] = value2;
11883 }
11884 }
11885 return props;
11886 }
11887 function parseFromConfigs(configs, filepath, options8) {
11888 return processMatches(configs.reverse().reduce(function(matches, file) {
11889 var pathPrefix = path9.dirname(file.name);
11890 file.contents.forEach(function(section) {
11891 var glob = section[0];
11892 var options22 = section[1];
11893 if (!glob) {
11894 return;
11895 }
11896 var fullGlob = buildFullGlob(pathPrefix, glob);
11897 if (!fnmatch(filepath, fullGlob)) {
11898 return;
11899 }
11900 matches = extendProps(matches, options22);
11901 });
11902 return matches;
11903 }, {}), options8.version);
11904 }
11905 function getConfigsForFiles(files) {
11906 var configs = [];
11907 for (var i in files) {
11908 if (files.hasOwnProperty(i)) {
11909 var file = files[i];
11910 var contents = ini_1.parseString(file.contents);
11911 configs.push({
11912 name: file.name,
11913 contents
11914 });
11915 if ((contents[0][1].root || "").toLowerCase() === "true") {
11916 break;
11917 }
11918 }
11919 }
11920 return configs;
11921 }
11922 function readConfigFiles(filepaths) {
11923 return __awaiter2(this, void 0, void 0, function() {
11924 return __generator2(this, function(_a) {
11925 return [2, Promise.all(filepaths.map(function(name) {
11926 return new Promise(function(resolve2) {
11927 fs5.readFile(name, "utf8", function(err, data) {
11928 resolve2({
11929 name,
11930 contents: err ? "" : data
11931 });
11932 });
11933 });
11934 }))];
11935 });
11936 });
11937 }
11938 function readConfigFilesSync(filepaths) {
11939 var files = [];
11940 var file;
11941 filepaths.forEach(function(filepath) {
11942 try {
11943 file = fs5.readFileSync(filepath, "utf8");
11944 } catch (e) {
11945 file = "";
11946 }
11947 files.push({
11948 name: filepath,
11949 contents: file
11950 });
11951 });
11952 return files;
11953 }
11954 function opts(filepath, options8) {
11955 if (options8 === void 0) {
11956 options8 = {};
11957 }
11958 var resolvedFilePath = path9.resolve(filepath);
11959 return [
11960 resolvedFilePath,
11961 processOptions(options8, resolvedFilePath)
11962 ];
11963 }
11964 function parseFromFiles(filepath, files, options8) {
11965 if (options8 === void 0) {
11966 options8 = {};
11967 }
11968 return __awaiter2(this, void 0, void 0, function() {
11969 var _a, resolvedFilePath, processedOptions;
11970 return __generator2(this, function(_b) {
11971 _a = opts(filepath, options8), resolvedFilePath = _a[0], processedOptions = _a[1];
11972 return [2, files.then(getConfigsForFiles).then(function(configs) {
11973 return parseFromConfigs(configs, resolvedFilePath, processedOptions);
11974 })];
11975 });
11976 });
11977 }
11978 exports.parseFromFiles = parseFromFiles;
11979 function parseFromFilesSync(filepath, files, options8) {
11980 if (options8 === void 0) {
11981 options8 = {};
11982 }
11983 var _a = opts(filepath, options8), resolvedFilePath = _a[0], processedOptions = _a[1];
11984 return parseFromConfigs(getConfigsForFiles(files), resolvedFilePath, processedOptions);
11985 }
11986 exports.parseFromFilesSync = parseFromFilesSync;
11987 function parse3(_filepath, _options) {
11988 if (_options === void 0) {
11989 _options = {};
11990 }
11991 return __awaiter2(this, void 0, void 0, function() {
11992 var _a, resolvedFilePath, processedOptions, filepaths;
11993 return __generator2(this, function(_b) {
11994 _a = opts(_filepath, _options), resolvedFilePath = _a[0], processedOptions = _a[1];
11995 filepaths = getConfigFileNames(resolvedFilePath, processedOptions);
11996 return [2, readConfigFiles(filepaths).then(getConfigsForFiles).then(function(configs) {
11997 return parseFromConfigs(configs, resolvedFilePath, processedOptions);
11998 })];
11999 });
12000 });
12001 }
12002 exports.parse = parse3;
12003 function parseSync(_filepath, _options) {
12004 if (_options === void 0) {
12005 _options = {};
12006 }
12007 var _a = opts(_filepath, _options), resolvedFilePath = _a[0], processedOptions = _a[1];
12008 var filepaths = getConfigFileNames(resolvedFilePath, processedOptions);
12009 var files = readConfigFilesSync(filepaths);
12010 return parseFromConfigs(getConfigsForFiles(files), resolvedFilePath, processedOptions);
12011 }
12012 exports.parseSync = parseSync;
12013 }
12014});
12015
12016// node_modules/editorconfig-to-prettier/index.js
12017var require_editorconfig_to_prettier = __commonJS({
12018 "node_modules/editorconfig-to-prettier/index.js"(exports, module) {
12019 module.exports = editorConfigToPrettier2;
12020 function removeUnset(editorConfig) {
12021 const result = {};
12022 const keys = Object.keys(editorConfig);
12023 for (let i = 0; i < keys.length; i++) {
12024 const key = keys[i];
12025 if (editorConfig[key] === "unset") {
12026 continue;
12027 }
12028 result[key] = editorConfig[key];
12029 }
12030 return result;
12031 }
12032 function editorConfigToPrettier2(editorConfig) {
12033 if (!editorConfig) {
12034 return null;
12035 }
12036 editorConfig = removeUnset(editorConfig);
12037 if (Object.keys(editorConfig).length === 0) {
12038 return null;
12039 }
12040 const result = {};
12041 if (editorConfig.indent_style) {
12042 result.useTabs = editorConfig.indent_style === "tab";
12043 }
12044 if (editorConfig.indent_size === "tab") {
12045 result.useTabs = true;
12046 }
12047 if (result.useTabs && editorConfig.tab_width) {
12048 result.tabWidth = editorConfig.tab_width;
12049 } else if (editorConfig.indent_style === "space" && editorConfig.indent_size && editorConfig.indent_size !== "tab") {
12050 result.tabWidth = editorConfig.indent_size;
12051 } else if (editorConfig.tab_width !== void 0) {
12052 result.tabWidth = editorConfig.tab_width;
12053 }
12054 if (editorConfig.max_line_length) {
12055 if (editorConfig.max_line_length === "off") {
12056 result.printWidth = Number.POSITIVE_INFINITY;
12057 } else {
12058 result.printWidth = editorConfig.max_line_length;
12059 }
12060 }
12061 if (editorConfig.quote_type === "single") {
12062 result.singleQuote = true;
12063 } else if (editorConfig.quote_type === "double") {
12064 result.singleQuote = false;
12065 }
12066 if (["cr", "crlf", "lf"].indexOf(editorConfig.end_of_line) !== -1) {
12067 result.endOfLine = editorConfig.end_of_line;
12068 }
12069 if (editorConfig.insert_final_newline === false || editorConfig.insert_final_newline === true) {
12070 result.insertFinalNewline = editorConfig.insert_final_newline;
12071 }
12072 return result;
12073 }
12074 }
12075});
12076
12077// node_modules/@iarna/toml/lib/parser.js
12078var require_parser = __commonJS({
12079 "node_modules/@iarna/toml/lib/parser.js"(exports, module) {
12080 "use strict";
12081 var ParserEND = 1114112;
12082 var ParserError = class _ParserError extends Error {
12083 /* istanbul ignore next */
12084 constructor(msg, filename, linenumber) {
12085 super("[ParserError] " + msg, filename, linenumber);
12086 this.name = "ParserError";
12087 this.code = "ParserError";
12088 if (Error.captureStackTrace)
12089 Error.captureStackTrace(this, _ParserError);
12090 }
12091 };
12092 var State = class {
12093 constructor(parser) {
12094 this.parser = parser;
12095 this.buf = "";
12096 this.returned = null;
12097 this.result = null;
12098 this.resultTable = null;
12099 this.resultArr = null;
12100 }
12101 };
12102 var Parser = class {
12103 constructor() {
12104 this.pos = 0;
12105 this.col = 0;
12106 this.line = 0;
12107 this.obj = {};
12108 this.ctx = this.obj;
12109 this.stack = [];
12110 this._buf = "";
12111 this.char = null;
12112 this.ii = 0;
12113 this.state = new State(this.parseStart);
12114 }
12115 parse(str) {
12116 if (str.length === 0 || str.length == null)
12117 return;
12118 this._buf = String(str);
12119 this.ii = -1;
12120 this.char = -1;
12121 let getNext;
12122 while (getNext === false || this.nextChar()) {
12123 getNext = this.runOne();
12124 }
12125 this._buf = null;
12126 }
12127 nextChar() {
12128 if (this.char === 10) {
12129 ++this.line;
12130 this.col = -1;
12131 }
12132 ++this.ii;
12133 this.char = this._buf.codePointAt(this.ii);
12134 ++this.pos;
12135 ++this.col;
12136 return this.haveBuffer();
12137 }
12138 haveBuffer() {
12139 return this.ii < this._buf.length;
12140 }
12141 runOne() {
12142 return this.state.parser.call(this, this.state.returned);
12143 }
12144 finish() {
12145 this.char = ParserEND;
12146 let last;
12147 do {
12148 last = this.state.parser;
12149 this.runOne();
12150 } while (this.state.parser !== last);
12151 this.ctx = null;
12152 this.state = null;
12153 this._buf = null;
12154 return this.obj;
12155 }
12156 next(fn) {
12157 if (typeof fn !== "function")
12158 throw new ParserError("Tried to set state to non-existent state: " + JSON.stringify(fn));
12159 this.state.parser = fn;
12160 }
12161 goto(fn) {
12162 this.next(fn);
12163 return this.runOne();
12164 }
12165 call(fn, returnWith) {
12166 if (returnWith)
12167 this.next(returnWith);
12168 this.stack.push(this.state);
12169 this.state = new State(fn);
12170 }
12171 callNow(fn, returnWith) {
12172 this.call(fn, returnWith);
12173 return this.runOne();
12174 }
12175 return(value) {
12176 if (this.stack.length === 0)
12177 throw this.error(new ParserError("Stack underflow"));
12178 if (value === void 0)
12179 value = this.state.buf;
12180 this.state = this.stack.pop();
12181 this.state.returned = value;
12182 }
12183 returnNow(value) {
12184 this.return(value);
12185 return this.runOne();
12186 }
12187 consume() {
12188 if (this.char === ParserEND)
12189 throw this.error(new ParserError("Unexpected end-of-buffer"));
12190 this.state.buf += this._buf[this.ii];
12191 }
12192 error(err) {
12193 err.line = this.line;
12194 err.col = this.col;
12195 err.pos = this.pos;
12196 return err;
12197 }
12198 /* istanbul ignore next */
12199 parseStart() {
12200 throw new ParserError("Must declare a parseStart method");
12201 }
12202 };
12203 Parser.END = ParserEND;
12204 Parser.Error = ParserError;
12205 module.exports = Parser;
12206 }
12207});
12208
12209// node_modules/@iarna/toml/lib/create-datetime.js
12210var require_create_datetime = __commonJS({
12211 "node_modules/@iarna/toml/lib/create-datetime.js"(exports, module) {
12212 "use strict";
12213 module.exports = (value) => {
12214 const date = new Date(value);
12215 if (isNaN(date)) {
12216 throw new TypeError("Invalid Datetime");
12217 } else {
12218 return date;
12219 }
12220 };
12221 }
12222});
12223
12224// node_modules/@iarna/toml/lib/format-num.js
12225var require_format_num = __commonJS({
12226 "node_modules/@iarna/toml/lib/format-num.js"(exports, module) {
12227 "use strict";
12228 module.exports = (d, num) => {
12229 num = String(num);
12230 while (num.length < d)
12231 num = "0" + num;
12232 return num;
12233 };
12234 }
12235});
12236
12237// node_modules/@iarna/toml/lib/create-datetime-float.js
12238var require_create_datetime_float = __commonJS({
12239 "node_modules/@iarna/toml/lib/create-datetime-float.js"(exports, module) {
12240 "use strict";
12241 var f = require_format_num();
12242 var FloatingDateTime = class extends Date {
12243 constructor(value) {
12244 super(value + "Z");
12245 this.isFloating = true;
12246 }
12247 toISOString() {
12248 const date = `${this.getUTCFullYear()}-${f(2, this.getUTCMonth() + 1)}-${f(2, this.getUTCDate())}`;
12249 const time = `${f(2, this.getUTCHours())}:${f(2, this.getUTCMinutes())}:${f(2, this.getUTCSeconds())}.${f(3, this.getUTCMilliseconds())}`;
12250 return `${date}T${time}`;
12251 }
12252 };
12253 module.exports = (value) => {
12254 const date = new FloatingDateTime(value);
12255 if (isNaN(date)) {
12256 throw new TypeError("Invalid Datetime");
12257 } else {
12258 return date;
12259 }
12260 };
12261 }
12262});
12263
12264// node_modules/@iarna/toml/lib/create-date.js
12265var require_create_date = __commonJS({
12266 "node_modules/@iarna/toml/lib/create-date.js"(exports, module) {
12267 "use strict";
12268 var f = require_format_num();
12269 var DateTime = global.Date;
12270 var Date2 = class extends DateTime {
12271 constructor(value) {
12272 super(value);
12273 this.isDate = true;
12274 }
12275 toISOString() {
12276 return `${this.getUTCFullYear()}-${f(2, this.getUTCMonth() + 1)}-${f(2, this.getUTCDate())}`;
12277 }
12278 };
12279 module.exports = (value) => {
12280 const date = new Date2(value);
12281 if (isNaN(date)) {
12282 throw new TypeError("Invalid Datetime");
12283 } else {
12284 return date;
12285 }
12286 };
12287 }
12288});
12289
12290// node_modules/@iarna/toml/lib/create-time.js
12291var require_create_time = __commonJS({
12292 "node_modules/@iarna/toml/lib/create-time.js"(exports, module) {
12293 "use strict";
12294 var f = require_format_num();
12295 var Time = class extends Date {
12296 constructor(value) {
12297 super(`0000-01-01T${value}Z`);
12298 this.isTime = true;
12299 }
12300 toISOString() {
12301 return `${f(2, this.getUTCHours())}:${f(2, this.getUTCMinutes())}:${f(2, this.getUTCSeconds())}.${f(3, this.getUTCMilliseconds())}`;
12302 }
12303 };
12304 module.exports = (value) => {
12305 const date = new Time(value);
12306 if (isNaN(date)) {
12307 throw new TypeError("Invalid Datetime");
12308 } else {
12309 return date;
12310 }
12311 };
12312 }
12313});
12314
12315// node_modules/@iarna/toml/lib/toml-parser.js
12316var require_toml_parser = __commonJS({
12317 "node_modules/@iarna/toml/lib/toml-parser.js"(exports, module) {
12318 "use strict";
12319 module.exports = makeParserClass(require_parser());
12320 module.exports.makeParserClass = makeParserClass;
12321 var TomlError = class _TomlError extends Error {
12322 constructor(msg) {
12323 super(msg);
12324 this.name = "TomlError";
12325 if (Error.captureStackTrace)
12326 Error.captureStackTrace(this, _TomlError);
12327 this.fromTOML = true;
12328 this.wrapped = null;
12329 }
12330 };
12331 TomlError.wrap = (err) => {
12332 const terr = new TomlError(err.message);
12333 terr.code = err.code;
12334 terr.wrapped = err;
12335 return terr;
12336 };
12337 module.exports.TomlError = TomlError;
12338 var createDateTime = require_create_datetime();
12339 var createDateTimeFloat = require_create_datetime_float();
12340 var createDate = require_create_date();
12341 var createTime = require_create_time();
12342 var CTRL_I = 9;
12343 var CTRL_J = 10;
12344 var CTRL_M = 13;
12345 var CTRL_CHAR_BOUNDARY = 31;
12346 var CHAR_SP = 32;
12347 var CHAR_QUOT = 34;
12348 var CHAR_NUM = 35;
12349 var CHAR_APOS = 39;
12350 var CHAR_PLUS = 43;
12351 var CHAR_COMMA = 44;
12352 var CHAR_HYPHEN = 45;
12353 var CHAR_PERIOD = 46;
12354 var CHAR_0 = 48;
12355 var CHAR_1 = 49;
12356 var CHAR_7 = 55;
12357 var CHAR_9 = 57;
12358 var CHAR_COLON = 58;
12359 var CHAR_EQUALS = 61;
12360 var CHAR_A = 65;
12361 var CHAR_E = 69;
12362 var CHAR_F = 70;
12363 var CHAR_T = 84;
12364 var CHAR_U = 85;
12365 var CHAR_Z = 90;
12366 var CHAR_LOWBAR = 95;
12367 var CHAR_a = 97;
12368 var CHAR_b = 98;
12369 var CHAR_e = 101;
12370 var CHAR_f = 102;
12371 var CHAR_i = 105;
12372 var CHAR_l = 108;
12373 var CHAR_n = 110;
12374 var CHAR_o = 111;
12375 var CHAR_r = 114;
12376 var CHAR_s = 115;
12377 var CHAR_t = 116;
12378 var CHAR_u = 117;
12379 var CHAR_x = 120;
12380 var CHAR_z = 122;
12381 var CHAR_LCUB = 123;
12382 var CHAR_RCUB = 125;
12383 var CHAR_LSQB = 91;
12384 var CHAR_BSOL = 92;
12385 var CHAR_RSQB = 93;
12386 var CHAR_DEL = 127;
12387 var SURROGATE_FIRST = 55296;
12388 var SURROGATE_LAST = 57343;
12389 var escapes = {
12390 [CHAR_b]: "\b",
12391 [CHAR_t]: " ",
12392 [CHAR_n]: "\n",
12393 [CHAR_f]: "\f",
12394 [CHAR_r]: "\r",
12395 [CHAR_QUOT]: '"',
12396 [CHAR_BSOL]: "\\"
12397 };
12398 function isDigit(cp) {
12399 return cp >= CHAR_0 && cp <= CHAR_9;
12400 }
12401 function isHexit(cp) {
12402 return cp >= CHAR_A && cp <= CHAR_F || cp >= CHAR_a && cp <= CHAR_f || cp >= CHAR_0 && cp <= CHAR_9;
12403 }
12404 function isBit(cp) {
12405 return cp === CHAR_1 || cp === CHAR_0;
12406 }
12407 function isOctit(cp) {
12408 return cp >= CHAR_0 && cp <= CHAR_7;
12409 }
12410 function isAlphaNumQuoteHyphen(cp) {
12411 return cp >= CHAR_A && cp <= CHAR_Z || cp >= CHAR_a && cp <= CHAR_z || cp >= CHAR_0 && cp <= CHAR_9 || cp === CHAR_APOS || cp === CHAR_QUOT || cp === CHAR_LOWBAR || cp === CHAR_HYPHEN;
12412 }
12413 function isAlphaNumHyphen(cp) {
12414 return cp >= CHAR_A && cp <= CHAR_Z || cp >= CHAR_a && cp <= CHAR_z || cp >= CHAR_0 && cp <= CHAR_9 || cp === CHAR_LOWBAR || cp === CHAR_HYPHEN;
12415 }
12416 var _type = Symbol("type");
12417 var _declared = Symbol("declared");
12418 var hasOwnProperty2 = Object.prototype.hasOwnProperty;
12419 var defineProperty = Object.defineProperty;
12420 var descriptor = { configurable: true, enumerable: true, writable: true, value: void 0 };
12421 function hasKey(obj, key) {
12422 if (hasOwnProperty2.call(obj, key))
12423 return true;
12424 if (key === "__proto__")
12425 defineProperty(obj, "__proto__", descriptor);
12426 return false;
12427 }
12428 var INLINE_TABLE = Symbol("inline-table");
12429 function InlineTable() {
12430 return Object.defineProperties({}, {
12431 [_type]: { value: INLINE_TABLE }
12432 });
12433 }
12434 function isInlineTable(obj) {
12435 if (obj === null || typeof obj !== "object")
12436 return false;
12437 return obj[_type] === INLINE_TABLE;
12438 }
12439 var TABLE = Symbol("table");
12440 function Table() {
12441 return Object.defineProperties({}, {
12442 [_type]: { value: TABLE },
12443 [_declared]: { value: false, writable: true }
12444 });
12445 }
12446 function isTable(obj) {
12447 if (obj === null || typeof obj !== "object")
12448 return false;
12449 return obj[_type] === TABLE;
12450 }
12451 var _contentType = Symbol("content-type");
12452 var INLINE_LIST = Symbol("inline-list");
12453 function InlineList(type) {
12454 return Object.defineProperties([], {
12455 [_type]: { value: INLINE_LIST },
12456 [_contentType]: { value: type }
12457 });
12458 }
12459 function isInlineList(obj) {
12460 if (obj === null || typeof obj !== "object")
12461 return false;
12462 return obj[_type] === INLINE_LIST;
12463 }
12464 var LIST = Symbol("list");
12465 function List() {
12466 return Object.defineProperties([], {
12467 [_type]: { value: LIST }
12468 });
12469 }
12470 function isList(obj) {
12471 if (obj === null || typeof obj !== "object")
12472 return false;
12473 return obj[_type] === LIST;
12474 }
12475 var _custom;
12476 try {
12477 const utilInspect = __require("util").inspect;
12478 _custom = utilInspect.custom;
12479 } catch (_) {
12480 }
12481 var _inspect = _custom || "inspect";
12482 var BoxedBigInt = class {
12483 constructor(value) {
12484 try {
12485 this.value = global.BigInt.asIntN(64, value);
12486 } catch (_) {
12487 this.value = null;
12488 }
12489 Object.defineProperty(this, _type, { value: INTEGER });
12490 }
12491 isNaN() {
12492 return this.value === null;
12493 }
12494 /* istanbul ignore next */
12495 toString() {
12496 return String(this.value);
12497 }
12498 /* istanbul ignore next */
12499 [_inspect]() {
12500 return `[BigInt: ${this.toString()}]}`;
12501 }
12502 valueOf() {
12503 return this.value;
12504 }
12505 };
12506 var INTEGER = Symbol("integer");
12507 function Integer(value) {
12508 let num = Number(value);
12509 if (Object.is(num, -0))
12510 num = 0;
12511 if (global.BigInt && !Number.isSafeInteger(num)) {
12512 return new BoxedBigInt(value);
12513 } else {
12514 return Object.defineProperties(new Number(num), {
12515 isNaN: { value: function() {
12516 return isNaN(this);
12517 } },
12518 [_type]: { value: INTEGER },
12519 [_inspect]: { value: () => `[Integer: ${value}]` }
12520 });
12521 }
12522 }
12523 function isInteger(obj) {
12524 if (obj === null || typeof obj !== "object")
12525 return false;
12526 return obj[_type] === INTEGER;
12527 }
12528 var FLOAT = Symbol("float");
12529 function Float(value) {
12530 return Object.defineProperties(new Number(value), {
12531 [_type]: { value: FLOAT },
12532 [_inspect]: { value: () => `[Float: ${value}]` }
12533 });
12534 }
12535 function isFloat(obj) {
12536 if (obj === null || typeof obj !== "object")
12537 return false;
12538 return obj[_type] === FLOAT;
12539 }
12540 function tomlType(value) {
12541 const type = typeof value;
12542 if (type === "object") {
12543 if (value === null)
12544 return "null";
12545 if (value instanceof Date)
12546 return "datetime";
12547 if (_type in value) {
12548 switch (value[_type]) {
12549 case INLINE_TABLE:
12550 return "inline-table";
12551 case INLINE_LIST:
12552 return "inline-list";
12553 case TABLE:
12554 return "table";
12555 case LIST:
12556 return "list";
12557 case FLOAT:
12558 return "float";
12559 case INTEGER:
12560 return "integer";
12561 }
12562 }
12563 }
12564 return type;
12565 }
12566 function makeParserClass(Parser) {
12567 class TOMLParser extends Parser {
12568 constructor() {
12569 super();
12570 this.ctx = this.obj = Table();
12571 }
12572 /* MATCH HELPER */
12573 atEndOfWord() {
12574 return this.char === CHAR_NUM || this.char === CTRL_I || this.char === CHAR_SP || this.atEndOfLine();
12575 }
12576 atEndOfLine() {
12577 return this.char === Parser.END || this.char === CTRL_J || this.char === CTRL_M;
12578 }
12579 parseStart() {
12580 if (this.char === Parser.END) {
12581 return null;
12582 } else if (this.char === CHAR_LSQB) {
12583 return this.call(this.parseTableOrList);
12584 } else if (this.char === CHAR_NUM) {
12585 return this.call(this.parseComment);
12586 } else if (this.char === CTRL_J || this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {
12587 return null;
12588 } else if (isAlphaNumQuoteHyphen(this.char)) {
12589 return this.callNow(this.parseAssignStatement);
12590 } else {
12591 throw this.error(new TomlError(`Unknown character "${this.char}"`));
12592 }
12593 }
12594 // HELPER, this strips any whitespace and comments to the end of the line
12595 // then RETURNS. Last state in a production.
12596 parseWhitespaceToEOL() {
12597 if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {
12598 return null;
12599 } else if (this.char === CHAR_NUM) {
12600 return this.goto(this.parseComment);
12601 } else if (this.char === Parser.END || this.char === CTRL_J) {
12602 return this.return();
12603 } else {
12604 throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line"));
12605 }
12606 }
12607 /* ASSIGNMENT: key = value */
12608 parseAssignStatement() {
12609 return this.callNow(this.parseAssign, this.recordAssignStatement);
12610 }
12611 recordAssignStatement(kv) {
12612 let target = this.ctx;
12613 let finalKey = kv.key.pop();
12614 for (let kw of kv.key) {
12615 if (hasKey(target, kw) && (!isTable(target[kw]) || target[kw][_declared])) {
12616 throw this.error(new TomlError("Can't redefine existing key"));
12617 }
12618 target = target[kw] = target[kw] || Table();
12619 }
12620 if (hasKey(target, finalKey)) {
12621 throw this.error(new TomlError("Can't redefine existing key"));
12622 }
12623 if (isInteger(kv.value) || isFloat(kv.value)) {
12624 target[finalKey] = kv.value.valueOf();
12625 } else {
12626 target[finalKey] = kv.value;
12627 }
12628 return this.goto(this.parseWhitespaceToEOL);
12629 }
12630 /* ASSSIGNMENT expression, key = value possibly inside an inline table */
12631 parseAssign() {
12632 return this.callNow(this.parseKeyword, this.recordAssignKeyword);
12633 }
12634 recordAssignKeyword(key) {
12635 if (this.state.resultTable) {
12636 this.state.resultTable.push(key);
12637 } else {
12638 this.state.resultTable = [key];
12639 }
12640 return this.goto(this.parseAssignKeywordPreDot);
12641 }
12642 parseAssignKeywordPreDot() {
12643 if (this.char === CHAR_PERIOD) {
12644 return this.next(this.parseAssignKeywordPostDot);
12645 } else if (this.char !== CHAR_SP && this.char !== CTRL_I) {
12646 return this.goto(this.parseAssignEqual);
12647 }
12648 }
12649 parseAssignKeywordPostDot() {
12650 if (this.char !== CHAR_SP && this.char !== CTRL_I) {
12651 return this.callNow(this.parseKeyword, this.recordAssignKeyword);
12652 }
12653 }
12654 parseAssignEqual() {
12655 if (this.char === CHAR_EQUALS) {
12656 return this.next(this.parseAssignPreValue);
12657 } else {
12658 throw this.error(new TomlError('Invalid character, expected "="'));
12659 }
12660 }
12661 parseAssignPreValue() {
12662 if (this.char === CHAR_SP || this.char === CTRL_I) {
12663 return null;
12664 } else {
12665 return this.callNow(this.parseValue, this.recordAssignValue);
12666 }
12667 }
12668 recordAssignValue(value) {
12669 return this.returnNow({ key: this.state.resultTable, value });
12670 }
12671 /* COMMENTS: #...eol */
12672 parseComment() {
12673 do {
12674 if (this.char === Parser.END || this.char === CTRL_J) {
12675 return this.return();
12676 }
12677 } while (this.nextChar());
12678 }
12679 /* TABLES AND LISTS, [foo] and [[foo]] */
12680 parseTableOrList() {
12681 if (this.char === CHAR_LSQB) {
12682 this.next(this.parseList);
12683 } else {
12684 return this.goto(this.parseTable);
12685 }
12686 }
12687 /* TABLE [foo.bar.baz] */
12688 parseTable() {
12689 this.ctx = this.obj;
12690 return this.goto(this.parseTableNext);
12691 }
12692 parseTableNext() {
12693 if (this.char === CHAR_SP || this.char === CTRL_I) {
12694 return null;
12695 } else {
12696 return this.callNow(this.parseKeyword, this.parseTableMore);
12697 }
12698 }
12699 parseTableMore(keyword) {
12700 if (this.char === CHAR_SP || this.char === CTRL_I) {
12701 return null;
12702 } else if (this.char === CHAR_RSQB) {
12703 if (hasKey(this.ctx, keyword) && (!isTable(this.ctx[keyword]) || this.ctx[keyword][_declared])) {
12704 throw this.error(new TomlError("Can't redefine existing key"));
12705 } else {
12706 this.ctx = this.ctx[keyword] = this.ctx[keyword] || Table();
12707 this.ctx[_declared] = true;
12708 }
12709 return this.next(this.parseWhitespaceToEOL);
12710 } else if (this.char === CHAR_PERIOD) {
12711 if (!hasKey(this.ctx, keyword)) {
12712 this.ctx = this.ctx[keyword] = Table();
12713 } else if (isTable(this.ctx[keyword])) {
12714 this.ctx = this.ctx[keyword];
12715 } else if (isList(this.ctx[keyword])) {
12716 this.ctx = this.ctx[keyword][this.ctx[keyword].length - 1];
12717 } else {
12718 throw this.error(new TomlError("Can't redefine existing key"));
12719 }
12720 return this.next(this.parseTableNext);
12721 } else {
12722 throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"));
12723 }
12724 }
12725 /* LIST [[a.b.c]] */
12726 parseList() {
12727 this.ctx = this.obj;
12728 return this.goto(this.parseListNext);
12729 }
12730 parseListNext() {
12731 if (this.char === CHAR_SP || this.char === CTRL_I) {
12732 return null;
12733 } else {
12734 return this.callNow(this.parseKeyword, this.parseListMore);
12735 }
12736 }
12737 parseListMore(keyword) {
12738 if (this.char === CHAR_SP || this.char === CTRL_I) {
12739 return null;
12740 } else if (this.char === CHAR_RSQB) {
12741 if (!hasKey(this.ctx, keyword)) {
12742 this.ctx[keyword] = List();
12743 }
12744 if (isInlineList(this.ctx[keyword])) {
12745 throw this.error(new TomlError("Can't extend an inline array"));
12746 } else if (isList(this.ctx[keyword])) {
12747 const next = Table();
12748 this.ctx[keyword].push(next);
12749 this.ctx = next;
12750 } else {
12751 throw this.error(new TomlError("Can't redefine an existing key"));
12752 }
12753 return this.next(this.parseListEnd);
12754 } else if (this.char === CHAR_PERIOD) {
12755 if (!hasKey(this.ctx, keyword)) {
12756 this.ctx = this.ctx[keyword] = Table();
12757 } else if (isInlineList(this.ctx[keyword])) {
12758 throw this.error(new TomlError("Can't extend an inline array"));
12759 } else if (isInlineTable(this.ctx[keyword])) {
12760 throw this.error(new TomlError("Can't extend an inline table"));
12761 } else if (isList(this.ctx[keyword])) {
12762 this.ctx = this.ctx[keyword][this.ctx[keyword].length - 1];
12763 } else if (isTable(this.ctx[keyword])) {
12764 this.ctx = this.ctx[keyword];
12765 } else {
12766 throw this.error(new TomlError("Can't redefine an existing key"));
12767 }
12768 return this.next(this.parseListNext);
12769 } else {
12770 throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"));
12771 }
12772 }
12773 parseListEnd(keyword) {
12774 if (this.char === CHAR_RSQB) {
12775 return this.next(this.parseWhitespaceToEOL);
12776 } else {
12777 throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"));
12778 }
12779 }
12780 /* VALUE string, number, boolean, inline list, inline object */
12781 parseValue() {
12782 if (this.char === Parser.END) {
12783 throw this.error(new TomlError("Key without value"));
12784 } else if (this.char === CHAR_QUOT) {
12785 return this.next(this.parseDoubleString);
12786 }
12787 if (this.char === CHAR_APOS) {
12788 return this.next(this.parseSingleString);
12789 } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {
12790 return this.goto(this.parseNumberSign);
12791 } else if (this.char === CHAR_i) {
12792 return this.next(this.parseInf);
12793 } else if (this.char === CHAR_n) {
12794 return this.next(this.parseNan);
12795 } else if (isDigit(this.char)) {
12796 return this.goto(this.parseNumberOrDateTime);
12797 } else if (this.char === CHAR_t || this.char === CHAR_f) {
12798 return this.goto(this.parseBoolean);
12799 } else if (this.char === CHAR_LSQB) {
12800 return this.call(this.parseInlineList, this.recordValue);
12801 } else if (this.char === CHAR_LCUB) {
12802 return this.call(this.parseInlineTable, this.recordValue);
12803 } else {
12804 throw this.error(new TomlError("Unexpected character, expecting string, number, datetime, boolean, inline array or inline table"));
12805 }
12806 }
12807 recordValue(value) {
12808 return this.returnNow(value);
12809 }
12810 parseInf() {
12811 if (this.char === CHAR_n) {
12812 return this.next(this.parseInf2);
12813 } else {
12814 throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'));
12815 }
12816 }
12817 parseInf2() {
12818 if (this.char === CHAR_f) {
12819 if (this.state.buf === "-") {
12820 return this.return(-Infinity);
12821 } else {
12822 return this.return(Infinity);
12823 }
12824 } else {
12825 throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'));
12826 }
12827 }
12828 parseNan() {
12829 if (this.char === CHAR_a) {
12830 return this.next(this.parseNan2);
12831 } else {
12832 throw this.error(new TomlError('Unexpected character, expected "nan"'));
12833 }
12834 }
12835 parseNan2() {
12836 if (this.char === CHAR_n) {
12837 return this.return(NaN);
12838 } else {
12839 throw this.error(new TomlError('Unexpected character, expected "nan"'));
12840 }
12841 }
12842 /* KEYS, barewords or basic, literal, or dotted */
12843 parseKeyword() {
12844 if (this.char === CHAR_QUOT) {
12845 return this.next(this.parseBasicString);
12846 } else if (this.char === CHAR_APOS) {
12847 return this.next(this.parseLiteralString);
12848 } else {
12849 return this.goto(this.parseBareKey);
12850 }
12851 }
12852 /* KEYS: barewords */
12853 parseBareKey() {
12854 do {
12855 if (this.char === Parser.END) {
12856 throw this.error(new TomlError("Key ended without value"));
12857 } else if (isAlphaNumHyphen(this.char)) {
12858 this.consume();
12859 } else if (this.state.buf.length === 0) {
12860 throw this.error(new TomlError("Empty bare keys are not allowed"));
12861 } else {
12862 return this.returnNow();
12863 }
12864 } while (this.nextChar());
12865 }
12866 /* STRINGS, single quoted (literal) */
12867 parseSingleString() {
12868 if (this.char === CHAR_APOS) {
12869 return this.next(this.parseLiteralMultiStringMaybe);
12870 } else {
12871 return this.goto(this.parseLiteralString);
12872 }
12873 }
12874 parseLiteralString() {
12875 do {
12876 if (this.char === CHAR_APOS) {
12877 return this.return();
12878 } else if (this.atEndOfLine()) {
12879 throw this.error(new TomlError("Unterminated string"));
12880 } else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I) {
12881 throw this.errorControlCharInString();
12882 } else {
12883 this.consume();
12884 }
12885 } while (this.nextChar());
12886 }
12887 parseLiteralMultiStringMaybe() {
12888 if (this.char === CHAR_APOS) {
12889 return this.next(this.parseLiteralMultiString);
12890 } else {
12891 return this.returnNow();
12892 }
12893 }
12894 parseLiteralMultiString() {
12895 if (this.char === CTRL_M) {
12896 return null;
12897 } else if (this.char === CTRL_J) {
12898 return this.next(this.parseLiteralMultiStringContent);
12899 } else {
12900 return this.goto(this.parseLiteralMultiStringContent);
12901 }
12902 }
12903 parseLiteralMultiStringContent() {
12904 do {
12905 if (this.char === CHAR_APOS) {
12906 return this.next(this.parseLiteralMultiEnd);
12907 } else if (this.char === Parser.END) {
12908 throw this.error(new TomlError("Unterminated multi-line string"));
12909 } else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I && this.char !== CTRL_J && this.char !== CTRL_M) {
12910 throw this.errorControlCharInString();
12911 } else {
12912 this.consume();
12913 }
12914 } while (this.nextChar());
12915 }
12916 parseLiteralMultiEnd() {
12917 if (this.char === CHAR_APOS) {
12918 return this.next(this.parseLiteralMultiEnd2);
12919 } else {
12920 this.state.buf += "'";
12921 return this.goto(this.parseLiteralMultiStringContent);
12922 }
12923 }
12924 parseLiteralMultiEnd2() {
12925 if (this.char === CHAR_APOS) {
12926 return this.return();
12927 } else {
12928 this.state.buf += "''";
12929 return this.goto(this.parseLiteralMultiStringContent);
12930 }
12931 }
12932 /* STRINGS double quoted */
12933 parseDoubleString() {
12934 if (this.char === CHAR_QUOT) {
12935 return this.next(this.parseMultiStringMaybe);
12936 } else {
12937 return this.goto(this.parseBasicString);
12938 }
12939 }
12940 parseBasicString() {
12941 do {
12942 if (this.char === CHAR_BSOL) {
12943 return this.call(this.parseEscape, this.recordEscapeReplacement);
12944 } else if (this.char === CHAR_QUOT) {
12945 return this.return();
12946 } else if (this.atEndOfLine()) {
12947 throw this.error(new TomlError("Unterminated string"));
12948 } else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I) {
12949 throw this.errorControlCharInString();
12950 } else {
12951 this.consume();
12952 }
12953 } while (this.nextChar());
12954 }
12955 recordEscapeReplacement(replacement) {
12956 this.state.buf += replacement;
12957 return this.goto(this.parseBasicString);
12958 }
12959 parseMultiStringMaybe() {
12960 if (this.char === CHAR_QUOT) {
12961 return this.next(this.parseMultiString);
12962 } else {
12963 return this.returnNow();
12964 }
12965 }
12966 parseMultiString() {
12967 if (this.char === CTRL_M) {
12968 return null;
12969 } else if (this.char === CTRL_J) {
12970 return this.next(this.parseMultiStringContent);
12971 } else {
12972 return this.goto(this.parseMultiStringContent);
12973 }
12974 }
12975 parseMultiStringContent() {
12976 do {
12977 if (this.char === CHAR_BSOL) {
12978 return this.call(this.parseMultiEscape, this.recordMultiEscapeReplacement);
12979 } else if (this.char === CHAR_QUOT) {
12980 return this.next(this.parseMultiEnd);
12981 } else if (this.char === Parser.END) {
12982 throw this.error(new TomlError("Unterminated multi-line string"));
12983 } else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I && this.char !== CTRL_J && this.char !== CTRL_M) {
12984 throw this.errorControlCharInString();
12985 } else {
12986 this.consume();
12987 }
12988 } while (this.nextChar());
12989 }
12990 errorControlCharInString() {
12991 let displayCode = "\\u00";
12992 if (this.char < 16) {
12993 displayCode += "0";
12994 }
12995 displayCode += this.char.toString(16);
12996 return this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in strings, use ${displayCode} instead`));
12997 }
12998 recordMultiEscapeReplacement(replacement) {
12999 this.state.buf += replacement;
13000 return this.goto(this.parseMultiStringContent);
13001 }
13002 parseMultiEnd() {
13003 if (this.char === CHAR_QUOT) {
13004 return this.next(this.parseMultiEnd2);
13005 } else {
13006 this.state.buf += '"';
13007 return this.goto(this.parseMultiStringContent);
13008 }
13009 }
13010 parseMultiEnd2() {
13011 if (this.char === CHAR_QUOT) {
13012 return this.return();
13013 } else {
13014 this.state.buf += '""';
13015 return this.goto(this.parseMultiStringContent);
13016 }
13017 }
13018 parseMultiEscape() {
13019 if (this.char === CTRL_M || this.char === CTRL_J) {
13020 return this.next(this.parseMultiTrim);
13021 } else if (this.char === CHAR_SP || this.char === CTRL_I) {
13022 return this.next(this.parsePreMultiTrim);
13023 } else {
13024 return this.goto(this.parseEscape);
13025 }
13026 }
13027 parsePreMultiTrim() {
13028 if (this.char === CHAR_SP || this.char === CTRL_I) {
13029 return null;
13030 } else if (this.char === CTRL_M || this.char === CTRL_J) {
13031 return this.next(this.parseMultiTrim);
13032 } else {
13033 throw this.error(new TomlError("Can't escape whitespace"));
13034 }
13035 }
13036 parseMultiTrim() {
13037 if (this.char === CTRL_J || this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {
13038 return null;
13039 } else {
13040 return this.returnNow();
13041 }
13042 }
13043 parseEscape() {
13044 if (this.char in escapes) {
13045 return this.return(escapes[this.char]);
13046 } else if (this.char === CHAR_u) {
13047 return this.call(this.parseSmallUnicode, this.parseUnicodeReturn);
13048 } else if (this.char === CHAR_U) {
13049 return this.call(this.parseLargeUnicode, this.parseUnicodeReturn);
13050 } else {
13051 throw this.error(new TomlError("Unknown escape character: " + this.char));
13052 }
13053 }
13054 parseUnicodeReturn(char) {
13055 try {
13056 const codePoint = parseInt(char, 16);
13057 if (codePoint >= SURROGATE_FIRST && codePoint <= SURROGATE_LAST) {
13058 throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));
13059 }
13060 return this.returnNow(String.fromCodePoint(codePoint));
13061 } catch (err) {
13062 throw this.error(TomlError.wrap(err));
13063 }
13064 }
13065 parseSmallUnicode() {
13066 if (!isHexit(this.char)) {
13067 throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"));
13068 } else {
13069 this.consume();
13070 if (this.state.buf.length >= 4)
13071 return this.return();
13072 }
13073 }
13074 parseLargeUnicode() {
13075 if (!isHexit(this.char)) {
13076 throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"));
13077 } else {
13078 this.consume();
13079 if (this.state.buf.length >= 8)
13080 return this.return();
13081 }
13082 }
13083 /* NUMBERS */
13084 parseNumberSign() {
13085 this.consume();
13086 return this.next(this.parseMaybeSignedInfOrNan);
13087 }
13088 parseMaybeSignedInfOrNan() {
13089 if (this.char === CHAR_i) {
13090 return this.next(this.parseInf);
13091 } else if (this.char === CHAR_n) {
13092 return this.next(this.parseNan);
13093 } else {
13094 return this.callNow(this.parseNoUnder, this.parseNumberIntegerStart);
13095 }
13096 }
13097 parseNumberIntegerStart() {
13098 if (this.char === CHAR_0) {
13099 this.consume();
13100 return this.next(this.parseNumberIntegerExponentOrDecimal);
13101 } else {
13102 return this.goto(this.parseNumberInteger);
13103 }
13104 }
13105 parseNumberIntegerExponentOrDecimal() {
13106 if (this.char === CHAR_PERIOD) {
13107 this.consume();
13108 return this.call(this.parseNoUnder, this.parseNumberFloat);
13109 } else if (this.char === CHAR_E || this.char === CHAR_e) {
13110 this.consume();
13111 return this.next(this.parseNumberExponentSign);
13112 } else {
13113 return this.returnNow(Integer(this.state.buf));
13114 }
13115 }
13116 parseNumberInteger() {
13117 if (isDigit(this.char)) {
13118 this.consume();
13119 } else if (this.char === CHAR_LOWBAR) {
13120 return this.call(this.parseNoUnder);
13121 } else if (this.char === CHAR_E || this.char === CHAR_e) {
13122 this.consume();
13123 return this.next(this.parseNumberExponentSign);
13124 } else if (this.char === CHAR_PERIOD) {
13125 this.consume();
13126 return this.call(this.parseNoUnder, this.parseNumberFloat);
13127 } else {
13128 const result = Integer(this.state.buf);
13129 if (result.isNaN()) {
13130 throw this.error(new TomlError("Invalid number"));
13131 } else {
13132 return this.returnNow(result);
13133 }
13134 }
13135 }
13136 parseNoUnder() {
13137 if (this.char === CHAR_LOWBAR || this.char === CHAR_PERIOD || this.char === CHAR_E || this.char === CHAR_e) {
13138 throw this.error(new TomlError("Unexpected character, expected digit"));
13139 } else if (this.atEndOfWord()) {
13140 throw this.error(new TomlError("Incomplete number"));
13141 }
13142 return this.returnNow();
13143 }
13144 parseNoUnderHexOctBinLiteral() {
13145 if (this.char === CHAR_LOWBAR || this.char === CHAR_PERIOD) {
13146 throw this.error(new TomlError("Unexpected character, expected digit"));
13147 } else if (this.atEndOfWord()) {
13148 throw this.error(new TomlError("Incomplete number"));
13149 }
13150 return this.returnNow();
13151 }
13152 parseNumberFloat() {
13153 if (this.char === CHAR_LOWBAR) {
13154 return this.call(this.parseNoUnder, this.parseNumberFloat);
13155 } else if (isDigit(this.char)) {
13156 this.consume();
13157 } else if (this.char === CHAR_E || this.char === CHAR_e) {
13158 this.consume();
13159 return this.next(this.parseNumberExponentSign);
13160 } else {
13161 return this.returnNow(Float(this.state.buf));
13162 }
13163 }
13164 parseNumberExponentSign() {
13165 if (isDigit(this.char)) {
13166 return this.goto(this.parseNumberExponent);
13167 } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {
13168 this.consume();
13169 this.call(this.parseNoUnder, this.parseNumberExponent);
13170 } else {
13171 throw this.error(new TomlError("Unexpected character, expected -, + or digit"));
13172 }
13173 }
13174 parseNumberExponent() {
13175 if (isDigit(this.char)) {
13176 this.consume();
13177 } else if (this.char === CHAR_LOWBAR) {
13178 return this.call(this.parseNoUnder);
13179 } else {
13180 return this.returnNow(Float(this.state.buf));
13181 }
13182 }
13183 /* NUMBERS or DATETIMES */
13184 parseNumberOrDateTime() {
13185 if (this.char === CHAR_0) {
13186 this.consume();
13187 return this.next(this.parseNumberBaseOrDateTime);
13188 } else {
13189 return this.goto(this.parseNumberOrDateTimeOnly);
13190 }
13191 }
13192 parseNumberOrDateTimeOnly() {
13193 if (this.char === CHAR_LOWBAR) {
13194 return this.call(this.parseNoUnder, this.parseNumberInteger);
13195 } else if (isDigit(this.char)) {
13196 this.consume();
13197 if (this.state.buf.length > 4)
13198 this.next(this.parseNumberInteger);
13199 } else if (this.char === CHAR_E || this.char === CHAR_e) {
13200 this.consume();
13201 return this.next(this.parseNumberExponentSign);
13202 } else if (this.char === CHAR_PERIOD) {
13203 this.consume();
13204 return this.call(this.parseNoUnder, this.parseNumberFloat);
13205 } else if (this.char === CHAR_HYPHEN) {
13206 return this.goto(this.parseDateTime);
13207 } else if (this.char === CHAR_COLON) {
13208 return this.goto(this.parseOnlyTimeHour);
13209 } else {
13210 return this.returnNow(Integer(this.state.buf));
13211 }
13212 }
13213 parseDateTimeOnly() {
13214 if (this.state.buf.length < 4) {
13215 if (isDigit(this.char)) {
13216 return this.consume();
13217 } else if (this.char === CHAR_COLON) {
13218 return this.goto(this.parseOnlyTimeHour);
13219 } else {
13220 throw this.error(new TomlError("Expected digit while parsing year part of a date"));
13221 }
13222 } else {
13223 if (this.char === CHAR_HYPHEN) {
13224 return this.goto(this.parseDateTime);
13225 } else {
13226 throw this.error(new TomlError("Expected hyphen (-) while parsing year part of date"));
13227 }
13228 }
13229 }
13230 parseNumberBaseOrDateTime() {
13231 if (this.char === CHAR_b) {
13232 this.consume();
13233 return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerBin);
13234 } else if (this.char === CHAR_o) {
13235 this.consume();
13236 return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerOct);
13237 } else if (this.char === CHAR_x) {
13238 this.consume();
13239 return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerHex);
13240 } else if (this.char === CHAR_PERIOD) {
13241 return this.goto(this.parseNumberInteger);
13242 } else if (isDigit(this.char)) {
13243 return this.goto(this.parseDateTimeOnly);
13244 } else {
13245 return this.returnNow(Integer(this.state.buf));
13246 }
13247 }
13248 parseIntegerHex() {
13249 if (isHexit(this.char)) {
13250 this.consume();
13251 } else if (this.char === CHAR_LOWBAR) {
13252 return this.call(this.parseNoUnderHexOctBinLiteral);
13253 } else {
13254 const result = Integer(this.state.buf);
13255 if (result.isNaN()) {
13256 throw this.error(new TomlError("Invalid number"));
13257 } else {
13258 return this.returnNow(result);
13259 }
13260 }
13261 }
13262 parseIntegerOct() {
13263 if (isOctit(this.char)) {
13264 this.consume();
13265 } else if (this.char === CHAR_LOWBAR) {
13266 return this.call(this.parseNoUnderHexOctBinLiteral);
13267 } else {
13268 const result = Integer(this.state.buf);
13269 if (result.isNaN()) {
13270 throw this.error(new TomlError("Invalid number"));
13271 } else {
13272 return this.returnNow(result);
13273 }
13274 }
13275 }
13276 parseIntegerBin() {
13277 if (isBit(this.char)) {
13278 this.consume();
13279 } else if (this.char === CHAR_LOWBAR) {
13280 return this.call(this.parseNoUnderHexOctBinLiteral);
13281 } else {
13282 const result = Integer(this.state.buf);
13283 if (result.isNaN()) {
13284 throw this.error(new TomlError("Invalid number"));
13285 } else {
13286 return this.returnNow(result);
13287 }
13288 }
13289 }
13290 /* DATETIME */
13291 parseDateTime() {
13292 if (this.state.buf.length < 4) {
13293 throw this.error(new TomlError("Years less than 1000 must be zero padded to four characters"));
13294 }
13295 this.state.result = this.state.buf;
13296 this.state.buf = "";
13297 return this.next(this.parseDateMonth);
13298 }
13299 parseDateMonth() {
13300 if (this.char === CHAR_HYPHEN) {
13301 if (this.state.buf.length < 2) {
13302 throw this.error(new TomlError("Months less than 10 must be zero padded to two characters"));
13303 }
13304 this.state.result += "-" + this.state.buf;
13305 this.state.buf = "";
13306 return this.next(this.parseDateDay);
13307 } else if (isDigit(this.char)) {
13308 this.consume();
13309 } else {
13310 throw this.error(new TomlError("Incomplete datetime"));
13311 }
13312 }
13313 parseDateDay() {
13314 if (this.char === CHAR_T || this.char === CHAR_SP) {
13315 if (this.state.buf.length < 2) {
13316 throw this.error(new TomlError("Days less than 10 must be zero padded to two characters"));
13317 }
13318 this.state.result += "-" + this.state.buf;
13319 this.state.buf = "";
13320 return this.next(this.parseStartTimeHour);
13321 } else if (this.atEndOfWord()) {
13322 return this.returnNow(createDate(this.state.result + "-" + this.state.buf));
13323 } else if (isDigit(this.char)) {
13324 this.consume();
13325 } else {
13326 throw this.error(new TomlError("Incomplete datetime"));
13327 }
13328 }
13329 parseStartTimeHour() {
13330 if (this.atEndOfWord()) {
13331 return this.returnNow(createDate(this.state.result));
13332 } else {
13333 return this.goto(this.parseTimeHour);
13334 }
13335 }
13336 parseTimeHour() {
13337 if (this.char === CHAR_COLON) {
13338 if (this.state.buf.length < 2) {
13339 throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));
13340 }
13341 this.state.result += "T" + this.state.buf;
13342 this.state.buf = "";
13343 return this.next(this.parseTimeMin);
13344 } else if (isDigit(this.char)) {
13345 this.consume();
13346 } else {
13347 throw this.error(new TomlError("Incomplete datetime"));
13348 }
13349 }
13350 parseTimeMin() {
13351 if (this.state.buf.length < 2 && isDigit(this.char)) {
13352 this.consume();
13353 } else if (this.state.buf.length === 2 && this.char === CHAR_COLON) {
13354 this.state.result += ":" + this.state.buf;
13355 this.state.buf = "";
13356 return this.next(this.parseTimeSec);
13357 } else {
13358 throw this.error(new TomlError("Incomplete datetime"));
13359 }
13360 }
13361 parseTimeSec() {
13362 if (isDigit(this.char)) {
13363 this.consume();
13364 if (this.state.buf.length === 2) {
13365 this.state.result += ":" + this.state.buf;
13366 this.state.buf = "";
13367 return this.next(this.parseTimeZoneOrFraction);
13368 }
13369 } else {
13370 throw this.error(new TomlError("Incomplete datetime"));
13371 }
13372 }
13373 parseOnlyTimeHour() {
13374 if (this.char === CHAR_COLON) {
13375 if (this.state.buf.length < 2) {
13376 throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));
13377 }
13378 this.state.result = this.state.buf;
13379 this.state.buf = "";
13380 return this.next(this.parseOnlyTimeMin);
13381 } else {
13382 throw this.error(new TomlError("Incomplete time"));
13383 }
13384 }
13385 parseOnlyTimeMin() {
13386 if (this.state.buf.length < 2 && isDigit(this.char)) {
13387 this.consume();
13388 } else if (this.state.buf.length === 2 && this.char === CHAR_COLON) {
13389 this.state.result += ":" + this.state.buf;
13390 this.state.buf = "";
13391 return this.next(this.parseOnlyTimeSec);
13392 } else {
13393 throw this.error(new TomlError("Incomplete time"));
13394 }
13395 }
13396 parseOnlyTimeSec() {
13397 if (isDigit(this.char)) {
13398 this.consume();
13399 if (this.state.buf.length === 2) {
13400 return this.next(this.parseOnlyTimeFractionMaybe);
13401 }
13402 } else {
13403 throw this.error(new TomlError("Incomplete time"));
13404 }
13405 }
13406 parseOnlyTimeFractionMaybe() {
13407 this.state.result += ":" + this.state.buf;
13408 if (this.char === CHAR_PERIOD) {
13409 this.state.buf = "";
13410 this.next(this.parseOnlyTimeFraction);
13411 } else {
13412 return this.return(createTime(this.state.result));
13413 }
13414 }
13415 parseOnlyTimeFraction() {
13416 if (isDigit(this.char)) {
13417 this.consume();
13418 } else if (this.atEndOfWord()) {
13419 if (this.state.buf.length === 0)
13420 throw this.error(new TomlError("Expected digit in milliseconds"));
13421 return this.returnNow(createTime(this.state.result + "." + this.state.buf));
13422 } else {
13423 throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"));
13424 }
13425 }
13426 parseTimeZoneOrFraction() {
13427 if (this.char === CHAR_PERIOD) {
13428 this.consume();
13429 this.next(this.parseDateTimeFraction);
13430 } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {
13431 this.consume();
13432 this.next(this.parseTimeZoneHour);
13433 } else if (this.char === CHAR_Z) {
13434 this.consume();
13435 return this.return(createDateTime(this.state.result + this.state.buf));
13436 } else if (this.atEndOfWord()) {
13437 return this.returnNow(createDateTimeFloat(this.state.result + this.state.buf));
13438 } else {
13439 throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"));
13440 }
13441 }
13442 parseDateTimeFraction() {
13443 if (isDigit(this.char)) {
13444 this.consume();
13445 } else if (this.state.buf.length === 1) {
13446 throw this.error(new TomlError("Expected digit in milliseconds"));
13447 } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {
13448 this.consume();
13449 this.next(this.parseTimeZoneHour);
13450 } else if (this.char === CHAR_Z) {
13451 this.consume();
13452 return this.return(createDateTime(this.state.result + this.state.buf));
13453 } else if (this.atEndOfWord()) {
13454 return this.returnNow(createDateTimeFloat(this.state.result + this.state.buf));
13455 } else {
13456 throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"));
13457 }
13458 }
13459 parseTimeZoneHour() {
13460 if (isDigit(this.char)) {
13461 this.consume();
13462 if (/\d\d$/.test(this.state.buf))
13463 return this.next(this.parseTimeZoneSep);
13464 } else {
13465 throw this.error(new TomlError("Unexpected character in datetime, expected digit"));
13466 }
13467 }
13468 parseTimeZoneSep() {
13469 if (this.char === CHAR_COLON) {
13470 this.consume();
13471 this.next(this.parseTimeZoneMin);
13472 } else {
13473 throw this.error(new TomlError("Unexpected character in datetime, expected colon"));
13474 }
13475 }
13476 parseTimeZoneMin() {
13477 if (isDigit(this.char)) {
13478 this.consume();
13479 if (/\d\d$/.test(this.state.buf))
13480 return this.return(createDateTime(this.state.result + this.state.buf));
13481 } else {
13482 throw this.error(new TomlError("Unexpected character in datetime, expected digit"));
13483 }
13484 }
13485 /* BOOLEAN */
13486 parseBoolean() {
13487 if (this.char === CHAR_t) {
13488 this.consume();
13489 return this.next(this.parseTrue_r);
13490 } else if (this.char === CHAR_f) {
13491 this.consume();
13492 return this.next(this.parseFalse_a);
13493 }
13494 }
13495 parseTrue_r() {
13496 if (this.char === CHAR_r) {
13497 this.consume();
13498 return this.next(this.parseTrue_u);
13499 } else {
13500 throw this.error(new TomlError("Invalid boolean, expected true or false"));
13501 }
13502 }
13503 parseTrue_u() {
13504 if (this.char === CHAR_u) {
13505 this.consume();
13506 return this.next(this.parseTrue_e);
13507 } else {
13508 throw this.error(new TomlError("Invalid boolean, expected true or false"));
13509 }
13510 }
13511 parseTrue_e() {
13512 if (this.char === CHAR_e) {
13513 return this.return(true);
13514 } else {
13515 throw this.error(new TomlError("Invalid boolean, expected true or false"));
13516 }
13517 }
13518 parseFalse_a() {
13519 if (this.char === CHAR_a) {
13520 this.consume();
13521 return this.next(this.parseFalse_l);
13522 } else {
13523 throw this.error(new TomlError("Invalid boolean, expected true or false"));
13524 }
13525 }
13526 parseFalse_l() {
13527 if (this.char === CHAR_l) {
13528 this.consume();
13529 return this.next(this.parseFalse_s);
13530 } else {
13531 throw this.error(new TomlError("Invalid boolean, expected true or false"));
13532 }
13533 }
13534 parseFalse_s() {
13535 if (this.char === CHAR_s) {
13536 this.consume();
13537 return this.next(this.parseFalse_e);
13538 } else {
13539 throw this.error(new TomlError("Invalid boolean, expected true or false"));
13540 }
13541 }
13542 parseFalse_e() {
13543 if (this.char === CHAR_e) {
13544 return this.return(false);
13545 } else {
13546 throw this.error(new TomlError("Invalid boolean, expected true or false"));
13547 }
13548 }
13549 /* INLINE LISTS */
13550 parseInlineList() {
13551 if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M || this.char === CTRL_J) {
13552 return null;
13553 } else if (this.char === Parser.END) {
13554 throw this.error(new TomlError("Unterminated inline array"));
13555 } else if (this.char === CHAR_NUM) {
13556 return this.call(this.parseComment);
13557 } else if (this.char === CHAR_RSQB) {
13558 return this.return(this.state.resultArr || InlineList());
13559 } else {
13560 return this.callNow(this.parseValue, this.recordInlineListValue);
13561 }
13562 }
13563 recordInlineListValue(value) {
13564 if (this.state.resultArr) {
13565 const listType = this.state.resultArr[_contentType];
13566 const valueType = tomlType(value);
13567 if (listType !== valueType) {
13568 throw this.error(new TomlError(`Inline lists must be a single type, not a mix of ${listType} and ${valueType}`));
13569 }
13570 } else {
13571 this.state.resultArr = InlineList(tomlType(value));
13572 }
13573 if (isFloat(value) || isInteger(value)) {
13574 this.state.resultArr.push(value.valueOf());
13575 } else {
13576 this.state.resultArr.push(value);
13577 }
13578 return this.goto(this.parseInlineListNext);
13579 }
13580 parseInlineListNext() {
13581 if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M || this.char === CTRL_J) {
13582 return null;
13583 } else if (this.char === CHAR_NUM) {
13584 return this.call(this.parseComment);
13585 } else if (this.char === CHAR_COMMA) {
13586 return this.next(this.parseInlineList);
13587 } else if (this.char === CHAR_RSQB) {
13588 return this.goto(this.parseInlineList);
13589 } else {
13590 throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"));
13591 }
13592 }
13593 /* INLINE TABLE */
13594 parseInlineTable() {
13595 if (this.char === CHAR_SP || this.char === CTRL_I) {
13596 return null;
13597 } else if (this.char === Parser.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) {
13598 throw this.error(new TomlError("Unterminated inline array"));
13599 } else if (this.char === CHAR_RCUB) {
13600 return this.return(this.state.resultTable || InlineTable());
13601 } else {
13602 if (!this.state.resultTable)
13603 this.state.resultTable = InlineTable();
13604 return this.callNow(this.parseAssign, this.recordInlineTableValue);
13605 }
13606 }
13607 recordInlineTableValue(kv) {
13608 let target = this.state.resultTable;
13609 let finalKey = kv.key.pop();
13610 for (let kw of kv.key) {
13611 if (hasKey(target, kw) && (!isTable(target[kw]) || target[kw][_declared])) {
13612 throw this.error(new TomlError("Can't redefine existing key"));
13613 }
13614 target = target[kw] = target[kw] || Table();
13615 }
13616 if (hasKey(target, finalKey)) {
13617 throw this.error(new TomlError("Can't redefine existing key"));
13618 }
13619 if (isInteger(kv.value) || isFloat(kv.value)) {
13620 target[finalKey] = kv.value.valueOf();
13621 } else {
13622 target[finalKey] = kv.value;
13623 }
13624 return this.goto(this.parseInlineTableNext);
13625 }
13626 parseInlineTableNext() {
13627 if (this.char === CHAR_SP || this.char === CTRL_I) {
13628 return null;
13629 } else if (this.char === Parser.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) {
13630 throw this.error(new TomlError("Unterminated inline array"));
13631 } else if (this.char === CHAR_COMMA) {
13632 return this.next(this.parseInlineTable);
13633 } else if (this.char === CHAR_RCUB) {
13634 return this.goto(this.parseInlineTable);
13635 } else {
13636 throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"));
13637 }
13638 }
13639 }
13640 return TOMLParser;
13641 }
13642 }
13643});
13644
13645// node_modules/@iarna/toml/parse-pretty-error.js
13646var require_parse_pretty_error = __commonJS({
13647 "node_modules/@iarna/toml/parse-pretty-error.js"(exports, module) {
13648 "use strict";
13649 module.exports = prettyError;
13650 function prettyError(err, buf) {
13651 if (err.pos == null || err.line == null)
13652 return err;
13653 let msg = err.message;
13654 msg += ` at row ${err.line + 1}, col ${err.col + 1}, pos ${err.pos}:
13655`;
13656 if (buf && buf.split) {
13657 const lines = buf.split(/\n/);
13658 const lineNumWidth = String(Math.min(lines.length, err.line + 3)).length;
13659 let linePadding = " ";
13660 while (linePadding.length < lineNumWidth)
13661 linePadding += " ";
13662 for (let ii = Math.max(0, err.line - 1); ii < Math.min(lines.length, err.line + 2); ++ii) {
13663 let lineNum = String(ii + 1);
13664 if (lineNum.length < lineNumWidth)
13665 lineNum = " " + lineNum;
13666 if (err.line === ii) {
13667 msg += lineNum + "> " + lines[ii] + "\n";
13668 msg += linePadding + " ";
13669 for (let hh = 0; hh < err.col; ++hh) {
13670 msg += " ";
13671 }
13672 msg += "^\n";
13673 } else {
13674 msg += lineNum + ": " + lines[ii] + "\n";
13675 }
13676 }
13677 }
13678 err.message = msg + "\n";
13679 return err;
13680 }
13681 }
13682});
13683
13684// node_modules/@iarna/toml/parse-async.js
13685var require_parse_async = __commonJS({
13686 "node_modules/@iarna/toml/parse-async.js"(exports, module) {
13687 "use strict";
13688 module.exports = parseAsync;
13689 var TOMLParser = require_toml_parser();
13690 var prettyError = require_parse_pretty_error();
13691 function parseAsync(str, opts) {
13692 if (!opts)
13693 opts = {};
13694 const index = 0;
13695 const blocksize = opts.blocksize || 40960;
13696 const parser = new TOMLParser();
13697 return new Promise((resolve2, reject) => {
13698 setImmediate(parseAsyncNext, index, blocksize, resolve2, reject);
13699 });
13700 function parseAsyncNext(index2, blocksize2, resolve2, reject) {
13701 if (index2 >= str.length) {
13702 try {
13703 return resolve2(parser.finish());
13704 } catch (err) {
13705 return reject(prettyError(err, str));
13706 }
13707 }
13708 try {
13709 parser.parse(str.slice(index2, index2 + blocksize2));
13710 setImmediate(parseAsyncNext, index2 + blocksize2, blocksize2, resolve2, reject);
13711 } catch (err) {
13712 reject(prettyError(err, str));
13713 }
13714 }
13715 }
13716 }
13717});
13718
13719// node_modules/json5/lib/unicode.js
13720var require_unicode = __commonJS({
13721 "node_modules/json5/lib/unicode.js"(exports, module) {
13722 module.exports.Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/;
13723 module.exports.ID_Start = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
13724 module.exports.ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/;
13725 }
13726});
13727
13728// node_modules/json5/lib/util.js
13729var require_util = __commonJS({
13730 "node_modules/json5/lib/util.js"(exports, module) {
13731 var unicode = require_unicode();
13732 module.exports = {
13733 isSpaceSeparator(c) {
13734 return typeof c === "string" && unicode.Space_Separator.test(c);
13735 },
13736 isIdStartChar(c) {
13737 return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c === "$" || c === "_" || unicode.ID_Start.test(c));
13738 },
13739 isIdContinueChar(c) {
13740 return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c >= "0" && c <= "9" || c === "$" || c === "_" || c === "\u200C" || c === "\u200D" || unicode.ID_Continue.test(c));
13741 },
13742 isDigit(c) {
13743 return typeof c === "string" && /[0-9]/.test(c);
13744 },
13745 isHexDigit(c) {
13746 return typeof c === "string" && /[0-9A-Fa-f]/.test(c);
13747 }
13748 };
13749 }
13750});
13751
13752// node_modules/json5/lib/parse.js
13753var require_parse3 = __commonJS({
13754 "node_modules/json5/lib/parse.js"(exports, module) {
13755 var util = require_util();
13756 var source;
13757 var parseState;
13758 var stack;
13759 var pos;
13760 var line2;
13761 var column;
13762 var token;
13763 var key;
13764 var root;
13765 module.exports = function parse3(text, reviver) {
13766 source = String(text);
13767 parseState = "start";
13768 stack = [];
13769 pos = 0;
13770 line2 = 1;
13771 column = 0;
13772 token = void 0;
13773 key = void 0;
13774 root = void 0;
13775 do {
13776 token = lex();
13777 parseStates[parseState]();
13778 } while (token.type !== "eof");
13779 if (typeof reviver === "function") {
13780 return internalize({ "": root }, "", reviver);
13781 }
13782 return root;
13783 };
13784 function internalize(holder, name, reviver) {
13785 const value = holder[name];
13786 if (value != null && typeof value === "object") {
13787 if (Array.isArray(value)) {
13788 for (let i = 0; i < value.length; i++) {
13789 const key2 = String(i);
13790 const replacement = internalize(value, key2, reviver);
13791 if (replacement === void 0) {
13792 delete value[key2];
13793 } else {
13794 Object.defineProperty(value, key2, {
13795 value: replacement,
13796 writable: true,
13797 enumerable: true,
13798 configurable: true
13799 });
13800 }
13801 }
13802 } else {
13803 for (const key2 in value) {
13804 const replacement = internalize(value, key2, reviver);
13805 if (replacement === void 0) {
13806 delete value[key2];
13807 } else {
13808 Object.defineProperty(value, key2, {
13809 value: replacement,
13810 writable: true,
13811 enumerable: true,
13812 configurable: true
13813 });
13814 }
13815 }
13816 }
13817 }
13818 return reviver.call(holder, name, value);
13819 }
13820 var lexState;
13821 var buffer;
13822 var doubleQuote;
13823 var sign;
13824 var c;
13825 function lex() {
13826 lexState = "default";
13827 buffer = "";
13828 doubleQuote = false;
13829 sign = 1;
13830 for (; ; ) {
13831 c = peek();
13832 const token2 = lexStates[lexState]();
13833 if (token2) {
13834 return token2;
13835 }
13836 }
13837 }
13838 function peek() {
13839 if (source[pos]) {
13840 return String.fromCodePoint(source.codePointAt(pos));
13841 }
13842 }
13843 function read2() {
13844 const c2 = peek();
13845 if (c2 === "\n") {
13846 line2++;
13847 column = 0;
13848 } else if (c2) {
13849 column += c2.length;
13850 } else {
13851 column++;
13852 }
13853 if (c2) {
13854 pos += c2.length;
13855 }
13856 return c2;
13857 }
13858 var lexStates = {
13859 default() {
13860 switch (c) {
13861 case " ":
13862 case "\v":
13863 case "\f":
13864 case " ":
13865 case "\xA0":
13866 case "\uFEFF":
13867 case "\n":
13868 case "\r":
13869 case "\u2028":
13870 case "\u2029":
13871 read2();
13872 return;
13873 case "/":
13874 read2();
13875 lexState = "comment";
13876 return;
13877 case void 0:
13878 read2();
13879 return newToken("eof");
13880 }
13881 if (util.isSpaceSeparator(c)) {
13882 read2();
13883 return;
13884 }
13885 return lexStates[parseState]();
13886 },
13887 comment() {
13888 switch (c) {
13889 case "*":
13890 read2();
13891 lexState = "multiLineComment";
13892 return;
13893 case "/":
13894 read2();
13895 lexState = "singleLineComment";
13896 return;
13897 }
13898 throw invalidChar(read2());
13899 },
13900 multiLineComment() {
13901 switch (c) {
13902 case "*":
13903 read2();
13904 lexState = "multiLineCommentAsterisk";
13905 return;
13906 case void 0:
13907 throw invalidChar(read2());
13908 }
13909 read2();
13910 },
13911 multiLineCommentAsterisk() {
13912 switch (c) {
13913 case "*":
13914 read2();
13915 return;
13916 case "/":
13917 read2();
13918 lexState = "default";
13919 return;
13920 case void 0:
13921 throw invalidChar(read2());
13922 }
13923 read2();
13924 lexState = "multiLineComment";
13925 },
13926 singleLineComment() {
13927 switch (c) {
13928 case "\n":
13929 case "\r":
13930 case "\u2028":
13931 case "\u2029":
13932 read2();
13933 lexState = "default";
13934 return;
13935 case void 0:
13936 read2();
13937 return newToken("eof");
13938 }
13939 read2();
13940 },
13941 value() {
13942 switch (c) {
13943 case "{":
13944 case "[":
13945 return newToken("punctuator", read2());
13946 case "n":
13947 read2();
13948 literal("ull");
13949 return newToken("null", null);
13950 case "t":
13951 read2();
13952 literal("rue");
13953 return newToken("boolean", true);
13954 case "f":
13955 read2();
13956 literal("alse");
13957 return newToken("boolean", false);
13958 case "-":
13959 case "+":
13960 if (read2() === "-") {
13961 sign = -1;
13962 }
13963 lexState = "sign";
13964 return;
13965 case ".":
13966 buffer = read2();
13967 lexState = "decimalPointLeading";
13968 return;
13969 case "0":
13970 buffer = read2();
13971 lexState = "zero";
13972 return;
13973 case "1":
13974 case "2":
13975 case "3":
13976 case "4":
13977 case "5":
13978 case "6":
13979 case "7":
13980 case "8":
13981 case "9":
13982 buffer = read2();
13983 lexState = "decimalInteger";
13984 return;
13985 case "I":
13986 read2();
13987 literal("nfinity");
13988 return newToken("numeric", Infinity);
13989 case "N":
13990 read2();
13991 literal("aN");
13992 return newToken("numeric", NaN);
13993 case '"':
13994 case "'":
13995 doubleQuote = read2() === '"';
13996 buffer = "";
13997 lexState = "string";
13998 return;
13999 }
14000 throw invalidChar(read2());
14001 },
14002 identifierNameStartEscape() {
14003 if (c !== "u") {
14004 throw invalidChar(read2());
14005 }
14006 read2();
14007 const u = unicodeEscape();
14008 switch (u) {
14009 case "$":
14010 case "_":
14011 break;
14012 default:
14013 if (!util.isIdStartChar(u)) {
14014 throw invalidIdentifier();
14015 }
14016 break;
14017 }
14018 buffer += u;
14019 lexState = "identifierName";
14020 },
14021 identifierName() {
14022 switch (c) {
14023 case "$":
14024 case "_":
14025 case "\u200C":
14026 case "\u200D":
14027 buffer += read2();
14028 return;
14029 case "\\":
14030 read2();
14031 lexState = "identifierNameEscape";
14032 return;
14033 }
14034 if (util.isIdContinueChar(c)) {
14035 buffer += read2();
14036 return;
14037 }
14038 return newToken("identifier", buffer);
14039 },
14040 identifierNameEscape() {
14041 if (c !== "u") {
14042 throw invalidChar(read2());
14043 }
14044 read2();
14045 const u = unicodeEscape();
14046 switch (u) {
14047 case "$":
14048 case "_":
14049 case "\u200C":
14050 case "\u200D":
14051 break;
14052 default:
14053 if (!util.isIdContinueChar(u)) {
14054 throw invalidIdentifier();
14055 }
14056 break;
14057 }
14058 buffer += u;
14059 lexState = "identifierName";
14060 },
14061 sign() {
14062 switch (c) {
14063 case ".":
14064 buffer = read2();
14065 lexState = "decimalPointLeading";
14066 return;
14067 case "0":
14068 buffer = read2();
14069 lexState = "zero";
14070 return;
14071 case "1":
14072 case "2":
14073 case "3":
14074 case "4":
14075 case "5":
14076 case "6":
14077 case "7":
14078 case "8":
14079 case "9":
14080 buffer = read2();
14081 lexState = "decimalInteger";
14082 return;
14083 case "I":
14084 read2();
14085 literal("nfinity");
14086 return newToken("numeric", sign * Infinity);
14087 case "N":
14088 read2();
14089 literal("aN");
14090 return newToken("numeric", NaN);
14091 }
14092 throw invalidChar(read2());
14093 },
14094 zero() {
14095 switch (c) {
14096 case ".":
14097 buffer += read2();
14098 lexState = "decimalPoint";
14099 return;
14100 case "e":
14101 case "E":
14102 buffer += read2();
14103 lexState = "decimalExponent";
14104 return;
14105 case "x":
14106 case "X":
14107 buffer += read2();
14108 lexState = "hexadecimal";
14109 return;
14110 }
14111 return newToken("numeric", sign * 0);
14112 },
14113 decimalInteger() {
14114 switch (c) {
14115 case ".":
14116 buffer += read2();
14117 lexState = "decimalPoint";
14118 return;
14119 case "e":
14120 case "E":
14121 buffer += read2();
14122 lexState = "decimalExponent";
14123 return;
14124 }
14125 if (util.isDigit(c)) {
14126 buffer += read2();
14127 return;
14128 }
14129 return newToken("numeric", sign * Number(buffer));
14130 },
14131 decimalPointLeading() {
14132 if (util.isDigit(c)) {
14133 buffer += read2();
14134 lexState = "decimalFraction";
14135 return;
14136 }
14137 throw invalidChar(read2());
14138 },
14139 decimalPoint() {
14140 switch (c) {
14141 case "e":
14142 case "E":
14143 buffer += read2();
14144 lexState = "decimalExponent";
14145 return;
14146 }
14147 if (util.isDigit(c)) {
14148 buffer += read2();
14149 lexState = "decimalFraction";
14150 return;
14151 }
14152 return newToken("numeric", sign * Number(buffer));
14153 },
14154 decimalFraction() {
14155 switch (c) {
14156 case "e":
14157 case "E":
14158 buffer += read2();
14159 lexState = "decimalExponent";
14160 return;
14161 }
14162 if (util.isDigit(c)) {
14163 buffer += read2();
14164 return;
14165 }
14166 return newToken("numeric", sign * Number(buffer));
14167 },
14168 decimalExponent() {
14169 switch (c) {
14170 case "+":
14171 case "-":
14172 buffer += read2();
14173 lexState = "decimalExponentSign";
14174 return;
14175 }
14176 if (util.isDigit(c)) {
14177 buffer += read2();
14178 lexState = "decimalExponentInteger";
14179 return;
14180 }
14181 throw invalidChar(read2());
14182 },
14183 decimalExponentSign() {
14184 if (util.isDigit(c)) {
14185 buffer += read2();
14186 lexState = "decimalExponentInteger";
14187 return;
14188 }
14189 throw invalidChar(read2());
14190 },
14191 decimalExponentInteger() {
14192 if (util.isDigit(c)) {
14193 buffer += read2();
14194 return;
14195 }
14196 return newToken("numeric", sign * Number(buffer));
14197 },
14198 hexadecimal() {
14199 if (util.isHexDigit(c)) {
14200 buffer += read2();
14201 lexState = "hexadecimalInteger";
14202 return;
14203 }
14204 throw invalidChar(read2());
14205 },
14206 hexadecimalInteger() {
14207 if (util.isHexDigit(c)) {
14208 buffer += read2();
14209 return;
14210 }
14211 return newToken("numeric", sign * Number(buffer));
14212 },
14213 string() {
14214 switch (c) {
14215 case "\\":
14216 read2();
14217 buffer += escape();
14218 return;
14219 case '"':
14220 if (doubleQuote) {
14221 read2();
14222 return newToken("string", buffer);
14223 }
14224 buffer += read2();
14225 return;
14226 case "'":
14227 if (!doubleQuote) {
14228 read2();
14229 return newToken("string", buffer);
14230 }
14231 buffer += read2();
14232 return;
14233 case "\n":
14234 case "\r":
14235 throw invalidChar(read2());
14236 case "\u2028":
14237 case "\u2029":
14238 separatorChar(c);
14239 break;
14240 case void 0:
14241 throw invalidChar(read2());
14242 }
14243 buffer += read2();
14244 },
14245 start() {
14246 switch (c) {
14247 case "{":
14248 case "[":
14249 return newToken("punctuator", read2());
14250 }
14251 lexState = "value";
14252 },
14253 beforePropertyName() {
14254 switch (c) {
14255 case "$":
14256 case "_":
14257 buffer = read2();
14258 lexState = "identifierName";
14259 return;
14260 case "\\":
14261 read2();
14262 lexState = "identifierNameStartEscape";
14263 return;
14264 case "}":
14265 return newToken("punctuator", read2());
14266 case '"':
14267 case "'":
14268 doubleQuote = read2() === '"';
14269 lexState = "string";
14270 return;
14271 }
14272 if (util.isIdStartChar(c)) {
14273 buffer += read2();
14274 lexState = "identifierName";
14275 return;
14276 }
14277 throw invalidChar(read2());
14278 },
14279 afterPropertyName() {
14280 if (c === ":") {
14281 return newToken("punctuator", read2());
14282 }
14283 throw invalidChar(read2());
14284 },
14285 beforePropertyValue() {
14286 lexState = "value";
14287 },
14288 afterPropertyValue() {
14289 switch (c) {
14290 case ",":
14291 case "}":
14292 return newToken("punctuator", read2());
14293 }
14294 throw invalidChar(read2());
14295 },
14296 beforeArrayValue() {
14297 if (c === "]") {
14298 return newToken("punctuator", read2());
14299 }
14300 lexState = "value";
14301 },
14302 afterArrayValue() {
14303 switch (c) {
14304 case ",":
14305 case "]":
14306 return newToken("punctuator", read2());
14307 }
14308 throw invalidChar(read2());
14309 },
14310 end() {
14311 throw invalidChar(read2());
14312 }
14313 };
14314 function newToken(type, value) {
14315 return {
14316 type,
14317 value,
14318 line: line2,
14319 column
14320 };
14321 }
14322 function literal(s) {
14323 for (const c2 of s) {
14324 const p = peek();
14325 if (p !== c2) {
14326 throw invalidChar(read2());
14327 }
14328 read2();
14329 }
14330 }
14331 function escape() {
14332 const c2 = peek();
14333 switch (c2) {
14334 case "b":
14335 read2();
14336 return "\b";
14337 case "f":
14338 read2();
14339 return "\f";
14340 case "n":
14341 read2();
14342 return "\n";
14343 case "r":
14344 read2();
14345 return "\r";
14346 case "t":
14347 read2();
14348 return " ";
14349 case "v":
14350 read2();
14351 return "\v";
14352 case "0":
14353 read2();
14354 if (util.isDigit(peek())) {
14355 throw invalidChar(read2());
14356 }
14357 return "\0";
14358 case "x":
14359 read2();
14360 return hexEscape();
14361 case "u":
14362 read2();
14363 return unicodeEscape();
14364 case "\n":
14365 case "\u2028":
14366 case "\u2029":
14367 read2();
14368 return "";
14369 case "\r":
14370 read2();
14371 if (peek() === "\n") {
14372 read2();
14373 }
14374 return "";
14375 case "1":
14376 case "2":
14377 case "3":
14378 case "4":
14379 case "5":
14380 case "6":
14381 case "7":
14382 case "8":
14383 case "9":
14384 throw invalidChar(read2());
14385 case void 0:
14386 throw invalidChar(read2());
14387 }
14388 return read2();
14389 }
14390 function hexEscape() {
14391 let buffer2 = "";
14392 let c2 = peek();
14393 if (!util.isHexDigit(c2)) {
14394 throw invalidChar(read2());
14395 }
14396 buffer2 += read2();
14397 c2 = peek();
14398 if (!util.isHexDigit(c2)) {
14399 throw invalidChar(read2());
14400 }
14401 buffer2 += read2();
14402 return String.fromCodePoint(parseInt(buffer2, 16));
14403 }
14404 function unicodeEscape() {
14405 let buffer2 = "";
14406 let count = 4;
14407 while (count-- > 0) {
14408 const c2 = peek();
14409 if (!util.isHexDigit(c2)) {
14410 throw invalidChar(read2());
14411 }
14412 buffer2 += read2();
14413 }
14414 return String.fromCodePoint(parseInt(buffer2, 16));
14415 }
14416 var parseStates = {
14417 start() {
14418 if (token.type === "eof") {
14419 throw invalidEOF();
14420 }
14421 push();
14422 },
14423 beforePropertyName() {
14424 switch (token.type) {
14425 case "identifier":
14426 case "string":
14427 key = token.value;
14428 parseState = "afterPropertyName";
14429 return;
14430 case "punctuator":
14431 pop();
14432 return;
14433 case "eof":
14434 throw invalidEOF();
14435 }
14436 },
14437 afterPropertyName() {
14438 if (token.type === "eof") {
14439 throw invalidEOF();
14440 }
14441 parseState = "beforePropertyValue";
14442 },
14443 beforePropertyValue() {
14444 if (token.type === "eof") {
14445 throw invalidEOF();
14446 }
14447 push();
14448 },
14449 beforeArrayValue() {
14450 if (token.type === "eof") {
14451 throw invalidEOF();
14452 }
14453 if (token.type === "punctuator" && token.value === "]") {
14454 pop();
14455 return;
14456 }
14457 push();
14458 },
14459 afterPropertyValue() {
14460 if (token.type === "eof") {
14461 throw invalidEOF();
14462 }
14463 switch (token.value) {
14464 case ",":
14465 parseState = "beforePropertyName";
14466 return;
14467 case "}":
14468 pop();
14469 }
14470 },
14471 afterArrayValue() {
14472 if (token.type === "eof") {
14473 throw invalidEOF();
14474 }
14475 switch (token.value) {
14476 case ",":
14477 parseState = "beforeArrayValue";
14478 return;
14479 case "]":
14480 pop();
14481 }
14482 },
14483 end() {
14484 }
14485 };
14486 function push() {
14487 let value;
14488 switch (token.type) {
14489 case "punctuator":
14490 switch (token.value) {
14491 case "{":
14492 value = {};
14493 break;
14494 case "[":
14495 value = [];
14496 break;
14497 }
14498 break;
14499 case "null":
14500 case "boolean":
14501 case "numeric":
14502 case "string":
14503 value = token.value;
14504 break;
14505 }
14506 if (root === void 0) {
14507 root = value;
14508 } else {
14509 const parent = stack[stack.length - 1];
14510 if (Array.isArray(parent)) {
14511 parent.push(value);
14512 } else {
14513 Object.defineProperty(parent, key, {
14514 value,
14515 writable: true,
14516 enumerable: true,
14517 configurable: true
14518 });
14519 }
14520 }
14521 if (value !== null && typeof value === "object") {
14522 stack.push(value);
14523 if (Array.isArray(value)) {
14524 parseState = "beforeArrayValue";
14525 } else {
14526 parseState = "beforePropertyName";
14527 }
14528 } else {
14529 const current = stack[stack.length - 1];
14530 if (current == null) {
14531 parseState = "end";
14532 } else if (Array.isArray(current)) {
14533 parseState = "afterArrayValue";
14534 } else {
14535 parseState = "afterPropertyValue";
14536 }
14537 }
14538 }
14539 function pop() {
14540 stack.pop();
14541 const current = stack[stack.length - 1];
14542 if (current == null) {
14543 parseState = "end";
14544 } else if (Array.isArray(current)) {
14545 parseState = "afterArrayValue";
14546 } else {
14547 parseState = "afterPropertyValue";
14548 }
14549 }
14550 function invalidChar(c2) {
14551 if (c2 === void 0) {
14552 return syntaxError(`JSON5: invalid end of input at ${line2}:${column}`);
14553 }
14554 return syntaxError(`JSON5: invalid character '${formatChar(c2)}' at ${line2}:${column}`);
14555 }
14556 function invalidEOF() {
14557 return syntaxError(`JSON5: invalid end of input at ${line2}:${column}`);
14558 }
14559 function invalidIdentifier() {
14560 column -= 5;
14561 return syntaxError(`JSON5: invalid identifier character at ${line2}:${column}`);
14562 }
14563 function separatorChar(c2) {
14564 console.warn(`JSON5: '${formatChar(c2)}' in strings is not valid ECMAScript; consider escaping`);
14565 }
14566 function formatChar(c2) {
14567 const replacements = {
14568 "'": "\\'",
14569 '"': '\\"',
14570 "\\": "\\\\",
14571 "\b": "\\b",
14572 "\f": "\\f",
14573 "\n": "\\n",
14574 "\r": "\\r",
14575 " ": "\\t",
14576 "\v": "\\v",
14577 "\0": "\\0",
14578 "\u2028": "\\u2028",
14579 "\u2029": "\\u2029"
14580 };
14581 if (replacements[c2]) {
14582 return replacements[c2];
14583 }
14584 if (c2 < " ") {
14585 const hexString = c2.charCodeAt(0).toString(16);
14586 return "\\x" + ("00" + hexString).substring(hexString.length);
14587 }
14588 return c2;
14589 }
14590 function syntaxError(message) {
14591 const err = new SyntaxError(message);
14592 err.lineNumber = line2;
14593 err.columnNumber = column;
14594 return err;
14595 }
14596 }
14597});
14598
14599// node_modules/ignore/index.js
14600var require_ignore = __commonJS({
14601 "node_modules/ignore/index.js"(exports, module) {
14602 function makeArray(subject) {
14603 return Array.isArray(subject) ? subject : [subject];
14604 }
14605 var EMPTY = "";
14606 var SPACE = " ";
14607 var ESCAPE = "\\";
14608 var REGEX_TEST_BLANK_LINE = /^\s+$/;
14609 var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/;
14610 var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
14611 var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
14612 var REGEX_SPLITALL_CRLF = /\r?\n/g;
14613 var REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/;
14614 var SLASH = "/";
14615 var TMP_KEY_IGNORE = "node-ignore";
14616 if (typeof Symbol !== "undefined") {
14617 TMP_KEY_IGNORE = Symbol.for("node-ignore");
14618 }
14619 var KEY_IGNORE = TMP_KEY_IGNORE;
14620 var define = (object, key, value) => Object.defineProperty(object, key, { value });
14621 var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g;
14622 var RETURN_FALSE = () => false;
14623 var sanitizeRange = (range) => range.replace(
14624 REGEX_REGEXP_RANGE,
14625 (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match : EMPTY
14626 );
14627 var cleanRangeBackSlash = (slashes) => {
14628 const { length } = slashes;
14629 return slashes.slice(0, length - length % 2);
14630 };
14631 var REPLACERS = [
14632 // > Trailing spaces are ignored unless they are quoted with backslash ("\")
14633 [
14634 // (a\ ) -> (a )
14635 // (a ) -> (a)
14636 // (a \ ) -> (a )
14637 /\\?\s+$/,
14638 (match) => match.indexOf("\\") === 0 ? SPACE : EMPTY
14639 ],
14640 // replace (\ ) with ' '
14641 [
14642 /\\\s/g,
14643 () => SPACE
14644 ],
14645 // Escape metacharacters
14646 // which is written down by users but means special for regular expressions.
14647 // > There are 12 characters with special meanings:
14648 // > - the backslash \,
14649 // > - the caret ^,
14650 // > - the dollar sign $,
14651 // > - the period or dot .,
14652 // > - the vertical bar or pipe symbol |,
14653 // > - the question mark ?,
14654 // > - the asterisk or star *,
14655 // > - the plus sign +,
14656 // > - the opening parenthesis (,
14657 // > - the closing parenthesis ),
14658 // > - and the opening square bracket [,
14659 // > - the opening curly brace {,
14660 // > These special characters are often called "metacharacters".
14661 [
14662 /[\\$.|*+(){^]/g,
14663 (match) => `\\${match}`
14664 ],
14665 [
14666 // > a question mark (?) matches a single character
14667 /(?!\\)\?/g,
14668 () => "[^/]"
14669 ],
14670 // leading slash
14671 [
14672 // > A leading slash matches the beginning of the pathname.
14673 // > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".
14674 // A leading slash matches the beginning of the pathname
14675 /^\//,
14676 () => "^"
14677 ],
14678 // replace special metacharacter slash after the leading slash
14679 [
14680 /\//g,
14681 () => "\\/"
14682 ],
14683 [
14684 // > A leading "**" followed by a slash means match in all directories.
14685 // > For example, "**/foo" matches file or directory "foo" anywhere,
14686 // > the same as pattern "foo".
14687 // > "**/foo/bar" matches file or directory "bar" anywhere that is directly
14688 // > under directory "foo".
14689 // Notice that the '*'s have been replaced as '\\*'
14690 /^\^*\\\*\\\*\\\//,
14691 // '**/foo' <-> 'foo'
14692 () => "^(?:.*\\/)?"
14693 ],
14694 // starting
14695 [
14696 // there will be no leading '/'
14697 // (which has been replaced by section "leading slash")
14698 // If starts with '**', adding a '^' to the regular expression also works
14699 /^(?=[^^])/,
14700 function startingReplacer() {
14701 return !/\/(?!$)/.test(this) ? "(?:^|\\/)" : "^";
14702 }
14703 ],
14704 // two globstars
14705 [
14706 // Use lookahead assertions so that we could match more than one `'/**'`
14707 /\\\/\\\*\\\*(?=\\\/|$)/g,
14708 // Zero, one or several directories
14709 // should not use '*', or it will be replaced by the next replacer
14710 // Check if it is not the last `'/**'`
14711 (_, index, str) => index + 6 < str.length ? "(?:\\/[^\\/]+)*" : "\\/.+"
14712 ],
14713 // normal intermediate wildcards
14714 [
14715 // Never replace escaped '*'
14716 // ignore rule '\*' will match the path '*'
14717 // 'abc.*/' -> go
14718 // 'abc.*' -> skip this rule,
14719 // coz trailing single wildcard will be handed by [trailing wildcard]
14720 /(^|[^\\]+)(\\\*)+(?=.+)/g,
14721 // '*.js' matches '.js'
14722 // '*.js' doesn't match 'abc'
14723 (_, p1, p2) => {
14724 const unescaped = p2.replace(/\\\*/g, "[^\\/]*");
14725 return p1 + unescaped;
14726 }
14727 ],
14728 [
14729 // unescape, revert step 3 except for back slash
14730 // For example, if a user escape a '\\*',
14731 // after step 3, the result will be '\\\\\\*'
14732 /\\\\\\(?=[$.|*+(){^])/g,
14733 () => ESCAPE
14734 ],
14735 [
14736 // '\\\\' -> '\\'
14737 /\\\\/g,
14738 () => ESCAPE
14739 ],
14740 [
14741 // > The range notation, e.g. [a-zA-Z],
14742 // > can be used to match one of the characters in a range.
14743 // `\` is escaped by step 3
14744 /(\\)?\[([^\]/]*?)(\\*)($|\])/g,
14745 (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range)}${endEscape}]` : "[]" : "[]"
14746 ],
14747 // ending
14748 [
14749 // 'js' will not match 'js.'
14750 // 'ab' will not match 'abc'
14751 /(?:[^*])$/,
14752 // WTF!
14753 // https://git-scm.com/docs/gitignore
14754 // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1)
14755 // which re-fixes #24, #38
14756 // > If there is a separator at the end of the pattern then the pattern
14757 // > will only match directories, otherwise the pattern can match both
14758 // > files and directories.
14759 // 'js*' will not match 'a.js'
14760 // 'js/' will not match 'a.js'
14761 // 'js' will match 'a.js' and 'a.js/'
14762 (match) => /\/$/.test(match) ? `${match}$` : `${match}(?=$|\\/$)`
14763 ],
14764 // trailing wildcard
14765 [
14766 /(\^|\\\/)?\\\*$/,
14767 (_, p1) => {
14768 const prefix = p1 ? `${p1}[^/]+` : "[^/]*";
14769 return `${prefix}(?=$|\\/$)`;
14770 }
14771 ]
14772 ];
14773 var regexCache = /* @__PURE__ */ Object.create(null);
14774 var makeRegex = (pattern, ignoreCase) => {
14775 let source = regexCache[pattern];
14776 if (!source) {
14777 source = REPLACERS.reduce(
14778 (prev, current) => prev.replace(current[0], current[1].bind(pattern)),
14779 pattern
14780 );
14781 regexCache[pattern] = source;
14782 }
14783 return ignoreCase ? new RegExp(source, "i") : new RegExp(source);
14784 };
14785 var isString = (subject) => typeof subject === "string";
14786 var checkPattern = (pattern) => pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) && pattern.indexOf("#") !== 0;
14787 var splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF);
14788 var IgnoreRule = class {
14789 constructor(origin, pattern, negative, regex) {
14790 this.origin = origin;
14791 this.pattern = pattern;
14792 this.negative = negative;
14793 this.regex = regex;
14794 }
14795 };
14796 var createRule = (pattern, ignoreCase) => {
14797 const origin = pattern;
14798 let negative = false;
14799 if (pattern.indexOf("!") === 0) {
14800 negative = true;
14801 pattern = pattern.substr(1);
14802 }
14803 pattern = pattern.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#");
14804 const regex = makeRegex(pattern, ignoreCase);
14805 return new IgnoreRule(
14806 origin,
14807 pattern,
14808 negative,
14809 regex
14810 );
14811 };
14812 var throwError = (message, Ctor) => {
14813 throw new Ctor(message);
14814 };
14815 var checkPath = (path9, originalPath, doThrow) => {
14816 if (!isString(path9)) {
14817 return doThrow(
14818 `path must be a string, but got \`${originalPath}\``,
14819 TypeError
14820 );
14821 }
14822 if (!path9) {
14823 return doThrow(`path must not be empty`, TypeError);
14824 }
14825 if (checkPath.isNotRelative(path9)) {
14826 const r = "`path.relative()`d";
14827 return doThrow(
14828 `path should be a ${r} string, but got "${originalPath}"`,
14829 RangeError
14830 );
14831 }
14832 return true;
14833 };
14834 var isNotRelative = (path9) => REGEX_TEST_INVALID_PATH.test(path9);
14835 checkPath.isNotRelative = isNotRelative;
14836 checkPath.convert = (p) => p;
14837 var Ignore = class {
14838 constructor({
14839 ignorecase = true,
14840 ignoreCase = ignorecase,
14841 allowRelativePaths = false
14842 } = {}) {
14843 define(this, KEY_IGNORE, true);
14844 this._rules = [];
14845 this._ignoreCase = ignoreCase;
14846 this._allowRelativePaths = allowRelativePaths;
14847 this._initCache();
14848 }
14849 _initCache() {
14850 this._ignoreCache = /* @__PURE__ */ Object.create(null);
14851 this._testCache = /* @__PURE__ */ Object.create(null);
14852 }
14853 _addPattern(pattern) {
14854 if (pattern && pattern[KEY_IGNORE]) {
14855 this._rules = this._rules.concat(pattern._rules);
14856 this._added = true;
14857 return;
14858 }
14859 if (checkPattern(pattern)) {
14860 const rule = createRule(pattern, this._ignoreCase);
14861 this._added = true;
14862 this._rules.push(rule);
14863 }
14864 }
14865 // @param {Array<string> | string | Ignore} pattern
14866 add(pattern) {
14867 this._added = false;
14868 makeArray(
14869 isString(pattern) ? splitPattern(pattern) : pattern
14870 ).forEach(this._addPattern, this);
14871 if (this._added) {
14872 this._initCache();
14873 }
14874 return this;
14875 }
14876 // legacy
14877 addPattern(pattern) {
14878 return this.add(pattern);
14879 }
14880 // | ignored : unignored
14881 // negative | 0:0 | 0:1 | 1:0 | 1:1
14882 // -------- | ------- | ------- | ------- | --------
14883 // 0 | TEST | TEST | SKIP | X
14884 // 1 | TESTIF | SKIP | TEST | X
14885 // - SKIP: always skip
14886 // - TEST: always test
14887 // - TESTIF: only test if checkUnignored
14888 // - X: that never happen
14889 // @param {boolean} whether should check if the path is unignored,
14890 // setting `checkUnignored` to `false` could reduce additional
14891 // path matching.
14892 // @returns {TestResult} true if a file is ignored
14893 _testOne(path9, checkUnignored) {
14894 let ignored = false;
14895 let unignored = false;
14896 this._rules.forEach((rule) => {
14897 const { negative } = rule;
14898 if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
14899 return;
14900 }
14901 const matched = rule.regex.test(path9);
14902 if (matched) {
14903 ignored = !negative;
14904 unignored = negative;
14905 }
14906 });
14907 return {
14908 ignored,
14909 unignored
14910 };
14911 }
14912 // @returns {TestResult}
14913 _test(originalPath, cache, checkUnignored, slices) {
14914 const path9 = originalPath && checkPath.convert(originalPath);
14915 checkPath(
14916 path9,
14917 originalPath,
14918 this._allowRelativePaths ? RETURN_FALSE : throwError
14919 );
14920 return this._t(path9, cache, checkUnignored, slices);
14921 }
14922 _t(path9, cache, checkUnignored, slices) {
14923 if (path9 in cache) {
14924 return cache[path9];
14925 }
14926 if (!slices) {
14927 slices = path9.split(SLASH);
14928 }
14929 slices.pop();
14930 if (!slices.length) {
14931 return cache[path9] = this._testOne(path9, checkUnignored);
14932 }
14933 const parent = this._t(
14934 slices.join(SLASH) + SLASH,
14935 cache,
14936 checkUnignored,
14937 slices
14938 );
14939 return cache[path9] = parent.ignored ? parent : this._testOne(path9, checkUnignored);
14940 }
14941 ignores(path9) {
14942 return this._test(path9, this._ignoreCache, false).ignored;
14943 }
14944 createFilter() {
14945 return (path9) => !this.ignores(path9);
14946 }
14947 filter(paths) {
14948 return makeArray(paths).filter(this.createFilter());
14949 }
14950 // @returns {TestResult}
14951 test(path9) {
14952 return this._test(path9, this._testCache, true);
14953 }
14954 };
14955 var factory = (options8) => new Ignore(options8);
14956 var isPathValid = (path9) => checkPath(path9 && checkPath.convert(path9), path9, RETURN_FALSE);
14957 factory.isPathValid = isPathValid;
14958 factory.default = factory;
14959 module.exports = factory;
14960 if (
14961 // Detect `process` so that it can run in browsers.
14962 typeof process !== "undefined" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32")
14963 ) {
14964 const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
14965 checkPath.convert = makePosix;
14966 const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
14967 checkPath.isNotRelative = (path9) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path9) || isNotRelative(path9);
14968 }
14969 }
14970});
14971
14972// src/index.js
14973var src_exports = {};
14974__export(src_exports, {
14975 __debug: () => debugApis,
14976 __internal: () => sharedWithCli,
14977 check: () => check,
14978 clearConfigCache: () => clearCache3,
14979 doc: () => doc,
14980 format: () => format2,
14981 formatWithCursor: () => formatWithCursor2,
14982 getFileInfo: () => getFileInfo2,
14983 getSupportInfo: () => getSupportInfo2,
14984 resolveConfig: () => resolveConfig,
14985 resolveConfigFile: () => resolveConfigFile,
14986 util: () => public_exports,
14987 version: () => version_evaluate_default
14988});
14989var import_vnopts2 = __toESM(require_lib(), 1);
14990var import_fast_glob = __toESM(require_out4(), 1);
14991
14992// scripts/build/shims/string-replace-all.js
14993var stringReplaceAll = (isOptionalObject, original, pattern, replacement) => {
14994 if (isOptionalObject && (original === void 0 || original === null)) {
14995 return;
14996 }
14997 if (original.replaceAll) {
14998 return original.replaceAll(pattern, replacement);
14999 }
15000 if (pattern.global) {
15001 return original.replace(pattern, replacement);
15002 }
15003 return original.split(pattern).join(replacement);
15004};
15005var string_replace_all_default = stringReplaceAll;
15006
15007// src/main/core.js
15008var import_diff = __toESM(require_array3(), 1);
15009
15010// src/document/constants.js
15011var DOC_TYPE_STRING = "string";
15012var DOC_TYPE_ARRAY = "array";
15013var DOC_TYPE_CURSOR = "cursor";
15014var DOC_TYPE_INDENT = "indent";
15015var DOC_TYPE_ALIGN = "align";
15016var DOC_TYPE_TRIM = "trim";
15017var DOC_TYPE_GROUP = "group";
15018var DOC_TYPE_FILL = "fill";
15019var DOC_TYPE_IF_BREAK = "if-break";
15020var DOC_TYPE_INDENT_IF_BREAK = "indent-if-break";
15021var DOC_TYPE_LINE_SUFFIX = "line-suffix";
15022var DOC_TYPE_LINE_SUFFIX_BOUNDARY = "line-suffix-boundary";
15023var DOC_TYPE_LINE = "line";
15024var DOC_TYPE_LABEL = "label";
15025var DOC_TYPE_BREAK_PARENT = "break-parent";
15026var VALID_OBJECT_DOC_TYPES = /* @__PURE__ */ new Set([
15027 DOC_TYPE_CURSOR,
15028 DOC_TYPE_INDENT,
15029 DOC_TYPE_ALIGN,
15030 DOC_TYPE_TRIM,
15031 DOC_TYPE_GROUP,
15032 DOC_TYPE_FILL,
15033 DOC_TYPE_IF_BREAK,
15034 DOC_TYPE_INDENT_IF_BREAK,
15035 DOC_TYPE_LINE_SUFFIX,
15036 DOC_TYPE_LINE_SUFFIX_BOUNDARY,
15037 DOC_TYPE_LINE,
15038 DOC_TYPE_LABEL,
15039 DOC_TYPE_BREAK_PARENT
15040]);
15041
15042// src/document/utils/get-doc-type.js
15043function getDocType(doc2) {
15044 if (typeof doc2 === "string") {
15045 return DOC_TYPE_STRING;
15046 }
15047 if (Array.isArray(doc2)) {
15048 return DOC_TYPE_ARRAY;
15049 }
15050 if (!doc2) {
15051 return;
15052 }
15053 const { type } = doc2;
15054 if (VALID_OBJECT_DOC_TYPES.has(type)) {
15055 return type;
15056 }
15057}
15058var get_doc_type_default = getDocType;
15059
15060// src/document/invalid-doc-error.js
15061var disjunctionListFormat = (list) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(list);
15062function getDocErrorMessage(doc2) {
15063 const type = doc2 === null ? "null" : typeof doc2;
15064 if (type !== "string" && type !== "object") {
15065 return `Unexpected doc '${type}',
15066Expected it to be 'string' or 'object'.`;
15067 }
15068 if (get_doc_type_default(doc2)) {
15069 throw new Error("doc is valid.");
15070 }
15071 const objectType = Object.prototype.toString.call(doc2);
15072 if (objectType !== "[object Object]") {
15073 return `Unexpected doc '${objectType}'.`;
15074 }
15075 const EXPECTED_TYPE_VALUES = disjunctionListFormat(
15076 [...VALID_OBJECT_DOC_TYPES].map((type2) => `'${type2}'`)
15077 );
15078 return `Unexpected doc.type '${doc2.type}'.
15079Expected it to be ${EXPECTED_TYPE_VALUES}.`;
15080}
15081var InvalidDocError = class extends Error {
15082 name = "InvalidDocError";
15083 constructor(doc2) {
15084 super(getDocErrorMessage(doc2));
15085 this.doc = doc2;
15086 }
15087};
15088var invalid_doc_error_default = InvalidDocError;
15089
15090// src/document/utils/traverse-doc.js
15091var traverseDocOnExitStackMarker = {};
15092function traverseDoc(doc2, onEnter, onExit, shouldTraverseConditionalGroups) {
15093 const docsStack = [doc2];
15094 while (docsStack.length > 0) {
15095 const doc3 = docsStack.pop();
15096 if (doc3 === traverseDocOnExitStackMarker) {
15097 onExit(docsStack.pop());
15098 continue;
15099 }
15100 if (onExit) {
15101 docsStack.push(doc3, traverseDocOnExitStackMarker);
15102 }
15103 const docType = get_doc_type_default(doc3);
15104 if (!docType) {
15105 throw new invalid_doc_error_default(doc3);
15106 }
15107 if ((onEnter == null ? void 0 : onEnter(doc3)) === false) {
15108 continue;
15109 }
15110 switch (docType) {
15111 case DOC_TYPE_ARRAY:
15112 case DOC_TYPE_FILL: {
15113 const parts = docType === DOC_TYPE_ARRAY ? doc3 : doc3.parts;
15114 for (let ic = parts.length, i = ic - 1; i >= 0; --i) {
15115 docsStack.push(parts[i]);
15116 }
15117 break;
15118 }
15119 case DOC_TYPE_IF_BREAK:
15120 docsStack.push(doc3.flatContents, doc3.breakContents);
15121 break;
15122 case DOC_TYPE_GROUP:
15123 if (shouldTraverseConditionalGroups && doc3.expandedStates) {
15124 for (let ic = doc3.expandedStates.length, i = ic - 1; i >= 0; --i) {
15125 docsStack.push(doc3.expandedStates[i]);
15126 }
15127 } else {
15128 docsStack.push(doc3.contents);
15129 }
15130 break;
15131 case DOC_TYPE_ALIGN:
15132 case DOC_TYPE_INDENT:
15133 case DOC_TYPE_INDENT_IF_BREAK:
15134 case DOC_TYPE_LABEL:
15135 case DOC_TYPE_LINE_SUFFIX:
15136 docsStack.push(doc3.contents);
15137 break;
15138 case DOC_TYPE_STRING:
15139 case DOC_TYPE_CURSOR:
15140 case DOC_TYPE_TRIM:
15141 case DOC_TYPE_LINE_SUFFIX_BOUNDARY:
15142 case DOC_TYPE_LINE:
15143 case DOC_TYPE_BREAK_PARENT:
15144 break;
15145 default:
15146 throw new invalid_doc_error_default(doc3);
15147 }
15148 }
15149}
15150var traverse_doc_default = traverseDoc;
15151
15152// src/document/utils/assert-doc.js
15153var noop = () => {
15154};
15155var assertDoc = true ? noop : function(doc2) {
15156 traverse_doc_default(doc2, (doc3) => {
15157 if (checked.has(doc3)) {
15158 return false;
15159 }
15160 if (typeof doc3 !== "string") {
15161 checked.add(doc3);
15162 }
15163 });
15164};
15165var assertDocArray = true ? noop : function(docs, optional = false) {
15166 if (optional && !docs) {
15167 return;
15168 }
15169 if (!Array.isArray(docs)) {
15170 throw new TypeError("Unexpected doc array.");
15171 }
15172 for (const doc2 of docs) {
15173 assertDoc(doc2);
15174 }
15175};
15176
15177// src/document/builders.js
15178function indent(contents) {
15179 assertDoc(contents);
15180 return { type: DOC_TYPE_INDENT, contents };
15181}
15182function align(widthOrString, contents) {
15183 assertDoc(contents);
15184 return { type: DOC_TYPE_ALIGN, contents, n: widthOrString };
15185}
15186function fill(parts) {
15187 assertDocArray(parts);
15188 return { type: DOC_TYPE_FILL, parts };
15189}
15190function lineSuffix(contents) {
15191 assertDoc(contents);
15192 return { type: DOC_TYPE_LINE_SUFFIX, contents };
15193}
15194var breakParent = { type: DOC_TYPE_BREAK_PARENT };
15195var hardlineWithoutBreakParent = { type: DOC_TYPE_LINE, hard: true };
15196var line = { type: DOC_TYPE_LINE };
15197var hardline = [hardlineWithoutBreakParent, breakParent];
15198var cursor = { type: DOC_TYPE_CURSOR };
15199function addAlignmentToDoc(doc2, size, tabWidth) {
15200 assertDoc(doc2);
15201 let aligned = doc2;
15202 if (size > 0) {
15203 for (let i = 0; i < Math.floor(size / tabWidth); ++i) {
15204 aligned = indent(aligned);
15205 }
15206 aligned = align(size % tabWidth, aligned);
15207 aligned = align(Number.NEGATIVE_INFINITY, aligned);
15208 }
15209 return aligned;
15210}
15211
15212// scripts/build/shims/at.js
15213var at = (isOptionalObject, object, index) => {
15214 if (isOptionalObject && (object === void 0 || object === null)) {
15215 return;
15216 }
15217 if (Array.isArray(object) || typeof object === "string") {
15218 return object[index < 0 ? object.length + index : index];
15219 }
15220 return object.at(index);
15221};
15222var at_default = at;
15223
15224// src/common/end-of-line.js
15225function guessEndOfLine(text) {
15226 const index = text.indexOf("\r");
15227 if (index >= 0) {
15228 return text.charAt(index + 1) === "\n" ? "crlf" : "cr";
15229 }
15230 return "lf";
15231}
15232function convertEndOfLineToChars(value) {
15233 switch (value) {
15234 case "cr":
15235 return "\r";
15236 case "crlf":
15237 return "\r\n";
15238 default:
15239 return "\n";
15240 }
15241}
15242function countEndOfLineChars(text, eol) {
15243 let regex;
15244 switch (eol) {
15245 case "\n":
15246 regex = /\n/g;
15247 break;
15248 case "\r":
15249 regex = /\r/g;
15250 break;
15251 case "\r\n":
15252 regex = /\r\n/g;
15253 break;
15254 default:
15255 throw new Error(`Unexpected "eol" ${JSON.stringify(eol)}.`);
15256 }
15257 const endOfLines = text.match(regex);
15258 return endOfLines ? endOfLines.length : 0;
15259}
15260function normalizeEndOfLine(text) {
15261 return string_replace_all_default(
15262 /* isOptionalObject*/
15263 false,
15264 text,
15265 /\r\n?/g,
15266 "\n"
15267 );
15268}
15269
15270// node_modules/emoji-regex/index.mjs
15271var emoji_regex_default = () => {
15272 return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
15273};
15274
15275// node_modules/eastasianwidth/eastasianwidth.js
15276var eastasianwidth_default = {
15277 eastAsianWidth(character) {
15278 var x = character.charCodeAt(0);
15279 var y = character.length == 2 ? character.charCodeAt(1) : 0;
15280 var codePoint = x;
15281 if (55296 <= x && x <= 56319 && 56320 <= y && y <= 57343) {
15282 x &= 1023;
15283 y &= 1023;
15284 codePoint = x << 10 | y;
15285 codePoint += 65536;
15286 }
15287 if (12288 == codePoint || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510) {
15288 return "F";
15289 }
15290 if (4352 <= codePoint && codePoint <= 4447 || 4515 <= codePoint && codePoint <= 4519 || 4602 <= codePoint && codePoint <= 4607 || 9001 <= codePoint && codePoint <= 9002 || 11904 <= codePoint && codePoint <= 11929 || 11931 <= codePoint && codePoint <= 12019 || 12032 <= codePoint && codePoint <= 12245 || 12272 <= codePoint && codePoint <= 12283 || 12289 <= codePoint && codePoint <= 12350 || 12353 <= codePoint && codePoint <= 12438 || 12441 <= codePoint && codePoint <= 12543 || 12549 <= codePoint && codePoint <= 12589 || 12593 <= codePoint && codePoint <= 12686 || 12688 <= codePoint && codePoint <= 12730 || 12736 <= codePoint && codePoint <= 12771 || 12784 <= codePoint && codePoint <= 12830 || 12832 <= codePoint && codePoint <= 12871 || 12880 <= codePoint && codePoint <= 13054 || 13056 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42124 || 42128 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 55216 <= codePoint && codePoint <= 55238 || 55243 <= codePoint && codePoint <= 55291 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65106 || 65108 <= codePoint && codePoint <= 65126 || 65128 <= codePoint && codePoint <= 65131 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127490 || 127504 <= codePoint && codePoint <= 127546 || 127552 <= codePoint && codePoint <= 127560 || 127568 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 194367 || 177984 <= codePoint && codePoint <= 196605 || 196608 <= codePoint && codePoint <= 262141) {
15291 return "W";
15292 }
15293 return "N";
15294 }
15295};
15296
15297// src/utils/get-string-width.js
15298var notAsciiRegex = /[^\x20-\x7F]/;
15299function getStringWidth(text) {
15300 if (!text) {
15301 return 0;
15302 }
15303 if (!notAsciiRegex.test(text)) {
15304 return text.length;
15305 }
15306 text = text.replace(emoji_regex_default(), " ");
15307 let width = 0;
15308 for (const character of text) {
15309 const codePoint = character.codePointAt(0);
15310 if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
15311 continue;
15312 }
15313 if (codePoint >= 768 && codePoint <= 879) {
15314 continue;
15315 }
15316 const code = eastasianwidth_default.eastAsianWidth(character);
15317 width += code === "F" || code === "W" ? 2 : 1;
15318 }
15319 return width;
15320}
15321var get_string_width_default = getStringWidth;
15322
15323// src/document/utils.js
15324var getDocParts = (doc2) => {
15325 if (Array.isArray(doc2)) {
15326 return doc2;
15327 }
15328 if (doc2.type !== DOC_TYPE_FILL) {
15329 throw new Error(`Expect doc to be 'array' or '${DOC_TYPE_FILL}'.`);
15330 }
15331 return doc2.parts;
15332};
15333function mapDoc(doc2, cb) {
15334 if (typeof doc2 === "string") {
15335 return cb(doc2);
15336 }
15337 const mapped = /* @__PURE__ */ new Map();
15338 return rec(doc2);
15339 function rec(doc3) {
15340 if (mapped.has(doc3)) {
15341 return mapped.get(doc3);
15342 }
15343 const result = process4(doc3);
15344 mapped.set(doc3, result);
15345 return result;
15346 }
15347 function process4(doc3) {
15348 switch (get_doc_type_default(doc3)) {
15349 case DOC_TYPE_ARRAY:
15350 return cb(doc3.map(rec));
15351 case DOC_TYPE_FILL:
15352 return cb({
15353 ...doc3,
15354 parts: doc3.parts.map(rec)
15355 });
15356 case DOC_TYPE_IF_BREAK:
15357 return cb({
15358 ...doc3,
15359 breakContents: rec(doc3.breakContents),
15360 flatContents: rec(doc3.flatContents)
15361 });
15362 case DOC_TYPE_GROUP: {
15363 let {
15364 expandedStates,
15365 contents
15366 } = doc3;
15367 if (expandedStates) {
15368 expandedStates = expandedStates.map(rec);
15369 contents = expandedStates[0];
15370 } else {
15371 contents = rec(contents);
15372 }
15373 return cb({
15374 ...doc3,
15375 contents,
15376 expandedStates
15377 });
15378 }
15379 case DOC_TYPE_ALIGN:
15380 case DOC_TYPE_INDENT:
15381 case DOC_TYPE_INDENT_IF_BREAK:
15382 case DOC_TYPE_LABEL:
15383 case DOC_TYPE_LINE_SUFFIX:
15384 return cb({
15385 ...doc3,
15386 contents: rec(doc3.contents)
15387 });
15388 case DOC_TYPE_STRING:
15389 case DOC_TYPE_CURSOR:
15390 case DOC_TYPE_TRIM:
15391 case DOC_TYPE_LINE_SUFFIX_BOUNDARY:
15392 case DOC_TYPE_LINE:
15393 case DOC_TYPE_BREAK_PARENT:
15394 return cb(doc3);
15395 default:
15396 throw new invalid_doc_error_default(doc3);
15397 }
15398 }
15399}
15400function breakParentGroup(groupStack) {
15401 if (groupStack.length > 0) {
15402 const parentGroup = at_default(
15403 /* isOptionalObject*/
15404 false,
15405 groupStack,
15406 -1
15407 );
15408 if (!parentGroup.expandedStates && !parentGroup.break) {
15409 parentGroup.break = "propagated";
15410 }
15411 }
15412 return null;
15413}
15414function propagateBreaks(doc2) {
15415 const alreadyVisitedSet = /* @__PURE__ */ new Set();
15416 const groupStack = [];
15417 function propagateBreaksOnEnterFn(doc3) {
15418 if (doc3.type === DOC_TYPE_BREAK_PARENT) {
15419 breakParentGroup(groupStack);
15420 }
15421 if (doc3.type === DOC_TYPE_GROUP) {
15422 groupStack.push(doc3);
15423 if (alreadyVisitedSet.has(doc3)) {
15424 return false;
15425 }
15426 alreadyVisitedSet.add(doc3);
15427 }
15428 }
15429 function propagateBreaksOnExitFn(doc3) {
15430 if (doc3.type === DOC_TYPE_GROUP) {
15431 const group = groupStack.pop();
15432 if (group.break) {
15433 breakParentGroup(groupStack);
15434 }
15435 }
15436 }
15437 traverse_doc_default(
15438 doc2,
15439 propagateBreaksOnEnterFn,
15440 propagateBreaksOnExitFn,
15441 /* shouldTraverseConditionalGroups */
15442 true
15443 );
15444}
15445function stripTrailingHardlineFromParts(parts) {
15446 parts = [...parts];
15447 while (parts.length >= 2 && at_default(
15448 /* isOptionalObject*/
15449 false,
15450 parts,
15451 -2
15452 ).type === DOC_TYPE_LINE && at_default(
15453 /* isOptionalObject*/
15454 false,
15455 parts,
15456 -1
15457 ).type === DOC_TYPE_BREAK_PARENT) {
15458 parts.length -= 2;
15459 }
15460 if (parts.length > 0) {
15461 const lastPart = stripTrailingHardlineFromDoc(at_default(
15462 /* isOptionalObject*/
15463 false,
15464 parts,
15465 -1
15466 ));
15467 parts[parts.length - 1] = lastPart;
15468 }
15469 return parts;
15470}
15471function stripTrailingHardlineFromDoc(doc2) {
15472 switch (get_doc_type_default(doc2)) {
15473 case DOC_TYPE_ALIGN:
15474 case DOC_TYPE_INDENT:
15475 case DOC_TYPE_INDENT_IF_BREAK:
15476 case DOC_TYPE_GROUP:
15477 case DOC_TYPE_LINE_SUFFIX:
15478 case DOC_TYPE_LABEL: {
15479 const contents = stripTrailingHardlineFromDoc(doc2.contents);
15480 return {
15481 ...doc2,
15482 contents
15483 };
15484 }
15485 case DOC_TYPE_IF_BREAK:
15486 return {
15487 ...doc2,
15488 breakContents: stripTrailingHardlineFromDoc(doc2.breakContents),
15489 flatContents: stripTrailingHardlineFromDoc(doc2.flatContents)
15490 };
15491 case DOC_TYPE_FILL:
15492 return {
15493 ...doc2,
15494 parts: stripTrailingHardlineFromParts(doc2.parts)
15495 };
15496 case DOC_TYPE_ARRAY:
15497 return stripTrailingHardlineFromParts(doc2);
15498 case DOC_TYPE_STRING:
15499 return doc2.replace(/[\n\r]*$/, "");
15500 case DOC_TYPE_CURSOR:
15501 case DOC_TYPE_TRIM:
15502 case DOC_TYPE_LINE_SUFFIX_BOUNDARY:
15503 case DOC_TYPE_LINE:
15504 case DOC_TYPE_BREAK_PARENT:
15505 break;
15506 default:
15507 throw new invalid_doc_error_default(doc2);
15508 }
15509 return doc2;
15510}
15511function stripTrailingHardline(doc2) {
15512 return stripTrailingHardlineFromDoc(cleanDoc(doc2));
15513}
15514function cleanDocFn(doc2) {
15515 switch (get_doc_type_default(doc2)) {
15516 case DOC_TYPE_FILL:
15517 if (doc2.parts.every((part) => part === "")) {
15518 return "";
15519 }
15520 break;
15521 case DOC_TYPE_GROUP:
15522 if (!doc2.contents && !doc2.id && !doc2.break && !doc2.expandedStates) {
15523 return "";
15524 }
15525 if (doc2.contents.type === DOC_TYPE_GROUP && doc2.contents.id === doc2.id && doc2.contents.break === doc2.break && doc2.contents.expandedStates === doc2.expandedStates) {
15526 return doc2.contents;
15527 }
15528 break;
15529 case DOC_TYPE_ALIGN:
15530 case DOC_TYPE_INDENT:
15531 case DOC_TYPE_INDENT_IF_BREAK:
15532 case DOC_TYPE_LINE_SUFFIX:
15533 if (!doc2.contents) {
15534 return "";
15535 }
15536 break;
15537 case DOC_TYPE_IF_BREAK:
15538 if (!doc2.flatContents && !doc2.breakContents) {
15539 return "";
15540 }
15541 break;
15542 case DOC_TYPE_ARRAY: {
15543 const parts = [];
15544 for (const part of doc2) {
15545 if (!part) {
15546 continue;
15547 }
15548 const [currentPart, ...restParts] = Array.isArray(part) ? part : [part];
15549 if (typeof currentPart === "string" && typeof at_default(
15550 /* isOptionalObject*/
15551 false,
15552 parts,
15553 -1
15554 ) === "string") {
15555 parts[parts.length - 1] += currentPart;
15556 } else {
15557 parts.push(currentPart);
15558 }
15559 parts.push(...restParts);
15560 }
15561 if (parts.length === 0) {
15562 return "";
15563 }
15564 if (parts.length === 1) {
15565 return parts[0];
15566 }
15567 return parts;
15568 }
15569 case DOC_TYPE_STRING:
15570 case DOC_TYPE_CURSOR:
15571 case DOC_TYPE_TRIM:
15572 case DOC_TYPE_LINE_SUFFIX_BOUNDARY:
15573 case DOC_TYPE_LINE:
15574 case DOC_TYPE_LABEL:
15575 case DOC_TYPE_BREAK_PARENT:
15576 break;
15577 default:
15578 throw new invalid_doc_error_default(doc2);
15579 }
15580 return doc2;
15581}
15582function cleanDoc(doc2) {
15583 return mapDoc(doc2, (currentDoc) => cleanDocFn(currentDoc));
15584}
15585function inheritLabel(doc2, fn) {
15586 return doc2.type === DOC_TYPE_LABEL ? {
15587 ...doc2,
15588 contents: fn(doc2.contents)
15589 } : fn(doc2);
15590}
15591
15592// src/document/printer.js
15593var MODE_BREAK = Symbol("MODE_BREAK");
15594var MODE_FLAT = Symbol("MODE_FLAT");
15595var CURSOR_PLACEHOLDER = Symbol("cursor");
15596function rootIndent() {
15597 return {
15598 value: "",
15599 length: 0,
15600 queue: []
15601 };
15602}
15603function makeIndent(ind, options8) {
15604 return generateInd(ind, {
15605 type: "indent"
15606 }, options8);
15607}
15608function makeAlign(indent2, widthOrDoc, options8) {
15609 if (widthOrDoc === Number.NEGATIVE_INFINITY) {
15610 return indent2.root || rootIndent();
15611 }
15612 if (widthOrDoc < 0) {
15613 return generateInd(indent2, {
15614 type: "dedent"
15615 }, options8);
15616 }
15617 if (!widthOrDoc) {
15618 return indent2;
15619 }
15620 if (widthOrDoc.type === "root") {
15621 return {
15622 ...indent2,
15623 root: indent2
15624 };
15625 }
15626 const alignType = typeof widthOrDoc === "string" ? "stringAlign" : "numberAlign";
15627 return generateInd(indent2, {
15628 type: alignType,
15629 n: widthOrDoc
15630 }, options8);
15631}
15632function generateInd(ind, newPart, options8) {
15633 const queue = newPart.type === "dedent" ? ind.queue.slice(0, -1) : [...ind.queue, newPart];
15634 let value = "";
15635 let length = 0;
15636 let lastTabs = 0;
15637 let lastSpaces = 0;
15638 for (const part of queue) {
15639 switch (part.type) {
15640 case "indent":
15641 flush();
15642 if (options8.useTabs) {
15643 addTabs(1);
15644 } else {
15645 addSpaces(options8.tabWidth);
15646 }
15647 break;
15648 case "stringAlign":
15649 flush();
15650 value += part.n;
15651 length += part.n.length;
15652 break;
15653 case "numberAlign":
15654 lastTabs += 1;
15655 lastSpaces += part.n;
15656 break;
15657 default:
15658 throw new Error(`Unexpected type '${part.type}'`);
15659 }
15660 }
15661 flushSpaces();
15662 return {
15663 ...ind,
15664 value,
15665 length,
15666 queue
15667 };
15668 function addTabs(count) {
15669 value += " ".repeat(count);
15670 length += options8.tabWidth * count;
15671 }
15672 function addSpaces(count) {
15673 value += " ".repeat(count);
15674 length += count;
15675 }
15676 function flush() {
15677 if (options8.useTabs) {
15678 flushTabs();
15679 } else {
15680 flushSpaces();
15681 }
15682 }
15683 function flushTabs() {
15684 if (lastTabs > 0) {
15685 addTabs(lastTabs);
15686 }
15687 resetLast();
15688 }
15689 function flushSpaces() {
15690 if (lastSpaces > 0) {
15691 addSpaces(lastSpaces);
15692 }
15693 resetLast();
15694 }
15695 function resetLast() {
15696 lastTabs = 0;
15697 lastSpaces = 0;
15698 }
15699}
15700function trim(out) {
15701 let trimCount = 0;
15702 let cursorCount = 0;
15703 let outIndex = out.length;
15704 outer:
15705 while (outIndex--) {
15706 const last = out[outIndex];
15707 if (last === CURSOR_PLACEHOLDER) {
15708 cursorCount++;
15709 continue;
15710 }
15711 if (false) {
15712 throw new Error(`Unexpected value in trim: '${typeof last}'`);
15713 }
15714 for (let charIndex = last.length - 1; charIndex >= 0; charIndex--) {
15715 const char = last[charIndex];
15716 if (char === " " || char === " ") {
15717 trimCount++;
15718 } else {
15719 out[outIndex] = last.slice(0, charIndex + 1);
15720 break outer;
15721 }
15722 }
15723 }
15724 if (trimCount > 0 || cursorCount > 0) {
15725 out.length = outIndex + 1;
15726 while (cursorCount-- > 0) {
15727 out.push(CURSOR_PLACEHOLDER);
15728 }
15729 }
15730 return trimCount;
15731}
15732function fits(next, restCommands, width, hasLineSuffix, groupModeMap, mustBeFlat) {
15733 if (width === Number.POSITIVE_INFINITY) {
15734 return true;
15735 }
15736 let restIdx = restCommands.length;
15737 const cmds = [next];
15738 const out = [];
15739 while (width >= 0) {
15740 if (cmds.length === 0) {
15741 if (restIdx === 0) {
15742 return true;
15743 }
15744 cmds.push(restCommands[--restIdx]);
15745 continue;
15746 }
15747 const {
15748 mode,
15749 doc: doc2
15750 } = cmds.pop();
15751 switch (get_doc_type_default(doc2)) {
15752 case DOC_TYPE_STRING:
15753 out.push(doc2);
15754 width -= get_string_width_default(doc2);
15755 break;
15756 case DOC_TYPE_ARRAY:
15757 case DOC_TYPE_FILL: {
15758 const parts = getDocParts(doc2);
15759 for (let i = parts.length - 1; i >= 0; i--) {
15760 cmds.push({
15761 mode,
15762 doc: parts[i]
15763 });
15764 }
15765 break;
15766 }
15767 case DOC_TYPE_INDENT:
15768 case DOC_TYPE_ALIGN:
15769 case DOC_TYPE_INDENT_IF_BREAK:
15770 case DOC_TYPE_LABEL:
15771 cmds.push({
15772 mode,
15773 doc: doc2.contents
15774 });
15775 break;
15776 case DOC_TYPE_TRIM:
15777 width += trim(out);
15778 break;
15779 case DOC_TYPE_GROUP: {
15780 if (mustBeFlat && doc2.break) {
15781 return false;
15782 }
15783 const groupMode = doc2.break ? MODE_BREAK : mode;
15784 const contents = doc2.expandedStates && groupMode === MODE_BREAK ? at_default(
15785 /* isOptionalObject*/
15786 false,
15787 doc2.expandedStates,
15788 -1
15789 ) : doc2.contents;
15790 cmds.push({
15791 mode: groupMode,
15792 doc: contents
15793 });
15794 break;
15795 }
15796 case DOC_TYPE_IF_BREAK: {
15797 const groupMode = doc2.groupId ? groupModeMap[doc2.groupId] || MODE_FLAT : mode;
15798 const contents = groupMode === MODE_BREAK ? doc2.breakContents : doc2.flatContents;
15799 if (contents) {
15800 cmds.push({
15801 mode,
15802 doc: contents
15803 });
15804 }
15805 break;
15806 }
15807 case DOC_TYPE_LINE:
15808 if (mode === MODE_BREAK || doc2.hard) {
15809 return true;
15810 }
15811 if (!doc2.soft) {
15812 out.push(" ");
15813 width--;
15814 }
15815 break;
15816 case DOC_TYPE_LINE_SUFFIX:
15817 hasLineSuffix = true;
15818 break;
15819 case DOC_TYPE_LINE_SUFFIX_BOUNDARY:
15820 if (hasLineSuffix) {
15821 return false;
15822 }
15823 break;
15824 }
15825 }
15826 return false;
15827}
15828function printDocToString(doc2, options8) {
15829 const groupModeMap = {};
15830 const width = options8.printWidth;
15831 const newLine = convertEndOfLineToChars(options8.endOfLine);
15832 let pos = 0;
15833 const cmds = [{
15834 ind: rootIndent(),
15835 mode: MODE_BREAK,
15836 doc: doc2
15837 }];
15838 const out = [];
15839 let shouldRemeasure = false;
15840 const lineSuffix2 = [];
15841 let printedCursorCount = 0;
15842 propagateBreaks(doc2);
15843 while (cmds.length > 0) {
15844 const {
15845 ind,
15846 mode,
15847 doc: doc3
15848 } = cmds.pop();
15849 switch (get_doc_type_default(doc3)) {
15850 case DOC_TYPE_STRING: {
15851 const formatted = newLine !== "\n" ? string_replace_all_default(
15852 /* isOptionalObject*/
15853 false,
15854 doc3,
15855 "\n",
15856 newLine
15857 ) : doc3;
15858 out.push(formatted);
15859 if (cmds.length > 0) {
15860 pos += get_string_width_default(formatted);
15861 }
15862 break;
15863 }
15864 case DOC_TYPE_ARRAY:
15865 for (let i = doc3.length - 1; i >= 0; i--) {
15866 cmds.push({
15867 ind,
15868 mode,
15869 doc: doc3[i]
15870 });
15871 }
15872 break;
15873 case DOC_TYPE_CURSOR:
15874 if (printedCursorCount >= 2) {
15875 throw new Error("There are too many 'cursor' in doc.");
15876 }
15877 out.push(CURSOR_PLACEHOLDER);
15878 printedCursorCount++;
15879 break;
15880 case DOC_TYPE_INDENT:
15881 cmds.push({
15882 ind: makeIndent(ind, options8),
15883 mode,
15884 doc: doc3.contents
15885 });
15886 break;
15887 case DOC_TYPE_ALIGN:
15888 cmds.push({
15889 ind: makeAlign(ind, doc3.n, options8),
15890 mode,
15891 doc: doc3.contents
15892 });
15893 break;
15894 case DOC_TYPE_TRIM:
15895 pos -= trim(out);
15896 break;
15897 case DOC_TYPE_GROUP:
15898 switch (mode) {
15899 case MODE_FLAT:
15900 if (!shouldRemeasure) {
15901 cmds.push({
15902 ind,
15903 mode: doc3.break ? MODE_BREAK : MODE_FLAT,
15904 doc: doc3.contents
15905 });
15906 break;
15907 }
15908 case MODE_BREAK: {
15909 shouldRemeasure = false;
15910 const next = {
15911 ind,
15912 mode: MODE_FLAT,
15913 doc: doc3.contents
15914 };
15915 const rem = width - pos;
15916 const hasLineSuffix = lineSuffix2.length > 0;
15917 if (!doc3.break && fits(next, cmds, rem, hasLineSuffix, groupModeMap)) {
15918 cmds.push(next);
15919 } else {
15920 if (doc3.expandedStates) {
15921 const mostExpanded = at_default(
15922 /* isOptionalObject*/
15923 false,
15924 doc3.expandedStates,
15925 -1
15926 );
15927 if (doc3.break) {
15928 cmds.push({
15929 ind,
15930 mode: MODE_BREAK,
15931 doc: mostExpanded
15932 });
15933 break;
15934 } else {
15935 for (let i = 1; i < doc3.expandedStates.length + 1; i++) {
15936 if (i >= doc3.expandedStates.length) {
15937 cmds.push({
15938 ind,
15939 mode: MODE_BREAK,
15940 doc: mostExpanded
15941 });
15942 break;
15943 } else {
15944 const state = doc3.expandedStates[i];
15945 const cmd = {
15946 ind,
15947 mode: MODE_FLAT,
15948 doc: state
15949 };
15950 if (fits(cmd, cmds, rem, hasLineSuffix, groupModeMap)) {
15951 cmds.push(cmd);
15952 break;
15953 }
15954 }
15955 }
15956 }
15957 } else {
15958 cmds.push({
15959 ind,
15960 mode: MODE_BREAK,
15961 doc: doc3.contents
15962 });
15963 }
15964 }
15965 break;
15966 }
15967 }
15968 if (doc3.id) {
15969 groupModeMap[doc3.id] = at_default(
15970 /* isOptionalObject*/
15971 false,
15972 cmds,
15973 -1
15974 ).mode;
15975 }
15976 break;
15977 case DOC_TYPE_FILL: {
15978 const rem = width - pos;
15979 const {
15980 parts
15981 } = doc3;
15982 if (parts.length === 0) {
15983 break;
15984 }
15985 const [content, whitespace] = parts;
15986 const contentFlatCmd = {
15987 ind,
15988 mode: MODE_FLAT,
15989 doc: content
15990 };
15991 const contentBreakCmd = {
15992 ind,
15993 mode: MODE_BREAK,
15994 doc: content
15995 };
15996 const contentFits = fits(contentFlatCmd, [], rem, lineSuffix2.length > 0, groupModeMap, true);
15997 if (parts.length === 1) {
15998 if (contentFits) {
15999 cmds.push(contentFlatCmd);
16000 } else {
16001 cmds.push(contentBreakCmd);
16002 }
16003 break;
16004 }
16005 const whitespaceFlatCmd = {
16006 ind,
16007 mode: MODE_FLAT,
16008 doc: whitespace
16009 };
16010 const whitespaceBreakCmd = {
16011 ind,
16012 mode: MODE_BREAK,
16013 doc: whitespace
16014 };
16015 if (parts.length === 2) {
16016 if (contentFits) {
16017 cmds.push(whitespaceFlatCmd, contentFlatCmd);
16018 } else {
16019 cmds.push(whitespaceBreakCmd, contentBreakCmd);
16020 }
16021 break;
16022 }
16023 parts.splice(0, 2);
16024 const remainingCmd = {
16025 ind,
16026 mode,
16027 doc: fill(parts)
16028 };
16029 const secondContent = parts[0];
16030 const firstAndSecondContentFlatCmd = {
16031 ind,
16032 mode: MODE_FLAT,
16033 doc: [content, whitespace, secondContent]
16034 };
16035 const firstAndSecondContentFits = fits(firstAndSecondContentFlatCmd, [], rem, lineSuffix2.length > 0, groupModeMap, true);
16036 if (firstAndSecondContentFits) {
16037 cmds.push(remainingCmd, whitespaceFlatCmd, contentFlatCmd);
16038 } else if (contentFits) {
16039 cmds.push(remainingCmd, whitespaceBreakCmd, contentFlatCmd);
16040 } else {
16041 cmds.push(remainingCmd, whitespaceBreakCmd, contentBreakCmd);
16042 }
16043 break;
16044 }
16045 case DOC_TYPE_IF_BREAK:
16046 case DOC_TYPE_INDENT_IF_BREAK: {
16047 const groupMode = doc3.groupId ? groupModeMap[doc3.groupId] : mode;
16048 if (groupMode === MODE_BREAK) {
16049 const breakContents = doc3.type === DOC_TYPE_IF_BREAK ? doc3.breakContents : doc3.negate ? doc3.contents : indent(doc3.contents);
16050 if (breakContents) {
16051 cmds.push({
16052 ind,
16053 mode,
16054 doc: breakContents
16055 });
16056 }
16057 }
16058 if (groupMode === MODE_FLAT) {
16059 const flatContents = doc3.type === DOC_TYPE_IF_BREAK ? doc3.flatContents : doc3.negate ? indent(doc3.contents) : doc3.contents;
16060 if (flatContents) {
16061 cmds.push({
16062 ind,
16063 mode,
16064 doc: flatContents
16065 });
16066 }
16067 }
16068 break;
16069 }
16070 case DOC_TYPE_LINE_SUFFIX:
16071 lineSuffix2.push({
16072 ind,
16073 mode,
16074 doc: doc3.contents
16075 });
16076 break;
16077 case DOC_TYPE_LINE_SUFFIX_BOUNDARY:
16078 if (lineSuffix2.length > 0) {
16079 cmds.push({
16080 ind,
16081 mode,
16082 doc: hardlineWithoutBreakParent
16083 });
16084 }
16085 break;
16086 case DOC_TYPE_LINE:
16087 switch (mode) {
16088 case MODE_FLAT:
16089 if (!doc3.hard) {
16090 if (!doc3.soft) {
16091 out.push(" ");
16092 pos += 1;
16093 }
16094 break;
16095 } else {
16096 shouldRemeasure = true;
16097 }
16098 case MODE_BREAK:
16099 if (lineSuffix2.length > 0) {
16100 cmds.push({
16101 ind,
16102 mode,
16103 doc: doc3
16104 }, ...lineSuffix2.reverse());
16105 lineSuffix2.length = 0;
16106 break;
16107 }
16108 if (doc3.literal) {
16109 if (ind.root) {
16110 out.push(newLine, ind.root.value);
16111 pos = ind.root.length;
16112 } else {
16113 out.push(newLine);
16114 pos = 0;
16115 }
16116 } else {
16117 pos -= trim(out);
16118 out.push(newLine + ind.value);
16119 pos = ind.length;
16120 }
16121 break;
16122 }
16123 break;
16124 case DOC_TYPE_LABEL:
16125 cmds.push({
16126 ind,
16127 mode,
16128 doc: doc3.contents
16129 });
16130 break;
16131 case DOC_TYPE_BREAK_PARENT:
16132 break;
16133 default:
16134 throw new invalid_doc_error_default(doc3);
16135 }
16136 if (cmds.length === 0 && lineSuffix2.length > 0) {
16137 cmds.push(...lineSuffix2.reverse());
16138 lineSuffix2.length = 0;
16139 }
16140 }
16141 const cursorPlaceholderIndex = out.indexOf(CURSOR_PLACEHOLDER);
16142 if (cursorPlaceholderIndex !== -1) {
16143 const otherCursorPlaceholderIndex = out.indexOf(CURSOR_PLACEHOLDER, cursorPlaceholderIndex + 1);
16144 const beforeCursor = out.slice(0, cursorPlaceholderIndex).join("");
16145 const aroundCursor = out.slice(cursorPlaceholderIndex + 1, otherCursorPlaceholderIndex).join("");
16146 const afterCursor = out.slice(otherCursorPlaceholderIndex + 1).join("");
16147 return {
16148 formatted: beforeCursor + aroundCursor + afterCursor,
16149 cursorNodeStart: beforeCursor.length,
16150 cursorNodeText: aroundCursor
16151 };
16152 }
16153 return {
16154 formatted: out.join("")
16155 };
16156}
16157
16158// src/document/debug.js
16159function flattenDoc(doc2) {
16160 var _a;
16161 if (!doc2) {
16162 return "";
16163 }
16164 if (Array.isArray(doc2)) {
16165 const res = [];
16166 for (const part of doc2) {
16167 if (Array.isArray(part)) {
16168 res.push(...flattenDoc(part));
16169 } else {
16170 const flattened = flattenDoc(part);
16171 if (flattened !== "") {
16172 res.push(flattened);
16173 }
16174 }
16175 }
16176 return res;
16177 }
16178 if (doc2.type === DOC_TYPE_IF_BREAK) {
16179 return {
16180 ...doc2,
16181 breakContents: flattenDoc(doc2.breakContents),
16182 flatContents: flattenDoc(doc2.flatContents)
16183 };
16184 }
16185 if (doc2.type === DOC_TYPE_GROUP) {
16186 return {
16187 ...doc2,
16188 contents: flattenDoc(doc2.contents),
16189 expandedStates: (_a = doc2.expandedStates) == null ? void 0 : _a.map(flattenDoc)
16190 };
16191 }
16192 if (doc2.type === DOC_TYPE_FILL) {
16193 return { type: "fill", parts: doc2.parts.map(flattenDoc) };
16194 }
16195 if (doc2.contents) {
16196 return { ...doc2, contents: flattenDoc(doc2.contents) };
16197 }
16198 return doc2;
16199}
16200function printDocToDebug(doc2) {
16201 const printedSymbols = /* @__PURE__ */ Object.create(null);
16202 const usedKeysForSymbols = /* @__PURE__ */ new Set();
16203 return printDoc(flattenDoc(doc2));
16204 function printDoc(doc3, index, parentParts) {
16205 var _a, _b;
16206 if (typeof doc3 === "string") {
16207 return JSON.stringify(doc3);
16208 }
16209 if (Array.isArray(doc3)) {
16210 const printed = doc3.map(printDoc).filter(Boolean);
16211 return printed.length === 1 ? printed[0] : `[${printed.join(", ")}]`;
16212 }
16213 if (doc3.type === DOC_TYPE_LINE) {
16214 const withBreakParent = ((_a = parentParts == null ? void 0 : parentParts[index + 1]) == null ? void 0 : _a.type) === DOC_TYPE_BREAK_PARENT;
16215 if (doc3.literal) {
16216 return withBreakParent ? "literalline" : "literallineWithoutBreakParent";
16217 }
16218 if (doc3.hard) {
16219 return withBreakParent ? "hardline" : "hardlineWithoutBreakParent";
16220 }
16221 if (doc3.soft) {
16222 return "softline";
16223 }
16224 return "line";
16225 }
16226 if (doc3.type === DOC_TYPE_BREAK_PARENT) {
16227 const afterHardline = ((_b = parentParts == null ? void 0 : parentParts[index - 1]) == null ? void 0 : _b.type) === DOC_TYPE_LINE && parentParts[index - 1].hard;
16228 return afterHardline ? void 0 : "breakParent";
16229 }
16230 if (doc3.type === DOC_TYPE_TRIM) {
16231 return "trim";
16232 }
16233 if (doc3.type === DOC_TYPE_INDENT) {
16234 return "indent(" + printDoc(doc3.contents) + ")";
16235 }
16236 if (doc3.type === DOC_TYPE_ALIGN) {
16237 return doc3.n === Number.NEGATIVE_INFINITY ? "dedentToRoot(" + printDoc(doc3.contents) + ")" : doc3.n < 0 ? "dedent(" + printDoc(doc3.contents) + ")" : doc3.n.type === "root" ? "markAsRoot(" + printDoc(doc3.contents) + ")" : "align(" + JSON.stringify(doc3.n) + ", " + printDoc(doc3.contents) + ")";
16238 }
16239 if (doc3.type === DOC_TYPE_IF_BREAK) {
16240 return "ifBreak(" + printDoc(doc3.breakContents) + (doc3.flatContents ? ", " + printDoc(doc3.flatContents) : "") + (doc3.groupId ? (!doc3.flatContents ? ', ""' : "") + `, { groupId: ${printGroupId(doc3.groupId)} }` : "") + ")";
16241 }
16242 if (doc3.type === DOC_TYPE_INDENT_IF_BREAK) {
16243 const optionsParts = [];
16244 if (doc3.negate) {
16245 optionsParts.push("negate: true");
16246 }
16247 if (doc3.groupId) {
16248 optionsParts.push(`groupId: ${printGroupId(doc3.groupId)}`);
16249 }
16250 const options8 = optionsParts.length > 0 ? `, { ${optionsParts.join(", ")} }` : "";
16251 return `indentIfBreak(${printDoc(doc3.contents)}${options8})`;
16252 }
16253 if (doc3.type === DOC_TYPE_GROUP) {
16254 const optionsParts = [];
16255 if (doc3.break && doc3.break !== "propagated") {
16256 optionsParts.push("shouldBreak: true");
16257 }
16258 if (doc3.id) {
16259 optionsParts.push(`id: ${printGroupId(doc3.id)}`);
16260 }
16261 const options8 = optionsParts.length > 0 ? `, { ${optionsParts.join(", ")} }` : "";
16262 if (doc3.expandedStates) {
16263 return `conditionalGroup([${doc3.expandedStates.map((part) => printDoc(part)).join(",")}]${options8})`;
16264 }
16265 return `group(${printDoc(doc3.contents)}${options8})`;
16266 }
16267 if (doc3.type === DOC_TYPE_FILL) {
16268 return `fill([${doc3.parts.map((part) => printDoc(part)).join(", ")}])`;
16269 }
16270 if (doc3.type === DOC_TYPE_LINE_SUFFIX) {
16271 return "lineSuffix(" + printDoc(doc3.contents) + ")";
16272 }
16273 if (doc3.type === DOC_TYPE_LINE_SUFFIX_BOUNDARY) {
16274 return "lineSuffixBoundary";
16275 }
16276 if (doc3.type === DOC_TYPE_LABEL) {
16277 return `label(${JSON.stringify(doc3.label)}, ${printDoc(doc3.contents)})`;
16278 }
16279 throw new Error("Unknown doc type " + doc3.type);
16280 }
16281 function printGroupId(id) {
16282 if (typeof id !== "symbol") {
16283 return JSON.stringify(String(id));
16284 }
16285 if (id in printedSymbols) {
16286 return printedSymbols[id];
16287 }
16288 const prefix = id.description || "symbol";
16289 for (let counter = 0; ; counter++) {
16290 const key = prefix + (counter > 0 ? ` #${counter}` : "");
16291 if (!usedKeysForSymbols.has(key)) {
16292 usedKeysForSymbols.add(key);
16293 return printedSymbols[id] = `Symbol.for(${JSON.stringify(key)})`;
16294 }
16295 }
16296 }
16297}
16298
16299// src/utils/get-alignment-size.js
16300function getAlignmentSize(text, tabWidth, startIndex = 0) {
16301 let size = 0;
16302 for (let i = startIndex; i < text.length; ++i) {
16303 if (text[i] === " ") {
16304 size = size + tabWidth - size % tabWidth;
16305 } else {
16306 size++;
16307 }
16308 }
16309 return size;
16310}
16311var get_alignment_size_default = getAlignmentSize;
16312
16313// src/common/errors.js
16314var errors_exports = {};
16315__export(errors_exports, {
16316 ArgExpansionBailout: () => ArgExpansionBailout,
16317 ConfigError: () => ConfigError,
16318 UndefinedParserError: () => UndefinedParserError
16319});
16320var ConfigError = class extends Error {
16321 name = "ConfigError";
16322};
16323var UndefinedParserError = class extends Error {
16324 name = "UndefinedParserError";
16325};
16326var ArgExpansionBailout = class extends Error {
16327 name = "ArgExpansionBailout";
16328};
16329
16330// src/main/core-options.evaluate.js
16331var core_options_evaluate_default = {
16332 "cursorOffset": {
16333 "category": "Special",
16334 "type": "int",
16335 "default": -1,
16336 "range": {
16337 "start": -1,
16338 "end": Infinity,
16339 "step": 1
16340 },
16341 "description": "Print (to stderr) where a cursor at the given position would move to after formatting.\nThis option cannot be used with --range-start and --range-end.",
16342 "cliCategory": "Editor"
16343 },
16344 "endOfLine": {
16345 "category": "Global",
16346 "type": "choice",
16347 "default": "lf",
16348 "description": "Which end of line characters to apply.",
16349 "choices": [
16350 {
16351 "value": "lf",
16352 "description": "Line Feed only (\\n), common on Linux and macOS as well as inside git repos"
16353 },
16354 {
16355 "value": "crlf",
16356 "description": "Carriage Return + Line Feed characters (\\r\\n), common on Windows"
16357 },
16358 {
16359 "value": "cr",
16360 "description": "Carriage Return character only (\\r), used very rarely"
16361 },
16362 {
16363 "value": "auto",
16364 "description": "Maintain existing\n(mixed values within one file are normalised by looking at what's used after the first line)"
16365 }
16366 ]
16367 },
16368 "filepath": {
16369 "category": "Special",
16370 "type": "path",
16371 "description": "Specify the input filepath. This will be used to do parser inference.",
16372 "cliName": "stdin-filepath",
16373 "cliCategory": "Other",
16374 "cliDescription": "Path to the file to pretend that stdin comes from."
16375 },
16376 "insertPragma": {
16377 "category": "Special",
16378 "type": "boolean",
16379 "default": false,
16380 "description": "Insert @format pragma into file's first docblock comment.",
16381 "cliCategory": "Other"
16382 },
16383 "parser": {
16384 "category": "Global",
16385 "type": "choice",
16386 "default": void 0,
16387 "description": "Which parser to use.",
16388 "exception": (value) => typeof value === "string" || typeof value === "function",
16389 "choices": [
16390 {
16391 "value": "flow",
16392 "description": "Flow"
16393 },
16394 {
16395 "value": "babel",
16396 "description": "JavaScript"
16397 },
16398 {
16399 "value": "babel-flow",
16400 "description": "Flow"
16401 },
16402 {
16403 "value": "babel-ts",
16404 "description": "TypeScript"
16405 },
16406 {
16407 "value": "typescript",
16408 "description": "TypeScript"
16409 },
16410 {
16411 "value": "acorn",
16412 "description": "JavaScript"
16413 },
16414 {
16415 "value": "espree",
16416 "description": "JavaScript"
16417 },
16418 {
16419 "value": "meriyah",
16420 "description": "JavaScript"
16421 },
16422 {
16423 "value": "css",
16424 "description": "CSS"
16425 },
16426 {
16427 "value": "less",
16428 "description": "Less"
16429 },
16430 {
16431 "value": "scss",
16432 "description": "SCSS"
16433 },
16434 {
16435 "value": "json",
16436 "description": "JSON"
16437 },
16438 {
16439 "value": "json5",
16440 "description": "JSON5"
16441 },
16442 {
16443 "value": "json-stringify",
16444 "description": "JSON.stringify"
16445 },
16446 {
16447 "value": "graphql",
16448 "description": "GraphQL"
16449 },
16450 {
16451 "value": "markdown",
16452 "description": "Markdown"
16453 },
16454 {
16455 "value": "mdx",
16456 "description": "MDX"
16457 },
16458 {
16459 "value": "vue",
16460 "description": "Vue"
16461 },
16462 {
16463 "value": "yaml",
16464 "description": "YAML"
16465 },
16466 {
16467 "value": "glimmer",
16468 "description": "Ember / Handlebars"
16469 },
16470 {
16471 "value": "html",
16472 "description": "HTML"
16473 },
16474 {
16475 "value": "angular",
16476 "description": "Angular"
16477 },
16478 {
16479 "value": "lwc",
16480 "description": "Lightning Web Components"
16481 }
16482 ]
16483 },
16484 "plugins": {
16485 "type": "path",
16486 "array": true,
16487 "default": [
16488 {
16489 "value": []
16490 }
16491 ],
16492 "category": "Global",
16493 "description": "Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",
16494 "exception": (value) => typeof value === "string" || typeof value === "object",
16495 "cliName": "plugin",
16496 "cliCategory": "Config"
16497 },
16498 "printWidth": {
16499 "category": "Global",
16500 "type": "int",
16501 "default": 80,
16502 "description": "The line length where Prettier will try wrap.",
16503 "range": {
16504 "start": 0,
16505 "end": Infinity,
16506 "step": 1
16507 }
16508 },
16509 "rangeEnd": {
16510 "category": "Special",
16511 "type": "int",
16512 "default": Infinity,
16513 "range": {
16514 "start": 0,
16515 "end": Infinity,
16516 "step": 1
16517 },
16518 "description": "Format code ending at a given character offset (exclusive).\nThe range will extend forwards to the end of the selected statement.\nThis option cannot be used with --cursor-offset.",
16519 "cliCategory": "Editor"
16520 },
16521 "rangeStart": {
16522 "category": "Special",
16523 "type": "int",
16524 "default": 0,
16525 "range": {
16526 "start": 0,
16527 "end": Infinity,
16528 "step": 1
16529 },
16530 "description": "Format code starting at a given character offset.\nThe range will extend backwards to the start of the first line containing the selected statement.\nThis option cannot be used with --cursor-offset.",
16531 "cliCategory": "Editor"
16532 },
16533 "requirePragma": {
16534 "category": "Special",
16535 "type": "boolean",
16536 "default": false,
16537 "description": "Require either '@prettier' or '@format' to be present in the file's first docblock comment\nin order for it to be formatted.",
16538 "cliCategory": "Other"
16539 },
16540 "tabWidth": {
16541 "type": "int",
16542 "category": "Global",
16543 "default": 2,
16544 "description": "Number of spaces per indentation level.",
16545 "range": {
16546 "start": 0,
16547 "end": Infinity,
16548 "step": 1
16549 }
16550 },
16551 "useTabs": {
16552 "category": "Global",
16553 "type": "boolean",
16554 "default": false,
16555 "description": "Indent with tabs instead of spaces."
16556 },
16557 "embeddedLanguageFormatting": {
16558 "category": "Global",
16559 "type": "choice",
16560 "default": "auto",
16561 "description": "Control how Prettier formats quoted code embedded in the file.",
16562 "choices": [
16563 {
16564 "value": "auto",
16565 "description": "Format embedded code if Prettier can automatically identify it."
16566 },
16567 {
16568 "value": "off",
16569 "description": "Never automatically format embedded code."
16570 }
16571 ]
16572 }
16573};
16574
16575// src/main/support.js
16576function getSupportInfo({
16577 plugins = [],
16578 showDeprecated = false
16579} = {}) {
16580 const languages2 = plugins.flatMap((plugin) => plugin.languages ?? []);
16581 const options8 = [];
16582 for (const option of normalizeOptionSettings(Object.assign({}, ...plugins.map(({
16583 options: options9
16584 }) => options9), core_options_evaluate_default))) {
16585 if (!showDeprecated && option.deprecated) {
16586 continue;
16587 }
16588 if (Array.isArray(option.choices)) {
16589 if (!showDeprecated) {
16590 option.choices = option.choices.filter((choice) => !choice.deprecated);
16591 }
16592 if (option.name === "parser") {
16593 option.choices = [...option.choices, ...collectParsersFromLanguages(option.choices, languages2, plugins)];
16594 }
16595 }
16596 option.pluginDefaults = Object.fromEntries(plugins.filter((plugin) => {
16597 var _a;
16598 return ((_a = plugin.defaultOptions) == null ? void 0 : _a[option.name]) !== void 0;
16599 }).map((plugin) => [plugin.name, plugin.defaultOptions[option.name]]));
16600 options8.push(option);
16601 }
16602 return {
16603 languages: languages2,
16604 options: options8
16605 };
16606}
16607function* collectParsersFromLanguages(parserChoices, languages2, plugins) {
16608 const existingParsers = new Set(parserChoices.map((choice) => choice.value));
16609 for (const language of languages2) {
16610 if (language.parsers) {
16611 for (const parserName of language.parsers) {
16612 if (!existingParsers.has(parserName)) {
16613 existingParsers.add(parserName);
16614 const plugin = plugins.find((plugin2) => plugin2.parsers && Object.prototype.hasOwnProperty.call(plugin2.parsers, parserName));
16615 let description = language.name;
16616 if (plugin == null ? void 0 : plugin.name) {
16617 description += ` (plugin: ${plugin.name})`;
16618 }
16619 yield {
16620 value: parserName,
16621 description
16622 };
16623 }
16624 }
16625 }
16626 }
16627}
16628function normalizeOptionSettings(settings) {
16629 const options8 = [];
16630 for (const [name, originalOption] of Object.entries(settings)) {
16631 const option = {
16632 name,
16633 ...originalOption
16634 };
16635 if (Array.isArray(option.default)) {
16636 option.default = at_default(
16637 /* isOptionalObject*/
16638 false,
16639 option.default,
16640 -1
16641 ).value;
16642 }
16643 options8.push(option);
16644 }
16645 return options8;
16646}
16647
16648// src/utils/get-interpreter.js
16649var import_n_readlines = __toESM(require_readlines(), 1);
16650import fs from "fs";
16651function getInterpreter(filepath) {
16652 if (typeof filepath !== "string") {
16653 return "";
16654 }
16655 let fd;
16656 try {
16657 fd = fs.openSync(filepath, "r");
16658 } catch {
16659 return "";
16660 }
16661 try {
16662 const liner = new import_n_readlines.default(fd);
16663 const firstLine = liner.next().toString("utf8");
16664 const m1 = firstLine.match(/^#!\/(?:usr\/)?bin\/env\s+(\S+)/);
16665 if (m1) {
16666 return m1[1];
16667 }
16668 const m2 = firstLine.match(/^#!\/(?:usr\/(?:local\/)?)?bin\/(\S+)/);
16669 if (m2) {
16670 return m2[1];
16671 }
16672 return "";
16673 } catch {
16674 return "";
16675 } finally {
16676 try {
16677 fs.closeSync(fd);
16678 } catch {
16679 }
16680 }
16681}
16682var get_interpreter_default = getInterpreter;
16683
16684// src/utils/infer-parser.js
16685var getFileBasename = (file) => file.split(/[/\\]/).pop();
16686function getLanguageByFilename(languages2, filename) {
16687 if (!filename) {
16688 return;
16689 }
16690 const basename = getFileBasename(filename).toLowerCase();
16691 return languages2.find(
16692 (language) => {
16693 var _a, _b;
16694 return ((_a = language.extensions) == null ? void 0 : _a.some((extension) => basename.endsWith(extension))) || ((_b = language.filenames) == null ? void 0 : _b.some((name) => name.toLowerCase() === basename));
16695 }
16696 );
16697}
16698function getLanguageByName(languages2, languageName) {
16699 if (!languageName) {
16700 return;
16701 }
16702 return languages2.find(({ name }) => name.toLowerCase() === languageName) ?? languages2.find(({ aliases }) => aliases == null ? void 0 : aliases.includes(languageName)) ?? languages2.find(({ extensions }) => extensions == null ? void 0 : extensions.includes(`.${languageName}`));
16703}
16704function getLanguageByInterpreter(languages2, file) {
16705 if (!file || getFileBasename(file).includes(".")) {
16706 return;
16707 }
16708 const interpreter = get_interpreter_default(file);
16709 if (!interpreter) {
16710 return;
16711 }
16712 return languages2.find(
16713 (language) => {
16714 var _a;
16715 return (_a = language.interpreters) == null ? void 0 : _a.includes(interpreter);
16716 }
16717 );
16718}
16719function inferParser(options8, fileInfo) {
16720 const languages2 = options8.plugins.flatMap(
16721 (plugin) => (
16722 // @ts-expect-error -- Safe
16723 plugin.languages ?? []
16724 )
16725 );
16726 const language = getLanguageByName(languages2, fileInfo.language) ?? getLanguageByFilename(languages2, fileInfo.physicalFile) ?? getLanguageByFilename(languages2, fileInfo.file) ?? getLanguageByInterpreter(languages2, fileInfo.physicalFile);
16727 return language == null ? void 0 : language.parsers[0];
16728}
16729var infer_parser_default = inferParser;
16730
16731// src/main/normalize-options.js
16732var import_vnopts = __toESM(require_lib(), 1);
16733var hasDeprecationWarned;
16734function normalizeOptions(options8, optionInfos, {
16735 logger = false,
16736 isCLI = false,
16737 passThrough = false,
16738 FlagSchema,
16739 descriptor
16740} = {}) {
16741 if (isCLI) {
16742 if (!FlagSchema) {
16743 throw new Error("'FlagSchema' option is required.");
16744 }
16745 if (!descriptor) {
16746 throw new Error("'descriptor' option is required.");
16747 }
16748 } else {
16749 descriptor = import_vnopts.default.apiDescriptor;
16750 }
16751 const unknown = !passThrough ? (key, value, options9) => {
16752 const {
16753 _,
16754 ...schemas2
16755 } = options9.schemas;
16756 return import_vnopts.default.levenUnknownHandler(key, value, {
16757 ...options9,
16758 schemas: schemas2
16759 });
16760 } : Array.isArray(passThrough) ? (key, value) => !passThrough.includes(key) ? void 0 : {
16761 [key]: value
16762 } : (key, value) => ({
16763 [key]: value
16764 });
16765 const schemas = optionInfosToSchemas(optionInfos, {
16766 isCLI,
16767 FlagSchema
16768 });
16769 const normalizer = new import_vnopts.default.Normalizer(schemas, {
16770 logger,
16771 unknown,
16772 descriptor
16773 });
16774 const shouldSuppressDuplicateDeprecationWarnings = logger !== false;
16775 if (shouldSuppressDuplicateDeprecationWarnings && hasDeprecationWarned) {
16776 normalizer._hasDeprecationWarned = hasDeprecationWarned;
16777 }
16778 const normalized = normalizer.normalize(options8);
16779 if (shouldSuppressDuplicateDeprecationWarnings) {
16780 hasDeprecationWarned = normalizer._hasDeprecationWarned;
16781 }
16782 return normalized;
16783}
16784function optionInfosToSchemas(optionInfos, {
16785 isCLI,
16786 FlagSchema
16787}) {
16788 const schemas = [];
16789 if (isCLI) {
16790 schemas.push(import_vnopts.default.AnySchema.create({
16791 name: "_"
16792 }));
16793 }
16794 for (const optionInfo of optionInfos) {
16795 schemas.push(optionInfoToSchema(optionInfo, {
16796 isCLI,
16797 optionInfos,
16798 FlagSchema
16799 }));
16800 if (optionInfo.alias && isCLI) {
16801 schemas.push(import_vnopts.default.AliasSchema.create({
16802 // @ts-expect-error
16803 name: optionInfo.alias,
16804 sourceName: optionInfo.name
16805 }));
16806 }
16807 }
16808 return schemas;
16809}
16810function optionInfoToSchema(optionInfo, {
16811 isCLI,
16812 optionInfos,
16813 FlagSchema
16814}) {
16815 const {
16816 name
16817 } = optionInfo;
16818 const parameters = {
16819 name
16820 };
16821 let SchemaConstructor;
16822 const handlers = {};
16823 switch (optionInfo.type) {
16824 case "int":
16825 SchemaConstructor = import_vnopts.default.IntegerSchema;
16826 if (isCLI) {
16827 parameters.preprocess = Number;
16828 }
16829 break;
16830 case "string":
16831 SchemaConstructor = import_vnopts.default.StringSchema;
16832 break;
16833 case "choice":
16834 SchemaConstructor = import_vnopts.default.ChoiceSchema;
16835 parameters.choices = optionInfo.choices.map((choiceInfo) => (choiceInfo == null ? void 0 : choiceInfo.redirect) ? {
16836 ...choiceInfo,
16837 redirect: {
16838 to: {
16839 key: optionInfo.name,
16840 value: choiceInfo.redirect
16841 }
16842 }
16843 } : choiceInfo);
16844 break;
16845 case "boolean":
16846 SchemaConstructor = import_vnopts.default.BooleanSchema;
16847 break;
16848 case "flag":
16849 SchemaConstructor = FlagSchema;
16850 parameters.flags = optionInfos.flatMap((optionInfo2) => [optionInfo2.alias, optionInfo2.description && optionInfo2.name, optionInfo2.oppositeDescription && `no-${optionInfo2.name}`].filter(Boolean));
16851 break;
16852 case "path":
16853 SchemaConstructor = import_vnopts.default.StringSchema;
16854 break;
16855 default:
16856 throw new Error(`Unexpected type ${optionInfo.type}`);
16857 }
16858 if (optionInfo.exception) {
16859 parameters.validate = (value, schema, utils) => optionInfo.exception(value) || schema.validate(value, utils);
16860 } else {
16861 parameters.validate = (value, schema, utils) => value === void 0 || schema.validate(value, utils);
16862 }
16863 if (optionInfo.redirect) {
16864 handlers.redirect = (value) => !value ? void 0 : {
16865 to: {
16866 key: optionInfo.redirect.option,
16867 value: optionInfo.redirect.value
16868 }
16869 };
16870 }
16871 if (optionInfo.deprecated) {
16872 handlers.deprecated = true;
16873 }
16874 if (isCLI && !optionInfo.array) {
16875 const originalPreprocess = parameters.preprocess || ((x) => x);
16876 parameters.preprocess = (value, schema, utils) => schema.preprocess(originalPreprocess(Array.isArray(value) ? at_default(
16877 /* isOptionalObject*/
16878 false,
16879 value,
16880 -1
16881 ) : value), utils);
16882 }
16883 return optionInfo.array ? import_vnopts.default.ArraySchema.create({
16884 ...isCLI ? {
16885 preprocess: (v) => Array.isArray(v) ? v : [v]
16886 } : {},
16887 ...handlers,
16888 // @ts-expect-error
16889 valueSchema: SchemaConstructor.create(parameters)
16890 }) : SchemaConstructor.create({
16891 ...parameters,
16892 ...handlers
16893 });
16894}
16895var normalize_options_default = normalizeOptions;
16896
16897// src/main/parser-and-printer.js
16898function getParserPluginByParserName(plugins, parserName) {
16899 if (!parserName) {
16900 throw new Error("parserName is required.");
16901 }
16902 for (let index = plugins.length - 1; index >= 0; index--) {
16903 const plugin = plugins[index];
16904 if (plugin.parsers && Object.prototype.hasOwnProperty.call(plugin.parsers, parserName)) {
16905 return plugin;
16906 }
16907 }
16908 let message = `Couldn't resolve parser "${parserName}".`;
16909 if (false) {
16910 message += " Plugins must be explicitly added to the standalone bundle.";
16911 }
16912 throw new ConfigError(message);
16913}
16914function getPrinterPluginByAstFormat(plugins, astFormat) {
16915 if (!astFormat) {
16916 throw new Error("astFormat is required.");
16917 }
16918 for (let index = plugins.length - 1; index >= 0; index--) {
16919 const plugin = plugins[index];
16920 if (plugin.printers && Object.prototype.hasOwnProperty.call(plugin.printers, astFormat)) {
16921 return plugin;
16922 }
16923 }
16924 let message = `Couldn't find plugin for AST format "${astFormat}".`;
16925 if (false) {
16926 message += " Plugins must be explicitly added to the standalone bundle.";
16927 }
16928 throw new ConfigError(message);
16929}
16930function resolveParser({
16931 plugins,
16932 parser
16933}) {
16934 const plugin = getParserPluginByParserName(plugins, parser);
16935 return initParser(plugin, parser);
16936}
16937function initParser(plugin, parserName) {
16938 const parserOrParserInitFunction = plugin.parsers[parserName];
16939 return typeof parserOrParserInitFunction === "function" ? parserOrParserInitFunction() : parserOrParserInitFunction;
16940}
16941function initPrinter(plugin, astFormat) {
16942 const printerOrPrinterInitFunction = plugin.printers[astFormat];
16943 return typeof printerOrPrinterInitFunction === "function" ? printerOrPrinterInitFunction() : printerOrPrinterInitFunction;
16944}
16945
16946// src/main/normalize-format-options.js
16947var formatOptionsHiddenDefaults = {
16948 astFormat: "estree",
16949 printer: {},
16950 originalText: void 0,
16951 locStart: null,
16952 locEnd: null
16953};
16954async function normalizeFormatOptions(options8, opts = {}) {
16955 var _a;
16956 const rawOptions = { ...options8 };
16957 if (!rawOptions.parser) {
16958 if (!rawOptions.filepath) {
16959 throw new UndefinedParserError(
16960 "No parser and no file path given, couldn't infer a parser."
16961 );
16962 } else {
16963 rawOptions.parser = infer_parser_default(rawOptions, {
16964 physicalFile: rawOptions.filepath
16965 });
16966 if (!rawOptions.parser) {
16967 throw new UndefinedParserError(
16968 `No parser could be inferred for file "${rawOptions.filepath}".`
16969 );
16970 }
16971 }
16972 }
16973 const supportOptions = getSupportInfo({
16974 plugins: options8.plugins,
16975 showDeprecated: true
16976 }).options;
16977 const defaults = {
16978 ...formatOptionsHiddenDefaults,
16979 ...Object.fromEntries(
16980 supportOptions.filter((optionInfo) => optionInfo.default !== void 0).map((option) => [option.name, option.default])
16981 )
16982 };
16983 const parserPlugin = getParserPluginByParserName(
16984 rawOptions.plugins,
16985 rawOptions.parser
16986 );
16987 const parser = await initParser(parserPlugin, rawOptions.parser);
16988 rawOptions.astFormat = parser.astFormat;
16989 rawOptions.locEnd = parser.locEnd;
16990 rawOptions.locStart = parser.locStart;
16991 const printerPlugin = ((_a = parserPlugin.printers) == null ? void 0 : _a[parser.astFormat]) ? parserPlugin : getPrinterPluginByAstFormat(rawOptions.plugins, parser.astFormat);
16992 const printer = await initPrinter(printerPlugin, parser.astFormat);
16993 rawOptions.printer = printer;
16994 const pluginDefaults = printerPlugin.defaultOptions ? Object.fromEntries(
16995 Object.entries(printerPlugin.defaultOptions).filter(
16996 ([, value]) => value !== void 0
16997 )
16998 ) : {};
16999 const mixedDefaults = { ...defaults, ...pluginDefaults };
17000 for (const [k, value] of Object.entries(mixedDefaults)) {
17001 if (rawOptions[k] === null || rawOptions[k] === void 0) {
17002 rawOptions[k] = value;
17003 }
17004 }
17005 if (rawOptions.parser === "json") {
17006 rawOptions.trailingComma = "none";
17007 }
17008 return normalize_options_default(rawOptions, supportOptions, {
17009 passThrough: Object.keys(formatOptionsHiddenDefaults),
17010 ...opts
17011 });
17012}
17013var normalize_format_options_default = normalizeFormatOptions;
17014
17015// src/main/create-get-visitor-keys-function.js
17016var nonTraversableKeys = /* @__PURE__ */ new Set([
17017 "tokens",
17018 "comments",
17019 "parent",
17020 "enclosingNode",
17021 "precedingNode",
17022 "followingNode"
17023]);
17024var defaultGetVisitorKeys = (node) => Object.keys(node).filter((key) => !nonTraversableKeys.has(key));
17025function createGetVisitorKeysFunction(printerGetVisitorKeys) {
17026 return printerGetVisitorKeys ? (node) => printerGetVisitorKeys(node, nonTraversableKeys) : defaultGetVisitorKeys;
17027}
17028var create_get_visitor_keys_function_default = createGetVisitorKeysFunction;
17029
17030// src/main/massage-ast.js
17031function massageAst(ast, options8) {
17032 const {
17033 printer: {
17034 massageAstNode: cleanFunction,
17035 getVisitorKeys: printerGetVisitorKeys
17036 }
17037 } = options8;
17038 if (!cleanFunction) {
17039 return ast;
17040 }
17041 const getVisitorKeys = create_get_visitor_keys_function_default(printerGetVisitorKeys);
17042 const ignoredProperties = cleanFunction.ignoredProperties ?? /* @__PURE__ */ new Set();
17043 return recurse(ast);
17044 function recurse(node, parent) {
17045 if (!(node !== null && typeof node === "object")) {
17046 return node;
17047 }
17048 if (Array.isArray(node)) {
17049 return node.map((child) => recurse(child, parent)).filter(Boolean);
17050 }
17051 const newObj = {};
17052 const childrenKeys = new Set(getVisitorKeys(node));
17053 for (const key in node) {
17054 if (!Object.prototype.hasOwnProperty.call(node, key) || ignoredProperties.has(key)) {
17055 continue;
17056 }
17057 if (childrenKeys.has(key)) {
17058 newObj[key] = recurse(node[key], node);
17059 } else {
17060 newObj[key] = node[key];
17061 }
17062 }
17063 const result = cleanFunction(node, newObj, parent);
17064 if (result === null) {
17065 return;
17066 }
17067 return result ?? newObj;
17068 }
17069}
17070var massage_ast_default = massageAst;
17071
17072// src/main/parse.js
17073var import_code_frame = __toESM(require_lib4(), 1);
17074async function parse(originalText, options8) {
17075 const parser = await resolveParser(options8);
17076 const text = parser.preprocess ? parser.preprocess(originalText, options8) : originalText;
17077 options8.originalText = text;
17078 let ast;
17079 try {
17080 ast = await parser.parse(
17081 text,
17082 options8,
17083 // TODO: remove the third argument in v4
17084 // The duplicated argument is passed as intended, see #10156
17085 options8
17086 );
17087 } catch (error) {
17088 handleParseError(error, originalText);
17089 }
17090 return { text, ast };
17091}
17092function handleParseError(error, text) {
17093 const { loc } = error;
17094 if (loc) {
17095 const codeFrame = (0, import_code_frame.codeFrameColumns)(text, loc, { highlightCode: true });
17096 error.message += "\n" + codeFrame;
17097 error.codeFrame = codeFrame;
17098 throw error;
17099 }
17100 throw error;
17101}
17102var parse_default = parse;
17103
17104// src/common/ast-path.js
17105var _getNodeStackIndex, getNodeStackIndex_fn, _getAncestors, getAncestors_fn;
17106var AstPath = class {
17107 constructor(value) {
17108 __privateAdd(this, _getNodeStackIndex);
17109 __privateAdd(this, _getAncestors);
17110 this.stack = [value];
17111 }
17112 /** @type {string | null} */
17113 get key() {
17114 const {
17115 stack,
17116 siblings
17117 } = this;
17118 return at_default(
17119 /* isOptionalObject*/
17120 false,
17121 stack,
17122 siblings === null ? -2 : -4
17123 ) ?? null;
17124 }
17125 /** @type {number | null} */
17126 get index() {
17127 return this.siblings === null ? null : at_default(
17128 /* isOptionalObject*/
17129 false,
17130 this.stack,
17131 -2
17132 );
17133 }
17134 /** @type {object} */
17135 get node() {
17136 return at_default(
17137 /* isOptionalObject*/
17138 false,
17139 this.stack,
17140 -1
17141 );
17142 }
17143 /** @type {object | null} */
17144 get parent() {
17145 return this.getNode(1);
17146 }
17147 /** @type {object | null} */
17148 get grandparent() {
17149 return this.getNode(2);
17150 }
17151 /** @type {boolean} */
17152 get isInArray() {
17153 return this.siblings !== null;
17154 }
17155 /** @type {object[] | null} */
17156 get siblings() {
17157 const {
17158 stack
17159 } = this;
17160 const maybeArray = at_default(
17161 /* isOptionalObject*/
17162 false,
17163 stack,
17164 -3
17165 );
17166 return Array.isArray(maybeArray) ? maybeArray : null;
17167 }
17168 /** @type {object | null} */
17169 get next() {
17170 const {
17171 siblings
17172 } = this;
17173 return siblings === null ? null : siblings[this.index + 1];
17174 }
17175 /** @type {object | null} */
17176 get previous() {
17177 const {
17178 siblings
17179 } = this;
17180 return siblings === null ? null : siblings[this.index - 1];
17181 }
17182 /** @type {boolean} */
17183 get isFirst() {
17184 return this.index === 0;
17185 }
17186 /** @type {boolean} */
17187 get isLast() {
17188 const {
17189 siblings,
17190 index
17191 } = this;
17192 return siblings !== null && index === siblings.length - 1;
17193 }
17194 /** @type {boolean} */
17195 get isRoot() {
17196 return this.stack.length === 1;
17197 }
17198 /** @type {object} */
17199 get root() {
17200 return this.stack[0];
17201 }
17202 /** @type {object[]} */
17203 get ancestors() {
17204 return [...__privateMethod(this, _getAncestors, getAncestors_fn).call(this)];
17205 }
17206 // The name of the current property is always the penultimate element of
17207 // this.stack, and always a string/number/symbol.
17208 getName() {
17209 const {
17210 stack
17211 } = this;
17212 const {
17213 length
17214 } = stack;
17215 if (length > 1) {
17216 return at_default(
17217 /* isOptionalObject*/
17218 false,
17219 stack,
17220 -2
17221 );
17222 }
17223 return null;
17224 }
17225 // The value of the current property is always the final element of
17226 // this.stack.
17227 getValue() {
17228 return at_default(
17229 /* isOptionalObject*/
17230 false,
17231 this.stack,
17232 -1
17233 );
17234 }
17235 getNode(count = 0) {
17236 const stackIndex = __privateMethod(this, _getNodeStackIndex, getNodeStackIndex_fn).call(this, count);
17237 return stackIndex === -1 ? null : this.stack[stackIndex];
17238 }
17239 getParentNode(count = 0) {
17240 return this.getNode(count + 1);
17241 }
17242 // Temporarily push properties named by string arguments given after the
17243 // callback function onto this.stack, then call the callback with a
17244 // reference to this (modified) AstPath object. Note that the stack will
17245 // be restored to its original state after the callback is finished, so it
17246 // is probably a mistake to retain a reference to the path.
17247 call(callback, ...names) {
17248 const {
17249 stack
17250 } = this;
17251 const {
17252 length
17253 } = stack;
17254 let value = at_default(
17255 /* isOptionalObject*/
17256 false,
17257 stack,
17258 -1
17259 );
17260 for (const name of names) {
17261 value = value[name];
17262 stack.push(name, value);
17263 }
17264 try {
17265 return callback(this);
17266 } finally {
17267 stack.length = length;
17268 }
17269 }
17270 callParent(callback, count = 0) {
17271 const stackIndex = __privateMethod(this, _getNodeStackIndex, getNodeStackIndex_fn).call(this, count + 1);
17272 const parentValues = this.stack.splice(stackIndex + 1);
17273 try {
17274 return callback(this);
17275 } finally {
17276 this.stack.push(...parentValues);
17277 }
17278 }
17279 // Similar to AstPath.prototype.call, except that the value obtained by
17280 // accessing this.getValue()[name1][name2]... should be array. The
17281 // callback will be called with a reference to this path object for each
17282 // element of the array.
17283 each(callback, ...names) {
17284 const {
17285 stack
17286 } = this;
17287 const {
17288 length
17289 } = stack;
17290 let value = at_default(
17291 /* isOptionalObject*/
17292 false,
17293 stack,
17294 -1
17295 );
17296 for (const name of names) {
17297 value = value[name];
17298 stack.push(name, value);
17299 }
17300 try {
17301 for (let i = 0; i < value.length; ++i) {
17302 stack.push(i, value[i]);
17303 callback(this, i, value);
17304 stack.length -= 2;
17305 }
17306 } finally {
17307 stack.length = length;
17308 }
17309 }
17310 // Similar to AstPath.prototype.each, except that the results of the
17311 // callback function invocations are stored in an array and returned at
17312 // the end of the iteration.
17313 map(callback, ...names) {
17314 const result = [];
17315 this.each((path9, index, value) => {
17316 result[index] = callback(path9, index, value);
17317 }, ...names);
17318 return result;
17319 }
17320 /**
17321 * @param {...(
17322 * | ((node: any, name: string | null, number: number | null) => boolean)
17323 * | undefined
17324 * )} predicates
17325 */
17326 match(...predicates) {
17327 let stackPointer = this.stack.length - 1;
17328 let name = null;
17329 let node = this.stack[stackPointer--];
17330 for (const predicate of predicates) {
17331 if (node === void 0) {
17332 return false;
17333 }
17334 let number = null;
17335 if (typeof name === "number") {
17336 number = name;
17337 name = this.stack[stackPointer--];
17338 node = this.stack[stackPointer--];
17339 }
17340 if (predicate && !predicate(node, name, number)) {
17341 return false;
17342 }
17343 name = this.stack[stackPointer--];
17344 node = this.stack[stackPointer--];
17345 }
17346 return true;
17347 }
17348 /**
17349 * Traverses the ancestors of the current node heading toward the tree root
17350 * until it finds a node that matches the provided predicate function. Will
17351 * return the first matching ancestor. If no such node exists, returns undefined.
17352 * @param {(node: any) => boolean} predicate
17353 * @internal Unstable API. Don't use in plugins for now.
17354 */
17355 findAncestor(predicate) {
17356 for (const node of __privateMethod(this, _getAncestors, getAncestors_fn).call(this)) {
17357 if (predicate(node)) {
17358 return node;
17359 }
17360 }
17361 }
17362 /**
17363 * Traverses the ancestors of the current node heading toward the tree root
17364 * until it finds a node that matches the provided predicate function.
17365 * returns true if matched node found.
17366 * @param {(node: any) => boolean} predicate
17367 * @returns {boolean}
17368 * @internal Unstable API. Don't use in plugins for now.
17369 */
17370 hasAncestor(predicate) {
17371 for (const node of __privateMethod(this, _getAncestors, getAncestors_fn).call(this)) {
17372 if (predicate(node)) {
17373 return true;
17374 }
17375 }
17376 return false;
17377 }
17378};
17379_getNodeStackIndex = new WeakSet();
17380getNodeStackIndex_fn = function(count) {
17381 const {
17382 stack
17383 } = this;
17384 for (let i = stack.length - 1; i >= 0; i -= 2) {
17385 if (!Array.isArray(stack[i]) && --count < 0) {
17386 return i;
17387 }
17388 }
17389 return -1;
17390};
17391_getAncestors = new WeakSet();
17392getAncestors_fn = function* () {
17393 const {
17394 stack
17395 } = this;
17396 for (let index = stack.length - 3; index >= 0; index -= 2) {
17397 const value = stack[index];
17398 if (!Array.isArray(value)) {
17399 yield value;
17400 }
17401 }
17402};
17403var ast_path_default = AstPath;
17404
17405// src/main/comments/attach.js
17406import assert from "assert";
17407
17408// src/utils/skip.js
17409function skip(characters) {
17410 return (text, startIndex, options8) => {
17411 const backwards = Boolean(options8 == null ? void 0 : options8.backwards);
17412 if (startIndex === false) {
17413 return false;
17414 }
17415 const { length } = text;
17416 let cursor2 = startIndex;
17417 while (cursor2 >= 0 && cursor2 < length) {
17418 const character = text.charAt(cursor2);
17419 if (characters instanceof RegExp) {
17420 if (!characters.test(character)) {
17421 return cursor2;
17422 }
17423 } else if (!characters.includes(character)) {
17424 return cursor2;
17425 }
17426 backwards ? cursor2-- : cursor2++;
17427 }
17428 if (cursor2 === -1 || cursor2 === length) {
17429 return cursor2;
17430 }
17431 return false;
17432 };
17433}
17434var skipWhitespace = skip(/\s/);
17435var skipSpaces = skip(" ");
17436var skipToLineEnd = skip(",; ");
17437var skipEverythingButNewLine = skip(/[^\n\r]/);
17438
17439// src/utils/skip-newline.js
17440function skipNewline(text, startIndex, options8) {
17441 const backwards = Boolean(options8 == null ? void 0 : options8.backwards);
17442 if (startIndex === false) {
17443 return false;
17444 }
17445 const character = text.charAt(startIndex);
17446 if (backwards) {
17447 if (text.charAt(startIndex - 1) === "\r" && character === "\n") {
17448 return startIndex - 2;
17449 }
17450 if (character === "\n" || character === "\r" || character === "\u2028" || character === "\u2029") {
17451 return startIndex - 1;
17452 }
17453 } else {
17454 if (character === "\r" && text.charAt(startIndex + 1) === "\n") {
17455 return startIndex + 2;
17456 }
17457 if (character === "\n" || character === "\r" || character === "\u2028" || character === "\u2029") {
17458 return startIndex + 1;
17459 }
17460 }
17461 return startIndex;
17462}
17463var skip_newline_default = skipNewline;
17464
17465// src/utils/has-newline.js
17466function hasNewline(text, startIndex, options8 = {}) {
17467 const idx = skipSpaces(
17468 text,
17469 options8.backwards ? startIndex - 1 : startIndex,
17470 options8
17471 );
17472 const idx2 = skip_newline_default(text, idx, options8);
17473 return idx !== idx2;
17474}
17475var has_newline_default = hasNewline;
17476
17477// src/utils/is-non-empty-array.js
17478function isNonEmptyArray(object) {
17479 return Array.isArray(object) && object.length > 0;
17480}
17481var is_non_empty_array_default = isNonEmptyArray;
17482
17483// src/utils/is-object.js
17484function isObject(object) {
17485 return object !== null && typeof object === "object";
17486}
17487var is_object_default = isObject;
17488
17489// src/utils/ast-utils.js
17490function* getChildren(node, options8) {
17491 const { getVisitorKeys, filter = () => true } = options8;
17492 const isMatchedNode = (node2) => is_object_default(node2) && filter(node2);
17493 for (const key of getVisitorKeys(node)) {
17494 const value = node[key];
17495 if (Array.isArray(value)) {
17496 for (const child of value) {
17497 if (isMatchedNode(child)) {
17498 yield child;
17499 }
17500 }
17501 } else if (isMatchedNode(value)) {
17502 yield value;
17503 }
17504 }
17505}
17506function* getDescendants(node, options8) {
17507 const queue = [node];
17508 for (let index = 0; index < queue.length; index++) {
17509 const node2 = queue[index];
17510 for (const child of getChildren(node2, options8)) {
17511 yield child;
17512 queue.push(child);
17513 }
17514 }
17515}
17516
17517// src/main/comments/utils.js
17518function describeNodeForDebugging(node) {
17519 const nodeType = node.type || node.kind || "(unknown type)";
17520 let nodeName = String(
17521 node.name || node.id && (typeof node.id === "object" ? node.id.name : node.id) || node.key && (typeof node.key === "object" ? node.key.name : node.key) || node.value && (typeof node.value === "object" ? "" : String(node.value)) || node.operator || ""
17522 );
17523 if (nodeName.length > 20) {
17524 nodeName = nodeName.slice(0, 19) + "\u2026";
17525 }
17526 return nodeType + (nodeName ? " " + nodeName : "");
17527}
17528function addCommentHelper(node, comment) {
17529 const comments = node.comments ?? (node.comments = []);
17530 comments.push(comment);
17531 comment.printed = false;
17532 comment.nodeDescription = describeNodeForDebugging(node);
17533}
17534function addLeadingComment(node, comment) {
17535 comment.leading = true;
17536 comment.trailing = false;
17537 addCommentHelper(node, comment);
17538}
17539function addDanglingComment(node, comment, marker) {
17540 comment.leading = false;
17541 comment.trailing = false;
17542 if (marker) {
17543 comment.marker = marker;
17544 }
17545 addCommentHelper(node, comment);
17546}
17547function addTrailingComment(node, comment) {
17548 comment.leading = false;
17549 comment.trailing = true;
17550 addCommentHelper(node, comment);
17551}
17552
17553// src/main/comments/attach.js
17554var childNodesCache = /* @__PURE__ */ new WeakMap();
17555function getSortedChildNodes(node, options8) {
17556 if (childNodesCache.has(node)) {
17557 return childNodesCache.get(node);
17558 }
17559 const {
17560 printer: {
17561 getCommentChildNodes,
17562 canAttachComment,
17563 getVisitorKeys: printerGetVisitorKeys
17564 },
17565 locStart,
17566 locEnd
17567 } = options8;
17568 if (!canAttachComment) {
17569 return [];
17570 }
17571 const childNodes = ((getCommentChildNodes == null ? void 0 : getCommentChildNodes(node, options8)) ?? [
17572 ...getChildren(node, {
17573 getVisitorKeys: create_get_visitor_keys_function_default(printerGetVisitorKeys)
17574 })
17575 ]).flatMap(
17576 (node2) => canAttachComment(node2) ? [node2] : getSortedChildNodes(node2, options8)
17577 );
17578 childNodes.sort(
17579 (nodeA, nodeB) => locStart(nodeA) - locStart(nodeB) || locEnd(nodeA) - locEnd(nodeB)
17580 );
17581 childNodesCache.set(node, childNodes);
17582 return childNodes;
17583}
17584function decorateComment(node, comment, options8, enclosingNode) {
17585 const { locStart, locEnd } = options8;
17586 const commentStart = locStart(comment);
17587 const commentEnd = locEnd(comment);
17588 const childNodes = getSortedChildNodes(node, options8);
17589 let precedingNode;
17590 let followingNode;
17591 let left = 0;
17592 let right = childNodes.length;
17593 while (left < right) {
17594 const middle = left + right >> 1;
17595 const child = childNodes[middle];
17596 const start = locStart(child);
17597 const end = locEnd(child);
17598 if (start <= commentStart && commentEnd <= end) {
17599 return decorateComment(child, comment, options8, child);
17600 }
17601 if (end <= commentStart) {
17602 precedingNode = child;
17603 left = middle + 1;
17604 continue;
17605 }
17606 if (commentEnd <= start) {
17607 followingNode = child;
17608 right = middle;
17609 continue;
17610 }
17611 throw new Error("Comment location overlaps with node location");
17612 }
17613 if ((enclosingNode == null ? void 0 : enclosingNode.type) === "TemplateLiteral") {
17614 const { quasis } = enclosingNode;
17615 const commentIndex = findExpressionIndexForComment(
17616 quasis,
17617 comment,
17618 options8
17619 );
17620 if (precedingNode && findExpressionIndexForComment(quasis, precedingNode, options8) !== commentIndex) {
17621 precedingNode = null;
17622 }
17623 if (followingNode && findExpressionIndexForComment(quasis, followingNode, options8) !== commentIndex) {
17624 followingNode = null;
17625 }
17626 }
17627 return { enclosingNode, precedingNode, followingNode };
17628}
17629var returnFalse = () => false;
17630function attachComments(ast, options8) {
17631 const { comments } = ast;
17632 delete ast.comments;
17633 if (!is_non_empty_array_default(comments) || !options8.printer.canAttachComment) {
17634 return;
17635 }
17636 const tiesToBreak = [];
17637 const {
17638 locStart,
17639 locEnd,
17640 printer: {
17641 experimentalFeatures: {
17642 // TODO: Make this as default behavior
17643 avoidAstMutation = false
17644 } = {},
17645 handleComments = {}
17646 },
17647 originalText: text
17648 } = options8;
17649 const {
17650 ownLine: handleOwnLineComment = returnFalse,
17651 endOfLine: handleEndOfLineComment = returnFalse,
17652 remaining: handleRemainingComment = returnFalse
17653 } = handleComments;
17654 const decoratedComments = comments.map((comment, index) => ({
17655 ...decorateComment(ast, comment, options8),
17656 comment,
17657 text,
17658 options: options8,
17659 ast,
17660 isLastComment: comments.length - 1 === index
17661 }));
17662 for (const [index, context] of decoratedComments.entries()) {
17663 const {
17664 comment,
17665 precedingNode,
17666 enclosingNode,
17667 followingNode,
17668 text: text2,
17669 options: options9,
17670 ast: ast2,
17671 isLastComment
17672 } = context;
17673 if (options9.parser === "json" || options9.parser === "json5" || options9.parser === "__js_expression" || options9.parser === "__ts_expression" || options9.parser === "__vue_expression" || options9.parser === "__vue_ts_expression") {
17674 if (locStart(comment) - locStart(ast2) <= 0) {
17675 addLeadingComment(ast2, comment);
17676 continue;
17677 }
17678 if (locEnd(comment) - locEnd(ast2) >= 0) {
17679 addTrailingComment(ast2, comment);
17680 continue;
17681 }
17682 }
17683 let args;
17684 if (avoidAstMutation) {
17685 args = [context];
17686 } else {
17687 comment.enclosingNode = enclosingNode;
17688 comment.precedingNode = precedingNode;
17689 comment.followingNode = followingNode;
17690 args = [comment, text2, options9, ast2, isLastComment];
17691 }
17692 if (isOwnLineComment(text2, options9, decoratedComments, index)) {
17693 comment.placement = "ownLine";
17694 if (handleOwnLineComment(...args)) {
17695 } else if (followingNode) {
17696 addLeadingComment(followingNode, comment);
17697 } else if (precedingNode) {
17698 addTrailingComment(precedingNode, comment);
17699 } else if (enclosingNode) {
17700 addDanglingComment(enclosingNode, comment);
17701 } else {
17702 addDanglingComment(ast2, comment);
17703 }
17704 } else if (isEndOfLineComment(text2, options9, decoratedComments, index)) {
17705 comment.placement = "endOfLine";
17706 if (handleEndOfLineComment(...args)) {
17707 } else if (precedingNode) {
17708 addTrailingComment(precedingNode, comment);
17709 } else if (followingNode) {
17710 addLeadingComment(followingNode, comment);
17711 } else if (enclosingNode) {
17712 addDanglingComment(enclosingNode, comment);
17713 } else {
17714 addDanglingComment(ast2, comment);
17715 }
17716 } else {
17717 comment.placement = "remaining";
17718 if (handleRemainingComment(...args)) {
17719 } else if (precedingNode && followingNode) {
17720 const tieCount = tiesToBreak.length;
17721 if (tieCount > 0) {
17722 const lastTie = tiesToBreak[tieCount - 1];
17723 if (lastTie.followingNode !== followingNode) {
17724 breakTies(tiesToBreak, options9);
17725 }
17726 }
17727 tiesToBreak.push(context);
17728 } else if (precedingNode) {
17729 addTrailingComment(precedingNode, comment);
17730 } else if (followingNode) {
17731 addLeadingComment(followingNode, comment);
17732 } else if (enclosingNode) {
17733 addDanglingComment(enclosingNode, comment);
17734 } else {
17735 addDanglingComment(ast2, comment);
17736 }
17737 }
17738 }
17739 breakTies(tiesToBreak, options8);
17740 if (!avoidAstMutation) {
17741 for (const comment of comments) {
17742 delete comment.precedingNode;
17743 delete comment.enclosingNode;
17744 delete comment.followingNode;
17745 }
17746 }
17747}
17748var isAllEmptyAndNoLineBreak = (text) => !/[\S\n\u2028\u2029]/.test(text);
17749function isOwnLineComment(text, options8, decoratedComments, commentIndex) {
17750 const { comment, precedingNode } = decoratedComments[commentIndex];
17751 const { locStart, locEnd } = options8;
17752 let start = locStart(comment);
17753 if (precedingNode) {
17754 for (let index = commentIndex - 1; index >= 0; index--) {
17755 const { comment: comment2, precedingNode: currentCommentPrecedingNode } = decoratedComments[index];
17756 if (currentCommentPrecedingNode !== precedingNode || !isAllEmptyAndNoLineBreak(text.slice(locEnd(comment2), start))) {
17757 break;
17758 }
17759 start = locStart(comment2);
17760 }
17761 }
17762 return has_newline_default(text, start, { backwards: true });
17763}
17764function isEndOfLineComment(text, options8, decoratedComments, commentIndex) {
17765 const { comment, followingNode } = decoratedComments[commentIndex];
17766 const { locStart, locEnd } = options8;
17767 let end = locEnd(comment);
17768 if (followingNode) {
17769 for (let index = commentIndex + 1; index < decoratedComments.length; index++) {
17770 const { comment: comment2, followingNode: currentCommentFollowingNode } = decoratedComments[index];
17771 if (currentCommentFollowingNode !== followingNode || !isAllEmptyAndNoLineBreak(text.slice(end, locStart(comment2)))) {
17772 break;
17773 }
17774 end = locEnd(comment2);
17775 }
17776 }
17777 return has_newline_default(text, end);
17778}
17779function breakTies(tiesToBreak, options8) {
17780 var _a, _b;
17781 const tieCount = tiesToBreak.length;
17782 if (tieCount === 0) {
17783 return;
17784 }
17785 const { precedingNode, followingNode } = tiesToBreak[0];
17786 let gapEndPos = options8.locStart(followingNode);
17787 let indexOfFirstLeadingComment;
17788 for (indexOfFirstLeadingComment = tieCount; indexOfFirstLeadingComment > 0; --indexOfFirstLeadingComment) {
17789 const {
17790 comment,
17791 precedingNode: currentCommentPrecedingNode,
17792 followingNode: currentCommentFollowingNode
17793 } = tiesToBreak[indexOfFirstLeadingComment - 1];
17794 assert.strictEqual(currentCommentPrecedingNode, precedingNode);
17795 assert.strictEqual(currentCommentFollowingNode, followingNode);
17796 const gap = options8.originalText.slice(options8.locEnd(comment), gapEndPos);
17797 if (((_b = (_a = options8.printer).isGap) == null ? void 0 : _b.call(_a, gap, options8)) ?? /^[\s(]*$/.test(gap)) {
17798 gapEndPos = options8.locStart(comment);
17799 } else {
17800 break;
17801 }
17802 }
17803 for (const [i, { comment }] of tiesToBreak.entries()) {
17804 if (i < indexOfFirstLeadingComment) {
17805 addTrailingComment(precedingNode, comment);
17806 } else {
17807 addLeadingComment(followingNode, comment);
17808 }
17809 }
17810 for (const node of [precedingNode, followingNode]) {
17811 if (node.comments && node.comments.length > 1) {
17812 node.comments.sort((a, b) => options8.locStart(a) - options8.locStart(b));
17813 }
17814 }
17815 tiesToBreak.length = 0;
17816}
17817function findExpressionIndexForComment(quasis, comment, options8) {
17818 const startPos = options8.locStart(comment) - 1;
17819 for (let i = 1; i < quasis.length; ++i) {
17820 if (startPos < options8.locStart(quasis[i])) {
17821 return i - 1;
17822 }
17823 }
17824 return 0;
17825}
17826
17827// src/utils/is-previous-line-empty.js
17828function isPreviousLineEmpty(text, startIndex) {
17829 let idx = startIndex - 1;
17830 idx = skipSpaces(text, idx, { backwards: true });
17831 idx = skip_newline_default(text, idx, { backwards: true });
17832 idx = skipSpaces(text, idx, { backwards: true });
17833 const idx2 = skip_newline_default(text, idx, { backwards: true });
17834 return idx !== idx2;
17835}
17836var is_previous_line_empty_default = isPreviousLineEmpty;
17837
17838// src/main/comments/print.js
17839function printComment(path9, options8) {
17840 const comment = path9.node;
17841 comment.printed = true;
17842 return options8.printer.printComment(path9, options8);
17843}
17844function printLeadingComment(path9, options8) {
17845 var _a;
17846 const comment = path9.node;
17847 const parts = [printComment(path9, options8)];
17848 const { printer, originalText, locStart, locEnd } = options8;
17849 const isBlock = (_a = printer.isBlockComment) == null ? void 0 : _a.call(printer, comment);
17850 if (isBlock) {
17851 const lineBreak = has_newline_default(originalText, locEnd(comment)) ? has_newline_default(originalText, locStart(comment), {
17852 backwards: true
17853 }) ? hardline : line : " ";
17854 parts.push(lineBreak);
17855 } else {
17856 parts.push(hardline);
17857 }
17858 const index = skip_newline_default(
17859 originalText,
17860 skipSpaces(originalText, locEnd(comment))
17861 );
17862 if (index !== false && has_newline_default(originalText, index)) {
17863 parts.push(hardline);
17864 }
17865 return parts;
17866}
17867function printTrailingComment(path9, options8, previousComment) {
17868 var _a;
17869 const comment = path9.node;
17870 const printed = printComment(path9, options8);
17871 const { printer, originalText, locStart } = options8;
17872 const isBlock = (_a = printer.isBlockComment) == null ? void 0 : _a.call(printer, comment);
17873 if ((previousComment == null ? void 0 : previousComment.hasLineSuffix) && !(previousComment == null ? void 0 : previousComment.isBlock) || has_newline_default(originalText, locStart(comment), { backwards: true })) {
17874 const isLineBeforeEmpty = is_previous_line_empty_default(
17875 originalText,
17876 locStart(comment)
17877 );
17878 return {
17879 doc: lineSuffix([hardline, isLineBeforeEmpty ? hardline : "", printed]),
17880 isBlock,
17881 hasLineSuffix: true
17882 };
17883 }
17884 if (!isBlock || (previousComment == null ? void 0 : previousComment.hasLineSuffix)) {
17885 return {
17886 doc: [lineSuffix([" ", printed]), breakParent],
17887 isBlock,
17888 hasLineSuffix: true
17889 };
17890 }
17891 return { doc: [" ", printed], isBlock, hasLineSuffix: false };
17892}
17893function printCommentsSeparately(path9, options8) {
17894 const value = path9.node;
17895 if (!value) {
17896 return {};
17897 }
17898 const ignored = options8[Symbol.for("printedComments")];
17899 const comments = (value.comments || []).filter(
17900 (comment) => !ignored.has(comment)
17901 );
17902 if (comments.length === 0) {
17903 return { leading: "", trailing: "" };
17904 }
17905 const leadingParts = [];
17906 const trailingParts = [];
17907 let printedTrailingComment;
17908 path9.each(() => {
17909 const comment = path9.node;
17910 if (ignored == null ? void 0 : ignored.has(comment)) {
17911 return;
17912 }
17913 const { leading, trailing } = comment;
17914 if (leading) {
17915 leadingParts.push(printLeadingComment(path9, options8));
17916 } else if (trailing) {
17917 printedTrailingComment = printTrailingComment(
17918 path9,
17919 options8,
17920 printedTrailingComment
17921 );
17922 trailingParts.push(printedTrailingComment.doc);
17923 }
17924 }, "comments");
17925 return { leading: leadingParts, trailing: trailingParts };
17926}
17927function printComments(path9, doc2, options8) {
17928 const { leading, trailing } = printCommentsSeparately(path9, options8);
17929 if (!leading && !trailing) {
17930 return doc2;
17931 }
17932 return inheritLabel(doc2, (doc3) => [leading, doc3, trailing]);
17933}
17934function ensureAllCommentsPrinted(options8) {
17935 const {
17936 [Symbol.for("comments")]: comments,
17937 [Symbol.for("printedComments")]: printedComments
17938 } = options8;
17939 for (const comment of comments) {
17940 if (!comment.printed && !printedComments.has(comment)) {
17941 throw new Error(
17942 'Comment "' + comment.value.trim() + '" was not printed. Please report this error!'
17943 );
17944 }
17945 delete comment.printed;
17946 }
17947}
17948
17949// src/main/multiparser.js
17950async function printEmbeddedLanguages(path9, genericPrint, options8, printAstToDoc2, embeds) {
17951 const {
17952 embeddedLanguageFormatting,
17953 printer: {
17954 embed,
17955 hasPrettierIgnore = () => false,
17956 getVisitorKeys: printerGetVisitorKeys
17957 }
17958 } = options8;
17959 if (!embed || embeddedLanguageFormatting !== "auto") {
17960 return;
17961 }
17962 if (embed.length > 2) {
17963 throw new Error(
17964 "printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/en/plugins.html#optional-embed"
17965 );
17966 }
17967 const getVisitorKeys = create_get_visitor_keys_function_default(
17968 embed.getVisitorKeys ?? printerGetVisitorKeys
17969 );
17970 const embedCallResults = [];
17971 recurse();
17972 const originalPathStack = path9.stack;
17973 for (const { print, node, pathStack } of embedCallResults) {
17974 try {
17975 path9.stack = pathStack;
17976 const doc2 = await print(textToDocForEmbed, genericPrint, path9, options8);
17977 if (doc2) {
17978 embeds.set(node, doc2);
17979 }
17980 } catch (error) {
17981 if (process.env.PRETTIER_DEBUG) {
17982 throw error;
17983 }
17984 }
17985 }
17986 path9.stack = originalPathStack;
17987 function textToDocForEmbed(text, partialNextOptions) {
17988 return textToDoc(text, partialNextOptions, options8, printAstToDoc2);
17989 }
17990 function recurse() {
17991 const { node } = path9;
17992 if (node === null || typeof node !== "object" || hasPrettierIgnore(path9)) {
17993 return;
17994 }
17995 for (const key of getVisitorKeys(node)) {
17996 if (Array.isArray(node[key])) {
17997 path9.each(recurse, key);
17998 } else {
17999 path9.call(recurse, key);
18000 }
18001 }
18002 const result = embed(path9, options8);
18003 if (!result) {
18004 return;
18005 }
18006 if (typeof result === "function") {
18007 embedCallResults.push({
18008 print: result,
18009 node,
18010 pathStack: [...path9.stack]
18011 });
18012 return;
18013 }
18014 if (false) {
18015 throw new Error(
18016 "`embed` should return an async function instead of Promise."
18017 );
18018 }
18019 embeds.set(node, result);
18020 }
18021}
18022async function textToDoc(text, partialNextOptions, parentOptions, printAstToDoc2) {
18023 const options8 = await normalize_format_options_default(
18024 {
18025 ...parentOptions,
18026 ...partialNextOptions,
18027 parentParser: parentOptions.parser,
18028 originalText: text
18029 },
18030 { passThrough: true }
18031 );
18032 const { ast } = await parse_default(text, options8);
18033 const doc2 = await printAstToDoc2(ast, options8);
18034 return stripTrailingHardline(doc2);
18035}
18036
18037// src/main/create-print-pre-check-function.js
18038function createPrintPreCheckFunction(options8) {
18039 if (true) {
18040 return () => {
18041 };
18042 }
18043 const getVisitorKeys = create_get_visitor_keys_function_default(
18044 options8.printer.getVisitorKeys
18045 );
18046 return function(path9) {
18047 if (path9.isRoot) {
18048 return;
18049 }
18050 const { key, parent } = path9;
18051 const visitorKeys = getVisitorKeys(parent);
18052 if (visitorKeys.includes(key)) {
18053 return;
18054 }
18055 throw Object.assign(new Error("Calling `print()` on non-node object."), {
18056 parentNode: parent,
18057 allowedProperties: visitorKeys,
18058 printingProperty: key,
18059 printingValue: path9.node,
18060 pathStack: path9.stack.length > 5 ? ["...", ...path9.stack.slice(-5)] : [...path9.stack]
18061 });
18062 };
18063}
18064var create_print_pre_check_function_default = createPrintPreCheckFunction;
18065
18066// src/main/print-ignored.js
18067function printIgnored(path9, options8) {
18068 const {
18069 originalText,
18070 [Symbol.for("comments")]: comments,
18071 locStart,
18072 locEnd,
18073 [Symbol.for("printedComments")]: printedComments
18074 } = options8;
18075 const { node } = path9;
18076 const start = locStart(node);
18077 const end = locEnd(node);
18078 for (const comment of comments) {
18079 if (locStart(comment) >= start && locEnd(comment) <= end) {
18080 printedComments.add(comment);
18081 }
18082 }
18083 return originalText.slice(start, end);
18084}
18085var print_ignored_default = printIgnored;
18086
18087// src/main/ast-to-doc.js
18088async function printAstToDoc(ast, options8) {
18089 ({ ast } = await prepareToPrint(ast, options8));
18090 const cache = /* @__PURE__ */ new Map();
18091 const path9 = new ast_path_default(ast);
18092 const ensurePrintingNode = create_print_pre_check_function_default(options8);
18093 const embeds = /* @__PURE__ */ new Map();
18094 await printEmbeddedLanguages(path9, mainPrint, options8, printAstToDoc, embeds);
18095 const doc2 = await callPluginPrintFunction(
18096 path9,
18097 options8,
18098 mainPrint,
18099 void 0,
18100 embeds
18101 );
18102 ensureAllCommentsPrinted(options8);
18103 return doc2;
18104 function mainPrint(selector, args) {
18105 if (selector === void 0 || selector === path9) {
18106 return mainPrintInternal(args);
18107 }
18108 if (Array.isArray(selector)) {
18109 return path9.call(() => mainPrintInternal(args), ...selector);
18110 }
18111 return path9.call(() => mainPrintInternal(args), selector);
18112 }
18113 function mainPrintInternal(args) {
18114 ensurePrintingNode(path9);
18115 const value = path9.node;
18116 if (value === void 0 || value === null) {
18117 return "";
18118 }
18119 const shouldCache = value && typeof value === "object" && args === void 0;
18120 if (shouldCache && cache.has(value)) {
18121 return cache.get(value);
18122 }
18123 const doc3 = callPluginPrintFunction(path9, options8, mainPrint, args, embeds);
18124 if (shouldCache) {
18125 cache.set(value, doc3);
18126 }
18127 return doc3;
18128 }
18129}
18130function callPluginPrintFunction(path9, options8, printPath, args, embeds) {
18131 var _a;
18132 const { node } = path9;
18133 const { printer } = options8;
18134 let doc2;
18135 if ((_a = printer.hasPrettierIgnore) == null ? void 0 : _a.call(printer, path9)) {
18136 doc2 = print_ignored_default(path9, options8);
18137 } else if (embeds.has(node)) {
18138 doc2 = embeds.get(node);
18139 } else {
18140 doc2 = printer.print(path9, options8, printPath, args);
18141 }
18142 if (printer.printComment && (!printer.willPrintOwnComments || !printer.willPrintOwnComments(path9, options8))) {
18143 doc2 = printComments(path9, doc2, options8);
18144 }
18145 if (node === options8.cursorNode) {
18146 doc2 = inheritLabel(doc2, (doc3) => [cursor, doc3, cursor]);
18147 }
18148 return doc2;
18149}
18150async function prepareToPrint(ast, options8) {
18151 const comments = ast.comments ?? [];
18152 options8[Symbol.for("comments")] = comments;
18153 options8[Symbol.for("tokens")] = ast.tokens ?? [];
18154 options8[Symbol.for("printedComments")] = /* @__PURE__ */ new Set();
18155 attachComments(ast, options8);
18156 const {
18157 printer: { preprocess }
18158 } = options8;
18159 ast = preprocess ? await preprocess(ast, options8) : ast;
18160 return { ast, comments };
18161}
18162
18163// src/main/range-util.js
18164import assert2 from "assert";
18165var isJsonParser = ({ parser }) => parser === "json" || parser === "json5" || parser === "json-stringify";
18166function findCommonAncestor(startNodeAndParents, endNodeAndParents) {
18167 const startNodeAndAncestors = [
18168 startNodeAndParents.node,
18169 ...startNodeAndParents.parentNodes
18170 ];
18171 const endNodeAndAncestors = /* @__PURE__ */ new Set([
18172 endNodeAndParents.node,
18173 ...endNodeAndParents.parentNodes
18174 ]);
18175 return startNodeAndAncestors.find(
18176 (node) => jsonSourceElements.has(node.type) && endNodeAndAncestors.has(node)
18177 );
18178}
18179function dropRootParents(parents) {
18180 let lastParentIndex = parents.length - 1;
18181 for (; ; ) {
18182 const parent = parents[lastParentIndex];
18183 if ((parent == null ? void 0 : parent.type) === "Program" || (parent == null ? void 0 : parent.type) === "File") {
18184 lastParentIndex--;
18185 } else {
18186 break;
18187 }
18188 }
18189 return parents.slice(0, lastParentIndex + 1);
18190}
18191function findSiblingAncestors(startNodeAndParents, endNodeAndParents, { locStart, locEnd }) {
18192 let resultStartNode = startNodeAndParents.node;
18193 let resultEndNode = endNodeAndParents.node;
18194 if (resultStartNode === resultEndNode) {
18195 return {
18196 startNode: resultStartNode,
18197 endNode: resultEndNode
18198 };
18199 }
18200 const startNodeStart = locStart(startNodeAndParents.node);
18201 for (const endParent of dropRootParents(endNodeAndParents.parentNodes)) {
18202 if (locStart(endParent) >= startNodeStart) {
18203 resultEndNode = endParent;
18204 } else {
18205 break;
18206 }
18207 }
18208 const endNodeEnd = locEnd(endNodeAndParents.node);
18209 for (const startParent of dropRootParents(startNodeAndParents.parentNodes)) {
18210 if (locEnd(startParent) <= endNodeEnd) {
18211 resultStartNode = startParent;
18212 } else {
18213 break;
18214 }
18215 if (resultStartNode === resultEndNode) {
18216 break;
18217 }
18218 }
18219 return {
18220 startNode: resultStartNode,
18221 endNode: resultEndNode
18222 };
18223}
18224function findNodeAtOffset(node, offset, options8, predicate, parentNodes = [], type) {
18225 const { locStart, locEnd } = options8;
18226 const start = locStart(node);
18227 const end = locEnd(node);
18228 if (offset > end || offset < start || type === "rangeEnd" && offset === start || type === "rangeStart" && offset === end) {
18229 return;
18230 }
18231 for (const childNode of getSortedChildNodes(node, options8)) {
18232 const childResult = findNodeAtOffset(
18233 childNode,
18234 offset,
18235 options8,
18236 predicate,
18237 [node, ...parentNodes],
18238 type
18239 );
18240 if (childResult) {
18241 return childResult;
18242 }
18243 }
18244 if (!predicate || predicate(node, parentNodes[0])) {
18245 return {
18246 node,
18247 parentNodes
18248 };
18249 }
18250}
18251function isJsSourceElement(type, parentType) {
18252 return parentType !== "DeclareExportDeclaration" && type !== "TypeParameterDeclaration" && (type === "Directive" || type === "TypeAlias" || type === "TSExportAssignment" || type.startsWith("Declare") || type.startsWith("TSDeclare") || type.endsWith("Statement") || type.endsWith("Declaration"));
18253}
18254var jsonSourceElements = /* @__PURE__ */ new Set([
18255 "JsonRoot",
18256 "ObjectExpression",
18257 "ArrayExpression",
18258 "StringLiteral",
18259 "NumericLiteral",
18260 "BooleanLiteral",
18261 "NullLiteral",
18262 "UnaryExpression",
18263 "TemplateLiteral"
18264]);
18265var graphqlSourceElements = /* @__PURE__ */ new Set([
18266 "OperationDefinition",
18267 "FragmentDefinition",
18268 "VariableDefinition",
18269 "TypeExtensionDefinition",
18270 "ObjectTypeDefinition",
18271 "FieldDefinition",
18272 "DirectiveDefinition",
18273 "EnumTypeDefinition",
18274 "EnumValueDefinition",
18275 "InputValueDefinition",
18276 "InputObjectTypeDefinition",
18277 "SchemaDefinition",
18278 "OperationTypeDefinition",
18279 "InterfaceTypeDefinition",
18280 "UnionTypeDefinition",
18281 "ScalarTypeDefinition"
18282]);
18283function isSourceElement(opts, node, parentNode) {
18284 if (!node) {
18285 return false;
18286 }
18287 switch (opts.parser) {
18288 case "flow":
18289 case "babel":
18290 case "babel-flow":
18291 case "babel-ts":
18292 case "typescript":
18293 case "acorn":
18294 case "espree":
18295 case "meriyah":
18296 case "__babel_estree":
18297 return isJsSourceElement(node.type, parentNode == null ? void 0 : parentNode.type);
18298 case "json":
18299 case "json5":
18300 case "json-stringify":
18301 return jsonSourceElements.has(node.type);
18302 case "graphql":
18303 return graphqlSourceElements.has(node.kind);
18304 case "vue":
18305 return node.tag !== "root";
18306 }
18307 return false;
18308}
18309function calculateRange(text, opts, ast) {
18310 let { rangeStart: start, rangeEnd: end, locStart, locEnd } = opts;
18311 assert2.ok(end > start);
18312 const firstNonWhitespaceCharacterIndex = text.slice(start, end).search(/\S/);
18313 const isAllWhitespace = firstNonWhitespaceCharacterIndex === -1;
18314 if (!isAllWhitespace) {
18315 start += firstNonWhitespaceCharacterIndex;
18316 for (; end > start; --end) {
18317 if (/\S/.test(text[end - 1])) {
18318 break;
18319 }
18320 }
18321 }
18322 const startNodeAndParents = findNodeAtOffset(
18323 ast,
18324 start,
18325 opts,
18326 (node, parentNode) => isSourceElement(opts, node, parentNode),
18327 [],
18328 "rangeStart"
18329 );
18330 const endNodeAndParents = (
18331 // No need find Node at `end`, it will be the same as `startNodeAndParents`
18332 isAllWhitespace ? startNodeAndParents : findNodeAtOffset(
18333 ast,
18334 end,
18335 opts,
18336 (node) => isSourceElement(opts, node),
18337 [],
18338 "rangeEnd"
18339 )
18340 );
18341 if (!startNodeAndParents || !endNodeAndParents) {
18342 return {
18343 rangeStart: 0,
18344 rangeEnd: 0
18345 };
18346 }
18347 let startNode;
18348 let endNode;
18349 if (isJsonParser(opts)) {
18350 const commonAncestor = findCommonAncestor(
18351 startNodeAndParents,
18352 endNodeAndParents
18353 );
18354 startNode = commonAncestor;
18355 endNode = commonAncestor;
18356 } else {
18357 ({ startNode, endNode } = findSiblingAncestors(
18358 startNodeAndParents,
18359 endNodeAndParents,
18360 opts
18361 ));
18362 }
18363 return {
18364 rangeStart: Math.min(locStart(startNode), locStart(endNode)),
18365 rangeEnd: Math.max(locEnd(startNode), locEnd(endNode))
18366 };
18367}
18368
18369// src/main/get-cursor-node.js
18370function getCursorNode(ast, options8) {
18371 const { cursorOffset, locStart, locEnd } = options8;
18372 const getVisitorKeys = create_get_visitor_keys_function_default(
18373 options8.printer.getVisitorKeys
18374 );
18375 const nodeContainsCursor = (node) => locStart(node) <= cursorOffset && locEnd(node) >= cursorOffset;
18376 let cursorNode = ast;
18377 for (const node of getDescendants(ast, {
18378 getVisitorKeys,
18379 filter: nodeContainsCursor
18380 })) {
18381 cursorNode = node;
18382 }
18383 return cursorNode;
18384}
18385var get_cursor_node_default = getCursorNode;
18386
18387// src/main/core.js
18388var BOM = "\uFEFF";
18389var CURSOR = Symbol("cursor");
18390async function coreFormat(originalText, opts, addAlignmentSize = 0) {
18391 if (!originalText || originalText.trim().length === 0) {
18392 return {
18393 formatted: "",
18394 cursorOffset: -1,
18395 comments: []
18396 };
18397 }
18398 const {
18399 ast,
18400 text
18401 } = await parse_default(originalText, opts);
18402 if (opts.cursorOffset >= 0) {
18403 opts.cursorNode = get_cursor_node_default(ast, opts);
18404 }
18405 let doc2 = await printAstToDoc(ast, opts, addAlignmentSize);
18406 if (addAlignmentSize > 0) {
18407 doc2 = addAlignmentToDoc([hardline, doc2], addAlignmentSize, opts.tabWidth);
18408 }
18409 const result = printDocToString(doc2, opts);
18410 if (addAlignmentSize > 0) {
18411 const trimmed = result.formatted.trim();
18412 if (result.cursorNodeStart !== void 0) {
18413 result.cursorNodeStart -= result.formatted.indexOf(trimmed);
18414 }
18415 result.formatted = trimmed + convertEndOfLineToChars(opts.endOfLine);
18416 }
18417 const comments = opts[Symbol.for("comments")];
18418 if (opts.cursorOffset >= 0) {
18419 let oldCursorNodeStart;
18420 let oldCursorNodeText;
18421 let cursorOffsetRelativeToOldCursorNode;
18422 let newCursorNodeStart;
18423 let newCursorNodeText;
18424 if (opts.cursorNode && result.cursorNodeText) {
18425 oldCursorNodeStart = opts.locStart(opts.cursorNode);
18426 oldCursorNodeText = text.slice(oldCursorNodeStart, opts.locEnd(opts.cursorNode));
18427 cursorOffsetRelativeToOldCursorNode = opts.cursorOffset - oldCursorNodeStart;
18428 newCursorNodeStart = result.cursorNodeStart;
18429 newCursorNodeText = result.cursorNodeText;
18430 } else {
18431 oldCursorNodeStart = 0;
18432 oldCursorNodeText = text;
18433 cursorOffsetRelativeToOldCursorNode = opts.cursorOffset;
18434 newCursorNodeStart = 0;
18435 newCursorNodeText = result.formatted;
18436 }
18437 if (oldCursorNodeText === newCursorNodeText) {
18438 return {
18439 formatted: result.formatted,
18440 cursorOffset: newCursorNodeStart + cursorOffsetRelativeToOldCursorNode,
18441 comments
18442 };
18443 }
18444 const oldCursorNodeCharArray = oldCursorNodeText.split("");
18445 oldCursorNodeCharArray.splice(cursorOffsetRelativeToOldCursorNode, 0, CURSOR);
18446 const newCursorNodeCharArray = newCursorNodeText.split("");
18447 const cursorNodeDiff = (0, import_diff.diffArrays)(oldCursorNodeCharArray, newCursorNodeCharArray);
18448 let cursorOffset = newCursorNodeStart;
18449 for (const entry of cursorNodeDiff) {
18450 if (entry.removed) {
18451 if (entry.value.includes(CURSOR)) {
18452 break;
18453 }
18454 } else {
18455 cursorOffset += entry.count;
18456 }
18457 }
18458 return {
18459 formatted: result.formatted,
18460 cursorOffset,
18461 comments
18462 };
18463 }
18464 return {
18465 formatted: result.formatted,
18466 cursorOffset: -1,
18467 comments
18468 };
18469}
18470async function formatRange(originalText, opts) {
18471 const {
18472 ast,
18473 text
18474 } = await parse_default(originalText, opts);
18475 const {
18476 rangeStart,
18477 rangeEnd
18478 } = calculateRange(text, opts, ast);
18479 const rangeString = text.slice(rangeStart, rangeEnd);
18480 const rangeStart2 = Math.min(rangeStart, text.lastIndexOf("\n", rangeStart) + 1);
18481 const indentString = text.slice(rangeStart2, rangeStart).match(/^\s*/)[0];
18482 const alignmentSize = get_alignment_size_default(indentString, opts.tabWidth);
18483 const rangeResult = await coreFormat(rangeString, {
18484 ...opts,
18485 rangeStart: 0,
18486 rangeEnd: Number.POSITIVE_INFINITY,
18487 // Track the cursor offset only if it's within our range
18488 cursorOffset: opts.cursorOffset > rangeStart && opts.cursorOffset <= rangeEnd ? opts.cursorOffset - rangeStart : -1,
18489 // Always use `lf` to format, we'll replace it later
18490 endOfLine: "lf"
18491 }, alignmentSize);
18492 const rangeTrimmed = rangeResult.formatted.trimEnd();
18493 let {
18494 cursorOffset
18495 } = opts;
18496 if (cursorOffset > rangeEnd) {
18497 cursorOffset += rangeTrimmed.length - rangeString.length;
18498 } else if (rangeResult.cursorOffset >= 0) {
18499 cursorOffset = rangeResult.cursorOffset + rangeStart;
18500 }
18501 let formatted = text.slice(0, rangeStart) + rangeTrimmed + text.slice(rangeEnd);
18502 if (opts.endOfLine !== "lf") {
18503 const eol = convertEndOfLineToChars(opts.endOfLine);
18504 if (cursorOffset >= 0 && eol === "\r\n") {
18505 cursorOffset += countEndOfLineChars(formatted.slice(0, cursorOffset), "\n");
18506 }
18507 formatted = string_replace_all_default(
18508 /* isOptionalObject*/
18509 false,
18510 formatted,
18511 "\n",
18512 eol
18513 );
18514 }
18515 return {
18516 formatted,
18517 cursorOffset,
18518 comments: rangeResult.comments
18519 };
18520}
18521function ensureIndexInText(text, index, defaultValue) {
18522 if (typeof index !== "number" || Number.isNaN(index) || index < 0 || index > text.length) {
18523 return defaultValue;
18524 }
18525 return index;
18526}
18527function normalizeIndexes(text, options8) {
18528 let {
18529 cursorOffset,
18530 rangeStart,
18531 rangeEnd
18532 } = options8;
18533 cursorOffset = ensureIndexInText(text, cursorOffset, -1);
18534 rangeStart = ensureIndexInText(text, rangeStart, 0);
18535 rangeEnd = ensureIndexInText(text, rangeEnd, text.length);
18536 return {
18537 ...options8,
18538 cursorOffset,
18539 rangeStart,
18540 rangeEnd
18541 };
18542}
18543function normalizeInputAndOptions(text, options8) {
18544 let {
18545 cursorOffset,
18546 rangeStart,
18547 rangeEnd,
18548 endOfLine
18549 } = normalizeIndexes(text, options8);
18550 const hasBOM = text.charAt(0) === BOM;
18551 if (hasBOM) {
18552 text = text.slice(1);
18553 cursorOffset--;
18554 rangeStart--;
18555 rangeEnd--;
18556 }
18557 if (endOfLine === "auto") {
18558 endOfLine = guessEndOfLine(text);
18559 }
18560 if (text.includes("\r")) {
18561 const countCrlfBefore = (index) => countEndOfLineChars(text.slice(0, Math.max(index, 0)), "\r\n");
18562 cursorOffset -= countCrlfBefore(cursorOffset);
18563 rangeStart -= countCrlfBefore(rangeStart);
18564 rangeEnd -= countCrlfBefore(rangeEnd);
18565 text = normalizeEndOfLine(text);
18566 }
18567 return {
18568 hasBOM,
18569 text,
18570 options: normalizeIndexes(text, {
18571 ...options8,
18572 cursorOffset,
18573 rangeStart,
18574 rangeEnd,
18575 endOfLine
18576 })
18577 };
18578}
18579async function hasPragma(text, options8) {
18580 const selectedParser = await resolveParser(options8);
18581 return !selectedParser.hasPragma || selectedParser.hasPragma(text);
18582}
18583async function formatWithCursor(originalText, originalOptions) {
18584 let {
18585 hasBOM,
18586 text,
18587 options: options8
18588 } = normalizeInputAndOptions(originalText, await normalize_format_options_default(originalOptions));
18589 if (options8.rangeStart >= options8.rangeEnd && text !== "" || options8.requirePragma && !await hasPragma(text, options8)) {
18590 return {
18591 formatted: originalText,
18592 cursorOffset: originalOptions.cursorOffset,
18593 comments: []
18594 };
18595 }
18596 let result;
18597 if (options8.rangeStart > 0 || options8.rangeEnd < text.length) {
18598 result = await formatRange(text, options8);
18599 } else {
18600 if (!options8.requirePragma && options8.insertPragma && options8.printer.insertPragma && !await hasPragma(text, options8)) {
18601 text = options8.printer.insertPragma(text);
18602 }
18603 result = await coreFormat(text, options8);
18604 }
18605 if (hasBOM) {
18606 result.formatted = BOM + result.formatted;
18607 if (result.cursorOffset >= 0) {
18608 result.cursorOffset++;
18609 }
18610 }
18611 return result;
18612}
18613async function parse2(originalText, originalOptions, devOptions) {
18614 const {
18615 text,
18616 options: options8
18617 } = normalizeInputAndOptions(originalText, await normalize_format_options_default(originalOptions));
18618 const parsed = await parse_default(text, options8);
18619 if (devOptions) {
18620 if (devOptions.preprocessForPrint) {
18621 parsed.ast = await prepareToPrint(parsed.ast, options8);
18622 }
18623 if (devOptions.massage) {
18624 parsed.ast = massage_ast_default(parsed.ast, options8);
18625 }
18626 }
18627 return parsed;
18628}
18629async function formatAst(ast, options8) {
18630 options8 = await normalize_format_options_default(options8);
18631 const doc2 = await printAstToDoc(ast, options8);
18632 return printDocToString(doc2, options8);
18633}
18634async function formatDoc(doc2, options8) {
18635 const text = printDocToDebug(doc2);
18636 const {
18637 formatted
18638 } = await formatWithCursor(text, {
18639 ...options8,
18640 parser: "__js_expression"
18641 });
18642 return formatted;
18643}
18644async function printToDoc(originalText, options8) {
18645 options8 = await normalize_format_options_default(options8);
18646 const {
18647 ast
18648 } = await parse_default(originalText, options8);
18649 return printAstToDoc(ast, options8);
18650}
18651async function printDocToString2(doc2, options8) {
18652 return printDocToString(doc2, await normalize_format_options_default(options8));
18653}
18654
18655// src/config/resolve-config.js
18656var import_micromatch = __toESM(require_micromatch(), 1);
18657import path5 from "path";
18658
18659// node_modules/mimic-fn/index.js
18660var copyProperty = (to, from, property, ignoreNonConfigurable) => {
18661 if (property === "length" || property === "prototype") {
18662 return;
18663 }
18664 if (property === "arguments" || property === "caller") {
18665 return;
18666 }
18667 const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
18668 const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
18669 if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
18670 return;
18671 }
18672 Object.defineProperty(to, property, fromDescriptor);
18673};
18674var canCopyProperty = function(toDescriptor, fromDescriptor) {
18675 return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
18676};
18677var changePrototype = (to, from) => {
18678 const fromPrototype = Object.getPrototypeOf(from);
18679 if (fromPrototype === Object.getPrototypeOf(to)) {
18680 return;
18681 }
18682 Object.setPrototypeOf(to, fromPrototype);
18683};
18684var wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/
18685${fromBody}`;
18686var toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString");
18687var toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
18688var changeToString = (to, from, name) => {
18689 const withName = name === "" ? "" : `with ${name.trim()}() `;
18690 const newToString = wrappedToString.bind(null, withName, from.toString());
18691 Object.defineProperty(newToString, "name", toStringName);
18692 Object.defineProperty(to, "toString", { ...toStringDescriptor, value: newToString });
18693};
18694function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
18695 const { name } = to;
18696 for (const property of Reflect.ownKeys(from)) {
18697 copyProperty(to, from, property, ignoreNonConfigurable);
18698 }
18699 changePrototype(to, from);
18700 changeToString(to, from, name);
18701 return to;
18702}
18703
18704// node_modules/mem/dist/index.js
18705var import_map_age_cleaner = __toESM(require_dist(), 1);
18706var cacheStore = /* @__PURE__ */ new WeakMap();
18707function mem(fn, { cacheKey, cache = /* @__PURE__ */ new Map(), maxAge } = {}) {
18708 if (typeof maxAge === "number") {
18709 (0, import_map_age_cleaner.default)(cache);
18710 }
18711 const memoized = function(...arguments_) {
18712 const key = cacheKey ? cacheKey(arguments_) : arguments_[0];
18713 const cacheItem = cache.get(key);
18714 if (cacheItem) {
18715 return cacheItem.data;
18716 }
18717 const result = fn.apply(this, arguments_);
18718 cache.set(key, {
18719 data: result,
18720 maxAge: maxAge ? Date.now() + maxAge : Number.POSITIVE_INFINITY
18721 });
18722 return result;
18723 };
18724 mimicFunction(memoized, fn, {
18725 ignoreNonConfigurable: true
18726 });
18727 cacheStore.set(memoized, cache);
18728 return memoized;
18729}
18730function memClear(fn) {
18731 const cache = cacheStore.get(fn);
18732 if (!cache) {
18733 throw new TypeError("Can't clear a function that was not memoized!");
18734 }
18735 if (typeof cache.clear !== "function") {
18736 throw new TypeError("The cache Map can't be cleared!");
18737 }
18738 cache.clear();
18739}
18740
18741// src/utils/partition.js
18742function partition(array, predicate) {
18743 const result = [[], []];
18744 for (const value of array) {
18745 result[predicate(value) ? 0 : 1].push(value);
18746 }
18747 return result;
18748}
18749var partition_default = partition;
18750
18751// src/config/resolve-editorconfig.js
18752var import_editorconfig = __toESM(require_src(), 1);
18753var import_editorconfig_to_prettier = __toESM(require_editorconfig_to_prettier(), 1);
18754import path2 from "path";
18755
18756// src/config/find-project-root.js
18757import fs2 from "fs";
18758import path from "path";
18759var MARKERS = [".git", ".hg"];
18760var markerExists = (directory) => MARKERS.some((mark) => fs2.existsSync(path.join(directory, mark)));
18761function findProjectRoot(directory) {
18762 while (!markerExists(directory)) {
18763 const parentDirectory = path.resolve(directory, "..");
18764 if (parentDirectory === directory) {
18765 break;
18766 }
18767 directory = parentDirectory;
18768 }
18769 return directory;
18770}
18771var find_project_root_default = findProjectRoot;
18772
18773// src/config/resolve-editorconfig.js
18774async function loadEditorConfig(filePath) {
18775 const editorConfig = await import_editorconfig.default.parse(filePath, {
18776 root: find_project_root_default(path2.dirname(path2.resolve(filePath)))
18777 });
18778 const config = (0, import_editorconfig_to_prettier.default)(editorConfig);
18779 if (config) {
18780 delete config.insertFinalNewline;
18781 }
18782 return config;
18783}
18784var resolve_editorconfig_default = loadEditorConfig;
18785
18786// src/config/get-prettier-config-explorer.js
18787var import_parse_async = __toESM(require_parse_async(), 1);
18788var import_parse3 = __toESM(require_parse3(), 1);
18789import mockable from "./internal/internal.mjs";
18790
18791// src/utils/require-from-file.js
18792import { createRequire } from "module";
18793function requireFromFile(id, parent) {
18794 const require2 = createRequire(parent);
18795 return require2(id);
18796}
18797var require_from_file_default = requireFromFile;
18798
18799// src/utils/import-from-file.js
18800import { pathToFileURL as pathToFileURL2 } from "url";
18801
18802// node_modules/import-meta-resolve/lib/resolve.js
18803import assert4 from "assert";
18804import { Stats, statSync, realpathSync } from "fs";
18805import process3 from "process";
18806import { URL as URL3, fileURLToPath as fileURLToPath3, pathToFileURL } from "url";
18807import path4 from "path";
18808import { builtinModules } from "module";
18809
18810// node_modules/import-meta-resolve/lib/get-format.js
18811import { URL as URL2, fileURLToPath as fileURLToPath2 } from "url";
18812
18813// node_modules/import-meta-resolve/lib/package-config.js
18814import { URL, fileURLToPath } from "url";
18815
18816// node_modules/import-meta-resolve/lib/errors.js
18817import v8 from "v8";
18818import process2 from "process";
18819import assert3 from "assert";
18820import { format, inspect } from "util";
18821var isWindows = process2.platform === "win32";
18822var own = {}.hasOwnProperty;
18823var classRegExp = /^([A-Z][a-z\d]*)+$/;
18824var kTypes = /* @__PURE__ */ new Set([
18825 "string",
18826 "function",
18827 "number",
18828 "object",
18829 // Accept 'Function' and 'Object' as alternative to the lower cased version.
18830 "Function",
18831 "Object",
18832 "boolean",
18833 "bigint",
18834 "symbol"
18835]);
18836var codes = {};
18837function formatList(array, type = "and") {
18838 return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array[array.length - 1]}`;
18839}
18840var messages = /* @__PURE__ */ new Map();
18841var nodeInternalPrefix = "__node_internal_";
18842var userStackTraceLimit;
18843codes.ERR_INVALID_ARG_TYPE = createError(
18844 "ERR_INVALID_ARG_TYPE",
18845 /**
18846 * @param {string} name
18847 * @param {Array<string> | string} expected
18848 * @param {unknown} actual
18849 */
18850 (name, expected, actual) => {
18851 assert3(typeof name === "string", "'name' must be a string");
18852 if (!Array.isArray(expected)) {
18853 expected = [expected];
18854 }
18855 let message = "The ";
18856 if (name.endsWith(" argument")) {
18857 message += `${name} `;
18858 } else {
18859 const type = name.includes(".") ? "property" : "argument";
18860 message += `"${name}" ${type} `;
18861 }
18862 message += "must be ";
18863 const types = [];
18864 const instances = [];
18865 const other = [];
18866 for (const value of expected) {
18867 assert3(
18868 typeof value === "string",
18869 "All expected entries have to be of type string"
18870 );
18871 if (kTypes.has(value)) {
18872 types.push(value.toLowerCase());
18873 } else if (classRegExp.exec(value) === null) {
18874 assert3(
18875 value !== "object",
18876 'The value "object" should be written as "Object"'
18877 );
18878 other.push(value);
18879 } else {
18880 instances.push(value);
18881 }
18882 }
18883 if (instances.length > 0) {
18884 const pos = types.indexOf("object");
18885 if (pos !== -1) {
18886 types.slice(pos, 1);
18887 instances.push("Object");
18888 }
18889 }
18890 if (types.length > 0) {
18891 message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(
18892 types,
18893 "or"
18894 )}`;
18895 if (instances.length > 0 || other.length > 0)
18896 message += " or ";
18897 }
18898 if (instances.length > 0) {
18899 message += `an instance of ${formatList(instances, "or")}`;
18900 if (other.length > 0)
18901 message += " or ";
18902 }
18903 if (other.length > 0) {
18904 if (other.length > 1) {
18905 message += `one of ${formatList(other, "or")}`;
18906 } else {
18907 if (other[0].toLowerCase() !== other[0])
18908 message += "an ";
18909 message += `${other[0]}`;
18910 }
18911 }
18912 message += `. Received ${determineSpecificType(actual)}`;
18913 return message;
18914 },
18915 TypeError
18916);
18917codes.ERR_INVALID_MODULE_SPECIFIER = createError(
18918 "ERR_INVALID_MODULE_SPECIFIER",
18919 /**
18920 * @param {string} request
18921 * @param {string} reason
18922 * @param {string} [base]
18923 */
18924 (request, reason, base = void 0) => {
18925 return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`;
18926 },
18927 TypeError
18928);
18929codes.ERR_INVALID_PACKAGE_CONFIG = createError(
18930 "ERR_INVALID_PACKAGE_CONFIG",
18931 /**
18932 * @param {string} path
18933 * @param {string} [base]
18934 * @param {string} [message]
18935 */
18936 (path9, base, message) => {
18937 return `Invalid package config ${path9}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
18938 },
18939 Error
18940);
18941codes.ERR_INVALID_PACKAGE_TARGET = createError(
18942 "ERR_INVALID_PACKAGE_TARGET",
18943 /**
18944 * @param {string} pkgPath
18945 * @param {string} key
18946 * @param {unknown} target
18947 * @param {boolean} [isImport=false]
18948 * @param {string} [base]
18949 */
18950 (pkgPath, key, target, isImport = false, base = void 0) => {
18951 const relError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");
18952 if (key === ".") {
18953 assert3(isImport === false);
18954 return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ""}${relError ? '; targets must start with "./"' : ""}`;
18955 }
18956 return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(
18957 target
18958 )} defined for '${key}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ""}${relError ? '; targets must start with "./"' : ""}`;
18959 },
18960 Error
18961);
18962codes.ERR_MODULE_NOT_FOUND = createError(
18963 "ERR_MODULE_NOT_FOUND",
18964 /**
18965 * @param {string} path
18966 * @param {string} base
18967 * @param {string} [type]
18968 */
18969 (path9, base, type = "package") => {
18970 return `Cannot find ${type} '${path9}' imported from ${base}`;
18971 },
18972 Error
18973);
18974codes.ERR_NETWORK_IMPORT_DISALLOWED = createError(
18975 "ERR_NETWORK_IMPORT_DISALLOWED",
18976 "import of '%s' by %s is not supported: %s",
18977 Error
18978);
18979codes.ERR_PACKAGE_IMPORT_NOT_DEFINED = createError(
18980 "ERR_PACKAGE_IMPORT_NOT_DEFINED",
18981 /**
18982 * @param {string} specifier
18983 * @param {string} packagePath
18984 * @param {string} base
18985 */
18986 (specifier, packagePath, base) => {
18987 return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ""} imported from ${base}`;
18988 },
18989 TypeError
18990);
18991codes.ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
18992 "ERR_PACKAGE_PATH_NOT_EXPORTED",
18993 /**
18994 * @param {string} pkgPath
18995 * @param {string} subpath
18996 * @param {string} [base]
18997 */
18998 (pkgPath, subpath, base = void 0) => {
18999 if (subpath === ".")
19000 return `No "exports" main defined in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`;
19001 return `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`;
19002 },
19003 Error
19004);
19005codes.ERR_UNSUPPORTED_DIR_IMPORT = createError(
19006 "ERR_UNSUPPORTED_DIR_IMPORT",
19007 "Directory import '%s' is not supported resolving ES modules imported from %s",
19008 Error
19009);
19010codes.ERR_UNKNOWN_FILE_EXTENSION = createError(
19011 "ERR_UNKNOWN_FILE_EXTENSION",
19012 /**
19013 * @param {string} ext
19014 * @param {string} path
19015 */
19016 (ext, path9) => {
19017 return `Unknown file extension "${ext}" for ${path9}`;
19018 },
19019 TypeError
19020);
19021codes.ERR_INVALID_ARG_VALUE = createError(
19022 "ERR_INVALID_ARG_VALUE",
19023 /**
19024 * @param {string} name
19025 * @param {unknown} value
19026 * @param {string} [reason='is invalid']
19027 */
19028 (name, value, reason = "is invalid") => {
19029 let inspected = inspect(value);
19030 if (inspected.length > 128) {
19031 inspected = `${inspected.slice(0, 128)}...`;
19032 }
19033 const type = name.includes(".") ? "property" : "argument";
19034 return `The ${type} '${name}' ${reason}. Received ${inspected}`;
19035 },
19036 TypeError
19037 // Note: extra classes have been shaken out.
19038 // , RangeError
19039);
19040codes.ERR_UNSUPPORTED_ESM_URL_SCHEME = createError(
19041 "ERR_UNSUPPORTED_ESM_URL_SCHEME",
19042 /**
19043 * @param {URL} url
19044 * @param {Array<string>} supported
19045 */
19046 (url, supported) => {
19047 let message = `Only URLs with a scheme in: ${formatList(
19048 supported
19049 )} are supported by the default ESM loader`;
19050 if (isWindows && url.protocol.length === 2) {
19051 message += ". On Windows, absolute paths must be valid file:// URLs";
19052 }
19053 message += `. Received protocol '${url.protocol}'`;
19054 return message;
19055 },
19056 Error
19057);
19058function createError(sym, value, def) {
19059 messages.set(sym, value);
19060 return makeNodeErrorWithCode(def, sym);
19061}
19062function makeNodeErrorWithCode(Base, key) {
19063 return NodeError;
19064 function NodeError(...args) {
19065 const limit = Error.stackTraceLimit;
19066 if (isErrorStackTraceLimitWritable())
19067 Error.stackTraceLimit = 0;
19068 const error = new Base();
19069 if (isErrorStackTraceLimitWritable())
19070 Error.stackTraceLimit = limit;
19071 const message = getMessage(key, args, error);
19072 Object.defineProperties(error, {
19073 // Note: no need to implement `kIsNodeError` symbol, would be hard,
19074 // probably.
19075 message: {
19076 value: message,
19077 enumerable: false,
19078 writable: true,
19079 configurable: true
19080 },
19081 toString: {
19082 /** @this {Error} */
19083 value() {
19084 return `${this.name} [${key}]: ${this.message}`;
19085 },
19086 enumerable: false,
19087 writable: true,
19088 configurable: true
19089 }
19090 });
19091 captureLargerStackTrace(error);
19092 error.code = key;
19093 return error;
19094 }
19095}
19096function isErrorStackTraceLimitWritable() {
19097 try {
19098 if (v8.startupSnapshot.isBuildingSnapshot()) {
19099 return false;
19100 }
19101 } catch {
19102 }
19103 const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
19104 if (desc === void 0) {
19105 return Object.isExtensible(Error);
19106 }
19107 return own.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
19108}
19109function hideStackFrames(fn) {
19110 const hidden = nodeInternalPrefix + fn.name;
19111 Object.defineProperty(fn, "name", { value: hidden });
19112 return fn;
19113}
19114var captureLargerStackTrace = hideStackFrames(
19115 /**
19116 * @param {Error} error
19117 * @returns {Error}
19118 */
19119 // @ts-expect-error: fine
19120 function(error) {
19121 const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();
19122 if (stackTraceLimitIsWritable) {
19123 userStackTraceLimit = Error.stackTraceLimit;
19124 Error.stackTraceLimit = Number.POSITIVE_INFINITY;
19125 }
19126 Error.captureStackTrace(error);
19127 if (stackTraceLimitIsWritable)
19128 Error.stackTraceLimit = userStackTraceLimit;
19129 return error;
19130 }
19131);
19132function getMessage(key, args, self) {
19133 const message = messages.get(key);
19134 assert3(message !== void 0, "expected `message` to be found");
19135 if (typeof message === "function") {
19136 assert3(
19137 message.length <= args.length,
19138 // Default options do not count.
19139 `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${message.length}).`
19140 );
19141 return Reflect.apply(message, self, args);
19142 }
19143 const regex = /%[dfijoOs]/g;
19144 let expectedLength = 0;
19145 while (regex.exec(message) !== null)
19146 expectedLength++;
19147 assert3(
19148 expectedLength === args.length,
19149 `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).`
19150 );
19151 if (args.length === 0)
19152 return message;
19153 args.unshift(message);
19154 return Reflect.apply(format, null, args);
19155}
19156function determineSpecificType(value) {
19157 if (value === null || value === void 0) {
19158 return String(value);
19159 }
19160 if (typeof value === "function" && value.name) {
19161 return `function ${value.name}`;
19162 }
19163 if (typeof value === "object") {
19164 if (value.constructor && value.constructor.name) {
19165 return `an instance of ${value.constructor.name}`;
19166 }
19167 return `${inspect(value, { depth: -1 })}`;
19168 }
19169 let inspected = inspect(value, { colors: false });
19170 if (inspected.length > 28) {
19171 inspected = `${inspected.slice(0, 25)}...`;
19172 }
19173 return `type ${typeof value} (${inspected})`;
19174}
19175
19176// node_modules/import-meta-resolve/lib/package-json-reader.js
19177import fs3 from "fs";
19178import path3 from "path";
19179var reader = { read };
19180var package_json_reader_default = reader;
19181function read(jsonPath) {
19182 try {
19183 const string = fs3.readFileSync(
19184 path3.toNamespacedPath(path3.join(path3.dirname(jsonPath), "package.json")),
19185 "utf8"
19186 );
19187 return { string };
19188 } catch (error) {
19189 const exception = (
19190 /** @type {ErrnoException} */
19191 error
19192 );
19193 if (exception.code === "ENOENT") {
19194 return { string: void 0 };
19195 }
19196 throw exception;
19197 }
19198}
19199
19200// node_modules/import-meta-resolve/lib/package-config.js
19201var { ERR_INVALID_PACKAGE_CONFIG } = codes;
19202var packageJsonCache = /* @__PURE__ */ new Map();
19203function getPackageConfig(path9, specifier, base) {
19204 const existing = packageJsonCache.get(path9);
19205 if (existing !== void 0) {
19206 return existing;
19207 }
19208 const source = package_json_reader_default.read(path9).string;
19209 if (source === void 0) {
19210 const packageConfig2 = {
19211 pjsonPath: path9,
19212 exists: false,
19213 main: void 0,
19214 name: void 0,
19215 type: "none",
19216 exports: void 0,
19217 imports: void 0
19218 };
19219 packageJsonCache.set(path9, packageConfig2);
19220 return packageConfig2;
19221 }
19222 let packageJson;
19223 try {
19224 packageJson = JSON.parse(source);
19225 } catch (error) {
19226 const exception = (
19227 /** @type {ErrnoException} */
19228 error
19229 );
19230 throw new ERR_INVALID_PACKAGE_CONFIG(
19231 path9,
19232 (base ? `"${specifier}" from ` : "") + fileURLToPath(base || specifier),
19233 exception.message
19234 );
19235 }
19236 const { exports, imports, main, name, type } = packageJson;
19237 const packageConfig = {
19238 pjsonPath: path9,
19239 exists: true,
19240 main: typeof main === "string" ? main : void 0,
19241 name: typeof name === "string" ? name : void 0,
19242 type: type === "module" || type === "commonjs" ? type : "none",
19243 // @ts-expect-error Assume `Record<string, unknown>`.
19244 exports,
19245 // @ts-expect-error Assume `Record<string, unknown>`.
19246 imports: imports && typeof imports === "object" ? imports : void 0
19247 };
19248 packageJsonCache.set(path9, packageConfig);
19249 return packageConfig;
19250}
19251function getPackageScopeConfig(resolved) {
19252 let packageJsonUrl = new URL("package.json", resolved);
19253 while (true) {
19254 const packageJsonPath2 = packageJsonUrl.pathname;
19255 if (packageJsonPath2.endsWith("node_modules/package.json"))
19256 break;
19257 const packageConfig2 = getPackageConfig(
19258 fileURLToPath(packageJsonUrl),
19259 resolved
19260 );
19261 if (packageConfig2.exists)
19262 return packageConfig2;
19263 const lastPackageJsonUrl = packageJsonUrl;
19264 packageJsonUrl = new URL("../package.json", packageJsonUrl);
19265 if (packageJsonUrl.pathname === lastPackageJsonUrl.pathname)
19266 break;
19267 }
19268 const packageJsonPath = fileURLToPath(packageJsonUrl);
19269 const packageConfig = {
19270 pjsonPath: packageJsonPath,
19271 exists: false,
19272 main: void 0,
19273 name: void 0,
19274 type: "none",
19275 exports: void 0,
19276 imports: void 0
19277 };
19278 packageJsonCache.set(packageJsonPath, packageConfig);
19279 return packageConfig;
19280}
19281
19282// node_modules/import-meta-resolve/lib/resolve-get-package-type.js
19283function getPackageType(url) {
19284 const packageConfig = getPackageScopeConfig(url);
19285 return packageConfig.type;
19286}
19287
19288// node_modules/import-meta-resolve/lib/get-format.js
19289var { ERR_UNKNOWN_FILE_EXTENSION } = codes;
19290var hasOwnProperty = {}.hasOwnProperty;
19291var extensionFormatMap = {
19292 // @ts-expect-error: hush.
19293 __proto__: null,
19294 ".cjs": "commonjs",
19295 ".js": "module",
19296 ".json": "json",
19297 ".mjs": "module"
19298};
19299function mimeToFormat(mime) {
19300 if (mime && /\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(mime))
19301 return "module";
19302 if (mime === "application/json")
19303 return "json";
19304 return null;
19305}
19306var protocolHandlers = {
19307 // @ts-expect-error: hush.
19308 __proto__: null,
19309 "data:": getDataProtocolModuleFormat,
19310 "file:": getFileProtocolModuleFormat,
19311 "http:": getHttpProtocolModuleFormat,
19312 "https:": getHttpProtocolModuleFormat,
19313 "node:"() {
19314 return "builtin";
19315 }
19316};
19317function getDataProtocolModuleFormat(parsed) {
19318 const { 1: mime } = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(
19319 parsed.pathname
19320 ) || [null, null, null];
19321 return mimeToFormat(mime);
19322}
19323function extname(url) {
19324 const pathname = url.pathname;
19325 let index = pathname.length;
19326 while (index--) {
19327 const code = pathname.codePointAt(index);
19328 if (code === 47) {
19329 return "";
19330 }
19331 if (code === 46) {
19332 return pathname.codePointAt(index - 1) === 47 ? "" : pathname.slice(index);
19333 }
19334 }
19335 return "";
19336}
19337function getFileProtocolModuleFormat(url, _context, ignoreErrors) {
19338 const ext = extname(url);
19339 if (ext === ".js") {
19340 return getPackageType(url) === "module" ? "module" : "commonjs";
19341 }
19342 const format3 = extensionFormatMap[ext];
19343 if (format3)
19344 return format3;
19345 if (ignoreErrors) {
19346 return void 0;
19347 }
19348 const filepath = fileURLToPath2(url);
19349 throw new ERR_UNKNOWN_FILE_EXTENSION(ext, filepath);
19350}
19351function getHttpProtocolModuleFormat() {
19352}
19353function defaultGetFormatWithoutErrors(url, context) {
19354 if (!hasOwnProperty.call(protocolHandlers, url.protocol)) {
19355 return null;
19356 }
19357 return protocolHandlers[url.protocol](url, context, true) || null;
19358}
19359
19360// node_modules/import-meta-resolve/lib/utils.js
19361var { ERR_INVALID_ARG_VALUE } = codes;
19362var DEFAULT_CONDITIONS = Object.freeze(["node", "import"]);
19363var DEFAULT_CONDITIONS_SET = new Set(DEFAULT_CONDITIONS);
19364function getDefaultConditions() {
19365 return DEFAULT_CONDITIONS;
19366}
19367function getDefaultConditionsSet() {
19368 return DEFAULT_CONDITIONS_SET;
19369}
19370function getConditionsSet(conditions) {
19371 if (conditions !== void 0 && conditions !== getDefaultConditions()) {
19372 if (!Array.isArray(conditions)) {
19373 throw new ERR_INVALID_ARG_VALUE(
19374 "conditions",
19375 conditions,
19376 "expected an array"
19377 );
19378 }
19379 return new Set(conditions);
19380 }
19381 return getDefaultConditionsSet();
19382}
19383
19384// node_modules/import-meta-resolve/lib/resolve.js
19385var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];
19386var experimentalNetworkImports = false;
19387var {
19388 ERR_NETWORK_IMPORT_DISALLOWED,
19389 ERR_INVALID_MODULE_SPECIFIER,
19390 ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG2,
19391 ERR_INVALID_PACKAGE_TARGET,
19392 ERR_MODULE_NOT_FOUND,
19393 ERR_PACKAGE_IMPORT_NOT_DEFINED,
19394 ERR_PACKAGE_PATH_NOT_EXPORTED,
19395 ERR_UNSUPPORTED_DIR_IMPORT,
19396 ERR_UNSUPPORTED_ESM_URL_SCHEME
19397} = codes;
19398var own2 = {}.hasOwnProperty;
19399var invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i;
19400var deprecatedInvalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i;
19401var invalidPackageNameRegEx = /^\.|%|\\/;
19402var patternRegEx = /\*/g;
19403var encodedSepRegEx = /%2f|%5c/i;
19404var emittedPackageWarnings = /* @__PURE__ */ new Set();
19405var doubleSlashRegEx = /[/\\]{2}/;
19406function emitInvalidSegmentDeprecation(target, request, match, packageJsonUrl, internal, base, isTarget) {
19407 const pjsonPath = fileURLToPath3(packageJsonUrl);
19408 const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null;
19409 process3.emitWarning(
19410 `Use of deprecated ${double ? "double slash" : "leading or trailing slash matching"} resolving "${target}" for module request "${request}" ${request === match ? "" : `matched to "${match}" `}in the "${internal ? "imports" : "exports"}" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${fileURLToPath3(base)}` : ""}.`,
19411 "DeprecationWarning",
19412 "DEP0166"
19413 );
19414}
19415function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
19416 const format3 = defaultGetFormatWithoutErrors(url, { parentURL: base.href });
19417 if (format3 !== "module")
19418 return;
19419 const path9 = fileURLToPath3(url.href);
19420 const pkgPath = fileURLToPath3(new URL3(".", packageJsonUrl));
19421 const basePath = fileURLToPath3(base);
19422 if (main)
19423 process3.emitWarning(
19424 `Package ${pkgPath} has a "main" field set to ${JSON.stringify(main)}, excluding the full filename and extension to the resolved file at "${path9.slice(
19425 pkgPath.length
19426 )}", imported from ${basePath}.
19427 Automatic extension resolution of the "main" field isdeprecated for ES modules.`,
19428 "DeprecationWarning",
19429 "DEP0151"
19430 );
19431 else
19432 process3.emitWarning(
19433 `No "main" or "exports" field defined in the package.json for ${pkgPath} resolving the main entry point "${path9.slice(
19434 pkgPath.length
19435 )}", imported from ${basePath}.
19436Default "index" lookups for the main are deprecated for ES modules.`,
19437 "DeprecationWarning",
19438 "DEP0151"
19439 );
19440}
19441function tryStatSync(path9) {
19442 try {
19443 return statSync(path9);
19444 } catch {
19445 return new Stats();
19446 }
19447}
19448function fileExists(url) {
19449 const stats = statSync(url, { throwIfNoEntry: false });
19450 const isFile = stats ? stats.isFile() : void 0;
19451 return isFile === null || isFile === void 0 ? false : isFile;
19452}
19453function legacyMainResolve(packageJsonUrl, packageConfig, base) {
19454 let guess;
19455 if (packageConfig.main !== void 0) {
19456 guess = new URL3(packageConfig.main, packageJsonUrl);
19457 if (fileExists(guess))
19458 return guess;
19459 const tries2 = [
19460 `./${packageConfig.main}.js`,
19461 `./${packageConfig.main}.json`,
19462 `./${packageConfig.main}.node`,
19463 `./${packageConfig.main}/index.js`,
19464 `./${packageConfig.main}/index.json`,
19465 `./${packageConfig.main}/index.node`
19466 ];
19467 let i2 = -1;
19468 while (++i2 < tries2.length) {
19469 guess = new URL3(tries2[i2], packageJsonUrl);
19470 if (fileExists(guess))
19471 break;
19472 guess = void 0;
19473 }
19474 if (guess) {
19475 emitLegacyIndexDeprecation(
19476 guess,
19477 packageJsonUrl,
19478 base,
19479 packageConfig.main
19480 );
19481 return guess;
19482 }
19483 }
19484 const tries = ["./index.js", "./index.json", "./index.node"];
19485 let i = -1;
19486 while (++i < tries.length) {
19487 guess = new URL3(tries[i], packageJsonUrl);
19488 if (fileExists(guess))
19489 break;
19490 guess = void 0;
19491 }
19492 if (guess) {
19493 emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main);
19494 return guess;
19495 }
19496 throw new ERR_MODULE_NOT_FOUND(
19497 fileURLToPath3(new URL3(".", packageJsonUrl)),
19498 fileURLToPath3(base)
19499 );
19500}
19501function finalizeResolution(resolved, base, preserveSymlinks) {
19502 if (encodedSepRegEx.exec(resolved.pathname) !== null)
19503 throw new ERR_INVALID_MODULE_SPECIFIER(
19504 resolved.pathname,
19505 'must not include encoded "/" or "\\" characters',
19506 fileURLToPath3(base)
19507 );
19508 const filePath = fileURLToPath3(resolved);
19509 const stats = tryStatSync(
19510 filePath.endsWith("/") ? filePath.slice(-1) : filePath
19511 );
19512 if (stats.isDirectory()) {
19513 const error = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, fileURLToPath3(base));
19514 error.url = String(resolved);
19515 throw error;
19516 }
19517 if (!stats.isFile()) {
19518 throw new ERR_MODULE_NOT_FOUND(
19519 filePath || resolved.pathname,
19520 base && fileURLToPath3(base),
19521 "module"
19522 );
19523 }
19524 if (!preserveSymlinks) {
19525 const real = realpathSync(filePath);
19526 const { search, hash } = resolved;
19527 resolved = pathToFileURL(real + (filePath.endsWith(path4.sep) ? "/" : ""));
19528 resolved.search = search;
19529 resolved.hash = hash;
19530 }
19531 return resolved;
19532}
19533function importNotDefined(specifier, packageJsonUrl, base) {
19534 return new ERR_PACKAGE_IMPORT_NOT_DEFINED(
19535 specifier,
19536 packageJsonUrl && fileURLToPath3(new URL3(".", packageJsonUrl)),
19537 fileURLToPath3(base)
19538 );
19539}
19540function exportsNotFound(subpath, packageJsonUrl, base) {
19541 return new ERR_PACKAGE_PATH_NOT_EXPORTED(
19542 fileURLToPath3(new URL3(".", packageJsonUrl)),
19543 subpath,
19544 base && fileURLToPath3(base)
19545 );
19546}
19547function throwInvalidSubpath(request, match, packageJsonUrl, internal, base) {
19548 const reason = `request is not a valid match in pattern "${match}" for the "${internal ? "imports" : "exports"}" resolution of ${fileURLToPath3(packageJsonUrl)}`;
19549 throw new ERR_INVALID_MODULE_SPECIFIER(
19550 request,
19551 reason,
19552 base && fileURLToPath3(base)
19553 );
19554}
19555function invalidPackageTarget(subpath, target, packageJsonUrl, internal, base) {
19556 target = typeof target === "object" && target !== null ? JSON.stringify(target, null, "") : `${target}`;
19557 return new ERR_INVALID_PACKAGE_TARGET(
19558 fileURLToPath3(new URL3(".", packageJsonUrl)),
19559 subpath,
19560 target,
19561 internal,
19562 base && fileURLToPath3(base)
19563 );
19564}
19565function resolvePackageTargetString(target, subpath, match, packageJsonUrl, base, pattern, internal, isPathMap, conditions) {
19566 if (subpath !== "" && !pattern && target[target.length - 1] !== "/")
19567 throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
19568 if (!target.startsWith("./")) {
19569 if (internal && !target.startsWith("../") && !target.startsWith("/")) {
19570 let isURL2 = false;
19571 try {
19572 new URL3(target);
19573 isURL2 = true;
19574 } catch {
19575 }
19576 if (!isURL2) {
19577 const exportTarget = pattern ? RegExpPrototypeSymbolReplace.call(
19578 patternRegEx,
19579 target,
19580 () => subpath
19581 ) : target + subpath;
19582 return packageResolve(exportTarget, packageJsonUrl, conditions);
19583 }
19584 }
19585 throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
19586 }
19587 if (invalidSegmentRegEx.exec(target.slice(2)) !== null) {
19588 if (deprecatedInvalidSegmentRegEx.exec(target.slice(2)) === null) {
19589 if (!isPathMap) {
19590 const request = pattern ? match.replace("*", () => subpath) : match + subpath;
19591 const resolvedTarget = pattern ? RegExpPrototypeSymbolReplace.call(
19592 patternRegEx,
19593 target,
19594 () => subpath
19595 ) : target;
19596 emitInvalidSegmentDeprecation(
19597 resolvedTarget,
19598 request,
19599 match,
19600 packageJsonUrl,
19601 internal,
19602 base,
19603 true
19604 );
19605 }
19606 } else {
19607 throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
19608 }
19609 }
19610 const resolved = new URL3(target, packageJsonUrl);
19611 const resolvedPath = resolved.pathname;
19612 const packagePath = new URL3(".", packageJsonUrl).pathname;
19613 if (!resolvedPath.startsWith(packagePath))
19614 throw invalidPackageTarget(match, target, packageJsonUrl, internal, base);
19615 if (subpath === "")
19616 return resolved;
19617 if (invalidSegmentRegEx.exec(subpath) !== null) {
19618 const request = pattern ? match.replace("*", () => subpath) : match + subpath;
19619 if (deprecatedInvalidSegmentRegEx.exec(subpath) === null) {
19620 if (!isPathMap) {
19621 const resolvedTarget = pattern ? RegExpPrototypeSymbolReplace.call(
19622 patternRegEx,
19623 target,
19624 () => subpath
19625 ) : target;
19626 emitInvalidSegmentDeprecation(
19627 resolvedTarget,
19628 request,
19629 match,
19630 packageJsonUrl,
19631 internal,
19632 base,
19633 false
19634 );
19635 }
19636 } else {
19637 throwInvalidSubpath(request, match, packageJsonUrl, internal, base);
19638 }
19639 }
19640 if (pattern) {
19641 return new URL3(
19642 RegExpPrototypeSymbolReplace.call(
19643 patternRegEx,
19644 resolved.href,
19645 () => subpath
19646 )
19647 );
19648 }
19649 return new URL3(subpath, resolved);
19650}
19651function isArrayIndex(key) {
19652 const keyNumber = Number(key);
19653 if (`${keyNumber}` !== key)
19654 return false;
19655 return keyNumber >= 0 && keyNumber < 4294967295;
19656}
19657function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions) {
19658 if (typeof target === "string") {
19659 return resolvePackageTargetString(
19660 target,
19661 subpath,
19662 packageSubpath,
19663 packageJsonUrl,
19664 base,
19665 pattern,
19666 internal,
19667 isPathMap,
19668 conditions
19669 );
19670 }
19671 if (Array.isArray(target)) {
19672 const targetList = target;
19673 if (targetList.length === 0)
19674 return null;
19675 let lastException;
19676 let i = -1;
19677 while (++i < targetList.length) {
19678 const targetItem = targetList[i];
19679 let resolveResult;
19680 try {
19681 resolveResult = resolvePackageTarget(
19682 packageJsonUrl,
19683 targetItem,
19684 subpath,
19685 packageSubpath,
19686 base,
19687 pattern,
19688 internal,
19689 isPathMap,
19690 conditions
19691 );
19692 } catch (error) {
19693 const exception = (
19694 /** @type {ErrnoException} */
19695 error
19696 );
19697 lastException = exception;
19698 if (exception.code === "ERR_INVALID_PACKAGE_TARGET")
19699 continue;
19700 throw error;
19701 }
19702 if (resolveResult === void 0)
19703 continue;
19704 if (resolveResult === null) {
19705 lastException = null;
19706 continue;
19707 }
19708 return resolveResult;
19709 }
19710 if (lastException === void 0 || lastException === null) {
19711 return null;
19712 }
19713 throw lastException;
19714 }
19715 if (typeof target === "object" && target !== null) {
19716 const keys = Object.getOwnPropertyNames(target);
19717 let i = -1;
19718 while (++i < keys.length) {
19719 const key = keys[i];
19720 if (isArrayIndex(key)) {
19721 throw new ERR_INVALID_PACKAGE_CONFIG2(
19722 fileURLToPath3(packageJsonUrl),
19723 base,
19724 '"exports" cannot contain numeric property keys.'
19725 );
19726 }
19727 }
19728 i = -1;
19729 while (++i < keys.length) {
19730 const key = keys[i];
19731 if (key === "default" || conditions && conditions.has(key)) {
19732 const conditionalTarget = (
19733 /** @type {unknown} */
19734 target[key]
19735 );
19736 const resolveResult = resolvePackageTarget(
19737 packageJsonUrl,
19738 conditionalTarget,
19739 subpath,
19740 packageSubpath,
19741 base,
19742 pattern,
19743 internal,
19744 isPathMap,
19745 conditions
19746 );
19747 if (resolveResult === void 0)
19748 continue;
19749 return resolveResult;
19750 }
19751 }
19752 return null;
19753 }
19754 if (target === null) {
19755 return null;
19756 }
19757 throw invalidPackageTarget(
19758 packageSubpath,
19759 target,
19760 packageJsonUrl,
19761 internal,
19762 base
19763 );
19764}
19765function isConditionalExportsMainSugar(exports, packageJsonUrl, base) {
19766 if (typeof exports === "string" || Array.isArray(exports))
19767 return true;
19768 if (typeof exports !== "object" || exports === null)
19769 return false;
19770 const keys = Object.getOwnPropertyNames(exports);
19771 let isConditionalSugar = false;
19772 let i = 0;
19773 let j = -1;
19774 while (++j < keys.length) {
19775 const key = keys[j];
19776 const curIsConditionalSugar = key === "" || key[0] !== ".";
19777 if (i++ === 0) {
19778 isConditionalSugar = curIsConditionalSugar;
19779 } else if (isConditionalSugar !== curIsConditionalSugar) {
19780 throw new ERR_INVALID_PACKAGE_CONFIG2(
19781 fileURLToPath3(packageJsonUrl),
19782 base,
19783 `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.`
19784 );
19785 }
19786 }
19787 return isConditionalSugar;
19788}
19789function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) {
19790 const pjsonPath = fileURLToPath3(pjsonUrl);
19791 if (emittedPackageWarnings.has(pjsonPath + "|" + match))
19792 return;
19793 emittedPackageWarnings.add(pjsonPath + "|" + match);
19794 process3.emitWarning(
19795 `Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${fileURLToPath3(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`,
19796 "DeprecationWarning",
19797 "DEP0155"
19798 );
19799}
19800function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions) {
19801 let exports = packageConfig.exports;
19802 if (isConditionalExportsMainSugar(exports, packageJsonUrl, base)) {
19803 exports = { ".": exports };
19804 }
19805 if (own2.call(exports, packageSubpath) && !packageSubpath.includes("*") && !packageSubpath.endsWith("/")) {
19806 const target = exports[packageSubpath];
19807 const resolveResult = resolvePackageTarget(
19808 packageJsonUrl,
19809 target,
19810 "",
19811 packageSubpath,
19812 base,
19813 false,
19814 false,
19815 false,
19816 conditions
19817 );
19818 if (resolveResult === null || resolveResult === void 0) {
19819 throw exportsNotFound(packageSubpath, packageJsonUrl, base);
19820 }
19821 return resolveResult;
19822 }
19823 let bestMatch = "";
19824 let bestMatchSubpath = "";
19825 const keys = Object.getOwnPropertyNames(exports);
19826 let i = -1;
19827 while (++i < keys.length) {
19828 const key = keys[i];
19829 const patternIndex = key.indexOf("*");
19830 if (patternIndex !== -1 && packageSubpath.startsWith(key.slice(0, patternIndex))) {
19831 if (packageSubpath.endsWith("/")) {
19832 emitTrailingSlashPatternDeprecation(
19833 packageSubpath,
19834 packageJsonUrl,
19835 base
19836 );
19837 }
19838 const patternTrailer = key.slice(patternIndex + 1);
19839 if (packageSubpath.length >= key.length && packageSubpath.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && key.lastIndexOf("*") === patternIndex) {
19840 bestMatch = key;
19841 bestMatchSubpath = packageSubpath.slice(
19842 patternIndex,
19843 packageSubpath.length - patternTrailer.length
19844 );
19845 }
19846 }
19847 }
19848 if (bestMatch) {
19849 const target = (
19850 /** @type {unknown} */
19851 exports[bestMatch]
19852 );
19853 const resolveResult = resolvePackageTarget(
19854 packageJsonUrl,
19855 target,
19856 bestMatchSubpath,
19857 bestMatch,
19858 base,
19859 true,
19860 false,
19861 packageSubpath.endsWith("/"),
19862 conditions
19863 );
19864 if (resolveResult === null || resolveResult === void 0) {
19865 throw exportsNotFound(packageSubpath, packageJsonUrl, base);
19866 }
19867 return resolveResult;
19868 }
19869 throw exportsNotFound(packageSubpath, packageJsonUrl, base);
19870}
19871function patternKeyCompare(a, b) {
19872 const aPatternIndex = a.indexOf("*");
19873 const bPatternIndex = b.indexOf("*");
19874 const baseLengthA = aPatternIndex === -1 ? a.length : aPatternIndex + 1;
19875 const baseLengthB = bPatternIndex === -1 ? b.length : bPatternIndex + 1;
19876 if (baseLengthA > baseLengthB)
19877 return -1;
19878 if (baseLengthB > baseLengthA)
19879 return 1;
19880 if (aPatternIndex === -1)
19881 return 1;
19882 if (bPatternIndex === -1)
19883 return -1;
19884 if (a.length > b.length)
19885 return -1;
19886 if (b.length > a.length)
19887 return 1;
19888 return 0;
19889}
19890function packageImportsResolve(name, base, conditions) {
19891 if (name === "#" || name.startsWith("#/") || name.endsWith("/")) {
19892 const reason = "is not a valid internal imports specifier name";
19893 throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, fileURLToPath3(base));
19894 }
19895 let packageJsonUrl;
19896 const packageConfig = getPackageScopeConfig(base);
19897 if (packageConfig.exists) {
19898 packageJsonUrl = pathToFileURL(packageConfig.pjsonPath);
19899 const imports = packageConfig.imports;
19900 if (imports) {
19901 if (own2.call(imports, name) && !name.includes("*")) {
19902 const resolveResult = resolvePackageTarget(
19903 packageJsonUrl,
19904 imports[name],
19905 "",
19906 name,
19907 base,
19908 false,
19909 true,
19910 false,
19911 conditions
19912 );
19913 if (resolveResult !== null && resolveResult !== void 0) {
19914 return resolveResult;
19915 }
19916 } else {
19917 let bestMatch = "";
19918 let bestMatchSubpath = "";
19919 const keys = Object.getOwnPropertyNames(imports);
19920 let i = -1;
19921 while (++i < keys.length) {
19922 const key = keys[i];
19923 const patternIndex = key.indexOf("*");
19924 if (patternIndex !== -1 && name.startsWith(key.slice(0, -1))) {
19925 const patternTrailer = key.slice(patternIndex + 1);
19926 if (name.length >= key.length && name.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && key.lastIndexOf("*") === patternIndex) {
19927 bestMatch = key;
19928 bestMatchSubpath = name.slice(
19929 patternIndex,
19930 name.length - patternTrailer.length
19931 );
19932 }
19933 }
19934 }
19935 if (bestMatch) {
19936 const target = imports[bestMatch];
19937 const resolveResult = resolvePackageTarget(
19938 packageJsonUrl,
19939 target,
19940 bestMatchSubpath,
19941 bestMatch,
19942 base,
19943 true,
19944 true,
19945 false,
19946 conditions
19947 );
19948 if (resolveResult !== null && resolveResult !== void 0) {
19949 return resolveResult;
19950 }
19951 }
19952 }
19953 }
19954 }
19955 throw importNotDefined(name, packageJsonUrl, base);
19956}
19957function parsePackageName(specifier, base) {
19958 let separatorIndex = specifier.indexOf("/");
19959 let validPackageName = true;
19960 let isScoped = false;
19961 if (specifier[0] === "@") {
19962 isScoped = true;
19963 if (separatorIndex === -1 || specifier.length === 0) {
19964 validPackageName = false;
19965 } else {
19966 separatorIndex = specifier.indexOf("/", separatorIndex + 1);
19967 }
19968 }
19969 const packageName = separatorIndex === -1 ? specifier : specifier.slice(0, separatorIndex);
19970 if (invalidPackageNameRegEx.exec(packageName) !== null) {
19971 validPackageName = false;
19972 }
19973 if (!validPackageName) {
19974 throw new ERR_INVALID_MODULE_SPECIFIER(
19975 specifier,
19976 "is not a valid package name",
19977 fileURLToPath3(base)
19978 );
19979 }
19980 const packageSubpath = "." + (separatorIndex === -1 ? "" : specifier.slice(separatorIndex));
19981 return { packageName, packageSubpath, isScoped };
19982}
19983function packageResolve(specifier, base, conditions) {
19984 if (builtinModules.includes(specifier)) {
19985 return new URL3("node:" + specifier);
19986 }
19987 const { packageName, packageSubpath, isScoped } = parsePackageName(
19988 specifier,
19989 base
19990 );
19991 const packageConfig = getPackageScopeConfig(base);
19992 if (packageConfig.exists) {
19993 const packageJsonUrl2 = pathToFileURL(packageConfig.pjsonPath);
19994 if (packageConfig.name === packageName && packageConfig.exports !== void 0 && packageConfig.exports !== null) {
19995 return packageExportsResolve(
19996 packageJsonUrl2,
19997 packageSubpath,
19998 packageConfig,
19999 base,
20000 conditions
20001 );
20002 }
20003 }
20004 let packageJsonUrl = new URL3(
20005 "./node_modules/" + packageName + "/package.json",
20006 base
20007 );
20008 let packageJsonPath = fileURLToPath3(packageJsonUrl);
20009 let lastPath;
20010 do {
20011 const stat = tryStatSync(packageJsonPath.slice(0, -13));
20012 if (!stat.isDirectory()) {
20013 lastPath = packageJsonPath;
20014 packageJsonUrl = new URL3(
20015 (isScoped ? "../../../../node_modules/" : "../../../node_modules/") + packageName + "/package.json",
20016 packageJsonUrl
20017 );
20018 packageJsonPath = fileURLToPath3(packageJsonUrl);
20019 continue;
20020 }
20021 const packageConfig2 = getPackageConfig(packageJsonPath, specifier, base);
20022 if (packageConfig2.exports !== void 0 && packageConfig2.exports !== null) {
20023 return packageExportsResolve(
20024 packageJsonUrl,
20025 packageSubpath,
20026 packageConfig2,
20027 base,
20028 conditions
20029 );
20030 }
20031 if (packageSubpath === ".") {
20032 return legacyMainResolve(packageJsonUrl, packageConfig2, base);
20033 }
20034 return new URL3(packageSubpath, packageJsonUrl);
20035 } while (packageJsonPath.length !== lastPath.length);
20036 throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath3(base));
20037}
20038function isRelativeSpecifier(specifier) {
20039 if (specifier[0] === ".") {
20040 if (specifier.length === 1 || specifier[1] === "/")
20041 return true;
20042 if (specifier[1] === "." && (specifier.length === 2 || specifier[2] === "/")) {
20043 return true;
20044 }
20045 }
20046 return false;
20047}
20048function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) {
20049 if (specifier === "")
20050 return false;
20051 if (specifier[0] === "/")
20052 return true;
20053 return isRelativeSpecifier(specifier);
20054}
20055function moduleResolve(specifier, base, conditions, preserveSymlinks) {
20056 const protocol = base.protocol;
20057 const isRemote = protocol === "http:" || protocol === "https:";
20058 let resolved;
20059 if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) {
20060 resolved = new URL3(specifier, base);
20061 } else if (!isRemote && specifier[0] === "#") {
20062 resolved = packageImportsResolve(specifier, base, conditions);
20063 } else {
20064 try {
20065 resolved = new URL3(specifier);
20066 } catch {
20067 if (!isRemote) {
20068 resolved = packageResolve(specifier, base, conditions);
20069 }
20070 }
20071 }
20072 assert4(resolved !== void 0, "expected to be defined");
20073 if (resolved.protocol !== "file:") {
20074 return resolved;
20075 }
20076 return finalizeResolution(resolved, base, preserveSymlinks);
20077}
20078function checkIfDisallowedImport(specifier, parsed, parsedParentURL) {
20079 if (parsedParentURL) {
20080 const parentProtocol = parsedParentURL.protocol;
20081 if (parentProtocol === "http:" || parentProtocol === "https:") {
20082 if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) {
20083 const parsedProtocol = parsed == null ? void 0 : parsed.protocol;
20084 if (parsedProtocol && parsedProtocol !== "https:" && parsedProtocol !== "http:") {
20085 throw new ERR_NETWORK_IMPORT_DISALLOWED(
20086 specifier,
20087 parsedParentURL,
20088 "remote imports cannot import from a local location."
20089 );
20090 }
20091 return { url: (parsed == null ? void 0 : parsed.href) || "" };
20092 }
20093 if (builtinModules.includes(specifier)) {
20094 throw new ERR_NETWORK_IMPORT_DISALLOWED(
20095 specifier,
20096 parsedParentURL,
20097 "remote imports cannot import from a local location."
20098 );
20099 }
20100 throw new ERR_NETWORK_IMPORT_DISALLOWED(
20101 specifier,
20102 parsedParentURL,
20103 "only relative and absolute specifiers are supported."
20104 );
20105 }
20106 }
20107}
20108function isURL(self) {
20109 return Boolean(
20110 self && typeof self === "object" && "href" in self && typeof self.href === "string" && "protocol" in self && typeof self.protocol === "string" && self.href && self.protocol
20111 );
20112}
20113function throwIfInvalidParentURL(parentURL) {
20114 if (parentURL === void 0) {
20115 return;
20116 }
20117 if (typeof parentURL !== "string" && !isURL(parentURL)) {
20118 throw new codes.ERR_INVALID_ARG_TYPE(
20119 "parentURL",
20120 ["string", "URL"],
20121 parentURL
20122 );
20123 }
20124}
20125function throwIfUnsupportedURLProtocol(url) {
20126 const protocol = url.protocol;
20127 if (protocol !== "file:" && protocol !== "data:" && protocol !== "node:") {
20128 throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(url);
20129 }
20130}
20131function throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports2) {
20132 const protocol = parsed == null ? void 0 : parsed.protocol;
20133 if (protocol && protocol !== "file:" && protocol !== "data:" && (!experimentalNetworkImports2 || protocol !== "https:" && protocol !== "http:")) {
20134 throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(
20135 parsed,
20136 ["file", "data"].concat(
20137 experimentalNetworkImports2 ? ["https", "http"] : []
20138 )
20139 );
20140 }
20141}
20142function defaultResolve(specifier, context = {}) {
20143 const { parentURL } = context;
20144 assert4(parentURL !== void 0, "expected `parentURL` to be defined");
20145 throwIfInvalidParentURL(parentURL);
20146 let parsedParentURL;
20147 if (parentURL) {
20148 try {
20149 parsedParentURL = new URL3(parentURL);
20150 } catch {
20151 }
20152 }
20153 let parsed;
20154 try {
20155 parsed = shouldBeTreatedAsRelativeOrAbsolutePath(specifier) ? new URL3(specifier, parsedParentURL) : new URL3(specifier);
20156 const protocol = parsed.protocol;
20157 if (protocol === "data:" || experimentalNetworkImports && (protocol === "https:" || protocol === "http:")) {
20158 return { url: parsed.href, format: null };
20159 }
20160 } catch {
20161 }
20162 const maybeReturn = checkIfDisallowedImport(
20163 specifier,
20164 parsed,
20165 parsedParentURL
20166 );
20167 if (maybeReturn)
20168 return maybeReturn;
20169 if (parsed && parsed.protocol === "node:")
20170 return { url: specifier };
20171 throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports);
20172 const conditions = getConditionsSet(context.conditions);
20173 const url = moduleResolve(specifier, new URL3(parentURL), conditions, false);
20174 throwIfUnsupportedURLProtocol(url);
20175 return {
20176 // Do NOT cast `url` to a string: that will work even when there are real
20177 // problems, silencing them
20178 url: url.href,
20179 format: defaultGetFormatWithoutErrors(url, { parentURL })
20180 };
20181}
20182
20183// node_modules/import-meta-resolve/index.js
20184function resolve(specifier, parent) {
20185 if (!parent) {
20186 throw new Error(
20187 "Please pass `parent`: `import-meta-resolve` cannot ponyfill that"
20188 );
20189 }
20190 try {
20191 return defaultResolve(specifier, { parentURL: parent }).url;
20192 } catch (error) {
20193 const exception = (
20194 /** @type {ErrnoException} */
20195 error
20196 );
20197 if (exception.code === "ERR_UNSUPPORTED_DIR_IMPORT" && typeof exception.url === "string") {
20198 return exception.url;
20199 }
20200 throw error;
20201 }
20202}
20203
20204// src/utils/import-from-file.js
20205function importFromFile(specifier, parent) {
20206 const url = resolve(specifier, pathToFileURL2(parent).href);
20207 return import(url);
20208}
20209var import_from_file_default = importFromFile;
20210
20211// src/config/load-external-config.js
20212async function loadExternalConfig(config, filepath) {
20213 try {
20214 return require_from_file_default(config, filepath);
20215 } catch (error) {
20216 if ((error == null ? void 0 : error.code) !== "MODULE_NOT_FOUND" && (error == null ? void 0 : error.code) !== "ERR_REQUIRE_ESM") {
20217 throw error;
20218 }
20219 }
20220 const module = await import_from_file_default(config, filepath);
20221 return module.default;
20222}
20223var load_external_config_default = loadExternalConfig;
20224
20225// src/config/get-prettier-config-explorer.js
20226var { cosmiconfig } = mockable;
20227var searchPlaces = [
20228 "package.json",
20229 ".prettierrc",
20230 ".prettierrc.json",
20231 ".prettierrc.yaml",
20232 ".prettierrc.yml",
20233 ".prettierrc.json5",
20234 ".prettierrc.js",
20235 ".prettierrc.mjs",
20236 ".prettierrc.cjs",
20237 "prettier.config.js",
20238 "prettier.config.mjs",
20239 "prettier.config.cjs",
20240 ".prettierrc.toml"
20241];
20242var loaders = {
20243 async ".toml"(filePath, content) {
20244 try {
20245 return await (0, import_parse_async.default)(content);
20246 } catch (error) {
20247 error.message = `TOML Error in ${filePath}:
20248${error.message}`;
20249 throw error;
20250 }
20251 },
20252 ".json5"(filePath, content) {
20253 try {
20254 return (0, import_parse3.default)(content);
20255 } catch (error) {
20256 error.message = `JSON5 Error in ${filePath}:
20257${error.message}`;
20258 throw error;
20259 }
20260 }
20261};
20262async function transform(result) {
20263 if (!(result == null ? void 0 : result.config)) {
20264 return result;
20265 }
20266 let { config, filepath } = result;
20267 if (typeof config === "string") {
20268 config = await load_external_config_default(config, filepath);
20269 result.config = config;
20270 }
20271 if (typeof config !== "object") {
20272 throw new TypeError(
20273 `Config is only allowed to be an object, but received ${typeof config} in "${filepath}"`
20274 );
20275 }
20276 delete config.$schema;
20277 return result;
20278}
20279function getExplorer(options8) {
20280 return cosmiconfig("prettier", {
20281 cache: options8.cache,
20282 transform,
20283 searchPlaces,
20284 loaders
20285 });
20286}
20287var get_prettier_config_explorer_default = getExplorer;
20288
20289// src/config/resolve-config.js
20290var getPrettierConfigExplorer = mem(get_prettier_config_explorer_default, {
20291 cacheKey: ([options8]) => options8.cache
20292});
20293var memoizedLoadEditorConfig = mem(resolve_editorconfig_default);
20294function clearCache() {
20295 memClear(getPrettierConfigExplorer);
20296 memClear(memoizedLoadEditorConfig);
20297}
20298function loadEditorConfig2(filePath, options8) {
20299 if (!filePath || !options8.editorconfig) {
20300 return;
20301 }
20302 return (options8.useCache ? memoizedLoadEditorConfig : resolve_editorconfig_default)(filePath);
20303}
20304function loadPrettierConfig(filePath, options8) {
20305 const { useCache, config: configPath } = options8;
20306 const { load, search } = getPrettierConfigExplorer({
20307 cache: Boolean(useCache)
20308 });
20309 return configPath ? load(configPath) : search(filePath);
20310}
20311async function resolveConfig(filePath, options8) {
20312 options8 = { useCache: true, ...options8 };
20313 const [result, editorConfigured] = await Promise.all([
20314 loadPrettierConfig(filePath, options8),
20315 loadEditorConfig2(filePath, options8)
20316 ]);
20317 if (!result && !editorConfigured) {
20318 return null;
20319 }
20320 const merged = {
20321 ...editorConfigured,
20322 ...mergeOverrides(result, filePath)
20323 };
20324 if (Array.isArray(merged.plugins)) {
20325 merged.plugins = merged.plugins.map(
20326 (value) => typeof value === "string" && value.startsWith(".") ? path5.resolve(path5.dirname(result.filepath), value) : value
20327 );
20328 }
20329 return merged;
20330}
20331async function resolveConfigFile(filePath) {
20332 const { search } = getPrettierConfigExplorer({ cache: false });
20333 const result = await search(filePath);
20334 return result ? result.filepath : null;
20335}
20336function mergeOverrides(configResult, filePath) {
20337 const { config, filepath: configPath } = configResult || {};
20338 const { overrides, ...options8 } = config || {};
20339 if (filePath && overrides) {
20340 const relativeFilePath = path5.relative(path5.dirname(configPath), filePath);
20341 for (const override of overrides) {
20342 if (pathMatchesGlobs(
20343 relativeFilePath,
20344 override.files,
20345 override.excludeFiles
20346 )) {
20347 Object.assign(options8, override.options);
20348 }
20349 }
20350 }
20351 return options8;
20352}
20353function pathMatchesGlobs(filePath, patterns, excludedPatterns) {
20354 const patternList = Array.isArray(patterns) ? patterns : [patterns];
20355 const [withSlashes, withoutSlashes] = partition_default(
20356 patternList,
20357 (pattern) => pattern.includes("/")
20358 );
20359 return import_micromatch.default.isMatch(filePath, withoutSlashes, {
20360 ignore: excludedPatterns,
20361 basename: true,
20362 dot: true
20363 }) || import_micromatch.default.isMatch(filePath, withSlashes, {
20364 ignore: excludedPatterns,
20365 basename: false,
20366 dot: true
20367 });
20368}
20369
20370// src/utils/ignore.js
20371var import_ignore = __toESM(require_ignore(), 1);
20372import path6 from "path";
20373
20374// src/utils/read-file.js
20375import fs4 from "fs/promises";
20376async function readFile(filename) {
20377 try {
20378 return await fs4.readFile(filename, "utf8");
20379 } catch (error) {
20380 if (error.code === "ENOENT") {
20381 return;
20382 }
20383 throw new Error(`Unable to read '${filename}': ${error.message}`);
20384 }
20385}
20386var read_file_default = readFile;
20387
20388// src/utils/ignore.js
20389var createIgnore = import_ignore.default.default;
20390var slash = path6.sep === "\\" ? (filepath) => string_replace_all_default(
20391 /* isOptionalObject*/
20392 false,
20393 filepath,
20394 "\\",
20395 "/"
20396) : (filepath) => filepath;
20397async function createSingleIsIgnoredFunction(ignoreFilePath, withNodeModules) {
20398 let content = "";
20399 if (ignoreFilePath) {
20400 content += await read_file_default(ignoreFilePath) ?? "";
20401 }
20402 if (!withNodeModules) {
20403 content += "\nnode_modules";
20404 }
20405 if (!content) {
20406 return;
20407 }
20408 const ignore = createIgnore({
20409 allowRelativePaths: true
20410 }).add(content);
20411 return (filepath) => {
20412 filepath = path6.resolve(filepath);
20413 const relativePath = ignoreFilePath ? path6.relative(path6.dirname(ignoreFilePath), filepath) : path6.relative(process.cwd(), filepath);
20414 return ignore.ignores(slash(relativePath));
20415 };
20416}
20417async function createIsIgnoredFunction(ignoreFilePaths, withNodeModules) {
20418 if (ignoreFilePaths.length === 0 && !withNodeModules) {
20419 ignoreFilePaths = [void 0];
20420 }
20421 const isIgnoredFunctions = (await Promise.all(ignoreFilePaths.map((ignoreFilePath) => createSingleIsIgnoredFunction(ignoreFilePath, withNodeModules)))).filter(Boolean);
20422 return (filepath) => isIgnoredFunctions.some((isIgnored2) => isIgnored2(filepath));
20423}
20424async function isIgnored(filepath, options8) {
20425 const {
20426 ignorePath,
20427 withNodeModules
20428 } = options8;
20429 const isIgnored2 = await createIsIgnoredFunction(ignorePath, withNodeModules);
20430 return isIgnored2(filepath);
20431}
20432
20433// src/common/get-file-info.js
20434async function getFileInfo(filePath, options8) {
20435 if (typeof filePath !== "string") {
20436 throw new TypeError(
20437 `expect \`filePath\` to be a string, got \`${typeof filePath}\``
20438 );
20439 }
20440 let { ignorePath, withNodeModules } = options8;
20441 if (!Array.isArray(ignorePath)) {
20442 ignorePath = [ignorePath];
20443 }
20444 const ignored = await isIgnored(filePath, { ignorePath, withNodeModules });
20445 let inferredParser;
20446 if (!ignored) {
20447 inferredParser = await getParser(filePath, options8);
20448 }
20449 return {
20450 ignored,
20451 inferredParser: inferredParser ?? null
20452 };
20453}
20454async function getParser(filePath, options8) {
20455 let config;
20456 if (options8.resolveConfig !== false) {
20457 config = await resolveConfig(filePath);
20458 }
20459 return (config == null ? void 0 : config.parser) ?? infer_parser_default(options8, { physicalFile: filePath });
20460}
20461var get_file_info_default = getFileInfo;
20462
20463// src/main/plugins/load-plugin.js
20464import { pathToFileURL as pathToFileURL3 } from "url";
20465import path8 from "path";
20466
20467// src/utils/import-from-directory.js
20468import path7 from "path";
20469function importFromDirectory(specifier, directory) {
20470 return import_from_file_default(specifier, path7.join(directory, "noop.js"));
20471}
20472var import_from_directory_default = importFromDirectory;
20473
20474// src/main/plugins/load-plugin.js
20475function normalizePlugin(pluginInstanceOfPluginModule, name) {
20476 const plugin = pluginInstanceOfPluginModule.default ?? pluginInstanceOfPluginModule;
20477 return { name, ...plugin };
20478}
20479var loadPluginFromDirectory = mem(
20480 async (name, directory) => normalizePlugin(await import_from_directory_default(name, directory), name),
20481 { cacheKey: JSON.stringify }
20482);
20483var importPlugin = mem(async (name) => {
20484 try {
20485 return await import(pathToFileURL3(path8.resolve(name)).href);
20486 } catch {
20487 return import_from_directory_default(name, process.cwd());
20488 }
20489});
20490async function loadPlugin(plugin) {
20491 if (typeof plugin === "string") {
20492 return normalizePlugin(await importPlugin(plugin), plugin);
20493 }
20494 return plugin;
20495}
20496function clearCache2() {
20497 memClear(loadPluginFromDirectory);
20498 memClear(importPlugin);
20499}
20500
20501// src/plugins/builtin-plugins-proxy.js
20502var builtin_plugins_proxy_exports = {};
20503__export(builtin_plugins_proxy_exports, {
20504 languages: () => languages,
20505 options: () => options7,
20506 parsers: () => parsers,
20507 printers: () => printers
20508});
20509
20510// src/common/common-options.evaluate.js
20511var common_options_evaluate_default = {
20512 "bracketSpacing": {
20513 "category": "Common",
20514 "type": "boolean",
20515 "default": true,
20516 "description": "Print spaces between brackets.",
20517 "oppositeDescription": "Do not print spaces between brackets."
20518 },
20519 "singleQuote": {
20520 "category": "Common",
20521 "type": "boolean",
20522 "default": false,
20523 "description": "Use single quotes instead of double quotes."
20524 },
20525 "proseWrap": {
20526 "category": "Common",
20527 "type": "choice",
20528 "default": "preserve",
20529 "description": "How to wrap prose.",
20530 "choices": [
20531 {
20532 "value": "always",
20533 "description": "Wrap prose if it exceeds the print width."
20534 },
20535 {
20536 "value": "never",
20537 "description": "Do not wrap prose."
20538 },
20539 {
20540 "value": "preserve",
20541 "description": "Wrap prose as-is."
20542 }
20543 ]
20544 },
20545 "bracketSameLine": {
20546 "category": "Common",
20547 "type": "boolean",
20548 "default": false,
20549 "description": "Put > of opening tags on the last line instead of on a new line."
20550 },
20551 "singleAttributePerLine": {
20552 "category": "Common",
20553 "type": "boolean",
20554 "default": false,
20555 "description": "Enforce single attribute per line in HTML, Vue and JSX."
20556 }
20557};
20558
20559// src/language-css/options.js
20560var options = {
20561 singleQuote: common_options_evaluate_default.singleQuote
20562};
20563var options_default = options;
20564
20565// src/language-css/languages.evaluate.js
20566var languages_evaluate_default = [
20567 {
20568 "linguistLanguageId": 50,
20569 "name": "CSS",
20570 "type": "markup",
20571 "tmScope": "source.css",
20572 "aceMode": "css",
20573 "codemirrorMode": "css",
20574 "codemirrorMimeType": "text/css",
20575 "color": "#563d7c",
20576 "extensions": [
20577 ".css",
20578 ".wxss"
20579 ],
20580 "parsers": [
20581 "css"
20582 ],
20583 "vscodeLanguageIds": [
20584 "css"
20585 ]
20586 },
20587 {
20588 "linguistLanguageId": 262764437,
20589 "name": "PostCSS",
20590 "type": "markup",
20591 "color": "#dc3a0c",
20592 "tmScope": "source.postcss",
20593 "group": "CSS",
20594 "extensions": [
20595 ".pcss",
20596 ".postcss"
20597 ],
20598 "aceMode": "text",
20599 "parsers": [
20600 "css"
20601 ],
20602 "vscodeLanguageIds": [
20603 "postcss"
20604 ]
20605 },
20606 {
20607 "linguistLanguageId": 198,
20608 "name": "Less",
20609 "type": "markup",
20610 "color": "#1d365d",
20611 "aliases": [
20612 "less-css"
20613 ],
20614 "extensions": [
20615 ".less"
20616 ],
20617 "tmScope": "source.css.less",
20618 "aceMode": "less",
20619 "codemirrorMode": "css",
20620 "codemirrorMimeType": "text/css",
20621 "parsers": [
20622 "less"
20623 ],
20624 "vscodeLanguageIds": [
20625 "less"
20626 ]
20627 },
20628 {
20629 "linguistLanguageId": 329,
20630 "name": "SCSS",
20631 "type": "markup",
20632 "color": "#c6538c",
20633 "tmScope": "source.css.scss",
20634 "aceMode": "scss",
20635 "codemirrorMode": "css",
20636 "codemirrorMimeType": "text/x-scss",
20637 "extensions": [
20638 ".scss"
20639 ],
20640 "parsers": [
20641 "scss"
20642 ],
20643 "vscodeLanguageIds": [
20644 "scss"
20645 ]
20646 }
20647];
20648
20649// src/language-graphql/options.js
20650var options2 = {
20651 bracketSpacing: common_options_evaluate_default.bracketSpacing
20652};
20653var options_default2 = options2;
20654
20655// src/language-graphql/languages.evaluate.js
20656var languages_evaluate_default2 = [
20657 {
20658 "linguistLanguageId": 139,
20659 "name": "GraphQL",
20660 "type": "data",
20661 "color": "#e10098",
20662 "extensions": [
20663 ".graphql",
20664 ".gql",
20665 ".graphqls"
20666 ],
20667 "tmScope": "source.graphql",
20668 "aceMode": "text",
20669 "parsers": [
20670 "graphql"
20671 ],
20672 "vscodeLanguageIds": [
20673 "graphql"
20674 ]
20675 }
20676];
20677
20678// src/language-handlebars/languages.evaluate.js
20679var languages_evaluate_default3 = [
20680 {
20681 "linguistLanguageId": 155,
20682 "name": "Handlebars",
20683 "type": "markup",
20684 "color": "#f7931e",
20685 "aliases": [
20686 "hbs",
20687 "htmlbars"
20688 ],
20689 "extensions": [
20690 ".handlebars",
20691 ".hbs"
20692 ],
20693 "tmScope": "text.html.handlebars",
20694 "aceMode": "handlebars",
20695 "parsers": [
20696 "glimmer"
20697 ],
20698 "vscodeLanguageIds": [
20699 "handlebars"
20700 ]
20701 }
20702];
20703
20704// src/language-html/options.js
20705var CATEGORY_HTML = "HTML";
20706var options3 = {
20707 bracketSameLine: common_options_evaluate_default.bracketSameLine,
20708 htmlWhitespaceSensitivity: {
20709 category: CATEGORY_HTML,
20710 type: "choice",
20711 default: "css",
20712 description: "How to handle whitespaces in HTML.",
20713 choices: [
20714 {
20715 value: "css",
20716 description: "Respect the default value of CSS display property."
20717 },
20718 {
20719 value: "strict",
20720 description: "Whitespaces are considered sensitive."
20721 },
20722 {
20723 value: "ignore",
20724 description: "Whitespaces are considered insensitive."
20725 }
20726 ]
20727 },
20728 singleAttributePerLine: common_options_evaluate_default.singleAttributePerLine,
20729 vueIndentScriptAndStyle: {
20730 category: CATEGORY_HTML,
20731 type: "boolean",
20732 default: false,
20733 description: "Indent script and style tags in Vue files."
20734 }
20735};
20736var options_default3 = options3;
20737
20738// src/language-html/languages.evaluate.js
20739var languages_evaluate_default4 = [
20740 {
20741 "linguistLanguageId": 146,
20742 "name": "Angular",
20743 "type": "markup",
20744 "tmScope": "text.html.basic",
20745 "aceMode": "html",
20746 "codemirrorMode": "htmlmixed",
20747 "codemirrorMimeType": "text/html",
20748 "color": "#e34c26",
20749 "aliases": [
20750 "xhtml"
20751 ],
20752 "extensions": [
20753 ".component.html"
20754 ],
20755 "parsers": [
20756 "angular"
20757 ],
20758 "vscodeLanguageIds": [
20759 "html"
20760 ],
20761 "filenames": []
20762 },
20763 {
20764 "linguistLanguageId": 146,
20765 "name": "HTML",
20766 "type": "markup",
20767 "tmScope": "text.html.basic",
20768 "aceMode": "html",
20769 "codemirrorMode": "htmlmixed",
20770 "codemirrorMimeType": "text/html",
20771 "color": "#e34c26",
20772 "aliases": [
20773 "xhtml"
20774 ],
20775 "extensions": [
20776 ".html",
20777 ".hta",
20778 ".htm",
20779 ".html.hl",
20780 ".inc",
20781 ".xht",
20782 ".xhtml",
20783 ".mjml"
20784 ],
20785 "parsers": [
20786 "html"
20787 ],
20788 "vscodeLanguageIds": [
20789 "html"
20790 ]
20791 },
20792 {
20793 "linguistLanguageId": 146,
20794 "name": "Lightning Web Components",
20795 "type": "markup",
20796 "tmScope": "text.html.basic",
20797 "aceMode": "html",
20798 "codemirrorMode": "htmlmixed",
20799 "codemirrorMimeType": "text/html",
20800 "color": "#e34c26",
20801 "aliases": [
20802 "xhtml"
20803 ],
20804 "extensions": [],
20805 "parsers": [
20806 "lwc"
20807 ],
20808 "vscodeLanguageIds": [
20809 "html"
20810 ],
20811 "filenames": []
20812 },
20813 {
20814 "linguistLanguageId": 391,
20815 "name": "Vue",
20816 "type": "markup",
20817 "color": "#41b883",
20818 "extensions": [
20819 ".vue"
20820 ],
20821 "tmScope": "text.html.vue",
20822 "aceMode": "html",
20823 "parsers": [
20824 "vue"
20825 ],
20826 "vscodeLanguageIds": [
20827 "vue"
20828 ]
20829 }
20830];
20831
20832// src/language-js/options.js
20833var CATEGORY_JAVASCRIPT = "JavaScript";
20834var options4 = {
20835 arrowParens: {
20836 category: CATEGORY_JAVASCRIPT,
20837 type: "choice",
20838 default: "always",
20839 description: "Include parentheses around a sole arrow function parameter.",
20840 choices: [
20841 {
20842 value: "always",
20843 description: "Always include parens. Example: `(x) => x`"
20844 },
20845 {
20846 value: "avoid",
20847 description: "Omit parens when possible. Example: `x => x`"
20848 }
20849 ]
20850 },
20851 bracketSameLine: common_options_evaluate_default.bracketSameLine,
20852 bracketSpacing: common_options_evaluate_default.bracketSpacing,
20853 jsxBracketSameLine: {
20854 category: CATEGORY_JAVASCRIPT,
20855 type: "boolean",
20856 description: "Put > on the last line instead of at a new line.",
20857 deprecated: "2.4.0"
20858 },
20859 semi: {
20860 category: CATEGORY_JAVASCRIPT,
20861 type: "boolean",
20862 default: true,
20863 description: "Print semicolons.",
20864 oppositeDescription: "Do not print semicolons, except at the beginning of lines which may need them."
20865 },
20866 singleQuote: common_options_evaluate_default.singleQuote,
20867 jsxSingleQuote: {
20868 category: CATEGORY_JAVASCRIPT,
20869 type: "boolean",
20870 default: false,
20871 description: "Use single quotes in JSX."
20872 },
20873 quoteProps: {
20874 category: CATEGORY_JAVASCRIPT,
20875 type: "choice",
20876 default: "as-needed",
20877 description: "Change when properties in objects are quoted.",
20878 choices: [
20879 {
20880 value: "as-needed",
20881 description: "Only add quotes around object properties where required."
20882 },
20883 {
20884 value: "consistent",
20885 description: "If at least one property in an object requires quotes, quote all properties."
20886 },
20887 {
20888 value: "preserve",
20889 description: "Respect the input use of quotes in object properties."
20890 }
20891 ]
20892 },
20893 trailingComma: {
20894 category: CATEGORY_JAVASCRIPT,
20895 type: "choice",
20896 default: "all",
20897 description: "Print trailing commas wherever possible when multi-line.",
20898 choices: [
20899 {
20900 value: "all",
20901 description: "Trailing commas wherever possible (including function arguments)."
20902 },
20903 {
20904 value: "es5",
20905 description: "Trailing commas where valid in ES5 (objects, arrays, etc.)"
20906 },
20907 { value: "none", description: "No trailing commas." }
20908 ]
20909 },
20910 singleAttributePerLine: common_options_evaluate_default.singleAttributePerLine
20911};
20912var options_default4 = options4;
20913
20914// src/language-js/languages.evaluate.js
20915var languages_evaluate_default5 = [
20916 {
20917 "linguistLanguageId": 183,
20918 "name": "JavaScript",
20919 "type": "programming",
20920 "tmScope": "source.js",
20921 "aceMode": "javascript",
20922 "codemirrorMode": "javascript",
20923 "codemirrorMimeType": "text/javascript",
20924 "color": "#f1e05a",
20925 "aliases": [
20926 "js",
20927 "node"
20928 ],
20929 "extensions": [
20930 ".js",
20931 "._js",
20932 ".bones",
20933 ".cjs",
20934 ".es",
20935 ".es6",
20936 ".frag",
20937 ".gs",
20938 ".jake",
20939 ".javascript",
20940 ".jsb",
20941 ".jscad",
20942 ".jsfl",
20943 ".jslib",
20944 ".jsm",
20945 ".jspre",
20946 ".jss",
20947 ".mjs",
20948 ".njs",
20949 ".pac",
20950 ".sjs",
20951 ".ssjs",
20952 ".xsjs",
20953 ".xsjslib",
20954 ".wxs"
20955 ],
20956 "filenames": [
20957 "Jakefile"
20958 ],
20959 "interpreters": [
20960 "chakra",
20961 "d8",
20962 "gjs",
20963 "js",
20964 "node",
20965 "nodejs",
20966 "qjs",
20967 "rhino",
20968 "v8",
20969 "v8-shell",
20970 "zx"
20971 ],
20972 "parsers": [
20973 "babel",
20974 "acorn",
20975 "espree",
20976 "meriyah",
20977 "babel-flow",
20978 "babel-ts",
20979 "flow",
20980 "typescript"
20981 ],
20982 "vscodeLanguageIds": [
20983 "javascript",
20984 "mongo"
20985 ]
20986 },
20987 {
20988 "linguistLanguageId": 183,
20989 "name": "Flow",
20990 "type": "programming",
20991 "tmScope": "source.js",
20992 "aceMode": "javascript",
20993 "codemirrorMode": "javascript",
20994 "codemirrorMimeType": "text/javascript",
20995 "color": "#f1e05a",
20996 "aliases": [],
20997 "extensions": [
20998 ".js.flow"
20999 ],
21000 "filenames": [],
21001 "interpreters": [
21002 "chakra",
21003 "d8",
21004 "gjs",
21005 "js",
21006 "node",
21007 "nodejs",
21008 "qjs",
21009 "rhino",
21010 "v8",
21011 "v8-shell"
21012 ],
21013 "parsers": [
21014 "flow",
21015 "babel-flow"
21016 ],
21017 "vscodeLanguageIds": [
21018 "javascript"
21019 ]
21020 },
21021 {
21022 "linguistLanguageId": 183,
21023 "name": "JSX",
21024 "type": "programming",
21025 "tmScope": "source.js.jsx",
21026 "aceMode": "javascript",
21027 "codemirrorMode": "jsx",
21028 "codemirrorMimeType": "text/jsx",
21029 "color": void 0,
21030 "aliases": void 0,
21031 "extensions": [
21032 ".jsx"
21033 ],
21034 "filenames": void 0,
21035 "interpreters": void 0,
21036 "parsers": [
21037 "babel",
21038 "babel-flow",
21039 "babel-ts",
21040 "flow",
21041 "typescript",
21042 "espree",
21043 "meriyah"
21044 ],
21045 "vscodeLanguageIds": [
21046 "javascriptreact"
21047 ],
21048 "group": "JavaScript"
21049 },
21050 {
21051 "linguistLanguageId": 378,
21052 "name": "TypeScript",
21053 "type": "programming",
21054 "color": "#3178c6",
21055 "aliases": [
21056 "ts"
21057 ],
21058 "interpreters": [
21059 "deno",
21060 "ts-node"
21061 ],
21062 "extensions": [
21063 ".ts",
21064 ".cts",
21065 ".mts"
21066 ],
21067 "tmScope": "source.ts",
21068 "aceMode": "typescript",
21069 "codemirrorMode": "javascript",
21070 "codemirrorMimeType": "application/typescript",
21071 "parsers": [
21072 "typescript",
21073 "babel-ts"
21074 ],
21075 "vscodeLanguageIds": [
21076 "typescript"
21077 ]
21078 },
21079 {
21080 "linguistLanguageId": 94901924,
21081 "name": "TSX",
21082 "type": "programming",
21083 "color": "#3178c6",
21084 "group": "TypeScript",
21085 "extensions": [
21086 ".tsx"
21087 ],
21088 "tmScope": "source.tsx",
21089 "aceMode": "javascript",
21090 "codemirrorMode": "jsx",
21091 "codemirrorMimeType": "text/jsx",
21092 "parsers": [
21093 "typescript",
21094 "babel-ts"
21095 ],
21096 "vscodeLanguageIds": [
21097 "typescriptreact"
21098 ]
21099 }
21100];
21101
21102// src/language-json/languages.evaluate.js
21103var languages_evaluate_default6 = [
21104 {
21105 "linguistLanguageId": 174,
21106 "name": "JSON.stringify",
21107 "type": "data",
21108 "color": "#292929",
21109 "tmScope": "source.json",
21110 "aceMode": "json",
21111 "codemirrorMode": "javascript",
21112 "codemirrorMimeType": "application/json",
21113 "aliases": [
21114 "geojson",
21115 "jsonl",
21116 "topojson"
21117 ],
21118 "extensions": [
21119 ".importmap"
21120 ],
21121 "filenames": [
21122 "package.json",
21123 "package-lock.json",
21124 "composer.json"
21125 ],
21126 "parsers": [
21127 "json-stringify"
21128 ],
21129 "vscodeLanguageIds": [
21130 "json"
21131 ]
21132 },
21133 {
21134 "linguistLanguageId": 174,
21135 "name": "JSON",
21136 "type": "data",
21137 "color": "#292929",
21138 "tmScope": "source.json",
21139 "aceMode": "json",
21140 "codemirrorMode": "javascript",
21141 "codemirrorMimeType": "application/json",
21142 "aliases": [
21143 "geojson",
21144 "jsonl",
21145 "topojson"
21146 ],
21147 "extensions": [
21148 ".json",
21149 ".4DForm",
21150 ".4DProject",
21151 ".avsc",
21152 ".geojson",
21153 ".gltf",
21154 ".har",
21155 ".ice",
21156 ".JSON-tmLanguage",
21157 ".mcmeta",
21158 ".tfstate",
21159 ".tfstate.backup",
21160 ".topojson",
21161 ".webapp",
21162 ".webmanifest",
21163 ".yy",
21164 ".yyp"
21165 ],
21166 "filenames": [
21167 ".arcconfig",
21168 ".auto-changelog",
21169 ".c8rc",
21170 ".htmlhintrc",
21171 ".imgbotconfig",
21172 ".nycrc",
21173 ".tern-config",
21174 ".tern-project",
21175 ".watchmanconfig",
21176 "Pipfile.lock",
21177 "composer.lock",
21178 "mcmod.info"
21179 ],
21180 "parsers": [
21181 "json"
21182 ],
21183 "vscodeLanguageIds": [
21184 "json"
21185 ]
21186 },
21187 {
21188 "linguistLanguageId": 423,
21189 "name": "JSON with Comments",
21190 "type": "data",
21191 "color": "#292929",
21192 "group": "JSON",
21193 "tmScope": "source.js",
21194 "aceMode": "javascript",
21195 "codemirrorMode": "javascript",
21196 "codemirrorMimeType": "text/javascript",
21197 "aliases": [
21198 "jsonc"
21199 ],
21200 "extensions": [
21201 ".jsonc",
21202 ".code-snippets",
21203 ".sublime-build",
21204 ".sublime-commands",
21205 ".sublime-completions",
21206 ".sublime-keymap",
21207 ".sublime-macro",
21208 ".sublime-menu",
21209 ".sublime-mousemap",
21210 ".sublime-project",
21211 ".sublime-settings",
21212 ".sublime-theme",
21213 ".sublime-workspace",
21214 ".sublime_metrics",
21215 ".sublime_session"
21216 ],
21217 "filenames": [
21218 ".babelrc",
21219 ".devcontainer.json",
21220 ".eslintrc.json",
21221 ".jscsrc",
21222 ".jshintrc",
21223 ".jslintrc",
21224 "api-extractor.json",
21225 "devcontainer.json",
21226 "jsconfig.json",
21227 "language-configuration.json",
21228 "tsconfig.json",
21229 "tslint.json",
21230 ".eslintrc",
21231 ".swcrc"
21232 ],
21233 "parsers": [
21234 "json"
21235 ],
21236 "vscodeLanguageIds": [
21237 "jsonc"
21238 ]
21239 },
21240 {
21241 "linguistLanguageId": 175,
21242 "name": "JSON5",
21243 "type": "data",
21244 "color": "#267CB9",
21245 "extensions": [
21246 ".json5"
21247 ],
21248 "tmScope": "source.js",
21249 "aceMode": "javascript",
21250 "codemirrorMode": "javascript",
21251 "codemirrorMimeType": "application/json",
21252 "parsers": [
21253 "json5"
21254 ],
21255 "vscodeLanguageIds": [
21256 "json5"
21257 ]
21258 }
21259];
21260
21261// src/language-markdown/options.js
21262var options5 = {
21263 proseWrap: common_options_evaluate_default.proseWrap,
21264 singleQuote: common_options_evaluate_default.singleQuote
21265};
21266var options_default5 = options5;
21267
21268// src/language-markdown/languages.evaluate.js
21269var languages_evaluate_default7 = [
21270 {
21271 "linguistLanguageId": 222,
21272 "name": "Markdown",
21273 "type": "prose",
21274 "color": "#083fa1",
21275 "aliases": [
21276 "pandoc"
21277 ],
21278 "aceMode": "markdown",
21279 "codemirrorMode": "gfm",
21280 "codemirrorMimeType": "text/x-gfm",
21281 "wrap": true,
21282 "extensions": [
21283 ".md",
21284 ".livemd",
21285 ".markdown",
21286 ".mdown",
21287 ".mdwn",
21288 ".mkd",
21289 ".mkdn",
21290 ".mkdown",
21291 ".ronn",
21292 ".scd",
21293 ".workbook"
21294 ],
21295 "filenames": [
21296 "contents.lr",
21297 "README"
21298 ],
21299 "tmScope": "source.gfm",
21300 "parsers": [
21301 "markdown"
21302 ],
21303 "vscodeLanguageIds": [
21304 "markdown"
21305 ]
21306 },
21307 {
21308 "linguistLanguageId": 222,
21309 "name": "MDX",
21310 "type": "prose",
21311 "color": "#083fa1",
21312 "aliases": [
21313 "pandoc"
21314 ],
21315 "aceMode": "markdown",
21316 "codemirrorMode": "gfm",
21317 "codemirrorMimeType": "text/x-gfm",
21318 "wrap": true,
21319 "extensions": [
21320 ".mdx"
21321 ],
21322 "filenames": [],
21323 "tmScope": "source.gfm",
21324 "parsers": [
21325 "mdx"
21326 ],
21327 "vscodeLanguageIds": [
21328 "mdx"
21329 ]
21330 }
21331];
21332
21333// src/language-yaml/options.js
21334var options6 = {
21335 bracketSpacing: common_options_evaluate_default.bracketSpacing,
21336 singleQuote: common_options_evaluate_default.singleQuote,
21337 proseWrap: common_options_evaluate_default.proseWrap
21338};
21339var options_default6 = options6;
21340
21341// src/language-yaml/languages.evaluate.js
21342var languages_evaluate_default8 = [
21343 {
21344 "linguistLanguageId": 407,
21345 "name": "YAML",
21346 "type": "data",
21347 "color": "#cb171e",
21348 "tmScope": "source.yaml",
21349 "aliases": [
21350 "yml"
21351 ],
21352 "extensions": [
21353 ".yml",
21354 ".mir",
21355 ".reek",
21356 ".rviz",
21357 ".sublime-syntax",
21358 ".syntax",
21359 ".yaml",
21360 ".yaml-tmlanguage",
21361 ".yaml.sed",
21362 ".yml.mysql"
21363 ],
21364 "filenames": [
21365 ".clang-format",
21366 ".clang-tidy",
21367 ".gemrc",
21368 "CITATION.cff",
21369 "glide.lock",
21370 ".prettierrc",
21371 ".stylelintrc",
21372 ".lintstagedrc"
21373 ],
21374 "aceMode": "yaml",
21375 "codemirrorMode": "yaml",
21376 "codemirrorMimeType": "text/x-yaml",
21377 "parsers": [
21378 "yaml"
21379 ],
21380 "vscodeLanguageIds": [
21381 "yaml",
21382 "ansible",
21383 "home-assistant"
21384 ]
21385 }
21386];
21387
21388// src/plugins/builtin-plugins-proxy.js
21389function createParsersAndPrinters(modules) {
21390 const parsers2 = /* @__PURE__ */ Object.create(null);
21391 const printers2 = /* @__PURE__ */ Object.create(null);
21392 for (const {
21393 importPlugin: importPlugin2,
21394 parsers: parserNames = [],
21395 printers: printerNames = []
21396 } of modules) {
21397 const loadPlugin2 = async () => {
21398 const plugin = await importPlugin2();
21399 Object.assign(parsers2, plugin.parsers);
21400 Object.assign(printers2, plugin.printers);
21401 return plugin;
21402 };
21403 for (const parserName of parserNames) {
21404 parsers2[parserName] = async () => (await loadPlugin2()).parsers[parserName];
21405 }
21406 for (const printerName of printerNames) {
21407 printers2[printerName] = async () => (await loadPlugin2()).printers[printerName];
21408 }
21409 }
21410 return { parsers: parsers2, printers: printers2 };
21411}
21412var options7 = {
21413 ...options_default,
21414 ...options_default2,
21415 ...options_default3,
21416 ...options_default4,
21417 ...options_default5,
21418 ...options_default6
21419};
21420var languages = [
21421 ...languages_evaluate_default,
21422 ...languages_evaluate_default2,
21423 ...languages_evaluate_default3,
21424 ...languages_evaluate_default4,
21425 ...languages_evaluate_default5,
21426 ...languages_evaluate_default6,
21427 ...languages_evaluate_default7,
21428 ...languages_evaluate_default8
21429];
21430var { parsers, printers } = createParsersAndPrinters([
21431 {
21432 importPlugin: () => import("./plugins/acorn.mjs"),
21433 parsers: ["acorn", "espree"]
21434 },
21435 {
21436 importPlugin: () => import("./plugins/angular.mjs"),
21437 parsers: [
21438 "__ng_action",
21439 "__ng_binding",
21440 "__ng_interpolation",
21441 "__ng_directive"
21442 ]
21443 },
21444 {
21445 importPlugin: () => import("./plugins/babel.mjs"),
21446 parsers: [
21447 "babel",
21448 "babel-flow",
21449 "babel-ts",
21450 "__js_expression",
21451 "__ts_expression",
21452 "__vue_expression",
21453 "__vue_ts_expression",
21454 "__vue_event_binding",
21455 "__vue_ts_event_binding",
21456 "__babel_estree",
21457 "json",
21458 "json5",
21459 "json-stringify"
21460 ]
21461 },
21462 {
21463 importPlugin: () => import("./plugins/estree.mjs"),
21464 printers: ["estree", "estree-json"]
21465 },
21466 {
21467 importPlugin: () => import("./plugins/flow.mjs"),
21468 parsers: ["flow"]
21469 },
21470 {
21471 importPlugin: () => import("./plugins/glimmer.mjs"),
21472 parsers: ["glimmer"],
21473 printers: ["glimmer"]
21474 },
21475 {
21476 importPlugin: () => import("./plugins/graphql.mjs"),
21477 parsers: ["graphql"],
21478 printers: ["graphql"]
21479 },
21480 {
21481 importPlugin: () => import("./plugins/html.mjs"),
21482 parsers: ["html", "angular", "vue", "lwc"],
21483 printers: ["html"]
21484 },
21485 {
21486 importPlugin: () => import("./plugins/markdown.mjs"),
21487 parsers: ["markdown", "mdx", "remark"],
21488 printers: ["mdast"]
21489 },
21490 {
21491 importPlugin: () => import("./plugins/meriyah.mjs"),
21492 parsers: ["meriyah"]
21493 },
21494 {
21495 importPlugin: () => import("./plugins/postcss.mjs"),
21496 parsers: ["css", "less", "scss"],
21497 printers: ["postcss"]
21498 },
21499 {
21500 importPlugin: () => import("./plugins/typescript.mjs"),
21501 parsers: ["typescript"]
21502 },
21503 {
21504 importPlugin: () => import("./plugins/yaml.mjs"),
21505 parsers: ["yaml"],
21506 printers: ["yaml"]
21507 }
21508]);
21509
21510// src/main/plugins/load-builtin-plugins.js
21511function loadBuiltinPlugins() {
21512 return [builtin_plugins_proxy_exports];
21513}
21514var load_builtin_plugins_default = loadBuiltinPlugins;
21515
21516// src/main/plugins/load-plugins.js
21517function loadPlugins(plugins = []) {
21518 return Promise.all(plugins.map((plugin) => loadPlugin(plugin)));
21519}
21520var load_plugins_default = loadPlugins;
21521
21522// src/main/option-categories.js
21523var option_categories_exports = {};
21524__export(option_categories_exports, {
21525 CATEGORY_CONFIG: () => CATEGORY_CONFIG,
21526 CATEGORY_EDITOR: () => CATEGORY_EDITOR,
21527 CATEGORY_FORMAT: () => CATEGORY_FORMAT,
21528 CATEGORY_GLOBAL: () => CATEGORY_GLOBAL,
21529 CATEGORY_OTHER: () => CATEGORY_OTHER,
21530 CATEGORY_OUTPUT: () => CATEGORY_OUTPUT,
21531 CATEGORY_SPECIAL: () => CATEGORY_SPECIAL
21532});
21533var CATEGORY_CONFIG = "Config";
21534var CATEGORY_EDITOR = "Editor";
21535var CATEGORY_FORMAT = "Format";
21536var CATEGORY_OTHER = "Other";
21537var CATEGORY_OUTPUT = "Output";
21538var CATEGORY_GLOBAL = "Global";
21539var CATEGORY_SPECIAL = "Special";
21540
21541// src/utils/object-omit.js
21542function omit(object, keys) {
21543 keys = new Set(keys);
21544 return Object.fromEntries(
21545 Object.entries(object).filter(([key]) => !keys.has(key))
21546 );
21547}
21548var object_omit_default = omit;
21549
21550// src/utils/public.js
21551var public_exports = {};
21552__export(public_exports, {
21553 addDanglingComment: () => addDanglingComment,
21554 addLeadingComment: () => addLeadingComment,
21555 addTrailingComment: () => addTrailingComment,
21556 getAlignmentSize: () => get_alignment_size_default,
21557 getIndentSize: () => get_indent_size_default,
21558 getMaxContinuousCount: () => get_max_continuous_count_default,
21559 getNextNonSpaceNonCommentCharacter: () => get_next_non_space_non_comment_character_default,
21560 getNextNonSpaceNonCommentCharacterIndex: () => getNextNonSpaceNonCommentCharacterIndex2,
21561 getStringWidth: () => get_string_width_default,
21562 hasNewline: () => has_newline_default,
21563 hasNewlineInRange: () => has_newline_in_range_default,
21564 hasSpaces: () => has_spaces_default,
21565 isNextLineEmpty: () => isNextLineEmpty2,
21566 isNextLineEmptyAfterIndex: () => is_next_line_empty_default,
21567 isPreviousLineEmpty: () => isPreviousLineEmpty2,
21568 makeString: () => make_string_default,
21569 skip: () => skip,
21570 skipEverythingButNewLine: () => skipEverythingButNewLine,
21571 skipInlineComment: () => skip_inline_comment_default,
21572 skipNewline: () => skip_newline_default,
21573 skipSpaces: () => skipSpaces,
21574 skipToLineEnd: () => skipToLineEnd,
21575 skipTrailingComment: () => skip_trailing_comment_default,
21576 skipWhitespace: () => skipWhitespace
21577});
21578
21579// src/utils/skip-inline-comment.js
21580function skipInlineComment(text, startIndex) {
21581 if (startIndex === false) {
21582 return false;
21583 }
21584 if (text.charAt(startIndex) === "/" && text.charAt(startIndex + 1) === "*") {
21585 for (let i = startIndex + 2; i < text.length; ++i) {
21586 if (text.charAt(i) === "*" && text.charAt(i + 1) === "/") {
21587 return i + 2;
21588 }
21589 }
21590 }
21591 return startIndex;
21592}
21593var skip_inline_comment_default = skipInlineComment;
21594
21595// src/utils/skip-trailing-comment.js
21596function skipTrailingComment(text, startIndex) {
21597 if (startIndex === false) {
21598 return false;
21599 }
21600 if (text.charAt(startIndex) === "/" && text.charAt(startIndex + 1) === "/") {
21601 return skipEverythingButNewLine(text, startIndex);
21602 }
21603 return startIndex;
21604}
21605var skip_trailing_comment_default = skipTrailingComment;
21606
21607// src/utils/get-next-non-space-non-comment-character-index.js
21608function getNextNonSpaceNonCommentCharacterIndex(text, startIndex) {
21609 let oldIdx = null;
21610 let nextIdx = startIndex;
21611 while (nextIdx !== oldIdx) {
21612 oldIdx = nextIdx;
21613 nextIdx = skipSpaces(text, nextIdx);
21614 nextIdx = skip_inline_comment_default(text, nextIdx);
21615 nextIdx = skip_trailing_comment_default(text, nextIdx);
21616 nextIdx = skip_newline_default(text, nextIdx);
21617 }
21618 return nextIdx;
21619}
21620var get_next_non_space_non_comment_character_index_default = getNextNonSpaceNonCommentCharacterIndex;
21621
21622// src/utils/is-next-line-empty.js
21623function isNextLineEmpty(text, startIndex) {
21624 let oldIdx = null;
21625 let idx = startIndex;
21626 while (idx !== oldIdx) {
21627 oldIdx = idx;
21628 idx = skipToLineEnd(text, idx);
21629 idx = skip_inline_comment_default(text, idx);
21630 idx = skipSpaces(text, idx);
21631 }
21632 idx = skip_trailing_comment_default(text, idx);
21633 idx = skip_newline_default(text, idx);
21634 return idx !== false && has_newline_default(text, idx);
21635}
21636var is_next_line_empty_default = isNextLineEmpty;
21637
21638// node_modules/escape-string-regexp/index.js
21639function escapeStringRegexp(string) {
21640 if (typeof string !== "string") {
21641 throw new TypeError("Expected a string");
21642 }
21643 return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
21644}
21645
21646// src/utils/get-max-continuous-count.js
21647function getMaxContinuousCount(text, searchString) {
21648 const results = text.match(
21649 new RegExp(`(${escapeStringRegexp(searchString)})+`, "g")
21650 );
21651 if (results === null) {
21652 return 0;
21653 }
21654 return results.reduce(
21655 (maxCount, result) => Math.max(maxCount, result.length / searchString.length),
21656 0
21657 );
21658}
21659var get_max_continuous_count_default = getMaxContinuousCount;
21660
21661// src/utils/get-indent-size.js
21662function getIndentSize(value, tabWidth) {
21663 const lastNewlineIndex = value.lastIndexOf("\n");
21664 if (lastNewlineIndex === -1) {
21665 return 0;
21666 }
21667 return get_alignment_size_default(
21668 // All the leading whitespaces
21669 value.slice(lastNewlineIndex + 1).match(/^[\t ]*/)[0],
21670 tabWidth
21671 );
21672}
21673var get_indent_size_default = getIndentSize;
21674
21675// src/utils/has-newline-in-range.js
21676function hasNewlineInRange(text, startIndex, endIndex) {
21677 for (let i = startIndex; i < endIndex; ++i) {
21678 if (text.charAt(i) === "\n") {
21679 return true;
21680 }
21681 }
21682 return false;
21683}
21684var has_newline_in_range_default = hasNewlineInRange;
21685
21686// src/utils/has-spaces.js
21687function hasSpaces(text, startIndex, options8 = {}) {
21688 const idx = skipSpaces(
21689 text,
21690 options8.backwards ? startIndex - 1 : startIndex,
21691 options8
21692 );
21693 return idx !== startIndex;
21694}
21695var has_spaces_default = hasSpaces;
21696
21697// src/utils/get-next-non-space-non-comment-character.js
21698function getNextNonSpaceNonCommentCharacter(text, startIndex) {
21699 const index = get_next_non_space_non_comment_character_index_default(text, startIndex);
21700 return index === false ? "" : text.charAt(index);
21701}
21702var get_next_non_space_non_comment_character_default = getNextNonSpaceNonCommentCharacter;
21703
21704// src/utils/make-string.js
21705function makeString(rawText, enclosingQuote, unescapeUnnecessaryEscapes) {
21706 const otherQuote = enclosingQuote === '"' ? "'" : '"';
21707 const regex = /\\(.)|(["'])/gs;
21708 const raw = string_replace_all_default(
21709 /* isOptionalObject*/
21710 false,
21711 rawText,
21712 regex,
21713 (match, escaped, quote) => {
21714 if (escaped === otherQuote) {
21715 return escaped;
21716 }
21717 if (quote === enclosingQuote) {
21718 return "\\" + quote;
21719 }
21720 if (quote) {
21721 return quote;
21722 }
21723 return unescapeUnnecessaryEscapes && /^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/.test(escaped) ? escaped : "\\" + escaped;
21724 }
21725 );
21726 return enclosingQuote + raw + enclosingQuote;
21727}
21728var make_string_default = makeString;
21729
21730// src/utils/public.js
21731function legacyGetNextNonSpaceNonCommentCharacterIndex(text, node, locEnd) {
21732 return get_next_non_space_non_comment_character_index_default(
21733 text,
21734 locEnd(node)
21735 );
21736}
21737function getNextNonSpaceNonCommentCharacterIndex2(text, startIndex) {
21738 return arguments.length === 2 || typeof startIndex === "number" ? get_next_non_space_non_comment_character_index_default(text, startIndex) : (
21739 // @ts-expect-error -- expected
21740 // eslint-disable-next-line prefer-rest-params
21741 legacyGetNextNonSpaceNonCommentCharacterIndex(...arguments)
21742 );
21743}
21744function legacyIsPreviousLineEmpty(text, node, locStart) {
21745 return is_previous_line_empty_default(text, locStart(node));
21746}
21747function isPreviousLineEmpty2(text, startIndex) {
21748 return arguments.length === 2 || typeof startIndex === "number" ? is_previous_line_empty_default(text, startIndex) : (
21749 // @ts-expect-error -- expected
21750 // eslint-disable-next-line prefer-rest-params
21751 legacyIsPreviousLineEmpty(...arguments)
21752 );
21753}
21754function legacyIsNextLineEmpty(text, node, locEnd) {
21755 return is_next_line_empty_default(text, locEnd(node));
21756}
21757function isNextLineEmpty2(text, startIndex) {
21758 return arguments.length === 2 || typeof startIndex === "number" ? is_next_line_empty_default(text, startIndex) : (
21759 // @ts-expect-error -- expected
21760 // eslint-disable-next-line prefer-rest-params
21761 legacyIsNextLineEmpty(...arguments)
21762 );
21763}
21764
21765// src/index.js
21766import * as doc from "./doc.mjs";
21767
21768// src/main/version.evaluate.cjs
21769var version_evaluate_default = "3.0.0";
21770
21771// src/index.js
21772function withPlugins(fn, optionsArgumentIndex = 1) {
21773 return async (...args) => {
21774 const options8 = args[optionsArgumentIndex] ?? {};
21775 const { plugins = [] } = options8;
21776 args[optionsArgumentIndex] = {
21777 ...options8,
21778 plugins: (await Promise.all([
21779 load_builtin_plugins_default(),
21780 // TODO: standalone version allow `plugins` to be `prettierPlugins` which is an object, should allow that too
21781 load_plugins_default(plugins)
21782 ])).flat()
21783 };
21784 return fn(...args);
21785 };
21786}
21787var formatWithCursor2 = withPlugins(formatWithCursor);
21788async function format2(text, options8) {
21789 const { formatted } = await formatWithCursor2(text, {
21790 ...options8,
21791 cursorOffset: -1
21792 });
21793 return formatted;
21794}
21795async function check(text, options8) {
21796 return await format2(text, options8) === text;
21797}
21798async function clearCache3() {
21799 clearCache();
21800 clearCache2();
21801}
21802var getFileInfo2 = withPlugins(get_file_info_default);
21803var getSupportInfo2 = withPlugins(getSupportInfo, 0);
21804var sharedWithCli = {
21805 errors: errors_exports,
21806 optionCategories: option_categories_exports,
21807 createIsIgnoredFunction,
21808 formatOptionsHiddenDefaults,
21809 normalizeOptions: normalize_options_default,
21810 getSupportInfoWithoutPlugins: getSupportInfo,
21811 normalizeOptionSettings,
21812 vnopts: import_vnopts2.default,
21813 fastGlob: import_fast_glob.default,
21814 utils: {
21815 isNonEmptyArray: is_non_empty_array_default,
21816 partition: partition_default,
21817 omit: object_omit_default
21818 }
21819};
21820var debugApis = {
21821 parse: withPlugins(parse2),
21822 formatAST: withPlugins(formatAst),
21823 formatDoc: withPlugins(formatDoc),
21824 printToDoc: withPlugins(printToDoc),
21825 printDocToString: withPlugins(printDocToString2)
21826};
21827
21828// with-default-export:src/index.js
21829var src_default = src_exports;
21830export {
21831 debugApis as __debug,
21832 sharedWithCli as __internal,
21833 check,
21834 clearCache3 as clearConfigCache,
21835 src_default as default,
21836 doc,
21837 format2 as format,
21838 formatWithCursor2 as formatWithCursor,
21839 getFileInfo2 as getFileInfo,
21840 getSupportInfo2 as getSupportInfo,
21841 resolveConfig,
21842 resolveConfigFile,
21843 public_exports as util,
21844 version_evaluate_default as version
21845};