@prisma/internals 6.5.0-dev.6 → 6.5.0-dev.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/Generator.js +2 -2
  2. package/dist/WasmPanicRegistry.js +2 -2
  3. package/dist/{chunk-BAULBRMC.js → chunk-2HVLHMSG.js} +5 -5
  4. package/dist/{chunk-NXIWDQBF.js → chunk-3ERIN7PH.js} +5 -5
  5. package/dist/{chunk-UUQ4S65T.js → chunk-ANV3YPJD.js} +9 -10
  6. package/dist/{chunk-VXSQZXSR.js → chunk-ARND4V6U.js} +5 -5
  7. package/dist/{chunk-A4QWQE3W.js → chunk-ATFQZVBS.js} +11 -4
  8. package/dist/{chunk-IFSZX2CY.js → chunk-BD6PMPH6.js} +5 -5
  9. package/dist/{chunk-HOZFIXMD.js → chunk-BPZFDGKN.js} +5 -4
  10. package/dist/{chunk-XJYCAEPW.js → chunk-C4U4BLRS.js} +12 -12
  11. package/dist/{chunk-RECBVX6S.js → chunk-C7CD2SGJ.js} +10 -11
  12. package/dist/{chunk-T5RACBRF.js → chunk-CHMJ5V7I.js} +10 -10
  13. package/dist/{chunk-J54H6BFK.js → chunk-CJKJUJDM.js} +11 -11
  14. package/dist/{chunk-FHXAG4A2.js → chunk-CZL7DCL2.js} +5 -5
  15. package/dist/{chunk-ROTZP5QJ.js → chunk-EMFHU6EO.js} +8 -8
  16. package/dist/{chunk-2SWS7ZGF.js → chunk-ET3CVE7C.js} +7 -7
  17. package/dist/{chunk-K37NLZHJ.js → chunk-F5VONWMX.js} +140 -141
  18. package/dist/{chunk-XOWBYDC2.js → chunk-FGQRHT3O.js} +12 -12
  19. package/dist/{chunk-Z3HEQNNY.js → chunk-FVQIWJO4.js} +12 -12
  20. package/dist/{chunk-QIVUAERL.js → chunk-GXDYIY4M.js} +1653 -1762
  21. package/dist/{chunk-AYHH7FB3.js → chunk-JZNUDHUX.js} +12 -12
  22. package/dist/{chunk-54KM4LPR.js → chunk-KF2MND2G.js} +140 -141
  23. package/dist/chunk-KKGIKPIK.js +573 -0
  24. package/dist/{chunk-G4BGJ6IP.js → chunk-KTBNIQ7N.js} +5 -5
  25. package/dist/{chunk-5XRQ7ONW.js → chunk-NJQWZ447.js} +5 -5
  26. package/dist/{chunk-VQX3AXS3.js → chunk-OBYRC26D.js} +12 -12
  27. package/dist/{chunk-VFCLWUAB.js → chunk-OTBZ3JRP.js} +12 -12
  28. package/dist/{chunk-CCLACYA6.js → chunk-PDOGVXVW.js} +11 -11
  29. package/dist/{chunk-2WQROSIU.js → chunk-SDTTYDOH.js} +7 -7
  30. package/dist/{chunk-OYLZC5OV.js → chunk-TATYN3T2.js} +7 -7
  31. package/dist/{chunk-RL3K4V2J.js → chunk-V6Z564LJ.js} +978 -112
  32. package/dist/{chunk-I7ZVB43E.js → chunk-VDZ4XQ45.js} +5 -5
  33. package/dist/{chunk-6HAMFH75.js → chunk-WBX3N7EZ.js} +8 -8
  34. package/dist/{chunk-IWJ2BUYF.js → chunk-XLGODPZH.js} +5 -5
  35. package/dist/{chunk-635TMBAP.js → chunk-ZYW3HGSH.js} +8 -4
  36. package/dist/cli/checkUnsupportedDataProxy.js +25 -26
  37. package/dist/cli/getSchema.js +29 -30
  38. package/dist/cli/hashes.js +25 -26
  39. package/dist/engine-commands/errorHelpers.js +4 -4
  40. package/dist/engine-commands/formatSchema.js +24 -25
  41. package/dist/engine-commands/getConfig.js +12 -12
  42. package/dist/engine-commands/getDmmf.js +9 -9
  43. package/dist/engine-commands/getEngineVersion.js +5 -6
  44. package/dist/engine-commands/getEnginesMetaInfo.js +7 -8
  45. package/dist/engine-commands/index.js +35 -36
  46. package/dist/engine-commands/lintSchema.js +10 -10
  47. package/dist/engine-commands/mergeSchemas.js +9 -9
  48. package/dist/engine-commands/validate.js +9 -9
  49. package/dist/errorReporting.d.ts +1 -0
  50. package/dist/get-generators/generatorResolvers/generatorResolvers.js +24 -25
  51. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +24 -25
  52. package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +25 -26
  53. package/dist/get-generators/getGenerators.js +27 -28
  54. package/dist/get-generators/utils/getBinaryPathsByVersion.js +3 -4
  55. package/dist/getPackedPackage.js +3 -4
  56. package/dist/index.js +68 -69
  57. package/dist/panic.js +6 -6
  58. package/dist/resolveBinary.js +7 -8
  59. package/dist/schemaEngineCommands.js +8 -9
  60. package/dist/sendPanic.js +24 -25
  61. package/dist/utils/drawBox.js +2 -2
  62. package/dist/utils/getEnvPaths.js +24 -25
  63. package/dist/utils/getVersionFromPackageJson.js +3 -3
  64. package/dist/utils/handlePanic.js +24 -25
  65. package/dist/utils/isValidJsIdentifier.js +3 -3
  66. package/dist/utils/loadEnvFile.js +24 -25
  67. package/dist/wasm.js +5 -5
  68. package/package.json +14 -15
  69. package/dist/chunk-F3SIWK3J.js +0 -1404
  70. package/dist/chunk-H4J2FN2W.js +0 -796
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_RL3K4V2J_exports = {};
30
- __export(chunk_RL3K4V2J_exports, {
29
+ var chunk_V6Z564LJ_exports = {};
30
+ __export(chunk_V6Z564LJ_exports, {
31
31
  getPackedPackage: () => getPackedPackage,
32
32
  readPackageUp: () => readPackageUp,
33
33
  require_glob: () => require_glob,
@@ -35,14 +35,13 @@ __export(chunk_RL3K4V2J_exports, {
35
35
  require_minimatch: () => require_minimatch,
36
36
  require_p_map: () => require_p_map
37
37
  });
38
- module.exports = __toCommonJS(chunk_RL3K4V2J_exports);
38
+ module.exports = __toCommonJS(chunk_V6Z564LJ_exports);
39
39
  var import_chunk_YXD4CJDK = require("./chunk-YXD4CJDK.js");
40
40
  var import_chunk_LKTTJWFT = require("./chunk-LKTTJWFT.js");
41
- var import_chunk_T5RACBRF = require("./chunk-T5RACBRF.js");
41
+ var import_chunk_CHMJ5V7I = require("./chunk-CHMJ5V7I.js");
42
42
  var import_chunk_53LS3WUO = require("./chunk-53LS3WUO.js");
43
43
  var import_chunk_4E7A3GDU = require("./chunk-4E7A3GDU.js");
44
44
  var import_chunk_TZCE3PWZ = require("./chunk-TZCE3PWZ.js");
45
- var import_chunk_H4J2FN2W = require("./chunk-H4J2FN2W.js");
46
45
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
47
46
  var import_fs = __toESM(require("fs"));
48
47
  var import_path = __toESM(require("path"));
@@ -4724,7 +4723,7 @@ var require_lib6 = (0, import_chunk_WWAWV7DQ.__commonJS)({
4724
4723
  exports.default = highlight;
4725
4724
  exports.shouldHighlight = shouldHighlight;
4726
4725
  var _jsTokens = require_js_tokens();
4727
- var _helperValidatorIdentifier = (0, import_chunk_T5RACBRF.require_lib)();
4726
+ var _helperValidatorIdentifier = (0, import_chunk_CHMJ5V7I.require_lib)();
4728
4727
  var _chalk = _interopRequireWildcard(require_chalk(), true);
4729
4728
  function _getRequireWildcardCache(e) {
4730
4729
  if ("function" != typeof WeakMap) return null;
@@ -6812,7 +6811,7 @@ var require_validate_npm_package_license = (0, import_chunk_WWAWV7DQ.__commonJS)
6812
6811
  }
6813
6812
  });
6814
6813
  var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
6815
- "../../node_modules/.pnpm/lru-cache@10.2.0/node_modules/lru-cache/dist/commonjs/index.js"(exports) {
6814
+ "../../node_modules/.pnpm/lru-cache@10.4.3/node_modules/lru-cache/dist/commonjs/index.js"(exports) {
6816
6815
  "use strict";
6817
6816
  Object.defineProperty(exports, "__esModule", { value: true });
6818
6817
  exports.LRUCache = void 0;
@@ -6900,7 +6899,7 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
6900
6899
  _constructing = /* @__PURE__ */ new WeakMap();
6901
6900
  (0, import_chunk_WWAWV7DQ.__privateAdd)(_Stack, _constructing, false);
6902
6901
  var Stack = _Stack;
6903
- var _a, _b, _max, _maxSize, _dispose, _disposeAfter, _fetchMethod, _size, _calculatedSize, _keyMap, _keyList, _valList, _next, _prev, _head, _tail, _free, _disposed, _sizes, _starts, _ttls, _hasDispose, _hasFetchMethod, _hasDisposeAfter, _LRUCache_instances, initializeTTLTracking_fn, _updateItemAge, _statusTTL, _setItemTTL, _isStale, initializeSizeTracking_fn, _removeItemSize, _addItemSize, _requireSize, indexes_fn, rindexes_fn, isValidIndex_fn, evict_fn, backgroundFetch_fn, isBackgroundFetch_fn, connect_fn, moveToTail_fn;
6902
+ var _a, _b, _max, _maxSize, _dispose, _disposeAfter, _fetchMethod, _memoMethod, _size, _calculatedSize, _keyMap, _keyList, _valList, _next, _prev, _head, _tail, _free, _disposed, _sizes, _starts, _ttls, _hasDispose, _hasFetchMethod, _hasDisposeAfter, _LRUCache_instances, initializeTTLTracking_fn, _updateItemAge, _statusTTL, _setItemTTL, _isStale, initializeSizeTracking_fn, _removeItemSize, _addItemSize, _requireSize, indexes_fn, rindexes_fn, isValidIndex_fn, evict_fn, backgroundFetch_fn, isBackgroundFetch_fn, connect_fn, moveToTail_fn, delete_fn, clear_fn;
6904
6903
  var _LRUCache = class _LRUCache2 {
6905
6904
  constructor(options) {
6906
6905
  (0, import_chunk_WWAWV7DQ.__privateAdd)(this, _LRUCache_instances);
@@ -6909,6 +6908,7 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
6909
6908
  (0, import_chunk_WWAWV7DQ.__privateAdd)(this, _dispose);
6910
6909
  (0, import_chunk_WWAWV7DQ.__privateAdd)(this, _disposeAfter);
6911
6910
  (0, import_chunk_WWAWV7DQ.__privateAdd)(this, _fetchMethod);
6911
+ (0, import_chunk_WWAWV7DQ.__privateAdd)(this, _memoMethod);
6912
6912
  (0, import_chunk_WWAWV7DQ.__publicField)(this, "ttl");
6913
6913
  (0, import_chunk_WWAWV7DQ.__publicField)(this, "ttlResolution");
6914
6914
  (0, import_chunk_WWAWV7DQ.__publicField)(this, "ttlAutopurge");
@@ -6959,7 +6959,7 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
6959
6959
  return 0;
6960
6960
  });
6961
6961
  (0, import_chunk_WWAWV7DQ.__publicField)(this, _a, "LRUCache");
6962
- const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options;
6962
+ const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options;
6963
6963
  if (max !== 0 && !isPosInt(max)) {
6964
6964
  throw new TypeError("max option must be a nonnegative integer");
6965
6965
  }
@@ -6979,6 +6979,10 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
6979
6979
  throw new TypeError("sizeCalculation set to non-function");
6980
6980
  }
6981
6981
  }
6982
+ if (memoMethod !== void 0 && typeof memoMethod !== "function") {
6983
+ throw new TypeError("memoMethod must be a function if defined");
6984
+ }
6985
+ (0, import_chunk_WWAWV7DQ.__privateSet)(this, _memoMethod, memoMethod);
6982
6986
  if (fetchMethod !== void 0 && typeof fetchMethod !== "function") {
6983
6987
  throw new TypeError("fetchMethod must be a function if specified");
6984
6988
  }
@@ -7133,6 +7137,9 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
7133
7137
  get fetchMethod() {
7134
7138
  return (0, import_chunk_WWAWV7DQ.__privateGet)(this, _fetchMethod);
7135
7139
  }
7140
+ get memoMethod() {
7141
+ return (0, import_chunk_WWAWV7DQ.__privateGet)(this, _memoMethod);
7142
+ }
7136
7143
  /**
7137
7144
  * {@link LRUCache.OptionsBase.dispose} (read-only)
7138
7145
  */
@@ -7146,7 +7153,8 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
7146
7153
  return (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposeAfter);
7147
7154
  }
7148
7155
  /**
7149
- * Return the remaining TTL time for a given entry key
7156
+ * Return the number of ms left in the item's TTL. If item is not in cache,
7157
+ * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.
7150
7158
  */
7151
7159
  getRemainingTTL(key) {
7152
7160
  return (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyMap).has(key) ? Infinity : 0;
@@ -7236,7 +7244,7 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
7236
7244
  }
7237
7245
  /**
7238
7246
  * Find a value for which the supplied fn method returns a truthy value,
7239
- * similar to Array.find(). fn is called as fn(value, key, cache).
7247
+ * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.
7240
7248
  */
7241
7249
  find(fn, getOptions = {}) {
7242
7250
  for (const i of (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, indexes_fn).call(this)) {
@@ -7250,10 +7258,15 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
7250
7258
  }
7251
7259
  }
7252
7260
  /**
7253
- * Call the supplied function on each item in the cache, in order from
7254
- * most recently used to least recently used. fn is called as
7255
- * fn(value, key, cache). Does not update age or recenty of use.
7256
- * Does not iterate over stale values.
7261
+ * Call the supplied function on each item in the cache, in order from most
7262
+ * recently used to least recently used.
7263
+ *
7264
+ * `fn` is called as `fn(value, key, cache)`.
7265
+ *
7266
+ * If `thisp` is provided, function will be called in the `this`-context of
7267
+ * the provided object, or the cache if no `thisp` object is provided.
7268
+ *
7269
+ * Does not update age or recenty of use, or iterate over stale values.
7257
7270
  */
7258
7271
  forEach(fn, thisp = this) {
7259
7272
  for (const i of (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, indexes_fn).call(this)) {
@@ -7285,7 +7298,7 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
7285
7298
  let deleted = false;
7286
7299
  for (const i of (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, rindexes_fn).call(this, { allowStale: true })) {
7287
7300
  if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _isStale).call(this, i)) {
7288
- this.delete((0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyList)[i]);
7301
+ (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, delete_fn).call(this, (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyList)[i], "expire");
7289
7302
  deleted = true;
7290
7303
  }
7291
7304
  }
@@ -7293,9 +7306,15 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
7293
7306
  }
7294
7307
  /**
7295
7308
  * Get the extended info about a given entry, to get its value, size, and
7296
- * TTL info simultaneously. Like {@link LRUCache#dump}, but just for a
7297
- * single key. Always returns stale values, if their info is found in the
7298
- * cache, so be sure to check for expired TTLs if relevant.
7309
+ * TTL info simultaneously. Returns `undefined` if the key is not present.
7310
+ *
7311
+ * Unlike {@link LRUCache#dump}, which is designed to be portable and survive
7312
+ * serialization, the `start` value is always the current timestamp, and the
7313
+ * `ttl` is a calculated remaining time to live (negative if expired).
7314
+ *
7315
+ * Always returns stale values, if their info is found in the cache, so be
7316
+ * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})
7317
+ * if relevant.
7299
7318
  */
7300
7319
  info(key) {
7301
7320
  const i = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyMap).get(key);
@@ -7322,7 +7341,16 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
7322
7341
  }
7323
7342
  /**
7324
7343
  * Return an array of [key, {@link LRUCache.Entry}] tuples which can be
7325
- * passed to cache.load()
7344
+ * passed to {@link LRLUCache#load}.
7345
+ *
7346
+ * The `start` fields are calculated relative to a portable `Date.now()`
7347
+ * timestamp, even if `performance.now()` is available.
7348
+ *
7349
+ * Stale entries are always included in the `dump`, even if
7350
+ * {@link LRUCache.OptionsBase.allowStale} is false.
7351
+ *
7352
+ * Note: this returns an actual array, not a generator, so it can be more
7353
+ * easily passed around.
7326
7354
  */
7327
7355
  dump() {
7328
7356
  const arr = [];
@@ -7347,8 +7375,12 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
7347
7375
  }
7348
7376
  /**
7349
7377
  * Reset the cache and load in the items in entries in the order listed.
7350
- * Note that the shape of the resulting cache may be different if the
7351
- * same options are not used in both caches.
7378
+ *
7379
+ * The shape of the resulting cache may be different if the same options are
7380
+ * not used in both caches.
7381
+ *
7382
+ * The `start` fields are assumed to be calculated relative to a portable
7383
+ * `Date.now()` timestamp, even if `performance.now()` is available.
7352
7384
  */
7353
7385
  load(arr) {
7354
7386
  this.clear();
@@ -7365,6 +7397,30 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
7365
7397
  *
7366
7398
  * Note: if `undefined` is specified as a value, this is an alias for
7367
7399
  * {@link LRUCache#delete}
7400
+ *
7401
+ * Fields on the {@link LRUCache.SetOptions} options param will override
7402
+ * their corresponding values in the constructor options for the scope
7403
+ * of this single `set()` operation.
7404
+ *
7405
+ * If `start` is provided, then that will set the effective start
7406
+ * time for the TTL calculation. Note that this must be a previous
7407
+ * value of `performance.now()` if supported, or a previous value of
7408
+ * `Date.now()` if not.
7409
+ *
7410
+ * Options object may also include `size`, which will prevent
7411
+ * calling the `sizeCalculation` function and just use the specified
7412
+ * number if it is a positive integer, and `noDisposeOnSet` which
7413
+ * will prevent calling a `dispose` function in the case of
7414
+ * overwrites.
7415
+ *
7416
+ * If the `size` (or return value of `sizeCalculation`) for a given
7417
+ * entry is greater than `maxEntrySize`, then the item will not be
7418
+ * added to the cache.
7419
+ *
7420
+ * Will update the recency of the entry.
7421
+ *
7422
+ * If the value is `undefined`, then this is an alias for
7423
+ * `cache.delete(key)`. `undefined` is never stored in the cache.
7368
7424
  */
7369
7425
  set(k, v, setOptions = {}) {
7370
7426
  var _a2, _b2, _c;
@@ -7380,7 +7436,7 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
7380
7436
  status.set = "miss";
7381
7437
  status.maxEntrySizeExceeded = true;
7382
7438
  }
7383
- this.delete(k);
7439
+ (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, delete_fn).call(this, k, "set");
7384
7440
  return this;
7385
7441
  }
7386
7442
  let index = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _size) === 0 ? void 0 : (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyMap).get(k);
@@ -7485,6 +7541,14 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
7485
7541
  * Will return false if the item is stale, even though it is technically
7486
7542
  * in the cache.
7487
7543
  *
7544
+ * Check if a key is in the cache, without updating the recency of
7545
+ * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set
7546
+ * to `true` in either the options or the constructor.
7547
+ *
7548
+ * Will return `false` if the item is stale, even though it is technically in
7549
+ * the cache. The difference can be determined (if it matters) by using a
7550
+ * `status` argument, and inspecting the `has` field.
7551
+ *
7488
7552
  * Will not update item age unless
7489
7553
  * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.
7490
7554
  */
@@ -7618,6 +7682,28 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
7618
7682
  return staleVal ? p.__staleWhileFetching : p.__returned = p;
7619
7683
  }
