@vltpkg/cli-js 1.0.0-rc.32 → 1.0.0-rc.34

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 (85) hide show
  1. package/{access-SQZRJLJA.js → access-SXQICNAN.js} +23 -12
  2. package/{bugs-BMZ5UERM.js → bugs-OOPMFRCI.js} +19 -17
  3. package/{build-LGQI6OGM.js → build-HDXI5OA7.js} +13 -9
  4. package/{cache-JWHNATAX.js → cache-RW4Y4XNQ.js} +19 -14
  5. package/cache-unzip-src-unzip.js +434 -428
  6. package/{chunk-6YXVQ5HC.js → chunk-2PLIV3N3.js} +1 -27
  7. package/{chunk-G6PG3AGN.js → chunk-3SQ5Y324.js} +11 -8
  8. package/{chunk-ZUP6UTME.js → chunk-4RZDJQ5U.js} +42 -61
  9. package/{chunk-M2WD7IBO.js → chunk-4ZXA6RLP.js} +1 -1
  10. package/{chunk-R44FR7BY.js → chunk-7NHXV6AH.js} +439 -433
  11. package/{chunk-SIXXDCBI.js → chunk-CCQYIYTA.js} +7 -7
  12. package/{chunk-FXDRM4ZO.js → chunk-CLVRCGOZ.js} +247 -235
  13. package/{chunk-YCQTLBWF.js → chunk-CNSTFT7U.js} +1 -1
  14. package/{chunk-7XE7OES7.js → chunk-D5CP6O6G.js} +3 -3
  15. package/{chunk-YQXDHMHG.js → chunk-E5YE7UTZ.js} +3167 -2991
  16. package/chunk-E74WGW5C.js +49 -0
  17. package/{chunk-DFNHGGGV.js → chunk-EFWPI6IY.js} +1 -1
  18. package/{chunk-5UXEBLLT.js → chunk-EHEVBLDB.js} +68 -7
  19. package/{chunk-JBVLIV37.js → chunk-EQ633HIM.js} +14 -13
  20. package/{chunk-DM3WGEVB.js → chunk-F2FKLPZD.js} +7 -7
  21. package/chunk-FAG776ZD.js +137 -0
  22. package/{chunk-HQ4US6G3.js → chunk-FWKQ7YDF.js} +1049 -980
  23. package/chunk-HB7CKTYO.js +75 -0
  24. package/{chunk-KRGA5VLT.js → chunk-ICJRCXSG.js} +31 -27
  25. package/{chunk-FBTBHRPG.js → chunk-LCDBW6IT.js} +1 -1
  26. package/{chunk-IAKUGHGT.js → chunk-MT76WHSM.js} +1 -1
  27. package/{chunk-3TVABXAG.js → chunk-MU7Y4R5E.js} +3 -3
  28. package/{chunk-JKAZKVQU.js → chunk-PW6S6AIO.js} +15 -11
  29. package/{chunk-DI2CYYXF.js → chunk-U6DM3ROE.js} +706 -442
  30. package/chunk-UBLFPJHV.js +40 -0
  31. package/{chunk-SDBTQF2Y.js → chunk-UCD3RJYG.js} +5 -5
  32. package/{chunk-XFQ2EH5D.js → chunk-VM2RMMY4.js} +3 -3
  33. package/{chunk-DIKKTUBV.js → chunk-VZ7UNZHR.js} +3 -3
  34. package/{chunk-2V4AQPBR.js → chunk-WP6CYBPM.js} +81 -46
  35. package/{chunk-LEX7YPHR.js → chunk-WXMYKCQW.js} +118 -92
  36. package/{chunk-LRPTCGTW.js → chunk-XA47WS4N.js} +11 -15
  37. package/{chunk-NLFBANVO.js → chunk-Y7CQIZ7Y.js} +106 -150
  38. package/{ci-FQJANSQW.js → ci-MTYU2K2A.js} +14 -10
  39. package/cli-package.json +6 -2
  40. package/{config-4KQTTXJH.js → config-6NXV2BXW.js} +15 -13
  41. package/{config-LRL3N7TN.js → config-TVAXCTQO.js} +13 -11
  42. package/{create-KN6AXEA6.js → create-LXI5DCDW.js} +24 -19
  43. package/{deprecate-P26WHVFB.js → deprecate-2AQBL5XT.js} +22 -14
  44. package/{devtools-6NFQDW4L.js → devtools-HGLF4KAO.js} +82 -28
  45. package/{dist-tag-FA2BT7SA.js → dist-tag-BFSYLRIH.js} +16 -9
  46. package/{docs-OAPIY4SC.js → docs-ADPJ4B4C.js} +19 -17
  47. package/{exec-CVZGHJZS.js → exec-GMS54RAC.js} +24 -19
  48. package/{exec-cache-3AHODVRN.js → exec-cache-R5LVZL5Z.js} +22 -17
  49. package/{exec-local-I4OJX76E.js → exec-local-TVCLZGIM.js} +17 -14
  50. package/{help-QFIQSPNS.js → help-6CECUD6C.js} +5 -4
  51. package/{init-QLADIAP5.js → init-XXFLGYVP.js} +12 -10
  52. package/{install-B7CU2BLC.js → install-6KMXYSF5.js} +27 -12
  53. package/{list-OTFV3LOM.js → list-RUO3SUKY.js} +20 -15
  54. package/{login-LG2ZOIDQ.js → login-6I2CGO7I.js} +23 -9
  55. package/{logout-KUI773AM.js → logout-JTU4BJKH.js} +19 -8
  56. package/{pack-C55TTBIQ.js → pack-NCWH2TUA.js} +17 -13
  57. package/package.json +8 -1
  58. package/{ping-VNUOC26G.js → ping-4MEAC2WD.js} +17 -10
  59. package/{pkg-H4RJEBK5.js → pkg-ENSKG6G7.js} +13 -11
  60. package/{profile-DIJ5JUSE.js → profile-62YHNFSO.js} +16 -8
  61. package/{publish-XF2TRBPH.js → publish-PPY724N2.js} +58 -23
  62. package/{query-BGP5JMJ7.js → query-NLWXKOOT.js} +61 -15
  63. package/registry-QGI44LG4.js +117 -0
  64. package/registry-client-package.json +6 -2
  65. package/registry-client-src-revalidate.js +1245 -977
  66. package/{repo-NCEHK7KB.js → repo-BFRAXIVU.js} +19 -17
  67. package/{reporter-OB6SNHOZ.js → reporter-2XBYWAVU.js} +3 -2
  68. package/{run-ZNJJYEJF.js → run-7O65747G.js} +17 -14
  69. package/{run-exec-F5OV7MVN.js → run-exec-2OYWHL6K.js} +19 -14
  70. package/security-archive-src-update-expired.js +16 -11
  71. package/setup-MMIDAIJI.js +181 -0
  72. package/{src-M3WI7TSB.js → src-OK3KHDYR.js} +25 -17
  73. package/{token-KXCVRJGF.js → token-VLVXUW54.js} +20 -9
  74. package/{uninstall-33SUWR6K.js → uninstall-TAG6QIAG.js} +15 -11
  75. package/{unpublish-7AZPBZF2.js → unpublish-Y4L5J2IA.js} +17 -9
  76. package/{update-2EQF6IKZ.js → update-RYH4RKBS.js} +14 -10
  77. package/{version-HFYI3SEX.js → version-COHB32ON.js} +12 -10
  78. package/{view-C5OT36OB.js → view-P7U4MF43.js} +18 -14
  79. package/vlr.js +1 -1
  80. package/vlrx.js +1 -1
  81. package/vlt.js +1 -1
  82. package/vlx.js +1 -1
  83. package/vlxl.js +1 -1
  84. package/{whoami-KKFV3XR6.js → whoami-47MVFMZC.js} +19 -8
  85. package/chunk-FXIBCUIM.js +0 -73
@@ -14,50 +14,56 @@ import {
14
14
  __require
15
15
  } from "./chunk-PZLD7RTK.js";
16
16
 
