genlayer 0.0.35 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3002,7 +3002,7 @@ var require_main = __commonJS({
3002
3002
  "use strict";
3003
3003
  var fs6 = require("fs");
3004
3004
  var path3 = require("path");
3005
- var os4 = require("os");
3005
+ var os3 = require("os");
3006
3006
  var crypto3 = require("crypto");
3007
3007
  var packageJson = require_package();
3008
3008
  var version2 = packageJson.version;
@@ -3123,7 +3123,7 @@ var require_main = __commonJS({
3123
3123
  return null;
3124
3124
  }
3125
3125
  function _resolveHome(envPath) {
3126
- return envPath[0] === "~" ? path3.join(os4.homedir(), envPath.slice(1)) : envPath;
3126
+ return envPath[0] === "~" ? path3.join(os3.homedir(), envPath.slice(1)) : envPath;
3127
3127
  }
3128
3128
  function _configVault(options) {
3129
3129
  _log("Loading env from encrypted .env.vault");
@@ -3264,6 +3264,2495 @@ var require_main = __commonJS({
3264
3264
  }
3265
3265
  });
3266
3266
 
3267
+ // node_modules/semver/internal/constants.js
3268
+ var require_constants = __commonJS({
3269
+ "node_modules/semver/internal/constants.js"(exports2, module2) {
3270
+ "use strict";
3271
+ var SEMVER_SPEC_VERSION = "2.0.0";
3272
+ var MAX_LENGTH = 256;
3273
+ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
3274
+ 9007199254740991;
3275
+ var MAX_SAFE_COMPONENT_LENGTH = 16;
3276
+ var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
3277
+ var RELEASE_TYPES = [
3278
+ "major",
3279
+ "premajor",
3280
+ "minor",
3281
+ "preminor",
3282
+ "patch",
3283
+ "prepatch",
3284
+ "prerelease"
3285
+ ];
3286
+ module2.exports = {
3287
+ MAX_LENGTH,
3288
+ MAX_SAFE_COMPONENT_LENGTH,
3289
+ MAX_SAFE_BUILD_LENGTH,
3290
+ MAX_SAFE_INTEGER,
3291
+ RELEASE_TYPES,
3292
+ SEMVER_SPEC_VERSION,
3293
+ FLAG_INCLUDE_PRERELEASE: 1,
3294
+ FLAG_LOOSE: 2
3295
+ };
3296
+ }
3297
+ });
3298
+
3299
+ // node_modules/semver/internal/debug.js
3300
+ var require_debug = __commonJS({
3301
+ "node_modules/semver/internal/debug.js"(exports2, module2) {
3302
+ "use strict";
3303
+ var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
3304
+ };
3305
+ module2.exports = debug;
3306
+ }
3307
+ });
3308
+
3309
+ // node_modules/semver/internal/re.js
3310
+ var require_re = __commonJS({
3311
+ "node_modules/semver/internal/re.js"(exports2, module2) {
3312
+ "use strict";
3313
+ var {
3314
+ MAX_SAFE_COMPONENT_LENGTH,
3315
+ MAX_SAFE_BUILD_LENGTH,
3316
+ MAX_LENGTH
3317
+ } = require_constants();
3318
+ var debug = require_debug();
3319
+ exports2 = module2.exports = {};
3320
+ var re = exports2.re = [];
3321
+ var safeRe = exports2.safeRe = [];
3322
+ var src = exports2.src = [];
3323
+ var t = exports2.t = {};
3324
+ var R = 0;
3325
+ var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
3326
+ var safeRegexReplacements = [
3327
+ ["\\s", 1],
3328
+ ["\\d", MAX_LENGTH],
3329
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
3330
+ ];
3331
+ var makeSafeRegex = (value) => {
3332
+ for (const [token, max] of safeRegexReplacements) {
3333
+ value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
3334
+ }
3335
+ return value;
3336
+ };
3337
+ var createToken = (name, value, isGlobal) => {
3338
+ const safe = makeSafeRegex(value);
3339
+ const index = R++;
3340
+ debug(name, index, value);
3341
+ t[name] = index;
3342
+ src[index] = value;
3343
+ re[index] = new RegExp(value, isGlobal ? "g" : void 0);
3344
+ safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
3345
+ };
3346
+ createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
3347
+ createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
3348
+ createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
3349
+ createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
3350
+ createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
3351
+ createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);
3352
+ createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);
3353
+ createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
3354
+ createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
3355
+ createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
3356
+ createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
3357
+ createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
3358
+ createToken("FULL", `^${src[t.FULLPLAIN]}$`);
3359
+ createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
3360
+ createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
3361
+ createToken("GTLT", "((?:<|>)?=?)");
3362
+ createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
3363
+ createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
3364
+ createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
3365
+ createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
3366
+ createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
3367
+ createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
3368
+ createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
3369
+ createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
3370
+ createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
3371
+ createToken("COERCERTL", src[t.COERCE], true);
3372
+ createToken("COERCERTLFULL", src[t.COERCEFULL], true);
3373
+ createToken("LONETILDE", "(?:~>?)");
3374
+ createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
3375
+ exports2.tildeTrimReplace = "$1~";
3376
+ createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
3377
+ createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
3378
+ createToken("LONECARET", "(?:\\^)");
3379
+ createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
3380
+ exports2.caretTrimReplace = "$1^";
3381
+ createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
3382
+ createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
3383
+ createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
3384
+ createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
3385
+ createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
3386
+ exports2.comparatorTrimReplace = "$1$2$3";
3387
+ createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
3388
+ createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
3389
+ createToken("STAR", "(<|>)?=?\\s*\\*");
3390
+ createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
3391
+ createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
3392
+ }
3393
+ });
3394
+
3395
+ // node_modules/semver/internal/parse-options.js
3396
+ var require_parse_options = __commonJS({
3397
+ "node_modules/semver/internal/parse-options.js"(exports2, module2) {
3398
+ "use strict";
3399
+ var looseOption = Object.freeze({ loose: true });
3400
+ var emptyOpts = Object.freeze({});
3401
+ var parseOptions = (options) => {
3402
+ if (!options) {
3403
+ return emptyOpts;
3404
+ }
3405
+ if (typeof options !== "object") {
3406
+ return looseOption;
3407
+ }
3408
+ return options;
3409
+ };
3410
+ module2.exports = parseOptions;
3411
+ }
3412
+ });
3413
+
3414
+ // node_modules/semver/internal/identifiers.js
3415
+ var require_identifiers = __commonJS({
3416
+ "node_modules/semver/internal/identifiers.js"(exports2, module2) {
3417
+ "use strict";
3418
+ var numeric = /^[0-9]+$/;
3419
+ var compareIdentifiers = (a, b) => {
3420
+ const anum = numeric.test(a);
3421
+ const bnum = numeric.test(b);
3422
+ if (anum && bnum) {
3423
+ a = +a;
3424
+ b = +b;
3425
+ }
3426
+ return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
3427
+ };
3428
+ var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
3429
+ module2.exports = {
3430
+ compareIdentifiers,
3431
+ rcompareIdentifiers
3432
+ };
3433
+ }
3434
+ });
3435
+
3436
+ // node_modules/semver/classes/semver.js
3437
+ var require_semver = __commonJS({
3438
+ "node_modules/semver/classes/semver.js"(exports2, module2) {
3439
+ "use strict";
3440
+ var debug = require_debug();
3441
+ var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
3442
+ var { safeRe: re, t } = require_re();
3443
+ var parseOptions = require_parse_options();
3444
+ var { compareIdentifiers } = require_identifiers();
3445
+ var SemVer = class _SemVer {
3446
+ constructor(version2, options) {
3447
+ options = parseOptions(options);
3448
+ if (version2 instanceof _SemVer) {
3449
+ if (version2.loose === !!options.loose && version2.includePrerelease === !!options.includePrerelease) {
3450
+ return version2;
3451
+ } else {
3452
+ version2 = version2.version;
3453
+ }
3454
+ } else if (typeof version2 !== "string") {
3455
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version2}".`);
3456
+ }
3457
+ if (version2.length > MAX_LENGTH) {
3458
+ throw new TypeError(
3459
+ `version is longer than ${MAX_LENGTH} characters`
3460
+ );
3461
+ }
3462
+ debug("SemVer", version2, options);
3463
+ this.options = options;
3464
+ this.loose = !!options.loose;
3465
+ this.includePrerelease = !!options.includePrerelease;
3466
+ const m = version2.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
3467
+ if (!m) {
3468
+ throw new TypeError(`Invalid Version: ${version2}`);
3469
+ }
3470
+ this.raw = version2;
3471
+ this.major = +m[1];
3472
+ this.minor = +m[2];
3473
+ this.patch = +m[3];
3474
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
3475
+ throw new TypeError("Invalid major version");
3476
+ }
3477
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
3478
+ throw new TypeError("Invalid minor version");
3479
+ }
3480
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
3481
+ throw new TypeError("Invalid patch version");
3482
+ }
3483
+ if (!m[4]) {
3484
+ this.prerelease = [];
3485
+ } else {
3486
+ this.prerelease = m[4].split(".").map((id) => {
3487
+ if (/^[0-9]+$/.test(id)) {
3488
+ const num = +id;
3489
+ if (num >= 0 && num < MAX_SAFE_INTEGER) {
3490
+ return num;
3491
+ }
3492
+ }
3493
+ return id;
3494
+ });
3495
+ }
3496
+ this.build = m[5] ? m[5].split(".") : [];
3497
+ this.format();
3498
+ }
3499
+ format() {
3500
+ this.version = `${this.major}.${this.minor}.${this.patch}`;
3501
+ if (this.prerelease.length) {
3502
+ this.version += `-${this.prerelease.join(".")}`;
3503
+ }
3504
+ return this.version;
3505
+ }
3506
+ toString() {
3507
+ return this.version;
3508
+ }
3509
+ compare(other) {
3510
+ debug("SemVer.compare", this.version, this.options, other);
3511
+ if (!(other instanceof _SemVer)) {
3512
+ if (typeof other === "string" && other === this.version) {
3513
+ return 0;
3514
+ }
3515
+ other = new _SemVer(other, this.options);
3516
+ }
3517
+ if (other.version === this.version) {
3518
+ return 0;
3519
+ }
3520
+ return this.compareMain(other) || this.comparePre(other);
3521
+ }
3522
+ compareMain(other) {
3523
+ if (!(other instanceof _SemVer)) {
3524
+ other = new _SemVer(other, this.options);
3525
+ }
3526
+ return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
3527
+ }
3528
+ comparePre(other) {
3529
+ if (!(other instanceof _SemVer)) {
3530
+ other = new _SemVer(other, this.options);
3531
+ }
3532
+ if (this.prerelease.length && !other.prerelease.length) {
3533
+ return -1;
3534
+ } else if (!this.prerelease.length && other.prerelease.length) {
3535
+ return 1;
3536
+ } else if (!this.prerelease.length && !other.prerelease.length) {
3537
+ return 0;
3538
+ }
3539
+ let i = 0;
3540
+ do {
3541
+ const a = this.prerelease[i];
3542
+ const b = other.prerelease[i];
3543
+ debug("prerelease compare", i, a, b);
3544
+ if (a === void 0 && b === void 0) {
3545
+ return 0;
3546
+ } else if (b === void 0) {
3547
+ return 1;
3548
+ } else if (a === void 0) {
3549
+ return -1;
3550
+ } else if (a === b) {
3551
+ continue;
3552
+ } else {
3553
+ return compareIdentifiers(a, b);
3554
+ }
3555
+ } while (++i);
3556
+ }
3557
+ compareBuild(other) {
3558
+ if (!(other instanceof _SemVer)) {
3559
+ other = new _SemVer(other, this.options);
3560
+ }
3561
+ let i = 0;
3562
+ do {
3563
+ const a = this.build[i];
3564
+ const b = other.build[i];
3565
+ debug("prerelease compare", i, a, b);
3566
+ if (a === void 0 && b === void 0) {
3567
+ return 0;
3568
+ } else if (b === void 0) {
3569
+ return 1;
3570
+ } else if (a === void 0) {
3571
+ return -1;
3572
+ } else if (a === b) {
3573
+ continue;
3574
+ } else {
3575
+ return compareIdentifiers(a, b);
3576
+ }
3577
+ } while (++i);
3578
+ }
3579
+ // preminor will bump the version up to the next minor release, and immediately
3580
+ // down to pre-release. premajor and prepatch work the same way.
3581
+ inc(release, identifier, identifierBase) {
3582
+ switch (release) {
3583
+ case "premajor":
3584
+ this.prerelease.length = 0;
3585
+ this.patch = 0;
3586
+ this.minor = 0;
3587
+ this.major++;
3588
+ this.inc("pre", identifier, identifierBase);
3589
+ break;
3590
+ case "preminor":
3591
+ this.prerelease.length = 0;
3592
+ this.patch = 0;
3593
+ this.minor++;
3594
+ this.inc("pre", identifier, identifierBase);
3595
+ break;
3596
+ case "prepatch":
3597
+ this.prerelease.length = 0;
3598
+ this.inc("patch", identifier, identifierBase);
3599
+ this.inc("pre", identifier, identifierBase);
3600
+ break;
3601
+ // If the input is a non-prerelease version, this acts the same as
3602
+ // prepatch.
3603
+ case "prerelease":
3604
+ if (this.prerelease.length === 0) {
3605
+ this.inc("patch", identifier, identifierBase);
3606
+ }
3607
+ this.inc("pre", identifier, identifierBase);
3608
+ break;
3609
+ case "major":
3610
+ if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
3611
+ this.major++;
3612
+ }
3613
+ this.minor = 0;
3614
+ this.patch = 0;
3615
+ this.prerelease = [];
3616
+ break;
3617
+ case "minor":
3618
+ if (this.patch !== 0 || this.prerelease.length === 0) {
3619
+ this.minor++;
3620
+ }
3621
+ this.patch = 0;
3622
+ this.prerelease = [];
3623
+ break;
3624
+ case "patch":
3625
+ if (this.prerelease.length === 0) {
3626
+ this.patch++;
3627
+ }
3628
+ this.prerelease = [];
3629
+ break;
3630
+ // This probably shouldn't be used publicly.
3631
+ // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
3632
+ case "pre": {
3633
+ const base = Number(identifierBase) ? 1 : 0;
3634
+ if (!identifier && identifierBase === false) {
3635
+ throw new Error("invalid increment argument: identifier is empty");
3636
+ }
3637
+ if (this.prerelease.length === 0) {
3638
+ this.prerelease = [base];
3639
+ } else {
3640
+ let i = this.prerelease.length;
3641
+ while (--i >= 0) {
3642
+ if (typeof this.prerelease[i] === "number") {
3643
+ this.prerelease[i]++;
3644
+ i = -2;
3645
+ }
3646
+ }
3647
+ if (i === -1) {
3648
+ if (identifier === this.prerelease.join(".") && identifierBase === false) {
3649
+ throw new Error("invalid increment argument: identifier already exists");
3650
+ }
3651
+ this.prerelease.push(base);
3652
+ }
3653
+ }
3654
+ if (identifier) {
3655
+ let prerelease = [identifier, base];
3656
+ if (identifierBase === false) {
3657
+ prerelease = [identifier];
3658
+ }
3659
+ if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
3660
+ if (isNaN(this.prerelease[1])) {
3661
+ this.prerelease = prerelease;
3662
+ }
3663
+ } else {
3664
+ this.prerelease = prerelease;
3665
+ }
3666
+ }
3667
+ break;
3668
+ }
3669
+ default:
3670
+ throw new Error(`invalid increment argument: ${release}`);
3671
+ }
3672
+ this.raw = this.format();
3673
+ if (this.build.length) {
3674
+ this.raw += `+${this.build.join(".")}`;
3675
+ }
3676
+ return this;
3677
+ }
3678
+ };
3679
+ module2.exports = SemVer;
3680
+ }
3681
+ });
3682
+
3683
+ // node_modules/semver/functions/parse.js
3684
+ var require_parse = __commonJS({
3685
+ "node_modules/semver/functions/parse.js"(exports2, module2) {
3686
+ "use strict";
3687
+ var SemVer = require_semver();
3688
+ var parse2 = (version2, options, throwErrors = false) => {
3689
+ if (version2 instanceof SemVer) {
3690
+ return version2;
3691
+ }
3692
+ try {
3693
+ return new SemVer(version2, options);
3694
+ } catch (er) {
3695
+ if (!throwErrors) {
3696
+ return null;
3697
+ }
3698
+ throw er;
3699
+ }
3700
+ };
3701
+ module2.exports = parse2;
3702
+ }
3703
+ });
3704
+
3705
+ // node_modules/semver/functions/valid.js
3706
+ var require_valid = __commonJS({
3707
+ "node_modules/semver/functions/valid.js"(exports2, module2) {
3708
+ "use strict";
3709
+ var parse2 = require_parse();
3710
+ var valid = (version2, options) => {
3711
+ const v = parse2(version2, options);
3712
+ return v ? v.version : null;
3713
+ };
3714
+ module2.exports = valid;
3715
+ }
3716
+ });
3717
+
3718
+ // node_modules/semver/functions/clean.js
3719
+ var require_clean = __commonJS({
3720
+ "node_modules/semver/functions/clean.js"(exports2, module2) {
3721
+ "use strict";
3722
+ var parse2 = require_parse();
3723
+ var clean = (version2, options) => {
3724
+ const s = parse2(version2.trim().replace(/^[=v]+/, ""), options);
3725
+ return s ? s.version : null;
3726
+ };
3727
+ module2.exports = clean;
3728
+ }
3729
+ });
3730
+
3731
+ // node_modules/semver/functions/inc.js
3732
+ var require_inc = __commonJS({
3733
+ "node_modules/semver/functions/inc.js"(exports2, module2) {
3734
+ "use strict";
3735
+ var SemVer = require_semver();
3736
+ var inc = (version2, release, options, identifier, identifierBase) => {
3737
+ if (typeof options === "string") {
3738
+ identifierBase = identifier;
3739
+ identifier = options;
3740
+ options = void 0;
3741
+ }
3742
+ try {
3743
+ return new SemVer(
3744
+ version2 instanceof SemVer ? version2.version : version2,
3745
+ options
3746
+ ).inc(release, identifier, identifierBase).version;
3747
+ } catch (er) {
3748
+ return null;
3749
+ }
3750
+ };
3751
+ module2.exports = inc;
3752
+ }
3753
+ });
3754
+
3755
+ // node_modules/semver/functions/diff.js
3756
+ var require_diff = __commonJS({
3757
+ "node_modules/semver/functions/diff.js"(exports2, module2) {
3758
+ "use strict";
3759
+ var parse2 = require_parse();
3760
+ var diff = (version1, version2) => {
3761
+ const v1 = parse2(version1, null, true);
3762
+ const v2 = parse2(version2, null, true);
3763
+ const comparison = v1.compare(v2);
3764
+ if (comparison === 0) {
3765
+ return null;
3766
+ }
3767
+ const v1Higher = comparison > 0;
3768
+ const highVersion = v1Higher ? v1 : v2;
3769
+ const lowVersion = v1Higher ? v2 : v1;
3770
+ const highHasPre = !!highVersion.prerelease.length;
3771
+ const lowHasPre = !!lowVersion.prerelease.length;
3772
+ if (lowHasPre && !highHasPre) {
3773
+ if (!lowVersion.patch && !lowVersion.minor) {
3774
+ return "major";
3775
+ }
3776
+ if (highVersion.patch) {
3777
+ return "patch";
3778
+ }
3779
+ if (highVersion.minor) {
3780
+ return "minor";
3781
+ }
3782
+ return "major";
3783
+ }
3784
+ const prefix = highHasPre ? "pre" : "";
3785
+ if (v1.major !== v2.major) {
3786
+ return prefix + "major";
3787
+ }
3788
+ if (v1.minor !== v2.minor) {
3789
+ return prefix + "minor";
3790
+ }
3791
+ if (v1.patch !== v2.patch) {
3792
+ return prefix + "patch";
3793
+ }
3794
+ return "prerelease";
3795
+ };
3796
+ module2.exports = diff;
3797
+ }
3798
+ });
3799
+
3800
+ // node_modules/semver/functions/major.js
3801
+ var require_major = __commonJS({
3802
+ "node_modules/semver/functions/major.js"(exports2, module2) {
3803
+ "use strict";
3804
+ var SemVer = require_semver();
3805
+ var major = (a, loose) => new SemVer(a, loose).major;
3806
+ module2.exports = major;
3807
+ }
3808
+ });
3809
+
3810
+ // node_modules/semver/functions/minor.js
3811
+ var require_minor = __commonJS({
3812
+ "node_modules/semver/functions/minor.js"(exports2, module2) {
3813
+ "use strict";
3814
+ var SemVer = require_semver();
3815
+ var minor = (a, loose) => new SemVer(a, loose).minor;
3816
+ module2.exports = minor;
3817
+ }
3818
+ });
3819
+
3820
+ // node_modules/semver/functions/patch.js
3821
+ var require_patch = __commonJS({
3822
+ "node_modules/semver/functions/patch.js"(exports2, module2) {
3823
+ "use strict";
3824
+ var SemVer = require_semver();
3825
+ var patch = (a, loose) => new SemVer(a, loose).patch;
3826
+ module2.exports = patch;
3827
+ }
3828
+ });
3829
+
3830
+ // node_modules/semver/functions/prerelease.js
3831
+ var require_prerelease = __commonJS({
3832
+ "node_modules/semver/functions/prerelease.js"(exports2, module2) {
3833
+ "use strict";
3834
+ var parse2 = require_parse();
3835
+ var prerelease = (version2, options) => {
3836
+ const parsed = parse2(version2, options);
3837
+ return parsed && parsed.prerelease.length ? parsed.prerelease : null;
3838
+ };
3839
+ module2.exports = prerelease;
3840
+ }
3841
+ });
3842
+
3843
+ // node_modules/semver/functions/compare.js
3844
+ var require_compare = __commonJS({
3845
+ "node_modules/semver/functions/compare.js"(exports2, module2) {
3846
+ "use strict";
3847
+ var SemVer = require_semver();
3848
+ var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
3849
+ module2.exports = compare;
3850
+ }
3851
+ });
3852
+
3853
+ // node_modules/semver/functions/rcompare.js
3854
+ var require_rcompare = __commonJS({
3855
+ "node_modules/semver/functions/rcompare.js"(exports2, module2) {
3856
+ "use strict";
3857
+ var compare = require_compare();
3858
+ var rcompare = (a, b, loose) => compare(b, a, loose);
3859
+ module2.exports = rcompare;
3860
+ }
3861
+ });
3862
+
3863
+ // node_modules/semver/functions/compare-loose.js
3864
+ var require_compare_loose = __commonJS({
3865
+ "node_modules/semver/functions/compare-loose.js"(exports2, module2) {
3866
+ "use strict";
3867
+ var compare = require_compare();
3868
+ var compareLoose = (a, b) => compare(a, b, true);
3869
+ module2.exports = compareLoose;
3870
+ }
3871
+ });
3872
+
3873
+ // node_modules/semver/functions/compare-build.js
3874
+ var require_compare_build = __commonJS({
3875
+ "node_modules/semver/functions/compare-build.js"(exports2, module2) {
3876
+ "use strict";
3877
+ var SemVer = require_semver();
3878
+ var compareBuild = (a, b, loose) => {
3879
+ const versionA = new SemVer(a, loose);
3880
+ const versionB = new SemVer(b, loose);
3881
+ return versionA.compare(versionB) || versionA.compareBuild(versionB);
3882
+ };
3883
+ module2.exports = compareBuild;
3884
+ }
3885
+ });
3886
+
3887
+ // node_modules/semver/functions/sort.js
3888
+ var require_sort = __commonJS({
3889
+ "node_modules/semver/functions/sort.js"(exports2, module2) {
3890
+ "use strict";
3891
+ var compareBuild = require_compare_build();
3892
+ var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
3893
+ module2.exports = sort;
3894
+ }
3895
+ });
3896
+
3897
+ // node_modules/semver/functions/rsort.js
3898
+ var require_rsort = __commonJS({
3899
+ "node_modules/semver/functions/rsort.js"(exports2, module2) {
3900
+ "use strict";
3901
+ var compareBuild = require_compare_build();
3902
+ var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
3903
+ module2.exports = rsort;
3904
+ }
3905
+ });
3906
+
3907
+ // node_modules/semver/functions/gt.js
3908
+ var require_gt = __commonJS({
3909
+ "node_modules/semver/functions/gt.js"(exports2, module2) {
3910
+ "use strict";
3911
+ var compare = require_compare();
3912
+ var gt = (a, b, loose) => compare(a, b, loose) > 0;
3913
+ module2.exports = gt;
3914
+ }
3915
+ });
3916
+
3917
+ // node_modules/semver/functions/lt.js
3918
+ var require_lt = __commonJS({
3919
+ "node_modules/semver/functions/lt.js"(exports2, module2) {
3920
+ "use strict";
3921
+ var compare = require_compare();
3922
+ var lt = (a, b, loose) => compare(a, b, loose) < 0;
3923
+ module2.exports = lt;
3924
+ }
3925
+ });
3926
+
3927
+ // node_modules/semver/functions/eq.js
3928
+ var require_eq = __commonJS({
3929
+ "node_modules/semver/functions/eq.js"(exports2, module2) {
3930
+ "use strict";
3931
+ var compare = require_compare();
3932
+ var eq = (a, b, loose) => compare(a, b, loose) === 0;
3933
+ module2.exports = eq;
3934
+ }
3935
+ });
3936
+
3937
+ // node_modules/semver/functions/neq.js
3938
+ var require_neq = __commonJS({
3939
+ "node_modules/semver/functions/neq.js"(exports2, module2) {
3940
+ "use strict";
3941
+ var compare = require_compare();
3942
+ var neq = (a, b, loose) => compare(a, b, loose) !== 0;
3943
+ module2.exports = neq;
3944
+ }
3945
+ });
3946
+
3947
+ // node_modules/semver/functions/gte.js
3948
+ var require_gte = __commonJS({
3949
+ "node_modules/semver/functions/gte.js"(exports2, module2) {
3950
+ "use strict";
3951
+ var compare = require_compare();
3952
+ var gte = (a, b, loose) => compare(a, b, loose) >= 0;
3953
+ module2.exports = gte;
3954
+ }
3955
+ });
3956
+
3957
+ // node_modules/semver/functions/lte.js
3958
+ var require_lte = __commonJS({
3959
+ "node_modules/semver/functions/lte.js"(exports2, module2) {
3960
+ "use strict";
3961
+ var compare = require_compare();
3962
+ var lte = (a, b, loose) => compare(a, b, loose) <= 0;
3963
+ module2.exports = lte;
3964
+ }
3965
+ });
3966
+
3967
+ // node_modules/semver/functions/cmp.js
3968
+ var require_cmp = __commonJS({
3969
+ "node_modules/semver/functions/cmp.js"(exports2, module2) {
3970
+ "use strict";
3971
+ var eq = require_eq();
3972
+ var neq = require_neq();
3973
+ var gt = require_gt();
3974
+ var gte = require_gte();
3975
+ var lt = require_lt();
3976
+ var lte = require_lte();
3977
+ var cmp = (a, op, b, loose) => {
3978
+ switch (op) {
3979
+ case "===":
3980
+ if (typeof a === "object") {
3981
+ a = a.version;
3982
+ }
3983
+ if (typeof b === "object") {
3984
+ b = b.version;
3985
+ }
3986
+ return a === b;
3987
+ case "!==":
3988
+ if (typeof a === "object") {
3989
+ a = a.version;
3990
+ }
3991
+ if (typeof b === "object") {
3992
+ b = b.version;
3993
+ }
3994
+ return a !== b;
3995
+ case "":
3996
+ case "=":
3997
+ case "==":
3998
+ return eq(a, b, loose);
3999
+ case "!=":
4000
+ return neq(a, b, loose);
4001
+ case ">":
4002
+ return gt(a, b, loose);
4003
+ case ">=":
4004
+ return gte(a, b, loose);
4005
+ case "<":
4006
+ return lt(a, b, loose);
4007
+ case "<=":
4008
+ return lte(a, b, loose);
4009
+ default:
4010
+ throw new TypeError(`Invalid operator: ${op}`);
4011
+ }
4012
+ };
4013
+ module2.exports = cmp;
4014
+ }
4015
+ });
4016
+
4017
+ // node_modules/semver/functions/coerce.js
4018
+ var require_coerce = __commonJS({
4019
+ "node_modules/semver/functions/coerce.js"(exports2, module2) {
4020
+ "use strict";
4021
+ var SemVer = require_semver();
4022
+ var parse2 = require_parse();
4023
+ var { safeRe: re, t } = require_re();
4024
+ var coerce = (version2, options) => {
4025
+ if (version2 instanceof SemVer) {
4026
+ return version2;
4027
+ }
4028
+ if (typeof version2 === "number") {
4029
+ version2 = String(version2);
4030
+ }
4031
+ if (typeof version2 !== "string") {
4032
+ return null;
4033
+ }
4034
+ options = options || {};
4035
+ let match = null;
4036
+ if (!options.rtl) {
4037
+ match = version2.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
4038
+ } else {
4039
+ const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
4040
+ let next;
4041
+ while ((next = coerceRtlRegex.exec(version2)) && (!match || match.index + match[0].length !== version2.length)) {
4042
+ if (!match || next.index + next[0].length !== match.index + match[0].length) {
4043
+ match = next;
4044
+ }
4045
+ coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
4046
+ }
4047
+ coerceRtlRegex.lastIndex = -1;
4048
+ }
4049
+ if (match === null) {
4050
+ return null;
4051
+ }
4052
+ const major = match[2];
4053
+ const minor = match[3] || "0";
4054
+ const patch = match[4] || "0";
4055
+ const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
4056
+ const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
4057
+ return parse2(`${major}.${minor}.${patch}${prerelease}${build}`, options);
4058
+ };
4059
+ module2.exports = coerce;
4060
+ }
4061
+ });
4062
+
4063
+ // node_modules/yallist/iterator.js
4064
+ var require_iterator = __commonJS({
4065
+ "node_modules/yallist/iterator.js"(exports2, module2) {
4066
+ "use strict";
4067
+ module2.exports = function(Yallist) {
4068
+ Yallist.prototype[Symbol.iterator] = function* () {
4069
+ for (let walker = this.head; walker; walker = walker.next) {
4070
+ yield walker.value;
4071
+ }
4072
+ };
4073
+ };
4074
+ }
4075
+ });
4076
+
4077
+ // node_modules/yallist/yallist.js
4078
+ var require_yallist = __commonJS({
4079
+ "node_modules/yallist/yallist.js"(exports2, module2) {
4080
+ "use strict";
4081
+ module2.exports = Yallist;
4082
+ Yallist.Node = Node;
4083
+ Yallist.create = Yallist;
4084
+ function Yallist(list) {
4085
+ var self2 = this;
4086
+ if (!(self2 instanceof Yallist)) {
4087
+ self2 = new Yallist();
4088
+ }
4089
+ self2.tail = null;
4090
+ self2.head = null;
4091
+ self2.length = 0;
4092
+ if (list && typeof list.forEach === "function") {
4093
+ list.forEach(function(item) {
4094
+ self2.push(item);
4095
+ });
4096
+ } else if (arguments.length > 0) {
4097
+ for (var i = 0, l = arguments.length; i < l; i++) {
4098
+ self2.push(arguments[i]);
4099
+ }
4100
+ }
4101
+ return self2;
4102
+ }
4103
+ Yallist.prototype.removeNode = function(node) {
4104
+ if (node.list !== this) {
4105
+ throw new Error("removing node which does not belong to this list");
4106
+ }
4107
+ var next = node.next;
4108
+ var prev = node.prev;
4109
+ if (next) {
4110
+ next.prev = prev;
4111
+ }
4112
+ if (prev) {
4113
+ prev.next = next;
4114
+ }
4115
+ if (node === this.head) {
4116
+ this.head = next;
4117
+ }
4118
+ if (node === this.tail) {
4119
+ this.tail = prev;
4120
+ }
4121
+ node.list.length--;
4122
+ node.next = null;
4123
+ node.prev = null;
4124
+ node.list = null;
4125
+ return next;
4126
+ };
4127
+ Yallist.prototype.unshiftNode = function(node) {
4128
+ if (node === this.head) {
4129
+ return;
4130
+ }
4131
+ if (node.list) {
4132
+ node.list.removeNode(node);
4133
+ }
4134
+ var head = this.head;
4135
+ node.list = this;
4136
+ node.next = head;
4137
+ if (head) {
4138
+ head.prev = node;
4139
+ }
4140
+ this.head = node;
4141
+ if (!this.tail) {
4142
+ this.tail = node;
4143
+ }
4144
+ this.length++;
4145
+ };
4146
+ Yallist.prototype.pushNode = function(node) {
4147
+ if (node === this.tail) {
4148
+ return;
4149
+ }
4150
+ if (node.list) {
4151
+ node.list.removeNode(node);
4152
+ }
4153
+ var tail = this.tail;
4154
+ node.list = this;
4155
+ node.prev = tail;
4156
+ if (tail) {
4157
+ tail.next = node;
4158
+ }
4159
+ this.tail = node;
4160
+ if (!this.head) {
4161
+ this.head = node;
4162
+ }
4163
+ this.length++;
4164
+ };
4165
+ Yallist.prototype.push = function() {
4166
+ for (var i = 0, l = arguments.length; i < l; i++) {
4167
+ push(this, arguments[i]);
4168
+ }
4169
+ return this.length;
4170
+ };
4171
+ Yallist.prototype.unshift = function() {
4172
+ for (var i = 0, l = arguments.length; i < l; i++) {
4173
+ unshift(this, arguments[i]);
4174
+ }
4175
+ return this.length;
4176
+ };
4177
+ Yallist.prototype.pop = function() {
4178
+ if (!this.tail) {
4179
+ return void 0;
4180
+ }
4181
+ var res = this.tail.value;
4182
+ this.tail = this.tail.prev;
4183
+ if (this.tail) {
4184
+ this.tail.next = null;
4185
+ } else {
4186
+ this.head = null;
4187
+ }
4188
+ this.length--;
4189
+ return res;
4190
+ };
4191
+ Yallist.prototype.shift = function() {
4192
+ if (!this.head) {
4193
+ return void 0;
4194
+ }
4195
+ var res = this.head.value;
4196
+ this.head = this.head.next;
4197
+ if (this.head) {
4198
+ this.head.prev = null;
4199
+ } else {
4200
+ this.tail = null;
4201
+ }
4202
+ this.length--;
4203
+ return res;
4204
+ };
4205
+ Yallist.prototype.forEach = function(fn, thisp) {
4206
+ thisp = thisp || this;
4207
+ for (var walker = this.head, i = 0; walker !== null; i++) {
4208
+ fn.call(thisp, walker.value, i, this);
4209
+ walker = walker.next;
4210
+ }
4211
+ };
4212
+ Yallist.prototype.forEachReverse = function(fn, thisp) {
4213
+ thisp = thisp || this;
4214
+ for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
4215
+ fn.call(thisp, walker.value, i, this);
4216
+ walker = walker.prev;
4217
+ }
4218
+ };
4219
+ Yallist.prototype.get = function(n) {
4220
+ for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
4221
+ walker = walker.next;
4222
+ }
4223
+ if (i === n && walker !== null) {
4224
+ return walker.value;
4225
+ }
4226
+ };
4227
+ Yallist.prototype.getReverse = function(n) {
4228
+ for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
4229
+ walker = walker.prev;
4230
+ }
4231
+ if (i === n && walker !== null) {
4232
+ return walker.value;
4233
+ }
4234
+ };
4235
+ Yallist.prototype.map = function(fn, thisp) {
4236
+ thisp = thisp || this;
4237
+ var res = new Yallist();
4238
+ for (var walker = this.head; walker !== null; ) {
4239
+ res.push(fn.call(thisp, walker.value, this));
4240
+ walker = walker.next;
4241
+ }
4242
+ return res;
4243
+ };
4244
+ Yallist.prototype.mapReverse = function(fn, thisp) {
4245
+ thisp = thisp || this;
4246
+ var res = new Yallist();
4247
+ for (var walker = this.tail; walker !== null; ) {
4248
+ res.push(fn.call(thisp, walker.value, this));
4249
+ walker = walker.prev;
4250
+ }
4251
+ return res;
4252
+ };
4253
+ Yallist.prototype.reduce = function(fn, initial) {
4254
+ var acc;
4255
+ var walker = this.head;
4256
+ if (arguments.length > 1) {
4257
+ acc = initial;
4258
+ } else if (this.head) {
4259
+ walker = this.head.next;
4260
+ acc = this.head.value;
4261
+ } else {
4262
+ throw new TypeError("Reduce of empty list with no initial value");
4263
+ }
4264
+ for (var i = 0; walker !== null; i++) {
4265
+ acc = fn(acc, walker.value, i);
4266
+ walker = walker.next;
4267
+ }
4268
+ return acc;
4269
+ };
4270
+ Yallist.prototype.reduceReverse = function(fn, initial) {
4271
+ var acc;
4272
+ var walker = this.tail;
4273
+ if (arguments.length > 1) {
4274
+ acc = initial;
4275
+ } else if (this.tail) {
4276
+ walker = this.tail.prev;
4277
+ acc = this.tail.value;
4278
+ } else {
4279
+ throw new TypeError("Reduce of empty list with no initial value");
4280
+ }
4281
+ for (var i = this.length - 1; walker !== null; i--) {
4282
+ acc = fn(acc, walker.value, i);
4283
+ walker = walker.prev;
4284
+ }
4285
+ return acc;
4286
+ };
4287
+ Yallist.prototype.toArray = function() {
4288
+ var arr = new Array(this.length);
4289
+ for (var i = 0, walker = this.head; walker !== null; i++) {
4290
+ arr[i] = walker.value;
4291
+ walker = walker.next;
4292
+ }
4293
+ return arr;
4294
+ };
4295
+ Yallist.prototype.toArrayReverse = function() {
4296
+ var arr = new Array(this.length);
4297
+ for (var i = 0, walker = this.tail; walker !== null; i++) {
4298
+ arr[i] = walker.value;
4299
+ walker = walker.prev;
4300
+ }
4301
+ return arr;
4302
+ };
4303
+ Yallist.prototype.slice = function(from3, to) {
4304
+ to = to || this.length;
4305
+ if (to < 0) {
4306
+ to += this.length;
4307
+ }
4308
+ from3 = from3 || 0;
4309
+ if (from3 < 0) {
4310
+ from3 += this.length;
4311
+ }
4312
+ var ret = new Yallist();
4313
+ if (to < from3 || to < 0) {
4314
+ return ret;
4315
+ }
4316
+ if (from3 < 0) {
4317
+ from3 = 0;
4318
+ }
4319
+ if (to > this.length) {
4320
+ to = this.length;
4321
+ }
4322
+ for (var i = 0, walker = this.head; walker !== null && i < from3; i++) {
4323
+ walker = walker.next;
4324
+ }
4325
+ for (; walker !== null && i < to; i++, walker = walker.next) {
4326
+ ret.push(walker.value);
4327
+ }
4328
+ return ret;
4329
+ };
4330
+ Yallist.prototype.sliceReverse = function(from3, to) {
4331
+ to = to || this.length;
4332
+ if (to < 0) {
4333
+ to += this.length;
4334
+ }
4335
+ from3 = from3 || 0;
4336
+ if (from3 < 0) {
4337
+ from3 += this.length;
4338
+ }
4339
+ var ret = new Yallist();
4340
+ if (to < from3 || to < 0) {
4341
+ return ret;
4342
+ }
4343
+ if (from3 < 0) {
4344
+ from3 = 0;
4345
+ }
4346
+ if (to > this.length) {
4347
+ to = this.length;
4348
+ }
4349
+ for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
4350
+ walker = walker.prev;
4351
+ }
4352
+ for (; walker !== null && i > from3; i--, walker = walker.prev) {
4353
+ ret.push(walker.value);
4354
+ }
4355
+ return ret;
4356
+ };
4357
+ Yallist.prototype.splice = function(start, deleteCount, ...nodes) {
4358
+ if (start > this.length) {
4359
+ start = this.length - 1;
4360
+ }
4361
+ if (start < 0) {
4362
+ start = this.length + start;
4363
+ }
4364
+ for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
4365
+ walker = walker.next;
4366
+ }
4367
+ var ret = [];
4368
+ for (var i = 0; walker && i < deleteCount; i++) {
4369
+ ret.push(walker.value);
4370
+ walker = this.removeNode(walker);
4371
+ }
4372
+ if (walker === null) {
4373
+ walker = this.tail;
4374
+ }
4375
+ if (walker !== this.head && walker !== this.tail) {
4376
+ walker = walker.prev;
4377
+ }
4378
+ for (var i = 0; i < nodes.length; i++) {
4379
+ walker = insert(this, walker, nodes[i]);
4380
+ }
4381
+ return ret;
4382
+ };
4383
+ Yallist.prototype.reverse = function() {
4384
+ var head = this.head;
4385
+ var tail = this.tail;
4386
+ for (var walker = head; walker !== null; walker = walker.prev) {
4387
+ var p = walker.prev;
4388
+ walker.prev = walker.next;
4389
+ walker.next = p;
4390
+ }
4391
+ this.head = tail;
4392
+ this.tail = head;
4393
+ return this;
4394
+ };
4395
+ function insert(self2, node, value) {
4396
+ var inserted = node === self2.head ? new Node(value, null, node, self2) : new Node(value, node, node.next, self2);
4397
+ if (inserted.next === null) {
4398
+ self2.tail = inserted;
4399
+ }
4400
+ if (inserted.prev === null) {
4401
+ self2.head = inserted;
4402
+ }
4403
+ self2.length++;
4404
+ return inserted;
4405
+ }
4406
+ function push(self2, item) {
4407
+ self2.tail = new Node(item, self2.tail, null, self2);
4408
+ if (!self2.head) {
4409
+ self2.head = self2.tail;
4410
+ }
4411
+ self2.length++;
4412
+ }
4413
+ function unshift(self2, item) {
4414
+ self2.head = new Node(item, null, self2.head, self2);
4415
+ if (!self2.tail) {
4416
+ self2.tail = self2.head;
4417
+ }
4418
+ self2.length++;
4419
+ }
4420
+ function Node(value, prev, next, list) {
4421
+ if (!(this instanceof Node)) {
4422
+ return new Node(value, prev, next, list);
4423
+ }
4424
+ this.list = list;
4425
+ this.value = value;
4426
+ if (prev) {
4427
+ prev.next = this;
4428
+ this.prev = prev;
4429
+ } else {
4430
+ this.prev = null;
4431
+ }
4432
+ if (next) {
4433
+ next.prev = this;
4434
+ this.next = next;
4435
+ } else {
4436
+ this.next = null;
4437
+ }
4438
+ }
4439
+ try {
4440
+ require_iterator()(Yallist);
4441
+ } catch (er) {
4442
+ }
4443
+ }
4444
+ });
4445
+
4446
+ // node_modules/lru-cache/index.js
4447
+ var require_lru_cache = __commonJS({
4448
+ "node_modules/lru-cache/index.js"(exports2, module2) {
4449
+ "use strict";
4450
+ var Yallist = require_yallist();
4451
+ var MAX = Symbol("max");
4452
+ var LENGTH = Symbol("length");
4453
+ var LENGTH_CALCULATOR = Symbol("lengthCalculator");
4454
+ var ALLOW_STALE = Symbol("allowStale");
4455
+ var MAX_AGE = Symbol("maxAge");
4456
+ var DISPOSE = Symbol("dispose");
4457
+ var NO_DISPOSE_ON_SET = Symbol("noDisposeOnSet");
4458
+ var LRU_LIST = Symbol("lruList");
4459
+ var CACHE = Symbol("cache");
4460
+ var UPDATE_AGE_ON_GET = Symbol("updateAgeOnGet");
4461
+ var naiveLength = () => 1;
4462
+ var LRUCache = class {
4463
+ constructor(options) {
4464
+ if (typeof options === "number")
4465
+ options = { max: options };
4466
+ if (!options)
4467
+ options = {};
4468
+ if (options.max && (typeof options.max !== "number" || options.max < 0))
4469
+ throw new TypeError("max must be a non-negative number");
4470
+ const max = this[MAX] = options.max || Infinity;
4471
+ const lc = options.length || naiveLength;
4472
+ this[LENGTH_CALCULATOR] = typeof lc !== "function" ? naiveLength : lc;
4473
+ this[ALLOW_STALE] = options.stale || false;
4474
+ if (options.maxAge && typeof options.maxAge !== "number")
4475
+ throw new TypeError("maxAge must be a number");
4476
+ this[MAX_AGE] = options.maxAge || 0;
4477
+ this[DISPOSE] = options.dispose;
4478
+ this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
4479
+ this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
4480
+ this.reset();
4481
+ }
4482
+ // resize the cache when the max changes.
4483
+ set max(mL) {
4484
+ if (typeof mL !== "number" || mL < 0)
4485
+ throw new TypeError("max must be a non-negative number");
4486
+ this[MAX] = mL || Infinity;
4487
+ trim(this);
4488
+ }
4489
+ get max() {
4490
+ return this[MAX];
4491
+ }
4492
+ set allowStale(allowStale) {
4493
+ this[ALLOW_STALE] = !!allowStale;
4494
+ }
4495
+ get allowStale() {
4496
+ return this[ALLOW_STALE];
4497
+ }
4498
+ set maxAge(mA) {
4499
+ if (typeof mA !== "number")
4500
+ throw new TypeError("maxAge must be a non-negative number");
4501
+ this[MAX_AGE] = mA;
4502
+ trim(this);
4503
+ }
4504
+ get maxAge() {
4505
+ return this[MAX_AGE];
4506
+ }
4507
+ // resize the cache when the lengthCalculator changes.
4508
+ set lengthCalculator(lC) {
4509
+ if (typeof lC !== "function")
4510
+ lC = naiveLength;
4511
+ if (lC !== this[LENGTH_CALCULATOR]) {
4512
+ this[LENGTH_CALCULATOR] = lC;
4513
+ this[LENGTH] = 0;
4514
+ this[LRU_LIST].forEach((hit) => {
4515
+ hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
4516
+ this[LENGTH] += hit.length;
4517
+ });
4518
+ }
4519
+ trim(this);
4520
+ }
4521
+ get lengthCalculator() {
4522
+ return this[LENGTH_CALCULATOR];
4523
+ }
4524
+ get length() {
4525
+ return this[LENGTH];
4526
+ }
4527
+ get itemCount() {
4528
+ return this[LRU_LIST].length;
4529
+ }
4530
+ rforEach(fn, thisp) {
4531
+ thisp = thisp || this;
4532
+ for (let walker = this[LRU_LIST].tail; walker !== null; ) {
4533
+ const prev = walker.prev;
4534
+ forEachStep(this, fn, walker, thisp);
4535
+ walker = prev;
4536
+ }
4537
+ }
4538
+ forEach(fn, thisp) {
4539
+ thisp = thisp || this;
4540
+ for (let walker = this[LRU_LIST].head; walker !== null; ) {
4541
+ const next = walker.next;
4542
+ forEachStep(this, fn, walker, thisp);
4543
+ walker = next;
4544
+ }
4545
+ }
4546
+ keys() {
4547
+ return this[LRU_LIST].toArray().map((k) => k.key);
4548
+ }
4549
+ values() {
4550
+ return this[LRU_LIST].toArray().map((k) => k.value);
4551
+ }
4552
+ reset() {
4553
+ if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
4554
+ this[LRU_LIST].forEach((hit) => this[DISPOSE](hit.key, hit.value));
4555
+ }
4556
+ this[CACHE] = /* @__PURE__ */ new Map();
4557
+ this[LRU_LIST] = new Yallist();
4558
+ this[LENGTH] = 0;
4559
+ }
4560
+ dump() {
4561
+ return this[LRU_LIST].map((hit) => isStale(this, hit) ? false : {
4562
+ k: hit.key,
4563
+ v: hit.value,
4564
+ e: hit.now + (hit.maxAge || 0)
4565
+ }).toArray().filter((h) => h);
4566
+ }
4567
+ dumpLru() {
4568
+ return this[LRU_LIST];
4569
+ }
4570
+ set(key, value, maxAge) {
4571
+ maxAge = maxAge || this[MAX_AGE];
4572
+ if (maxAge && typeof maxAge !== "number")
4573
+ throw new TypeError("maxAge must be a number");
4574
+ const now = maxAge ? Date.now() : 0;
4575
+ const len = this[LENGTH_CALCULATOR](value, key);
4576
+ if (this[CACHE].has(key)) {
4577
+ if (len > this[MAX]) {
4578
+ del(this, this[CACHE].get(key));
4579
+ return false;
4580
+ }
4581
+ const node = this[CACHE].get(key);
4582
+ const item = node.value;
4583
+ if (this[DISPOSE]) {
4584
+ if (!this[NO_DISPOSE_ON_SET])
4585
+ this[DISPOSE](key, item.value);
4586
+ }
4587
+ item.now = now;
4588
+ item.maxAge = maxAge;
4589
+ item.value = value;
4590
+ this[LENGTH] += len - item.length;
4591
+ item.length = len;
4592
+ this.get(key);
4593
+ trim(this);
4594
+ return true;
4595
+ }
4596
+ const hit = new Entry(key, value, len, now, maxAge);
4597
+ if (hit.length > this[MAX]) {
4598
+ if (this[DISPOSE])
4599
+ this[DISPOSE](key, value);
4600
+ return false;
4601
+ }
4602
+ this[LENGTH] += hit.length;
4603
+ this[LRU_LIST].unshift(hit);
4604
+ this[CACHE].set(key, this[LRU_LIST].head);
4605
+ trim(this);
4606
+ return true;
4607
+ }
4608
+ has(key) {
4609
+ if (!this[CACHE].has(key)) return false;
4610
+ const hit = this[CACHE].get(key).value;
4611
+ return !isStale(this, hit);
4612
+ }
4613
+ get(key) {
4614
+ return get2(this, key, true);
4615
+ }
4616
+ peek(key) {
4617
+ return get2(this, key, false);
4618
+ }
4619
+ pop() {
4620
+ const node = this[LRU_LIST].tail;
4621
+ if (!node)
4622
+ return null;
4623
+ del(this, node);
4624
+ return node.value;
4625
+ }
4626
+ del(key) {
4627
+ del(this, this[CACHE].get(key));
4628
+ }
4629
+ load(arr) {
4630
+ this.reset();
4631
+ const now = Date.now();
4632
+ for (let l = arr.length - 1; l >= 0; l--) {
4633
+ const hit = arr[l];
4634
+ const expiresAt = hit.e || 0;
4635
+ if (expiresAt === 0)
4636
+ this.set(hit.k, hit.v);
4637
+ else {
4638
+ const maxAge = expiresAt - now;
4639
+ if (maxAge > 0) {
4640
+ this.set(hit.k, hit.v, maxAge);
4641
+ }
4642
+ }
4643
+ }
4644
+ }
4645
+ prune() {
4646
+ this[CACHE].forEach((value, key) => get2(this, key, false));
4647
+ }
4648
+ };
4649
+ var get2 = (self2, key, doUse) => {
4650
+ const node = self2[CACHE].get(key);
4651
+ if (node) {
4652
+ const hit = node.value;
4653
+ if (isStale(self2, hit)) {
4654
+ del(self2, node);
4655
+ if (!self2[ALLOW_STALE])
4656
+ return void 0;
4657
+ } else {
4658
+ if (doUse) {
4659
+ if (self2[UPDATE_AGE_ON_GET])
4660
+ node.value.now = Date.now();
4661
+ self2[LRU_LIST].unshiftNode(node);
4662
+ }
4663
+ }
4664
+ return hit.value;
4665
+ }
4666
+ };
4667
+ var isStale = (self2, hit) => {
4668
+ if (!hit || !hit.maxAge && !self2[MAX_AGE])
4669
+ return false;
4670
+ const diff = Date.now() - hit.now;
4671
+ return hit.maxAge ? diff > hit.maxAge : self2[MAX_AGE] && diff > self2[MAX_AGE];
4672
+ };
4673
+ var trim = (self2) => {
4674
+ if (self2[LENGTH] > self2[MAX]) {
4675
+ for (let walker = self2[LRU_LIST].tail; self2[LENGTH] > self2[MAX] && walker !== null; ) {
4676
+ const prev = walker.prev;
4677
+ del(self2, walker);
4678
+ walker = prev;
4679
+ }
4680
+ }
4681
+ };
4682
+ var del = (self2, node) => {
4683
+ if (node) {
4684
+ const hit = node.value;
4685
+ if (self2[DISPOSE])
4686
+ self2[DISPOSE](hit.key, hit.value);
4687
+ self2[LENGTH] -= hit.length;
4688
+ self2[CACHE].delete(hit.key);
4689
+ self2[LRU_LIST].removeNode(node);
4690
+ }
4691
+ };
4692
+ var Entry = class {
4693
+ constructor(key, value, length, now, maxAge) {
4694
+ this.key = key;
4695
+ this.value = value;
4696
+ this.length = length;
4697
+ this.now = now;
4698
+ this.maxAge = maxAge || 0;
4699
+ }
4700
+ };
4701
+ var forEachStep = (self2, fn, node, thisp) => {
4702
+ let hit = node.value;
4703
+ if (isStale(self2, hit)) {
4704
+ del(self2, node);
4705
+ if (!self2[ALLOW_STALE])
4706
+ hit = void 0;
4707
+ }
4708
+ if (hit)
4709
+ fn.call(thisp, hit.value, hit.key, self2);
4710
+ };
4711
+ module2.exports = LRUCache;
4712
+ }
4713
+ });
4714
+
4715
+ // node_modules/semver/classes/range.js
4716
+ var require_range = __commonJS({
4717
+ "node_modules/semver/classes/range.js"(exports2, module2) {
4718
+ "use strict";
4719
+ var Range = class _Range {
4720
+ constructor(range, options) {
4721
+ options = parseOptions(options);
4722
+ if (range instanceof _Range) {
4723
+ if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
4724
+ return range;
4725
+ } else {
4726
+ return new _Range(range.raw, options);
4727
+ }
4728
+ }
4729
+ if (range instanceof Comparator) {
4730
+ this.raw = range.value;
4731
+ this.set = [[range]];
4732
+ this.format();
4733
+ return this;
4734
+ }
4735
+ this.options = options;
4736
+ this.loose = !!options.loose;
4737
+ this.includePrerelease = !!options.includePrerelease;
4738
+ this.raw = range.trim().split(/\s+/).join(" ");
4739
+ this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
4740
+ if (!this.set.length) {
4741
+ throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
4742
+ }
4743
+ if (this.set.length > 1) {
4744
+ const first = this.set[0];
4745
+ this.set = this.set.filter((c) => !isNullSet(c[0]));
4746
+ if (this.set.length === 0) {
4747
+ this.set = [first];
4748
+ } else if (this.set.length > 1) {
4749
+ for (const c of this.set) {
4750
+ if (c.length === 1 && isAny(c[0])) {
4751
+ this.set = [c];
4752
+ break;
4753
+ }
4754
+ }
4755
+ }
4756
+ }
4757
+ this.format();
4758
+ }
4759
+ format() {
4760
+ this.range = this.set.map((comps) => comps.join(" ").trim()).join("||").trim();
4761
+ return this.range;
4762
+ }
4763
+ toString() {
4764
+ return this.range;
4765
+ }
4766
+ parseRange(range) {
4767
+ const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
4768
+ const memoKey = memoOpts + ":" + range;
4769
+ const cached = cache.get(memoKey);
4770
+ if (cached) {
4771
+ return cached;
4772
+ }
4773
+ const loose = this.options.loose;
4774
+ const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
4775
+ range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
4776
+ debug("hyphen replace", range);
4777
+ range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
4778
+ debug("comparator trim", range);
4779
+ range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
4780
+ debug("tilde trim", range);
4781
+ range = range.replace(re[t.CARETTRIM], caretTrimReplace);
4782
+ debug("caret trim", range);
4783
+ let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
4784
+ if (loose) {
4785
+ rangeList = rangeList.filter((comp) => {
4786
+ debug("loose invalid filter", comp, this.options);
4787
+ return !!comp.match(re[t.COMPARATORLOOSE]);
4788
+ });
4789
+ }
4790
+ debug("range list", rangeList);
4791
+ const rangeMap = /* @__PURE__ */ new Map();
4792
+ const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
4793
+ for (const comp of comparators) {
4794
+ if (isNullSet(comp)) {
4795
+ return [comp];
4796
+ }
4797
+ rangeMap.set(comp.value, comp);
4798
+ }
4799
+ if (rangeMap.size > 1 && rangeMap.has("")) {
4800
+ rangeMap.delete("");
4801
+ }
4802
+ const result = [...rangeMap.values()];
4803
+ cache.set(memoKey, result);
4804
+ return result;
4805
+ }
4806
+ intersects(range, options) {
4807
+ if (!(range instanceof _Range)) {
4808
+ throw new TypeError("a Range is required");
4809
+ }
4810
+ return this.set.some((thisComparators) => {
4811
+ return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
4812
+ return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
4813
+ return rangeComparators.every((rangeComparator) => {
4814
+ return thisComparator.intersects(rangeComparator, options);
4815
+ });
4816
+ });
4817
+ });
4818
+ });
4819
+ }
4820
+ // if ANY of the sets match ALL of its comparators, then pass
4821
+ test(version2) {
4822
+ if (!version2) {
4823
+ return false;
4824
+ }
4825
+ if (typeof version2 === "string") {
4826
+ try {
4827
+ version2 = new SemVer(version2, this.options);
4828
+ } catch (er) {
4829
+ return false;
4830
+ }
4831
+ }
4832
+ for (let i = 0; i < this.set.length; i++) {
4833
+ if (testSet(this.set[i], version2, this.options)) {
4834
+ return true;
4835
+ }
4836
+ }
4837
+ return false;
4838
+ }
4839
+ };
4840
+ module2.exports = Range;
4841
+ var LRU = require_lru_cache();
4842
+ var cache = new LRU({ max: 1e3 });
4843
+ var parseOptions = require_parse_options();
4844
+ var Comparator = require_comparator();
4845
+ var debug = require_debug();
4846
+ var SemVer = require_semver();
4847
+ var {
4848
+ safeRe: re,
4849
+ t,
4850
+ comparatorTrimReplace,
4851
+ tildeTrimReplace,
4852
+ caretTrimReplace
4853
+ } = require_re();
4854
+ var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
4855
+ var isNullSet = (c) => c.value === "<0.0.0-0";
4856
+ var isAny = (c) => c.value === "";
4857
+ var isSatisfiable = (comparators, options) => {
4858
+ let result = true;
4859
+ const remainingComparators = comparators.slice();
4860
+ let testComparator = remainingComparators.pop();
4861
+ while (result && remainingComparators.length) {
4862
+ result = remainingComparators.every((otherComparator) => {
4863
+ return testComparator.intersects(otherComparator, options);
4864
+ });
4865
+ testComparator = remainingComparators.pop();
4866
+ }
4867
+ return result;
4868
+ };
4869
+ var parseComparator = (comp, options) => {
4870
+ debug("comp", comp, options);
4871
+ comp = replaceCarets(comp, options);
4872
+ debug("caret", comp);
4873
+ comp = replaceTildes(comp, options);
4874
+ debug("tildes", comp);
4875
+ comp = replaceXRanges(comp, options);
4876
+ debug("xrange", comp);
4877
+ comp = replaceStars(comp, options);
4878
+ debug("stars", comp);
4879
+ return comp;
4880
+ };
4881
+ var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
4882
+ var replaceTildes = (comp, options) => {
4883
+ return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
4884
+ };
4885
+ var replaceTilde = (comp, options) => {
4886
+ const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
4887
+ return comp.replace(r, (_3, M, m, p, pr) => {
4888
+ debug("tilde", comp, _3, M, m, p, pr);
4889
+ let ret;
4890
+ if (isX(M)) {
4891
+ ret = "";
4892
+ } else if (isX(m)) {
4893
+ ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
4894
+ } else if (isX(p)) {
4895
+ ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
4896
+ } else if (pr) {
4897
+ debug("replaceTilde pr", pr);
4898
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
4899
+ } else {
4900
+ ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
4901
+ }
4902
+ debug("tilde return", ret);
4903
+ return ret;
4904
+ });
4905
+ };
4906
+ var replaceCarets = (comp, options) => {
4907
+ return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
4908
+ };
4909
+ var replaceCaret = (comp, options) => {
4910
+ debug("caret", comp, options);
4911
+ const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
4912
+ const z = options.includePrerelease ? "-0" : "";
4913
+ return comp.replace(r, (_3, M, m, p, pr) => {
4914
+ debug("caret", comp, _3, M, m, p, pr);
4915
+ let ret;
4916
+ if (isX(M)) {
4917
+ ret = "";
4918
+ } else if (isX(m)) {
4919
+ ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
4920
+ } else if (isX(p)) {
4921
+ if (M === "0") {
4922
+ ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
4923
+ } else {
4924
+ ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
4925
+ }
4926
+ } else if (pr) {
4927
+ debug("replaceCaret pr", pr);
4928
+ if (M === "0") {
4929
+ if (m === "0") {
4930
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
4931
+ } else {
4932
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
4933
+ }
4934
+ } else {
4935
+ ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
4936
+ }
4937
+ } else {
4938
+ debug("no pr");
4939
+ if (M === "0") {
4940
+ if (m === "0") {
4941
+ ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
4942
+ } else {
4943
+ ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
4944
+ }
4945
+ } else {
4946
+ ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
4947
+ }
4948
+ }
4949
+ debug("caret return", ret);
4950
+ return ret;
4951
+ });
4952
+ };
4953
+ var replaceXRanges = (comp, options) => {
4954
+ debug("replaceXRanges", comp, options);
4955
+ return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
4956
+ };
4957
+ var replaceXRange = (comp, options) => {
4958
+ comp = comp.trim();
4959
+ const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
4960
+ return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
4961
+ debug("xRange", comp, ret, gtlt, M, m, p, pr);
4962
+ const xM = isX(M);
4963
+ const xm = xM || isX(m);
4964
+ const xp = xm || isX(p);
4965
+ const anyX = xp;
4966
+ if (gtlt === "=" && anyX) {
4967
+ gtlt = "";
4968
+ }
4969
+ pr = options.includePrerelease ? "-0" : "";
4970
+ if (xM) {
4971
+ if (gtlt === ">" || gtlt === "<") {
4972
+ ret = "<0.0.0-0";
4973
+ } else {
4974
+ ret = "*";
4975
+ }
4976
+ } else if (gtlt && anyX) {
4977
+ if (xm) {
4978
+ m = 0;
4979
+ }
4980
+ p = 0;
4981
+ if (gtlt === ">") {
4982
+ gtlt = ">=";
4983
+ if (xm) {
4984
+ M = +M + 1;
4985
+ m = 0;
4986
+ p = 0;
4987
+ } else {
4988
+ m = +m + 1;
4989
+ p = 0;
4990
+ }
4991
+ } else if (gtlt === "<=") {
4992
+ gtlt = "<";
4993
+ if (xm) {
4994
+ M = +M + 1;
4995
+ } else {
4996
+ m = +m + 1;
4997
+ }
4998
+ }
4999
+ if (gtlt === "<") {
5000
+ pr = "-0";
5001
+ }
5002
+ ret = `${gtlt + M}.${m}.${p}${pr}`;
5003
+ } else if (xm) {
5004
+ ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
5005
+ } else if (xp) {
5006
+ ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
5007
+ }
5008
+ debug("xRange return", ret);
5009
+ return ret;
5010
+ });
5011
+ };
5012
+ var replaceStars = (comp, options) => {
5013
+ debug("replaceStars", comp, options);
5014
+ return comp.trim().replace(re[t.STAR], "");
5015
+ };
5016
+ var replaceGTE0 = (comp, options) => {
5017
+ debug("replaceGTE0", comp, options);
5018
+ return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
5019
+ };
5020
+ var hyphenReplace = (incPr) => ($0, from3, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => {
5021
+ if (isX(fM)) {
5022
+ from3 = "";
5023
+ } else if (isX(fm)) {
5024
+ from3 = `>=${fM}.0.0${incPr ? "-0" : ""}`;
5025
+ } else if (isX(fp)) {
5026
+ from3 = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
5027
+ } else if (fpr) {
5028
+ from3 = `>=${from3}`;
5029
+ } else {
5030
+ from3 = `>=${from3}${incPr ? "-0" : ""}`;
5031
+ }
5032
+ if (isX(tM)) {
5033
+ to = "";
5034
+ } else if (isX(tm)) {
5035
+ to = `<${+tM + 1}.0.0-0`;
5036
+ } else if (isX(tp)) {
5037
+ to = `<${tM}.${+tm + 1}.0-0`;
5038
+ } else if (tpr) {
5039
+ to = `<=${tM}.${tm}.${tp}-${tpr}`;
5040
+ } else if (incPr) {
5041
+ to = `<${tM}.${tm}.${+tp + 1}-0`;
5042
+ } else {
5043
+ to = `<=${to}`;
5044
+ }
5045
+ return `${from3} ${to}`.trim();
5046
+ };
5047
+ var testSet = (set2, version2, options) => {
5048
+ for (let i = 0; i < set2.length; i++) {
5049
+ if (!set2[i].test(version2)) {
5050
+ return false;
5051
+ }
5052
+ }
5053
+ if (version2.prerelease.length && !options.includePrerelease) {
5054
+ for (let i = 0; i < set2.length; i++) {
5055
+ debug(set2[i].semver);
5056
+ if (set2[i].semver === Comparator.ANY) {
5057
+ continue;
5058
+ }
5059
+ if (set2[i].semver.prerelease.length > 0) {
5060
+ const allowed = set2[i].semver;
5061
+ if (allowed.major === version2.major && allowed.minor === version2.minor && allowed.patch === version2.patch) {
5062
+ return true;
5063
+ }
5064
+ }
5065
+ }
5066
+ return false;
5067
+ }
5068
+ return true;
5069
+ };
5070
+ }
5071
+ });
5072
+
5073
+ // node_modules/semver/classes/comparator.js
5074
+ var require_comparator = __commonJS({
5075
+ "node_modules/semver/classes/comparator.js"(exports2, module2) {
5076
+ "use strict";
5077
+ var ANY = Symbol("SemVer ANY");
5078
+ var Comparator = class _Comparator {
5079
+ static get ANY() {
5080
+ return ANY;
5081
+ }
5082
+ constructor(comp, options) {
5083
+ options = parseOptions(options);
5084
+ if (comp instanceof _Comparator) {
5085
+ if (comp.loose === !!options.loose) {
5086
+ return comp;
5087
+ } else {
5088
+ comp = comp.value;
5089
+ }
5090
+ }
5091
+ comp = comp.trim().split(/\s+/).join(" ");
5092
+ debug("comparator", comp, options);
5093
+ this.options = options;
5094
+ this.loose = !!options.loose;
5095
+ this.parse(comp);
5096
+ if (this.semver === ANY) {
5097
+ this.value = "";
5098
+ } else {
5099
+ this.value = this.operator + this.semver.version;
5100
+ }
5101
+ debug("comp", this);
5102
+ }
5103
+ parse(comp) {
5104
+ const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
5105
+ const m = comp.match(r);
5106
+ if (!m) {
5107
+ throw new TypeError(`Invalid comparator: ${comp}`);
5108
+ }
5109
+ this.operator = m[1] !== void 0 ? m[1] : "";
5110
+ if (this.operator === "=") {
5111
+ this.operator = "";
5112
+ }
5113
+ if (!m[2]) {
5114
+ this.semver = ANY;
5115
+ } else {
5116
+ this.semver = new SemVer(m[2], this.options.loose);
5117
+ }
5118
+ }
5119
+ toString() {
5120
+ return this.value;
5121
+ }
5122
+ test(version2) {
5123
+ debug("Comparator.test", version2, this.options.loose);
5124
+ if (this.semver === ANY || version2 === ANY) {
5125
+ return true;
5126
+ }
5127
+ if (typeof version2 === "string") {
5128
+ try {
5129
+ version2 = new SemVer(version2, this.options);
5130
+ } catch (er) {
5131
+ return false;
5132
+ }
5133
+ }
5134
+ return cmp(version2, this.operator, this.semver, this.options);
5135
+ }
5136
+ intersects(comp, options) {
5137
+ if (!(comp instanceof _Comparator)) {
5138
+ throw new TypeError("a Comparator is required");
5139
+ }
5140
+ if (this.operator === "") {
5141
+ if (this.value === "") {
5142
+ return true;
5143
+ }
5144
+ return new Range(comp.value, options).test(this.value);
5145
+ } else if (comp.operator === "") {
5146
+ if (comp.value === "") {
5147
+ return true;
5148
+ }
5149
+ return new Range(this.value, options).test(comp.semver);
5150
+ }
5151
+ options = parseOptions(options);
5152
+ if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
5153
+ return false;
5154
+ }
5155
+ if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
5156
+ return false;
5157
+ }
5158
+ if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
5159
+ return true;
5160
+ }
5161
+ if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
5162
+ return true;
5163
+ }
5164
+ if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
5165
+ return true;
5166
+ }
5167
+ if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
5168
+ return true;
5169
+ }
5170
+ if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
5171
+ return true;
5172
+ }
5173
+ return false;
5174
+ }
5175
+ };
5176
+ module2.exports = Comparator;
5177
+ var parseOptions = require_parse_options();
5178
+ var { safeRe: re, t } = require_re();
5179
+ var cmp = require_cmp();
5180
+ var debug = require_debug();
5181
+ var SemVer = require_semver();
5182
+ var Range = require_range();
5183
+ }
5184
+ });
5185
+
5186
+ // node_modules/semver/functions/satisfies.js
5187
+ var require_satisfies = __commonJS({
5188
+ "node_modules/semver/functions/satisfies.js"(exports2, module2) {
5189
+ "use strict";
5190
+ var Range = require_range();
5191
+ var satisfies2 = (version2, range, options) => {
5192
+ try {
5193
+ range = new Range(range, options);
5194
+ } catch (er) {
5195
+ return false;
5196
+ }
5197
+ return range.test(version2);
5198
+ };
5199
+ module2.exports = satisfies2;
5200
+ }
5201
+ });
5202
+
5203
+ // node_modules/semver/ranges/to-comparators.js
5204
+ var require_to_comparators = __commonJS({
5205
+ "node_modules/semver/ranges/to-comparators.js"(exports2, module2) {
5206
+ "use strict";
5207
+ var Range = require_range();
5208
+ var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
5209
+ module2.exports = toComparators;
5210
+ }
5211
+ });
5212
+
5213
+ // node_modules/semver/ranges/max-satisfying.js
5214
+ var require_max_satisfying = __commonJS({
5215
+ "node_modules/semver/ranges/max-satisfying.js"(exports2, module2) {
5216
+ "use strict";
5217
+ var SemVer = require_semver();
5218
+ var Range = require_range();
5219
+ var maxSatisfying = (versions, range, options) => {
5220
+ let max = null;
5221
+ let maxSV = null;
5222
+ let rangeObj = null;
5223
+ try {
5224
+ rangeObj = new Range(range, options);
5225
+ } catch (er) {
5226
+ return null;
5227
+ }
5228
+ versions.forEach((v) => {
5229
+ if (rangeObj.test(v)) {
5230
+ if (!max || maxSV.compare(v) === -1) {
5231
+ max = v;
5232
+ maxSV = new SemVer(max, options);
5233
+ }
5234
+ }
5235
+ });
5236
+ return max;
5237
+ };
5238
+ module2.exports = maxSatisfying;
5239
+ }
5240
+ });
5241
+
5242
+ // node_modules/semver/ranges/min-satisfying.js
5243
+ var require_min_satisfying = __commonJS({
5244
+ "node_modules/semver/ranges/min-satisfying.js"(exports2, module2) {
5245
+ "use strict";
5246
+ var SemVer = require_semver();
5247
+ var Range = require_range();
5248
+ var minSatisfying = (versions, range, options) => {
5249
+ let min = null;
5250
+ let minSV = null;
5251
+ let rangeObj = null;
5252
+ try {
5253
+ rangeObj = new Range(range, options);
5254
+ } catch (er) {
5255
+ return null;
5256
+ }
5257
+ versions.forEach((v) => {
5258
+ if (rangeObj.test(v)) {
5259
+ if (!min || minSV.compare(v) === 1) {
5260
+ min = v;
5261
+ minSV = new SemVer(min, options);
5262
+ }
5263
+ }
5264
+ });
5265
+ return min;
5266
+ };
5267
+ module2.exports = minSatisfying;
5268
+ }
5269
+ });
5270
+
5271
+ // node_modules/semver/ranges/min-version.js
5272
+ var require_min_version = __commonJS({
5273
+ "node_modules/semver/ranges/min-version.js"(exports2, module2) {
5274
+ "use strict";
5275
+ var SemVer = require_semver();
5276
+ var Range = require_range();
5277
+ var gt = require_gt();
5278
+ var minVersion = (range, loose) => {
5279
+ range = new Range(range, loose);
5280
+ let minver = new SemVer("0.0.0");
5281
+ if (range.test(minver)) {
5282
+ return minver;
5283
+ }
5284
+ minver = new SemVer("0.0.0-0");
5285
+ if (range.test(minver)) {
5286
+ return minver;
5287
+ }
5288
+ minver = null;
5289
+ for (let i = 0; i < range.set.length; ++i) {
5290
+ const comparators = range.set[i];
5291
+ let setMin = null;
5292
+ comparators.forEach((comparator) => {
5293
+ const compver = new SemVer(comparator.semver.version);
5294
+ switch (comparator.operator) {
5295
+ case ">":
5296
+ if (compver.prerelease.length === 0) {
5297
+ compver.patch++;
5298
+ } else {
5299
+ compver.prerelease.push(0);
5300
+ }
5301
+ compver.raw = compver.format();
5302
+ /* fallthrough */
5303
+ case "":
5304
+ case ">=":
5305
+ if (!setMin || gt(compver, setMin)) {
5306
+ setMin = compver;
5307
+ }
5308
+ break;
5309
+ case "<":
5310
+ case "<=":
5311
+ break;
5312
+ /* istanbul ignore next */
5313
+ default:
5314
+ throw new Error(`Unexpected operation: ${comparator.operator}`);
5315
+ }
5316
+ });
5317
+ if (setMin && (!minver || gt(minver, setMin))) {
5318
+ minver = setMin;
5319
+ }
5320
+ }
5321
+ if (minver && range.test(minver)) {
5322
+ return minver;
5323
+ }
5324
+ return null;
5325
+ };
5326
+ module2.exports = minVersion;
5327
+ }
5328
+ });
5329
+
5330
+ // node_modules/semver/ranges/valid.js
5331
+ var require_valid2 = __commonJS({
5332
+ "node_modules/semver/ranges/valid.js"(exports2, module2) {
5333
+ "use strict";
5334
+ var Range = require_range();
5335
+ var validRange = (range, options) => {
5336
+ try {
5337
+ return new Range(range, options).range || "*";
5338
+ } catch (er) {
5339
+ return null;
5340
+ }
5341
+ };
5342
+ module2.exports = validRange;
5343
+ }
5344
+ });
5345
+
5346
+ // node_modules/semver/ranges/outside.js
5347
+ var require_outside = __commonJS({
5348
+ "node_modules/semver/ranges/outside.js"(exports2, module2) {
5349
+ "use strict";
5350
+ var SemVer = require_semver();
5351
+ var Comparator = require_comparator();
5352
+ var { ANY } = Comparator;
5353
+ var Range = require_range();
5354
+ var satisfies2 = require_satisfies();
5355
+ var gt = require_gt();
5356
+ var lt = require_lt();
5357
+ var lte = require_lte();
5358
+ var gte = require_gte();
5359
+ var outside = (version2, range, hilo, options) => {
5360
+ version2 = new SemVer(version2, options);
5361
+ range = new Range(range, options);
5362
+ let gtfn, ltefn, ltfn, comp, ecomp;
5363
+ switch (hilo) {
5364
+ case ">":
5365
+ gtfn = gt;
5366
+ ltefn = lte;
5367
+ ltfn = lt;
5368
+ comp = ">";
5369
+ ecomp = ">=";
5370
+ break;
5371
+ case "<":
5372
+ gtfn = lt;
5373
+ ltefn = gte;
5374
+ ltfn = gt;
5375
+ comp = "<";
5376
+ ecomp = "<=";
5377
+ break;
5378
+ default:
5379
+ throw new TypeError('Must provide a hilo val of "<" or ">"');
5380
+ }
5381
+ if (satisfies2(version2, range, options)) {
5382
+ return false;
5383
+ }
5384
+ for (let i = 0; i < range.set.length; ++i) {
5385
+ const comparators = range.set[i];
5386
+ let high = null;
5387
+ let low = null;
5388
+ comparators.forEach((comparator) => {
5389
+ if (comparator.semver === ANY) {
5390
+ comparator = new Comparator(">=0.0.0");
5391
+ }
5392
+ high = high || comparator;
5393
+ low = low || comparator;
5394
+ if (gtfn(comparator.semver, high.semver, options)) {
5395
+ high = comparator;
5396
+ } else if (ltfn(comparator.semver, low.semver, options)) {
5397
+ low = comparator;
5398
+ }
5399
+ });
5400
+ if (high.operator === comp || high.operator === ecomp) {
5401
+ return false;
5402
+ }
5403
+ if ((!low.operator || low.operator === comp) && ltefn(version2, low.semver)) {
5404
+ return false;
5405
+ } else if (low.operator === ecomp && ltfn(version2, low.semver)) {
5406
+ return false;
5407
+ }
5408
+ }
5409
+ return true;
5410
+ };
5411
+ module2.exports = outside;
5412
+ }
5413
+ });
5414
+
5415
+ // node_modules/semver/ranges/gtr.js
5416
+ var require_gtr = __commonJS({
5417
+ "node_modules/semver/ranges/gtr.js"(exports2, module2) {
5418
+ "use strict";
5419
+ var outside = require_outside();
5420
+ var gtr = (version2, range, options) => outside(version2, range, ">", options);
5421
+ module2.exports = gtr;
5422
+ }
5423
+ });
5424
+
5425
+ // node_modules/semver/ranges/ltr.js
5426
+ var require_ltr = __commonJS({
5427
+ "node_modules/semver/ranges/ltr.js"(exports2, module2) {
5428
+ "use strict";
5429
+ var outside = require_outside();
5430
+ var ltr = (version2, range, options) => outside(version2, range, "<", options);
5431
+ module2.exports = ltr;
5432
+ }
5433
+ });
5434
+
5435
+ // node_modules/semver/ranges/intersects.js
5436
+ var require_intersects = __commonJS({
5437
+ "node_modules/semver/ranges/intersects.js"(exports2, module2) {
5438
+ "use strict";
5439
+ var Range = require_range();
5440
+ var intersects = (r1, r2, options) => {
5441
+ r1 = new Range(r1, options);
5442
+ r2 = new Range(r2, options);
5443
+ return r1.intersects(r2, options);
5444
+ };
5445
+ module2.exports = intersects;
5446
+ }
5447
+ });
5448
+
5449
+ // node_modules/semver/ranges/simplify.js
5450
+ var require_simplify = __commonJS({
5451
+ "node_modules/semver/ranges/simplify.js"(exports2, module2) {
5452
+ "use strict";
5453
+ var satisfies2 = require_satisfies();
5454
+ var compare = require_compare();
5455
+ module2.exports = (versions, range, options) => {
5456
+ const set2 = [];
5457
+ let first = null;
5458
+ let prev = null;
5459
+ const v = versions.sort((a, b) => compare(a, b, options));
5460
+ for (const version2 of v) {
5461
+ const included = satisfies2(version2, range, options);
5462
+ if (included) {
5463
+ prev = version2;
5464
+ if (!first) {
5465
+ first = version2;
5466
+ }
5467
+ } else {
5468
+ if (prev) {
5469
+ set2.push([first, prev]);
5470
+ }
5471
+ prev = null;
5472
+ first = null;
5473
+ }
5474
+ }
5475
+ if (first) {
5476
+ set2.push([first, null]);
5477
+ }
5478
+ const ranges = [];
5479
+ for (const [min, max] of set2) {
5480
+ if (min === max) {
5481
+ ranges.push(min);
5482
+ } else if (!max && min === v[0]) {
5483
+ ranges.push("*");
5484
+ } else if (!max) {
5485
+ ranges.push(`>=${min}`);
5486
+ } else if (min === v[0]) {
5487
+ ranges.push(`<=${max}`);
5488
+ } else {
5489
+ ranges.push(`${min} - ${max}`);
5490
+ }
5491
+ }
5492
+ const simplified = ranges.join(" || ");
5493
+ const original = typeof range.raw === "string" ? range.raw : String(range);
5494
+ return simplified.length < original.length ? simplified : range;
5495
+ };
5496
+ }
5497
+ });
5498
+
5499
+ // node_modules/semver/ranges/subset.js
5500
+ var require_subset = __commonJS({
5501
+ "node_modules/semver/ranges/subset.js"(exports2, module2) {
5502
+ "use strict";
5503
+ var Range = require_range();
5504
+ var Comparator = require_comparator();
5505
+ var { ANY } = Comparator;
5506
+ var satisfies2 = require_satisfies();
5507
+ var compare = require_compare();
5508
+ var subset = (sub, dom, options = {}) => {
5509
+ if (sub === dom) {
5510
+ return true;
5511
+ }
5512
+ sub = new Range(sub, options);
5513
+ dom = new Range(dom, options);
5514
+ let sawNonNull = false;
5515
+ OUTER: for (const simpleSub of sub.set) {
5516
+ for (const simpleDom of dom.set) {
5517
+ const isSub = simpleSubset(simpleSub, simpleDom, options);
5518
+ sawNonNull = sawNonNull || isSub !== null;
5519
+ if (isSub) {
5520
+ continue OUTER;
5521
+ }
5522
+ }
5523
+ if (sawNonNull) {
5524
+ return false;
5525
+ }
5526
+ }
5527
+ return true;
5528
+ };
5529
+ var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
5530
+ var minimumVersion = [new Comparator(">=0.0.0")];
5531
+ var simpleSubset = (sub, dom, options) => {
5532
+ if (sub === dom) {
5533
+ return true;
5534
+ }
5535
+ if (sub.length === 1 && sub[0].semver === ANY) {
5536
+ if (dom.length === 1 && dom[0].semver === ANY) {
5537
+ return true;
5538
+ } else if (options.includePrerelease) {
5539
+ sub = minimumVersionWithPreRelease;
5540
+ } else {
5541
+ sub = minimumVersion;
5542
+ }
5543
+ }
5544
+ if (dom.length === 1 && dom[0].semver === ANY) {
5545
+ if (options.includePrerelease) {
5546
+ return true;
5547
+ } else {
5548
+ dom = minimumVersion;
5549
+ }
5550
+ }
5551
+ const eqSet = /* @__PURE__ */ new Set();
5552
+ let gt, lt;
5553
+ for (const c of sub) {
5554
+ if (c.operator === ">" || c.operator === ">=") {
5555
+ gt = higherGT(gt, c, options);
5556
+ } else if (c.operator === "<" || c.operator === "<=") {
5557
+ lt = lowerLT(lt, c, options);
5558
+ } else {
5559
+ eqSet.add(c.semver);
5560
+ }
5561
+ }
5562
+ if (eqSet.size > 1) {
5563
+ return null;
5564
+ }
5565
+ let gtltComp;
5566
+ if (gt && lt) {
5567
+ gtltComp = compare(gt.semver, lt.semver, options);
5568
+ if (gtltComp > 0) {
5569
+ return null;
5570
+ } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
5571
+ return null;
5572
+ }
5573
+ }
5574
+ for (const eq of eqSet) {
5575
+ if (gt && !satisfies2(eq, String(gt), options)) {
5576
+ return null;
5577
+ }
5578
+ if (lt && !satisfies2(eq, String(lt), options)) {
5579
+ return null;
5580
+ }
5581
+ for (const c of dom) {
5582
+ if (!satisfies2(eq, String(c), options)) {
5583
+ return false;
5584
+ }
5585
+ }
5586
+ return true;
5587
+ }
5588
+ let higher, lower;
5589
+ let hasDomLT, hasDomGT;
5590
+ let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
5591
+ let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
5592
+ if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
5593
+ needDomLTPre = false;
5594
+ }
5595
+ for (const c of dom) {
5596
+ hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
5597
+ hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
5598
+ if (gt) {
5599
+ if (needDomGTPre) {
5600
+ if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
5601
+ needDomGTPre = false;
5602
+ }
5603
+ }
5604
+ if (c.operator === ">" || c.operator === ">=") {
5605
+ higher = higherGT(gt, c, options);
5606
+ if (higher === c && higher !== gt) {
5607
+ return false;
5608
+ }
5609
+ } else if (gt.operator === ">=" && !satisfies2(gt.semver, String(c), options)) {
5610
+ return false;
5611
+ }
5612
+ }
5613
+ if (lt) {
5614
+ if (needDomLTPre) {
5615
+ if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
5616
+ needDomLTPre = false;
5617
+ }
5618
+ }
5619
+ if (c.operator === "<" || c.operator === "<=") {
5620
+ lower = lowerLT(lt, c, options);
5621
+ if (lower === c && lower !== lt) {
5622
+ return false;
5623
+ }
5624
+ } else if (lt.operator === "<=" && !satisfies2(lt.semver, String(c), options)) {
5625
+ return false;
5626
+ }
5627
+ }
5628
+ if (!c.operator && (lt || gt) && gtltComp !== 0) {
5629
+ return false;
5630
+ }
5631
+ }
5632
+ if (gt && hasDomLT && !lt && gtltComp !== 0) {
5633
+ return false;
5634
+ }
5635
+ if (lt && hasDomGT && !gt && gtltComp !== 0) {
5636
+ return false;
5637
+ }
5638
+ if (needDomGTPre || needDomLTPre) {
5639
+ return false;
5640
+ }
5641
+ return true;
5642
+ };
5643
+ var higherGT = (a, b, options) => {
5644
+ if (!a) {
5645
+ return b;
5646
+ }
5647
+ const comp = compare(a.semver, b.semver, options);
5648
+ return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
5649
+ };
5650
+ var lowerLT = (a, b, options) => {
5651
+ if (!a) {
5652
+ return b;
5653
+ }
5654
+ const comp = compare(a.semver, b.semver, options);
5655
+ return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
5656
+ };
5657
+ module2.exports = subset;
5658
+ }
5659
+ });
5660
+
5661
+ // node_modules/semver/index.js
5662
+ var require_semver2 = __commonJS({
5663
+ "node_modules/semver/index.js"(exports2, module2) {
5664
+ "use strict";
5665
+ var internalRe = require_re();
5666
+ var constants = require_constants();
5667
+ var SemVer = require_semver();
5668
+ var identifiers = require_identifiers();
5669
+ var parse2 = require_parse();
5670
+ var valid = require_valid();
5671
+ var clean = require_clean();
5672
+ var inc = require_inc();
5673
+ var diff = require_diff();
5674
+ var major = require_major();
5675
+ var minor = require_minor();
5676
+ var patch = require_patch();
5677
+ var prerelease = require_prerelease();
5678
+ var compare = require_compare();
5679
+ var rcompare = require_rcompare();
5680
+ var compareLoose = require_compare_loose();
5681
+ var compareBuild = require_compare_build();
5682
+ var sort = require_sort();
5683
+ var rsort = require_rsort();
5684
+ var gt = require_gt();
5685
+ var lt = require_lt();
5686
+ var eq = require_eq();
5687
+ var neq = require_neq();
5688
+ var gte = require_gte();
5689
+ var lte = require_lte();
5690
+ var cmp = require_cmp();
5691
+ var coerce = require_coerce();
5692
+ var Comparator = require_comparator();
5693
+ var Range = require_range();
5694
+ var satisfies2 = require_satisfies();
5695
+ var toComparators = require_to_comparators();
5696
+ var maxSatisfying = require_max_satisfying();
5697
+ var minSatisfying = require_min_satisfying();
5698
+ var minVersion = require_min_version();
5699
+ var validRange = require_valid2();
5700
+ var outside = require_outside();
5701
+ var gtr = require_gtr();
5702
+ var ltr = require_ltr();
5703
+ var intersects = require_intersects();
5704
+ var simplifyRange = require_simplify();
5705
+ var subset = require_subset();
5706
+ module2.exports = {
5707
+ parse: parse2,
5708
+ valid,
5709
+ clean,
5710
+ inc,
5711
+ diff,
5712
+ major,
5713
+ minor,
5714
+ patch,
5715
+ prerelease,
5716
+ compare,
5717
+ rcompare,
5718
+ compareLoose,
5719
+ compareBuild,
5720
+ sort,
5721
+ rsort,
5722
+ gt,
5723
+ lt,
5724
+ eq,
5725
+ neq,
5726
+ gte,
5727
+ lte,
5728
+ cmp,
5729
+ coerce,
5730
+ Comparator,
5731
+ Range,
5732
+ satisfies: satisfies2,
5733
+ toComparators,
5734
+ maxSatisfying,
5735
+ minSatisfying,
5736
+ minVersion,
5737
+ validRange,
5738
+ outside,
5739
+ gtr,
5740
+ ltr,
5741
+ intersects,
5742
+ simplifyRange,
5743
+ subset,
5744
+ SemVer,
5745
+ re: internalRe.re,
5746
+ src: internalRe.src,
5747
+ tokens: internalRe.t,
5748
+ SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
5749
+ RELEASE_TYPES: constants.RELEASE_TYPES,
5750
+ compareIdentifiers: identifiers.compareIdentifiers,
5751
+ rcompareIdentifiers: identifiers.rcompareIdentifiers
5752
+ };
5753
+ }
5754
+ });
5755
+
3267
5756
  // node_modules/webidl-conversions/lib/index.js