7620
7684
  }
7685
+ async forceFetch(k, fetchOptions = {}) {
7686
+ const v = await this.fetch(k, fetchOptions);
7687
+ if (v === void 0)
7688
+ throw new Error("fetch() returned undefined");
7689
+ return v;
7690
+ }
7691
+ memo(k, memoOptions = {}) {
7692
+ const memoMethod = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _memoMethod);
7693
+ if (!memoMethod) {
7694
+ throw new Error("no memoMethod provided to constructor");
7695
+ }
7696
+ const { context, forceRefresh, ...options } = memoOptions;
7697
+ const v = this.get(k, options);
7698
+ if (!forceRefresh && v !== void 0)
7699
+ return v;
7700
+ const vv = memoMethod(k, v, {
7701
+ options,
7702
+ context
7703
+ });
7704
+ this.set(k, vv, options);
7705
+ return vv;
7706
+ }
7621
7707
  /**
7622
7708
  * Return a value from the cache. Will update the recency of the cache
7623
7709
  * entry found.
@@ -7637,7 +7723,7 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
7637
7723
  status.get = "stale";
7638
7724
  if (!fetching) {
7639
7725
  if (!noDeleteOnStaleGet) {
7640
- this.delete(k);
7726
+ (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, delete_fn).call(this, k, "expire");
7641
7727
  }
7642
7728
  if (status && allowStale)
7643
7729
  status.returnedStale = true;
@@ -7666,98 +7752,17 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
7666
7752
  }
7667
7753
  /**
7668
7754
  * Deletes a key out of the cache.
7755
+ *
7669
7756
  * Returns true if the key was deleted, false otherwise.
7670
7757
  */
