@qodalis/cli-curl 0.0.4 → 2.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3033 @@
1
+ "use strict";
2
+ var curl = (() => {
3
+ // ../../../dist/core/public-api.mjs
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __commonJS = (cb, mod) => function __require() {
11
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var require_constants = __commonJS({
30
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.js"(exports$1, module2) {
31
+ var SEMVER_SPEC_VERSION = "2.0.0";
32
+ var MAX_LENGTH = 256;
33
+ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
34
+ 9007199254740991;
35
+ var MAX_SAFE_COMPONENT_LENGTH = 16;
36
+ var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
37
+ var RELEASE_TYPES = [
38
+ "major",
39
+ "premajor",
40
+ "minor",
41
+ "preminor",
42
+ "patch",
43
+ "prepatch",
44
+ "prerelease"
45
+ ];
46
+ module2.exports = {
47
+ MAX_LENGTH,
48
+ MAX_SAFE_COMPONENT_LENGTH,
49
+ MAX_SAFE_BUILD_LENGTH,
50
+ MAX_SAFE_INTEGER,
51
+ RELEASE_TYPES,
52
+ SEMVER_SPEC_VERSION,
53
+ FLAG_INCLUDE_PRERELEASE: 1,
54
+ FLAG_LOOSE: 2
55
+ };
56
+ }
57
+ });
58
+ var require_debug = __commonJS({
59
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/debug.js"(exports$1, module2) {
60
+ var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
61
+ };
62
+ module2.exports = debug;
63
+ }
64
+ });
65
+ var require_re = __commonJS({
66
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/re.js"(exports$1, module2) {
67
+ var {
68
+ MAX_SAFE_COMPONENT_LENGTH,
69
+ MAX_SAFE_BUILD_LENGTH,
70
+ MAX_LENGTH
71
+ } = require_constants();
72
+ var debug = require_debug();
73
+ exports$1 = module2.exports = {};
74
+ var re = exports$1.re = [];
75
+ var safeRe = exports$1.safeRe = [];
76
+ var src = exports$1.src = [];
77
+ var safeSrc = exports$1.safeSrc = [];
78
+ var t = exports$1.t = {};
79
+ var R = 0;
80
+ var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
81
+ var safeRegexReplacements = [
82
+ ["\\s", 1],
83
+ ["\\d", MAX_LENGTH],
84
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
85
+ ];
86
+ var makeSafeRegex = (value) => {
87
+ for (const [token, max] of safeRegexReplacements) {
88
+ value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
89
+ }
90
+ return value;
91
+ };
92
+ var createToken = (name, value, isGlobal) => {
93
+ const safe = makeSafeRegex(value);
94
+ const index = R++;
95
+ debug(name, index, value);
96
+ t[name] = index;
97
+ src[index] = value;
98
+ safeSrc[index] = safe;
99
+ re[index] = new RegExp(value, isGlobal ? "g" : void 0);
100
+ safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
101
+ };
102
+ createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
103
+ createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
104
+ createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
105
+ createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
106
+ createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
107
+ createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
108
+ createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
109
+ createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
110
+ createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
111
+ createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
112
+ createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
113
+ createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
114
+ createToken("FULL", `^${src[t.FULLPLAIN]}$`);
115
+ createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
116
+ createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
117
+ createToken("GTLT", "((?:<|>)?=?)");
118
+ createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
119
+ createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
120
+ createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
121
+ createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
122
+ createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
123
+ createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
124
+ createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
125
+ createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
126
+ createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
127
+ createToken("COERCERTL", src[t.COERCE], true);
128
+ createToken("COERCERTLFULL", src[t.COERCEFULL], true);
129
+ createToken("LONETILDE", "(?:~>?)");
130
+ createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
131
+ exports$1.tildeTrimReplace = "$1~";
132
+ createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
133
+ createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
134
+ createToken("LONECARET", "(?:\\^)");
135
+ createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
136
+ exports$1.caretTrimReplace = "$1^";
137
+ createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
138
+ createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
139
+ createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
140
+ createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
141
+ createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
142
+ exports$1.comparatorTrimReplace = "$1$2$3";
143
+ createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
144
+ createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
145
+ createToken("STAR", "(<|>)?=?\\s*\\*");
146
+ createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
147
+ createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
148
+ }
149
+ });
150
+ var require_parse_options = __commonJS({
151
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/parse-options.js"(exports$1, module2) {
152
+ var looseOption = Object.freeze({ loose: true });
153
+ var emptyOpts = Object.freeze({});
154
+ var parseOptions = (options) => {
155
+ if (!options) {
156
+ return emptyOpts;
157
+ }
158
+ if (typeof options !== "object") {
159
+ return looseOption;
160
+ }
161
+ return options;
162
+ };
163
+ module2.exports = parseOptions;
164
+ }
165
+ });
166
+ var require_identifiers = __commonJS({
167
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.js"(exports$1, module2) {
168
+ var numeric = /^[0-9]+$/;
169
+ var compareIdentifiers = (a, b) => {
170
+ if (typeof a === "number" && typeof b === "number") {
171
+ return a === b ? 0 : a < b ? -1 : 1;
172
+ }
173
+ const anum = numeric.test(a);
174
+ const bnum = numeric.test(b);
175
+ if (anum && bnum) {
176
+ a = +a;
177
+ b = +b;
178
+ }
179
+ return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
180
+ };
181
+ var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
182
+ module2.exports = {
183
+ compareIdentifiers,
184
+ rcompareIdentifiers
185
+ };
186
+ }
187
+ });
188
+ var require_semver = __commonJS({
189
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/semver.js"(exports$1, module2) {
190
+ var debug = require_debug();
191
+ var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
192
+ var { safeRe: re, t } = require_re();
193
+ var parseOptions = require_parse_options();
194
+ var { compareIdentifiers } = require_identifiers();
195
+ var SemVer = class _SemVer {
196
+ constructor(version, options) {
197
+ options = parseOptions(options);
198
+ if (version instanceof _SemVer) {
199
+ if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
200
+ return version;
201
+ } else {
202
+ version = version.version;
203
+ }
204
+ } else if (typeof version !== "string") {
205
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
206
+ }
207
+ if (version.length > MAX_LENGTH) {
208
+ throw new TypeError(
209
+ `version is longer than ${MAX_LENGTH} characters`
210
+ );
211
+ }
212
+ debug("SemVer", version, options);
213
+ this.options = options;
214
+ this.loose = !!options.loose;
215
+ this.includePrerelease = !!options.includePrerelease;
216
+ const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
217
+ if (!m) {
218
+ throw new TypeError(`Invalid Version: ${version}`);
219
+ }
220
+ this.raw = version;
221
+ this.major = +m[1];
222
+ this.minor = +m[2];
223
+ this.patch = +m[3];
224
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
225
+ throw new TypeError("Invalid major version");
226
+ }
227
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
228
+ throw new TypeError("Invalid minor version");
229
+ }
230
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
231
+ throw new TypeError("Invalid patch version");
232
+ }
233
+ if (!m[4]) {
234
+ this.prerelease = [];
235
+ } else {
236
+ this.prerelease = m[4].split(".").map((id) => {
237
+ if (/^[0-9]+$/.test(id)) {
238
+ const num = +id;
239
+ if (num >= 0 && num < MAX_SAFE_INTEGER) {
240
+ return num;
241
+ }
242
+ }
243
+ return id;
244
+ });
245
+ }
246
+ this.build = m[5] ? m[5].split(".") : [];
247
+ this.format();
248
+ }
249
+ format() {
250
+ this.version = `${this.major}.${this.minor}.${this.patch}`;
251
+ if (this.prerelease.length) {
252
+ this.version += `-${this.prerelease.join(".")}`;
253
+ }
254
+ return this.version;
255
+ }
256
+ toString() {
257
+ return this.version;
258
+ }
259
+ compare(other) {
260
+ debug("SemVer.compare", this.version, this.options, other);
261
+ if (!(other instanceof _SemVer)) {
262
+ if (typeof other === "string" && other === this.version) {
263
+ return 0;
264
+ }
265
+ other = new _SemVer(other, this.options);
266
+ }
267
+ if (other.version === this.version) {
268
+ return 0;
269
+ }
270
+ return this.compareMain(other) || this.comparePre(other);
271
+ }
272
+ compareMain(other) {
273
+ if (!(other instanceof _SemVer)) {
274
+ other = new _SemVer(other, this.options);
275
+ }
276
+ if (this.major < other.major) {
277
+ return -1;
278
+ }
279
+ if (this.major > other.major) {
280
+ return 1;
281
+ }
282
+ if (this.minor < other.minor) {
283
+ return -1;
284
+ }
285
+ if (this.minor > other.minor) {
286
+ return 1;
287
+ }
288
+ if (this.patch < other.patch) {
289
+ return -1;
290
+ }
291
+ if (this.patch > other.patch) {
292
+ return 1;
293
+ }
294
+ return 0;
295
+ }
296
+ comparePre(other) {
297
+ if (!(other instanceof _SemVer)) {
298
+ other = new _SemVer(other, this.options);
299
+ }
300
+ if (this.prerelease.length && !other.prerelease.length) {
301
+ return -1;
302
+ } else if (!this.prerelease.length && other.prerelease.length) {
303
+ return 1;
304
+ } else if (!this.prerelease.length && !other.prerelease.length) {
305
+ return 0;
306
+ }
307
+ let i = 0;
308
+ do {
309
+ const a = this.prerelease[i];
310
+ const b = other.prerelease[i];
311
+ debug("prerelease compare", i, a, b);
312
+ if (a === void 0 && b === void 0) {
313
+ return 0;
314
+ } else if (b === void 0) {
315
+ return 1;
316
+ } else if (a === void 0) {
317
+ return -1;
318
+ } else if (a === b) {
319
+ continue;
320
+ } else {
321
+ return compareIdentifiers(a, b);
322
+ }
323
+ } while (++i);
324
+ }
325
+ compareBuild(other) {
326
+ if (!(other instanceof _SemVer)) {
327
+ other = new _SemVer(other, this.options);
328
+ }
329
+ let i = 0;
330
+ do {
331
+ const a = this.build[i];
332
+ const b = other.build[i];
333
+ debug("build compare", i, a, b);
334
+ if (a === void 0 && b === void 0) {
335
+ return 0;
336
+ } else if (b === void 0) {
337
+ return 1;
338
+ } else if (a === void 0) {
339
+ return -1;
340
+ } else if (a === b) {
341
+ continue;
342
+ } else {
343
+ return compareIdentifiers(a, b);
344
+ }
345
+ } while (++i);
346
+ }
347
+ // preminor will bump the version up to the next minor release, and immediately
348
+ // down to pre-release. premajor and prepatch work the same way.
349
+ inc(release, identifier, identifierBase) {
350
+ if (release.startsWith("pre")) {
351
+ if (!identifier && identifierBase === false) {
352
+ throw new Error("invalid increment argument: identifier is empty");
353
+ }
354
+ if (identifier) {
355
+ const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
356
+ if (!match || match[1] !== identifier) {
357
+ throw new Error(`invalid identifier: ${identifier}`);
358
+ }
359
+ }
360
+ }
361
+ switch (release) {
362
+ case "premajor":
363
+ this.prerelease.length = 0;
364
+ this.patch = 0;
365
+ this.minor = 0;
366
+ this.major++;
367
+ this.inc("pre", identifier, identifierBase);
368
+ break;
369
+ case "preminor":
370
+ this.prerelease.length = 0;
371
+ this.patch = 0;
372
+ this.minor++;
373
+ this.inc("pre", identifier, identifierBase);
374
+ break;
375
+ case "prepatch":
376
+ this.prerelease.length = 0;
377
+ this.inc("patch", identifier, identifierBase);
378
+ this.inc("pre", identifier, identifierBase);
379
+ break;
380
+ // If the input is a non-prerelease version, this acts the same as
381
+ // prepatch.
382
+ case "prerelease":
383
+ if (this.prerelease.length === 0) {
384
+ this.inc("patch", identifier, identifierBase);
385
+ }
386
+ this.inc("pre", identifier, identifierBase);
387
+ break;
388
+ case "release":
389
+ if (this.prerelease.length === 0) {
390
+ throw new Error(`version ${this.raw} is not a prerelease`);
391
+ }
392
+ this.prerelease.length = 0;
393
+ break;
394
+ case "major":
395
+ if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
396
+ this.major++;
397
+ }
398
+ this.minor = 0;
399
+ this.patch = 0;
400
+ this.prerelease = [];
401
+ break;
402
+ case "minor":
403
+ if (this.patch !== 0 || this.prerelease.length === 0) {
404
+ this.minor++;
405
+ }
406
+ this.patch = 0;
407
+ this.prerelease = [];
408
+ break;
409
+ case "patch":
410
+ if (this.prerelease.length === 0) {
411
+ this.patch++;
412
+ }
413
+ this.prerelease = [];
414
+ break;
415
+ // This probably shouldn't be used publicly.
416
+ // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
417
+ case "pre": {
418
+ const base = Number(identifierBase) ? 1 : 0;
419
+ if (this.prerelease.length === 0) {
420
+ this.prerelease = [base];
421
+ } else {
422
+ let i = this.prerelease.length;
423
+ while (--i >= 0) {
424
+ if (typeof this.prerelease[i] === "number") {
425
+ this.prerelease[i]++;
426
+ i = -2;
427
+ }
428
+ }
429
+ if (i === -1) {
430
+ if (identifier === this.prerelease.join(".") && identifierBase === false) {
431
+ throw new Error("invalid increment argument: identifier already exists");
432
+ }
433
+ this.prerelease.push(base);
434
+ }
435
+ }
436
+ if (identifier) {
437
+ let prerelease = [identifier, base];
438
+ if (identifierBase === false) {
439
+ prerelease = [identifier];
440
+ }
441
+ if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
442
+ if (isNaN(this.prerelease[1])) {
443
+ this.prerelease = prerelease;
444
+ }
445
+ } else {
446
+ this.prerelease = prerelease;
447
+ }
448
+ }
449
+ break;
450
+ }
451
+ default:
452
+ throw new Error(`invalid increment argument: ${release}`);
453
+ }
454
+ this.raw = this.format();
455
+ if (this.build.length) {
456
+ this.raw += `+${this.build.join(".")}`;
457
+ }
458
+ return this;
459
+ }
460
+ };
461
+ module2.exports = SemVer;
462
+ }
463
+ });
464
+ var require_parse = __commonJS({
465
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.js"(exports$1, module2) {
466
+ var SemVer = require_semver();
467
+ var parse = (version, options, throwErrors = false) => {
468
+ if (version instanceof SemVer) {
469
+ return version;
470
+ }
471
+ try {
472
+ return new SemVer(version, options);
473
+ } catch (er) {
474
+ if (!throwErrors) {
475
+ return null;
476
+ }
477
+ throw er;
478
+ }
479
+ };
480
+ module2.exports = parse;
481
+ }
482
+ });
483
+ var require_valid = __commonJS({
484
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/valid.js"(exports$1, module2) {
485
+ var parse = require_parse();
486
+ var valid2 = (version, options) => {
487
+ const v = parse(version, options);
488
+ return v ? v.version : null;
489
+ };
490
+ module2.exports = valid2;
491
+ }
492
+ });
493
+ var require_clean = __commonJS({
494
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/clean.js"(exports$1, module2) {
495
+ var parse = require_parse();
496
+ var clean = (version, options) => {
497
+ const s = parse(version.trim().replace(/^[=v]+/, ""), options);
498
+ return s ? s.version : null;
499
+ };
500
+ module2.exports = clean;
501
+ }
502
+ });
503
+ var require_inc = __commonJS({
504
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/inc.js"(exports$1, module2) {
505
+ var SemVer = require_semver();
506
+ var inc = (version, release, options, identifier, identifierBase) => {
507
+ if (typeof options === "string") {
508
+ identifierBase = identifier;
509
+ identifier = options;
510
+ options = void 0;
511
+ }
512
+ try {
513
+ return new SemVer(
514
+ version instanceof SemVer ? version.version : version,
515
+ options
516
+ ).inc(release, identifier, identifierBase).version;
517
+ } catch (er) {
518
+ return null;
519
+ }
520
+ };
521
+ module2.exports = inc;
522
+ }
523
+ });
524
+ var require_diff = __commonJS({
525
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/diff.js"(exports$1, module2) {
526
+ var parse = require_parse();
527
+ var diff = (version1, version2) => {
528
+ const v1 = parse(version1, null, true);
529
+ const v2 = parse(version2, null, true);
530
+ const comparison = v1.compare(v2);
531
+ if (comparison === 0) {
532
+ return null;
533
+ }
534
+ const v1Higher = comparison > 0;
535
+ const highVersion = v1Higher ? v1 : v2;
536
+ const lowVersion = v1Higher ? v2 : v1;
537
+ const highHasPre = !!highVersion.prerelease.length;
538
+ const lowHasPre = !!lowVersion.prerelease.length;
539
+ if (lowHasPre && !highHasPre) {
540
+ if (!lowVersion.patch && !lowVersion.minor) {
541
+ return "major";
542
+ }
543
+ if (lowVersion.compareMain(highVersion) === 0) {
544
+ if (lowVersion.minor && !lowVersion.patch) {
545
+ return "minor";
546
+ }
547
+ return "patch";
548
+ }
549
+ }
550
+ const prefix = highHasPre ? "pre" : "";
551
+ if (v1.major !== v2.major) {
552
+ return prefix + "major";
553
+ }
554
+ if (v1.minor !== v2.minor) {
555
+ return prefix + "minor";
556
+ }
557
+ if (v1.patch !== v2.patch) {
558
+ return prefix + "patch";
559
+ }
560
+ return "prerelease";
561
+ };
562
+ module2.exports = diff;
563
+ }
564
+ });
565
+ var require_major = __commonJS({
566
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/major.js"(exports$1, module2) {
567
+ var SemVer = require_semver();
568
+ var major = (a, loose) => new SemVer(a, loose).major;
569
+ module2.exports = major;
570
+ }
571
+ });
572
+ var require_minor = __commonJS({
573
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/minor.js"(exports$1, module2) {
574
+ var SemVer = require_semver();
575
+ var minor = (a, loose) => new SemVer(a, loose).minor;
576
+ module2.exports = minor;
577
+ }
578
+ });
579
+ var require_patch = __commonJS({
580
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/patch.js"(exports$1, module2) {
581
+ var SemVer = require_semver();
582
+ var patch = (a, loose) => new SemVer(a, loose).patch;
583
+ module2.exports = patch;
584
+ }
585
+ });
586
+ var require_prerelease = __commonJS({
587
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/prerelease.js"(exports$1, module2) {
588
+ var parse = require_parse();
589
+ var prerelease = (version, options) => {
590
+ const parsed = parse(version, options);
591
+ return parsed && parsed.prerelease.length ? parsed.prerelease : null;
592
+ };
593
+ module2.exports = prerelease;
594
+ }
595
+ });
596
+ var require_compare = __commonJS({
597
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.js"(exports$1, module2) {
598
+ var SemVer = require_semver();
599
+ var compare2 = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
600
+ module2.exports = compare2;
601
+ }
602
+ });
603
+ var require_rcompare = __commonJS({
604
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rcompare.js"(exports$1, module2) {
605
+ var compare2 = require_compare();
606
+ var rcompare = (a, b, loose) => compare2(b, a, loose);
607
+ module2.exports = rcompare;
608
+ }
609
+ });
610
+ var require_compare_loose = __commonJS({
611
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-loose.js"(exports$1, module2) {
612
+ var compare2 = require_compare();
613
+ var compareLoose = (a, b) => compare2(a, b, true);
614
+ module2.exports = compareLoose;
615
+ }
616
+ });
617
+ var require_compare_build = __commonJS({
618
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-build.js"(exports$1, module2) {
619
+ var SemVer = require_semver();
620
+ var compareBuild = (a, b, loose) => {
621
+ const versionA = new SemVer(a, loose);
622
+ const versionB = new SemVer(b, loose);
623
+ return versionA.compare(versionB) || versionA.compareBuild(versionB);
624
+ };
625
+ module2.exports = compareBuild;
626
+ }
627
+ });
628
+ var require_sort = __commonJS({
629
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/sort.js"(exports$1, module2) {
630
+ var compareBuild = require_compare_build();
631
+ var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
632
+ module2.exports = sort;
633
+ }
634
+ });
635
+ var require_rsort = __commonJS({
636
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rsort.js"(exports$1, module2) {
637
+ var compareBuild = require_compare_build();
638
+ var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
639
+ module2.exports = rsort;
640
+ }
641
+ });
642
+ var require_gt = __commonJS({
643
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.js"(exports$1, module2) {
644
+ var compare2 = require_compare();
645
+ var gt = (a, b, loose) => compare2(a, b, loose) > 0;
646
+ module2.exports = gt;
647
+ }
648
+ });
649
+ var require_lt = __commonJS({
650
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.js"(exports$1, module2) {
651
+ var compare2 = require_compare();
652
+ var lt = (a, b, loose) => compare2(a, b, loose) < 0;
653
+ module2.exports = lt;
654
+ }
655
+ });
656
+ var require_eq = __commonJS({
657
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.js"(exports$1, module2) {
658
+ var compare2 = require_compare();
659
+ var eq = (a, b, loose) => compare2(a, b, loose) === 0;
660
+ module2.exports = eq;
661
+ }
662
+ });
663
+ var require_neq = __commonJS({
664
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.js"(exports$1, module2) {
665
+ var compare2 = require_compare();
666
+ var neq = (a, b, loose) => compare2(a, b, loose) !== 0;
667
+ module2.exports = neq;
668
+ }
669
+ });
670
+ var require_gte = __commonJS({
671
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.js"(exports$1, module2) {
672
+ var compare2 = require_compare();
673
+ var gte2 = (a, b, loose) => compare2(a, b, loose) >= 0;
674
+ module2.exports = gte2;
675
+ }
676
+ });
677
+ var require_lte = __commonJS({
678
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.js"(exports$1, module2) {
679
+ var compare2 = require_compare();
680
+ var lte = (a, b, loose) => compare2(a, b, loose) <= 0;
681
+ module2.exports = lte;
682
+ }
683
+ });
684
+ var require_cmp = __commonJS({
685
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.js"(exports$1, module2) {
686
+ var eq = require_eq();
687
+ var neq = require_neq();
688
+ var gt = require_gt();
689
+ var gte2 = require_gte();
690
+ var lt = require_lt();
691
+ var lte = require_lte();
692
+ var cmp = (a, op, b, loose) => {
693
+ switch (op) {
694
+ case "===":
695
+ if (typeof a === "object") {
696
+ a = a.version;
697
+ }
698
+ if (typeof b === "object") {
699
+ b = b.version;
700
+ }
701
+ return a === b;
702
+ case "!==":
703
+ if (typeof a === "object") {
704
+ a = a.version;
705
+ }
706
+ if (typeof b === "object") {
707
+ b = b.version;
708
+ }
709
+ return a !== b;
710
+ case "":
711
+ case "=":
712
+ case "==":
713
+ return eq(a, b, loose);
714
+ case "!=":
715
+ return neq(a, b, loose);
716
+ case ">":
717
+ return gt(a, b, loose);
718
+ case ">=":
719
+ return gte2(a, b, loose);
720
+ case "<":
721
+ return lt(a, b, loose);
722
+ case "<=":
723
+ return lte(a, b, loose);
724
+ default:
725
+ throw new TypeError(`Invalid operator: ${op}`);
726
+ }
727
+ };
728
+ module2.exports = cmp;
729
+ }
730
+ });
731
+ var require_coerce = __commonJS({
732
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/coerce.js"(exports$1, module2) {
733
+ var SemVer = require_semver();
734
+ var parse = require_parse();
735
+ var { safeRe: re, t } = require_re();
736
+ var coerce2 = (version, options) => {
737
+ if (version instanceof SemVer) {
738
+ return version;
739
+ }
740
+ if (typeof version === "number") {
741
+ version = String(version);
742
+ }
743
+ if (typeof version !== "string") {
744
+ return null;
745
+ }
746
+ options = options || {};
747
+ let match = null;
748
+ if (!options.rtl) {
749
+ match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
750
+ } else {
751
+ const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
752
+ let next;
753
+ while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
754
+ if (!match || next.index + next[0].length !== match.index + match[0].length) {
755
+ match = next;
756
+ }
757
+ coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
758
+ }
759
+ coerceRtlRegex.lastIndex = -1;
760
+ }
761
+ if (match === null) {
762
+ return null;
763
+ }
764
+ const major = match[2];
765
+ const minor = match[3] || "0";
766
+ const patch = match[4] || "0";
767
+ const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
768
+ const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
769
+ return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
770
+ };
771
+ module2.exports = coerce2;
772
+ }
773
+ });
774
+ var require_lrucache = __commonJS({
775
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.js"(exports$1, module2) {
776
+ var LRUCache = class {
777
+ constructor() {
778
+ this.max = 1e3;
779
+ this.map = /* @__PURE__ */ new Map();
780
+ }
781
+ get(key) {
782
+ const value = this.map.get(key);
783
+ if (value === void 0) {
784
+ return void 0;
785
+ } else {
786
+ this.map.delete(key);
787
+ this.map.set(key, value);
788
+ return value;
789
+ }
790
+ }
791
+ delete(key) {
792
+ return this.map.delete(key);
793
+ }
794
+ set(key, value) {
795
+ const deleted = this.delete(key);
796
+ if (!deleted && value !== void 0) {
797
+ if (this.map.size >= this.max) {
798
+ const firstKey = this.map.keys().next().value;
799
+ this.delete(firstKey);
800
+ }
801
+ this.map.set(key, value);
802
+ }
803
+ return this;
804
+ }
805
+ };
806
+ module2.exports = LRUCache;
807
+ }
808
+ });
809
+ var require_range = __commonJS({
810
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.js"(exports$1, module2) {
811
+ var SPACE_CHARACTERS = /\s+/g;
812
+ var Range = class _Range {
813
+ constructor(range, options) {
814
+ options = parseOptions(options);
815
+ if (range instanceof _Range) {
816
+ if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
817
+ return range;
818
+ } else {
819
+ return new _Range(range.raw, options);
820
+ }
821
+ }
822
+ if (range instanceof Comparator) {
823
+ this.raw = range.value;
824
+ this.set = [[range]];
825
+ this.formatted = void 0;
826
+ return this;
827
+ }
828
+ this.options = options;
829
+ this.loose = !!options.loose;
830
+ this.includePrerelease = !!options.includePrerelease;
831
+ this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
832
+ this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
833
+ if (!this.set.length) {
834
+ throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
835
+ }
836
+ if (this.set.length > 1) {
837
+ const first = this.set[0];
838
+ this.set = this.set.filter((c) => !isNullSet(c[0]));
839
+ if (this.set.length === 0) {
840
+ this.set = [first];
841
+ } else if (this.set.length > 1) {
842
+ for (const c of this.set) {
843
+ if (c.length === 1 && isAny(c[0])) {
844
+ this.set = [c];
845
+ break;
846
+ }
847
+ }
848
+ }
849
+ }
850
+ this.formatted = void 0;
851
+ }
852
+ get range() {
853
+ if (this.formatted === void 0) {
854
+ this.formatted = "";
855
+ for (let i = 0; i < this.set.length; i++) {
856
+ if (i > 0) {
857
+ this.formatted += "||";
858
+ }
859
+ const comps = this.set[i];
860
+ for (let k = 0; k < comps.length; k++) {
861
+ if (k > 0) {
862
+ this.formatted += " ";
863
+ }
864
+ this.formatted += comps[k].toString().trim();
865
+ }
866
+ }
867
+ }
868
+ return this.formatted;
869
+ }
870
+ format() {
871
+ return this.range;
872
+ }
873
+ toString() {
874
+ return this.range;
875
+ }
876
+ parseRange(range) {
877
+ const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
878
+ const memoKey = memoOpts + ":" + range;
879
+ const cached = cache.get(memoKey);
880
+ if (cached) {
881
+ return cached;
882
+ }
883
+ const loose = this.options.loose;
884
+ const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
885
+ range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
886
+ debug("hyphen replace", range);
887
+ range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
888
+ debug("comparator trim", range);
889
+ range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
890
+ debug("tilde trim", range);
891
+ range = range.replace(re[t.CARETTRIM], caretTrimReplace);
892
+ debug("caret trim", range);
893
+ let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
894
+ if (loose) {
895
+ rangeList = rangeList.filter((comp) => {
896
+ debug("loose invalid filter", comp, this.options);
897
+ return !!comp.match(re[t.COMPARATORLOOSE]);
898
+ });
899
+ }
900
+ debug("range list", rangeList);
901
+ const rangeMap = /* @__PURE__ */ new Map();
902
+ const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
903
+ for (const comp of comparators) {
904
+ if (isNullSet(comp)) {
905
+ return [comp];
906
+ }
907
+ rangeMap.set(comp.value, comp);
908
+ }
909
+ if (rangeMap.size > 1 && rangeMap.has("")) {
910
+ rangeMap.delete("");
911
+ }
912
+ const result = [...rangeMap.values()];
913
+ cache.set(memoKey, result);
914
+ return result;
915
+ }
916
+ intersects(range, options) {
917
+ if (!(range instanceof _Range)) {
918
+ throw new TypeError("a Range is required");
919
+ }
920
+ return this.set.some((thisComparators) => {
921
+ return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
922
+ return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
923
+ return rangeComparators.every((rangeComparator) => {
924
+ return thisComparator.intersects(rangeComparator, options);
925
+ });
926
+ });
927
+ });
928
+ });
929
+ }
930
+ // if ANY of the sets match ALL of its comparators, then pass
931
+ test(version) {
932
+ if (!version) {
933
+ return false;
934
+ }
935
+ if (typeof version === "string") {
936
+ try {
937
+ version = new SemVer(version, this.options);
938
+ } catch (er) {
939
+ return false;
940
+ }
941
+ }
942
+ for (let i = 0; i < this.set.length; i++) {
943
+ if (testSet(this.set[i], version, this.options)) {
944
+ return true;
945
+ }
946
+ }
947
+ return false;
948
+ }
949
+ };
950
+ module2.exports = Range;
951
+ var LRU = require_lrucache();
952
+ var cache = new LRU();
953
+ var parseOptions = require_parse_options();
954
+ var Comparator = require_comparator();
955
+ var debug = require_debug();
956
+ var SemVer = require_semver();
957
+ var {
958
+ safeRe: re,
959
+ t,
960
+ comparatorTrimReplace,
961
+ tildeTrimReplace,
962
+ caretTrimReplace
963
+ } = require_re();
964
+ var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
965
+ var isNullSet = (c) => c.value === "<0.0.0-0";
966
+ var isAny = (c) => c.value === "";
967
+ var isSatisfiable = (comparators, options) => {
968
+ let result = true;
969
+ const remainingComparators = comparators.slice();
970
+ let testComparator = remainingComparators.pop();
971
+ while (result && remainingComparators.length) {
972
+ result = remainingComparators.every((otherComparator) => {
973
+ return testComparator.intersects(otherComparator, options);
974
+ });
975
+ testComparator = remainingComparators.pop();
976
+ }
977
+ return result;
978
+ };
979
+ var parseComparator = (comp, options) => {
980
+ comp = comp.replace(re[t.BUILD], "");
981
+ debug("comp", comp, options);
982
+ comp = replaceCarets(comp, options);
983
+ debug("caret", comp);
984
+ comp = replaceTildes(comp, options);
985
+ debug("tildes", comp);
986
+ comp = replaceXRanges(comp, options);
987
+ debug("xrange", comp);
988
+ comp = replaceStars(comp, options);
989
+ debug("stars", comp);
990
+ return comp;
991
+ };
992
+ var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
993
+ var replaceTildes = (comp, options) => {
994
+ return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
995
+ };
996
+ var replaceTilde = (comp, options) => {
997
+ const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
998
+ return comp.replace(r, (_, M, m, p, pr) => {
999
+ debug("tilde", comp, _, M, m, p, pr);
1000
+ let ret;
1001
+ if (isX(M)) {
1002
+ ret = "";
1003
+ } else if (isX(m)) {
1004
+ ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
1005
+ } else if (isX(p)) {
1006
+ ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
1007
+ } else if (pr) {
1008
+ debug("replaceTilde pr", pr);
1009
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
1010
+ } else {
1011
+ ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
1012
+ }
1013
+ debug("tilde return", ret);
1014
+ return ret;
1015
+ });
1016
+ };
1017
+ var replaceCarets = (comp, options) => {
1018
+ return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
1019
+ };
1020
+ var replaceCaret = (comp, options) => {
1021
+ debug("caret", comp, options);
1022
+ const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
1023
+ const z = options.includePrerelease ? "-0" : "";
1024
+ return comp.replace(r, (_, M, m, p, pr) => {
1025
+ debug("caret", comp, _, M, m, p, pr);
1026
+ let ret;
1027
+ if (isX(M)) {
1028
+ ret = "";
1029
+ } else if (isX(m)) {
1030
+ ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
1031
+ } else if (isX(p)) {
1032
+ if (M === "0") {
1033
+ ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
1034
+ } else {
1035
+ ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
1036
+ }
1037
+ } else if (pr) {
1038
+ debug("replaceCaret pr", pr);
1039
+ if (M === "0") {
1040
+ if (m === "0") {
1041
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
1042
+ } else {
1043
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
1044
+ }
1045
+ } else {
1046
+ ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
1047
+ }
1048
+ } else {
1049
+ debug("no pr");
1050
+ if (M === "0") {
1051
+ if (m === "0") {
1052
+ ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
1053
+ } else {
1054
+ ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
1055
+ }
1056
+ } else {
1057
+ ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
1058
+ }
1059
+ }
1060
+ debug("caret return", ret);
1061
+ return ret;
1062
+ });
1063
+ };
1064
+ var replaceXRanges = (comp, options) => {
1065
+ debug("replaceXRanges", comp, options);
1066
+ return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
1067
+ };
1068
+ var replaceXRange = (comp, options) => {
1069
+ comp = comp.trim();
1070
+ const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
1071
+ return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
1072
+ debug("xRange", comp, ret, gtlt, M, m, p, pr);
1073
+ const xM = isX(M);
1074
+ const xm = xM || isX(m);
1075
+ const xp = xm || isX(p);
1076
+ const anyX = xp;
1077
+ if (gtlt === "=" && anyX) {
1078
+ gtlt = "";
1079
+ }
1080
+ pr = options.includePrerelease ? "-0" : "";
1081
+ if (xM) {
1082
+ if (gtlt === ">" || gtlt === "<") {
1083
+ ret = "<0.0.0-0";
1084
+ } else {
1085
+ ret = "*";
1086
+ }
1087
+ } else if (gtlt && anyX) {
1088
+ if (xm) {
1089
+ m = 0;
1090
+ }
1091
+ p = 0;
1092
+ if (gtlt === ">") {
1093
+ gtlt = ">=";
1094
+ if (xm) {
1095
+ M = +M + 1;
1096
+ m = 0;
1097
+ p = 0;
1098
+ } else {
1099
+ m = +m + 1;
1100
+ p = 0;
1101
+ }
1102
+ } else if (gtlt === "<=") {
1103
+ gtlt = "<";
1104
+ if (xm) {
1105
+ M = +M + 1;
1106
+ } else {
1107
+ m = +m + 1;
1108
+ }
1109
+ }
1110
+ if (gtlt === "<") {
1111
+ pr = "-0";
1112
+ }
1113
+ ret = `${gtlt + M}.${m}.${p}${pr}`;
1114
+ } else if (xm) {
1115
+ ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
1116
+ } else if (xp) {
1117
+ ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
1118
+ }
1119
+ debug("xRange return", ret);
1120
+ return ret;
1121
+ });
1122
+ };
1123
+ var replaceStars = (comp, options) => {
1124
+ debug("replaceStars", comp, options);
1125
+ return comp.trim().replace(re[t.STAR], "");
1126
+ };
1127
+ var replaceGTE0 = (comp, options) => {
1128
+ debug("replaceGTE0", comp, options);
1129
+ return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
1130
+ };
1131
+ var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
1132
+ if (isX(fM)) {
1133
+ from = "";
1134
+ } else if (isX(fm)) {
1135
+ from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
1136
+ } else if (isX(fp)) {
1137
+ from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
1138
+ } else if (fpr) {
1139
+ from = `>=${from}`;
1140
+ } else {
1141
+ from = `>=${from}${incPr ? "-0" : ""}`;
1142
+ }
1143
+ if (isX(tM)) {
1144
+ to = "";
1145
+ } else if (isX(tm)) {
1146
+ to = `<${+tM + 1}.0.0-0`;
1147
+ } else if (isX(tp)) {
1148
+ to = `<${tM}.${+tm + 1}.0-0`;
1149
+ } else if (tpr) {
1150
+ to = `<=${tM}.${tm}.${tp}-${tpr}`;
1151
+ } else if (incPr) {
1152
+ to = `<${tM}.${tm}.${+tp + 1}-0`;
1153
+ } else {
1154
+ to = `<=${to}`;
1155
+ }
1156
+ return `${from} ${to}`.trim();
1157
+ };
1158
+ var testSet = (set, version, options) => {
1159
+ for (let i = 0; i < set.length; i++) {
1160
+ if (!set[i].test(version)) {
1161
+ return false;
1162
+ }
1163
+ }
1164
+ if (version.prerelease.length && !options.includePrerelease) {
1165
+ for (let i = 0; i < set.length; i++) {
1166
+ debug(set[i].semver);
1167
+ if (set[i].semver === Comparator.ANY) {
1168
+ continue;
1169
+ }
1170
+ if (set[i].semver.prerelease.length > 0) {
1171
+ const allowed = set[i].semver;
1172
+ if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
1173
+ return true;
1174
+ }
1175
+ }
1176
+ }
1177
+ return false;
1178
+ }
1179
+ return true;
1180
+ };
1181
+ }
1182
+ });
1183
+ var require_comparator = __commonJS({
1184
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.js"(exports$1, module2) {
1185
+ var ANY = /* @__PURE__ */ Symbol("SemVer ANY");
1186
+ var Comparator = class _Comparator {
1187
+ static get ANY() {
1188
+ return ANY;
1189
+ }
1190
+ constructor(comp, options) {
1191
+ options = parseOptions(options);
1192
+ if (comp instanceof _Comparator) {
1193
+ if (comp.loose === !!options.loose) {
1194
+ return comp;
1195
+ } else {
1196
+ comp = comp.value;
1197
+ }
1198
+ }
1199
+ comp = comp.trim().split(/\s+/).join(" ");
1200
+ debug("comparator", comp, options);
1201
+ this.options = options;
1202
+ this.loose = !!options.loose;
1203
+ this.parse(comp);
1204
+ if (this.semver === ANY) {
1205
+ this.value = "";
1206
+ } else {
1207
+ this.value = this.operator + this.semver.version;
1208
+ }
1209
+ debug("comp", this);
1210
+ }
1211
+ parse(comp) {
1212
+ const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
1213
+ const m = comp.match(r);
1214
+ if (!m) {
1215
+ throw new TypeError(`Invalid comparator: ${comp}`);
1216
+ }
1217
+ this.operator = m[1] !== void 0 ? m[1] : "";
1218
+ if (this.operator === "=") {
1219
+ this.operator = "";
1220
+ }
1221
+ if (!m[2]) {
1222
+ this.semver = ANY;
1223
+ } else {
1224
+ this.semver = new SemVer(m[2], this.options.loose);
1225
+ }
1226
+ }
1227
+ toString() {
1228
+ return this.value;
1229
+ }
1230
+ test(version) {
1231
+ debug("Comparator.test", version, this.options.loose);
1232
+ if (this.semver === ANY || version === ANY) {
1233
+ return true;
1234
+ }
1235
+ if (typeof version === "string") {
1236
+ try {
1237
+ version = new SemVer(version, this.options);
1238
+ } catch (er) {
1239
+ return false;
1240
+ }
1241
+ }
1242
+ return cmp(version, this.operator, this.semver, this.options);
1243
+ }
1244
+ intersects(comp, options) {
1245
+ if (!(comp instanceof _Comparator)) {
1246
+ throw new TypeError("a Comparator is required");
1247
+ }
1248
+ if (this.operator === "") {
1249
+ if (this.value === "") {
1250
+ return true;
1251
+ }
1252
+ return new Range(comp.value, options).test(this.value);
1253
+ } else if (comp.operator === "") {
1254
+ if (comp.value === "") {
1255
+ return true;
1256
+ }
1257
+ return new Range(this.value, options).test(comp.semver);
1258
+ }
1259
+ options = parseOptions(options);
1260
+ if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
1261
+ return false;
1262
+ }
1263
+ if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
1264
+ return false;
1265
+ }
1266
+ if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
1267
+ return true;
1268
+ }
1269
+ if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
1270
+ return true;
1271
+ }
1272
+ if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
1273
+ return true;
1274
+ }
1275
+ if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
1276
+ return true;
1277
+ }
1278
+ if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
1279
+ return true;
1280
+ }
1281
+ return false;
1282
+ }
1283
+ };
1284
+ module2.exports = Comparator;
1285
+ var parseOptions = require_parse_options();
1286
+ var { safeRe: re, t } = require_re();
1287
+ var cmp = require_cmp();
1288
+ var debug = require_debug();
1289
+ var SemVer = require_semver();
1290
+ var Range = require_range();
1291
+ }
1292
+ });
1293
+ var require_satisfies = __commonJS({
1294
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.js"(exports$1, module2) {
1295
+ var Range = require_range();
1296
+ var satisfies2 = (version, range, options) => {
1297
+ try {
1298
+ range = new Range(range, options);
1299
+ } catch (er) {
1300
+ return false;
1301
+ }
1302
+ return range.test(version);
1303
+ };
1304
+ module2.exports = satisfies2;
1305
+ }
1306
+ });
1307
+ var require_to_comparators = __commonJS({
1308
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/to-comparators.js"(exports$1, module2) {
1309
+ var Range = require_range();
1310
+ var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
1311
+ module2.exports = toComparators;
1312
+ }
1313
+ });
1314
+ var require_max_satisfying = __commonJS({
1315
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/max-satisfying.js"(exports$1, module2) {
1316
+ var SemVer = require_semver();
1317
+ var Range = require_range();
1318
+ var maxSatisfying = (versions, range, options) => {
1319
+ let max = null;
1320
+ let maxSV = null;
1321
+ let rangeObj = null;
1322
+ try {
1323
+ rangeObj = new Range(range, options);
1324
+ } catch (er) {
1325
+ return null;
1326
+ }
1327
+ versions.forEach((v) => {
1328
+ if (rangeObj.test(v)) {
1329
+ if (!max || maxSV.compare(v) === -1) {
1330
+ max = v;
1331
+ maxSV = new SemVer(max, options);
1332
+ }
1333
+ }
1334
+ });
1335
+ return max;
1336
+ };
1337
+ module2.exports = maxSatisfying;
1338
+ }
1339
+ });
1340
+ var require_min_satisfying = __commonJS({
1341
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-satisfying.js"(exports$1, module2) {
1342
+ var SemVer = require_semver();
1343
+ var Range = require_range();
1344
+ var minSatisfying = (versions, range, options) => {
1345
+ let min = null;
1346
+ let minSV = null;
1347
+ let rangeObj = null;
1348
+ try {
1349
+ rangeObj = new Range(range, options);
1350
+ } catch (er) {
1351
+ return null;
1352
+ }
1353
+ versions.forEach((v) => {
1354
+ if (rangeObj.test(v)) {
1355
+ if (!min || minSV.compare(v) === 1) {
1356
+ min = v;
1357
+ minSV = new SemVer(min, options);
1358
+ }
1359
+ }
1360
+ });
1361
+ return min;
1362
+ };
1363
+ module2.exports = minSatisfying;
1364
+ }
1365
+ });
1366
+ var require_min_version = __commonJS({
1367
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-version.js"(exports$1, module2) {
1368
+ var SemVer = require_semver();
1369
+ var Range = require_range();
1370
+ var gt = require_gt();
1371
+ var minVersion = (range, loose) => {
1372
+ range = new Range(range, loose);
1373
+ let minver = new SemVer("0.0.0");
1374
+ if (range.test(minver)) {
1375
+ return minver;
1376
+ }
1377
+ minver = new SemVer("0.0.0-0");
1378
+ if (range.test(minver)) {
1379
+ return minver;
1380
+ }
1381
+ minver = null;
1382
+ for (let i = 0; i < range.set.length; ++i) {
1383
+ const comparators = range.set[i];
1384
+ let setMin = null;
1385
+ comparators.forEach((comparator) => {
1386
+ const compver = new SemVer(comparator.semver.version);
1387
+ switch (comparator.operator) {
1388
+ case ">":
1389
+ if (compver.prerelease.length === 0) {
1390
+ compver.patch++;
1391
+ } else {
1392
+ compver.prerelease.push(0);
1393
+ }
1394
+ compver.raw = compver.format();
1395
+ /* fallthrough */
1396
+ case "":
1397
+ case ">=":
1398
+ if (!setMin || gt(compver, setMin)) {
1399
+ setMin = compver;
1400
+ }
1401
+ break;
1402
+ case "<":
1403
+ case "<=":
1404
+ break;
1405
+ /* istanbul ignore next */
1406
+ default:
1407
+ throw new Error(`Unexpected operation: ${comparator.operator}`);
1408
+ }
1409
+ });
1410
+ if (setMin && (!minver || gt(minver, setMin))) {
1411
+ minver = setMin;
1412
+ }
1413
+ }
1414
+ if (minver && range.test(minver)) {
1415
+ return minver;
1416
+ }
1417
+ return null;
1418
+ };
1419
+ module2.exports = minVersion;
1420
+ }
1421
+ });
1422
+ var require_valid2 = __commonJS({
1423
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/valid.js"(exports$1, module2) {
1424
+ var Range = require_range();
1425
+ var validRange = (range, options) => {
1426
+ try {
1427
+ return new Range(range, options).range || "*";
1428
+ } catch (er) {
1429
+ return null;
1430
+ }
1431
+ };
1432
+ module2.exports = validRange;
1433
+ }
1434
+ });
1435
+ var require_outside = __commonJS({
1436
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/outside.js"(exports$1, module2) {
1437
+ var SemVer = require_semver();
1438
+ var Comparator = require_comparator();
1439
+ var { ANY } = Comparator;
1440
+ var Range = require_range();
1441
+ var satisfies2 = require_satisfies();
1442
+ var gt = require_gt();
1443
+ var lt = require_lt();
1444
+ var lte = require_lte();
1445
+ var gte2 = require_gte();
1446
+ var outside = (version, range, hilo, options) => {
1447
+ version = new SemVer(version, options);
1448
+ range = new Range(range, options);
1449
+ let gtfn, ltefn, ltfn, comp, ecomp;
1450
+ switch (hilo) {
1451
+ case ">":
1452
+ gtfn = gt;
1453
+ ltefn = lte;
1454
+ ltfn = lt;
1455
+ comp = ">";
1456
+ ecomp = ">=";
1457
+ break;
1458
+ case "<":
1459
+ gtfn = lt;
1460
+ ltefn = gte2;
1461
+ ltfn = gt;
1462
+ comp = "<";
1463
+ ecomp = "<=";
1464
+ break;
1465
+ default:
1466
+ throw new TypeError('Must provide a hilo val of "<" or ">"');
1467
+ }
1468
+ if (satisfies2(version, range, options)) {
1469
+ return false;
1470
+ }
1471
+ for (let i = 0; i < range.set.length; ++i) {
1472
+ const comparators = range.set[i];
1473
+ let high = null;
1474
+ let low = null;
1475
+ comparators.forEach((comparator) => {
1476
+ if (comparator.semver === ANY) {
1477
+ comparator = new Comparator(">=0.0.0");
1478
+ }
1479
+ high = high || comparator;
1480
+ low = low || comparator;
1481
+ if (gtfn(comparator.semver, high.semver, options)) {
1482
+ high = comparator;
1483
+ } else if (ltfn(comparator.semver, low.semver, options)) {
1484
+ low = comparator;
1485
+ }
1486
+ });
1487
+ if (high.operator === comp || high.operator === ecomp) {
1488
+ return false;
1489
+ }
1490
+ if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
1491
+ return false;
1492
+ } else if (low.operator === ecomp && ltfn(version, low.semver)) {
1493
+ return false;
1494
+ }
1495
+ }
1496
+ return true;
1497
+ };
1498
+ module2.exports = outside;
1499
+ }
1500
+ });
1501
+ var require_gtr = __commonJS({
1502
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/gtr.js"(exports$1, module2) {
1503
+ var outside = require_outside();
1504
+ var gtr = (version, range, options) => outside(version, range, ">", options);
1505
+ module2.exports = gtr;
1506
+ }
1507
+ });
1508
+ var require_ltr = __commonJS({
1509
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/ltr.js"(exports$1, module2) {
1510
+ var outside = require_outside();
1511
+ var ltr = (version, range, options) => outside(version, range, "<", options);
1512
+ module2.exports = ltr;
1513
+ }
1514
+ });
1515
+ var require_intersects = __commonJS({
1516
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/intersects.js"(exports$1, module2) {
1517
+ var Range = require_range();
1518
+ var intersects = (r1, r2, options) => {
1519
+ r1 = new Range(r1, options);
1520
+ r2 = new Range(r2, options);
1521
+ return r1.intersects(r2, options);
1522
+ };
1523
+ module2.exports = intersects;
1524
+ }
1525
+ });
1526
+ var require_simplify = __commonJS({
1527
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/simplify.js"(exports$1, module2) {
1528
+ var satisfies2 = require_satisfies();
1529
+ var compare2 = require_compare();
1530
+ module2.exports = (versions, range, options) => {
1531
+ const set = [];
1532
+ let first = null;
1533
+ let prev = null;
1534
+ const v = versions.sort((a, b) => compare2(a, b, options));
1535
+ for (const version of v) {
1536
+ const included = satisfies2(version, range, options);
1537
+ if (included) {
1538
+ prev = version;
1539
+ if (!first) {
1540
+ first = version;
1541
+ }
1542
+ } else {
1543
+ if (prev) {
1544
+ set.push([first, prev]);
1545
+ }
1546
+ prev = null;
1547
+ first = null;
1548
+ }
1549
+ }
1550
+ if (first) {
1551
+ set.push([first, null]);
1552
+ }
1553
+ const ranges = [];
1554
+ for (const [min, max] of set) {
1555
+ if (min === max) {
1556
+ ranges.push(min);
1557
+ } else if (!max && min === v[0]) {
1558
+ ranges.push("*");
1559
+ } else if (!max) {
1560
+ ranges.push(`>=${min}`);
1561
+ } else if (min === v[0]) {
1562
+ ranges.push(`<=${max}`);
1563
+ } else {
1564
+ ranges.push(`${min} - ${max}`);
1565
+ }
1566
+ }
1567
+ const simplified = ranges.join(" || ");
1568
+ const original = typeof range.raw === "string" ? range.raw : String(range);
1569
+ return simplified.length < original.length ? simplified : range;
1570
+ };
1571
+ }
1572
+ });
1573
+ var require_subset = __commonJS({
1574
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/subset.js"(exports$1, module2) {
1575
+ var Range = require_range();
1576
+ var Comparator = require_comparator();
1577
+ var { ANY } = Comparator;
1578
+ var satisfies2 = require_satisfies();
1579
+ var compare2 = require_compare();
1580
+ var subset = (sub, dom, options = {}) => {
1581
+ if (sub === dom) {
1582
+ return true;
1583
+ }
1584
+ sub = new Range(sub, options);
1585
+ dom = new Range(dom, options);
1586
+ let sawNonNull = false;
1587
+ OUTER: for (const simpleSub of sub.set) {
1588
+ for (const simpleDom of dom.set) {
1589
+ const isSub = simpleSubset(simpleSub, simpleDom, options);
1590
+ sawNonNull = sawNonNull || isSub !== null;
1591
+ if (isSub) {
1592
+ continue OUTER;
1593
+ }
1594
+ }
1595
+ if (sawNonNull) {
1596
+ return false;
1597
+ }
1598
+ }
1599
+ return true;
1600
+ };
1601
+ var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
1602
+ var minimumVersion = [new Comparator(">=0.0.0")];
1603
+ var simpleSubset = (sub, dom, options) => {
1604
+ if (sub === dom) {
1605
+ return true;
1606
+ }
1607
+ if (sub.length === 1 && sub[0].semver === ANY) {
1608
+ if (dom.length === 1 && dom[0].semver === ANY) {
1609
+ return true;
1610
+ } else if (options.includePrerelease) {
1611
+ sub = minimumVersionWithPreRelease;
1612
+ } else {
1613
+ sub = minimumVersion;
1614
+ }
1615
+ }
1616
+ if (dom.length === 1 && dom[0].semver === ANY) {
1617
+ if (options.includePrerelease) {
1618
+ return true;
1619
+ } else {
1620
+ dom = minimumVersion;
1621
+ }
1622
+ }
1623
+ const eqSet = /* @__PURE__ */ new Set();
1624
+ let gt, lt;
1625
+ for (const c of sub) {
1626
+ if (c.operator === ">" || c.operator === ">=") {
1627
+ gt = higherGT(gt, c, options);
1628
+ } else if (c.operator === "<" || c.operator === "<=") {
1629
+ lt = lowerLT(lt, c, options);
1630
+ } else {
1631
+ eqSet.add(c.semver);
1632
+ }
1633
+ }
1634
+ if (eqSet.size > 1) {
1635
+ return null;
1636
+ }
1637
+ let gtltComp;
1638
+ if (gt && lt) {
1639
+ gtltComp = compare2(gt.semver, lt.semver, options);
1640
+ if (gtltComp > 0) {
1641
+ return null;
1642
+ } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
1643
+ return null;
1644
+ }
1645
+ }
1646
+ for (const eq of eqSet) {
1647
+ if (gt && !satisfies2(eq, String(gt), options)) {
1648
+ return null;
1649
+ }
1650
+ if (lt && !satisfies2(eq, String(lt), options)) {
1651
+ return null;
1652
+ }
1653
+ for (const c of dom) {
1654
+ if (!satisfies2(eq, String(c), options)) {
1655
+ return false;
1656
+ }
1657
+ }
1658
+ return true;
1659
+ }
1660
+ let higher, lower;
1661
+ let hasDomLT, hasDomGT;
1662
+ let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
1663
+ let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
1664
+ if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
1665
+ needDomLTPre = false;
1666
+ }
1667
+ for (const c of dom) {
1668
+ hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
1669
+ hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
1670
+ if (gt) {
1671
+ if (needDomGTPre) {
1672
+ if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
1673
+ needDomGTPre = false;
1674
+ }
1675
+ }
1676
+ if (c.operator === ">" || c.operator === ">=") {
1677
+ higher = higherGT(gt, c, options);
1678
+ if (higher === c && higher !== gt) {
1679
+ return false;
1680
+ }
1681
+ } else if (gt.operator === ">=" && !satisfies2(gt.semver, String(c), options)) {
1682
+ return false;
1683
+ }
1684
+ }
1685
+ if (lt) {
1686
+ if (needDomLTPre) {
1687
+ if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
1688
+ needDomLTPre = false;
1689
+ }
1690
+ }
1691
+ if (c.operator === "<" || c.operator === "<=") {
1692
+ lower = lowerLT(lt, c, options);
1693
+ if (lower === c && lower !== lt) {
1694
+ return false;
1695
+ }
1696
+ } else if (lt.operator === "<=" && !satisfies2(lt.semver, String(c), options)) {
1697
+ return false;
1698
+ }
1699
+ }
1700
+ if (!c.operator && (lt || gt) && gtltComp !== 0) {
1701
+ return false;
1702
+ }
1703
+ }
1704
+ if (gt && hasDomLT && !lt && gtltComp !== 0) {
1705
+ return false;
1706
+ }
1707
+ if (lt && hasDomGT && !gt && gtltComp !== 0) {
1708
+ return false;
1709
+ }
1710
+ if (needDomGTPre || needDomLTPre) {
1711
+ return false;
1712
+ }
1713
+ return true;
1714
+ };
1715
+ var higherGT = (a, b, options) => {
1716
+ if (!a) {
1717
+ return b;
1718
+ }
1719
+ const comp = compare2(a.semver, b.semver, options);
1720
+ return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
1721
+ };
1722
+ var lowerLT = (a, b, options) => {
1723
+ if (!a) {
1724
+ return b;
1725
+ }
1726
+ const comp = compare2(a.semver, b.semver, options);
1727
+ return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
1728
+ };
1729
+ module2.exports = subset;
1730
+ }
1731
+ });
1732
+ var require_semver2 = __commonJS({
1733
+ "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/index.js"(exports$1, module2) {
1734
+ var internalRe = require_re();
1735
+ var constants2 = require_constants();
1736
+ var SemVer = require_semver();
1737
+ var identifiers = require_identifiers();
1738
+ var parse = require_parse();
1739
+ var valid2 = require_valid();
1740
+ var clean = require_clean();
1741
+ var inc = require_inc();
1742
+ var diff = require_diff();
1743
+ var major = require_major();
1744
+ var minor = require_minor();
1745
+ var patch = require_patch();
1746
+ var prerelease = require_prerelease();
1747
+ var compare2 = require_compare();
1748
+ var rcompare = require_rcompare();
1749
+ var compareLoose = require_compare_loose();
1750
+ var compareBuild = require_compare_build();
1751
+ var sort = require_sort();
1752
+ var rsort = require_rsort();
1753
+ var gt = require_gt();
1754
+ var lt = require_lt();
1755
+ var eq = require_eq();
1756
+ var neq = require_neq();
1757
+ var gte2 = require_gte();
1758
+ var lte = require_lte();
1759
+ var cmp = require_cmp();
1760
+ var coerce2 = require_coerce();
1761
+ var Comparator = require_comparator();
1762
+ var Range = require_range();
1763
+ var satisfies2 = require_satisfies();
1764
+ var toComparators = require_to_comparators();
1765
+ var maxSatisfying = require_max_satisfying();
1766
+ var minSatisfying = require_min_satisfying();
1767
+ var minVersion = require_min_version();
1768
+ var validRange = require_valid2();
1769
+ var outside = require_outside();
1770
+ var gtr = require_gtr();
1771
+ var ltr = require_ltr();
1772
+ var intersects = require_intersects();
1773
+ var simplifyRange = require_simplify();
1774
+ var subset = require_subset();
1775
+ module2.exports = {
1776
+ parse,
1777
+ valid: valid2,
1778
+ clean,
1779
+ inc,
1780
+ diff,
1781
+ major,
1782
+ minor,
1783
+ patch,
1784
+ prerelease,
1785
+ compare: compare2,
1786
+ rcompare,
1787
+ compareLoose,
1788
+ compareBuild,
1789
+ sort,
1790
+ rsort,
1791
+ gt,
1792
+ lt,
1793
+ eq,
1794
+ neq,
1795
+ gte: gte2,
1796
+ lte,
1797
+ cmp,
1798
+ coerce: coerce2,
1799
+ Comparator,
1800
+ Range,
1801
+ satisfies: satisfies2,
1802
+ toComparators,
1803
+ maxSatisfying,
1804
+ minSatisfying,
1805
+ minVersion,
1806
+ validRange,
1807
+ outside,
1808
+ gtr,
1809
+ ltr,
1810
+ intersects,
1811
+ simplifyRange,
1812
+ subset,
1813
+ SemVer,
1814
+ re: internalRe.re,
1815
+ src: internalRe.src,
1816
+ tokens: internalRe.t,
1817
+ SEMVER_SPEC_VERSION: constants2.SEMVER_SPEC_VERSION,
1818
+ RELEASE_TYPES: constants2.RELEASE_TYPES,
1819
+ compareIdentifiers: identifiers.compareIdentifiers,
1820
+ rcompareIdentifiers: identifiers.rcompareIdentifiers
1821
+ };
1822
+ }
1823
+ });
1824
+ var CliForegroundColor = /* @__PURE__ */ ((CliForegroundColor2) => {
1825
+ CliForegroundColor2["Black"] = "\x1B[30m";
1826
+ CliForegroundColor2["Red"] = "\x1B[31m";
1827
+ CliForegroundColor2["Green"] = "\x1B[32m";
1828
+ CliForegroundColor2["Yellow"] = "\x1B[33m";
1829
+ CliForegroundColor2["Blue"] = "\x1B[34m";
1830
+ CliForegroundColor2["Magenta"] = "\x1B[35m";
1831
+ CliForegroundColor2["Cyan"] = "\x1B[36m";
1832
+ CliForegroundColor2["White"] = "\x1B[37m";
1833
+ CliForegroundColor2["Reset"] = "\x1B[0m";
1834
+ return CliForegroundColor2;
1835
+ })(CliForegroundColor || {});
1836
+ var DefaultLibraryAuthor = {
1837
+ name: "Nicolae Lupei",
1838
+ email: "nicolae.lupei@qodalis.com"
1839
+ };
1840
+ var semver = __toESM(require_semver2());
1841
+ var ServerVersionNegotiator = class {
1842
+ static {
1843
+ this.CLIENT_SUPPORTED_VERSIONS = [2];
1844
+ }
1845
+ /**
1846
+ * Given a server's version info, pick the highest mutually compatible version.
1847
+ * Returns null if no compatible version exists.
1848
+ */
1849
+ static negotiate(serverInfo) {
1850
+ const common = this.CLIENT_SUPPORTED_VERSIONS.filter(
1851
+ (v) => serverInfo.supportedVersions.includes(v)
1852
+ );
1853
+ return common.length > 0 ? Math.max(...common) : null;
1854
+ }
1855
+ /**
1856
+ * Discover the server's supported versions and negotiate the best match.
1857
+ * Returns the negotiated API version and the base path for all subsequent calls,
1858
+ * or null if the server is unreachable or incompatible.
1859
+ */
1860
+ static async discover(baseUrl) {
1861
+ try {
1862
+ const response = await fetch(`${baseUrl}/api/cli/versions`);
1863
+ if (!response.ok) return null;
1864
+ const info = await response.json();
1865
+ const version = this.negotiate(info);
1866
+ if (version === null) return null;
1867
+ return {
1868
+ apiVersion: version,
1869
+ basePath: `${baseUrl}/api/v${version}/cli`
1870
+ };
1871
+ } catch {
1872
+ return null;
1873
+ }
1874
+ }
1875
+ };
1876
+ var bootCliModule = async (module2) => {
1877
+ if (typeof window !== "undefined" && window.__cliModuleRegistry) {
1878
+ await window.__cliModuleRegistry.register(module2);
1879
+ }
1880
+ };
1881
+ var DefaultThemes = {
1882
+ default: {
1883
+ background: "#070b14",
1884
+ foreground: "#dee2ea",
1885
+ cursor: "#818cf8",
1886
+ selectionBackground: "#334155",
1887
+ selectionForeground: "#ffffff",
1888
+ black: "#0d1117",
1889
+ red: "#f87171",
1890
+ green: "#4ade80",
1891
+ yellow: "#fbbf24",
1892
+ blue: "#818cf8",
1893
+ magenta: "#c084fc",
1894
+ cyan: "#67e8f9",
1895
+ white: "#dee2ea",
1896
+ brightBlack: "#475569",
1897
+ brightRed: "#fca5a5",
1898
+ brightGreen: "#86efac",
1899
+ brightYellow: "#fde68a",
1900
+ brightBlue: "#a5b4fc",
1901
+ brightMagenta: "#d8b4fe",
1902
+ brightCyan: "#a5f3fc",
1903
+ brightWhite: "#f1f5f9"
1904
+ },
1905
+ classic: {
1906
+ background: "#0c0c0c",
1907
+ foreground: "#cccccc",
1908
+ cursor: "#cccccc",
1909
+ selectionBackground: "#264f78",
1910
+ selectionForeground: "#ffffff",
1911
+ black: "#0c0c0c",
1912
+ red: "#c50f1f",
1913
+ green: "#13a10e",
1914
+ yellow: "#c19c00",
1915
+ blue: "#0037da",
1916
+ magenta: "#881798",
1917
+ cyan: "#3a96dd",
1918
+ white: "#cccccc",
1919
+ brightBlack: "#767676",
1920
+ brightRed: "#e74856",
1921
+ brightGreen: "#16c60c",
1922
+ brightYellow: "#f9f1a5",
1923
+ brightBlue: "#3b78ff",
1924
+ brightMagenta: "#b4009e",
1925
+ brightCyan: "#61d6d6",
1926
+ brightWhite: "#f2f2f2"
1927
+ },
1928
+ dracula: {
1929
+ background: "#282A36",
1930
+ foreground: "#F8F8F2",
1931
+ cursor: "#50FA7B",
1932
+ black: "#21222C",
1933
+ red: "#FF5555",
1934
+ green: "#50FA7B",
1935
+ yellow: "#F1FA8C",
1936
+ blue: "#BD93F9",
1937
+ magenta: "#FF79C6",
1938
+ cyan: "#8BE9FD",
1939
+ white: "#F8F8F2",
1940
+ brightBlack: "#6272A4",
1941
+ brightRed: "#FF6E6E",
1942
+ brightGreen: "#69FF94",
1943
+ brightYellow: "#FFFFA5",
1944
+ brightBlue: "#D6ACFF",
1945
+ brightMagenta: "#FF92D0",
1946
+ brightCyan: "#A4FFFF",
1947
+ brightWhite: "#FFFFFF"
1948
+ },
1949
+ monokai: {
1950
+ background: "#272822",
1951
+ foreground: "#F8F8F2",
1952
+ cursor: "#F8F8F0",
1953
+ black: "#272822",
1954
+ red: "#F92672",
1955
+ green: "#A6E22E",
1956
+ yellow: "#F4BF75",
1957
+ blue: "#66D9EF",
1958
+ magenta: "#AE81FF",
1959
+ cyan: "#A1EFE4",
1960
+ white: "#F8F8F2",
1961
+ brightBlack: "#75715E",
1962
+ brightRed: "#F92672",
1963
+ brightGreen: "#A6E22E",
1964
+ brightYellow: "#F4BF75",
1965
+ brightBlue: "#66D9EF",
1966
+ brightMagenta: "#AE81FF",
1967
+ brightCyan: "#A1EFE4",
1968
+ brightWhite: "#F9F8F5"
1969
+ },
1970
+ solarizedDark: {
1971
+ background: "#002B36",
1972
+ foreground: "#839496",
1973
+ cursor: "#93A1A1",
1974
+ black: "#073642",
1975
+ red: "#DC322F",
1976
+ green: "#859900",
1977
+ yellow: "#B58900",
1978
+ blue: "#268BD2",
1979
+ magenta: "#D33682",
1980
+ cyan: "#2AA198",
1981
+ white: "#EEE8D5",
1982
+ brightBlack: "#002B36",
1983
+ brightRed: "#CB4B16",
1984
+ brightGreen: "#586E75",
1985
+ brightYellow: "#657B83",
1986
+ brightBlue: "#839496",
1987
+ brightMagenta: "#6C71C4",
1988
+ brightCyan: "#93A1A1",
1989
+ brightWhite: "#FDF6E3"
1990
+ },
1991
+ solarizedLight: {
1992
+ background: "#FDF6E3",
1993
+ foreground: "#657B83",
1994
+ cursor: "#586E75",
1995
+ black: "#073642",
1996
+ red: "#DC322F",
1997
+ green: "#859900",
1998
+ yellow: "#B58900",
1999
+ blue: "#268BD2",
2000
+ magenta: "#D33682",
2001
+ cyan: "#2AA198",
2002
+ white: "#EEE8D5",
2003
+ brightBlack: "#002B36",
2004
+ brightRed: "#CB4B16",
2005
+ brightGreen: "#586E75",
2006
+ brightYellow: "#657B83",
2007
+ brightBlue: "#839496",
2008
+ brightMagenta: "#6C71C4",
2009
+ brightCyan: "#93A1A1",
2010
+ brightWhite: "#FDF6E3"
2011
+ },
2012
+ gruvboxDark: {
2013
+ background: "#282828",
2014
+ foreground: "#EBDBB2",
2015
+ cursor: "#EBDBB2",
2016
+ black: "#282828",
2017
+ red: "#CC241D",
2018
+ green: "#98971A",
2019
+ yellow: "#D79921",
2020
+ blue: "#458588",
2021
+ magenta: "#B16286",
2022
+ cyan: "#689D6A",
2023
+ white: "#A89984",
2024
+ brightBlack: "#928374",
2025
+ brightRed: "#FB4934",
2026
+ brightGreen: "#B8BB26",
2027
+ brightYellow: "#FABD2F",
2028
+ brightBlue: "#83A598",
2029
+ brightMagenta: "#D3869B",
2030
+ brightCyan: "#8EC07C",
2031
+ brightWhite: "#EBDBB2"
2032
+ },
2033
+ gruvboxLight: {
2034
+ background: "#FBF1C7",
2035
+ foreground: "#3C3836",
2036
+ cursor: "#3C3836",
2037
+ black: "#FBF1C7",
2038
+ red: "#9D0006",
2039
+ green: "#79740E",
2040
+ yellow: "#B57614",
2041
+ blue: "#076678",
2042
+ magenta: "#8F3F71",
2043
+ cyan: "#427B58",
2044
+ white: "#3C3836",
2045
+ brightBlack: "#D5C4A1",
2046
+ brightRed: "#AF3A03",
2047
+ brightGreen: "#B8BB26",
2048
+ brightYellow: "#FABD2F",
2049
+ brightBlue: "#83A598",
2050
+ brightMagenta: "#D3869B",
2051
+ brightCyan: "#8EC07C",
2052
+ brightWhite: "#EBDBB2"
2053
+ },
2054
+ nord: {
2055
+ background: "#2E3440",
2056
+ foreground: "#D8DEE9",
2057
+ cursor: "#88C0D0",
2058
+ black: "#3B4252",
2059
+ red: "#BF616A",
2060
+ green: "#A3BE8C",
2061
+ yellow: "#EBCB8B",
2062
+ blue: "#81A1C1",
2063
+ magenta: "#B48EAD",
2064
+ cyan: "#88C0D0",
2065
+ white: "#E5E9F0",
2066
+ brightBlack: "#4C566A",
2067
+ brightRed: "#BF616A",
2068
+ brightGreen: "#A3BE8C",
2069
+ brightYellow: "#EBCB8B",
2070
+ brightBlue: "#81A1C1",
2071
+ brightMagenta: "#B48EAD",
2072
+ brightCyan: "#8FBCBB",
2073
+ brightWhite: "#ECEFF4"
2074
+ },
2075
+ oneDark: {
2076
+ background: "#282C34",
2077
+ foreground: "#ABB2BF",
2078
+ cursor: "#528BFF",
2079
+ black: "#282C34",
2080
+ red: "#E06C75",
2081
+ green: "#98C379",
2082
+ yellow: "#E5C07B",
2083
+ blue: "#61AFEF",
2084
+ magenta: "#C678DD",
2085
+ cyan: "#56B6C2",
2086
+ white: "#ABB2BF",
2087
+ brightBlack: "#5C6370",
2088
+ brightRed: "#E06C75",
2089
+ brightGreen: "#98C379",
2090
+ brightYellow: "#E5C07B",
2091
+ brightBlue: "#61AFEF",
2092
+ brightMagenta: "#C678DD",
2093
+ brightCyan: "#56B6C2",
2094
+ brightWhite: "#FFFFFF"
2095
+ },
2096
+ material: {
2097
+ background: "#263238",
2098
+ foreground: "#ECEFF1",
2099
+ cursor: "#FFCC00",
2100
+ black: "#263238",
2101
+ red: "#F07178",
2102
+ green: "#C3E88D",
2103
+ yellow: "#FFCB6B",
2104
+ blue: "#82AAFF",
2105
+ magenta: "#C792EA",
2106
+ cyan: "#89DDFF",
2107
+ white: "#EEFFFF",
2108
+ brightBlack: "#546E7A",
2109
+ brightRed: "#F07178",
2110
+ brightGreen: "#C3E88D",
2111
+ brightYellow: "#FFCB6B",
2112
+ brightBlue: "#82AAFF",
2113
+ brightMagenta: "#C792EA",
2114
+ brightCyan: "#89DDFF",
2115
+ brightWhite: "#FFFFFF"
2116
+ },
2117
+ highContrastLight: {
2118
+ background: "#FFFACD",
2119
+ foreground: "#000000",
2120
+ cursor: "#FFA500",
2121
+ selectionBackground: "#FFD700",
2122
+ black: "#3B3A32",
2123
+ red: "#D32F2F",
2124
+ green: "#388E3C",
2125
+ yellow: "#FBC02D",
2126
+ blue: "#1976D2",
2127
+ magenta: "#8E24AA",
2128
+ cyan: "#0097A7",
2129
+ white: "#FFFFFF",
2130
+ brightBlack: "#616161",
2131
+ brightRed: "#FF5252",
2132
+ brightGreen: "#69F0AE",
2133
+ brightYellow: "#FFEB3B",
2134
+ brightBlue: "#64B5F6",
2135
+ brightMagenta: "#BA68C8",
2136
+ brightCyan: "#4DD0E1",
2137
+ brightWhite: "#FAFAFA"
2138
+ },
2139
+ tokyoNight: {
2140
+ background: "#1a1b26",
2141
+ foreground: "#c0caf5",
2142
+ cursor: "#c0caf5",
2143
+ selectionBackground: "#33467c",
2144
+ black: "#15161e",
2145
+ red: "#f7768e",
2146
+ green: "#9ece6a",
2147
+ yellow: "#e0af68",
2148
+ blue: "#7aa2f7",
2149
+ magenta: "#bb9af7",
2150
+ cyan: "#7dcfff",
2151
+ white: "#a9b1d6",
2152
+ brightBlack: "#414868",
2153
+ brightRed: "#f7768e",
2154
+ brightGreen: "#9ece6a",
2155
+ brightYellow: "#e0af68",
2156
+ brightBlue: "#7aa2f7",
2157
+ brightMagenta: "#bb9af7",
2158
+ brightCyan: "#7dcfff",
2159
+ brightWhite: "#c0caf5"
2160
+ },
2161
+ catppuccinMocha: {
2162
+ background: "#1e1e2e",
2163
+ foreground: "#cdd6f4",
2164
+ cursor: "#f5e0dc",
2165
+ selectionBackground: "#45475a",
2166
+ black: "#45475a",
2167
+ red: "#f38ba8",
2168
+ green: "#a6e3a1",
2169
+ yellow: "#f9e2af",
2170
+ blue: "#89b4fa",
2171
+ magenta: "#f5c2e7",
2172
+ cyan: "#94e2d5",
2173
+ white: "#bac2de",
2174
+ brightBlack: "#585b70",
2175
+ brightRed: "#f38ba8",
2176
+ brightGreen: "#a6e3a1",
2177
+ brightYellow: "#f9e2af",
2178
+ brightBlue: "#89b4fa",
2179
+ brightMagenta: "#f5c2e7",
2180
+ brightCyan: "#94e2d5",
2181
+ brightWhite: "#a6adc8"
2182
+ },
2183
+ catppuccinFrappe: {
2184
+ background: "#303446",
2185
+ foreground: "#c6d0f5",
2186
+ cursor: "#f2d5cf",
2187
+ selectionBackground: "#51576d",
2188
+ black: "#51576d",
2189
+ red: "#e78284",
2190
+ green: "#a6d189",
2191
+ yellow: "#e5c890",
2192
+ blue: "#8caaee",
2193
+ magenta: "#f4b8e4",
2194
+ cyan: "#81c8be",
2195
+ white: "#b5bfe2",
2196
+ brightBlack: "#626880",
2197
+ brightRed: "#e78284",
2198
+ brightGreen: "#a6d189",
2199
+ brightYellow: "#e5c890",
2200
+ brightBlue: "#8caaee",
2201
+ brightMagenta: "#f4b8e4",
2202
+ brightCyan: "#81c8be",
2203
+ brightWhite: "#a5adce"
2204
+ },
2205
+ rosePine: {
2206
+ background: "#191724",
2207
+ foreground: "#e0def4",
2208
+ cursor: "#524f67",
2209
+ selectionBackground: "#2a283e",
2210
+ black: "#26233a",
2211
+ red: "#eb6f92",
2212
+ green: "#31748f",
2213
+ yellow: "#f6c177",
2214
+ blue: "#9ccfd8",
2215
+ magenta: "#c4a7e7",
2216
+ cyan: "#ebbcba",
2217
+ white: "#e0def4",
2218
+ brightBlack: "#6e6a86",
2219
+ brightRed: "#eb6f92",
2220
+ brightGreen: "#31748f",
2221
+ brightYellow: "#f6c177",
2222
+ brightBlue: "#9ccfd8",
2223
+ brightMagenta: "#c4a7e7",
2224
+ brightCyan: "#ebbcba",
2225
+ brightWhite: "#e0def4"
2226
+ },
2227
+ kanagawa: {
2228
+ background: "#1f1f28",
2229
+ foreground: "#dcd7ba",
2230
+ cursor: "#c8c093",
2231
+ selectionBackground: "#2d4f67",
2232
+ black: "#16161d",
2233
+ red: "#c34043",
2234
+ green: "#76946a",
2235
+ yellow: "#c0a36e",
2236
+ blue: "#7e9cd8",
2237
+ magenta: "#957fb8",
2238
+ cyan: "#6a9589",
2239
+ white: "#c8c093",
2240
+ brightBlack: "#727169",
2241
+ brightRed: "#e82424",
2242
+ brightGreen: "#98bb6c",
2243
+ brightYellow: "#e6c384",
2244
+ brightBlue: "#7fb4ca",
2245
+ brightMagenta: "#938aa9",
2246
+ brightCyan: "#7aa89f",
2247
+ brightWhite: "#dcd7ba"
2248
+ },
2249
+ everforestDark: {
2250
+ background: "#2d353b",
2251
+ foreground: "#d3c6aa",
2252
+ cursor: "#d3c6aa",
2253
+ selectionBackground: "#543a48",
2254
+ black: "#475258",
2255
+ red: "#e67e80",
2256
+ green: "#a7c080",
2257
+ yellow: "#dbbc7f",
2258
+ blue: "#7fbbb3",
2259
+ magenta: "#d699b6",
2260
+ cyan: "#83c092",
2261
+ white: "#d3c6aa",
2262
+ brightBlack: "#475258",
2263
+ brightRed: "#e67e80",
2264
+ brightGreen: "#a7c080",
2265
+ brightYellow: "#dbbc7f",
2266
+ brightBlue: "#7fbbb3",
2267
+ brightMagenta: "#d699b6",
2268
+ brightCyan: "#83c092",
2269
+ brightWhite: "#d3c6aa"
2270
+ },
2271
+ ayuDark: {
2272
+ background: "#0b0e14",
2273
+ foreground: "#bfbdb6",
2274
+ cursor: "#e6b450",
2275
+ selectionBackground: "#1b3a4b",
2276
+ black: "#01060e",
2277
+ red: "#ea6c73",
2278
+ green: "#91b362",
2279
+ yellow: "#f9af4f",
2280
+ blue: "#53bdfa",
2281
+ magenta: "#fae994",
2282
+ cyan: "#90e1c6",
2283
+ white: "#c7c7c7",
2284
+ brightBlack: "#686868",
2285
+ brightRed: "#f07178",
2286
+ brightGreen: "#c2d94c",
2287
+ brightYellow: "#ffb454",
2288
+ brightBlue: "#59c2ff",
2289
+ brightMagenta: "#ffee99",
2290
+ brightCyan: "#95e6cb",
2291
+ brightWhite: "#ffffff"
2292
+ },
2293
+ catppuccinLatte: {
2294
+ background: "#eff1f5",
2295
+ foreground: "#4c4f69",
2296
+ cursor: "#dc8a78",
2297
+ selectionBackground: "#acb0be",
2298
+ black: "#5c5f77",
2299
+ red: "#d20f39",
2300
+ green: "#40a02b",
2301
+ yellow: "#df8e1d",
2302
+ blue: "#1e66f5",
2303
+ magenta: "#ea76cb",
2304
+ cyan: "#179299",
2305
+ white: "#acb0be",
2306
+ brightBlack: "#6c6f85",
2307
+ brightRed: "#d20f39",
2308
+ brightGreen: "#40a02b",
2309
+ brightYellow: "#df8e1d",
2310
+ brightBlue: "#1e66f5",
2311
+ brightMagenta: "#ea76cb",
2312
+ brightCyan: "#179299",
2313
+ brightWhite: "#bcc0cc"
2314
+ },
2315
+ rosePineDawn: {
2316
+ background: "#faf4ed",
2317
+ foreground: "#575279",
2318
+ cursor: "#9893a5",
2319
+ selectionBackground: "#dfdad9",
2320
+ black: "#f2e9e1",
2321
+ red: "#b4637a",
2322
+ green: "#286983",
2323
+ yellow: "#ea9d34",
2324
+ blue: "#56949f",
2325
+ magenta: "#907aa9",
2326
+ cyan: "#d7827e",
2327
+ white: "#575279",
2328
+ brightBlack: "#9893a5",
2329
+ brightRed: "#b4637a",
2330
+ brightGreen: "#286983",
2331
+ brightYellow: "#ea9d34",
2332
+ brightBlue: "#56949f",
2333
+ brightMagenta: "#907aa9",
2334
+ brightCyan: "#d7827e",
2335
+ brightWhite: "#575279"
2336
+ },
2337
+ everforestLight: {
2338
+ background: "#fdf6e3",
2339
+ foreground: "#5c6a72",
2340
+ cursor: "#5c6a72",
2341
+ selectionBackground: "#e6e2cc",
2342
+ black: "#5c6a72",
2343
+ red: "#f85552",
2344
+ green: "#8da101",
2345
+ yellow: "#dfa000",
2346
+ blue: "#3a94c5",
2347
+ magenta: "#df69ba",
2348
+ cyan: "#35a77c",
2349
+ white: "#dfddc8",
2350
+ brightBlack: "#708089",
2351
+ brightRed: "#f85552",
2352
+ brightGreen: "#8da101",
2353
+ brightYellow: "#dfa000",
2354
+ brightBlue: "#3a94c5",
2355
+ brightMagenta: "#df69ba",
2356
+ brightCyan: "#35a77c",
2357
+ brightWhite: "#e8e5d0"
2358
+ },
2359
+ githubLight: {
2360
+ background: "#ffffff",
2361
+ foreground: "#24292f",
2362
+ cursor: "#044289",
2363
+ selectionBackground: "#0969da33",
2364
+ black: "#24292f",
2365
+ red: "#cf222e",
2366
+ green: "#116329",
2367
+ yellow: "#4d2d00",
2368
+ blue: "#0969da",
2369
+ magenta: "#8250df",
2370
+ cyan: "#1b7c83",
2371
+ white: "#6e7781",
2372
+ brightBlack: "#57606a",
2373
+ brightRed: "#a40e26",
2374
+ brightGreen: "#1a7f37",
2375
+ brightYellow: "#633c01",
2376
+ brightBlue: "#218bff",
2377
+ brightMagenta: "#a475f9",
2378
+ brightCyan: "#3192aa",
2379
+ brightWhite: "#8c959f"
2380
+ },
2381
+ cyberpunk: {
2382
+ background: "#0a0a1a",
2383
+ foreground: "#0abdc6",
2384
+ cursor: "#ff2079",
2385
+ selectionBackground: "#1a1a3a",
2386
+ black: "#000000",
2387
+ red: "#ff2079",
2388
+ green: "#00ff9c",
2389
+ yellow: "#fed230",
2390
+ blue: "#0abdc6",
2391
+ magenta: "#ea00d9",
2392
+ cyan: "#0abdc6",
2393
+ white: "#c7c7c7",
2394
+ brightBlack: "#686868",
2395
+ brightRed: "#ff4a9e",
2396
+ brightGreen: "#3df5b6",
2397
+ brightYellow: "#fef465",
2398
+ brightBlue: "#3ff1de",
2399
+ brightMagenta: "#ff79f0",
2400
+ brightCyan: "#3ff1de",
2401
+ brightWhite: "#ffffff"
2402
+ },
2403
+ retroGreen: {
2404
+ background: "#0a0a0a",
2405
+ foreground: "#33ff00",
2406
+ cursor: "#33ff00",
2407
+ selectionBackground: "#1a3a1a",
2408
+ black: "#0a0a0a",
2409
+ red: "#ff0000",
2410
+ green: "#33ff00",
2411
+ yellow: "#ffff00",
2412
+ blue: "#0066ff",
2413
+ magenta: "#cc00ff",
2414
+ cyan: "#00ffff",
2415
+ white: "#33ff00",
2416
+ brightBlack: "#1a5c1a",
2417
+ brightRed: "#ff3333",
2418
+ brightGreen: "#66ff33",
2419
+ brightYellow: "#ffff66",
2420
+ brightBlue: "#3399ff",
2421
+ brightMagenta: "#e550ff",
2422
+ brightCyan: "#66ffff",
2423
+ brightWhite: "#66ff33"
2424
+ },
2425
+ retroAmber: {
2426
+ background: "#0a0a00",
2427
+ foreground: "#ffb000",
2428
+ cursor: "#ffb000",
2429
+ selectionBackground: "#3a2a00",
2430
+ black: "#0a0a00",
2431
+ red: "#ff0000",
2432
+ green: "#ffb000",
2433
+ yellow: "#ffcc00",
2434
+ blue: "#cc8800",
2435
+ magenta: "#ff8800",
2436
+ cyan: "#ffcc66",
2437
+ white: "#ffb000",
2438
+ brightBlack: "#665500",
2439
+ brightRed: "#ff3333",
2440
+ brightGreen: "#ffc033",
2441
+ brightYellow: "#ffdd33",
2442
+ brightBlue: "#ddaa33",
2443
+ brightMagenta: "#ffaa33",
2444
+ brightCyan: "#ffdd99",
2445
+ brightWhite: "#ffc033"
2446
+ },
2447
+ matrix: {
2448
+ background: "#000000",
2449
+ foreground: "#00ff41",
2450
+ cursor: "#00ff41",
2451
+ selectionBackground: "#003300",
2452
+ black: "#000000",
2453
+ red: "#00ff41",
2454
+ green: "#00ff41",
2455
+ yellow: "#00ff41",
2456
+ blue: "#00cc33",
2457
+ magenta: "#009926",
2458
+ cyan: "#00ff41",
2459
+ white: "#00ff41",
2460
+ brightBlack: "#005500",
2461
+ brightRed: "#33ff66",
2462
+ brightGreen: "#33ff66",
2463
+ brightYellow: "#33ff66",
2464
+ brightBlue: "#00ff41",
2465
+ brightMagenta: "#00cc33",
2466
+ brightCyan: "#33ff66",
2467
+ brightWhite: "#66ff88"
2468
+ },
2469
+ synthwave: {
2470
+ background: "#2b213a",
2471
+ foreground: "#f0e4fc",
2472
+ cursor: "#72f1b8",
2473
+ selectionBackground: "#463465",
2474
+ black: "#2b213a",
2475
+ red: "#fe4450",
2476
+ green: "#72f1b8",
2477
+ yellow: "#fede5d",
2478
+ blue: "#2ee2fa",
2479
+ magenta: "#ff7edb",
2480
+ cyan: "#03edf9",
2481
+ white: "#f0e4fc",
2482
+ brightBlack: "#614d85",
2483
+ brightRed: "#fe4450",
2484
+ brightGreen: "#72f1b8",
2485
+ brightYellow: "#fede5d",
2486
+ brightBlue: "#2ee2fa",
2487
+ brightMagenta: "#ff7edb",
2488
+ brightCyan: "#03edf9",
2489
+ brightWhite: "#ffffff"
2490
+ },
2491
+ highContrastDark: {
2492
+ background: "#000000",
2493
+ foreground: "#ffffff",
2494
+ cursor: "#ffffff",
2495
+ selectionBackground: "#264f78",
2496
+ selectionForeground: "#ffffff",
2497
+ black: "#000000",
2498
+ red: "#ff0000",
2499
+ green: "#00ff00",
2500
+ yellow: "#ffff00",
2501
+ blue: "#3b78ff",
2502
+ magenta: "#ff00ff",
2503
+ cyan: "#00ffff",
2504
+ white: "#ffffff",
2505
+ brightBlack: "#808080",
2506
+ brightRed: "#ff3333",
2507
+ brightGreen: "#33ff33",
2508
+ brightYellow: "#ffff33",
2509
+ brightBlue: "#6699ff",
2510
+ brightMagenta: "#ff33ff",
2511
+ brightCyan: "#33ffff",
2512
+ brightWhite: "#ffffff"
2513
+ }
2514
+ };
2515
+ DefaultThemes.yellow = DefaultThemes.highContrastLight;
2516
+ var DefaultThemeInfos = {
2517
+ default: {
2518
+ theme: DefaultThemes.default,
2519
+ category: "dark",
2520
+ tags: ["built-in"],
2521
+ description: "Dark indigo theme with soft pastels"
2522
+ },
2523
+ classic: {
2524
+ theme: DefaultThemes.classic,
2525
+ category: "dark",
2526
+ tags: ["built-in"],
2527
+ description: "Classic Windows terminal palette"
2528
+ },
2529
+ dracula: {
2530
+ theme: DefaultThemes.dracula,
2531
+ category: "dark",
2532
+ tags: ["popular"],
2533
+ description: "Popular dark theme with vibrant colors"
2534
+ },
2535
+ monokai: {
2536
+ theme: DefaultThemes.monokai,
2537
+ category: "dark",
2538
+ tags: ["popular"],
2539
+ description: "Classic code editor dark theme"
2540
+ },
2541
+ solarizedDark: {
2542
+ theme: DefaultThemes.solarizedDark,
2543
+ category: "dark",
2544
+ tags: ["popular"],
2545
+ description: "Ethan Schoonover's precision dark palette"
2546
+ },
2547
+ solarizedLight: {
2548
+ theme: DefaultThemes.solarizedLight,
2549
+ category: "light",
2550
+ tags: ["popular"],
2551
+ description: "Ethan Schoonover's precision light palette"
2552
+ },
2553
+ gruvboxDark: {
2554
+ theme: DefaultThemes.gruvboxDark,
2555
+ category: "dark",
2556
+ tags: ["popular"],
2557
+ description: "Retro groove dark color scheme"
2558
+ },
2559
+ gruvboxLight: {
2560
+ theme: DefaultThemes.gruvboxLight,
2561
+ category: "light",
2562
+ tags: ["popular"],
2563
+ description: "Retro groove light color scheme"
2564
+ },
2565
+ nord: {
2566
+ theme: DefaultThemes.nord,
2567
+ category: "dark",
2568
+ tags: ["popular"],
2569
+ description: "Arctic, north-bluish clean palette"
2570
+ },
2571
+ oneDark: {
2572
+ theme: DefaultThemes.oneDark,
2573
+ category: "dark",
2574
+ tags: ["popular"],
2575
+ description: "Atom's iconic dark theme"
2576
+ },
2577
+ material: {
2578
+ theme: DefaultThemes.material,
2579
+ category: "dark",
2580
+ tags: ["popular"],
2581
+ description: "Material Design inspired dark theme"
2582
+ },
2583
+ highContrastLight: {
2584
+ theme: DefaultThemes.highContrastLight,
2585
+ category: "light",
2586
+ tags: ["accessibility"],
2587
+ description: "High contrast light theme for accessibility"
2588
+ },
2589
+ tokyoNight: {
2590
+ theme: DefaultThemes.tokyoNight,
2591
+ category: "dark",
2592
+ tags: ["popular"],
2593
+ description: "Cool blue-purple dark theme"
2594
+ },
2595
+ catppuccinMocha: {
2596
+ theme: DefaultThemes.catppuccinMocha,
2597
+ category: "dark",
2598
+ tags: ["popular", "pastel"],
2599
+ description: "Soothing pastel dark theme (warmest)"
2600
+ },
2601
+ catppuccinFrappe: {
2602
+ theme: DefaultThemes.catppuccinFrappe,
2603
+ category: "dark",
2604
+ tags: ["popular", "pastel"],
2605
+ description: "Soothing pastel mid-dark theme"
2606
+ },
2607
+ catppuccinLatte: {
2608
+ theme: DefaultThemes.catppuccinLatte,
2609
+ category: "light",
2610
+ tags: ["popular", "pastel"],
2611
+ description: "Soothing pastel light theme"
2612
+ },
2613
+ rosePine: {
2614
+ theme: DefaultThemes.rosePine,
2615
+ category: "dark",
2616
+ tags: ["popular"],
2617
+ description: "All natural pine, faux fur, and a bit of soho vibes"
2618
+ },
2619
+ rosePineDawn: {
2620
+ theme: DefaultThemes.rosePineDawn,
2621
+ category: "light",
2622
+ tags: ["popular"],
2623
+ description: "Rose Pine light variant"
2624
+ },
2625
+ kanagawa: {
2626
+ theme: DefaultThemes.kanagawa,
2627
+ category: "dark",
2628
+ tags: ["popular"],
2629
+ description: "Dark theme inspired by Katsushika Hokusai"
2630
+ },
2631
+ everforestDark: {
2632
+ theme: DefaultThemes.everforestDark,
2633
+ category: "dark",
2634
+ tags: ["popular"],
2635
+ description: "Comfortable green-tinted dark theme"
2636
+ },
2637
+ everforestLight: {
2638
+ theme: DefaultThemes.everforestLight,
2639
+ category: "light",
2640
+ tags: ["popular"],
2641
+ description: "Comfortable green-tinted light theme"
2642
+ },
2643
+ ayuDark: {
2644
+ theme: DefaultThemes.ayuDark,
2645
+ category: "dark",
2646
+ tags: ["popular"],
2647
+ description: "Simple, bright and elegant dark theme"
2648
+ },
2649
+ githubLight: {
2650
+ theme: DefaultThemes.githubLight,
2651
+ category: "light",
2652
+ tags: ["popular"],
2653
+ description: "GitHub's clean light interface theme"
2654
+ },
2655
+ cyberpunk: {
2656
+ theme: DefaultThemes.cyberpunk,
2657
+ category: "dark",
2658
+ tags: ["retro", "fun"],
2659
+ description: "Neon-lit cyberpunk aesthetic"
2660
+ },
2661
+ retroGreen: {
2662
+ theme: DefaultThemes.retroGreen,
2663
+ category: "dark",
2664
+ tags: ["retro", "fun"],
2665
+ description: "Classic green phosphor CRT monitor"
2666
+ },
2667
+ retroAmber: {
2668
+ theme: DefaultThemes.retroAmber,
2669
+ category: "dark",
2670
+ tags: ["retro", "fun"],
2671
+ description: "Warm amber CRT monitor"
2672
+ },
2673
+ matrix: {
2674
+ theme: DefaultThemes.matrix,
2675
+ category: "dark",
2676
+ tags: ["retro", "fun"],
2677
+ description: "Enter the Matrix - green on black"
2678
+ },
2679
+ synthwave: {
2680
+ theme: DefaultThemes.synthwave,
2681
+ category: "dark",
2682
+ tags: ["retro", "fun"],
2683
+ description: "80s synthwave purple/pink aesthetic"
2684
+ },
2685
+ highContrastDark: {
2686
+ theme: DefaultThemes.highContrastDark,
2687
+ category: "dark",
2688
+ tags: ["accessibility"],
2689
+ description: "Maximum contrast dark theme"
2690
+ }
2691
+ };
2692
+
2693
+ // src/lib/version.ts
2694
+ var LIBRARY_VERSION = "2.0.0-beta.1";
2695
+ var API_VERSION = 2;
2696
+
2697
+ // src/lib/utilities/index.ts
2698
+ var VALID_METHODS = ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"];
2699
+ function inferMethod(explicitMethod, hasBody) {
2700
+ if (explicitMethod) {
2701
+ const upper = explicitMethod.toUpperCase();
2702
+ if (!VALID_METHODS.includes(upper)) {
2703
+ throw new Error(`Invalid HTTP method: ${explicitMethod}. Valid methods: ${VALID_METHODS.join(", ")}`);
2704
+ }
2705
+ return upper;
2706
+ }
2707
+ return hasBody ? "POST" : "GET";
2708
+ }
2709
+ function parseHeaders(headerArgs) {
2710
+ if (!headerArgs) return {};
2711
+ const arr = Array.isArray(headerArgs) ? headerArgs : [headerArgs];
2712
+ const result = {};
2713
+ for (const header of arr) {
2714
+ const colonIndex = header.indexOf(":");
2715
+ if (colonIndex === -1) continue;
2716
+ const key = header.substring(0, colonIndex).trim();
2717
+ const value = header.substring(colonIndex + 1).trim();
2718
+ if (key) result[key] = value;
2719
+ }
2720
+ return result;
2721
+ }
2722
+ function resolveBody(data, dataRaw) {
2723
+ if (dataRaw != null) return dataRaw;
2724
+ if (data == null) return void 0;
2725
+ try {
2726
+ return JSON.stringify(JSON.parse(data));
2727
+ } catch {
2728
+ return data;
2729
+ }
2730
+ }
2731
+ function isJsonBody(body) {
2732
+ if (!body) return false;
2733
+ try {
2734
+ JSON.parse(body);
2735
+ return true;
2736
+ } catch {
2737
+ return false;
2738
+ }
2739
+ }
2740
+ function buildFetchOptions(options) {
2741
+ const headers = { ...options.headers };
2742
+ if (options.body && !headers["Content-Type"] && isJsonBody(options.body)) {
2743
+ headers["Content-Type"] = "application/json";
2744
+ }
2745
+ const init = {
2746
+ method: options.method,
2747
+ headers
2748
+ };
2749
+ if (options.body && options.method !== "GET" && options.method !== "HEAD") {
2750
+ init.body = options.body;
2751
+ }
2752
+ if (!options.followRedirects) {
2753
+ init.redirect = "manual";
2754
+ }
2755
+ return init;
2756
+ }
2757
+ function formatResponseBody(body, pretty) {
2758
+ if (!pretty) return body;
2759
+ try {
2760
+ return JSON.stringify(JSON.parse(body), null, 2);
2761
+ } catch {
2762
+ return body;
2763
+ }
2764
+ }
2765
+ function rewriteUrlToProxy(originalUrl) {
2766
+ const match = originalUrl.match(/^(https?):\/\/([^\/]+)(\/.*)?$/i);
2767
+ if (!match) {
2768
+ throw new Error(`Invalid URL: ${originalUrl}`);
2769
+ }
2770
+ const scheme = match[1];
2771
+ const domain = match[2];
2772
+ const path = match[3] || "/";
2773
+ return `https://proxy.qodalis.com/proxy/${scheme}/${domain}${path}`;
2774
+ }
2775
+ function buildCurlEquivalent(url, method, headers, body) {
2776
+ const parts = ["curl"];
2777
+ if (method !== "GET") {
2778
+ parts.push(`-X ${method}`);
2779
+ }
2780
+ for (const [key, value] of Object.entries(headers)) {
2781
+ parts.push(`-H '${key}: ${value}'`);
2782
+ }
2783
+ if (body) {
2784
+ parts.push(`-d '${body}'`);
2785
+ }
2786
+ parts.push(`'${url}'`);
2787
+ return parts.join(" ");
2788
+ }
2789
+ function extractResponseHeaders(response) {
2790
+ const headers = {};
2791
+ response.headers.forEach((value, key) => {
2792
+ headers[key] = value;
2793
+ });
2794
+ return headers;
2795
+ }
2796
+
2797
+ // src/lib/processors/cli-curl-command-processor.ts
2798
+ var CliCurlCommandProcessor = class {
2799
+ constructor() {
2800
+ this.command = "curl";
2801
+ this.description = "Make HTTP requests from the terminal. Supports all HTTP methods, custom headers, request bodies, timeouts, and more.";
2802
+ this.author = DefaultLibraryAuthor;
2803
+ this.version = LIBRARY_VERSION;
2804
+ this.valueRequired = true;
2805
+ this.metadata = {
2806
+ icon: "\u{1F310}",
2807
+ requiredCoreVersion: ">=2.0.0 <3.0.0",
2808
+ requiredCliVersion: ">=2.0.0 <3.0.0"
2809
+ };
2810
+ this.parameters = [
2811
+ {
2812
+ name: "request",
2813
+ aliases: ["X"],
2814
+ type: "string",
2815
+ description: "HTTP method (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS)",
2816
+ required: false
2817
+ },
2818
+ {
2819
+ name: "header",
2820
+ aliases: ["H"],
2821
+ type: "array",
2822
+ description: "Add header, e.g. -H 'Content-Type: application/json' (repeatable)",
2823
+ required: false
2824
+ },
2825
+ {
2826
+ name: "data",
2827
+ aliases: ["d"],
2828
+ type: "string",
2829
+ description: "Request body (auto-detects JSON, sets method to POST if -X not given)",
2830
+ required: false
2831
+ },
2832
+ {
2833
+ name: "data-raw",
2834
+ type: "string",
2835
+ description: "Request body sent as-is without JSON parsing",
2836
+ required: false
2837
+ },
2838
+ {
2839
+ name: "verbose",
2840
+ aliases: ["v"],
2841
+ type: "boolean",
2842
+ description: "Show request/response headers and timing",
2843
+ required: false
2844
+ },
2845
+ {
2846
+ name: "pretty",
2847
+ type: "boolean",
2848
+ description: "Pretty-print JSON response body",
2849
+ required: false
2850
+ },
2851
+ {
2852
+ name: "timeout",
2853
+ type: "number",
2854
+ description: "Request timeout in milliseconds (default: 30000)",
2855
+ required: false,
2856
+ defaultValue: "30000"
2857
+ },
2858
+ {
2859
+ name: "location",
2860
+ aliases: ["L"],
2861
+ type: "boolean",
2862
+ description: "Follow redirects (default: true)",
2863
+ required: false
2864
+ },
2865
+ {
2866
+ name: "proxy",
2867
+ type: "boolean",
2868
+ description: "Route request through proxy.qodalis.com (bypasses CORS)",
2869
+ required: false
2870
+ },
2871
+ {
2872
+ name: "silent",
2873
+ aliases: ["s"],
2874
+ type: "boolean",
2875
+ description: "Only output response body (no status line)",
2876
+ required: false
2877
+ }
2878
+ ];
2879
+ }
2880
+ async processCommand(command, context) {
2881
+ const url = command.value;
2882
+ if (!url) {
2883
+ context.writer.writeError("URL is required. Usage: curl <url> [options]");
2884
+ context.process.exit(1);
2885
+ return;
2886
+ }
2887
+ const args = command.args;
2888
+ const explicitMethod = args["request"] || args["X"];
2889
+ const data = args["data"] || args["d"];
2890
+ const dataRaw = args["data-raw"];
2891
+ const hasBody = data != null || dataRaw != null;
2892
+ const verbose = !!args["verbose"] || !!args["v"];
2893
+ const pretty = !!args["pretty"];
2894
+ const silent = !!args["silent"] || !!args["s"];
2895
+ const useProxy = !!args["proxy"];
2896
+ const timeout = parseInt(args["timeout"] || "30000", 10);
2897
+ const followRedirects = args["location"] !== false && args["L"] !== false;
2898
+ let method;
2899
+ try {
2900
+ method = inferMethod(explicitMethod, hasBody);
2901
+ } catch (e) {
2902
+ context.writer.writeError(e.message);
2903
+ context.process.exit(1);
2904
+ return;
2905
+ }
2906
+ const headers = parseHeaders(args["header"] || args["H"]);
2907
+ const body = resolveBody(data, dataRaw);
2908
+ const requestUrl = useProxy ? rewriteUrlToProxy(url) : url;
2909
+ const fetchOptions = buildFetchOptions({
2910
+ method,
2911
+ headers,
2912
+ body,
2913
+ followRedirects
2914
+ });
2915
+ if (verbose) {
2916
+ context.writer.writeln(
2917
+ `> ${context.writer.wrapInColor(`${method} ${url}`, CliForegroundColor.Cyan)}`
2918
+ );
2919
+ for (const [key, value] of Object.entries(headers)) {
2920
+ context.writer.writeln(
2921
+ `> ${context.writer.wrapInColor(`${key}: ${value}`, CliForegroundColor.Yellow)}`
2922
+ );
2923
+ }
2924
+ if (body) {
2925
+ context.writer.writeln(`> Body: ${body}`);
2926
+ }
2927
+ context.writer.writeln();
2928
+ }
2929
+ const controller = new AbortController();
2930
+ const timeoutId = setTimeout(() => controller.abort(), timeout);
2931
+ fetchOptions.signal = controller.signal;
2932
+ const startTime = performance.now();
2933
+ try {
2934
+ const response = await fetch(requestUrl, fetchOptions);
2935
+ const elapsed = Math.round(performance.now() - startTime);
2936
+ const responseText = await response.text();
2937
+ const responseHeaders = extractResponseHeaders(response);
2938
+ const curlResponse = {
2939
+ status: response.status,
2940
+ statusText: response.statusText,
2941
+ headers: responseHeaders,
2942
+ body: responseText,
2943
+ timing: elapsed,
2944
+ url: response.url,
2945
+ redirected: response.redirected
2946
+ };
2947
+ if (!silent) {
2948
+ const statusColor = response.ok ? CliForegroundColor.Green : CliForegroundColor.Red;
2949
+ context.writer.writeln(
2950
+ context.writer.wrapInColor(
2951
+ `HTTP ${response.status} ${response.statusText}`,
2952
+ statusColor
2953
+ )
2954
+ );
2955
+ }
2956
+ if (verbose) {
2957
+ context.writer.writeln();
2958
+ for (const [key, value] of Object.entries(responseHeaders)) {
2959
+ context.writer.writeln(
2960
+ `< ${context.writer.wrapInColor(`${key}: ${value}`, CliForegroundColor.Yellow)}`
2961
+ );
2962
+ }
2963
+ context.writer.writeln(
2964
+ `< ${context.writer.wrapInColor(`Time: ${elapsed}ms`, CliForegroundColor.Magenta)}`
2965
+ );
2966
+ if (response.redirected) {
2967
+ context.writer.writeln(
2968
+ `< ${context.writer.wrapInColor(`Redirected to: ${response.url}`, CliForegroundColor.Cyan)}`
2969
+ );
2970
+ }
2971
+ context.writer.writeln();
2972
+ }
2973
+ const formattedBody = formatResponseBody(responseText, pretty);
2974
+ if (formattedBody) {
2975
+ context.writer.writeln(formattedBody);
2976
+ }
2977
+ if (verbose) {
2978
+ context.writer.writeln();
2979
+ context.writer.writeInfo("Equivalent curl command:");
2980
+ context.writer.writeln(buildCurlEquivalent(url, method, headers, body));
2981
+ }
2982
+ context.process.output(curlResponse);
2983
+ } catch (error) {
2984
+ if (error.name === "AbortError") {
2985
+ context.writer.writeError(`Request timed out after ${timeout}ms`);
2986
+ } else {
2987
+ context.writer.writeError(`Request failed: ${error.message}`);
2988
+ }
2989
+ context.process.exit(1);
2990
+ } finally {
2991
+ clearTimeout(timeoutId);
2992
+ }
2993
+ }
2994
+ writeDescription(context) {
2995
+ const { writer } = context;
2996
+ writer.writeln(this.description);
2997
+ writer.writeln();
2998
+ writer.writeln(writer.wrapInColor("Usage:", CliForegroundColor.Yellow));
2999
+ writer.writeln(` curl <url> [options]`);
3000
+ writer.writeln();
3001
+ writer.writeln(writer.wrapInColor("Options:", CliForegroundColor.Yellow));
3002
+ writer.writeln(` ${writer.wrapInColor("-X, --request <METHOD>", CliForegroundColor.Cyan)} HTTP method (default: GET, or POST if -d given)`);
3003
+ writer.writeln(` ${writer.wrapInColor("-H, --header <header>", CliForegroundColor.Cyan)} Add header (repeatable)`);
3004
+ writer.writeln(` ${writer.wrapInColor("-d, --data <body>", CliForegroundColor.Cyan)} Request body (auto-detects JSON)`);
3005
+ writer.writeln(` ${writer.wrapInColor("--data-raw <body>", CliForegroundColor.Cyan)} Request body as-is`);
3006
+ writer.writeln(` ${writer.wrapInColor("-v, --verbose", CliForegroundColor.Cyan)} Show headers and timing`);
3007
+ writer.writeln(` ${writer.wrapInColor("--pretty", CliForegroundColor.Cyan)} Pretty-print JSON response`);
3008
+ writer.writeln(` ${writer.wrapInColor("--timeout <ms>", CliForegroundColor.Cyan)} Timeout in ms (default: 30000)`);
3009
+ writer.writeln(` ${writer.wrapInColor("-L, --location", CliForegroundColor.Cyan)} Follow redirects (default: true)`);
3010
+ writer.writeln(` ${writer.wrapInColor("--proxy", CliForegroundColor.Cyan)} Route through CORS proxy`);
3011
+ writer.writeln(` ${writer.wrapInColor("-s, --silent", CliForegroundColor.Cyan)} Only output body`);
3012
+ writer.writeln();
3013
+ writer.writeln(writer.wrapInColor("Examples:", CliForegroundColor.Yellow));
3014
+ writer.writeln(` curl https://api.example.com/users`);
3015
+ writer.writeln(` curl https://api.example.com/users -X POST -d '{"name":"John"}' -H 'Content-Type: application/json'`);
3016
+ writer.writeln(` curl https://api.example.com/users -v --pretty`);
3017
+ writer.writeln(` curl https://api.example.com/status -X HEAD`);
3018
+ writer.writeln(` curl https://api.example.com/data --proxy --timeout 5000`);
3019
+ writer.writeln();
3020
+ writer.writeWarning("The server must allow CORS for this tool to work. Use --proxy to bypass CORS restrictions.");
3021
+ }
3022
+ async initialize(_context) {
3023
+ }
3024
+ };
3025
+
3026
+ // src/cli-entrypoint.ts
3027
+ var module = {
3028
+ apiVersion: API_VERSION,
3029
+ name: "@qodalis/cli-curl",
3030
+ processors: [new CliCurlCommandProcessor()]
3031
+ };
3032
+ bootCliModule(module);
3033
+ })();