drizzle-kit 0.20.4-ab73d4a → 0.20.4-bf71f08

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