7671
7758
  delete(k) {
7672
- var _a2, _b2;
7673
- let deleted = false;
7674
- if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _size) !== 0) {
7675
- const index = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyMap).get(k);
7676
- if (index !== void 0) {
7677
- deleted = true;
7678
- if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _size) === 1) {
7679
- this.clear();
7680
- } else {
7681
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _removeItemSize).call(this, index);
7682
- const v = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _valList)[index];
7683
- if ((0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {
7684
- v.__abortController.abort(new Error("deleted"));
7685
- } else if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDispose) || (0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDisposeAfter)) {
7686
- if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDispose)) {
7687
- (_a2 = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _dispose)) == null ? void 0 : _a2.call(this, v, k, "delete");
7688
- }
7689
- if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDisposeAfter)) {
7690
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed)?.push([v, k, "delete"]);
7691
- }
7692
- }
7693
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyMap).delete(k);
7694
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyList)[index] = void 0;
7695
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _valList)[index] = void 0;
7696
- if (index === (0, import_chunk_WWAWV7DQ.__privateGet)(this, _tail)) {
7697
- (0, import_chunk_WWAWV7DQ.__privateSet)(this, _tail, (0, import_chunk_WWAWV7DQ.__privateGet)(this, _prev)[index]);
7698
- } else if (index === (0, import_chunk_WWAWV7DQ.__privateGet)(this, _head)) {
7699
- (0, import_chunk_WWAWV7DQ.__privateSet)(this, _head, (0, import_chunk_WWAWV7DQ.__privateGet)(this, _next)[index]);
7700
- } else {
7701
- const pi = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _prev)[index];
7702
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _next)[pi] = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _next)[index];
7703
- const ni = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _next)[index];
7704
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _prev)[ni] = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _prev)[index];
7705
- }
7706
- (0, import_chunk_WWAWV7DQ.__privateWrapper)(this, _size)._--;
7707
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _free).push(index);
7708
- }
7709
- }
7710
- }
7711
- if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDisposeAfter) && (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed)?.length) {
7712
- const dt = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed);
7713
- let task;
7714
- while (task = dt?.shift()) {
7715
- (_b2 = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposeAfter)) == null ? void 0 : _b2.call(this, ...task);
7716
- }
7717
- }
7718
- return deleted;
7759
+ return (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, delete_fn).call(this, k, "delete");
7719
7760
  }