3268
5757
  var require_lib = __commonJS({
3269
5758
  "node_modules/webidl-conversions/lib/index.js"(exports2, module2) {
@@ -9322,7 +11811,7 @@ var require_throwUnobservableError = __commonJS({
9322
11811
  });
9323
11812
 
9324
11813
  // node_modules/rxjs/dist/cjs/internal/symbol/iterator.js
9325
- var require_iterator = __commonJS({
11814
+ var require_iterator2 = __commonJS({
9326
11815
  "node_modules/rxjs/dist/cjs/internal/symbol/iterator.js"(exports2) {
9327
11816
  "use strict";
9328
11817
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -9344,7 +11833,7 @@ var require_isIterable = __commonJS({
9344
11833
  "use strict";
9345
11834
  Object.defineProperty(exports2, "__esModule", { value: true });
9346
11835
  exports2.isIterable = void 0;
9347
- var iterator_1 = require_iterator();
11836
+ var iterator_1 = require_iterator2();
9348
11837
  var isFunction_1 = require_isFunction();
9349
11838
  function isIterable(input) {
9350
11839
  return isFunction_1.isFunction(input === null || input === void 0 ? void 0 : input[iterator_1.iterator]);
@@ -9951,7 +12440,7 @@ var require_scheduleIterable = __commonJS({
9951
12440
  Object.defineProperty(exports2, "__esModule", { value: true });
9952
12441
  exports2.scheduleIterable = void 0;
9953
12442
  var Observable_1 = require_Observable();
9954
- var iterator_1 = require_iterator();
12443
+ var iterator_1 = require_iterator2();
9955
12444
  var isFunction_1 = require_isFunction();
9956
12445
  var executeSchedule_1 = require_executeSchedule();
9957
12446
  function scheduleIterable(input, scheduler) {
@@ -11567,7 +14056,7 @@ var require_race = __commonJS({
11567
14056
  });
11568
14057
 
11569
14058
  // node_modules/rxjs/dist/cjs/internal/observable/range.js
11570
- var require_range = __commonJS({
14059
+ var require_range2 = __commonJS({
11571
14060
  "node_modules/rxjs/dist/cjs/internal/observable/range.js"(exports2) {
11572
14061
  "use strict";
11573
14062
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -15599,7 +18088,7 @@ var require_cjs = __commonJS({
15599
18088
  Object.defineProperty(exports2, "race", { enumerable: true, get: function() {
15600
18089
  return race_1.race;
15601
18090
  } });
15602
- var range_1 = require_range();
18091
+ var range_1 = require_range2();
15603
18092
  Object.defineProperty(exports2, "range", { enumerable: true, get: function() {
15604
18093
  return range_1.range;
15605
18094
  } });
@@ -16454,7 +18943,7 @@ var require_baseRest = __commonJS({
16454
18943
  });
16455
18944
 
16456
18945
  // node_modules/lodash/eq.js
16457
- var require_eq = __commonJS({
18946
+ var require_eq2 = __commonJS({
16458
18947
  "node_modules/lodash/eq.js"(exports2, module2) {
16459
18948
  "use strict";
16460
18949
  function eq(value, other) {
@@ -16508,7 +18997,7 @@ var require_isIndex = __commonJS({
16508
18997
  var require_isIterateeCall = __commonJS({
16509
18998
  "node_modules/lodash/_isIterateeCall.js"(exports2, module2) {
16510
18999
  "use strict";
16511
- var eq = require_eq();
19000
+ var eq = require_eq2();
16512
19001
  var isArrayLike = require_isArrayLike2();
16513
19002
  var isIndex = require_isIndex();
16514
19003
  var isObject = require_isObject();
@@ -16813,7 +19302,7 @@ var require_defaults = __commonJS({
16813
19302
  "node_modules/lodash/defaults.js"(exports2, module2) {
16814
19303
  "use strict";
16815
19304
  var baseRest = require_baseRest();
16816
- var eq = require_eq();
19305
+ var eq = require_eq2();
16817
19306
  var isIterateeCall = require_isIterateeCall();
16818
19307
  var keysIn = require_keysIn();
16819
19308
  var objectProto = Object.prototype;
@@ -16861,7 +19350,7 @@ var require_listCacheClear = __commonJS({
16861
19350
  var require_assocIndexOf = __commonJS({
16862
19351
  "node_modules/lodash/_assocIndexOf.js"(exports2, module2) {
16863
19352
  "use strict";
16864
- var eq = require_eq();
19353
+ var eq = require_eq2();
16865
19354
  function assocIndexOf(array, key) {
16866
19355
  var length = array.length;
16867
19356
  while (length--) {
@@ -17358,7 +19847,7 @@ var require_assignValue = __commonJS({
17358
19847
  "node_modules/lodash/_assignValue.js"(exports2, module2) {
17359
19848
  "use strict";
17360
19849
  var baseAssignValue = require_baseAssignValue();
17361
- var eq = require_eq();
19850
+ var eq = require_eq2();
17362
19851
  var objectProto = Object.prototype;
17363
19852
  var hasOwnProperty = objectProto.hasOwnProperty;
17364
19853
  function assignValue(object, key, value) {
@@ -18432,7 +20921,7 @@ var require_equalByTag = __commonJS({
18432
20921
  "use strict";
18433
20922
  var Symbol2 = require_Symbol();
18434
20923
  var Uint8Array2 = require_Uint8Array();
18435
- var eq = require_eq();
20924
+ var eq = require_eq2();
18436
20925
  var equalArrays = require_equalArrays();
18437
20926
  var mapToArray = require_mapToArray();
18438
20927
  var setToArray = require_setToArray();
@@ -20557,7 +23046,7 @@ var require_has_flag = __commonJS({
20557
23046
  var require_supports_color = __commonJS({
20558
23047
  "node_modules/supports-color/index.js"(exports2, module2) {
20559
23048
  "use strict";
20560
- var os4 = require("os");
23049
+ var os3 = require("os");
20561
23050
  var tty2 = require("tty");
20562
23051
  var hasFlag2 = require_has_flag();
20563
23052
  var { env: env2 } = process;
@@ -20605,7 +23094,7 @@ var require_supports_color = __commonJS({
20605
23094
  return min;
20606
23095
  }
20607
23096
  if (process.platform === "win32") {
20608
- const osRelease = os4.release().split(".");
23097
+ const osRelease = os3.release().split(".");
20609
23098
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
20610
23099
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
20611
23100
  }
@@ -36231,7 +38720,7 @@ var require_eval = __commonJS({
36231
38720
  });
36232
38721
 
36233
38722
  // node_modules/es-errors/range.js
36234
- var require_range2 = __commonJS({
38723
+ var require_range3 = __commonJS({
36235
38724
  "node_modules/es-errors/range.js"(exports2, module2) {
36236
38725
  "use strict";
36237
38726
  module2.exports = RangeError;
@@ -36379,7 +38868,7 @@ var require_get_intrinsic = __commonJS({
36379
38868
  var undefined2;
36380
38869
  var $Error = require_es_errors();
36381
38870
  var $EvalError = require_eval();
36382
- var $RangeError = require_range2();
38871
+ var $RangeError = require_range3();
36383
38872
  var $ReferenceError = require_ref();
36384
38873
  var $SyntaxError = require_syntax();
36385
38874
  var $TypeError = require_type();
@@ -37210,7 +39699,7 @@ var {
37210
39699
  } = import_index.default;
37211
39700
 
37212
39701
  // package.json
37213
- var version = "0.0.35";
39702
+ var version = "0.1.0";
37214
39703
 
37215
39704
  // src/lib/config/text.ts
37216
39705
  var CLI_DESCRIPTION = "GenLayer CLI is a development environment for the GenLayer ecosystem. It allows developers to interact with the protocol by creating accounts, sending transactions, and working with Intelligent Contracts by testing, debugging, and deploying them.";
@@ -37219,6 +39708,7 @@ var CLI_DESCRIPTION = "GenLayer CLI is a development environment for the GenLaye
37219
39708
  var fs5 = __toESM(require("fs"));
37220
39709
  var dotenv = __toESM(require_main());
37221
39710
  var path2 = __toESM(require("path"));
39711
+ var semver = __toESM(require_semver2());
37222
39712
 
37223
39713
  // src/lib/clients/jsonRpcClient.ts
37224
39714
  var import_node_fetch = __toESM(require_lib2());
@@ -37289,6 +39779,10 @@ var DEFAULT_RUN_DOCKER_COMMAND = {
37289
39779
  win32: 'start "" "C:\\Program Files\\Docker\\Docker\\Docker Desktop.exe"',
37290
39780
  linux: "sudo systemctl start docker"
37291
39781
  };
39782
+ var VERSION_REQUIREMENTS = {
39783
+ docker: "25.0.0",
39784
+ node: "18.0.0"
39785
+ };
37292
39786
  var AVAILABLE_PLATFORMS = ["darwin", "win32", "linux"];
37293
39787
  var STARTING_TIMEOUT_WAIT_CYLCE = 2e3;
37294
39788
  var STARTING_TIMEOUT_ATTEMPTS = 120;
@@ -37348,7 +39842,6 @@ var rpcClient = new JsonRpcClient(DEFAULT_JSON_RPC_URL);
37348
39842
  // src/lib/clients/system.ts
37349
39843
  var import_node_util5 = __toESM(require("node:util"));
37350
39844
  var import_child_process = require("child_process");
37351
- var import_os = __toESM(require("os"));
37352
39845
 
37353
39846
  // node_modules/open/index.js
37354
39847
  var import_node_process5 = __toESM(require("node:process"), 1);
@@ -37827,9 +40320,6 @@ function executeCommand(cmdsByPlatform, toolName) {
37827
40320
  throw new Error(`Error executing ${toolName || command}: ${error.message}.`);
37828
40321
  }
37829
40322
  }
37830
- function getHomeDirectory() {
37831
- return import_os.default.homedir();
37832
- }
37833
40323
  function getPlatform() {
37834
40324
  const currentPlatform = process.platform;
37835
40325
  if (!AVAILABLE_PLATFORMS.includes(currentPlatform)) {
@@ -37840,6 +40330,27 @@ function getPlatform() {
37840
40330
  function openUrl(url) {
37841
40331
  return open_default(url);
37842
40332
  }
40333
+ function getVersion(toolName) {
40334
+ return __async(this, null, function* () {
40335
+ try {
40336
+ const toolResponse = yield asyncExec(`${toolName} --version`);
40337
+ if (toolResponse.stderr) {
40338
+ throw new Error(toolResponse.stderr);
40339
+ }
40340
+ try {
40341
+ const versionMatch = toolResponse.stdout.match(/(\d+\.\d+\.\d+)/);
40342
+ if (versionMatch) {
40343
+ return versionMatch[1];
40344
+ }
40345
+ } catch (err) {
40346
+ throw new Error(`Could not parse ${toolName} version.`);
40347
+ }
40348
+ } catch (error) {
40349
+ throw new Error(`Error getting ${toolName} version.`);
40350
+ }
40351
+ return "";
40352
+ });
40353
+ }
37843
40354
  function listDockerContainers() {
37844
40355
  return __async(this, null, function* () {
37845
40356
  try {
@@ -37892,23 +40403,38 @@ function removeDockerImage(imageName) {
37892
40403
  });
37893
40404
  }
37894
40405
 
40406
+ // src/lib/errors/versionRequired.ts
40407
+ var VersionRequiredError = class extends Error {
40408
+ constructor(tool, requiredVersion) {
40409
+ super(`${tool} version ${requiredVersion} or higher is required. Please update ${tool}.`);
40410
+ __publicField(this, "tool");
40411
+ this.name = "VersionRequired";
40412
+ this.tool = tool;
40413
+ }
40414
+ };
40415
+
37895
40416
  // src/lib/services/simulator.ts
37896
40417
  function sleep(millliseconds) {
37897
40418
  return new Promise((resolve) => setTimeout(resolve, millliseconds));
37898
40419
  }
37899
40420
  var SimulatorService = class {
40421
+ constructor() {
40422
+ __publicField(this, "simulatorLocation");
40423
+ this.simulatorLocation = "";
40424
+ }
40425
+ setSimulatorLocation(location) {
40426
+ this.simulatorLocation = location;
40427
+ }
37900
40428
  getSimulatorLocation() {
37901
- return path2.join(getHomeDirectory(), "genlayer-simulator");
40429
+ return this.simulatorLocation;
37902
40430
  }
37903
40431
  readEnvConfigValue(key) {
37904
- const simulatorLocation = this.getSimulatorLocation();
37905
- const envFilePath = path2.join(simulatorLocation, ".env");
40432
+ const envFilePath = path2.join(this.simulatorLocation, ".env");
37906
40433
  const envConfig = dotenv.parse(fs5.readFileSync(envFilePath, "utf8"));
37907
40434
  return envConfig[key];
37908
40435
  }
37909
40436
  addConfigToEnvFile(newConfig) {
37910
- const simulatorLocation = this.getSimulatorLocation();
37911
- const envFilePath = path2.join(simulatorLocation, ".env");
40437
+ const envFilePath = path2.join(this.simulatorLocation, ".env");
37912
40438
  fs5.writeFileSync(`${envFilePath}.bak`, fs5.readFileSync(envFilePath));
37913
40439
  const envConfig = dotenv.parse(fs5.readFileSync(envFilePath, "utf8"));
37914
40440
  Object.keys(newConfig).forEach((key) => {
@@ -37919,7 +40445,7 @@ var SimulatorService = class {
37919
40445
  }).join("\n");
37920
40446
  fs5.writeFileSync(envFilePath, updatedConfig);
37921
40447
  }
37922
- checkRequirements() {
40448
+ checkInstallRequirements() {
37923
40449
  return __async(this, null, function* () {
37924
40450
  const requirementsInstalled = {
37925
40451
  git: false,
@@ -37951,15 +40477,47 @@ var SimulatorService = class {
37951
40477
  return requirementsInstalled;
37952
40478
  });
37953
40479
  }
40480
+ checkVersionRequirements() {
40481
+ return __async(this, null, function* () {
40482
+ const missingVersions = {
40483
+ docker: "",
40484
+ node: ""
40485
+ };
40486
+ try {
40487
+ yield this.checkVersion(VERSION_REQUIREMENTS.node, "node");
40488
+ } catch (error) {
40489
+ missingVersions.node = VERSION_REQUIREMENTS.node;
40490
+ if (!(error instanceof VersionRequiredError)) {
40491
+ throw error;
40492
+ }
40493
+ }
40494
+ try {
40495
+ yield this.checkVersion(VERSION_REQUIREMENTS.docker, "docker");
40496
+ } catch (error) {
40497
+ missingVersions.docker = VERSION_REQUIREMENTS.docker;
40498
+ if (!(error instanceof VersionRequiredError)) {
40499
+ throw error;
40500
+ }
40501
+ }
40502
+ return missingVersions;
40503
+ });
40504
+ }
40505
+ checkVersion(minVersion, toolName) {
40506
+ return __async(this, null, function* () {
40507
+ const version2 = yield getVersion(toolName);
40508
+ if (!semver.satisfies(version2, `>=${minVersion}`)) {
40509
+ throw new VersionRequiredError(toolName, minVersion);
40510
+ }
40511
+ });
40512
+ }
37954
40513
  downloadSimulator(branch = "main") {
37955
40514
  return __async(this, null, function* () {
37956
- const simulatorLocation = this.getSimulatorLocation();
37957
40515
  try {
37958
- const gitCommand = `git clone -b ${branch} ${DEFAULT_REPO_GH_URL} ${simulatorLocation}`;
40516
+ const gitCommand = `git clone -b ${branch} ${DEFAULT_REPO_GH_URL} ${this.simulatorLocation}`;
37959
40517
  const cmdsByPlatform = { darwin: gitCommand, win32: gitCommand, linux: gitCommand };
37960
40518
  yield executeCommand(cmdsByPlatform, "git");
37961
40519
  } catch (error) {
37962
- const simulatorLocationExists = fs5.existsSync(simulatorLocation);
40520
+ const simulatorLocationExists = fs5.existsSync(this.simulatorLocation);
37963
40521
  if (simulatorLocationExists) {
37964
40522
  return { wasInstalled: true };
37965
40523
  }
@@ -37970,21 +40528,20 @@ var SimulatorService = class {
37970
40528
  }
37971
40529
  updateSimulator(branch = "main") {
37972
40530
  return __async(this, null, function* () {
37973
- const simulatorLocation = this.getSimulatorLocation();
37974
- const gitCleanCommand = `git -C "${simulatorLocation}" clean -f`;
40531
+ const gitCleanCommand = `git -C "${this.simulatorLocation}" clean -f`;
37975
40532
  const cleanCmdsByPlatform = { darwin: gitCleanCommand, win32: gitCleanCommand, linux: gitCleanCommand };
37976
40533
  yield executeCommand(cleanCmdsByPlatform, "git");
37977
- const gitFetchCommand = `git -C "${simulatorLocation}" fetch`;
40534
+ const gitFetchCommand = `git -C "${this.simulatorLocation}" fetch`;
37978
40535
  const fetchCmdsByPlatform = { darwin: gitFetchCommand, win32: gitFetchCommand, linux: gitFetchCommand };
37979
40536
  yield executeCommand(fetchCmdsByPlatform, "git");
37980
- const gitCheckoutCommand = `git -C "${simulatorLocation}" checkout ${branch}`;
40537
+ const gitCheckoutCommand = `git -C "${this.simulatorLocation}" checkout ${branch}`;
37981
40538
  const checkoutCmdsByPlatform = {
37982
40539
  darwin: gitCheckoutCommand,
37983
40540
  win32: gitCheckoutCommand,
37984
40541
  linux: gitCheckoutCommand
37985
40542
  };
37986
40543
  yield executeCommand(checkoutCmdsByPlatform, "git");
37987
- const gitPullCommand = `git -C "${simulatorLocation}" pull`;
40544
+ const gitPullCommand = `git -C "${this.simulatorLocation}" pull`;
37988
40545
  const pullCmdsByPlatform = { darwin: gitPullCommand, win32: gitPullCommand, linux: gitPullCommand };
37989
40546
  yield executeCommand(pullCmdsByPlatform, "git");
37990
40547
  return true;
@@ -37992,25 +40549,22 @@ var SimulatorService = class {
37992
40549
  }
37993
40550
  pullOllamaModel() {
37994
40551
  return __async(this, null, function* () {
37995
- const simulatorLocation = this.getSimulatorLocation();
37996
- const cmdsByPlatform = DEFAULT_PULL_OLLAMA_COMMAND(simulatorLocation);
40552
+ const cmdsByPlatform = DEFAULT_PULL_OLLAMA_COMMAND(this.simulatorLocation);
37997
40553
  yield executeCommand(cmdsByPlatform);
37998
40554
  return true;
37999
40555
  });
38000
40556
  }
38001
40557
  configSimulator(newConfig) {
38002
40558
  return __async(this, null, function* () {
38003
- const simulatorLocation = this.getSimulatorLocation();
38004
- const envExample = path2.join(simulatorLocation, ".env.example");
38005
- const envFilePath = path2.join(simulatorLocation, ".env");
40559
+ const envExample = path2.join(this.simulatorLocation, ".env.example");
40560
+ const envFilePath = path2.join(this.simulatorLocation, ".env");
38006
40561
  fs5.copyFileSync(envExample, envFilePath);
38007
40562
  this.addConfigToEnvFile(newConfig);
38008
40563
  return true;
38009
40564
  });
38010
40565
  }
38011
40566
  runSimulator() {
38012
- const simulatorLocation = this.getSimulatorLocation();
38013
- const commandsByPlatform = DEFAULT_RUN_SIMULATOR_COMMAND(simulatorLocation);
40567
+ const commandsByPlatform = DEFAULT_RUN_SIMULATOR_COMMAND(this.simulatorLocation);
38014
40568
  return executeCommand(commandsByPlatform);
38015
40569
  }
38016
40570
  waitForSimulatorToBeReady() {
@@ -38018,7 +40572,7 @@ var SimulatorService = class {
38018
40572
  console.log("Waiting for the simulator to start up...");
38019
40573
  try {
38020
40574
  const response = yield rpcClient.request({ method: "ping", params: [] });
38021
- if (response && (response.result === "OK" || response.result.status === "OK" || response.result.data.status === "OK")) {
40575
+ if (response && (response.result.status === "OK" || response.result.data.status === "OK")) {
38022
40576
  return { initialized: true };
38023
40577
  }
38024
40578
  if (retries > 0) {
@@ -40691,16 +43245,37 @@ function getRequirementsErrorMessage({ git, docker }) {
40691
43245
  }
40692
43246
  return "";
40693
43247
  }
43248
+ function getVersionErrorMessage({ docker, node }) {
43249
+ let message = "";
43250
+ if (docker) {
43251
+ message += `Docker version ${docker} or higher is required. Please update Docker and try again.
43252
+ `;
43253
+ }
43254
+ if (node) {
43255
+ message += `Node version ${node} or higher is required. Please update Node and try again.
43256
+ `;
43257
+ }
43258
+ return message;
43259
+ }
40694
43260
  function initAction(options, simulatorService) {
40695
43261
  return __async(this, null, function* () {
43262
+ simulatorService.setSimulatorLocation(options.location);
40696
43263
  try {
40697
- const { git, docker } = yield simulatorService.checkRequirements();
40698
- const errorMessage = getRequirementsErrorMessage({ git, docker });
40699
- if (errorMessage) {
40700
- console.log(
40701
- "There was a problem running the docker service. Please start the docker service and try again."
40702
- );
40703
- console.error(errorMessage);
43264
+ const requirementsInstalled = yield simulatorService.checkInstallRequirements();
43265
+ const requirementErrorMessage = getRequirementsErrorMessage(requirementsInstalled);
43266
+ if (requirementErrorMessage) {
43267
+ console.error(requirementErrorMessage);
43268
+ return;
43269
+ }
43270
+ } catch (error) {
43271
+ console.error(error);
43272
+ return;
43273
+ }
43274
+ try {
43275
+ const missingVersions = yield simulatorService.checkVersionRequirements();
43276
+ const versionErrorMessage = getVersionErrorMessage(missingVersions);
43277
+ if (versionErrorMessage) {
43278
+ console.error(versionErrorMessage);
40704
43279
  return;
40705
43280
  }
40706
43281
  } catch (error) {
@@ -40848,7 +43423,8 @@ function initAction(options, simulatorService) {
40848
43423
  // src/commands/general/start.ts
40849
43424
  function startAction(options, simulatorService) {
40850
43425
  return __async(this, null, function* () {
40851
- const { resetValidators, numValidators, branch } = options;
43426
+ const { resetValidators, numValidators, branch, location } = options;
43427
+ simulatorService.setSimulatorLocation(location);
40852
43428
  const restartValidatorsHintText = resetValidators ? `creating new ${numValidators} random validators` : "keeping the existing validators";
40853
43429
  console.log(`Starting GenLayer simulator ${restartValidatorsHintText}`);
40854
43430
  console.log(`Updating GenLayer Simulator...`);
@@ -40917,7 +43493,7 @@ function startAction(options, simulatorService) {
40917
43493
  `GenLayer simulator initialized successfully! Go to ${simulatorService.getFrontendUrl()} in your browser to access it.`
40918
43494
  );
40919
43495
  try {
40920
- simulatorService.openFrontend();
43496
+ yield simulatorService.openFrontend();
40921
43497
  } catch (error) {
40922
43498
  console.error(error);
40923
43499
  }
@@ -40926,8 +43502,8 @@ function startAction(options, simulatorService) {
40926
43502
 
40927
43503
  // src/commands/general/index.ts
40928
43504
  function initializeGeneralCommands(program2) {
40929
- program2.command("init").description("Initialize the GenLayer Environment").option("--numValidators <numValidators>", "Number of validators", "5").option("--branch <branch>", "Branch", "main").action((options) => initAction(options, simulator_default));
40930
- program2.command("up").description("Starts GenLayer's simulator").option("--reset-validators", "Remove all current validators and create new random ones", false).option("--numValidators <numValidators>", "Number of validators", "5").option("--branch <branch>", "Branch", "main").action((options) => startAction(options, simulator_default));
43505
+ program2.command("init").description("Initialize the GenLayer Environment").option("--numValidators <numValidators>", "Number of validators", "5").option("--branch <branch>", "Branch", "main").option("--location <folder>", "Location where it will be installed", process.cwd()).action((options) => initAction(options, simulator_default));
43506
+ program2.command("up").description("Starts GenLayer's simulator").option("--reset-validators", "Remove all current validators and create new random ones", false).option("--numValidators <numValidators>", "Number of validators", "5").option("--branch <branch>", "Branch", "main").option("--location <folder>", "Location where it will be installed", process.cwd()).action((options) => startAction(options, simulator_default));
40931
43507
  return program2;
40932
43508
  }
40933
43509