@prisma/internals 6.5.0-dev.8 → 6.5.0-dev.81

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