drizzle-kit 0.20.4-5bb2ccb → 0.20.4-7ffdcd8

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/bin.cjs CHANGED
@@ -4474,14 +4474,14 @@ Is ${source_default.bold.blue(
4474
4474
  this.requestLayout();
4475
4475
  }
4476
4476
  render() {
4477
- let info2 = "";
4477
+ let info3 = "";
4478
4478
  const spin = this.spinner.value();
4479
- info2 += this.statusText(spin, this.state.tables);
4480
- info2 += this.statusText(spin, this.state.columns);
4481
- info2 += this.statusText(spin, this.state.enums);
4482
- info2 += this.statusText(spin, this.state.indexes);
4483
- info2 += this.statusText(spin, this.state.fks);
4484
- return info2;
4479
+ info3 += this.statusText(spin, this.state.tables);
4480
+ info3 += this.statusText(spin, this.state.columns);
4481
+ info3 += this.statusText(spin, this.state.enums);
4482
+ info3 += this.statusText(spin, this.state.indexes);
4483
+ info3 += this.statusText(spin, this.state.fks);
4484
+ return info3;
4485
4485
  }
4486
4486
  };
4487
4487
  DropMigrationView = class extends import_hanji.Prompt {
@@ -8656,13 +8656,13 @@ var require_node2 = __commonJS({
8656
8656
  }
8657
8657
  function asyncGeneratorStep(gen, resolve2, reject, _next, _throw, key, arg) {
8658
8658
  try {
8659
- var info2 = gen[key](arg);
8660
- var value = info2.value;
8659
+ var info3 = gen[key](arg);
8660
+ var value = info3.value;
8661
8661
  } catch (error2) {
8662
8662
  reject(error2);
8663
8663
  return;
8664
8664
  }
8665
- if (info2.done) {
8665
+ if (info3.done) {
8666
8666
  resolve2(value);
8667
8667
  } else {
8668
8668
  Promise.resolve(value).then(_next, _throw);
@@ -9380,7 +9380,7 @@ var require_node2 = __commonJS({
9380
9380
  return /[0-9A-Fa-f]/.test(c);
9381
9381
  }
9382
9382
  });
9383
- var require_parse3 = __commonJS2((exports2, module22) => {
9383
+ var require_parse4 = __commonJS2((exports2, module22) => {
9384
9384
  "use strict";
9385
9385
  Object.defineProperty(exports2, "__esModule", { value: true });
9386
9386
  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
@@ -10463,7 +10463,7 @@ var require_node2 = __commonJS({
10463
10463
  var require_lib32 = __commonJS2((exports2, module22) => {
10464
10464
  "use strict";
10465
10465
  Object.defineProperty(exports2, "__esModule", { value: true });
10466
- var _parse = require_parse3();
10466
+ var _parse = require_parse4();
10467
10467
  var _parse2 = _interopRequireDefault(_parse);
10468
10468
  var _stringify = require_stringify3();
10469
10469
  var _stringify2 = _interopRequireDefault(_stringify);
@@ -13310,6 +13310,7 @@ var init_serializer = __esm({
13310
13310
  import_path2 = __toESM(require("path"));
13311
13311
  glob = __toESM(require("glob"));
13312
13312
  init_source();
13313
+ init_views();
13313
13314
  sqlToStr = (sql2) => {
13314
13315
  return sql2.toQuery({
13315
13316
  escapeName: () => {
@@ -13360,7 +13361,16 @@ ${filenames.join("\n")}
13360
13361
  });
13361
13362
  return result2;
13362
13363
  }, /* @__PURE__ */ new Set());
13363
- return [...result];
13364
+ const res = [...result];
13365
+ const errors = res.filter((it) => {
13366
+ return !(it.endsWith(".ts") || it.endsWith(".js") || it.endsWith(".cjs") || it.endsWith(".mjs") || it.endsWith(".mts") || it.endsWith(".cts"));
13367
+ });
13368
+ if (res.length === 0) {
13369
+ console.log(error(`No schema files found for path [${path4.join(", ")}]`));
13370
+ console.log(error(`If path represents a file - please make sure to use .ts or other extension in the path`));
13371
+ process.exit(1);
13372
+ }
13373
+ return res;
13364
13374
  };
13365
13375
  }
13366
13376
  });
@@ -19040,7 +19050,7 @@ var init_introspect_pg = __esm({
19040
19050
  const file = importsTs + decalrations;
19041
19051
  const schemaEntry = `
19042
19052
  {
19043
- ${Object.values(schema4.tables).map((it) => withCasing(it.name)).join(",")}
19053
+ ${Object.values(schema4.tables).map((it) => withCasing(it.name, casing)).join(",\n")}
19044
19054
  }
19045
19055
  `;
19046
19056
  return { file, imports: importsTs, decalrations, schemaEntry };
@@ -25853,7 +25863,7 @@ var init_introspect_sqlite = __esm({
25853
25863
  ];
25854
25864
  const importsTs = `import { ${uniqueSqliteImports.join(
25855
25865
  ", "
25856
- )} } from "drizzle-orm/pg-core"
25866
+ )} } from "drizzle-orm/sqlite-core"
25857
25867
  import { sql } from "drizzle-orm"
25858
25868
 
25859
25869
  `;
@@ -25861,7 +25871,7 @@ var init_introspect_sqlite = __esm({
25861
25871
  const file = importsTs + decalrations;
25862
25872
  const schemaEntry = `
25863
25873
  {
25864
- ${Object.values(schema4.tables).map((it) => withCasing2(it.name)).join(",")}
25874
+ ${Object.values(schema4.tables).map((it) => withCasing2(it.name, casing)).join(",")}
25865
25875
  }
25866
25876
  `;
25867
25877
  return { file, imports: importsTs, decalrations, schemaEntry };
@@ -26118,669 +26128,823 @@ var init_sqliteIntrospect = __esm({
26118
26128
  }
26119
26129
  });
26120
26130
 
26121
- // src/cli/utils.ts
26122
- var assertPackages, requiredApiVersion, assertOrmCoreVersion, ormCoreVersions;
26123
- var init_utils3 = __esm({
26124
- "src/cli/utils.ts"() {
26125
- init_views();
26126
- assertPackages = async (...pkgs) => {
26127
- try {
26128
- for (let i = 0; i < pkgs.length; i++) {
26129
- const it = pkgs[i];
26130
- await import(it);
26131
- }
26132
- } catch (e) {
26133
- err(
26134
- `please install required packages: ${pkgs.map((it) => `'${it}'`).join(" ")}`
26135
- );
26136
- process.exit(1);
26137
- }
26131
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/constants.js
26132
+ var require_constants = __commonJS({
26133
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/constants.js"(exports, module2) {
26134
+ var SEMVER_SPEC_VERSION = "2.0.0";
26135
+ var MAX_LENGTH = 256;
26136
+ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
26137
+ 9007199254740991;
26138
+ var MAX_SAFE_COMPONENT_LENGTH = 16;
26139
+ var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
26140
+ var RELEASE_TYPES = [
26141
+ "major",
26142
+ "premajor",
26143
+ "minor",
26144
+ "preminor",
26145
+ "patch",
26146
+ "prepatch",
26147
+ "prerelease"
26148
+ ];
26149
+ module2.exports = {
26150
+ MAX_LENGTH,
26151
+ MAX_SAFE_COMPONENT_LENGTH,
26152
+ MAX_SAFE_BUILD_LENGTH,
26153
+ MAX_SAFE_INTEGER,
26154
+ RELEASE_TYPES,
26155
+ SEMVER_SPEC_VERSION,
26156
+ FLAG_INCLUDE_PRERELEASE: 1,
26157
+ FLAG_LOOSE: 2
26138
26158
  };
26139
- requiredApiVersion = 6;
26140
- assertOrmCoreVersion = async () => {
26141
- try {
26142
- const { compatibilityVersion } = await import("drizzle-orm/version");
26143
- if (compatibilityVersion && compatibilityVersion === requiredApiVersion)
26144
- return;
26145
- if (!compatibilityVersion || compatibilityVersion < requiredApiVersion) {
26146
- console.log(
26147
- "This version of drizzle-kit requires newer version of drizzle-orm\nPlease update drizzle-orm package to the latest version \u{1F44D}"
26148
- );
26149
- } else {
26150
- console.log(
26151
- "This version of drizzle-kit is outdated\nPlease update drizzle-kit package to the latest version \u{1F44D}"
26152
- );
26153
- }
26154
- } catch (e) {
26155
- console.log("Please install latest version of drizzle-orm");
26159
+ }
26160
+ });
26161
+
26162
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/debug.js
26163
+ var require_debug = __commonJS({
26164
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/debug.js"(exports, module2) {
26165
+ var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
26166
+ };
26167
+ module2.exports = debug;
26168
+ }
26169
+ });
26170
+
26171
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/re.js
26172
+ var require_re = __commonJS({
26173
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/re.js"(exports, module2) {
26174
+ var {
26175
+ MAX_SAFE_COMPONENT_LENGTH,
26176
+ MAX_SAFE_BUILD_LENGTH,
26177
+ MAX_LENGTH
26178
+ } = require_constants();
26179
+ var debug = require_debug();
26180
+ exports = module2.exports = {};
26181
+ var re = exports.re = [];
26182
+ var safeRe = exports.safeRe = [];
26183
+ var src = exports.src = [];
26184
+ var t = exports.t = {};
26185
+ var R = 0;
26186
+ var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
26187
+ var safeRegexReplacements = [
26188
+ ["\\s", 1],
26189
+ ["\\d", MAX_LENGTH],
26190
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
26191
+ ];
26192
+ var makeSafeRegex = (value) => {
26193
+ for (const [token, max] of safeRegexReplacements) {
26194
+ value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
26156
26195
  }
26157
- process.exit(1);
26196
+ return value;
26158
26197
  };
26159
- ormCoreVersions = async () => {
26160
- try {
26161
- const { compatibilityVersion, npmVersion } = await import("drizzle-orm/version");
26162
- return { compatibilityVersion, npmVersion };
26163
- } catch (e) {
26164
- return {};
26198
+ var createToken = (name, value, isGlobal) => {
26199
+ const safe = makeSafeRegex(value);
26200
+ const index4 = R++;
26201
+ debug(name, index4, value);
26202
+ t[name] = index4;
26203
+ src[index4] = value;
26204
+ re[index4] = new RegExp(value, isGlobal ? "g" : void 0);
26205
+ safeRe[index4] = new RegExp(safe, isGlobal ? "g" : void 0);
26206
+ };
26207
+ createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
26208
+ createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
26209
+ createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
26210
+ createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
26211
+ createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
26212
+ createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);
26213
+ createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);
26214
+ createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
26215
+ createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
26216
+ createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
26217
+ createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
26218
+ createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
26219
+ createToken("FULL", `^${src[t.FULLPLAIN]}$`);
26220
+ createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
26221
+ createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
26222
+ createToken("GTLT", "((?:<|>)?=?)");
26223
+ createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
26224
+ createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
26225
+ createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
26226
+ createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
26227
+ createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
26228
+ createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
26229
+ createToken("COERCE", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:$|[^\\d])`);
26230
+ createToken("COERCERTL", src[t.COERCE], true);
26231
+ createToken("LONETILDE", "(?:~>?)");
26232
+ createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
26233
+ exports.tildeTrimReplace = "$1~";
26234
+ createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
26235
+ createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
26236
+ createToken("LONECARET", "(?:\\^)");
26237
+ createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
26238
+ exports.caretTrimReplace = "$1^";
26239
+ createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
26240
+ createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
26241
+ createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
26242
+ createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
26243
+ createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
26244
+ exports.comparatorTrimReplace = "$1$2$3";
26245
+ createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
26246
+ createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
26247
+ createToken("STAR", "(<|>)?=?\\s*\\*");
26248
+ createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
26249
+ createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
26250
+ }
26251
+ });
26252
+
26253
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/parse-options.js
26254
+ var require_parse_options = __commonJS({
26255
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/parse-options.js"(exports, module2) {
26256
+ var looseOption = Object.freeze({ loose: true });
26257
+ var emptyOpts = Object.freeze({});
26258
+ var parseOptions = (options) => {
26259
+ if (!options) {
26260
+ return emptyOpts;
26261
+ }
26262
+ if (typeof options !== "object") {
26263
+ return looseOption;
26165
26264
  }
26265
+ return options;
26166
26266
  };
26267
+ module2.exports = parseOptions;
26167
26268
  }
26168
26269
  });
26169
26270
 
26170
- // node_modules/.pnpm/sqlstring@2.3.3/node_modules/sqlstring/lib/SqlString.js
26171
- var require_SqlString = __commonJS({
26172
- "node_modules/.pnpm/sqlstring@2.3.3/node_modules/sqlstring/lib/SqlString.js"(exports) {
26173
- var SqlString = exports;
26174
- var ID_GLOBAL_REGEXP = /`/g;
26175
- var QUAL_GLOBAL_REGEXP = /\./g;
26176
- var CHARS_GLOBAL_REGEXP = /[\0\b\t\n\r\x1a\"\'\\]/g;
26177
- var CHARS_ESCAPE_MAP = {
26178
- "\0": "\\0",
26179
- "\b": "\\b",
26180
- " ": "\\t",
26181
- "\n": "\\n",
26182
- "\r": "\\r",
26183
- "": "\\Z",
26184
- '"': '\\"',
26185
- "'": "\\'",
26186
- "\\": "\\\\"
26187
- };
26188
- SqlString.escapeId = function escapeId(val, forbidQualified) {
26189
- if (Array.isArray(val)) {
26190
- var sql2 = "";
26191
- for (var i = 0; i < val.length; i++) {
26192
- sql2 += (i === 0 ? "" : ", ") + SqlString.escapeId(val[i], forbidQualified);
26193
- }
26194
- return sql2;
26195
- } else if (forbidQualified) {
26196
- return "`" + String(val).replace(ID_GLOBAL_REGEXP, "``") + "`";
26197
- } else {
26198
- return "`" + String(val).replace(ID_GLOBAL_REGEXP, "``").replace(QUAL_GLOBAL_REGEXP, "`.`") + "`";
26271
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/identifiers.js
26272
+ var require_identifiers = __commonJS({
26273
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/identifiers.js"(exports, module2) {
26274
+ var numeric = /^[0-9]+$/;
26275
+ var compareIdentifiers = (a, b) => {
26276
+ const anum = numeric.test(a);
26277
+ const bnum = numeric.test(b);
26278
+ if (anum && bnum) {
26279
+ a = +a;
26280
+ b = +b;
26199
26281
  }
26282
+ return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
26200
26283
  };
26201
- SqlString.escape = function escape2(val, stringifyObjects, timeZone) {
26202
- if (val === void 0 || val === null) {
26203
- return "NULL";
26204
- }
26205
- switch (typeof val) {
26206
- case "boolean":
26207
- return val ? "true" : "false";
26208
- case "number":
26209
- return val + "";
26210
- case "object":
26211
- if (Object.prototype.toString.call(val) === "[object Date]") {
26212
- return SqlString.dateToString(val, timeZone || "local");
26213
- } else if (Array.isArray(val)) {
26214
- return SqlString.arrayToList(val, timeZone);
26215
- } else if (Buffer.isBuffer(val)) {
26216
- return SqlString.bufferToString(val);
26217
- } else if (typeof val.toSqlString === "function") {
26218
- return String(val.toSqlString());
26219
- } else if (stringifyObjects) {
26220
- return escapeString(val.toString());
26284
+ var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
26285
+ module2.exports = {
26286
+ compareIdentifiers,
26287
+ rcompareIdentifiers
26288
+ };
26289
+ }
26290
+ });
26291
+
26292
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/semver.js
26293
+ var require_semver = __commonJS({
26294
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/semver.js"(exports, module2) {
26295
+ var debug = require_debug();
26296
+ var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
26297
+ var { safeRe: re, t } = require_re();
26298
+ var parseOptions = require_parse_options();
26299
+ var { compareIdentifiers } = require_identifiers();
26300
+ var SemVer = class _SemVer {
26301
+ constructor(version, options) {
26302
+ options = parseOptions(options);
26303
+ if (version instanceof _SemVer) {
26304
+ if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
26305
+ return version;
26221
26306
  } else {
26222
- return SqlString.objectToValues(val, timeZone);
26307
+ version = version.version;
26223
26308
  }
26224
- default:
26225
- return escapeString(val);
26226
- }
26227
- };
26228
- SqlString.arrayToList = function arrayToList(array, timeZone) {
26229
- var sql2 = "";
26230
- for (var i = 0; i < array.length; i++) {
26231
- var val = array[i];
26232
- if (Array.isArray(val)) {
26233
- sql2 += (i === 0 ? "" : ", ") + "(" + SqlString.arrayToList(val, timeZone) + ")";
26309
+ } else if (typeof version !== "string") {
26310
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
26311
+ }
26312
+ if (version.length > MAX_LENGTH) {
26313
+ throw new TypeError(
26314
+ `version is longer than ${MAX_LENGTH} characters`
26315
+ );
26316
+ }
26317
+ debug("SemVer", version, options);
26318
+ this.options = options;
26319
+ this.loose = !!options.loose;
26320
+ this.includePrerelease = !!options.includePrerelease;
26321
+ const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
26322
+ if (!m) {
26323
+ throw new TypeError(`Invalid Version: ${version}`);
26324
+ }
26325
+ this.raw = version;
26326
+ this.major = +m[1];
26327
+ this.minor = +m[2];
26328
+ this.patch = +m[3];
26329
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
26330
+ throw new TypeError("Invalid major version");
26331
+ }
26332
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
26333
+ throw new TypeError("Invalid minor version");
26334
+ }
26335
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
26336
+ throw new TypeError("Invalid patch version");
26337
+ }
26338
+ if (!m[4]) {
26339
+ this.prerelease = [];
26234
26340
  } else {
26235
- sql2 += (i === 0 ? "" : ", ") + SqlString.escape(val, true, timeZone);
26341
+ this.prerelease = m[4].split(".").map((id) => {
26342
+ if (/^[0-9]+$/.test(id)) {
26343
+ const num = +id;
26344
+ if (num >= 0 && num < MAX_SAFE_INTEGER) {
26345
+ return num;
26346
+ }
26347
+ }
26348
+ return id;
26349
+ });
26236
26350
  }
26351
+ this.build = m[5] ? m[5].split(".") : [];
26352
+ this.format();
26237
26353
  }
26238
- return sql2;
26239
- };
26240
- SqlString.format = function format(sql2, values, stringifyObjects, timeZone) {
26241
- if (values == null) {
26242
- return sql2;
26354
+ format() {
26355
+ this.version = `${this.major}.${this.minor}.${this.patch}`;
26356
+ if (this.prerelease.length) {
26357
+ this.version += `-${this.prerelease.join(".")}`;
26358
+ }
26359
+ return this.version;
26243
26360
  }
26244
- if (!Array.isArray(values)) {
26245
- values = [values];
26361
+ toString() {
26362
+ return this.version;
26246
26363
  }
26247
- var chunkIndex = 0;
26248
- var placeholdersRegex = /\?+/g;
26249
- var result = "";
26250
- var valuesIndex = 0;
26251
- var match2;
26252
- while (valuesIndex < values.length && (match2 = placeholdersRegex.exec(sql2))) {
26253
- var len = match2[0].length;
26254
- if (len > 2) {
26255
- continue;
26364
+ compare(other) {
26365
+ debug("SemVer.compare", this.version, this.options, other);
26366
+ if (!(other instanceof _SemVer)) {
26367
+ if (typeof other === "string" && other === this.version) {
26368
+ return 0;
26369
+ }
26370
+ other = new _SemVer(other, this.options);
26256
26371
  }
26257
- var value = len === 2 ? SqlString.escapeId(values[valuesIndex]) : SqlString.escape(values[valuesIndex], stringifyObjects, timeZone);
26258
- result += sql2.slice(chunkIndex, match2.index) + value;
26259
- chunkIndex = placeholdersRegex.lastIndex;
26260
- valuesIndex++;
26372
+ if (other.version === this.version) {
26373
+ return 0;
26374
+ }
26375
+ return this.compareMain(other) || this.comparePre(other);
26261
26376
  }
26262
- if (chunkIndex === 0) {
26263
- return sql2;
26377
+ compareMain(other) {
26378
+ if (!(other instanceof _SemVer)) {
26379
+ other = new _SemVer(other, this.options);
26380
+ }
26381
+ return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
26264
26382
  }
26265
- if (chunkIndex < sql2.length) {
26266
- return result + sql2.slice(chunkIndex);
26383
+ comparePre(other) {
26384
+ if (!(other instanceof _SemVer)) {
26385
+ other = new _SemVer(other, this.options);
26386
+ }
26387
+ if (this.prerelease.length && !other.prerelease.length) {
26388
+ return -1;
26389
+ } else if (!this.prerelease.length && other.prerelease.length) {
26390
+ return 1;
26391
+ } else if (!this.prerelease.length && !other.prerelease.length) {
26392
+ return 0;
26393
+ }
26394
+ let i = 0;
26395
+ do {
26396
+ const a = this.prerelease[i];
26397
+ const b = other.prerelease[i];
26398
+ debug("prerelease compare", i, a, b);
26399
+ if (a === void 0 && b === void 0) {
26400
+ return 0;
26401
+ } else if (b === void 0) {
26402
+ return 1;
26403
+ } else if (a === void 0) {
26404
+ return -1;
26405
+ } else if (a === b) {
26406
+ continue;
26407
+ } else {
26408
+ return compareIdentifiers(a, b);
26409
+ }
26410
+ } while (++i);
26411
+ }
26412
+ compareBuild(other) {
26413
+ if (!(other instanceof _SemVer)) {
26414
+ other = new _SemVer(other, this.options);
26415
+ }
26416
+ let i = 0;
26417
+ do {
26418
+ const a = this.build[i];
26419
+ const b = other.build[i];
26420
+ debug("prerelease compare", i, a, b);
26421
+ if (a === void 0 && b === void 0) {
26422
+ return 0;
26423
+ } else if (b === void 0) {
26424
+ return 1;
26425
+ } else if (a === void 0) {
26426
+ return -1;
26427
+ } else if (a === b) {
26428
+ continue;
26429
+ } else {
26430
+ return compareIdentifiers(a, b);
26431
+ }
26432
+ } while (++i);
26433
+ }
26434
+ // preminor will bump the version up to the next minor release, and immediately
26435
+ // down to pre-release. premajor and prepatch work the same way.
26436
+ inc(release, identifier, identifierBase) {
26437
+ switch (release) {
26438
+ case "premajor":
26439
+ this.prerelease.length = 0;
26440
+ this.patch = 0;
26441
+ this.minor = 0;
26442
+ this.major++;
26443
+ this.inc("pre", identifier, identifierBase);
26444
+ break;
26445
+ case "preminor":
26446
+ this.prerelease.length = 0;
26447
+ this.patch = 0;
26448
+ this.minor++;
26449
+ this.inc("pre", identifier, identifierBase);
26450
+ break;
26451
+ case "prepatch":
26452
+ this.prerelease.length = 0;
26453
+ this.inc("patch", identifier, identifierBase);
26454
+ this.inc("pre", identifier, identifierBase);
26455
+ break;
26456
+ case "prerelease":
26457
+ if (this.prerelease.length === 0) {
26458
+ this.inc("patch", identifier, identifierBase);
26459
+ }
26460
+ this.inc("pre", identifier, identifierBase);
26461
+ break;
26462
+ case "major":
26463
+ if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
26464
+ this.major++;
26465
+ }
26466
+ this.minor = 0;
26467
+ this.patch = 0;
26468
+ this.prerelease = [];
26469
+ break;
26470
+ case "minor":
26471
+ if (this.patch !== 0 || this.prerelease.length === 0) {
26472
+ this.minor++;
26473
+ }
26474
+ this.patch = 0;
26475
+ this.prerelease = [];
26476
+ break;
26477
+ case "patch":
26478
+ if (this.prerelease.length === 0) {
26479
+ this.patch++;
26480
+ }
26481
+ this.prerelease = [];
26482
+ break;
26483
+ case "pre": {
26484
+ const base = Number(identifierBase) ? 1 : 0;
26485
+ if (!identifier && identifierBase === false) {
26486
+ throw new Error("invalid increment argument: identifier is empty");
26487
+ }
26488
+ if (this.prerelease.length === 0) {
26489
+ this.prerelease = [base];
26490
+ } else {
26491
+ let i = this.prerelease.length;
26492
+ while (--i >= 0) {
26493
+ if (typeof this.prerelease[i] === "number") {
26494
+ this.prerelease[i]++;
26495
+ i = -2;
26496
+ }
26497
+ }
26498
+ if (i === -1) {
26499
+ if (identifier === this.prerelease.join(".") && identifierBase === false) {
26500
+ throw new Error("invalid increment argument: identifier already exists");
26501
+ }
26502
+ this.prerelease.push(base);
26503
+ }
26504
+ }
26505
+ if (identifier) {
26506
+ let prerelease = [identifier, base];
26507
+ if (identifierBase === false) {
26508
+ prerelease = [identifier];
26509
+ }
26510
+ if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
26511
+ if (isNaN(this.prerelease[1])) {
26512
+ this.prerelease = prerelease;
26513
+ }
26514
+ } else {
26515
+ this.prerelease = prerelease;
26516
+ }
26517
+ }
26518
+ break;
26519
+ }
26520
+ default:
26521
+ throw new Error(`invalid increment argument: ${release}`);
26522
+ }
26523
+ this.raw = this.format();
26524
+ if (this.build.length) {
26525
+ this.raw += `+${this.build.join(".")}`;
26526
+ }
26527
+ return this;
26267
26528
  }
26268
- return result;
26269
26529
  };
26270
- SqlString.dateToString = function dateToString(date, timeZone) {
26271
- var dt = new Date(date);
26272
- if (isNaN(dt.getTime())) {
26273
- return "NULL";
26530
+ module2.exports = SemVer;
26531
+ }
26532
+ });
26533
+
26534
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/parse.js
26535
+ var require_parse = __commonJS({
26536
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/parse.js"(exports, module2) {
26537
+ var SemVer = require_semver();
26538
+ var parse = (version, options, throwErrors = false) => {
26539
+ if (version instanceof SemVer) {
26540
+ return version;
26274
26541
  }
26275
- var year;
26276
- var month;
26277
- var day;
26278
- var hour;
26279
- var minute;
26280
- var second;
26281
- var millisecond;
26282
- if (timeZone === "local") {
26283
- year = dt.getFullYear();
26284
- month = dt.getMonth() + 1;
26285
- day = dt.getDate();
26286
- hour = dt.getHours();
26287
- minute = dt.getMinutes();
26288
- second = dt.getSeconds();
26289
- millisecond = dt.getMilliseconds();
26290
- } else {
26291
- var tz = convertTimezone(timeZone);
26292
- if (tz !== false && tz !== 0) {
26293
- dt.setTime(dt.getTime() + tz * 6e4);
26542
+ try {
26543
+ return new SemVer(version, options);
26544
+ } catch (er) {
26545
+ if (!throwErrors) {
26546
+ return null;
26294
26547
  }
26295
- year = dt.getUTCFullYear();
26296
- month = dt.getUTCMonth() + 1;
26297
- day = dt.getUTCDate();
26298
- hour = dt.getUTCHours();
26299
- minute = dt.getUTCMinutes();
26300
- second = dt.getUTCSeconds();
26301
- millisecond = dt.getUTCMilliseconds();
26548
+ throw er;
26302
26549
  }
26303
- var str = zeroPad(year, 4) + "-" + zeroPad(month, 2) + "-" + zeroPad(day, 2) + " " + zeroPad(hour, 2) + ":" + zeroPad(minute, 2) + ":" + zeroPad(second, 2) + "." + zeroPad(millisecond, 3);
26304
- return escapeString(str);
26305
26550
  };
26306
- SqlString.bufferToString = function bufferToString(buffer) {
26307
- return "X" + escapeString(buffer.toString("hex"));
26551
+ module2.exports = parse;
26552
+ }
26553
+ });
26554
+
26555
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/valid.js
26556
+ var require_valid = __commonJS({
26557
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/valid.js"(exports, module2) {
26558
+ var parse = require_parse();
26559
+ var valid = (version, options) => {
26560
+ const v = parse(version, options);
26561
+ return v ? v.version : null;
26308
26562
  };
26309
- SqlString.objectToValues = function objectToValues(object, timeZone) {
26310
- var sql2 = "";
26311
- for (var key in object) {
26312
- var val = object[key];
26313
- if (typeof val === "function") {
26314
- continue;
26315
- }
26316
- sql2 += (sql2.length === 0 ? "" : ", ") + SqlString.escapeId(key) + " = " + SqlString.escape(val, true, timeZone);
26563
+ module2.exports = valid;
26564
+ }
26565
+ });
26566
+
26567
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/clean.js
26568
+ var require_clean = __commonJS({
26569
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/clean.js"(exports, module2) {
26570
+ var parse = require_parse();
26571
+ var clean = (version, options) => {
26572
+ const s = parse(version.trim().replace(/^[=v]+/, ""), options);
26573
+ return s ? s.version : null;
26574
+ };
26575
+ module2.exports = clean;
26576
+ }
26577
+ });
26578
+
26579
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/inc.js
26580
+ var require_inc = __commonJS({
26581
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/inc.js"(exports, module2) {
26582
+ var SemVer = require_semver();
26583
+ var inc = (version, release, options, identifier, identifierBase) => {
26584
+ if (typeof options === "string") {
26585
+ identifierBase = identifier;
26586
+ identifier = options;
26587
+ options = void 0;
26588
+ }
26589
+ try {
26590
+ return new SemVer(
26591
+ version instanceof SemVer ? version.version : version,
26592
+ options
26593
+ ).inc(release, identifier, identifierBase).version;
26594
+ } catch (er) {
26595
+ return null;
26317
26596
  }
26318
- return sql2;
26319
26597
  };
26320
- SqlString.raw = function raw(sql2) {
26321
- if (typeof sql2 !== "string") {
26322
- throw new TypeError("argument sql must be a string");
26598
+ module2.exports = inc;
26599
+ }
26600
+ });
26601
+
26602
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/diff.js
26603
+ var require_diff = __commonJS({
26604
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/diff.js"(exports, module2) {
26605
+ var parse = require_parse();
26606
+ var diff2 = (version1, version2) => {
26607
+ const v1 = parse(version1, null, true);
26608
+ const v2 = parse(version2, null, true);
26609
+ const comparison = v1.compare(v2);
26610
+ if (comparison === 0) {
26611
+ return null;
26323
26612
  }
26324
- return {
26325
- toSqlString: function toSqlString() {
26326
- return sql2;
26613
+ const v1Higher = comparison > 0;
26614
+ const highVersion = v1Higher ? v1 : v2;
26615
+ const lowVersion = v1Higher ? v2 : v1;
26616
+ const highHasPre = !!highVersion.prerelease.length;
26617
+ const lowHasPre = !!lowVersion.prerelease.length;
26618
+ if (lowHasPre && !highHasPre) {
26619
+ if (!lowVersion.patch && !lowVersion.minor) {
26620
+ return "major";
26327
26621
  }
26328
- };
26622
+ if (highVersion.patch) {
26623
+ return "patch";
26624
+ }
26625
+ if (highVersion.minor) {
26626
+ return "minor";
26627
+ }
26628
+ return "major";
26629
+ }
26630
+ const prefix = highHasPre ? "pre" : "";
26631
+ if (v1.major !== v2.major) {
26632
+ return prefix + "major";
26633
+ }
26634
+ if (v1.minor !== v2.minor) {
26635
+ return prefix + "minor";
26636
+ }
26637
+ if (v1.patch !== v2.patch) {
26638
+ return prefix + "patch";
26639
+ }
26640
+ return "prerelease";
26329
26641
  };
26330
- function escapeString(val) {
26331
- var chunkIndex = CHARS_GLOBAL_REGEXP.lastIndex = 0;
26332
- var escapedVal = "";
26333
- var match2;
26334
- while (match2 = CHARS_GLOBAL_REGEXP.exec(val)) {
26335
- escapedVal += val.slice(chunkIndex, match2.index) + CHARS_ESCAPE_MAP[match2[0]];
26336
- chunkIndex = CHARS_GLOBAL_REGEXP.lastIndex;
26642
+ module2.exports = diff2;
26643
+ }
26644
+ });
26645
+
26646
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/major.js
26647
+ var require_major = __commonJS({
26648
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/major.js"(exports, module2) {
26649
+ var SemVer = require_semver();
26650
+ var major = (a, loose) => new SemVer(a, loose).major;
26651
+ module2.exports = major;
26652
+ }
26653
+ });
26654
+
26655
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/minor.js
26656
+ var require_minor = __commonJS({
26657
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/minor.js"(exports, module2) {
26658
+ var SemVer = require_semver();
26659
+ var minor = (a, loose) => new SemVer(a, loose).minor;
26660
+ module2.exports = minor;
26661
+ }
26662
+ });
26663
+
26664
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/patch.js
26665
+ var require_patch = __commonJS({
26666
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/patch.js"(exports, module2) {
26667
+ var SemVer = require_semver();
26668
+ var patch = (a, loose) => new SemVer(a, loose).patch;
26669
+ module2.exports = patch;
26670
+ }
26671
+ });
26672
+
26673
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/prerelease.js
26674
+ var require_prerelease = __commonJS({
26675
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/prerelease.js"(exports, module2) {
26676
+ var parse = require_parse();
26677
+ var prerelease = (version, options) => {
26678
+ const parsed = parse(version, options);
26679
+ return parsed && parsed.prerelease.length ? parsed.prerelease : null;
26680
+ };
26681
+ module2.exports = prerelease;
26682
+ }
26683
+ });
26684
+
26685
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare.js
26686
+ var require_compare = __commonJS({
26687
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare.js"(exports, module2) {
26688
+ var SemVer = require_semver();
26689
+ var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
26690
+ module2.exports = compare;
26691
+ }
26692
+ });
26693
+
26694
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/rcompare.js
26695
+ var require_rcompare = __commonJS({
26696
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/rcompare.js"(exports, module2) {
26697
+ var compare = require_compare();
26698
+ var rcompare = (a, b, loose) => compare(b, a, loose);
26699
+ module2.exports = rcompare;
26700
+ }
26701
+ });
26702
+
26703
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare-loose.js
26704
+ var require_compare_loose = __commonJS({
26705
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare-loose.js"(exports, module2) {
26706
+ var compare = require_compare();
26707
+ var compareLoose = (a, b) => compare(a, b, true);
26708
+ module2.exports = compareLoose;
26709
+ }
26710
+ });
26711
+
26712
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare-build.js
26713
+ var require_compare_build = __commonJS({
26714
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare-build.js"(exports, module2) {
26715
+ var SemVer = require_semver();
26716
+ var compareBuild = (a, b, loose) => {
26717
+ const versionA = new SemVer(a, loose);
26718
+ const versionB = new SemVer(b, loose);
26719
+ return versionA.compare(versionB) || versionA.compareBuild(versionB);
26720
+ };
26721
+ module2.exports = compareBuild;
26722
+ }
26723
+ });
26724
+
26725
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/sort.js
26726
+ var require_sort = __commonJS({
26727
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/sort.js"(exports, module2) {
26728
+ var compareBuild = require_compare_build();
26729
+ var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
26730
+ module2.exports = sort;
26731
+ }
26732
+ });
26733
+
26734
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/rsort.js
26735
+ var require_rsort = __commonJS({
26736
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/rsort.js"(exports, module2) {
26737
+ var compareBuild = require_compare_build();
26738
+ var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
26739
+ module2.exports = rsort;
26740
+ }
26741
+ });
26742
+
26743
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/gt.js
26744
+ var require_gt = __commonJS({
26745
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/gt.js"(exports, module2) {
26746
+ var compare = require_compare();
26747
+ var gt = (a, b, loose) => compare(a, b, loose) > 0;
26748
+ module2.exports = gt;
26749
+ }
26750
+ });
26751
+
26752
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/lt.js
26753
+ var require_lt = __commonJS({
26754
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/lt.js"(exports, module2) {
26755
+ var compare = require_compare();
26756
+ var lt = (a, b, loose) => compare(a, b, loose) < 0;
26757
+ module2.exports = lt;
26758
+ }
26759
+ });
26760
+
26761
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/eq.js
26762
+ var require_eq = __commonJS({
26763
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/eq.js"(exports, module2) {
26764
+ var compare = require_compare();
26765
+ var eq = (a, b, loose) => compare(a, b, loose) === 0;
26766
+ module2.exports = eq;
26767
+ }
26768
+ });
26769
+
26770
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/neq.js
26771
+ var require_neq = __commonJS({
26772
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/neq.js"(exports, module2) {
26773
+ var compare = require_compare();
26774
+ var neq = (a, b, loose) => compare(a, b, loose) !== 0;
26775
+ module2.exports = neq;
26776
+ }
26777
+ });
26778
+
26779
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/gte.js
26780
+ var require_gte = __commonJS({
26781
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/gte.js"(exports, module2) {
26782
+ var compare = require_compare();
26783
+ var gte = (a, b, loose) => compare(a, b, loose) >= 0;
26784
+ module2.exports = gte;
26785
+ }
26786
+ });
26787
+
26788
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/lte.js
26789
+ var require_lte = __commonJS({
26790
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/lte.js"(exports, module2) {
26791
+ var compare = require_compare();
26792
+ var lte = (a, b, loose) => compare(a, b, loose) <= 0;
26793
+ module2.exports = lte;
26794
+ }
26795
+ });
26796
+
26797
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/cmp.js
26798
+ var require_cmp = __commonJS({
26799
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/cmp.js"(exports, module2) {
26800
+ var eq = require_eq();
26801
+ var neq = require_neq();
26802
+ var gt = require_gt();
26803
+ var gte = require_gte();
26804
+ var lt = require_lt();
26805
+ var lte = require_lte();
26806
+ var cmp = (a, op, b, loose) => {
26807
+ switch (op) {
26808
+ case "===":
26809
+ if (typeof a === "object") {
26810
+ a = a.version;
26811
+ }
26812
+ if (typeof b === "object") {
26813
+ b = b.version;
26814
+ }
26815
+ return a === b;
26816
+ case "!==":
26817
+ if (typeof a === "object") {
26818
+ a = a.version;
26819
+ }
26820
+ if (typeof b === "object") {
26821
+ b = b.version;
26822
+ }
26823
+ return a !== b;
26824
+ case "":
26825
+ case "=":
26826
+ case "==":
26827
+ return eq(a, b, loose);
26828
+ case "!=":
26829
+ return neq(a, b, loose);
26830
+ case ">":
26831
+ return gt(a, b, loose);
26832
+ case ">=":
26833
+ return gte(a, b, loose);
26834
+ case "<":
26835
+ return lt(a, b, loose);
26836
+ case "<=":
26837
+ return lte(a, b, loose);
26838
+ default:
26839
+ throw new TypeError(`Invalid operator: ${op}`);
26337
26840
  }
26338
- if (chunkIndex === 0) {
26339
- return "'" + val + "'";
26841
+ };
26842
+ module2.exports = cmp;
26843
+ }
26844
+ });
26845
+
26846
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/coerce.js
26847
+ var require_coerce = __commonJS({
26848
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/coerce.js"(exports, module2) {
26849
+ var SemVer = require_semver();
26850
+ var parse = require_parse();
26851
+ var { safeRe: re, t } = require_re();
26852
+ var coerce2 = (version, options) => {
26853
+ if (version instanceof SemVer) {
26854
+ return version;
26340
26855
  }
26341
- if (chunkIndex < val.length) {
26342
- return "'" + escapedVal + val.slice(chunkIndex) + "'";
26856
+ if (typeof version === "number") {
26857
+ version = String(version);
26343
26858
  }
26344
- return "'" + escapedVal + "'";
26345
- }
26346
- function zeroPad(number, length) {
26347
- number = number.toString();
26348
- while (number.length < length) {
26349
- number = "0" + number;
26859
+ if (typeof version !== "string") {
26860
+ return null;
26350
26861
  }
26351
- return number;
26352
- }
26353
- function convertTimezone(tz) {
26354
- if (tz === "Z") {
26355
- return 0;
26862
+ options = options || {};
26863
+ let match2 = null;
26864
+ if (!options.rtl) {
26865
+ match2 = version.match(re[t.COERCE]);
26866
+ } else {
26867
+ let next;
26868
+ while ((next = re[t.COERCERTL].exec(version)) && (!match2 || match2.index + match2[0].length !== version.length)) {
26869
+ if (!match2 || next.index + next[0].length !== match2.index + match2[0].length) {
26870
+ match2 = next;
26871
+ }
26872
+ re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
26873
+ }
26874
+ re[t.COERCERTL].lastIndex = -1;
26356
26875
  }
26357
- var m = tz.match(/([\+\-\s])(\d\d):?(\d\d)?/);
26358
- if (m) {
26359
- return (m[1] === "-" ? -1 : 1) * (parseInt(m[2], 10) + (m[3] ? parseInt(m[3], 10) : 0) / 60) * 60;
26876
+ if (match2 === null) {
26877
+ return null;
26360
26878
  }
26361
- return false;
26362
- }
26879
+ return parse(`${match2[2]}.${match2[3] || "0"}.${match2[4] || "0"}`, options);
26880
+ };
26881
+ module2.exports = coerce2;
26363
26882
  }
26364
26883
  });
26365
26884
 
26366
- // node_modules/.pnpm/sqlstring@2.3.3/node_modules/sqlstring/index.js
26367
- var require_sqlstring = __commonJS({
26368
- "node_modules/.pnpm/sqlstring@2.3.3/node_modules/sqlstring/index.js"(exports, module2) {
26369
- module2.exports = require_SqlString();
26885
+ // node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/iterator.js
26886
+ var require_iterator = __commonJS({
26887
+ "node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/iterator.js"(exports, module2) {
26888
+ "use strict";
26889
+ module2.exports = function(Yallist) {
26890
+ Yallist.prototype[Symbol.iterator] = function* () {
26891
+ for (let walker = this.head; walker; walker = walker.next) {
26892
+ yield walker.value;
26893
+ }
26894
+ };
26895
+ };
26370
26896
  }
26371
26897
  });
26372
26898
 
26373
- // node_modules/.pnpm/denque@2.1.0/node_modules/denque/index.js
26374
- var require_denque = __commonJS({
26375
- "node_modules/.pnpm/denque@2.1.0/node_modules/denque/index.js"(exports, module2) {
26899
+ // node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/yallist.js
26900
+ var require_yallist = __commonJS({
26901
+ "node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/yallist.js"(exports, module2) {
26376
26902
  "use strict";
26377
- function Denque(array, options) {
26378
- var options = options || {};
26379
- this._capacity = options.capacity;
26380
- this._head = 0;
26381
- this._tail = 0;
26382
- if (Array.isArray(array)) {
26383
- this._fromArray(array);
26384
- } else {
26385
- this._capacityMask = 3;
26386
- this._list = new Array(4);
26903
+ module2.exports = Yallist;
26904
+ Yallist.Node = Node;
26905
+ Yallist.create = Yallist;
26906
+ function Yallist(list) {
26907
+ var self2 = this;
26908
+ if (!(self2 instanceof Yallist)) {
26909
+ self2 = new Yallist();
26910
+ }
26911
+ self2.tail = null;
26912
+ self2.head = null;
26913
+ self2.length = 0;
26914
+ if (list && typeof list.forEach === "function") {
26915
+ list.forEach(function(item) {
26916
+ self2.push(item);
26917
+ });
26918
+ } else if (arguments.length > 0) {
26919
+ for (var i = 0, l = arguments.length; i < l; i++) {
26920
+ self2.push(arguments[i]);
26921
+ }
26387
26922
  }
26923
+ return self2;
26388
26924
  }
26389
- Denque.prototype.peekAt = function peekAt(index4) {
26390
- var i = index4;
26391
- if (i !== (i | 0)) {
26392
- return void 0;
26925
+ Yallist.prototype.removeNode = function(node) {
26926
+ if (node.list !== this) {
26927
+ throw new Error("removing node which does not belong to this list");
26393
26928
  }
26394
- var len = this.size();
26395
- if (i >= len || i < -len)
26396
- return void 0;
26397
- if (i < 0)
26398
- i += len;
26399
- i = this._head + i & this._capacityMask;
26400
- return this._list[i];
26401
- };
26402
- Denque.prototype.get = function get(i) {
26403
- return this.peekAt(i);
26404
- };
26405
- Denque.prototype.peek = function peek() {
26406
- if (this._head === this._tail)
26407
- return void 0;
26408
- return this._list[this._head];
26409
- };
26410
- Denque.prototype.peekFront = function peekFront() {
26411
- return this.peek();
26412
- };
26413
- Denque.prototype.peekBack = function peekBack() {
26414
- return this.peekAt(-1);
26415
- };
26416
- Object.defineProperty(Denque.prototype, "length", {
26417
- get: function length() {
26418
- return this.size();
26929
+ var next = node.next;
26930
+ var prev = node.prev;
26931
+ if (next) {
26932
+ next.prev = prev;
26419
26933
  }
26420
- });
26421
- Denque.prototype.size = function size() {
26422
- if (this._head === this._tail)
26423
- return 0;
26424
- if (this._head < this._tail)
26425
- return this._tail - this._head;
26426
- else
26427
- return this._capacityMask + 1 - (this._head - this._tail);
26428
- };
26429
- Denque.prototype.unshift = function unshift(item) {
26430
- if (arguments.length === 0)
26431
- return this.size();
26432
- var len = this._list.length;
26433
- this._head = this._head - 1 + len & this._capacityMask;
26434
- this._list[this._head] = item;
26435
- if (this._tail === this._head)
26436
- this._growArray();
26437
- if (this._capacity && this.size() > this._capacity)
26438
- this.pop();
26439
- if (this._head < this._tail)
26440
- return this._tail - this._head;
26441
- else
26442
- return this._capacityMask + 1 - (this._head - this._tail);
26443
- };
26444
- Denque.prototype.shift = function shift() {
26445
- var head = this._head;
26446
- if (head === this._tail)
26447
- return void 0;
26448
- var item = this._list[head];
26449
- this._list[head] = void 0;
26450
- this._head = head + 1 & this._capacityMask;
26451
- if (head < 2 && this._tail > 1e4 && this._tail <= this._list.length >>> 2)
26452
- this._shrinkArray();
26453
- return item;
26454
- };
26455
- Denque.prototype.push = function push(item) {
26456
- if (arguments.length === 0)
26457
- return this.size();
26458
- var tail = this._tail;
26459
- this._list[tail] = item;
26460
- this._tail = tail + 1 & this._capacityMask;
26461
- if (this._tail === this._head) {
26462
- this._growArray();
26463
- }
26464
- if (this._capacity && this.size() > this._capacity) {
26465
- this.shift();
26466
- }
26467
- if (this._head < this._tail)
26468
- return this._tail - this._head;
26469
- else
26470
- return this._capacityMask + 1 - (this._head - this._tail);
26471
- };
26472
- Denque.prototype.pop = function pop() {
26473
- var tail = this._tail;
26474
- if (tail === this._head)
26475
- return void 0;
26476
- var len = this._list.length;
26477
- this._tail = tail - 1 + len & this._capacityMask;
26478
- var item = this._list[this._tail];
26479
- this._list[this._tail] = void 0;
26480
- if (this._head < 2 && tail > 1e4 && tail <= len >>> 2)
26481
- this._shrinkArray();
26482
- return item;
26483
- };
26484
- Denque.prototype.removeOne = function removeOne(index4) {
26485
- var i = index4;
26486
- if (i !== (i | 0)) {
26487
- return void 0;
26488
- }
26489
- if (this._head === this._tail)
26490
- return void 0;
26491
- var size = this.size();
26492
- var len = this._list.length;
26493
- if (i >= size || i < -size)
26494
- return void 0;
26495
- if (i < 0)
26496
- i += size;
26497
- i = this._head + i & this._capacityMask;
26498
- var item = this._list[i];
26499
- var k;
26500
- if (index4 < size / 2) {
26501
- for (k = index4; k > 0; k--) {
26502
- this._list[i] = this._list[i = i - 1 + len & this._capacityMask];
26503
- }
26504
- this._list[i] = void 0;
26505
- this._head = this._head + 1 + len & this._capacityMask;
26506
- } else {
26507
- for (k = size - 1 - index4; k > 0; k--) {
26508
- this._list[i] = this._list[i = i + 1 + len & this._capacityMask];
26509
- }
26510
- this._list[i] = void 0;
26511
- this._tail = this._tail - 1 + len & this._capacityMask;
26512
- }
26513
- return item;
26514
- };
26515
- Denque.prototype.remove = function remove(index4, count) {
26516
- var i = index4;
26517
- var removed;
26518
- var del_count = count;
26519
- if (i !== (i | 0)) {
26520
- return void 0;
26521
- }
26522
- if (this._head === this._tail)
26523
- return void 0;
26524
- var size = this.size();
26525
- var len = this._list.length;
26526
- if (i >= size || i < -size || count < 1)
26527
- return void 0;
26528
- if (i < 0)
26529
- i += size;
26530
- if (count === 1 || !count) {
26531
- removed = new Array(1);
26532
- removed[0] = this.removeOne(i);
26533
- return removed;
26534
- }
26535
- if (i === 0 && i + count >= size) {
26536
- removed = this.toArray();
26537
- this.clear();
26538
- return removed;
26539
- }
26540
- if (i + count > size)
26541
- count = size - i;
26542
- var k;
26543
- removed = new Array(count);
26544
- for (k = 0; k < count; k++) {
26545
- removed[k] = this._list[this._head + i + k & this._capacityMask];
26546
- }
26547
- i = this._head + i & this._capacityMask;
26548
- if (index4 + count === size) {
26549
- this._tail = this._tail - count + len & this._capacityMask;
26550
- for (k = count; k > 0; k--) {
26551
- this._list[i = i + 1 + len & this._capacityMask] = void 0;
26552
- }
26553
- return removed;
26554
- }
26555
- if (index4 === 0) {
26556
- this._head = this._head + count + len & this._capacityMask;
26557
- for (k = count - 1; k > 0; k--) {
26558
- this._list[i = i + 1 + len & this._capacityMask] = void 0;
26559
- }
26560
- return removed;
26561
- }
26562
- if (i < size / 2) {
26563
- this._head = this._head + index4 + count + len & this._capacityMask;
26564
- for (k = index4; k > 0; k--) {
26565
- this.unshift(this._list[i = i - 1 + len & this._capacityMask]);
26566
- }
26567
- i = this._head - 1 + len & this._capacityMask;
26568
- while (del_count > 0) {
26569
- this._list[i = i - 1 + len & this._capacityMask] = void 0;
26570
- del_count--;
26571
- }
26572
- if (index4 < 0)
26573
- this._tail = i;
26574
- } else {
26575
- this._tail = i;
26576
- i = i + count + len & this._capacityMask;
26577
- for (k = size - (count + index4); k > 0; k--) {
26578
- this.push(this._list[i++]);
26579
- }
26580
- i = this._tail;
26581
- while (del_count > 0) {
26582
- this._list[i = i + 1 + len & this._capacityMask] = void 0;
26583
- del_count--;
26584
- }
26585
- }
26586
- if (this._head < 2 && this._tail > 1e4 && this._tail <= len >>> 2)
26587
- this._shrinkArray();
26588
- return removed;
26589
- };
26590
- Denque.prototype.splice = function splice(index4, count) {
26591
- var i = index4;
26592
- if (i !== (i | 0)) {
26593
- return void 0;
26594
- }
26595
- var size = this.size();
26596
- if (i < 0)
26597
- i += size;
26598
- if (i > size)
26599
- return void 0;
26600
- if (arguments.length > 2) {
26601
- var k;
26602
- var temp;
26603
- var removed;
26604
- var arg_len = arguments.length;
26605
- var len = this._list.length;
26606
- var arguments_index = 2;
26607
- if (!size || i < size / 2) {
26608
- temp = new Array(i);
26609
- for (k = 0; k < i; k++) {
26610
- temp[k] = this._list[this._head + k & this._capacityMask];
26611
- }
26612
- if (count === 0) {
26613
- removed = [];
26614
- if (i > 0) {
26615
- this._head = this._head + i + len & this._capacityMask;
26616
- }
26617
- } else {
26618
- removed = this.remove(i, count);
26619
- this._head = this._head + i + len & this._capacityMask;
26620
- }
26621
- while (arg_len > arguments_index) {
26622
- this.unshift(arguments[--arg_len]);
26623
- }
26624
- for (k = i; k > 0; k--) {
26625
- this.unshift(temp[k - 1]);
26626
- }
26627
- } else {
26628
- temp = new Array(size - (i + count));
26629
- var leng = temp.length;
26630
- for (k = 0; k < leng; k++) {
26631
- temp[k] = this._list[this._head + i + count + k & this._capacityMask];
26632
- }
26633
- if (count === 0) {
26634
- removed = [];
26635
- if (i != size) {
26636
- this._tail = this._head + i + len & this._capacityMask;
26637
- }
26638
- } else {
26639
- removed = this.remove(i, count);
26640
- this._tail = this._tail - leng + len & this._capacityMask;
26641
- }
26642
- while (arguments_index < arg_len) {
26643
- this.push(arguments[arguments_index++]);
26644
- }
26645
- for (k = 0; k < leng; k++) {
26646
- this.push(temp[k]);
26647
- }
26648
- }
26649
- return removed;
26650
- } else {
26651
- return this.remove(i, count);
26652
- }
26653
- };
26654
- Denque.prototype.clear = function clear() {
26655
- this._list = new Array(this._list.length);
26656
- this._head = 0;
26657
- this._tail = 0;
26658
- };
26659
- Denque.prototype.isEmpty = function isEmpty() {
26660
- return this._head === this._tail;
26661
- };
26662
- Denque.prototype.toArray = function toArray() {
26663
- return this._copyArray(false);
26664
- };
26665
- Denque.prototype._fromArray = function _fromArray(array) {
26666
- var length = array.length;
26667
- var capacity = this._nextPowerOf2(length);
26668
- this._list = new Array(capacity);
26669
- this._capacityMask = capacity - 1;
26670
- this._tail = length;
26671
- for (var i = 0; i < length; i++)
26672
- this._list[i] = array[i];
26673
- };
26674
- Denque.prototype._copyArray = function _copyArray(fullCopy, size) {
26675
- var src = this._list;
26676
- var capacity = src.length;
26677
- var length = this.length;
26678
- size = size | length;
26679
- if (size == length && this._head < this._tail) {
26680
- return this._list.slice(this._head, this._tail);
26681
- }
26682
- var dest = new Array(size);
26683
- var k = 0;
26684
- var i;
26685
- if (fullCopy || this._head > this._tail) {
26686
- for (i = this._head; i < capacity; i++)
26687
- dest[k++] = src[i];
26688
- for (i = 0; i < this._tail; i++)
26689
- dest[k++] = src[i];
26690
- } else {
26691
- for (i = this._head; i < this._tail; i++)
26692
- dest[k++] = src[i];
26693
- }
26694
- return dest;
26695
- };
26696
- Denque.prototype._growArray = function _growArray() {
26697
- if (this._head != 0) {
26698
- var newList = this._copyArray(true, this._list.length << 1);
26699
- this._tail = this._list.length;
26700
- this._head = 0;
26701
- this._list = newList;
26702
- } else {
26703
- this._tail = this._list.length;
26704
- this._list.length <<= 1;
26705
- }
26706
- this._capacityMask = this._capacityMask << 1 | 1;
26707
- };
26708
- Denque.prototype._shrinkArray = function _shrinkArray() {
26709
- this._list.length >>>= 1;
26710
- this._capacityMask >>>= 1;
26711
- };
26712
- Denque.prototype._nextPowerOf2 = function _nextPowerOf2(num) {
26713
- var log2 = Math.log(num) / Math.log(2);
26714
- var nextPow2 = 1 << log2 + 1;
26715
- return Math.max(nextPow2, 4);
26716
- };
26717
- module2.exports = Denque;
26718
- }
26719
- });
26720
-
26721
- // node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/iterator.js
26722
- var require_iterator = __commonJS({
26723
- "node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/iterator.js"(exports, module2) {
26724
- "use strict";
26725
- module2.exports = function(Yallist) {
26726
- Yallist.prototype[Symbol.iterator] = function* () {
26727
- for (let walker = this.head; walker; walker = walker.next) {
26728
- yield walker.value;
26729
- }
26730
- };
26731
- };
26732
- }
26733
- });
26734
-
26735
- // node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/yallist.js
26736
- var require_yallist = __commonJS({
26737
- "node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/yallist.js"(exports, module2) {
26738
- "use strict";
26739
- module2.exports = Yallist;
26740
- Yallist.Node = Node;
26741
- Yallist.create = Yallist;
26742
- function Yallist(list) {
26743
- var self2 = this;
26744
- if (!(self2 instanceof Yallist)) {
26745
- self2 = new Yallist();
26746
- }
26747
- self2.tail = null;
26748
- self2.head = null;
26749
- self2.length = 0;
26750
- if (list && typeof list.forEach === "function") {
26751
- list.forEach(function(item) {
26752
- self2.push(item);
26753
- });
26754
- } else if (arguments.length > 0) {
26755
- for (var i = 0, l = arguments.length; i < l; i++) {
26756
- self2.push(arguments[i]);
26757
- }
26758
- }
26759
- return self2;
26760
- }
26761
- Yallist.prototype.removeNode = function(node) {
26762
- if (node.list !== this) {
26763
- throw new Error("removing node which does not belong to this list");
26764
- }
26765
- var next = node.next;
26766
- var prev = node.prev;
26767
- if (next) {
26768
- next.prev = prev;
26769
- }
26770
- if (prev) {
26771
- prev.next = next;
26772
- }
26773
- if (node === this.head) {
26774
- this.head = next;
26775
- }
26776
- if (node === this.tail) {
26777
- this.tail = prev;
26778
- }
26779
- node.list.length--;
26780
- node.next = null;
26781
- node.prev = null;
26782
- node.list = null;
26783
- return next;
26934
+ if (prev) {
26935
+ prev.next = next;
26936
+ }
26937
+ if (node === this.head) {
26938
+ this.head = next;
26939
+ }
26940
+ if (node === this.tail) {
26941
+ this.tail = prev;
26942
+ }
26943
+ node.list.length--;
26944
+ node.next = null;
26945
+ node.prev = null;
26946
+ node.list = null;
26947
+ return next;
26784
26948
  };
26785
26949
  Yallist.prototype.unshiftNode = function(node) {
26786
26950
  if (node === this.head) {
@@ -27144,230 +27308,1862 @@ var require_lru_cache = __commonJS({
27144
27308
  this[MAX] = mL || Infinity;
27145
27309
  trim(this);
27146
27310
  }
27147
- get max() {
27148
- return this[MAX];
27311
+ get max() {
27312
+ return this[MAX];
27313
+ }
27314
+ set allowStale(allowStale) {
27315
+ this[ALLOW_STALE] = !!allowStale;
27316
+ }
27317
+ get allowStale() {
27318
+ return this[ALLOW_STALE];
27319
+ }
27320
+ set maxAge(mA) {
27321
+ if (typeof mA !== "number")
27322
+ throw new TypeError("maxAge must be a non-negative number");
27323
+ this[MAX_AGE] = mA;
27324
+ trim(this);
27325
+ }
27326
+ get maxAge() {
27327
+ return this[MAX_AGE];
27328
+ }
27329
+ // resize the cache when the lengthCalculator changes.
27330
+ set lengthCalculator(lC) {
27331
+ if (typeof lC !== "function")
27332
+ lC = naiveLength;
27333
+ if (lC !== this[LENGTH_CALCULATOR]) {
27334
+ this[LENGTH_CALCULATOR] = lC;
27335
+ this[LENGTH] = 0;
27336
+ this[LRU_LIST].forEach((hit) => {
27337
+ hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
27338
+ this[LENGTH] += hit.length;
27339
+ });
27340
+ }
27341
+ trim(this);
27342
+ }
27343
+ get lengthCalculator() {
27344
+ return this[LENGTH_CALCULATOR];
27345
+ }
27346
+ get length() {
27347
+ return this[LENGTH];
27348
+ }
27349
+ get itemCount() {
27350
+ return this[LRU_LIST].length;
27351
+ }
27352
+ rforEach(fn, thisp) {
27353
+ thisp = thisp || this;
27354
+ for (let walker = this[LRU_LIST].tail; walker !== null; ) {
27355
+ const prev = walker.prev;
27356
+ forEachStep(this, fn, walker, thisp);
27357
+ walker = prev;
27358
+ }
27359
+ }
27360
+ forEach(fn, thisp) {
27361
+ thisp = thisp || this;
27362
+ for (let walker = this[LRU_LIST].head; walker !== null; ) {
27363
+ const next = walker.next;
27364
+ forEachStep(this, fn, walker, thisp);
27365
+ walker = next;
27366
+ }
27367
+ }
27368
+ keys() {
27369
+ return this[LRU_LIST].toArray().map((k) => k.key);
27370
+ }
27371
+ values() {
27372
+ return this[LRU_LIST].toArray().map((k) => k.value);
27373
+ }
27374
+ reset() {
27375
+ if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
27376
+ this[LRU_LIST].forEach((hit) => this[DISPOSE](hit.key, hit.value));
27377
+ }
27378
+ this[CACHE] = /* @__PURE__ */ new Map();
27379
+ this[LRU_LIST] = new Yallist();
27380
+ this[LENGTH] = 0;
27381
+ }
27382
+ dump() {
27383
+ return this[LRU_LIST].map((hit) => isStale(this, hit) ? false : {
27384
+ k: hit.key,
27385
+ v: hit.value,
27386
+ e: hit.now + (hit.maxAge || 0)
27387
+ }).toArray().filter((h) => h);
27388
+ }
27389
+ dumpLru() {
27390
+ return this[LRU_LIST];
27391
+ }
27392
+ set(key, value, maxAge) {
27393
+ maxAge = maxAge || this[MAX_AGE];
27394
+ if (maxAge && typeof maxAge !== "number")
27395
+ throw new TypeError("maxAge must be a number");
27396
+ const now = maxAge ? Date.now() : 0;
27397
+ const len = this[LENGTH_CALCULATOR](value, key);
27398
+ if (this[CACHE].has(key)) {
27399
+ if (len > this[MAX]) {
27400
+ del(this, this[CACHE].get(key));
27401
+ return false;
27402
+ }
27403
+ const node = this[CACHE].get(key);
27404
+ const item = node.value;
27405
+ if (this[DISPOSE]) {
27406
+ if (!this[NO_DISPOSE_ON_SET])
27407
+ this[DISPOSE](key, item.value);
27408
+ }
27409
+ item.now = now;
27410
+ item.maxAge = maxAge;
27411
+ item.value = value;
27412
+ this[LENGTH] += len - item.length;
27413
+ item.length = len;
27414
+ this.get(key);
27415
+ trim(this);
27416
+ return true;
27417
+ }
27418
+ const hit = new Entry(key, value, len, now, maxAge);
27419
+ if (hit.length > this[MAX]) {
27420
+ if (this[DISPOSE])
27421
+ this[DISPOSE](key, value);
27422
+ return false;
27423
+ }
27424
+ this[LENGTH] += hit.length;
27425
+ this[LRU_LIST].unshift(hit);
27426
+ this[CACHE].set(key, this[LRU_LIST].head);
27427
+ trim(this);
27428
+ return true;
27429
+ }
27430
+ has(key) {
27431
+ if (!this[CACHE].has(key))
27432
+ return false;
27433
+ const hit = this[CACHE].get(key).value;
27434
+ return !isStale(this, hit);
27435
+ }
27436
+ get(key) {
27437
+ return get(this, key, true);
27438
+ }
27439
+ peek(key) {
27440
+ return get(this, key, false);
27441
+ }
27442
+ pop() {
27443
+ const node = this[LRU_LIST].tail;
27444
+ if (!node)
27445
+ return null;
27446
+ del(this, node);
27447
+ return node.value;
27448
+ }
27449
+ del(key) {
27450
+ del(this, this[CACHE].get(key));
27451
+ }
27452
+ load(arr) {
27453
+ this.reset();
27454
+ const now = Date.now();
27455
+ for (let l = arr.length - 1; l >= 0; l--) {
27456
+ const hit = arr[l];
27457
+ const expiresAt = hit.e || 0;
27458
+ if (expiresAt === 0)
27459
+ this.set(hit.k, hit.v);
27460
+ else {
27461
+ const maxAge = expiresAt - now;
27462
+ if (maxAge > 0) {
27463
+ this.set(hit.k, hit.v, maxAge);
27464
+ }
27465
+ }
27466
+ }
27467
+ }
27468
+ prune() {
27469
+ this[CACHE].forEach((value, key) => get(this, key, false));
27470
+ }
27471
+ };
27472
+ var get = (self2, key, doUse) => {
27473
+ const node = self2[CACHE].get(key);
27474
+ if (node) {
27475
+ const hit = node.value;
27476
+ if (isStale(self2, hit)) {
27477
+ del(self2, node);
27478
+ if (!self2[ALLOW_STALE])
27479
+ return void 0;
27480
+ } else {
27481
+ if (doUse) {
27482
+ if (self2[UPDATE_AGE_ON_GET])
27483
+ node.value.now = Date.now();
27484
+ self2[LRU_LIST].unshiftNode(node);
27485
+ }
27486
+ }
27487
+ return hit.value;
27488
+ }
27489
+ };
27490
+ var isStale = (self2, hit) => {
27491
+ if (!hit || !hit.maxAge && !self2[MAX_AGE])
27492
+ return false;
27493
+ const diff2 = Date.now() - hit.now;
27494
+ return hit.maxAge ? diff2 > hit.maxAge : self2[MAX_AGE] && diff2 > self2[MAX_AGE];
27495
+ };
27496
+ var trim = (self2) => {
27497
+ if (self2[LENGTH] > self2[MAX]) {
27498
+ for (let walker = self2[LRU_LIST].tail; self2[LENGTH] > self2[MAX] && walker !== null; ) {
27499
+ const prev = walker.prev;
27500
+ del(self2, walker);
27501
+ walker = prev;
27502
+ }
27503
+ }
27504
+ };
27505
+ var del = (self2, node) => {
27506
+ if (node) {
27507
+ const hit = node.value;
27508
+ if (self2[DISPOSE])
27509
+ self2[DISPOSE](hit.key, hit.value);
27510
+ self2[LENGTH] -= hit.length;
27511
+ self2[CACHE].delete(hit.key);
27512
+ self2[LRU_LIST].removeNode(node);
27513
+ }
27514
+ };
27515
+ var Entry = class {
27516
+ constructor(key, value, length, now, maxAge) {
27517
+ this.key = key;
27518
+ this.value = value;
27519
+ this.length = length;
27520
+ this.now = now;
27521
+ this.maxAge = maxAge || 0;
27522
+ }
27523
+ };
27524
+ var forEachStep = (self2, fn, node, thisp) => {
27525
+ let hit = node.value;
27526
+ if (isStale(self2, hit)) {
27527
+ del(self2, node);
27528
+ if (!self2[ALLOW_STALE])
27529
+ hit = void 0;
27530
+ }
27531
+ if (hit)
27532
+ fn.call(thisp, hit.value, hit.key, self2);
27533
+ };
27534
+ module2.exports = LRUCache;
27535
+ }
27536
+ });
27537
+
27538
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/range.js
27539
+ var require_range = __commonJS({
27540
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/range.js"(exports, module2) {
27541
+ var Range = class _Range {
27542
+ constructor(range, options) {
27543
+ options = parseOptions(options);
27544
+ if (range instanceof _Range) {
27545
+ if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
27546
+ return range;
27547
+ } else {
27548
+ return new _Range(range.raw, options);
27549
+ }
27550
+ }
27551
+ if (range instanceof Comparator) {
27552
+ this.raw = range.value;
27553
+ this.set = [[range]];
27554
+ this.format();
27555
+ return this;
27556
+ }
27557
+ this.options = options;
27558
+ this.loose = !!options.loose;
27559
+ this.includePrerelease = !!options.includePrerelease;
27560
+ this.raw = range.trim().split(/\s+/).join(" ");
27561
+ this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
27562
+ if (!this.set.length) {
27563
+ throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
27564
+ }
27565
+ if (this.set.length > 1) {
27566
+ const first = this.set[0];
27567
+ this.set = this.set.filter((c) => !isNullSet(c[0]));
27568
+ if (this.set.length === 0) {
27569
+ this.set = [first];
27570
+ } else if (this.set.length > 1) {
27571
+ for (const c of this.set) {
27572
+ if (c.length === 1 && isAny(c[0])) {
27573
+ this.set = [c];
27574
+ break;
27575
+ }
27576
+ }
27577
+ }
27578
+ }
27579
+ this.format();
27580
+ }
27581
+ format() {
27582
+ this.range = this.set.map((comps) => comps.join(" ").trim()).join("||").trim();
27583
+ return this.range;
27584
+ }
27585
+ toString() {
27586
+ return this.range;
27587
+ }
27588
+ parseRange(range) {
27589
+ const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
27590
+ const memoKey = memoOpts + ":" + range;
27591
+ const cached = cache.get(memoKey);
27592
+ if (cached) {
27593
+ return cached;
27594
+ }
27595
+ const loose = this.options.loose;
27596
+ const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
27597
+ range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
27598
+ debug("hyphen replace", range);
27599
+ range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
27600
+ debug("comparator trim", range);
27601
+ range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
27602
+ debug("tilde trim", range);
27603
+ range = range.replace(re[t.CARETTRIM], caretTrimReplace);
27604
+ debug("caret trim", range);
27605
+ let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
27606
+ if (loose) {
27607
+ rangeList = rangeList.filter((comp) => {
27608
+ debug("loose invalid filter", comp, this.options);
27609
+ return !!comp.match(re[t.COMPARATORLOOSE]);
27610
+ });
27611
+ }
27612
+ debug("range list", rangeList);
27613
+ const rangeMap = /* @__PURE__ */ new Map();
27614
+ const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
27615
+ for (const comp of comparators) {
27616
+ if (isNullSet(comp)) {
27617
+ return [comp];
27618
+ }
27619
+ rangeMap.set(comp.value, comp);
27620
+ }
27621
+ if (rangeMap.size > 1 && rangeMap.has("")) {
27622
+ rangeMap.delete("");
27623
+ }
27624
+ const result = [...rangeMap.values()];
27625
+ cache.set(memoKey, result);
27626
+ return result;
27627
+ }
27628
+ intersects(range, options) {
27629
+ if (!(range instanceof _Range)) {
27630
+ throw new TypeError("a Range is required");
27631
+ }
27632
+ return this.set.some((thisComparators) => {
27633
+ return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
27634
+ return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
27635
+ return rangeComparators.every((rangeComparator) => {
27636
+ return thisComparator.intersects(rangeComparator, options);
27637
+ });
27638
+ });
27639
+ });
27640
+ });
27641
+ }
27642
+ // if ANY of the sets match ALL of its comparators, then pass
27643
+ test(version) {
27644
+ if (!version) {
27645
+ return false;
27646
+ }
27647
+ if (typeof version === "string") {
27648
+ try {
27649
+ version = new SemVer(version, this.options);
27650
+ } catch (er) {
27651
+ return false;
27652
+ }
27653
+ }
27654
+ for (let i = 0; i < this.set.length; i++) {
27655
+ if (testSet(this.set[i], version, this.options)) {
27656
+ return true;
27657
+ }
27658
+ }
27659
+ return false;
27660
+ }
27661
+ };
27662
+ module2.exports = Range;
27663
+ var LRU = require_lru_cache();
27664
+ var cache = new LRU({ max: 1e3 });
27665
+ var parseOptions = require_parse_options();
27666
+ var Comparator = require_comparator();
27667
+ var debug = require_debug();
27668
+ var SemVer = require_semver();
27669
+ var {
27670
+ safeRe: re,
27671
+ t,
27672
+ comparatorTrimReplace,
27673
+ tildeTrimReplace,
27674
+ caretTrimReplace
27675
+ } = require_re();
27676
+ var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
27677
+ var isNullSet = (c) => c.value === "<0.0.0-0";
27678
+ var isAny = (c) => c.value === "";
27679
+ var isSatisfiable = (comparators, options) => {
27680
+ let result = true;
27681
+ const remainingComparators = comparators.slice();
27682
+ let testComparator = remainingComparators.pop();
27683
+ while (result && remainingComparators.length) {
27684
+ result = remainingComparators.every((otherComparator) => {
27685
+ return testComparator.intersects(otherComparator, options);
27686
+ });
27687
+ testComparator = remainingComparators.pop();
27688
+ }
27689
+ return result;
27690
+ };
27691
+ var parseComparator = (comp, options) => {
27692
+ debug("comp", comp, options);
27693
+ comp = replaceCarets(comp, options);
27694
+ debug("caret", comp);
27695
+ comp = replaceTildes(comp, options);
27696
+ debug("tildes", comp);
27697
+ comp = replaceXRanges(comp, options);
27698
+ debug("xrange", comp);
27699
+ comp = replaceStars(comp, options);
27700
+ debug("stars", comp);
27701
+ return comp;
27702
+ };
27703
+ var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
27704
+ var replaceTildes = (comp, options) => {
27705
+ return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
27706
+ };
27707
+ var replaceTilde = (comp, options) => {
27708
+ const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
27709
+ return comp.replace(r, (_, M, m, p, pr) => {
27710
+ debug("tilde", comp, _, M, m, p, pr);
27711
+ let ret;
27712
+ if (isX(M)) {
27713
+ ret = "";
27714
+ } else if (isX(m)) {
27715
+ ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
27716
+ } else if (isX(p)) {
27717
+ ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
27718
+ } else if (pr) {
27719
+ debug("replaceTilde pr", pr);
27720
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
27721
+ } else {
27722
+ ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
27723
+ }
27724
+ debug("tilde return", ret);
27725
+ return ret;
27726
+ });
27727
+ };
27728
+ var replaceCarets = (comp, options) => {
27729
+ return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
27730
+ };
27731
+ var replaceCaret = (comp, options) => {
27732
+ debug("caret", comp, options);
27733
+ const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
27734
+ const z2 = options.includePrerelease ? "-0" : "";
27735
+ return comp.replace(r, (_, M, m, p, pr) => {
27736
+ debug("caret", comp, _, M, m, p, pr);
27737
+ let ret;
27738
+ if (isX(M)) {
27739
+ ret = "";
27740
+ } else if (isX(m)) {
27741
+ ret = `>=${M}.0.0${z2} <${+M + 1}.0.0-0`;
27742
+ } else if (isX(p)) {
27743
+ if (M === "0") {
27744
+ ret = `>=${M}.${m}.0${z2} <${M}.${+m + 1}.0-0`;
27745
+ } else {
27746
+ ret = `>=${M}.${m}.0${z2} <${+M + 1}.0.0-0`;
27747
+ }
27748
+ } else if (pr) {
27749
+ debug("replaceCaret pr", pr);
27750
+ if (M === "0") {
27751
+ if (m === "0") {
27752
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
27753
+ } else {
27754
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
27755
+ }
27756
+ } else {
27757
+ ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
27758
+ }
27759
+ } else {
27760
+ debug("no pr");
27761
+ if (M === "0") {
27762
+ if (m === "0") {
27763
+ ret = `>=${M}.${m}.${p}${z2} <${M}.${m}.${+p + 1}-0`;
27764
+ } else {
27765
+ ret = `>=${M}.${m}.${p}${z2} <${M}.${+m + 1}.0-0`;
27766
+ }
27767
+ } else {
27768
+ ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
27769
+ }
27770
+ }
27771
+ debug("caret return", ret);
27772
+ return ret;
27773
+ });
27774
+ };
27775
+ var replaceXRanges = (comp, options) => {
27776
+ debug("replaceXRanges", comp, options);
27777
+ return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
27778
+ };
27779
+ var replaceXRange = (comp, options) => {
27780
+ comp = comp.trim();
27781
+ const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
27782
+ return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
27783
+ debug("xRange", comp, ret, gtlt, M, m, p, pr);
27784
+ const xM = isX(M);
27785
+ const xm = xM || isX(m);
27786
+ const xp = xm || isX(p);
27787
+ const anyX = xp;
27788
+ if (gtlt === "=" && anyX) {
27789
+ gtlt = "";
27790
+ }
27791
+ pr = options.includePrerelease ? "-0" : "";
27792
+ if (xM) {
27793
+ if (gtlt === ">" || gtlt === "<") {
27794
+ ret = "<0.0.0-0";
27795
+ } else {
27796
+ ret = "*";
27797
+ }
27798
+ } else if (gtlt && anyX) {
27799
+ if (xm) {
27800
+ m = 0;
27801
+ }
27802
+ p = 0;
27803
+ if (gtlt === ">") {
27804
+ gtlt = ">=";
27805
+ if (xm) {
27806
+ M = +M + 1;
27807
+ m = 0;
27808
+ p = 0;
27809
+ } else {
27810
+ m = +m + 1;
27811
+ p = 0;
27812
+ }
27813
+ } else if (gtlt === "<=") {
27814
+ gtlt = "<";
27815
+ if (xm) {
27816
+ M = +M + 1;
27817
+ } else {
27818
+ m = +m + 1;
27819
+ }
27820
+ }
27821
+ if (gtlt === "<") {
27822
+ pr = "-0";
27823
+ }
27824
+ ret = `${gtlt + M}.${m}.${p}${pr}`;
27825
+ } else if (xm) {
27826
+ ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
27827
+ } else if (xp) {
27828
+ ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
27829
+ }
27830
+ debug("xRange return", ret);
27831
+ return ret;
27832
+ });
27833
+ };
27834
+ var replaceStars = (comp, options) => {
27835
+ debug("replaceStars", comp, options);
27836
+ return comp.trim().replace(re[t.STAR], "");
27837
+ };
27838
+ var replaceGTE0 = (comp, options) => {
27839
+ debug("replaceGTE0", comp, options);
27840
+ return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
27841
+ };
27842
+ var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => {
27843
+ if (isX(fM)) {
27844
+ from = "";
27845
+ } else if (isX(fm)) {
27846
+ from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
27847
+ } else if (isX(fp)) {
27848
+ from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
27849
+ } else if (fpr) {
27850
+ from = `>=${from}`;
27851
+ } else {
27852
+ from = `>=${from}${incPr ? "-0" : ""}`;
27853
+ }
27854
+ if (isX(tM)) {
27855
+ to = "";
27856
+ } else if (isX(tm)) {
27857
+ to = `<${+tM + 1}.0.0-0`;
27858
+ } else if (isX(tp)) {
27859
+ to = `<${tM}.${+tm + 1}.0-0`;
27860
+ } else if (tpr) {
27861
+ to = `<=${tM}.${tm}.${tp}-${tpr}`;
27862
+ } else if (incPr) {
27863
+ to = `<${tM}.${tm}.${+tp + 1}-0`;
27864
+ } else {
27865
+ to = `<=${to}`;
27866
+ }
27867
+ return `${from} ${to}`.trim();
27868
+ };
27869
+ var testSet = (set2, version, options) => {
27870
+ for (let i = 0; i < set2.length; i++) {
27871
+ if (!set2[i].test(version)) {
27872
+ return false;
27873
+ }
27874
+ }
27875
+ if (version.prerelease.length && !options.includePrerelease) {
27876
+ for (let i = 0; i < set2.length; i++) {
27877
+ debug(set2[i].semver);
27878
+ if (set2[i].semver === Comparator.ANY) {
27879
+ continue;
27880
+ }
27881
+ if (set2[i].semver.prerelease.length > 0) {
27882
+ const allowed = set2[i].semver;
27883
+ if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
27884
+ return true;
27885
+ }
27886
+ }
27887
+ }
27888
+ return false;
27889
+ }
27890
+ return true;
27891
+ };
27892
+ }
27893
+ });
27894
+
27895
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/comparator.js
27896
+ var require_comparator = __commonJS({
27897
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/comparator.js"(exports, module2) {
27898
+ var ANY = Symbol("SemVer ANY");
27899
+ var Comparator = class _Comparator {
27900
+ static get ANY() {
27901
+ return ANY;
27902
+ }
27903
+ constructor(comp, options) {
27904
+ options = parseOptions(options);
27905
+ if (comp instanceof _Comparator) {
27906
+ if (comp.loose === !!options.loose) {
27907
+ return comp;
27908
+ } else {
27909
+ comp = comp.value;
27910
+ }
27911
+ }
27912
+ comp = comp.trim().split(/\s+/).join(" ");
27913
+ debug("comparator", comp, options);
27914
+ this.options = options;
27915
+ this.loose = !!options.loose;
27916
+ this.parse(comp);
27917
+ if (this.semver === ANY) {
27918
+ this.value = "";
27919
+ } else {
27920
+ this.value = this.operator + this.semver.version;
27921
+ }
27922
+ debug("comp", this);
27923
+ }
27924
+ parse(comp) {
27925
+ const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
27926
+ const m = comp.match(r);
27927
+ if (!m) {
27928
+ throw new TypeError(`Invalid comparator: ${comp}`);
27929
+ }
27930
+ this.operator = m[1] !== void 0 ? m[1] : "";
27931
+ if (this.operator === "=") {
27932
+ this.operator = "";
27933
+ }
27934
+ if (!m[2]) {
27935
+ this.semver = ANY;
27936
+ } else {
27937
+ this.semver = new SemVer(m[2], this.options.loose);
27938
+ }
27939
+ }
27940
+ toString() {
27941
+ return this.value;
27942
+ }
27943
+ test(version) {
27944
+ debug("Comparator.test", version, this.options.loose);
27945
+ if (this.semver === ANY || version === ANY) {
27946
+ return true;
27947
+ }
27948
+ if (typeof version === "string") {
27949
+ try {
27950
+ version = new SemVer(version, this.options);
27951
+ } catch (er) {
27952
+ return false;
27953
+ }
27954
+ }
27955
+ return cmp(version, this.operator, this.semver, this.options);
27956
+ }
27957
+ intersects(comp, options) {
27958
+ if (!(comp instanceof _Comparator)) {
27959
+ throw new TypeError("a Comparator is required");
27960
+ }
27961
+ if (this.operator === "") {
27962
+ if (this.value === "") {
27963
+ return true;
27964
+ }
27965
+ return new Range(comp.value, options).test(this.value);
27966
+ } else if (comp.operator === "") {
27967
+ if (comp.value === "") {
27968
+ return true;
27969
+ }
27970
+ return new Range(this.value, options).test(comp.semver);
27971
+ }
27972
+ options = parseOptions(options);
27973
+ if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
27974
+ return false;
27975
+ }
27976
+ if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
27977
+ return false;
27978
+ }
27979
+ if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
27980
+ return true;
27981
+ }
27982
+ if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
27983
+ return true;
27984
+ }
27985
+ if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
27986
+ return true;
27987
+ }
27988
+ if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
27989
+ return true;
27990
+ }
27991
+ if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
27992
+ return true;
27993
+ }
27994
+ return false;
27995
+ }
27996
+ };
27997
+ module2.exports = Comparator;
27998
+ var parseOptions = require_parse_options();
27999
+ var { safeRe: re, t } = require_re();
28000
+ var cmp = require_cmp();
28001
+ var debug = require_debug();
28002
+ var SemVer = require_semver();
28003
+ var Range = require_range();
28004
+ }
28005
+ });
28006
+
28007
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/satisfies.js
28008
+ var require_satisfies = __commonJS({
28009
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/satisfies.js"(exports, module2) {
28010
+ var Range = require_range();
28011
+ var satisfies = (version, range, options) => {
28012
+ try {
28013
+ range = new Range(range, options);
28014
+ } catch (er) {
28015
+ return false;
28016
+ }
28017
+ return range.test(version);
28018
+ };
28019
+ module2.exports = satisfies;
28020
+ }
28021
+ });
28022
+
28023
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/to-comparators.js
28024
+ var require_to_comparators = __commonJS({
28025
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/to-comparators.js"(exports, module2) {
28026
+ var Range = require_range();
28027
+ var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
28028
+ module2.exports = toComparators;
28029
+ }
28030
+ });
28031
+
28032
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/max-satisfying.js
28033
+ var require_max_satisfying = __commonJS({
28034
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/max-satisfying.js"(exports, module2) {
28035
+ var SemVer = require_semver();
28036
+ var Range = require_range();
28037
+ var maxSatisfying = (versions2, range, options) => {
28038
+ let max = null;
28039
+ let maxSV = null;
28040
+ let rangeObj = null;
28041
+ try {
28042
+ rangeObj = new Range(range, options);
28043
+ } catch (er) {
28044
+ return null;
28045
+ }
28046
+ versions2.forEach((v) => {
28047
+ if (rangeObj.test(v)) {
28048
+ if (!max || maxSV.compare(v) === -1) {
28049
+ max = v;
28050
+ maxSV = new SemVer(max, options);
28051
+ }
28052
+ }
28053
+ });
28054
+ return max;
28055
+ };
28056
+ module2.exports = maxSatisfying;
28057
+ }
28058
+ });
28059
+
28060
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/min-satisfying.js
28061
+ var require_min_satisfying = __commonJS({
28062
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/min-satisfying.js"(exports, module2) {
28063
+ var SemVer = require_semver();
28064
+ var Range = require_range();
28065
+ var minSatisfying = (versions2, range, options) => {
28066
+ let min = null;
28067
+ let minSV = null;
28068
+ let rangeObj = null;
28069
+ try {
28070
+ rangeObj = new Range(range, options);
28071
+ } catch (er) {
28072
+ return null;
28073
+ }
28074
+ versions2.forEach((v) => {
28075
+ if (rangeObj.test(v)) {
28076
+ if (!min || minSV.compare(v) === 1) {
28077
+ min = v;
28078
+ minSV = new SemVer(min, options);
28079
+ }
28080
+ }
28081
+ });
28082
+ return min;
28083
+ };
28084
+ module2.exports = minSatisfying;
28085
+ }
28086
+ });
28087
+
28088
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/min-version.js
28089
+ var require_min_version = __commonJS({
28090
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/min-version.js"(exports, module2) {
28091
+ var SemVer = require_semver();
28092
+ var Range = require_range();
28093
+ var gt = require_gt();
28094
+ var minVersion = (range, loose) => {
28095
+ range = new Range(range, loose);
28096
+ let minver = new SemVer("0.0.0");
28097
+ if (range.test(minver)) {
28098
+ return minver;
28099
+ }
28100
+ minver = new SemVer("0.0.0-0");
28101
+ if (range.test(minver)) {
28102
+ return minver;
28103
+ }
28104
+ minver = null;
28105
+ for (let i = 0; i < range.set.length; ++i) {
28106
+ const comparators = range.set[i];
28107
+ let setMin = null;
28108
+ comparators.forEach((comparator) => {
28109
+ const compver = new SemVer(comparator.semver.version);
28110
+ switch (comparator.operator) {
28111
+ case ">":
28112
+ if (compver.prerelease.length === 0) {
28113
+ compver.patch++;
28114
+ } else {
28115
+ compver.prerelease.push(0);
28116
+ }
28117
+ compver.raw = compver.format();
28118
+ case "":
28119
+ case ">=":
28120
+ if (!setMin || gt(compver, setMin)) {
28121
+ setMin = compver;
28122
+ }
28123
+ break;
28124
+ case "<":
28125
+ case "<=":
28126
+ break;
28127
+ default:
28128
+ throw new Error(`Unexpected operation: ${comparator.operator}`);
28129
+ }
28130
+ });
28131
+ if (setMin && (!minver || gt(minver, setMin))) {
28132
+ minver = setMin;
28133
+ }
28134
+ }
28135
+ if (minver && range.test(minver)) {
28136
+ return minver;
28137
+ }
28138
+ return null;
28139
+ };
28140
+ module2.exports = minVersion;
28141
+ }
28142
+ });
28143
+
28144
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/valid.js
28145
+ var require_valid2 = __commonJS({
28146
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/valid.js"(exports, module2) {
28147
+ var Range = require_range();
28148
+ var validRange = (range, options) => {
28149
+ try {
28150
+ return new Range(range, options).range || "*";
28151
+ } catch (er) {
28152
+ return null;
28153
+ }
28154
+ };
28155
+ module2.exports = validRange;
28156
+ }
28157
+ });
28158
+
28159
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/outside.js
28160
+ var require_outside = __commonJS({
28161
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/outside.js"(exports, module2) {
28162
+ var SemVer = require_semver();
28163
+ var Comparator = require_comparator();
28164
+ var { ANY } = Comparator;
28165
+ var Range = require_range();
28166
+ var satisfies = require_satisfies();
28167
+ var gt = require_gt();
28168
+ var lt = require_lt();
28169
+ var lte = require_lte();
28170
+ var gte = require_gte();
28171
+ var outside = (version, range, hilo, options) => {
28172
+ version = new SemVer(version, options);
28173
+ range = new Range(range, options);
28174
+ let gtfn, ltefn, ltfn, comp, ecomp;
28175
+ switch (hilo) {
28176
+ case ">":
28177
+ gtfn = gt;
28178
+ ltefn = lte;
28179
+ ltfn = lt;
28180
+ comp = ">";
28181
+ ecomp = ">=";
28182
+ break;
28183
+ case "<":
28184
+ gtfn = lt;
28185
+ ltefn = gte;
28186
+ ltfn = gt;
28187
+ comp = "<";
28188
+ ecomp = "<=";
28189
+ break;
28190
+ default:
28191
+ throw new TypeError('Must provide a hilo val of "<" or ">"');
28192
+ }
28193
+ if (satisfies(version, range, options)) {
28194
+ return false;
28195
+ }
28196
+ for (let i = 0; i < range.set.length; ++i) {
28197
+ const comparators = range.set[i];
28198
+ let high = null;
28199
+ let low = null;
28200
+ comparators.forEach((comparator) => {
28201
+ if (comparator.semver === ANY) {
28202
+ comparator = new Comparator(">=0.0.0");
28203
+ }
28204
+ high = high || comparator;
28205
+ low = low || comparator;
28206
+ if (gtfn(comparator.semver, high.semver, options)) {
28207
+ high = comparator;
28208
+ } else if (ltfn(comparator.semver, low.semver, options)) {
28209
+ low = comparator;
28210
+ }
28211
+ });
28212
+ if (high.operator === comp || high.operator === ecomp) {
28213
+ return false;
28214
+ }
28215
+ if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
28216
+ return false;
28217
+ } else if (low.operator === ecomp && ltfn(version, low.semver)) {
28218
+ return false;
28219
+ }
28220
+ }
28221
+ return true;
28222
+ };
28223
+ module2.exports = outside;
28224
+ }
28225
+ });
28226
+
28227
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/gtr.js
28228
+ var require_gtr = __commonJS({
28229
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/gtr.js"(exports, module2) {
28230
+ var outside = require_outside();
28231
+ var gtr = (version, range, options) => outside(version, range, ">", options);
28232
+ module2.exports = gtr;
28233
+ }
28234
+ });
28235
+
28236
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/ltr.js
28237
+ var require_ltr = __commonJS({
28238
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/ltr.js"(exports, module2) {
28239
+ var outside = require_outside();
28240
+ var ltr = (version, range, options) => outside(version, range, "<", options);
28241
+ module2.exports = ltr;
28242
+ }
28243
+ });
28244
+
28245
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/intersects.js
28246
+ var require_intersects = __commonJS({
28247
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/intersects.js"(exports, module2) {
28248
+ var Range = require_range();
28249
+ var intersects = (r1, r2, options) => {
28250
+ r1 = new Range(r1, options);
28251
+ r2 = new Range(r2, options);
28252
+ return r1.intersects(r2, options);
28253
+ };
28254
+ module2.exports = intersects;
28255
+ }
28256
+ });
28257
+
28258
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/simplify.js
28259
+ var require_simplify = __commonJS({
28260
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/simplify.js"(exports, module2) {
28261
+ var satisfies = require_satisfies();
28262
+ var compare = require_compare();
28263
+ module2.exports = (versions2, range, options) => {
28264
+ const set2 = [];
28265
+ let first = null;
28266
+ let prev = null;
28267
+ const v = versions2.sort((a, b) => compare(a, b, options));
28268
+ for (const version of v) {
28269
+ const included = satisfies(version, range, options);
28270
+ if (included) {
28271
+ prev = version;
28272
+ if (!first) {
28273
+ first = version;
28274
+ }
28275
+ } else {
28276
+ if (prev) {
28277
+ set2.push([first, prev]);
28278
+ }
28279
+ prev = null;
28280
+ first = null;
28281
+ }
28282
+ }
28283
+ if (first) {
28284
+ set2.push([first, null]);
28285
+ }
28286
+ const ranges = [];
28287
+ for (const [min, max] of set2) {
28288
+ if (min === max) {
28289
+ ranges.push(min);
28290
+ } else if (!max && min === v[0]) {
28291
+ ranges.push("*");
28292
+ } else if (!max) {
28293
+ ranges.push(`>=${min}`);
28294
+ } else if (min === v[0]) {
28295
+ ranges.push(`<=${max}`);
28296
+ } else {
28297
+ ranges.push(`${min} - ${max}`);
28298
+ }
28299
+ }
28300
+ const simplified = ranges.join(" || ");
28301
+ const original = typeof range.raw === "string" ? range.raw : String(range);
28302
+ return simplified.length < original.length ? simplified : range;
28303
+ };
28304
+ }
28305
+ });
28306
+
28307
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/subset.js
28308
+ var require_subset = __commonJS({
28309
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/subset.js"(exports, module2) {
28310
+ var Range = require_range();
28311
+ var Comparator = require_comparator();
28312
+ var { ANY } = Comparator;
28313
+ var satisfies = require_satisfies();
28314
+ var compare = require_compare();
28315
+ var subset = (sub, dom, options = {}) => {
28316
+ if (sub === dom) {
28317
+ return true;
28318
+ }
28319
+ sub = new Range(sub, options);
28320
+ dom = new Range(dom, options);
28321
+ let sawNonNull = false;
28322
+ OUTER:
28323
+ for (const simpleSub of sub.set) {
28324
+ for (const simpleDom of dom.set) {
28325
+ const isSub = simpleSubset(simpleSub, simpleDom, options);
28326
+ sawNonNull = sawNonNull || isSub !== null;
28327
+ if (isSub) {
28328
+ continue OUTER;
28329
+ }
28330
+ }
28331
+ if (sawNonNull) {
28332
+ return false;
28333
+ }
28334
+ }
28335
+ return true;
28336
+ };
28337
+ var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
28338
+ var minimumVersion = [new Comparator(">=0.0.0")];
28339
+ var simpleSubset = (sub, dom, options) => {
28340
+ if (sub === dom) {
28341
+ return true;
28342
+ }
28343
+ if (sub.length === 1 && sub[0].semver === ANY) {
28344
+ if (dom.length === 1 && dom[0].semver === ANY) {
28345
+ return true;
28346
+ } else if (options.includePrerelease) {
28347
+ sub = minimumVersionWithPreRelease;
28348
+ } else {
28349
+ sub = minimumVersion;
28350
+ }
28351
+ }
28352
+ if (dom.length === 1 && dom[0].semver === ANY) {
28353
+ if (options.includePrerelease) {
28354
+ return true;
28355
+ } else {
28356
+ dom = minimumVersion;
28357
+ }
28358
+ }
28359
+ const eqSet = /* @__PURE__ */ new Set();
28360
+ let gt, lt;
28361
+ for (const c of sub) {
28362
+ if (c.operator === ">" || c.operator === ">=") {
28363
+ gt = higherGT(gt, c, options);
28364
+ } else if (c.operator === "<" || c.operator === "<=") {
28365
+ lt = lowerLT(lt, c, options);
28366
+ } else {
28367
+ eqSet.add(c.semver);
28368
+ }
28369
+ }
28370
+ if (eqSet.size > 1) {
28371
+ return null;
28372
+ }
28373
+ let gtltComp;
28374
+ if (gt && lt) {
28375
+ gtltComp = compare(gt.semver, lt.semver, options);
28376
+ if (gtltComp > 0) {
28377
+ return null;
28378
+ } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
28379
+ return null;
28380
+ }
28381
+ }
28382
+ for (const eq of eqSet) {
28383
+ if (gt && !satisfies(eq, String(gt), options)) {
28384
+ return null;
28385
+ }
28386
+ if (lt && !satisfies(eq, String(lt), options)) {
28387
+ return null;
28388
+ }
28389
+ for (const c of dom) {
28390
+ if (!satisfies(eq, String(c), options)) {
28391
+ return false;
28392
+ }
28393
+ }
28394
+ return true;
28395
+ }
28396
+ let higher, lower;
28397
+ let hasDomLT, hasDomGT;
28398
+ let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
28399
+ let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
28400
+ if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
28401
+ needDomLTPre = false;
28402
+ }
28403
+ for (const c of dom) {
28404
+ hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
28405
+ hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
28406
+ if (gt) {
28407
+ if (needDomGTPre) {
28408
+ if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
28409
+ needDomGTPre = false;
28410
+ }
28411
+ }
28412
+ if (c.operator === ">" || c.operator === ">=") {
28413
+ higher = higherGT(gt, c, options);
28414
+ if (higher === c && higher !== gt) {
28415
+ return false;
28416
+ }
28417
+ } else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) {
28418
+ return false;
28419
+ }
28420
+ }
28421
+ if (lt) {
28422
+ if (needDomLTPre) {
28423
+ if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
28424
+ needDomLTPre = false;
28425
+ }
28426
+ }
28427
+ if (c.operator === "<" || c.operator === "<=") {
28428
+ lower = lowerLT(lt, c, options);
28429
+ if (lower === c && lower !== lt) {
28430
+ return false;
28431
+ }
28432
+ } else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) {
28433
+ return false;
28434
+ }
28435
+ }
28436
+ if (!c.operator && (lt || gt) && gtltComp !== 0) {
28437
+ return false;
28438
+ }
28439
+ }
28440
+ if (gt && hasDomLT && !lt && gtltComp !== 0) {
28441
+ return false;
28442
+ }
28443
+ if (lt && hasDomGT && !gt && gtltComp !== 0) {
28444
+ return false;
28445
+ }
28446
+ if (needDomGTPre || needDomLTPre) {
28447
+ return false;
28448
+ }
28449
+ return true;
28450
+ };
28451
+ var higherGT = (a, b, options) => {
28452
+ if (!a) {
28453
+ return b;
28454
+ }
28455
+ const comp = compare(a.semver, b.semver, options);
28456
+ return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
28457
+ };
28458
+ var lowerLT = (a, b, options) => {
28459
+ if (!a) {
28460
+ return b;
28461
+ }
28462
+ const comp = compare(a.semver, b.semver, options);
28463
+ return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
28464
+ };
28465
+ module2.exports = subset;
28466
+ }
28467
+ });
28468
+
28469
+ // node_modules/.pnpm/semver@7.5.4/node_modules/semver/index.js
28470
+ var require_semver2 = __commonJS({
28471
+ "node_modules/.pnpm/semver@7.5.4/node_modules/semver/index.js"(exports, module2) {
28472
+ var internalRe = require_re();
28473
+ var constants = require_constants();
28474
+ var SemVer = require_semver();
28475
+ var identifiers = require_identifiers();
28476
+ var parse = require_parse();
28477
+ var valid = require_valid();
28478
+ var clean = require_clean();
28479
+ var inc = require_inc();
28480
+ var diff2 = require_diff();
28481
+ var major = require_major();
28482
+ var minor = require_minor();
28483
+ var patch = require_patch();
28484
+ var prerelease = require_prerelease();
28485
+ var compare = require_compare();
28486
+ var rcompare = require_rcompare();
28487
+ var compareLoose = require_compare_loose();
28488
+ var compareBuild = require_compare_build();
28489
+ var sort = require_sort();
28490
+ var rsort = require_rsort();
28491
+ var gt = require_gt();
28492
+ var lt = require_lt();
28493
+ var eq = require_eq();
28494
+ var neq = require_neq();
28495
+ var gte = require_gte();
28496
+ var lte = require_lte();
28497
+ var cmp = require_cmp();
28498
+ var coerce2 = require_coerce();
28499
+ var Comparator = require_comparator();
28500
+ var Range = require_range();
28501
+ var satisfies = require_satisfies();
28502
+ var toComparators = require_to_comparators();
28503
+ var maxSatisfying = require_max_satisfying();
28504
+ var minSatisfying = require_min_satisfying();
28505
+ var minVersion = require_min_version();
28506
+ var validRange = require_valid2();
28507
+ var outside = require_outside();
28508
+ var gtr = require_gtr();
28509
+ var ltr = require_ltr();
28510
+ var intersects = require_intersects();
28511
+ var simplifyRange = require_simplify();
28512
+ var subset = require_subset();
28513
+ module2.exports = {
28514
+ parse,
28515
+ valid,
28516
+ clean,
28517
+ inc,
28518
+ diff: diff2,
28519
+ major,
28520
+ minor,
28521
+ patch,
28522
+ prerelease,
28523
+ compare,
28524
+ rcompare,
28525
+ compareLoose,
28526
+ compareBuild,
28527
+ sort,
28528
+ rsort,
28529
+ gt,
28530
+ lt,
28531
+ eq,
28532
+ neq,
28533
+ gte,
28534
+ lte,
28535
+ cmp,
28536
+ coerce: coerce2,
28537
+ Comparator,
28538
+ Range,
28539
+ satisfies,
28540
+ toComparators,
28541
+ maxSatisfying,
28542
+ minSatisfying,
28543
+ minVersion,
28544
+ validRange,
28545
+ outside,
28546
+ gtr,
28547
+ ltr,
28548
+ intersects,
28549
+ simplifyRange,
28550
+ subset,
28551
+ SemVer,
28552
+ re: internalRe.re,
28553
+ src: internalRe.src,
28554
+ tokens: internalRe.t,
28555
+ SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
28556
+ RELEASE_TYPES: constants.RELEASE_TYPES,
28557
+ compareIdentifiers: identifiers.compareIdentifiers,
28558
+ rcompareIdentifiers: identifiers.rcompareIdentifiers
28559
+ };
28560
+ }
28561
+ });
28562
+
28563
+ // src/cli/utils.ts
28564
+ var import_semver, assertStudioNodeVersion, assertPackages, requiredApiVersion, assertOrmCoreVersion, ormCoreVersions;
28565
+ var init_utils3 = __esm({
28566
+ "src/cli/utils.ts"() {
28567
+ init_views();
28568
+ import_semver = __toESM(require_semver2());
28569
+ assertStudioNodeVersion = () => {
28570
+ if (import_semver.default.gte(process.version, "18.0.0"))
28571
+ return;
28572
+ err("Drizzle Studio requires NodeJS v18 or above");
28573
+ process.exit(1);
28574
+ };
28575
+ assertPackages = async (...pkgs) => {
28576
+ try {
28577
+ for (let i = 0; i < pkgs.length; i++) {
28578
+ const it = pkgs[i];
28579
+ await import(it);
28580
+ }
28581
+ } catch (e) {
28582
+ err(
28583
+ `please install required packages: ${pkgs.map((it) => `'${it}'`).join(" ")}`
28584
+ );
28585
+ process.exit(1);
28586
+ }
28587
+ };
28588
+ requiredApiVersion = 6;
28589
+ assertOrmCoreVersion = async () => {
28590
+ try {
28591
+ const { compatibilityVersion } = await import("drizzle-orm/version");
28592
+ if (compatibilityVersion && compatibilityVersion === requiredApiVersion)
28593
+ return;
28594
+ if (!compatibilityVersion || compatibilityVersion < requiredApiVersion) {
28595
+ console.log(
28596
+ "This version of drizzle-kit requires newer version of drizzle-orm\nPlease update drizzle-orm package to the latest version \u{1F44D}"
28597
+ );
28598
+ } else {
28599
+ console.log(
28600
+ "This version of drizzle-kit is outdated\nPlease update drizzle-kit package to the latest version \u{1F44D}"
28601
+ );
28602
+ }
28603
+ } catch (e) {
28604
+ console.log("Please install latest version of drizzle-orm");
28605
+ }
28606
+ process.exit(1);
28607
+ };
28608
+ ormCoreVersions = async () => {
28609
+ try {
28610
+ const { compatibilityVersion, npmVersion } = await import("drizzle-orm/version");
28611
+ return { compatibilityVersion, npmVersion };
28612
+ } catch (e) {
28613
+ return {};
28614
+ }
28615
+ };
28616
+ }
28617
+ });
28618
+
28619
+ // node_modules/.pnpm/sqlstring@2.3.3/node_modules/sqlstring/lib/SqlString.js
28620
+ var require_SqlString = __commonJS({
28621
+ "node_modules/.pnpm/sqlstring@2.3.3/node_modules/sqlstring/lib/SqlString.js"(exports) {
28622
+ var SqlString = exports;
28623
+ var ID_GLOBAL_REGEXP = /`/g;
28624
+ var QUAL_GLOBAL_REGEXP = /\./g;
28625
+ var CHARS_GLOBAL_REGEXP = /[\0\b\t\n\r\x1a\"\'\\]/g;
28626
+ var CHARS_ESCAPE_MAP = {
28627
+ "\0": "\\0",
28628
+ "\b": "\\b",
28629
+ " ": "\\t",
28630
+ "\n": "\\n",
28631
+ "\r": "\\r",
28632
+ "": "\\Z",
28633
+ '"': '\\"',
28634
+ "'": "\\'",
28635
+ "\\": "\\\\"
28636
+ };
28637
+ SqlString.escapeId = function escapeId(val, forbidQualified) {
28638
+ if (Array.isArray(val)) {
28639
+ var sql2 = "";
28640
+ for (var i = 0; i < val.length; i++) {
28641
+ sql2 += (i === 0 ? "" : ", ") + SqlString.escapeId(val[i], forbidQualified);
28642
+ }
28643
+ return sql2;
28644
+ } else if (forbidQualified) {
28645
+ return "`" + String(val).replace(ID_GLOBAL_REGEXP, "``") + "`";
28646
+ } else {
28647
+ return "`" + String(val).replace(ID_GLOBAL_REGEXP, "``").replace(QUAL_GLOBAL_REGEXP, "`.`") + "`";
28648
+ }
28649
+ };
28650
+ SqlString.escape = function escape2(val, stringifyObjects, timeZone) {
28651
+ if (val === void 0 || val === null) {
28652
+ return "NULL";
28653
+ }
28654
+ switch (typeof val) {
28655
+ case "boolean":
28656
+ return val ? "true" : "false";
28657
+ case "number":
28658
+ return val + "";
28659
+ case "object":
28660
+ if (Object.prototype.toString.call(val) === "[object Date]") {
28661
+ return SqlString.dateToString(val, timeZone || "local");
28662
+ } else if (Array.isArray(val)) {
28663
+ return SqlString.arrayToList(val, timeZone);
28664
+ } else if (Buffer.isBuffer(val)) {
28665
+ return SqlString.bufferToString(val);
28666
+ } else if (typeof val.toSqlString === "function") {
28667
+ return String(val.toSqlString());
28668
+ } else if (stringifyObjects) {
28669
+ return escapeString(val.toString());
28670
+ } else {
28671
+ return SqlString.objectToValues(val, timeZone);
28672
+ }
28673
+ default:
28674
+ return escapeString(val);
28675
+ }
28676
+ };
28677
+ SqlString.arrayToList = function arrayToList(array, timeZone) {
28678
+ var sql2 = "";
28679
+ for (var i = 0; i < array.length; i++) {
28680
+ var val = array[i];
28681
+ if (Array.isArray(val)) {
28682
+ sql2 += (i === 0 ? "" : ", ") + "(" + SqlString.arrayToList(val, timeZone) + ")";
28683
+ } else {
28684
+ sql2 += (i === 0 ? "" : ", ") + SqlString.escape(val, true, timeZone);
28685
+ }
28686
+ }
28687
+ return sql2;
28688
+ };
28689
+ SqlString.format = function format(sql2, values, stringifyObjects, timeZone) {
28690
+ if (values == null) {
28691
+ return sql2;
28692
+ }
28693
+ if (!Array.isArray(values)) {
28694
+ values = [values];
28695
+ }
28696
+ var chunkIndex = 0;
28697
+ var placeholdersRegex = /\?+/g;
28698
+ var result = "";
28699
+ var valuesIndex = 0;
28700
+ var match2;
28701
+ while (valuesIndex < values.length && (match2 = placeholdersRegex.exec(sql2))) {
28702
+ var len = match2[0].length;
28703
+ if (len > 2) {
28704
+ continue;
28705
+ }
28706
+ var value = len === 2 ? SqlString.escapeId(values[valuesIndex]) : SqlString.escape(values[valuesIndex], stringifyObjects, timeZone);
28707
+ result += sql2.slice(chunkIndex, match2.index) + value;
28708
+ chunkIndex = placeholdersRegex.lastIndex;
28709
+ valuesIndex++;
28710
+ }
28711
+ if (chunkIndex === 0) {
28712
+ return sql2;
28713
+ }
28714
+ if (chunkIndex < sql2.length) {
28715
+ return result + sql2.slice(chunkIndex);
28716
+ }
28717
+ return result;
28718
+ };
28719
+ SqlString.dateToString = function dateToString(date, timeZone) {
28720
+ var dt = new Date(date);
28721
+ if (isNaN(dt.getTime())) {
28722
+ return "NULL";
28723
+ }
28724
+ var year;
28725
+ var month;
28726
+ var day;
28727
+ var hour;
28728
+ var minute;
28729
+ var second;
28730
+ var millisecond;
28731
+ if (timeZone === "local") {
28732
+ year = dt.getFullYear();
28733
+ month = dt.getMonth() + 1;
28734
+ day = dt.getDate();
28735
+ hour = dt.getHours();
28736
+ minute = dt.getMinutes();
28737
+ second = dt.getSeconds();
28738
+ millisecond = dt.getMilliseconds();
28739
+ } else {
28740
+ var tz = convertTimezone(timeZone);
28741
+ if (tz !== false && tz !== 0) {
28742
+ dt.setTime(dt.getTime() + tz * 6e4);
28743
+ }
28744
+ year = dt.getUTCFullYear();
28745
+ month = dt.getUTCMonth() + 1;
28746
+ day = dt.getUTCDate();
28747
+ hour = dt.getUTCHours();
28748
+ minute = dt.getUTCMinutes();
28749
+ second = dt.getUTCSeconds();
28750
+ millisecond = dt.getUTCMilliseconds();
28751
+ }
28752
+ var str = zeroPad(year, 4) + "-" + zeroPad(month, 2) + "-" + zeroPad(day, 2) + " " + zeroPad(hour, 2) + ":" + zeroPad(minute, 2) + ":" + zeroPad(second, 2) + "." + zeroPad(millisecond, 3);
28753
+ return escapeString(str);
28754
+ };
28755
+ SqlString.bufferToString = function bufferToString(buffer) {
28756
+ return "X" + escapeString(buffer.toString("hex"));
28757
+ };
28758
+ SqlString.objectToValues = function objectToValues(object, timeZone) {
28759
+ var sql2 = "";
28760
+ for (var key in object) {
28761
+ var val = object[key];
28762
+ if (typeof val === "function") {
28763
+ continue;
28764
+ }
28765
+ sql2 += (sql2.length === 0 ? "" : ", ") + SqlString.escapeId(key) + " = " + SqlString.escape(val, true, timeZone);
28766
+ }
28767
+ return sql2;
28768
+ };
28769
+ SqlString.raw = function raw(sql2) {
28770
+ if (typeof sql2 !== "string") {
28771
+ throw new TypeError("argument sql must be a string");
28772
+ }
28773
+ return {
28774
+ toSqlString: function toSqlString() {
28775
+ return sql2;
28776
+ }
28777
+ };
28778
+ };
28779
+ function escapeString(val) {
28780
+ var chunkIndex = CHARS_GLOBAL_REGEXP.lastIndex = 0;
28781
+ var escapedVal = "";
28782
+ var match2;
28783
+ while (match2 = CHARS_GLOBAL_REGEXP.exec(val)) {
28784
+ escapedVal += val.slice(chunkIndex, match2.index) + CHARS_ESCAPE_MAP[match2[0]];
28785
+ chunkIndex = CHARS_GLOBAL_REGEXP.lastIndex;
28786
+ }
28787
+ if (chunkIndex === 0) {
28788
+ return "'" + val + "'";
28789
+ }
28790
+ if (chunkIndex < val.length) {
28791
+ return "'" + escapedVal + val.slice(chunkIndex) + "'";
28792
+ }
28793
+ return "'" + escapedVal + "'";
28794
+ }
28795
+ function zeroPad(number, length) {
28796
+ number = number.toString();
28797
+ while (number.length < length) {
28798
+ number = "0" + number;
28799
+ }
28800
+ return number;
28801
+ }
28802
+ function convertTimezone(tz) {
28803
+ if (tz === "Z") {
28804
+ return 0;
28805
+ }
28806
+ var m = tz.match(/([\+\-\s])(\d\d):?(\d\d)?/);
28807
+ if (m) {
28808
+ return (m[1] === "-" ? -1 : 1) * (parseInt(m[2], 10) + (m[3] ? parseInt(m[3], 10) : 0) / 60) * 60;
28809
+ }
28810
+ return false;
28811
+ }
28812
+ }
28813
+ });
28814
+
28815
+ // node_modules/.pnpm/sqlstring@2.3.3/node_modules/sqlstring/index.js
28816
+ var require_sqlstring = __commonJS({
28817
+ "node_modules/.pnpm/sqlstring@2.3.3/node_modules/sqlstring/index.js"(exports, module2) {
28818
+ module2.exports = require_SqlString();
28819
+ }
28820
+ });
28821
+
28822
+ // node_modules/.pnpm/denque@2.1.0/node_modules/denque/index.js
28823
+ var require_denque = __commonJS({
28824
+ "node_modules/.pnpm/denque@2.1.0/node_modules/denque/index.js"(exports, module2) {
28825
+ "use strict";
28826
+ function Denque(array, options) {
28827
+ var options = options || {};
28828
+ this._capacity = options.capacity;
28829
+ this._head = 0;
28830
+ this._tail = 0;
28831
+ if (Array.isArray(array)) {
28832
+ this._fromArray(array);
28833
+ } else {
28834
+ this._capacityMask = 3;
28835
+ this._list = new Array(4);
28836
+ }
28837
+ }
28838
+ Denque.prototype.peekAt = function peekAt(index4) {
28839
+ var i = index4;
28840
+ if (i !== (i | 0)) {
28841
+ return void 0;
27149
28842
  }
27150
- set allowStale(allowStale) {
27151
- this[ALLOW_STALE] = !!allowStale;
28843
+ var len = this.size();
28844
+ if (i >= len || i < -len)
28845
+ return void 0;
28846
+ if (i < 0)
28847
+ i += len;
28848
+ i = this._head + i & this._capacityMask;
28849
+ return this._list[i];
28850
+ };
28851
+ Denque.prototype.get = function get(i) {
28852
+ return this.peekAt(i);
28853
+ };
28854
+ Denque.prototype.peek = function peek() {
28855
+ if (this._head === this._tail)
28856
+ return void 0;
28857
+ return this._list[this._head];
28858
+ };
28859
+ Denque.prototype.peekFront = function peekFront() {
28860
+ return this.peek();
28861
+ };
28862
+ Denque.prototype.peekBack = function peekBack() {
28863
+ return this.peekAt(-1);
28864
+ };
28865
+ Object.defineProperty(Denque.prototype, "length", {
28866
+ get: function length() {
28867
+ return this.size();
27152
28868
  }
27153
- get allowStale() {
27154
- return this[ALLOW_STALE];
28869
+ });
28870
+ Denque.prototype.size = function size() {
28871
+ if (this._head === this._tail)
28872
+ return 0;
28873
+ if (this._head < this._tail)
28874
+ return this._tail - this._head;
28875
+ else
28876
+ return this._capacityMask + 1 - (this._head - this._tail);
28877
+ };
28878
+ Denque.prototype.unshift = function unshift(item) {
28879
+ if (arguments.length === 0)
28880
+ return this.size();
28881
+ var len = this._list.length;
28882
+ this._head = this._head - 1 + len & this._capacityMask;
28883
+ this._list[this._head] = item;
28884
+ if (this._tail === this._head)
28885
+ this._growArray();
28886
+ if (this._capacity && this.size() > this._capacity)
28887
+ this.pop();
28888
+ if (this._head < this._tail)
28889
+ return this._tail - this._head;
28890
+ else
28891
+ return this._capacityMask + 1 - (this._head - this._tail);
28892
+ };
28893
+ Denque.prototype.shift = function shift() {
28894
+ var head = this._head;
28895
+ if (head === this._tail)
28896
+ return void 0;
28897
+ var item = this._list[head];
28898
+ this._list[head] = void 0;
28899
+ this._head = head + 1 & this._capacityMask;
28900
+ if (head < 2 && this._tail > 1e4 && this._tail <= this._list.length >>> 2)
28901
+ this._shrinkArray();
28902
+ return item;
28903
+ };
28904
+ Denque.prototype.push = function push(item) {
28905
+ if (arguments.length === 0)
28906
+ return this.size();
28907
+ var tail = this._tail;
28908
+ this._list[tail] = item;
28909
+ this._tail = tail + 1 & this._capacityMask;
28910
+ if (this._tail === this._head) {
28911
+ this._growArray();
27155
28912
  }
27156
- set maxAge(mA) {
27157
- if (typeof mA !== "number")
27158
- throw new TypeError("maxAge must be a non-negative number");
27159
- this[MAX_AGE] = mA;
27160
- trim(this);
28913
+ if (this._capacity && this.size() > this._capacity) {
28914
+ this.shift();
27161
28915
  }
27162
- get maxAge() {
27163
- return this[MAX_AGE];
28916
+ if (this._head < this._tail)
28917
+ return this._tail - this._head;
28918
+ else
28919
+ return this._capacityMask + 1 - (this._head - this._tail);
28920
+ };
28921
+ Denque.prototype.pop = function pop() {
28922
+ var tail = this._tail;
28923
+ if (tail === this._head)
28924
+ return void 0;
28925
+ var len = this._list.length;
28926
+ this._tail = tail - 1 + len & this._capacityMask;
28927
+ var item = this._list[this._tail];
28928
+ this._list[this._tail] = void 0;
28929
+ if (this._head < 2 && tail > 1e4 && tail <= len >>> 2)
28930
+ this._shrinkArray();
28931
+ return item;
28932
+ };
28933
+ Denque.prototype.removeOne = function removeOne(index4) {
28934
+ var i = index4;
28935
+ if (i !== (i | 0)) {
28936
+ return void 0;
27164
28937
  }
27165
- // resize the cache when the lengthCalculator changes.
27166
- set lengthCalculator(lC) {
27167
- if (typeof lC !== "function")
27168
- lC = naiveLength;
27169
- if (lC !== this[LENGTH_CALCULATOR]) {
27170
- this[LENGTH_CALCULATOR] = lC;
27171
- this[LENGTH] = 0;
27172
- this[LRU_LIST].forEach((hit) => {
27173
- hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
27174
- this[LENGTH] += hit.length;
27175
- });
28938
+ if (this._head === this._tail)
28939
+ return void 0;
28940
+ var size = this.size();
28941
+ var len = this._list.length;
28942
+ if (i >= size || i < -size)
28943
+ return void 0;
28944
+ if (i < 0)
28945
+ i += size;
28946
+ i = this._head + i & this._capacityMask;
28947
+ var item = this._list[i];
28948
+ var k;
28949
+ if (index4 < size / 2) {
28950
+ for (k = index4; k > 0; k--) {
28951
+ this._list[i] = this._list[i = i - 1 + len & this._capacityMask];
27176
28952
  }
27177
- trim(this);
28953
+ this._list[i] = void 0;
28954
+ this._head = this._head + 1 + len & this._capacityMask;
28955
+ } else {
28956
+ for (k = size - 1 - index4; k > 0; k--) {
28957
+ this._list[i] = this._list[i = i + 1 + len & this._capacityMask];
28958
+ }
28959
+ this._list[i] = void 0;
28960
+ this._tail = this._tail - 1 + len & this._capacityMask;
27178
28961
  }
27179
- get lengthCalculator() {
27180
- return this[LENGTH_CALCULATOR];
28962
+ return item;
28963
+ };
28964
+ Denque.prototype.remove = function remove(index4, count) {
28965
+ var i = index4;
28966
+ var removed;
28967
+ var del_count = count;
28968
+ if (i !== (i | 0)) {
28969
+ return void 0;
27181
28970
  }
27182
- get length() {
27183
- return this[LENGTH];
28971
+ if (this._head === this._tail)
28972
+ return void 0;
28973
+ var size = this.size();
28974
+ var len = this._list.length;
28975
+ if (i >= size || i < -size || count < 1)
28976
+ return void 0;
28977
+ if (i < 0)
28978
+ i += size;
28979
+ if (count === 1 || !count) {
28980
+ removed = new Array(1);
28981
+ removed[0] = this.removeOne(i);
28982
+ return removed;
27184
28983
  }
27185
- get itemCount() {
27186
- return this[LRU_LIST].length;
28984
+ if (i === 0 && i + count >= size) {
28985
+ removed = this.toArray();
28986
+ this.clear();
28987
+ return removed;
27187
28988
  }
27188
- rforEach(fn, thisp) {
27189
- thisp = thisp || this;
27190
- for (let walker = this[LRU_LIST].tail; walker !== null; ) {
27191
- const prev = walker.prev;
27192
- forEachStep(this, fn, walker, thisp);
27193
- walker = prev;
27194
- }
28989
+ if (i + count > size)
28990
+ count = size - i;
28991
+ var k;
28992
+ removed = new Array(count);
28993
+ for (k = 0; k < count; k++) {
28994
+ removed[k] = this._list[this._head + i + k & this._capacityMask];
27195
28995
  }
27196
- forEach(fn, thisp) {
27197
- thisp = thisp || this;
27198
- for (let walker = this[LRU_LIST].head; walker !== null; ) {
27199
- const next = walker.next;
27200
- forEachStep(this, fn, walker, thisp);
27201
- walker = next;
28996
+ i = this._head + i & this._capacityMask;
28997
+ if (index4 + count === size) {
28998
+ this._tail = this._tail - count + len & this._capacityMask;
28999
+ for (k = count; k > 0; k--) {
29000
+ this._list[i = i + 1 + len & this._capacityMask] = void 0;
27202
29001
  }
29002
+ return removed;
27203
29003
  }
27204
- keys() {
27205
- return this[LRU_LIST].toArray().map((k) => k.key);
27206
- }
27207
- values() {
27208
- return this[LRU_LIST].toArray().map((k) => k.value);
27209
- }
27210
- reset() {
27211
- if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
27212
- this[LRU_LIST].forEach((hit) => this[DISPOSE](hit.key, hit.value));
29004
+ if (index4 === 0) {
29005
+ this._head = this._head + count + len & this._capacityMask;
29006
+ for (k = count - 1; k > 0; k--) {
29007
+ this._list[i = i + 1 + len & this._capacityMask] = void 0;
27213
29008
  }
27214
- this[CACHE] = /* @__PURE__ */ new Map();
27215
- this[LRU_LIST] = new Yallist();
27216
- this[LENGTH] = 0;
27217
- }
27218
- dump() {
27219
- return this[LRU_LIST].map((hit) => isStale(this, hit) ? false : {
27220
- k: hit.key,
27221
- v: hit.value,
27222
- e: hit.now + (hit.maxAge || 0)
27223
- }).toArray().filter((h) => h);
27224
- }
27225
- dumpLru() {
27226
- return this[LRU_LIST];
29009
+ return removed;
27227
29010
  }
27228
- set(key, value, maxAge) {
27229
- maxAge = maxAge || this[MAX_AGE];
27230
- if (maxAge && typeof maxAge !== "number")
27231
- throw new TypeError("maxAge must be a number");
27232
- const now = maxAge ? Date.now() : 0;
27233
- const len = this[LENGTH_CALCULATOR](value, key);
27234
- if (this[CACHE].has(key)) {
27235
- if (len > this[MAX]) {
27236
- del(this, this[CACHE].get(key));
27237
- return false;
27238
- }
27239
- const node = this[CACHE].get(key);
27240
- const item = node.value;
27241
- if (this[DISPOSE]) {
27242
- if (!this[NO_DISPOSE_ON_SET])
27243
- this[DISPOSE](key, item.value);
27244
- }
27245
- item.now = now;
27246
- item.maxAge = maxAge;
27247
- item.value = value;
27248
- this[LENGTH] += len - item.length;
27249
- item.length = len;
27250
- this.get(key);
27251
- trim(this);
27252
- return true;
29011
+ if (i < size / 2) {
29012
+ this._head = this._head + index4 + count + len & this._capacityMask;
29013
+ for (k = index4; k > 0; k--) {
29014
+ this.unshift(this._list[i = i - 1 + len & this._capacityMask]);
27253
29015
  }
27254
- const hit = new Entry(key, value, len, now, maxAge);
27255
- if (hit.length > this[MAX]) {
27256
- if (this[DISPOSE])
27257
- this[DISPOSE](key, value);
27258
- return false;
29016
+ i = this._head - 1 + len & this._capacityMask;
29017
+ while (del_count > 0) {
29018
+ this._list[i = i - 1 + len & this._capacityMask] = void 0;
29019
+ del_count--;
29020
+ }
29021
+ if (index4 < 0)
29022
+ this._tail = i;
29023
+ } else {
29024
+ this._tail = i;
29025
+ i = i + count + len & this._capacityMask;
29026
+ for (k = size - (count + index4); k > 0; k--) {
29027
+ this.push(this._list[i++]);
29028
+ }
29029
+ i = this._tail;
29030
+ while (del_count > 0) {
29031
+ this._list[i = i + 1 + len & this._capacityMask] = void 0;
29032
+ del_count--;
27259
29033
  }
27260
- this[LENGTH] += hit.length;
27261
- this[LRU_LIST].unshift(hit);
27262
- this[CACHE].set(key, this[LRU_LIST].head);
27263
- trim(this);
27264
- return true;
27265
- }
27266
- has(key) {
27267
- if (!this[CACHE].has(key))
27268
- return false;
27269
- const hit = this[CACHE].get(key).value;
27270
- return !isStale(this, hit);
27271
- }
27272
- get(key) {
27273
- return get(this, key, true);
27274
- }
27275
- peek(key) {
27276
- return get(this, key, false);
27277
- }
27278
- pop() {
27279
- const node = this[LRU_LIST].tail;
27280
- if (!node)
27281
- return null;
27282
- del(this, node);
27283
- return node.value;
27284
29034
  }
27285
- del(key) {
27286
- del(this, this[CACHE].get(key));
29035
+ if (this._head < 2 && this._tail > 1e4 && this._tail <= len >>> 2)
29036
+ this._shrinkArray();
29037
+ return removed;
29038
+ };
29039
+ Denque.prototype.splice = function splice(index4, count) {
29040
+ var i = index4;
29041
+ if (i !== (i | 0)) {
29042
+ return void 0;
27287
29043
  }
27288
- load(arr) {
27289
- this.reset();
27290
- const now = Date.now();
27291
- for (let l = arr.length - 1; l >= 0; l--) {
27292
- const hit = arr[l];
27293
- const expiresAt = hit.e || 0;
27294
- if (expiresAt === 0)
27295
- this.set(hit.k, hit.v);
27296
- else {
27297
- const maxAge = expiresAt - now;
27298
- if (maxAge > 0) {
27299
- this.set(hit.k, hit.v, maxAge);
29044
+ var size = this.size();
29045
+ if (i < 0)
29046
+ i += size;
29047
+ if (i > size)
29048
+ return void 0;
29049
+ if (arguments.length > 2) {
29050
+ var k;
29051
+ var temp;
29052
+ var removed;
29053
+ var arg_len = arguments.length;
29054
+ var len = this._list.length;
29055
+ var arguments_index = 2;
29056
+ if (!size || i < size / 2) {
29057
+ temp = new Array(i);
29058
+ for (k = 0; k < i; k++) {
29059
+ temp[k] = this._list[this._head + k & this._capacityMask];
29060
+ }
29061
+ if (count === 0) {
29062
+ removed = [];
29063
+ if (i > 0) {
29064
+ this._head = this._head + i + len & this._capacityMask;
27300
29065
  }
29066
+ } else {
29067
+ removed = this.remove(i, count);
29068
+ this._head = this._head + i + len & this._capacityMask;
29069
+ }
29070
+ while (arg_len > arguments_index) {
29071
+ this.unshift(arguments[--arg_len]);
29072
+ }
29073
+ for (k = i; k > 0; k--) {
29074
+ this.unshift(temp[k - 1]);
27301
29075
  }
27302
- }
27303
- }
27304
- prune() {
27305
- this[CACHE].forEach((value, key) => get(this, key, false));
27306
- }
27307
- };
27308
- var get = (self2, key, doUse) => {
27309
- const node = self2[CACHE].get(key);
27310
- if (node) {
27311
- const hit = node.value;
27312
- if (isStale(self2, hit)) {
27313
- del(self2, node);
27314
- if (!self2[ALLOW_STALE])
27315
- return void 0;
27316
29076
  } else {
27317
- if (doUse) {
27318
- if (self2[UPDATE_AGE_ON_GET])
27319
- node.value.now = Date.now();
27320
- self2[LRU_LIST].unshiftNode(node);
29077
+ temp = new Array(size - (i + count));
29078
+ var leng = temp.length;
29079
+ for (k = 0; k < leng; k++) {
29080
+ temp[k] = this._list[this._head + i + count + k & this._capacityMask];
29081
+ }
29082
+ if (count === 0) {
29083
+ removed = [];
29084
+ if (i != size) {
29085
+ this._tail = this._head + i + len & this._capacityMask;
29086
+ }
29087
+ } else {
29088
+ removed = this.remove(i, count);
29089
+ this._tail = this._tail - leng + len & this._capacityMask;
29090
+ }
29091
+ while (arguments_index < arg_len) {
29092
+ this.push(arguments[arguments_index++]);
29093
+ }
29094
+ for (k = 0; k < leng; k++) {
29095
+ this.push(temp[k]);
27321
29096
  }
27322
29097
  }
27323
- return hit.value;
29098
+ return removed;
29099
+ } else {
29100
+ return this.remove(i, count);
27324
29101
  }
27325
29102
  };
27326
- var isStale = (self2, hit) => {
27327
- if (!hit || !hit.maxAge && !self2[MAX_AGE])
27328
- return false;
27329
- const diff2 = Date.now() - hit.now;
27330
- return hit.maxAge ? diff2 > hit.maxAge : self2[MAX_AGE] && diff2 > self2[MAX_AGE];
29103
+ Denque.prototype.clear = function clear() {
29104
+ this._list = new Array(this._list.length);
29105
+ this._head = 0;
29106
+ this._tail = 0;
27331
29107
  };
27332
- var trim = (self2) => {
27333
- if (self2[LENGTH] > self2[MAX]) {
27334
- for (let walker = self2[LRU_LIST].tail; self2[LENGTH] > self2[MAX] && walker !== null; ) {
27335
- const prev = walker.prev;
27336
- del(self2, walker);
27337
- walker = prev;
27338
- }
27339
- }
29108
+ Denque.prototype.isEmpty = function isEmpty() {
29109
+ return this._head === this._tail;
27340
29110
  };
27341
- var del = (self2, node) => {
27342
- if (node) {
27343
- const hit = node.value;
27344
- if (self2[DISPOSE])
27345
- self2[DISPOSE](hit.key, hit.value);
27346
- self2[LENGTH] -= hit.length;
27347
- self2[CACHE].delete(hit.key);
27348
- self2[LRU_LIST].removeNode(node);
27349
- }
29111
+ Denque.prototype.toArray = function toArray() {
29112
+ return this._copyArray(false);
27350
29113
  };
27351
- var Entry = class {
27352
- constructor(key, value, length, now, maxAge) {
27353
- this.key = key;
27354
- this.value = value;
27355
- this.length = length;
27356
- this.now = now;
27357
- this.maxAge = maxAge || 0;
29114
+ Denque.prototype._fromArray = function _fromArray(array) {
29115
+ var length = array.length;
29116
+ var capacity = this._nextPowerOf2(length);
29117
+ this._list = new Array(capacity);
29118
+ this._capacityMask = capacity - 1;
29119
+ this._tail = length;
29120
+ for (var i = 0; i < length; i++)
29121
+ this._list[i] = array[i];
29122
+ };
29123
+ Denque.prototype._copyArray = function _copyArray(fullCopy, size) {
29124
+ var src = this._list;
29125
+ var capacity = src.length;
29126
+ var length = this.length;
29127
+ size = size | length;
29128
+ if (size == length && this._head < this._tail) {
29129
+ return this._list.slice(this._head, this._tail);
27358
29130
  }
29131
+ var dest = new Array(size);
29132
+ var k = 0;
29133
+ var i;
29134
+ if (fullCopy || this._head > this._tail) {
29135
+ for (i = this._head; i < capacity; i++)
29136
+ dest[k++] = src[i];
29137
+ for (i = 0; i < this._tail; i++)
29138
+ dest[k++] = src[i];
29139
+ } else {
29140
+ for (i = this._head; i < this._tail; i++)
29141
+ dest[k++] = src[i];
29142
+ }
29143
+ return dest;
27359
29144
  };
27360
- var forEachStep = (self2, fn, node, thisp) => {
27361
- let hit = node.value;
27362
- if (isStale(self2, hit)) {
27363
- del(self2, node);
27364
- if (!self2[ALLOW_STALE])
27365
- hit = void 0;
29145
+ Denque.prototype._growArray = function _growArray() {
29146
+ if (this._head != 0) {
29147
+ var newList = this._copyArray(true, this._list.length << 1);
29148
+ this._tail = this._list.length;
29149
+ this._head = 0;
29150
+ this._list = newList;
29151
+ } else {
29152
+ this._tail = this._list.length;
29153
+ this._list.length <<= 1;
27366
29154
  }
27367
- if (hit)
27368
- fn.call(thisp, hit.value, hit.key, self2);
29155
+ this._capacityMask = this._capacityMask << 1 | 1;
27369
29156
  };
27370
- module2.exports = LRUCache;
29157
+ Denque.prototype._shrinkArray = function _shrinkArray() {
29158
+ this._list.length >>>= 1;
29159
+ this._capacityMask >>>= 1;
29160
+ };
29161
+ Denque.prototype._nextPowerOf2 = function _nextPowerOf2(num) {
29162
+ var log2 = Math.log(num) / Math.log(2);
29163
+ var nextPow2 = 1 << log2 + 1;
29164
+ return Math.max(nextPow2, 4);
29165
+ };
29166
+ module2.exports = Denque;
27371
29167
  }
27372
29168
  });
27373
29169
 
@@ -45637,7 +47433,7 @@ var require_expand = __commonJS({
45637
47433
  });
45638
47434
 
45639
47435
  // node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/constants.js
45640
- var require_constants = __commonJS({
47436
+ var require_constants2 = __commonJS({
45641
47437
  "node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/constants.js"(exports, module2) {
45642
47438
  "use strict";
45643
47439
  module2.exports = {
@@ -45738,7 +47534,7 @@ var require_constants = __commonJS({
45738
47534
  });
45739
47535
 
45740
47536
  // node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/parse.js
45741
- var require_parse = __commonJS({
47537
+ var require_parse2 = __commonJS({
45742
47538
  "node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/parse.js"(exports, module2) {
45743
47539
  "use strict";
45744
47540
  var stringify = require_stringify();
@@ -45770,7 +47566,7 @@ var require_parse = __commonJS({
45770
47566
  /* ' */
45771
47567
  CHAR_NO_BREAK_SPACE,
45772
47568
  CHAR_ZERO_WIDTH_NOBREAK_SPACE
45773
- } = require_constants();
47569
+ } = require_constants2();
45774
47570
  var parse = (input, options = {}) => {
45775
47571
  if (typeof input !== "string") {
45776
47572
  throw new TypeError("Expected a string");
@@ -45988,7 +47784,7 @@ var require_braces = __commonJS({
45988
47784
  var stringify = require_stringify();
45989
47785
  var compile = require_compile();
45990
47786
  var expand2 = require_expand();
45991
- var parse = require_parse();
47787
+ var parse = require_parse2();
45992
47788
  var braces = (input, options = {}) => {
45993
47789
  let output = [];
45994
47790
  if (Array.isArray(input)) {
@@ -46045,7 +47841,7 @@ var require_braces = __commonJS({
46045
47841
  });
46046
47842
 
46047
47843
  // node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js
46048
- var require_constants2 = __commonJS({
47844
+ var require_constants3 = __commonJS({
46049
47845
  "node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js"(exports, module2) {
46050
47846
  "use strict";
46051
47847
  var path4 = require("path");
@@ -46252,7 +48048,7 @@ var require_utils5 = __commonJS({
46252
48048
  REGEX_REMOVE_BACKSLASH,
46253
48049
  REGEX_SPECIAL_CHARS,
46254
48050
  REGEX_SPECIAL_CHARS_GLOBAL
46255
- } = require_constants2();
48051
+ } = require_constants3();
46256
48052
  exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
46257
48053
  exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
46258
48054
  exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
@@ -46340,7 +48136,7 @@ var require_scan = __commonJS({
46340
48136
  /* ) */
46341
48137
  CHAR_RIGHT_SQUARE_BRACKET
46342
48138
  /* ] */
46343
- } = require_constants2();
48139
+ } = require_constants3();
46344
48140
  var isPathSeparator = (code) => {
46345
48141
  return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
46346
48142
  };
@@ -46638,10 +48434,10 @@ var require_scan = __commonJS({
46638
48434
  });
46639
48435
 
46640
48436
  // node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.js
46641
- var require_parse2 = __commonJS({
48437
+ var require_parse3 = __commonJS({
46642
48438
  "node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.js"(exports, module2) {
46643
48439
  "use strict";
46644
- var constants = require_constants2();
48440
+ var constants = require_constants3();
46645
48441
  var utils = require_utils5();
46646
48442
  var {
46647
48443
  MAX_LENGTH,
@@ -47424,9 +49220,9 @@ var require_picomatch = __commonJS({
47424
49220
  "use strict";
47425
49221
  var path4 = require("path");
47426
49222
  var scan = require_scan();
47427
- var parse = require_parse2();
49223
+ var parse = require_parse3();
47428
49224
  var utils = require_utils5();
47429
- var constants = require_constants2();
49225
+ var constants = require_constants3();
47430
49226
  var isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
47431
49227
  var picomatch = (glob2, options, returnState = false) => {
47432
49228
  if (Array.isArray(glob2)) {
@@ -48250,7 +50046,7 @@ var require_run_parallel = __commonJS({
48250
50046
  });
48251
50047
 
48252
50048
  // node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/constants.js
48253
- var require_constants3 = __commonJS({
50049
+ var require_constants4 = __commonJS({
48254
50050
  "node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/constants.js"(exports) {
48255
50051
  "use strict";
48256
50052
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -48329,7 +50125,7 @@ var require_async2 = __commonJS({
48329
50125
  exports.readdir = exports.readdirWithFileTypes = exports.read = void 0;
48330
50126
  var fsStat = require_out();
48331
50127
  var rpl = require_run_parallel();
48332
- var constants_1 = require_constants3();
50128
+ var constants_1 = require_constants4();
48333
50129
  var utils = require_utils7();
48334
50130
  var common = require_common2();
48335
50131
  function read(directory, settings, callback) {
@@ -48438,7 +50234,7 @@ var require_sync2 = __commonJS({
48438
50234
  Object.defineProperty(exports, "__esModule", { value: true });
48439
50235
  exports.readdir = exports.readdirWithFileTypes = exports.read = void 0;
48440
50236
  var fsStat = require_out();
48441
- var constants_1 = require_constants3();
50237
+ var constants_1 = require_constants4();
48442
50238
  var utils = require_utils7();
48443
50239
  var common = require_common2();
48444
50240
  function read(directory, settings) {
@@ -49432,7 +51228,7 @@ var require_partial = __commonJS({
49432
51228
  match(filepath) {
49433
51229
  const parts = filepath.split("/");
49434
51230
  const levels = parts.length;
49435
- const patterns = this._storage.filter((info2) => !info2.complete || info2.segments.length > levels);
51231
+ const patterns = this._storage.filter((info3) => !info3.complete || info3.segments.length > levels);
49436
51232
  for (const pattern of patterns) {
49437
51233
  const section = pattern.sections[0];
49438
51234
  if (!pattern.complete && levels > section.length) {
@@ -58340,12 +60136,22 @@ var init_studioUtils = __esm({
58340
60136
  assertPackages("pg");
58341
60137
  const { drizzle: drizzle2 } = await import("drizzle-orm/node-postgres");
58342
60138
  const pg = await Promise.resolve().then(() => __toESM(require_lib2()));
58343
- const db = drizzle2(new pg.default.Pool(connectionConfig.dbCredentials), {
60139
+ const client = new pg.default.Pool(connectionConfig.dbCredentials);
60140
+ const db = drizzle2(client, {
58344
60141
  logger: verbose
58345
60142
  });
60143
+ const proxy = async (params) => {
60144
+ const result = await client.query({
60145
+ text: params.sql,
60146
+ values: params.params,
60147
+ rowMode: "array"
60148
+ });
60149
+ return result.rows;
60150
+ };
58346
60151
  return {
58347
60152
  dialect: "pg",
58348
60153
  db,
60154
+ proxy,
58349
60155
  schema: pgSchema4,
58350
60156
  relations: relations4,
58351
60157
  ts
@@ -58357,9 +60163,18 @@ var init_studioUtils = __esm({
58357
60163
  const { createPool } = await Promise.resolve().then(() => __toESM(require_promise()));
58358
60164
  const client = createPool({ ...config.dbCredentials, connectionLimit: 1 });
58359
60165
  const db = drizzle2(client, { logger: verbose });
60166
+ const proxy = async (params) => {
60167
+ const result = await client.query({
60168
+ sql: params.sql,
60169
+ values: params.params,
60170
+ rowsAsArray: true
60171
+ });
60172
+ return result[0];
60173
+ };
58360
60174
  return {
58361
60175
  dialect: "mysql",
58362
60176
  db,
60177
+ proxy,
58363
60178
  schema: mysqlSchema4,
58364
60179
  relations: relations4,
58365
60180
  ts
@@ -58373,9 +60188,13 @@ var init_studioUtils = __esm({
58373
60188
  const db = drizzle2(execute2, creds.wranglerConfigPath, creds.dbName, {
58374
60189
  logger: verbose
58375
60190
  });
60191
+ const proxy = async (params) => {
60192
+ throw new Error("Proxy is not implemented for D1");
60193
+ };
58376
60194
  return {
58377
60195
  dialect: "sqlite",
58378
60196
  db,
60197
+ proxy,
58379
60198
  schema: sqliteSchema2,
58380
60199
  relations: relations4,
58381
60200
  ts
@@ -58387,9 +60206,14 @@ var init_studioUtils = __esm({
58387
60206
  const Database = await import("better-sqlite3");
58388
60207
  const client = new Database.default(creds.url);
58389
60208
  const db = drizzle2(client, { logger: verbose });
60209
+ const proxy = async (params) => {
60210
+ const sql2 = params.sql;
60211
+ return client.prepare(sql2).raw().all(params.params);
60212
+ };
58390
60213
  return {
58391
60214
  dialect: "sqlite",
58392
60215
  db,
60216
+ proxy,
58393
60217
  schema: sqliteSchema2,
58394
60218
  relations: relations4,
58395
60219
  ts
@@ -58404,9 +60228,16 @@ var init_studioUtils = __esm({
58404
60228
  client,
58405
60229
  { logger: verbose }
58406
60230
  );
60231
+ const proxy = async (params) => {
60232
+ return client.execute({
60233
+ sql: params.sql,
60234
+ args: params.params
60235
+ }).then((it) => it.rows.map((row) => Object.values(row)));
60236
+ };
58407
60237
  return {
58408
60238
  dialect: "sqlite",
58409
60239
  db,
60240
+ proxy,
58410
60241
  schema: sqliteSchema2,
58411
60242
  relations: relations4,
58412
60243
  ts
@@ -60243,7 +62074,7 @@ var package_default = {
60243
62074
  ]
60244
62075
  },
60245
62076
  dependencies: {
60246
- "@drizzle-team/studio": "^0.0.31",
62077
+ "@drizzle-team/studio": "^0.0.34",
60247
62078
  "@esbuild-kit/esm-loader": "^2.5.5",
60248
62079
  camelcase: "^7.0.1",
60249
62080
  chalk: "^5.2.0",
@@ -60254,6 +62085,7 @@ var package_default = {
60254
62085
  hanji: "^0.0.5",
60255
62086
  "json-diff": "0.9.0",
60256
62087
  minimatch: "^7.4.3",
62088
+ semver: "^7.5.4",
60257
62089
  wrangler: "^3.7.0",
60258
62090
  zod: "^3.20.2"
60259
62091
  },
@@ -60266,6 +62098,7 @@ var package_default = {
60266
62098
  "@types/minimatch": "^5.1.2",
60267
62099
  "@types/node": "^18.11.15",
60268
62100
  "@types/pg": "^8.10.7",
62101
+ "@types/semver": "^7.5.5",
60269
62102
  "@typescript-eslint/eslint-plugin": "^5.46.1",
60270
62103
  "@typescript-eslint/parser": "^5.46.1",
60271
62104
  ava: "^5.1.0",
@@ -61625,6 +63458,7 @@ var dropCommand = new import_commander.Command("drop").option("--out <out>", `Ou
61625
63458
  var studioCommand = new import_commander.Command("studio").option("--port <port>", "Custom port for drizzle studio [default=4983]").option("--host <host>", "Custom host for drizzle studio [default=0.0.0.0]").option("--verbose", "Print all stataments that are executed by Studio").option("--config <config>", `Config path [default=drizzle.config.ts]`).action(async (options) => {
61626
63459
  await printVersions();
61627
63460
  await assertOrmCoreVersion();
63461
+ assertStudioNodeVersion();
61628
63462
  const { validateStudio: validateStudio2 } = await Promise.resolve().then(() => (init_studio(), studio_exports));
61629
63463
  const drizzleConfig = await validateStudio2(options);
61630
63464
  const {