7720
7761
  /**
7721
7762
  * Clear the cache entirely, throwing away all values.
7722
7763
  */
7723
7764
  clear() {
7724
- var _a2, _b2;
7725
- for (const index of (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, rindexes_fn).call(this, { allowStale: true })) {
7726
- const v = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _valList)[index];
7727
- if ((0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {
7728
- v.__abortController.abort(new Error("deleted"));
7729
- } else {
7730
- const k = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyList)[index];
7731
- if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDispose)) {
7732
- (_a2 = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _dispose)) == null ? void 0 : _a2.call(this, v, k, "delete");
7733
- }
7734
- if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDisposeAfter)) {
7735
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed)?.push([v, k, "delete"]);
7736
- }
7737
- }
7738
- }
7739
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyMap).clear();
7740
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _valList).fill(void 0);
7741
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyList).fill(void 0);
7742
- if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _ttls) && (0, import_chunk_WWAWV7DQ.__privateGet)(this, _starts)) {
7743
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _ttls).fill(0);
7744
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _starts).fill(0);
7745
- }
7746
- if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _sizes)) {
7747
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _sizes).fill(0);
7748
- }
7749
- (0, import_chunk_WWAWV7DQ.__privateSet)(this, _head, 0);
7750
- (0, import_chunk_WWAWV7DQ.__privateSet)(this, _tail, 0);
7751
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _free).length = 0;
7752
- (0, import_chunk_WWAWV7DQ.__privateSet)(this, _calculatedSize, 0);
7753
- (0, import_chunk_WWAWV7DQ.__privateSet)(this, _size, 0);
7754
- if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDisposeAfter) && (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed)) {
7755
- const dt = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed);
7756
- let task;
7757
- while (task = dt?.shift()) {
7758
- (_b2 = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposeAfter)) == null ? void 0 : _b2.call(this, ...task);
7759
- }
7760
- }
7765
+ return (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, clear_fn).call(this, "delete");
7761
7766
  }
7762
7767
  };
7763
7768
  _max = /* @__PURE__ */ new WeakMap();
@@ -7765,6 +7770,7 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
7765
7770
  _dispose = /* @__PURE__ */ new WeakMap();
7766
7771
  _disposeAfter = /* @__PURE__ */ new WeakMap();
7767
7772
  _fetchMethod = /* @__PURE__ */ new WeakMap();
7773
+ _memoMethod = /* @__PURE__ */ new WeakMap();
7768
7774
  _size = /* @__PURE__ */ new WeakMap();
7769
7775
  _calculatedSize = /* @__PURE__ */ new WeakMap();
7770
7776
  _keyMap = /* @__PURE__ */ new WeakMap();
@@ -7794,7 +7800,7 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
7794
7800
  if (ttl !== 0 && this.ttlAutopurge) {
7795
7801
  const t = setTimeout(() => {
7796
7802
  if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _isStale).call(this, index)) {
7797
- this.delete((0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyList)[index]);
7803
+ (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, delete_fn).call(this, (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyList)[index], "expire");
7798
7804
  }
7799
7805
  }, ttl + 1);
7800
7806
  if (t.unref) {
@@ -8003,7 +8009,7 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
8003
8009
  if (bf2.__staleWhileFetching) {
8004
8010
  (0, import_chunk_WWAWV7DQ.__privateGet)(this, _valList)[index] = bf2.__staleWhileFetching;
8005
8011
  } else {
8006
- this.delete(k);
8012
+ (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, delete_fn).call(this, k, "fetch");
8007
8013
  }
8008
8014
  } else {
8009
8015
  if (options.status)
@@ -8029,7 +8035,7 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
8029
8035
  if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _valList)[index] === p) {
8030
8036
  const del = !noDelete || bf2.__staleWhileFetching === void 0;
8031
8037
  if (del) {
8032
- this.delete(k);
8038
+ (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, delete_fn).call(this, k, "fetch");
8033
8039
  } else if (!allowStaleAborted) {
8034
8040
  (0, import_chunk_WWAWV7DQ.__privateGet)(this, _valList)[index] = bf2.__staleWhileFetching;
8035
8041
  }
@@ -8095,6 +8101,94 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
8095
8101
  (0, import_chunk_WWAWV7DQ.__privateSet)(this, _tail, index);
8096
8102
  }
8097
8103
  };
8104
+ delete_fn = function(k, reason) {
8105
+ var _a2, _b2;
8106
+ let deleted = false;
8107
+ if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _size) !== 0) {
8108
+ const index = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyMap).get(k);
8109
+ if (index !== void 0) {
8110
+ deleted = true;
8111
+ if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _size) === 1) {
8112
+ (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, clear_fn).call(this, reason);
8113
+ } else {
8114
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _removeItemSize).call(this, index);
8115
+ const v = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _valList)[index];
8116
+ if ((0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {
8117
+ v.__abortController.abort(new Error("deleted"));
8118
+ } else if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDispose) || (0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDisposeAfter)) {
8119
+ if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDispose)) {
8120
+ (_a2 = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _dispose)) == null ? void 0 : _a2.call(this, v, k, reason);
8121
+ }
8122
+ if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDisposeAfter)) {
8123
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed)?.push([v, k, reason]);
8124
+ }
8125
+ }
8126
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyMap).delete(k);
8127
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyList)[index] = void 0;
8128
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _valList)[index] = void 0;
8129
+ if (index === (0, import_chunk_WWAWV7DQ.__privateGet)(this, _tail)) {
8130
+ (0, import_chunk_WWAWV7DQ.__privateSet)(this, _tail, (0, import_chunk_WWAWV7DQ.__privateGet)(this, _prev)[index]);
8131
+ } else if (index === (0, import_chunk_WWAWV7DQ.__privateGet)(this, _head)) {
8132
+ (0, import_chunk_WWAWV7DQ.__privateSet)(this, _head, (0, import_chunk_WWAWV7DQ.__privateGet)(this, _next)[index]);
8133
+ } else {
8134
+ const pi = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _prev)[index];
8135
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _next)[pi] = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _next)[index];
8136
+ const ni = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _next)[index];
8137
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _prev)[ni] = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _prev)[index];
8138
+ }
8139
+ (0, import_chunk_WWAWV7DQ.__privateWrapper)(this, _size)._--;
8140
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _free).push(index);
8141
+ }
8142
+ }
8143
+ }
8144
+ if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDisposeAfter) && (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed)?.length) {
8145
+ const dt = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed);
8146
+ let task;
8147
+ while (task = dt?.shift()) {
8148
+ (_b2 = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposeAfter)) == null ? void 0 : _b2.call(this, ...task);
8149
+ }
8150
+ }
8151
+ return deleted;
8152
+ };
8153
+ clear_fn = function(reason) {
8154
+ var _a2, _b2;
8155
+ for (const index of (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, rindexes_fn).call(this, { allowStale: true })) {
8156
+ const v = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _valList)[index];
8157
+ if ((0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {
8158
+ v.__abortController.abort(new Error("deleted"));
8159
+ } else {
8160
+ const k = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyList)[index];
8161
+ if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDispose)) {
8162
+ (_a2 = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _dispose)) == null ? void 0 : _a2.call(this, v, k, reason);
8163
+ }
8164
+ if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDisposeAfter)) {
8165
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed)?.push([v, k, reason]);
8166
+ }
8167
+ }
8168
+ }
8169
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyMap).clear();
8170
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _valList).fill(void 0);
8171
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyList).fill(void 0);
8172
+ if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _ttls) && (0, import_chunk_WWAWV7DQ.__privateGet)(this, _starts)) {
8173
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _ttls).fill(0);
8174
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _starts).fill(0);
8175
+ }
8176
+ if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _sizes)) {
8177
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _sizes).fill(0);
8178
+ }
8179
+ (0, import_chunk_WWAWV7DQ.__privateSet)(this, _head, 0);
8180
+ (0, import_chunk_WWAWV7DQ.__privateSet)(this, _tail, 0);
8181
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _free).length = 0;
8182
+ (0, import_chunk_WWAWV7DQ.__privateSet)(this, _calculatedSize, 0);
8183
+ (0, import_chunk_WWAWV7DQ.__privateSet)(this, _size, 0);
8184
+ if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDisposeAfter) && (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed)) {
8185
+ const dt = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed);
8186
+ let task;
8187
+ while (task = dt?.shift()) {
8188
+ (_b2 = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposeAfter)) == null ? void 0 : _b2.call(this, ...task);
8189
+ }
8190
+ }
8191
+ };
8098
8192
  var LRUCache = _LRUCache;