17
- // ../../node_modules/.vlt/~npm~lru-cache@11.3.5/node_modules/lru-cache/dist/commonjs/index.min.js
17
+ // ../../node_modules/.vlt/~npm~lru-cache@11.5.2/node_modules/lru-cache/dist/commonjs/node/index.min.js
18
18
  var require_index_min = __commonJS({
19
- "../../node_modules/.vlt/~npm~lru-cache@11.3.5/node_modules/lru-cache/dist/commonjs/index.min.js"(exports) {
19
+ "../../node_modules/.vlt/~npm~lru-cache@11.5.2/node_modules/lru-cache/dist/commonjs/node/index.min.js"(exports) {
20
20
  "use strict";
21
- var G = (c, t) => () => (t || c((t = { exports: {} }).exports, t), t.exports);
22
- var M = G((O) => {
21
+ var j = (u, t) => () => (t || u((t = { exports: {} }).exports, t), t.exports);
22
+ var I = j((O) => {
23
23
  "use strict";
24
24
  Object.defineProperty(O, "__esModule", { value: true });
25
25
  O.tracing = O.metrics = void 0;
26
- var L = __require("node:diagnostics_channel");
27
- O.metrics = (0, L.channel)("lru-cache:metrics");
28
- O.tracing = (0, L.tracingChannel)("lru-cache");
26
+ var U = __require("node:diagnostics_channel");
27
+ O.metrics = (0, U.channel)("lru-cache:metrics");
28
+ O.tracing = (0, U.tracingChannel)("lru-cache");
29
+ });
30
+ var P = j((R) => {
31
+ "use strict";
32
+ Object.defineProperty(R, "__esModule", { value: true });
33
+ R.defaultPerf = void 0;
34
+ R.defaultPerf = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
29
35
  });
30
36
  Object.defineProperty(exports, "__esModule", { value: true });
31
37
  exports.LRUCache = void 0;
32
- var u = M();
33
- var D = () => u.metrics.hasSubscribers || u.tracing.hasSubscribers;
34
- var P = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
35
- var U = /* @__PURE__ */ new Set();
36
- var j = typeof process == "object" && process ? process : {};
37
- var H = (c, t, e, i) => {
38
- typeof j.emitWarning == "function" ? j.emitWarning(c, t, e, i) : console.error(`[${e}] ${t}: ${c}`);
38
+ var g = I();
39
+ var N = P();
40
+ var C = () => g.metrics.hasSubscribers || g.tracing.hasSubscribers;
41
+ var k = /* @__PURE__ */ new Set();
42
+ var G = typeof process == "object" && process ? process : {};
43
+ var V = (u, t, e, i) => {
44
+ typeof G.emitWarning == "function" ? G.emitWarning(u, t, e, i) : console.error(`[${e}] ${t}: ${u}`);
39
45
  };
40
- var N = (c) => !U.has(c);
41
- var F = (c) => !!c && c === Math.floor(c) && c > 0 && isFinite(c);
42
- var I = (c) => F(c) ? c <= Math.pow(2, 8) ? Uint8Array : c <= Math.pow(2, 16) ? Uint16Array : c <= Math.pow(2, 32) ? Uint32Array : c <= Number.MAX_SAFE_INTEGER ? W : null : null;
46
+ var q = (u) => !k.has(u);
47
+ var T = (u) => !!u && u === Math.floor(u) && u > 0 && isFinite(u);
48
+ var H = (u) => T(u) ? u <= Math.pow(2, 8) ? Uint8Array : u <= Math.pow(2, 16) ? Uint16Array : u <= Math.pow(2, 32) ? Uint32Array : u <= Number.MAX_SAFE_INTEGER ? W : null : null;
43
49
  var W = class extends Array {
44
50
  constructor(t) {
45
51
  super(t), this.fill(0);
46
52
  }
47
53
  };
48
- var C = class c {
54
+ var L = class u {
49
55
  heap;
50
56
  length;
51
57
  static #o = false;
52
58
  static create(t) {
53
- let e = I(t);
59
+ let e = H(t);
54
60
  if (!e) return [];
55
- c.#o = true;
56
- let i = new c(t, e);
57
- return c.#o = false, i;
61
+ u.#o = true;
62
+ let i = new u(t, e);
63
+ return u.#o = false, i;
58
64
  }
59
65
  constructor(t, e) {
60
- if (!c.#o) throw new TypeError("instantiate Stack using Stack.create(n)");
66
+ if (!u.#o) throw new TypeError("instantiate Stack using Stack.create(n)");
61
67
  this.heap = new e(t), this.length = 0;
62
68
  }
63
69
  push(t) {
@@ -67,17 +73,17 @@ var require_index_min = __commonJS({
67
73
  return this.heap[--this.length];
68
74
  }
69
75
  };
70
- var x = class c {
76
+ var M = class u {
71
77
  #o;
72
78
  #c;
73
79
  #m;
74
- #D;
75
- #w;
76
- #M;
77
- #j;
80
+ #W;
78
81
  #S;
82
+ #x;
83
+ #j;
84
+ #w;
79
85
  get perf() {
80
- return this.#S;
86
+ return this.#w;
81
87
  }
82
88
  ttl;
83
89
  ttlResolution;
@@ -94,6 +100,7 @@ var require_index_min = __commonJS({
94
100
  allowStaleOnFetchAbort;
95
101
  allowStaleOnFetchRejection;
96
102
  ignoreFetchAbort;
103
+ backgroundFetchSize;
97
104
  #n;
98
105
  #b;
99
106
  #s;
@@ -103,22 +110,22 @@ var require_index_min = __commonJS({
103
110
  #u;
104
111
  #a;
105
112
  #h;
106
- #y;
107
- #r;
108
113
  #_;
114
+ #r;
115
+ #y;
109
116
  #F;
110
117
  #d;
111
118
  #g;
112
119
  #T;
113
- #O;
114
- #f;
115
120
  #U;
121
+ #f;
122
+ #R;
116
123
  static unsafeExposeInternals(t) {
117
- return { starts: t.#F, ttls: t.#d, autopurgeTimers: t.#g, sizes: t.#_, keyMap: t.#s, keyList: t.#i, valList: t.#t, next: t.#l, prev: t.#u, get head() {
124
+ return { starts: t.#F, ttls: t.#d, autopurgeTimers: t.#g, sizes: t.#y, keyMap: t.#s, keyList: t.#i, valList: t.#t, next: t.#l, prev: t.#u, get head() {
118
125
  return t.#a;
119
126
  }, get tail() {
120
127
  return t.#h;
121
- }, free: t.#y, isBackgroundFetch: (e) => t.#e(e), backgroundFetch: (e, i, s, n) => t.#P(e, i, s, n), moveToTail: (e) => t.#L(e), indexes: (e) => t.#A(e), rindexes: (e) => t.#v(e), isStale: (e) => t.#p(e) };
128
+ }, free: t.#_, isBackgroundFetch: (e) => t.#e(e), backgroundFetch: (e, i, s, n) => t.#G(e, i, s, n), moveToTail: (e) => t.#M(e), indexes: (e) => t.#A(e), rindexes: (e) => t.#z(e), isStale: (e) => t.#p(e) };
122
129
  }
123
130
  get max() {
124
131
  return this.#o;
@@ -133,7 +140,7 @@ var require_index_min = __commonJS({
133
140
  return this.#n;
134
141
  }
135
142
  get fetchMethod() {
136
- return this.#M;
143
+ return this.#x;
137
144
  }
138
145
  get memoMethod() {
139
146
  return this.#j;
@@ -142,111 +149,116 @@ var require_index_min = __commonJS({
142
149
  return this.#m;
143
150
  }
144
151
  get onInsert() {
145
- return this.#D;
152
+ return this.#W;
146
153
  }
147
154
  get disposeAfter() {
148
- return this.#w;
155
+ return this.#S;
149
156
  }
150
157
  constructor(t) {
151
- let { max: e = 0, ttl: i, ttlResolution: s = 1, ttlAutopurge: n, updateAgeOnGet: o, updateAgeOnHas: r, allowStale: h, dispose: a, onInsert: d, disposeAfter: f, noDisposeOnSet: p, noUpdateTTL: m, maxSize: T = 0, maxEntrySize: w = 0, sizeCalculation: y, fetchMethod: l, memoMethod: S, noDeleteOnFetchRejection: _, noDeleteOnStaleGet: b, allowStaleOnFetchRejection: g, allowStaleOnFetchAbort: A, ignoreFetchAbort: v, perf: R } = t;
152
- if (R !== void 0 && typeof R?.now != "function") throw new TypeError("perf option must have a now() method if specified");
153
- if (this.#S = R ?? P, e !== 0 && !F(e)) throw new TypeError("max option must be a nonnegative integer");
154
- let z = e ? I(e) : Array;
155
- if (!z) throw new Error("invalid max value: " + e);
156
- if (this.#o = e, this.#c = T, this.maxEntrySize = w || this.#c, this.sizeCalculation = y, this.sizeCalculation) {
158
+ let { max: e = 0, ttl: i, ttlResolution: s = 1, ttlAutopurge: n, updateAgeOnGet: o, updateAgeOnHas: l, allowStale: h, dispose: r, onInsert: c, disposeAfter: w, noDisposeOnSet: y, noUpdateTTL: d, maxSize: p = 0, maxEntrySize: f = 0, sizeCalculation: _, fetchMethod: a, memoMethod: S, noDeleteOnFetchRejection: F, noDeleteOnStaleGet: b, allowStaleOnFetchRejection: m, allowStaleOnFetchAbort: A, ignoreFetchAbort: z, backgroundFetchSize: x = 1, perf: v } = t;
159
+ if (this.backgroundFetchSize = x, v !== void 0 && typeof v?.now != "function") throw new TypeError("perf option must have a now() method if specified");
160
+ if (this.#w = v ?? N.defaultPerf, e !== 0 && !T(e)) throw new TypeError("max option must be a nonnegative integer");
161
+ let E = e ? H(e) : Array;
162
+ if (!E) throw new Error("invalid max value: " + e);
163
+ if (this.#o = e, this.#c = p, this.maxEntrySize = f || this.#c, this.sizeCalculation = _, this.sizeCalculation) {
157
164
  if (!this.#c && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
158
165
  if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
159
166
  }
160
167
  if (S !== void 0 && typeof S != "function") throw new TypeError("memoMethod must be a function if defined");
161
- if (this.#j = S, l !== void 0 && typeof l != "function") throw new TypeError("fetchMethod must be a function if specified");
162
- if (this.#M = l, this.#O = !!l, this.#s = /* @__PURE__ */ new Map(), this.#i = Array.from({ length: e }).fill(void 0), this.#t = Array.from({ length: e }).fill(void 0), this.#l = new z(e), this.#u = new z(e), this.#a = 0, this.#h = 0, this.#y = C.create(e), this.#n = 0, this.#b = 0, typeof a == "function" && (this.#m = a), typeof d == "function" && (this.#D = d), typeof f == "function" ? (this.#w = f, this.#r = []) : (this.#w = void 0, this.#r = void 0), this.#T = !!this.#m, this.#U = !!this.#D, this.#f = !!this.#w, this.noDisposeOnSet = !!p, this.noUpdateTTL = !!m, this.noDeleteOnFetchRejection = !!_, this.allowStaleOnFetchRejection = !!g, this.allowStaleOnFetchAbort = !!A, this.ignoreFetchAbort = !!v, this.maxEntrySize !== 0) {
163
- if (this.#c !== 0 && !F(this.#c)) throw new TypeError("maxSize must be a positive integer if specified");
164
- if (!F(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
168
+ if (this.#j = S, a !== void 0 && typeof a != "function") throw new TypeError("fetchMethod must be a function if specified");
169
+ if (this.#x = a, this.#U = !!a, this.#s = /* @__PURE__ */ new Map(), this.#i = Array.from({ length: e }).fill(void 0), this.#t = Array.from({ length: e }).fill(void 0), this.#l = new E(e), this.#u = new E(e), this.#a = 0, this.#h = 0, this.#_ = L.create(e), this.#n = 0, this.#b = 0, typeof r == "function" && (this.#m = r), typeof c == "function" && (this.#W = c), typeof w == "function" ? (this.#S = w, this.#r = []) : (this.#S = void 0, this.#r = void 0), this.#T = !!this.#m, this.#R = !!this.#W, this.#f = !!this.#S, this.noDisposeOnSet = !!y, this.noUpdateTTL = !!d, this.noDeleteOnFetchRejection = !!F, this.allowStaleOnFetchRejection = !!m, this.allowStaleOnFetchAbort = !!A, this.ignoreFetchAbort = !!z, this.maxEntrySize !== 0) {
170
+ if (this.#c !== 0 && !T(this.#c)) throw new TypeError("maxSize must be a positive integer if specified");
171
+ if (!T(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
165
172
  this.#X();
166
173
  }
167
- if (this.allowStale = !!h, this.noDeleteOnStaleGet = !!b, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!r, this.ttlResolution = F(s) || s === 0 ? s : 1, this.ttlAutopurge = !!n, this.ttl = i || 0, this.ttl) {
168
- if (!F(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
169
- this.#H();
174
+ if (this.allowStale = !!h, this.noDeleteOnStaleGet = !!b, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!l, this.ttlResolution = T(s) || s === 0 ? s : 1, this.ttlAutopurge = !!n, this.ttl = i || 0, this.ttl) {
175
+ if (!T(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
176
+ this.#k();
170
177
  }
171
178
  if (this.#o === 0 && this.ttl === 0 && this.#c === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
172
179
  if (!this.ttlAutopurge && !this.#o && !this.#c) {
173
- let E = "LRU_CACHE_UNBOUNDED";
174
- N(E) && (U.add(E), H("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", E, c));
180
+ let D = "LRU_CACHE_UNBOUNDED";
181
+ q(D) && (k.add(D), V("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", D, u));
175
182
  }
176
183
  }
177
184
  getRemainingTTL(t) {
178
185
  return this.#s.has(t) ? 1 / 0 : 0;
179
186
  }
180
- #H() {
187
+ #k() {
181
188
  let t = new W(this.#o), e = new W(this.#o);
182
189
  this.#d = t, this.#F = e;
183
190
  let i = this.ttlAutopurge ? Array.from({ length: this.#o }) : void 0;
184
- this.#g = i, this.#N = (r, h, a = this.#S.now()) => {
185
- e[r] = h !== 0 ? a : 0, t[r] = h, s(r, h);
186
- }, this.#R = (r) => {
187
- e[r] = t[r] !== 0 ? this.#S.now() : 0, s(r, t[r]);
191
+ this.#g = i, this.#H = (h, r, c = this.#w.now()) => {
192
+ e[h] = r !== 0 ? c : 0, t[h] = r, s(h, r);
193
+ }, this.#D = (h) => {
194
+ e[h] = t[h] !== 0 ? this.#w.now() : 0, s(h, t[h]);
188
195
  };
189
- let s = this.ttlAutopurge ? (r, h) => {
190
- if (i?.[r] && (clearTimeout(i[r]), i[r] = void 0), h && h !== 0 && i) {
191
- let a = setTimeout(() => {
192
- this.#p(r) && this.#z(this.#i[r], "expire");
193
- }, h + 1);
194
- a.unref && a.unref(), i[r] = a;
196
+ let s = this.ttlAutopurge ? (h, r) => {
197
+ if (i?.[h] && (clearTimeout(i[h]), i[h] = void 0), r && r !== 0 && i) {
198
+ let c = setTimeout(() => {
199
+ this.#p(h) ? (this.#v(this.#i[h], "expire"), i[h] = void 0) : s(h, l(h));
200
+ }, r + 1);
201
+ c.unref && c.unref(), i[h] = c;
195
202
  }
196
203
  } : () => {
197
204
  };
198
- this.#E = (r, h) => {
199
- if (t[h]) {
200
- let a = t[h], d = e[h];
201
- if (!a || !d) return;
202
- r.ttl = a, r.start = d, r.now = n || o();
203
- let f = r.now - d;
204
- r.remainingTTL = a - f;
205
+ this.#E = (h, r) => {
206
+ if (t[r]) {
207
+ let c = t[r], w = e[r];
208
+ if (!c || !w) return;
209
+ h.ttl = c, h.start = w, h.now = n || o();
210
+ let y = h.now - w;
211
+ h.remainingTTL = c - y;
205
212
  }
206
213
  };
207
214
  let n = 0, o = () => {
208
- let r = this.#S.now();
215
+ let h = this.#w.now();
209
216
  if (this.ttlResolution > 0) {
210
- n = r;
211
- let h = setTimeout(() => n = 0, this.ttlResolution);
212
- h.unref && h.unref();
217
+ n = h;
218
+ let r = setTimeout(() => n = 0, this.ttlResolution);
219
+ r.unref && r.unref();
213
220
  }
214
- return r;
221
+ return h;
222
+ };
223
+ this.getRemainingTTL = (h) => {
224
+ let r = this.#s.get(h);
225
+ return r === void 0 ? 0 : l(r);
226
+ };
227
+ let l = (h) => {
228
+ let r = t[h], c = e[h];
229
+ if (!r || !c) return 1 / 0;
230
+ let w = (n || o()) - c;
231
+ return r - w;
215
232
  };
216
- this.getRemainingTTL = (r) => {
217
- let h = this.#s.get(r);
218
- if (h === void 0) return 0;
219
- let a = t[h], d = e[h];
220
- if (!a || !d) return 1 / 0;
221
- let f = (n || o()) - d;
222
- return a - f;
223
- }, this.#p = (r) => {
224
- let h = e[r], a = t[r];
225
- return !!a && !!h && (n || o()) - h > a;
233
+ this.#p = (h) => {
234
+ let r = e[h], c = t[h];
235
+ return !!c && !!r && (n || o()) - r > c;
226
236
  };
227
237
  }
228
- #R = () => {
238
+ #D = () => {
229
239
  };
230
240
  #E = () => {
231
241
  };
232
- #N = () => {
242
+ #H = () => {
233
243
  };
234
244
  #p = () => false;
235
245
  #X() {
236
246
  let t = new W(this.#o);
237
- this.#b = 0, this.#_ = t, this.#C = (e) => {
247
+ this.#b = 0, this.#y = t, this.#C = (e) => {
238
248
  this.#b -= t[e], t[e] = 0;
239
- }, this.#k = (e, i, s, n) => {
240
- if (this.#e(i)) return 0;
241
- if (!F(s)) if (n) {
242
- if (typeof n != "function") throw new TypeError("sizeCalculation must be a function");
243
- if (s = n(i, e), !F(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
244
- } else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
249
+ }, this.#N = (e, i, s, n) => {
250
+ if (!T(s)) {
251
+ if (this.#e(i)) return this.backgroundFetchSize;
252
+ if (n) {
253
+ if (typeof n != "function") throw new TypeError("sizeCalculation must be a function");
254
+ if (s = n(i, e), !T(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
255
+ } else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
256
+ }
245
257
  return s;
246
258
  }, this.#I = (e, i, s) => {
247
259
  if (t[e] = i, this.#c) {
248
260
  let n = this.#c - t[e];
249
- for (; this.#b > n; ) this.#G(true);
261
+ for (; this.#b > n; ) this.#P(true);
250
262
  }
251
263
  this.#b += t[e], s && (s.entrySize = i, s.totalCalculatedSize = this.#b);
252
264
  };
@@ -255,14 +267,14 @@ var require_index_min = __commonJS({
255
267
  };
256
268
  #I = (t, e, i) => {
257
269
  };
258
- #k = (t, e, i, s) => {
270
+ #N = (t, e, i, s) => {
259
271
  if (i || s) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
260
272
  return 0;
261
273
  };
262
274
  *#A({ allowStale: t = this.allowStale } = {}) {
263
275
  if (this.#n) for (let e = this.#h; this.#V(e) && ((t || !this.#p(e)) && (yield e), e !== this.#a); ) e = this.#u[e];
264
276
  }
265
- *#v({ allowStale: t = this.allowStale } = {}) {
277
+ *#z({ allowStale: t = this.allowStale } = {}) {
266
278
  if (this.#n) for (let e = this.#a; this.#V(e) && ((t || !this.#p(e)) && (yield e), e !== this.#h); ) e = this.#l[e];
267
279
  }
268
280
  #V(t) {
@@ -272,7 +284,7 @@ var require_index_min = __commonJS({
272
284
  for (let t of this.#A()) this.#t[t] !== void 0 && this.#i[t] !== void 0 && !this.#e(this.#t[t]) && (yield [this.#i[t], this.#t[t]]);
273
285
  }
274
286
  *rentries() {
275
- for (let t of this.#v()) this.#t[t] !== void 0 && this.#i[t] !== void 0 && !this.#e(this.#t[t]) && (yield [this.#i[t], this.#t[t]]);
287
+ for (let t of this.#z()) this.#t[t] !== void 0 && this.#i[t] !== void 0 && !this.#e(this.#t[t]) && (yield [this.#i[t], this.#t[t]]);
276
288
  }
277
289
  *keys() {
278
290
  for (let t of this.#A()) {
@@ -281,7 +293,7 @@ var require_index_min = __commonJS({
281
293
  }
282
294
  }
283
295
  *rkeys() {
284
- for (let t of this.#v()) {
296
+ for (let t of this.#z()) {
285
297
  let e = this.#i[t];
286
298
  e !== void 0 && !this.#e(this.#t[t]) && (yield e);
287
299
  }
@@ -290,7 +302,7 @@ var require_index_min = __commonJS({
290
302
  for (let t of this.#A()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
291
303
  }
292
304
  *rvalues() {
293
- for (let t of this.#v()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
305
+ for (let t of this.#z()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
294
306
  }
295
307
  [Symbol.iterator]() {
296
308
  return this.entries();
@@ -299,7 +311,7 @@ var require_index_min = __commonJS({
299
311
  find(t, e = {}) {
300
312
  for (let i of this.#A()) {
301
313
  let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
302
- if (n !== void 0 && t(n, this.#i[i], this)) return this.#x(this.#i[i], e);
314
+ if (n !== void 0 && t(n, this.#i[i], this)) return this.#L(this.#i[i], e);
303
315
  }
304
316
  }
305
317
  forEach(t, e = this) {
@@ -309,14 +321,14 @@ var require_index_min = __commonJS({
309
321
  }
310
322
  }
311
323
  rforEach(t, e = this) {
312
- for (let i of this.#v()) {
324
+ for (let i of this.#z()) {
313
325
  let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
314
326
  n !== void 0 && t.call(e, n, this.#i[i], this);
315
327
  }
316
328
  }
317
329
  purgeStale() {
318
330
  let t = false;
319
- for (let e of this.#v({ allowStale: true })) this.#p(e) && (this.#z(this.#i[e], "expire"), t = true);
331
+ for (let e of this.#z({ allowStale: true })) this.#p(e) && (this.#v(this.#i[e], "expire"), t = true);
320
332
  return t;
321
333
  }
322
334
  info(t) {
@@ -326,13 +338,13 @@ var require_index_min = __commonJS({
326
338
  if (s === void 0) return;
327
339
  let n = { value: s };
328
340
  if (this.#d && this.#F) {
329
- let o = this.#d[e], r = this.#F[e];
330
- if (o && r) {
331
- let h = o - (this.#S.now() - r);
341
+ let o = this.#d[e], l = this.#F[e];
342
+ if (o && l) {
343
+ let h = o - (this.#w.now() - l);
332
344
  n.ttl = h, n.start = Date.now();
333
345
  }
334
346
  }
335
- return this.#_ && (n.size = this.#_[e]), n;
347
+ return this.#y && (n.size = this.#y[e]), n;
336
348
  }
337
349
  dump() {
338
350
  let t = [];
@@ -342,10 +354,10 @@ var require_index_min = __commonJS({
342
354
  let o = { value: n };
343
355
  if (this.#d && this.#F) {
344
356
  o.ttl = this.#d[e];
345
- let r = this.#S.now() - this.#F[e];
346
- o.start = Math.floor(Date.now() - r);
357
+ let l = this.#w.now() - this.#F[e];
358
+ o.start = Math.floor(Date.now() - l);
347
359
  }
348
- this.#_ && (o.size = this.#_[e]), t.unshift([i, o]);
360
+ this.#y && (o.size = this.#y[e]), t.unshift([i, o]);
349
361
  }
350
362
  return t;
351
363
  }
@@ -354,46 +366,44 @@ var require_index_min = __commonJS({
354
366
  for (let [e, i] of t) {
355
367
  if (i.start) {
356
368
  let s = Date.now() - i.start;
357
- i.start = this.#S.now() - s;
369
+ i.start = this.#w.now() - s;
358
370
  }
359
- this.#W(e, i.value, i);
371
+ this.#O(e, i.value, i);
360
372
  }
361
373
  }
362
374
  set(t, e, i = {}) {
363
- let { status: s = u.metrics.hasSubscribers ? {} : void 0 } = i;
364
- i.status = s, s && (s.op = "set", s.key = t, e !== void 0 && (s.value = e));
365
- let n = this.#W(t, e, i);
366
- return s && u.metrics.hasSubscribers && u.metrics.publish(s), n;
367
- }
368
- #W(t, e, i = {}) {
369
- let { ttl: s = this.ttl, start: n, noDisposeOnSet: o = this.noDisposeOnSet, sizeCalculation: r = this.sizeCalculation, status: h } = i;
370
- if (e === void 0) return h && (h.set = "deleted"), this.delete(t), this;
371
- let { noUpdateTTL: a = this.noUpdateTTL } = i;
372
- h && !this.#e(e) && (h.value = e);
373
- let d = this.#k(t, e, i.size || 0, r, h);
374
- if (this.maxEntrySize && d > this.maxEntrySize) return this.#z(t, "set"), h && (h.set = "miss", h.maxEntrySizeExceeded = true), this;
375
- let f = this.#n === 0 ? void 0 : this.#s.get(t);
376
- if (f === void 0) f = this.#n === 0 ? this.#h : this.#y.length !== 0 ? this.#y.pop() : this.#n === this.#o ? this.#G(false) : this.#n, this.#i[f] = t, this.#t[f] = e, this.#s.set(t, f), this.#l[this.#h] = f, this.#u[f] = this.#h, this.#h = f, this.#n++, this.#I(f, d, h), h && (h.set = "add"), a = false, this.#U && this.#D?.(e, t, "add");
375
+ let { status: s = g.metrics.hasSubscribers ? {} : void 0 } = i;
376
+ i.status = s, s && (s.op = "set", s.key = t, e !== void 0 && (s.value = e), s.cache = this);
377
+ let n = this.#O(t, e, i);
378
+ return s && g.metrics.hasSubscribers && g.metrics.publish(s), n;
379
+ }
380
+ #O(t, e, i, s) {
381
+ let { ttl: n = this.ttl, start: o, noDisposeOnSet: l = this.noDisposeOnSet, sizeCalculation: h = this.sizeCalculation, status: r } = i, c = this.#e(e);
382
+ if (e === void 0) return r && (r.set = "deleted"), this.delete(t), this;
383
+ let { noUpdateTTL: w = this.noUpdateTTL } = i;
384
+ r && !c && (r.value = e);
385
+ let y = this.#N(t, e, i.size || 0, h, r);
386
+ if (this.maxEntrySize && y > this.maxEntrySize) return this.#v(t, "set"), r && (r.set = "miss", r.maxEntrySizeExceeded = true), this;
387
+ let d = this.#n === 0 ? void 0 : this.#s.get(t);
388
+ if (d === void 0) d = this.#n === 0 ? this.#h : this.#_.length !== 0 ? this.#_.pop() : this.#n === this.#o ? this.#P(false) : this.#n, this.#i[d] = t, this.#t[d] = e, this.#s.set(t, d), this.#l[this.#h] = d, this.#u[d] = this.#h, this.#h = d, this.#n++, this.#I(d, y, r), r && (r.set = "add"), w = false, this.#R && !c && this.#W?.(e, t, "add");
377
389
  else {
378
- this.#L(f);
379
- let p = this.#t[f];
390
+ this.#M(d);
391
+ let p = this.#t[d];
380
392
  if (e !== p) {
381
- if (this.#O && this.#e(p)) {
382
- p.__abortController.abort(new Error("replaced"));
383
- let { __staleWhileFetching: m } = p;
384
- m !== void 0 && !o && (this.#T && this.#m?.(m, t, "set"), this.#f && this.#r?.push([m, t, "set"]));
385
- } else o || (this.#T && this.#m?.(p, t, "set"), this.#f && this.#r?.push([p, t, "set"]));
386
- if (this.#C(f), this.#I(f, d, h), this.#t[f] = e, h) {
387
- h.set = "replace";
388
- let m = p && this.#e(p) ? p.__staleWhileFetching : p;
389
- m !== void 0 && (h.oldValue = m);
393
+ if (!l) if (this.#e(p)) {
394
+ p !== s && p.__abortController.abort(new Error("replaced"));
395
+ let { __staleWhileFetching: f } = p;
396
+ f !== void 0 && f !== e && (this.#T && this.#m?.(f, t, "set"), this.#f && this.#r?.push([f, t, "set"]));
397
+ } else this.#T && this.#m?.(p, t, "set"), this.#f && this.#r?.push([p, t, "set"]);
398
+ if (this.#C(d), this.#I(d, y, r), this.#t[d] = e, !c) {
399
+ let f = p && this.#e(p) ? p.__staleWhileFetching : p, _ = f === void 0 ? "add" : e !== f ? "replace" : "update";
400
+ r && (r.set = _, f !== void 0 && (r.oldValue = f)), this.#R && this.onInsert?.(e, t, _);
390
401
  }
391
- } else h && (h.set = "update");
392
- this.#U && this.onInsert?.(e, t, e === p ? "update" : "replace");
402
+ } else c || (r && (r.set = "update"), this.#R && this.onInsert?.(e, t, "update"));
393
403
  }
394
- if (s !== 0 && !this.#d && this.#H(), this.#d && (a || this.#N(f, s, n), h && this.#E(h, f)), !o && this.#f && this.#r) {
395
- let p = this.#r, m;
396
- for (; m = p?.shift(); ) this.#w?.(...m);
404
+ if (n !== 0 && !this.#d && this.#k(), this.#d && (w || this.#H(d, n, o), r && this.#E(r, d)), !l && this.#f && this.#r) {
405
+ let p = this.#r, f;
406
+ for (; f = p?.shift(); ) this.#S?.(...f);
397
407
  }
398
408
  return this;
399
409
  }
@@ -401,26 +411,28 @@ var require_index_min = __commonJS({
401
411
  try {
402
412
  for (; this.#n; ) {
403
413
  let t = this.#t[this.#a];
404
- if (this.#G(true), this.#e(t)) {
414
+ if (this.#P(true), this.#e(t)) {
405
415
  if (t.__staleWhileFetching) return t.__staleWhileFetching;
406
416
  } else if (t !== void 0) return t;
407
417
  }
408
418
  } finally {
409
419
  if (this.#f && this.#r) {
410
420
  let t = this.#r, e;
411
- for (; e = t?.shift(); ) this.#w?.(...e);
421
+ for (; e = t?.shift(); ) this.#S?.(...e);
412
422
  }
413
423
  }
414
424
  }
415
- #G(t) {
416
- let e = this.#a, i = this.#i[e], s = this.#t[e];
417
- return this.#O && this.#e(s) ? s.__abortController.abort(new Error("evicted")) : (this.#T || this.#f) && (this.#T && this.#m?.(s, i, "evict"), this.#f && this.#r?.push([s, i, "evict"])), this.#C(e), this.#g?.[e] && (clearTimeout(this.#g[e]), this.#g[e] = void 0), t && (this.#i[e] = void 0, this.#t[e] = void 0, this.#y.push(e)), this.#n === 1 ? (this.#a = this.#h = 0, this.#y.length = 0) : this.#a = this.#l[e], this.#s.delete(i), this.#n--, e;
425
+ #P(t) {
426
+ let e = this.#a, i = this.#i[e], s = this.#t[e], n = this.#e(s);
427
+ n && s.__abortController.abort(new Error("evicted"));
428
+ let o = n ? s.__staleWhileFetching : s;
429
+ return (this.#T || this.#f) && o !== void 0 && (this.#T && this.#m?.(o, i, "evict"), this.#f && this.#r?.push([o, i, "evict"])), this.#C(e), this.#g?.[e] && (clearTimeout(this.#g[e]), this.#g[e] = void 0), t && (this.#i[e] = void 0, this.#t[e] = void 0, this.#_.push(e)), this.#n === 1 ? (this.#a = this.#h = 0, this.#_.length = 0) : this.#a = this.#l[e], this.#s.delete(i), this.#n--, e;
418
430
  }
419
431
  has(t, e = {}) {
420
- let { status: i = u.metrics.hasSubscribers ? {} : void 0 } = e;
421
- e.status = i, i && (i.op = "has", i.key = t);
432
+ let { status: i = g.metrics.hasSubscribers ? {} : void 0 } = e;
433
+ e.status = i, i && (i.op = "has", i.key = t, i.cache = this);
422
434
  let s = this.#Y(t, e);
423
- return u.metrics.hasSubscribers && u.metrics.publish(i), s;
435
+ return g.metrics.hasSubscribers && g.metrics.publish(i), s;
424
436
  }
425
437
  #Y(t, e = {}) {
426
438
  let { updateAgeOnHas: i = this.updateAgeOnHas, status: s } = e, n = this.#s.get(t);
@@ -428,15 +440,15 @@ var require_index_min = __commonJS({
428
440
  let o = this.#t[n];
429
441
  if (this.#e(o) && o.__staleWhileFetching === void 0) return false;
430
442
  if (this.#p(n)) s && (s.has = "stale", this.#E(s, n));
431
- else return i && this.#R(n), s && (s.has = "hit", this.#E(s, n)), true;
443
+ else return i && this.#D(n), s && (s.has = "hit", this.#E(s, n)), true;
432
444
  } else s && (s.has = "miss");
433
445
  return false;
434
446
  }
435
447
  peek(t, e = {}) {
436
- let { status: i = D() ? {} : void 0 } = e;
437
- i && (i.op = "peek", i.key = t), e.status = i;
448
+ let { status: i = C() ? {} : void 0 } = e;
449
+ i && (i.op = "peek", i.key = t, i.cache = this), e.status = i;
438
450
  let s = this.#J(t, e);
439
- return u.metrics.hasSubscribers && u.metrics.publish(i), s;
451
+ return g.metrics.hasSubscribers && g.metrics.publish(i), s;
440
452
  }
441
453
  #J(t, e) {
442
454
  let { status: i, allowStale: s = this.allowStale } = e, n = this.#s.get(t);
@@ -444,70 +456,70 @@ var require_index_min = __commonJS({
444
456
  i && (i.peek = n === void 0 ? "miss" : "stale");
445
457
  return;
446
458
  }
447
- let o = this.#t[n], r = this.#e(o) ? o.__staleWhileFetching : o;
448
- return i && (r !== void 0 ? (i.peek = "hit", i.value = r) : i.peek = "miss"), r;
459
+ let o = this.#t[n], l = this.#e(o) ? o.__staleWhileFetching : o;
460
+ return i && (l !== void 0 ? (i.peek = "hit", i.value = l) : i.peek = "miss"), l;
449
461
  }
450
- #P(t, e, i, s) {
462
+ #G(t, e, i, s) {
451
463
  let n = e === void 0 ? void 0 : this.#t[e];
452
464
  if (this.#e(n)) return n;
453
- let o = new AbortController(), { signal: r } = i;
454
- r?.addEventListener("abort", () => o.abort(r.reason), { signal: o.signal });
455
- let h = { signal: o.signal, options: i, context: s }, a = (w, y = false) => {
456
- let { aborted: l } = o.signal, S = i.ignoreFetchAbort && w !== void 0, _ = i.ignoreFetchAbort || !!(i.allowStaleOnFetchAbort && w !== void 0);
457
- if (i.status && (l && !y ? (i.status.fetchAborted = true, i.status.fetchError = o.signal.reason, S && (i.status.fetchAbortIgnored = true)) : i.status.fetchResolved = true), l && !S && !y) return f(o.signal.reason, _);
458
- let b = m, g = this.#t[e];
459
- return (g === m || g === void 0 && S && y) && (w === void 0 ? b.__staleWhileFetching !== void 0 ? this.#t[e] = b.__staleWhileFetching : this.#z(t, "fetch") : (i.status && (i.status.fetchUpdated = true), this.#W(t, w, h.options))), w;
460
- }, d = (w) => (i.status && (i.status.fetchRejected = true, i.status.fetchError = w), f(w, false)), f = (w, y) => {
461
- let { aborted: l } = o.signal, S = l && i.allowStaleOnFetchAbort, _ = S || i.allowStaleOnFetchRejection, b = _ || i.noDeleteOnFetchRejection, g = m;
462
- if (this.#t[e] === m && (!b || !y && g.__staleWhileFetching === void 0 ? this.#z(t, "fetch") : S || (this.#t[e] = g.__staleWhileFetching)), _) return i.status && g.__staleWhileFetching !== void 0 && (i.status.returnedStale = true), g.__staleWhileFetching;
463
- if (g.__returned === g) throw w;
464
- }, p = (w, y) => {
465
- let l = this.#M?.(t, n, h);
466
- l && l instanceof Promise && l.then((S) => w(S === void 0 ? void 0 : S), y), o.signal.addEventListener("abort", () => {
467
- (!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (w(void 0), i.allowStaleOnFetchAbort && (w = (S) => a(S, true)));
468
- });
465
+ let o = new AbortController(), { signal: l } = i;
466
+ l?.addEventListener("abort", () => o.abort(l.reason), { signal: o.signal });
467
+ let h = { signal: o.signal, options: i, context: s }, r = (f, _ = false) => {
468
+ let { aborted: a } = o.signal, S = i.ignoreFetchAbort && f !== void 0, F = i.ignoreFetchAbort || !!(i.allowStaleOnFetchAbort && f !== void 0);
469
+ if (i.status && (a && !_ ? (i.status.fetchAborted = true, i.status.fetchError = o.signal.reason, S && (i.status.fetchAbortIgnored = true)) : i.status.fetchResolved = true), a && !S && !_) return w(o.signal.reason, F);
470
+ let b = d, m = this.#t[e];
471
+ return (m === d || m === void 0 && S && _) && (f === void 0 ? b.__staleWhileFetching !== void 0 ? this.#t[e] = b.__staleWhileFetching : this.#v(t, "fetch") : (i.status && (i.status.fetchUpdated = true), this.#O(t, f, h.options, b))), f;
472
+ }, c = (f) => (i.status && (i.status.fetchRejected = true, i.status.fetchError = f), w(f, false)), w = (f, _) => {
473
+ let { aborted: a } = o.signal, S = a && i.allowStaleOnFetchAbort, F = S || i.allowStaleOnFetchRejection, b = F || i.noDeleteOnFetchRejection, m = d;
474
+ if (this.#t[e] === d && (!b || !_ && m.__staleWhileFetching === void 0 ? this.#v(t, "fetch") : S || (this.#t[e] = m.__staleWhileFetching)), F) return i.status && m.__staleWhileFetching !== void 0 && (i.status.returnedStale = true), m.__staleWhileFetching;
475
+ if (m.__returned === m) throw f;
476
+ }, y = (f, _) => {
477
+ let a = this.#x?.(t, n, h);
478
+ o.signal.addEventListener("abort", () => {
479
+ (!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (f(void 0), i.allowStaleOnFetchAbort && (f = (S) => r(S, true)));
480
+ }), a && a instanceof Promise ? a.then((S) => f(S === void 0 ? void 0 : S), _) : a !== void 0 && f(a);
469
481
  };
470
482
  i.status && (i.status.fetchDispatched = true);
471
- let m = new Promise(p).then(a, d), T = Object.assign(m, { __abortController: o, __staleWhileFetching: n, __returned: void 0 });
472
- return e === void 0 ? (this.#W(t, T, { ...h.options, status: void 0 }), e = this.#s.get(t)) : this.#t[e] = T, T;
483
+ let d = new Promise(y).then(r, c), p = Object.assign(d, { __abortController: o, __staleWhileFetching: n, __returned: void 0 });
484
+ return e === void 0 ? (this.#O(t, p, { ...h.options, status: void 0 }), e = this.#s.get(t)) : this.#t[e] = p, p;
473
485
  }
474
486
  #e(t) {
475
- if (!this.#O) return false;
487
+ if (!this.#U) return false;
476
488
  let e = t;
477
489
  return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof AbortController;
478
490
  }
479
491
  fetch(t, e = {}) {
480
- let i = u.tracing.hasSubscribers, { status: s = D() ? {} : void 0 } = e;
492
+ let i = g.tracing.hasSubscribers, { status: s = C() ? {} : void 0 } = e;
481
493
  e.status = s, s && e.context && (s.context = e.context);
482
494
  let n = this.#q(t, e);
483
- return s && D() && i && (s.trace = true, u.tracing.tracePromise(() => n, s).catch(() => {
495
+ return s && i && (s.trace = true, g.tracing.tracePromise(() => n, s).catch(() => {
484
496
  })), n;
485
497
  }
486
498
  async #q(t, e = {}) {
487
- let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet: r = this.noDisposeOnSet, size: h = 0, sizeCalculation: a = this.sizeCalculation, noUpdateTTL: d = this.noUpdateTTL, noDeleteOnFetchRejection: f = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: p = this.allowStaleOnFetchRejection, ignoreFetchAbort: m = this.ignoreFetchAbort, allowStaleOnFetchAbort: T = this.allowStaleOnFetchAbort, context: w, forceRefresh: y = false, status: l, signal: S } = e;
488
- if (l && (l.op = "fetch", l.key = t, y && (l.forceRefresh = true)), !this.#O) return l && (l.fetch = "get"), this.#x(t, { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n, status: l });
489
- let _ = { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n, ttl: o, noDisposeOnSet: r, size: h, sizeCalculation: a, noUpdateTTL: d, noDeleteOnFetchRejection: f, allowStaleOnFetchRejection: p, allowStaleOnFetchAbort: T, ignoreFetchAbort: m, status: l, signal: S }, b = this.#s.get(t);
499
+ let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet: l = this.noDisposeOnSet, size: h = 0, sizeCalculation: r = this.sizeCalculation, noUpdateTTL: c = this.noUpdateTTL, noDeleteOnFetchRejection: w = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: y = this.allowStaleOnFetchRejection, ignoreFetchAbort: d = this.ignoreFetchAbort, allowStaleOnFetchAbort: p = this.allowStaleOnFetchAbort, context: f, forceRefresh: _ = false, status: a, signal: S } = e;
500
+ if (a && (a.op = "fetch", a.key = t, _ && (a.forceRefresh = true), a.cache = this), !this.#U) return a && (a.fetch = "get"), this.#L(t, { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n, status: a });
501
+ let F = { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n, ttl: o, noDisposeOnSet: l, size: h, sizeCalculation: r, noUpdateTTL: c, noDeleteOnFetchRejection: w, allowStaleOnFetchRejection: y, allowStaleOnFetchAbort: p, ignoreFetchAbort: d, status: a, signal: S }, b = this.#s.get(t);
490
502
  if (b === void 0) {
491
- l && (l.fetch = "miss");
492
- let g = this.#P(t, b, _, w);
493
- return g.__returned = g;
503
+ a && (a.fetch = "miss");
504
+ let m = this.#G(t, b, F, f);
505
+ return m.__returned = m;
494
506
  } else {
495
- let g = this.#t[b];
496
- if (this.#e(g)) {
497
- let E = i && g.__staleWhileFetching !== void 0;
498
- return l && (l.fetch = "inflight", E && (l.returnedStale = true)), E ? g.__staleWhileFetching : g.__returned = g;
507
+ let m = this.#t[b];
508
+ if (this.#e(m)) {
509
+ let E = i && m.__staleWhileFetching !== void 0;
510
+ return a && (a.fetch = "inflight", E && (a.returnedStale = true)), E ? m.__staleWhileFetching : m.__returned = m;
499
511
  }
500
512
  let A = this.#p(b);
501
- if (!y && !A) return l && (l.fetch = "hit"), this.#L(b), s && this.#R(b), l && this.#E(l, b), g;
502
- let v = this.#P(t, b, _, w), z = v.__staleWhileFetching !== void 0 && i;
503
- return l && (l.fetch = A ? "stale" : "refresh", z && A && (l.returnedStale = true)), z ? v.__staleWhileFetching : v.__returned = v;
513
+ if (!_ && !A) return a && (a.fetch = "hit"), this.#M(b), s && this.#D(b), a && this.#E(a, b), m;
514
+ let z = this.#G(t, b, F, f), v = z.__staleWhileFetching !== void 0 && i;
515
+ return a && (a.fetch = A ? "stale" : "refresh", v && A && (a.returnedStale = true)), v ? z.__staleWhileFetching : z.__returned = z;
504
516
  }
505
517
  }
506
518
  forceFetch(t, e = {}) {
507
- let i = u.tracing.hasSubscribers, { status: s = D() ? {} : void 0 } = e;
519
+ let i = g.tracing.hasSubscribers, { status: s = C() ? {} : void 0 } = e;
508
520
  e.status = s, s && e.context && (s.context = e.context);
509
521
  let n = this.#K(t, e);
510
- return s && D() && i && (s.trace = true, u.tracing.tracePromise(() => n, s).catch(() => {
522
+ return s && i && (s.trace = true, g.tracing.tracePromise(() => n, s).catch(() => {
511
523
  })), n;
512
524
  }
513
525
  async #K(t, e = {}) {
@@ -516,51 +528,51 @@ var require_index_min = __commonJS({
516
528
  return i;
517
529
  }
518
530
  memo(t, e = {}) {
519
- let { status: i = u.metrics.hasSubscribers ? {} : void 0 } = e;
520
- e.status = i, i && (i.op = "memo", i.key = t, e.context && (i.context = e.context));
531
+ let { status: i = g.metrics.hasSubscribers ? {} : void 0 } = e;
532
+ e.status = i, i && (i.op = "memo", i.key = t, e.context && (i.context = e.context), i.cache = this);
521
533
  let s = this.#Q(t, e);
522
- return i && (i.value = s), u.metrics.hasSubscribers && u.metrics.publish(i), s;
534
+ return i && (i.value = s), g.metrics.hasSubscribers && g.metrics.publish(i), s;
523
535
  }
524
536
  #Q(t, e = {}) {
525
537
  let i = this.#j;
526
538
  if (!i) throw new Error("no memoMethod provided to constructor");
527
- let { context: s, status: n, forceRefresh: o, ...r } = e;
539
+ let { context: s, status: n, forceRefresh: o, ...l } = e;
528
540
  n && o && (n.forceRefresh = true);
529
- let h = this.#x(t, r), a = o || h === void 0;
530
- if (n && (n.memo = a ? "miss" : "hit", a || (n.value = h)), !a) return h;
531
- let d = i(t, h, { options: r, context: s });
532
- return n && (n.value = d), this.#W(t, d, r), d;
541
+ let h = this.#L(t, l), r = o || h === void 0;
542
+ if (n && (n.memo = r ? "miss" : "hit", r || (n.value = h)), !r) return h;
543
+ let c = i(t, h, { options: l, context: s });
544
+ return n && (n.value = c), this.#O(t, c, l), c;
533
545
  }
534
546
  get(t, e = {}) {
535
- let { status: i = u.metrics.hasSubscribers ? {} : void 0 } = e;
536
- e.status = i, i && (i.op = "get", i.key = t);
537
- let s = this.#x(t, e);
538
- return i && (s !== void 0 && (i.value = s), u.metrics.hasSubscribers && u.metrics.publish(i)), s;
539
- }
540
- #x(t, e = {}) {
541
- let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, status: o } = e, r = this.#s.get(t);
542
- if (r === void 0) {
547
+ let { status: i = g.metrics.hasSubscribers ? {} : void 0 } = e;
548
+ e.status = i, i && (i.op = "get", i.key = t, i.cache = this);
549
+ let s = this.#L(t, e);
550
+ return i && (s !== void 0 && (i.value = s), g.metrics.hasSubscribers && g.metrics.publish(i)), s;
551
+ }
552
+ #L(t, e = {}) {
553
+ let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, status: o } = e, l = this.#s.get(t);
554
+ if (l === void 0) {
543
555
  o && (o.get = "miss");
544
556
  return;
545
557
  }
546
- let h = this.#t[r], a = this.#e(h);
547
- return o && this.#E(o, r), this.#p(r) ? a ? (o && (o.get = "stale-fetching"), i && h.__staleWhileFetching !== void 0 ? (o && (o.returnedStale = true), h.__staleWhileFetching) : void 0) : (n || this.#z(t, "expire"), o && (o.get = "stale"), i ? (o && (o.returnedStale = true), h) : void 0) : (o && (o.get = a ? "fetching" : "hit"), this.#L(r), s && this.#R(r), a ? h.__staleWhileFetching : h);
558
+ let h = this.#t[l], r = this.#e(h);
559
+ return o && this.#E(o, l), this.#p(l) ? r ? (o && (o.get = "stale-fetching"), i && h.__staleWhileFetching !== void 0 ? (o && (o.returnedStale = true), h.__staleWhileFetching) : void 0) : (n || this.#v(t, "expire"), o && (o.get = "stale"), i ? (o && (o.returnedStale = true), h) : void 0) : (o && (o.get = r ? "fetching" : "hit"), this.#M(l), s && this.#D(l), r ? h.__staleWhileFetching : h);
548
560
  }
549
561
  #B(t, e) {
550
562
  this.#u[e] = t, this.#l[t] = e;
551
563
  }
552
- #L(t) {
564
+ #M(t) {
553
565
  t !== this.#h && (t === this.#a ? this.#a = this.#l[t] : this.#B(this.#u[t], this.#l[t]), this.#B(this.#h, t), this.#h = t);
554
566
  }
555
567
  delete(t) {
556
- return this.#z(t, "delete");
568
+ return this.#v(t, "delete");
557
569
  }
558
- #z(t, e) {
559
- u.metrics.hasSubscribers && u.metrics.publish({ op: "delete", delete: e, key: t });
570
+ #v(t, e) {
571
+ g.metrics.hasSubscribers && g.metrics.publish({ op: "delete", delete: e, key: t, cache: this });
560
572
  let i = false;
561
573
  if (this.#n !== 0) {
562
574
  let s = this.#s.get(t);
563
- if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g?.[s]), this.#g[s] = void 0), i = true, this.#n === 1) this.#$(e);
575
+ if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g[s]), this.#g[s] = void 0), i = true, this.#n === 1) this.#$(e);
564
576
  else {
565
577
  this.#C(s);
566
578
  let n = this.#t[s];
@@ -569,15 +581,15 @@ var require_index_min = __commonJS({
569
581
  else {
570
582
  let o = this.#u[s];
571
583
  this.#l[o] = this.#l[s];
572
- let r = this.#l[s];
573
- this.#u[r] = this.#u[s];
584
+ let l = this.#l[s];
585
+ this.#u[l] = this.#u[s];
574
586
  }
575
- this.#n--, this.#y.push(s);
587
+ this.#n--, this.#_.push(s);
576
588
  }
577
589
  }
578
590
  if (this.#f && this.#r?.length) {
579
591
  let s = this.#r, n;
580
- for (; n = s?.shift(); ) this.#w?.(...n);
592
+ for (; n = s?.shift(); ) this.#S?.(...n);
581
593
  }
582
594
  return i;
583
595
  }
@@ -585,7 +597,7 @@ var require_index_min = __commonJS({
585
597
  return this.#$("delete");
586
598
  }
587
599
  #$(t) {
588
- for (let e of this.#v({ allowStale: true })) {
600
+ for (let e of this.#z({ allowStale: true })) {
589
601
  let i = this.#t[e];
590
602
  if (this.#e(i)) i.__abortController.abort(new Error("deleted"));
591
603
  else {
@@ -598,19 +610,19 @@ var require_index_min = __commonJS({
598
610
  for (let e of this.#g ?? []) e !== void 0 && clearTimeout(e);
599
611
  this.#g?.fill(void 0);
600
612
  }
601
- if (this.#_ && this.#_.fill(0), this.#a = 0, this.#h = 0, this.#y.length = 0, this.#b = 0, this.#n = 0, this.#f && this.#r) {
613
+ if (this.#y && this.#y.fill(0), this.#a = 0, this.#h = 0, this.#_.length = 0, this.#b = 0, this.#n = 0, this.#f && this.#r) {
602
614
  let e = this.#r, i;
603
- for (; i = e?.shift(); ) this.#w?.(...i);
615
+ for (; i = e?.shift(); ) this.#S?.(...i);
604
616
  }
605
617
  }
606
618
  };
607
- exports.LRUCache = x;
619
+ exports.LRUCache = M;
608
620
  }
609
621
  });
610
622
 
611
- // ../../node_modules/.vlt/~npm~hosted-git-info@9.0.2/node_modules/hosted-git-info/lib/hosts.js
623
+ // ../../node_modules/.vlt/~npm~hosted-git-info@9.0.3/node_modules/hosted-git-info/lib/hosts.js
612
624
  var require_hosts = __commonJS({
613
- "../../node_modules/.vlt/~npm~hosted-git-info@9.0.2/node_modules/hosted-git-info/lib/hosts.js"(exports, module) {
625
+ "../../node_modules/.vlt/~npm~hosted-git-info@9.0.3/node_modules/hosted-git-info/lib/hosts.js"(exports, module) {
614
626
  "use strict";
615
627
  var maybeJoin = (...args) => args.every((arg) => arg) ? args.join("") : "";
616
628
  var maybeEncode = (arg) => arg ? encodeURIComponent(arg) : "";
@@ -687,7 +699,7 @@ var require_hosts = __commonJS({
687
699
  treepath: "tree",
688
700
  blobpath: "tree",
689
701
  editpath: "-/edit",
690
- tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/repository/archive.tar.gz?ref=${maybeEncode(committish || "HEAD")}`,
702
+ tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/api/v4/projects/${maybeEncode(user + "/" + project)}/repository/archive.tar.gz?sha=${maybeEncode(committish || "HEAD")}`,
691
703
  extract: (url) => {
692
704
  const path = url.pathname.slice(1);
693
705
  if (path.includes("/-/") || path.includes("/archive.tar.gz")) {
@@ -750,7 +762,7 @@ var require_hosts = __commonJS({
750
762
  treepath: "tree",
751
763
  blobpath: "tree",
752
764
  filetemplate: ({ domain, user, project, committish, path }) => `https://${domain}/${user}/${project}/blob/${maybeEncode(committish) || "HEAD"}/${path}`,
753
- httpstemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
765
+ httpstemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}${maybeJoin("#", committish)}`,
754
766
  tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/archive/${maybeEncode(committish) || "HEAD"}.tar.gz`,
755
767
  bugstemplate: () => null,
756
768
  extract: (url) => {
@@ -774,9 +786,9 @@ var require_hosts = __commonJS({
774
786
  }
775
787
  });
776
788
 
777
- // ../../node_modules/.vlt/~npm~hosted-git-info@9.0.2/node_modules/hosted-git-info/lib/parse-url.js
789
+ // ../../node_modules/.vlt/~npm~hosted-git-info@9.0.3/node_modules/hosted-git-info/lib/parse-url.js
778
790
  var require_parse_url = __commonJS({
779
- "../../node_modules/.vlt/~npm~hosted-git-info@9.0.2/node_modules/hosted-git-info/lib/parse-url.js"(exports, module) {
791
+ "../../node_modules/.vlt/~npm~hosted-git-info@9.0.3/node_modules/hosted-git-info/lib/parse-url.js"(exports, module) {
780
792
  var url = __require("node:url");
781
793
  var lastIndexOfBefore = (str, char, beforeChar) => {
782
794
  const startPosition = str.indexOf(beforeChar);
@@ -825,9 +837,9 @@ var require_parse_url = __commonJS({
825
837
  }
826
838
  });
827
839
 
828
- // ../../node_modules/.vlt/~npm~hosted-git-info@9.0.2/node_modules/hosted-git-info/lib/from-url.js
840
+ // ../../node_modules/.vlt/~npm~hosted-git-info@9.0.3/node_modules/hosted-git-info/lib/from-url.js
829
841
  var require_from_url = __commonJS({
830
- "../../node_modules/.vlt/~npm~hosted-git-info@9.0.2/node_modules/hosted-git-info/lib/from-url.js"(exports, module) {
842
+ "../../node_modules/.vlt/~npm~hosted-git-info@9.0.3/node_modules/hosted-git-info/lib/from-url.js"(exports, module) {
831
843
  "use strict";
832
844
  var parseUrl = require_parse_url();
833
845
  var isGitHubShorthand = (arg) => {
@@ -919,9 +931,9 @@ var require_from_url = __commonJS({
919
931
  }
920
932
  });
921
933
 
922
- // ../../node_modules/.vlt/~npm~hosted-git-info@9.0.2/node_modules/hosted-git-info/lib/index.js
934
+ // ../../node_modules/.vlt/~npm~hosted-git-info@9.0.3/node_modules/hosted-git-info/lib/index.js
923
935
  var require_lib = __commonJS({
924
- "../../node_modules/.vlt/~npm~hosted-git-info@9.0.2/node_modules/hosted-git-info/lib/index.js"(exports, module) {
936
+ "../../node_modules/.vlt/~npm~hosted-git-info@9.0.3/node_modules/hosted-git-info/lib/index.js"(exports, module) {
925
937
  "use strict";
926
938
  var { LRUCache } = require_index_min();
927
939
  var hosts = require_hosts();