8099
8193
  exports.LRUCache = LRUCache;
8100
8194
  }
@@ -9406,6 +9500,778 @@ var require_unique_string = (0, import_chunk_WWAWV7DQ.__commonJS)({
9406
9500
  module2.exports = () => cryptoRandomString(32);
9407
9501
  }
9408
9502
  });
9503
+ var require_polyfills = (0, import_chunk_WWAWV7DQ.__commonJS)({
9504
+ "../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/polyfills.js"(exports, module2) {
9505
+ "use strict";
9506
+ var constants = (0, import_chunk_WWAWV7DQ.__require)("constants");
9507
+ var origCwd = process.cwd;
9508
+ var cwd = null;
9509
+ var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
9510
+ process.cwd = function() {
9511
+ if (!cwd)
9512
+ cwd = origCwd.call(process);
9513
+ return cwd;
9514
+ };
9515
+ try {
9516
+ process.cwd();
9517
+ } catch (er) {
9518
+ }
9519
+ if (typeof process.chdir === "function") {
9520
+ chdir = process.chdir;
9521
+ process.chdir = function(d) {
9522
+ cwd = null;
9523
+ chdir.call(process, d);
9524
+ };
9525
+ if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir);
9526
+ }
9527
+ var chdir;
9528
+ module2.exports = patch;
9529
+ function patch(fs4) {
9530
+ if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
9531
+ patchLchmod(fs4);
9532
+ }
9533
+ if (!fs4.lutimes) {
9534
+ patchLutimes(fs4);
9535
+ }
9536
+ fs4.chown = chownFix(fs4.chown);
9537
+ fs4.fchown = chownFix(fs4.fchown);
9538
+ fs4.lchown = chownFix(fs4.lchown);
9539
+ fs4.chmod = chmodFix(fs4.chmod);
9540
+ fs4.fchmod = chmodFix(fs4.fchmod);
9541
+ fs4.lchmod = chmodFix(fs4.lchmod);
9542
+ fs4.chownSync = chownFixSync(fs4.chownSync);
9543
+ fs4.fchownSync = chownFixSync(fs4.fchownSync);
9544
+ fs4.lchownSync = chownFixSync(fs4.lchownSync);
9545
+ fs4.chmodSync = chmodFixSync(fs4.chmodSync);
9546
+ fs4.fchmodSync = chmodFixSync(fs4.fchmodSync);
9547
+ fs4.lchmodSync = chmodFixSync(fs4.lchmodSync);
9548
+ fs4.stat = statFix(fs4.stat);
9549
+ fs4.fstat = statFix(fs4.fstat);
9550
+ fs4.lstat = statFix(fs4.lstat);
9551
+ fs4.statSync = statFixSync(fs4.statSync);
9552
+ fs4.fstatSync = statFixSync(fs4.fstatSync);
9553
+ fs4.lstatSync = statFixSync(fs4.lstatSync);
9554
+ if (fs4.chmod && !fs4.lchmod) {
9555
+ fs4.lchmod = function(path5, mode, cb) {
9556
+ if (cb) process.nextTick(cb);
9557
+ };
9558
+ fs4.lchmodSync = function() {
9559
+ };
9560
+ }
9561
+ if (fs4.chown && !fs4.lchown) {
9562
+ fs4.lchown = function(path5, uid, gid, cb) {
9563
+ if (cb) process.nextTick(cb);
9564
+ };
9565
+ fs4.lchownSync = function() {
9566
+ };
9567
+ }
9568
+ if (platform === "win32") {
9569
+ fs4.rename = typeof fs4.rename !== "function" ? fs4.rename : function(fs$rename) {
9570
+ function rename(from, to, cb) {
9571
+ var start = Date.now();
9572
+ var backoff = 0;
9573
+ fs$rename(from, to, function CB(er) {
9574
+ if (er && (er.code === "EACCES" || er.code === "EPERM") && Date.now() - start < 6e4) {
9575
+ setTimeout(function() {
9576
+ fs4.stat(to, function(stater, st) {
9577
+ if (stater && stater.code === "ENOENT")
9578
+ fs$rename(from, to, CB);
9579
+ else
9580
+ cb(er);
9581
+ });
9582
+ }, backoff);
9583
+ if (backoff < 100)
9584
+ backoff += 10;
9585
+ return;
9586
+ }
9587
+ if (cb) cb(er);
9588
+ });
9589
+ }
9590
+ if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
9591
+ return rename;
9592
+ }(fs4.rename);
9593
+ }
9594
+ fs4.read = typeof fs4.read !== "function" ? fs4.read : function(fs$read) {
9595
+ function read(fd, buffer, offset, length, position, callback_) {
9596
+ var callback;
9597
+ if (callback_ && typeof callback_ === "function") {
9598
+ var eagCounter = 0;
9599
+ callback = function(er, _, __) {
9600
+ if (er && er.code === "EAGAIN" && eagCounter < 10) {
9601
+ eagCounter++;
9602
+ return fs$read.call(fs4, fd, buffer, offset, length, position, callback);
9603
+ }
9604
+ callback_.apply(this, arguments);
9605
+ };
9606
+ }
9607
+ return fs$read.call(fs4, fd, buffer, offset, length, position, callback);
9608
+ }
9609
+ if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
9610
+ return read;
9611
+ }(fs4.read);
9612
+ fs4.readSync = typeof fs4.readSync !== "function" ? fs4.readSync : /* @__PURE__ */ function(fs$readSync) {
9613
+ return function(fd, buffer, offset, length, position) {
9614
+ var eagCounter = 0;
9615
+ while (true) {
9616
+ try {
9617
+ return fs$readSync.call(fs4, fd, buffer, offset, length, position);
9618
+ } catch (er) {
9619
+ if (er.code === "EAGAIN" && eagCounter < 10) {
9620
+ eagCounter++;
9621
+ continue;
9622
+ }
9623
+ throw er;
9624
+ }
9625
+ }
9626
+ };
9627
+ }(fs4.readSync);
9628
+ function patchLchmod(fs5) {
9629
+ fs5.lchmod = function(path5, mode, callback) {
9630
+ fs5.open(
9631
+ path5,
9632
+ constants.O_WRONLY | constants.O_SYMLINK,
9633
+ mode,
9634
+ function(err, fd) {
9635
+ if (err) {
9636
+ if (callback) callback(err);
9637
+ return;
9638
+ }
9639
+ fs5.fchmod(fd, mode, function(err2) {
9640
+ fs5.close(fd, function(err22) {
9641
+ if (callback) callback(err2 || err22);
9642
+ });
9643
+ });
9644
+ }
9645
+ );
9646
+ };
9647
+ fs5.lchmodSync = function(path5, mode) {
9648
+ var fd = fs5.openSync(path5, constants.O_WRONLY | constants.O_SYMLINK, mode);
9649
+ var threw = true;
9650
+ var ret;
9651
+ try {
9652
+ ret = fs5.fchmodSync(fd, mode);
9653
+ threw = false;
9654
+ } finally {
9655
+ if (threw) {
9656
+ try {
9657
+ fs5.closeSync(fd);
9658
+ } catch (er) {
9659
+ }
9660
+ } else {
9661
+ fs5.closeSync(fd);
9662
+ }
9663
+ }
9664
+ return ret;
9665
+ };
9666
+ }
9667
+ function patchLutimes(fs5) {
9668
+ if (constants.hasOwnProperty("O_SYMLINK") && fs5.futimes) {
9669
+ fs5.lutimes = function(path5, at, mt, cb) {
9670
+ fs5.open(path5, constants.O_SYMLINK, function(er, fd) {
9671
+ if (er) {
9672
+ if (cb) cb(er);
9673
+ return;
9674
+ }
9675
+ fs5.futimes(fd, at, mt, function(er2) {
9676
+ fs5.close(fd, function(er22) {
9677
+ if (cb) cb(er2 || er22);
9678
+ });
9679
+ });
9680
+ });
9681
+ };
9682
+ fs5.lutimesSync = function(path5, at, mt) {
9683
+ var fd = fs5.openSync(path5, constants.O_SYMLINK);
9684
+ var ret;
9685
+ var threw = true;
9686
+ try {
9687
+ ret = fs5.futimesSync(fd, at, mt);
9688
+ threw = false;
9689
+ } finally {
9690
+ if (threw) {
9691
+ try {
9692
+ fs5.closeSync(fd);
9693
+ } catch (er) {
9694
+ }
9695
+ } else {
9696
+ fs5.closeSync(fd);
9697
+ }
9698
+ }
9699
+ return ret;
9700
+ };
9701
+ } else if (fs5.futimes) {
9702
+ fs5.lutimes = function(_a, _b, _c, cb) {
9703
+ if (cb) process.nextTick(cb);
9704
+ };
9705
+ fs5.lutimesSync = function() {
9706
+ };
9707
+ }
9708
+ }
9709
+ function chmodFix(orig) {
9710
+ if (!orig) return orig;
9711
+ return function(target, mode, cb) {
9712
+ return orig.call(fs4, target, mode, function(er) {
9713
+ if (chownErOk(er)) er = null;
9714
+ if (cb) cb.apply(this, arguments);
9715
+ });
9716
+ };
9717
+ }
9718
+ function chmodFixSync(orig) {
9719
+ if (!orig) return orig;
9720
+ return function(target, mode) {
9721
+ try {
9722
+ return orig.call(fs4, target, mode);
9723
+ } catch (er) {
9724
+ if (!chownErOk(er)) throw er;
9725
+ }
9726
+ };
9727
+ }
9728
+ function chownFix(orig) {
9729
+ if (!orig) return orig;
9730
+ return function(target, uid, gid, cb) {
9731
+ return orig.call(fs4, target, uid, gid, function(er) {
9732
+ if (chownErOk(er)) er = null;
9733
+ if (cb) cb.apply(this, arguments);
9734
+ });
9735
+ };
9736
+ }
9737
+ function chownFixSync(orig) {
9738
+ if (!orig) return orig;
9739
+ return function(target, uid, gid) {
9740
+ try {
9741
+ return orig.call(fs4, target, uid, gid);
9742
+ } catch (er) {
9743
+ if (!chownErOk(er)) throw er;
9744
+ }
9745
+ };
9746
+ }
9747
+ function statFix(orig) {
9748
+ if (!orig) return orig;
9749
+ return function(target, options, cb) {
9750
+ if (typeof options === "function") {
9751
+ cb = options;
9752
+ options = null;
9753
+ }
9754
+ function callback(er, stats) {
9755
+ if (stats) {
9756
+ if (stats.uid < 0) stats.uid += 4294967296;
9757
+ if (stats.gid < 0) stats.gid += 4294967296;
9758
+ }
9759
+ if (cb) cb.apply(this, arguments);
9760
+ }
9761
+ return options ? orig.call(fs4, target, options, callback) : orig.call(fs4, target, callback);
9762
+ };
9763
+ }
9764
+ function statFixSync(orig) {
9765
+ if (!orig) return orig;
9766
+ return function(target, options) {
9767
+ var stats = options ? orig.call(fs4, target, options) : orig.call(fs4, target);
9768
+ if (stats) {
9769
+ if (stats.uid < 0) stats.uid += 4294967296;
9770
+ if (stats.gid < 0) stats.gid += 4294967296;
9771
+ }
9772
+ return stats;
9773
+ };
9774
+ }
9775
+ function chownErOk(er) {
9776
+ if (!er)
9777
+ return true;
9778
+ if (er.code === "ENOSYS")
9779
+ return true;
9780
+ var nonroot = !process.getuid || process.getuid() !== 0;
9781
+ if (nonroot) {
9782
+ if (er.code === "EINVAL" || er.code === "EPERM")
9783
+ return true;
9784
+ }
9785
+ return false;
9786
+ }
9787
+ }
9788
+ }
9789
+ });
9790
+ var require_legacy_streams = (0, import_chunk_WWAWV7DQ.__commonJS)({
9791
+ "../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/legacy-streams.js"(exports, module2) {
9792
+ "use strict";
9793
+ var Stream = (0, import_chunk_WWAWV7DQ.__require)("stream").Stream;
9794
+ module2.exports = legacy;
9795
+ function legacy(fs4) {
9796
+ return {
9797
+ ReadStream,
9798
+ WriteStream
9799
+ };
9800
+ function ReadStream(path5, options) {
9801
+ if (!(this instanceof ReadStream)) return new ReadStream(path5, options);
9802
+ Stream.call(this);
9803
+ var self = this;
9804
+ this.path = path5;
9805
+ this.fd = null;
9806
+ this.readable = true;
9807
+ this.paused = false;
9808
+ this.flags = "r";
9809
+ this.mode = 438;
9810
+ this.bufferSize = 64 * 1024;
9811
+ options = options || {};
9812
+ var keys = Object.keys(options);
9813
+ for (var index = 0, length = keys.length; index < length; index++) {
9814
+ var key = keys[index];
9815
+ this[key] = options[key];
9816
+ }
9817
+ if (this.encoding) this.setEncoding(this.encoding);
9818
+ if (this.start !== void 0) {
9819
+ if ("number" !== typeof this.start) {
9820
+ throw TypeError("start must be a Number");
9821
+ }
9822
+ if (this.end === void 0) {
9823
+ this.end = Infinity;
9824
+ } else if ("number" !== typeof this.end) {
9825
+ throw TypeError("end must be a Number");
9826
+ }
9827
+ if (this.start > this.end) {
9828
+ throw new Error("start must be <= end");
9829
+ }
9830
+ this.pos = this.start;
9831
+ }
9832
+ if (this.fd !== null) {
9833
+ process.nextTick(function() {
9834
+ self._read();
9835
+ });
9836
+ return;
9837
+ }
9838
+ fs4.open(this.path, this.flags, this.mode, function(err, fd) {
9839
+ if (err) {
9840
+ self.emit("error", err);
9841
+ self.readable = false;
9842
+ return;
9843
+ }
9844
+ self.fd = fd;
9845
+ self.emit("open", fd);
9846
+ self._read();
9847
+ });
9848
+ }
9849
+ function WriteStream(path5, options) {
9850
+ if (!(this instanceof WriteStream)) return new WriteStream(path5, options);
9851
+ Stream.call(this);
9852
+ this.path = path5;
9853
+ this.fd = null;
9854
+ this.writable = true;
9855
+ this.flags = "w";
9856
+ this.encoding = "binary";
9857
+ this.mode = 438;
9858
+ this.bytesWritten = 0;
9859
+ options = options || {};
9860
+ var keys = Object.keys(options);
9861
+ for (var index = 0, length = keys.length; index < length; index++) {
9862
+ var key = keys[index];
9863
+ this[key] = options[key];
9864
+ }
9865
+ if (this.start !== void 0) {
9866
+ if ("number" !== typeof this.start) {
9867
+ throw TypeError("start must be a Number");
9868
+ }
9869
+ if (this.start < 0) {
9870
+ throw new Error("start must be >= zero");
9871
+ }
9872
+ this.pos = this.start;
9873
+ }
9874
+ this.busy = false;
9875
+ this._queue = [];
9876
+ if (this.fd === null) {
9877
+ this._open = fs4.open;
9878
+ this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
9879
+ this.flush();
9880
+ }
9881
+ }
9882
+ }
9883
+ }
9884
+ });
9885
+ var require_clone = (0, import_chunk_WWAWV7DQ.__commonJS)({
9886
+ "../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/clone.js"(exports, module2) {
9887
+ "use strict";
9888
+ module2.exports = clone;
9889
+ var getPrototypeOf = Object.getPrototypeOf || function(obj) {
9890
+ return obj.__proto__;
9891
+ };
9892
+ function clone(obj) {
9893
+ if (obj === null || typeof obj !== "object")
9894
+ return obj;
9895
+ if (obj instanceof Object)
9896
+ var copy = { __proto__: getPrototypeOf(obj) };
9897
+ else
9898
+ var copy = /* @__PURE__ */ Object.create(null);
9899
+ Object.getOwnPropertyNames(obj).forEach(function(key) {
9900
+ Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
9901
+ });
9902
+ return copy;
9903
+ }
9904
+ }
9905
+ });
9906
+ var require_graceful_fs = (0, import_chunk_WWAWV7DQ.__commonJS)({
9907
+ "../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/graceful-fs.js"(exports, module2) {
9908
+ "use strict";
9909
+ var fs4 = (0, import_chunk_WWAWV7DQ.__require)("fs");
9910
+ var polyfills = require_polyfills();
9911
+ var legacy = require_legacy_streams();
9912
+ var clone = require_clone();
9913
+ var util = (0, import_chunk_WWAWV7DQ.__require)("util");
9914
+ var gracefulQueue;
9915
+ var previousSymbol;
9916
+ if (typeof Symbol === "function" && typeof Symbol.for === "function") {
9917
+ gracefulQueue = Symbol.for("graceful-fs.queue");
9918
+ previousSymbol = Symbol.for("graceful-fs.previous");
9919
+ } else {
9920
+ gracefulQueue = "___graceful-fs.queue";
9921
+ previousSymbol = "___graceful-fs.previous";
9922
+ }
9923
+ function noop() {
9924
+ }
9925
+ function publishQueue(context, queue2) {
9926
+ Object.defineProperty(context, gracefulQueue, {
9927
+ get: function() {
9928
+ return queue2;
9929
+ }
9930
+ });
9931
+ }
9932
+ var debug = noop;
9933
+ if (util.debuglog)
9934
+ debug = util.debuglog("gfs4");
9935
+ else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
9936
+ debug = function() {
9937
+ var m = util.format.apply(util, arguments);
9938
+ m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
9939
+ console.error(m);
9940
+ };
9941
+ if (!fs4[gracefulQueue]) {
9942
+ queue = global[gracefulQueue] || [];
9943
+ publishQueue(fs4, queue);
9944
+ fs4.close = function(fs$close) {
9945
+ function close(fd, cb) {
9946
+ return fs$close.call(fs4, fd, function(err) {
9947
+ if (!err) {
9948
+ resetQueue();
9949
+ }
9950
+ if (typeof cb === "function")
9951
+ cb.apply(this, arguments);
9952
+ });
9953
+ }
9954
+ Object.defineProperty(close, previousSymbol, {
9955
+ value: fs$close
9956
+ });
9957
+ return close;
9958
+ }(fs4.close);
9959
+ fs4.closeSync = function(fs$closeSync) {
9960
+ function closeSync(fd) {
9961
+ fs$closeSync.apply(fs4, arguments);
9962
+ resetQueue();
9963
+ }
9964
+ Object.defineProperty(closeSync, previousSymbol, {
9965
+ value: fs$closeSync
9966
+ });
9967
+ return closeSync;
9968
+ }(fs4.closeSync);
9969
+ if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
9970
+ process.on("exit", function() {
9971
+ debug(fs4[gracefulQueue]);
9972
+ (0, import_chunk_WWAWV7DQ.__require)("assert").equal(fs4[gracefulQueue].length, 0);
9973
+ });
9974
+ }
9975
+ }
9976
+ var queue;
9977
+ if (!global[gracefulQueue]) {
9978
+ publishQueue(global, fs4[gracefulQueue]);
9979
+ }
9980
+ module2.exports = patch(clone(fs4));
9981
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs4.__patched) {
9982
+ module2.exports = patch(fs4);
9983
+ fs4.__patched = true;
9984
+ }
9985
+ function patch(fs5) {
9986
+ polyfills(fs5);
9987
+ fs5.gracefulify = patch;
9988
+ fs5.createReadStream = createReadStream;
9989
+ fs5.createWriteStream = createWriteStream;
9990
+ var fs$readFile = fs5.readFile;
9991
+ fs5.readFile = readFile;
9992
+ function readFile(path5, options, cb) {
9993
+ if (typeof options === "function")
9994
+ cb = options, options = null;
9995
+ return go$readFile(path5, options, cb);
9996
+ function go$readFile(path6, options2, cb2, startTime) {
9997
+ return fs$readFile(path6, options2, function(err) {
9998
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
9999
+ enqueue([go$readFile, [path6, options2, cb2], err, startTime || Date.now(), Date.now()]);
10000
+ else {
10001
+ if (typeof cb2 === "function")
10002
+ cb2.apply(this, arguments);
10003
+ }
10004
+ });
10005
+ }
10006
+ }
10007
+ var fs$writeFile = fs5.writeFile;
10008
+ fs5.writeFile = writeFile;
10009
+ function writeFile(path5, data, options, cb) {
10010
+ if (typeof options === "function")
10011
+ cb = options, options = null;
10012
+ return go$writeFile(path5, data, options, cb);
10013
+ function go$writeFile(path6, data2, options2, cb2, startTime) {
10014
+ return fs$writeFile(path6, data2, options2, function(err) {
10015
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
10016
+ enqueue([go$writeFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
10017
+ else {
10018
+ if (typeof cb2 === "function")
10019
+ cb2.apply(this, arguments);
10020
+ }
10021
+ });
10022
+ }
10023
+ }
10024
+ var fs$appendFile = fs5.appendFile;
10025
+ if (fs$appendFile)
10026
+ fs5.appendFile = appendFile;
10027
+ function appendFile(path5, data, options, cb) {
10028
+ if (typeof options === "function")
10029
+ cb = options, options = null;
10030
+ return go$appendFile(path5, data, options, cb);
10031
+ function go$appendFile(path6, data2, options2, cb2, startTime) {
10032
+ return fs$appendFile(path6, data2, options2, function(err) {
10033
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
10034
+ enqueue([go$appendFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
10035
+ else {
10036
+ if (typeof cb2 === "function")
10037
+ cb2.apply(this, arguments);
10038
+ }
10039
+ });
10040
+ }
10041
+ }
10042
+ var fs$copyFile = fs5.copyFile;
10043
+ if (fs$copyFile)
10044
+ fs5.copyFile = copyFile;
10045
+ function copyFile(src, dest, flags, cb) {
10046
+ if (typeof flags === "function") {
10047
+ cb = flags;
10048
+ flags = 0;
10049
+ }
10050
+ return go$copyFile(src, dest, flags, cb);
10051
+ function go$copyFile(src2, dest2, flags2, cb2, startTime) {
10052
+ return fs$copyFile(src2, dest2, flags2, function(err) {
10053
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
10054
+ enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
10055
+ else {
10056
+ if (typeof cb2 === "function")
10057
+ cb2.apply(this, arguments);
10058
+ }
10059
+ });
10060
+ }
10061
+ }
10062
+ var fs$readdir = fs5.readdir;
10063
+ fs5.readdir = readdir;
10064
+ var noReaddirOptionVersions = /^v[0-5]\./;
10065
+ function readdir(path5, options, cb) {
10066
+ if (typeof options === "function")
10067
+ cb = options, options = null;
10068
+ var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path6, options2, cb2, startTime) {
10069
+ return fs$readdir(path6, fs$readdirCallback(
10070
+ path6,
10071
+ options2,
10072
+ cb2,
10073
+ startTime
10074
+ ));
10075
+ } : function go$readdir2(path6, options2, cb2, startTime) {
10076
+ return fs$readdir(path6, options2, fs$readdirCallback(
10077
+ path6,
10078
+ options2,
10079
+ cb2,
10080
+ startTime
10081
+ ));
10082
+ };
10083
+ return go$readdir(path5, options, cb);
10084
+ function fs$readdirCallback(path6, options2, cb2, startTime) {
10085
+ return function(err, files) {
10086
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
10087
+ enqueue([
10088
+ go$readdir,
10089
+ [path6, options2, cb2],
10090
+ err,
10091
+ startTime || Date.now(),
10092
+ Date.now()
10093
+ ]);
10094
+ else {
10095
+ if (files && files.sort)
10096
+ files.sort();
10097
+ if (typeof cb2 === "function")
10098
+ cb2.call(this, err, files);
10099
+ }
10100
+ };
10101
+ }
10102
+ }
10103
+ if (process.version.substr(0, 4) === "v0.8") {
10104
+ var legStreams = legacy(fs5);
10105
+ ReadStream = legStreams.ReadStream;
10106
+ WriteStream = legStreams.WriteStream;
10107
+ }
10108
+ var fs$ReadStream = fs5.ReadStream;
10109
+ if (fs$ReadStream) {
10110
+ ReadStream.prototype = Object.create(fs$ReadStream.prototype);
10111
+ ReadStream.prototype.open = ReadStream$open;
10112
+ }
10113
+ var fs$WriteStream = fs5.WriteStream;
10114
+ if (fs$WriteStream) {
10115
+ WriteStream.prototype = Object.create(fs$WriteStream.prototype);
10116
+ WriteStream.prototype.open = WriteStream$open;
10117
+ }
10118
+ Object.defineProperty(fs5, "ReadStream", {
10119
+ get: function() {
10120
+ return ReadStream;
10121
+ },
10122
+ set: function(val) {
10123
+ ReadStream = val;
10124
+ },
10125
+ enumerable: true,
10126
+ configurable: true
10127
+ });
10128
+ Object.defineProperty(fs5, "WriteStream", {
10129
+ get: function() {
10130
+ return WriteStream;
10131
+ },
10132
+ set: function(val) {
10133
+ WriteStream = val;
10134
+ },
10135
+ enumerable: true,
10136
+ configurable: true
10137
+ });
10138
+ var FileReadStream = ReadStream;
10139
+ Object.defineProperty(fs5, "FileReadStream", {
10140
+ get: function() {
10141
+ return FileReadStream;
10142
+ },
10143
+ set: function(val) {
10144
+ FileReadStream = val;
10145
+ },
10146
+ enumerable: true,
10147
+ configurable: true
10148
+ });
10149
+ var FileWriteStream = WriteStream;
10150
+ Object.defineProperty(fs5, "FileWriteStream", {
10151
+ get: function() {
10152
+ return FileWriteStream;
10153
+ },
10154
+ set: function(val) {
10155
+ FileWriteStream = val;
10156
+ },
10157
+ enumerable: true,
10158
+ configurable: true
10159
+ });
10160
+ function ReadStream(path5, options) {
10161
+ if (this instanceof ReadStream)
10162
+ return fs$ReadStream.apply(this, arguments), this;
10163
+ else
10164
+ return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
10165
+ }
10166
+ function ReadStream$open() {
10167
+ var that = this;
10168
+ open(that.path, that.flags, that.mode, function(err, fd) {
10169
+ if (err) {
10170
+ if (that.autoClose)
10171
+ that.destroy();
10172
+ that.emit("error", err);
10173
+ } else {
10174
+ that.fd = fd;
10175
+ that.emit("open", fd);
10176
+ that.read();
10177
+ }
10178
+ });
10179
+ }
10180
+ function WriteStream(path5, options) {
10181
+ if (this instanceof WriteStream)
10182
+ return fs$WriteStream.apply(this, arguments), this;
10183
+ else
10184
+ return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
10185
+ }
10186
+ function WriteStream$open() {
10187
+ var that = this;
10188
+ open(that.path, that.flags, that.mode, function(err, fd) {
10189
+ if (err) {
10190
+ that.destroy();
10191
+ that.emit("error", err);
10192
+ } else {
10193
+ that.fd = fd;
10194
+ that.emit("open", fd);
10195
+ }
10196
+ });
10197
+ }
10198
+ function createReadStream(path5, options) {
10199
+ return new fs5.ReadStream(path5, options);
10200
+ }
10201
+ function createWriteStream(path5, options) {
10202
+ return new fs5.WriteStream(path5, options);
10203
+ }
10204
+ var fs$open = fs5.open;
10205
+ fs5.open = open;
10206
+ function open(path5, flags, mode, cb) {
10207
+ if (typeof mode === "function")
10208
+ cb = mode, mode = null;
10209
+ return go$open(path5, flags, mode, cb);
10210
+ function go$open(path6, flags2, mode2, cb2, startTime) {
10211
+ return fs$open(path6, flags2, mode2, function(err, fd) {
10212
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
10213
+ enqueue([go$open, [path6, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
10214
+ else {
10215
+ if (typeof cb2 === "function")
10216
+ cb2.apply(this, arguments);
10217
+ }
10218
+ });
10219
+ }
10220
+ }
10221
+ return fs5;
10222
+ }
10223
+ function enqueue(elem) {
10224
+ debug("ENQUEUE", elem[0].name, elem[1]);
10225
+ fs4[gracefulQueue].push(elem);
10226
+ retry();
10227
+ }
10228
+ var retryTimer;
10229
+ function resetQueue() {
10230
+ var now = Date.now();
10231
+ for (var i = 0; i < fs4[gracefulQueue].length; ++i) {
10232
+ if (fs4[gracefulQueue][i].length > 2) {
10233
+ fs4[gracefulQueue][i][3] = now;
10234
+ fs4[gracefulQueue][i][4] = now;
10235
+ }
10236
+ }
10237
+ retry();
10238
+ }
10239
+ function retry() {
10240
+ clearTimeout(retryTimer);
10241
+ retryTimer = void 0;
10242
+ if (fs4[gracefulQueue].length === 0)
10243
+ return;
10244
+ var elem = fs4[gracefulQueue].shift();
10245
+ var fn = elem[0];
10246
+ var args = elem[1];
10247
+ var err = elem[2];
10248
+ var startTime = elem[3];
10249
+ var lastTime = elem[4];
10250
+ if (startTime === void 0) {
10251
+ debug("RETRY", fn.name, args);
10252
+ fn.apply(null, args);
10253
+ } else if (Date.now() - startTime >= 6e4) {
10254
+ debug("TIMEOUT", fn.name, args);
10255
+ var cb = args.pop();
10256
+ if (typeof cb === "function")
10257
+ cb.call(null, err);
10258
+ } else {
10259
+ var sinceAttempt = Date.now() - lastTime;
10260
+ var sinceStart = Math.max(lastTime - startTime, 1);
10261
+ var desiredDelay = Math.min(sinceStart * 1.2, 100);
10262
+ if (sinceAttempt >= desiredDelay) {
10263
+ debug("RETRY", fn.name, args);
10264
+ fn.apply(null, args.concat([startTime]));
10265
+ } else {
10266
+ fs4[gracefulQueue].push(elem);
10267
+ }
10268
+ }
10269
+ if (retryTimer === void 0) {
10270
+ retryTimer = setTimeout(retry, 0);
10271
+ }
10272
+ }
10273
+ }
10274
+ });
9409
10275
  var require_is_path_cwd = (0, import_chunk_WWAWV7DQ.__commonJS)({
9410
10276
  "../../node_modules/.pnpm/is-path-cwd@2.2.0/node_modules/is-path-cwd/index.js"(exports, module2) {
9411
10277
  "use strict";
@@ -11706,7 +12572,7 @@ var require_del = (0, import_chunk_WWAWV7DQ.__commonJS)({
11706
12572
  var globby = (0, import_chunk_53LS3WUO.require_globby)();
11707
12573
  var isGlob = (0, import_chunk_53LS3WUO.require_is_glob)();
11708
12574
  var slash = (0, import_chunk_53LS3WUO.require_slash)();
11709
- var gracefulFs = (0, import_chunk_H4J2FN2W.require_graceful_fs)();
12575
+ var gracefulFs = require_graceful_fs();
11710
12576
  var isPathCwd = require_is_path_cwd();
11711
12577
  var isPathInside = require_is_path_inside();
11712
12578
  var rimraf = require_rimraf();