xframelib 1.1.3 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{worker-iconv-KS7y7NCM.js → worker-iconv-CmAR4oTq.js} +173 -169
- package/dist/assets/{worker-webcache-C22MEJ3V.js → worker-webcache-BS31iRI5.js} +193 -192
- package/dist/assets/{worker-xmath-CbuRtVJ1.js → worker-xmath-BSf3Zz2e.js} +25 -25
- package/dist/controls/layoutcontainer/layout.vue.d.ts +7 -7
- package/dist/controls/xwindow/XWindow.vue.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/model/Layout.d.ts +8 -36
- package/dist/utils/GzipTool.d.ts +1 -1
- package/package.json +14 -14
|
@@ -3,7 +3,7 @@ var t = Object.defineProperty;
|
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2019 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
-
*/ const e = Symbol("Comlink.proxy"), i = Symbol("Comlink.endpoint"), s = Symbol("Comlink.releaseProxy"),
|
|
6
|
+
*/ const e = Symbol("Comlink.proxy"), i = Symbol("Comlink.endpoint"), s = Symbol("Comlink.releaseProxy"), h = Symbol("Comlink.finalizer"), n = Symbol("Comlink.thrown"), r = (t) => "object" == typeof t && null !== t || "function" == typeof t, o = new Map([["proxy", {
|
|
7
7
|
canHandle: (t) => r(t) && t[e],
|
|
8
8
|
serialize(t) {
|
|
9
9
|
const { port1: e, port2: i } = new MessageChannel();
|
|
@@ -11,7 +11,7 @@ var t = Object.defineProperty;
|
|
|
11
11
|
},
|
|
12
12
|
deserialize: (t) => (t.start(), function(t) {
|
|
13
13
|
const e = /* @__PURE__ */ new Map();
|
|
14
|
-
return t.addEventListener("message",
|
|
14
|
+
return t.addEventListener("message", function(t) {
|
|
15
15
|
const { data: i } = t;
|
|
16
16
|
if (!i || !i.id) return;
|
|
17
17
|
const s = e.get(i.id);
|
|
@@ -20,10 +20,10 @@ var t = Object.defineProperty;
|
|
|
20
20
|
} finally {
|
|
21
21
|
e.delete(i.id);
|
|
22
22
|
}
|
|
23
|
-
})
|
|
23
|
+
}), p(t, e, [], void 0);
|
|
24
24
|
}(t))
|
|
25
25
|
}], ["throw", {
|
|
26
|
-
canHandle: (t) => r(t) &&
|
|
26
|
+
canHandle: (t) => r(t) && n in t,
|
|
27
27
|
serialize({ value: t }) {
|
|
28
28
|
let e;
|
|
29
29
|
return e = t instanceof Error ? {
|
|
@@ -44,7 +44,7 @@ var t = Object.defineProperty;
|
|
|
44
44
|
}
|
|
45
45
|
}]]);
|
|
46
46
|
function a(t, i = globalThis, s = ["*"]) {
|
|
47
|
-
i.addEventListener("message",
|
|
47
|
+
i.addEventListener("message", function r(o) {
|
|
48
48
|
if (!o || !o.data) return;
|
|
49
49
|
if (!function(t, e) {
|
|
50
50
|
for (const i of t) {
|
|
@@ -56,7 +56,7 @@ function a(t, i = globalThis, s = ["*"]) {
|
|
|
56
56
|
const { id: c, type: u, path: f } = Object.assign({ path: [] }, o.data), d = (o.data.argumentList || []).map(w);
|
|
57
57
|
let p;
|
|
58
58
|
try {
|
|
59
|
-
const i = f.slice(0, -1).reduce((
|
|
59
|
+
const i = f.slice(0, -1).reduce((t, e) => t[e], t), s = f.reduce((t, e) => t[e], t);
|
|
60
60
|
switch (u) {
|
|
61
61
|
case "GET":
|
|
62
62
|
p = s;
|
|
@@ -88,23 +88,23 @@ function a(t, i = globalThis, s = ["*"]) {
|
|
|
88
88
|
} catch (t) {
|
|
89
89
|
p = {
|
|
90
90
|
value: t,
|
|
91
|
-
[
|
|
91
|
+
[n]: 0
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
Promise.resolve(p).catch((
|
|
94
|
+
Promise.resolve(p).catch((t) => ({
|
|
95
95
|
value: t,
|
|
96
|
-
[
|
|
97
|
-
}))
|
|
98
|
-
const [s,
|
|
99
|
-
i.postMessage(Object.assign(Object.assign({}, s), { id: c }),
|
|
100
|
-
})
|
|
96
|
+
[n]: 0
|
|
97
|
+
})).then((e) => {
|
|
98
|
+
const [s, n] = m(e);
|
|
99
|
+
i.postMessage(Object.assign(Object.assign({}, s), { id: c }), n), "RELEASE" === u && (i.removeEventListener("message", r), l(i), h in t && "function" == typeof t[h] && t[h]());
|
|
100
|
+
}).catch((t) => {
|
|
101
101
|
const [e, s] = m({
|
|
102
102
|
value: /* @__PURE__ */ new TypeError("Unserializable return value"),
|
|
103
|
-
[
|
|
103
|
+
[n]: 0
|
|
104
104
|
});
|
|
105
105
|
i.postMessage(Object.assign(Object.assign({}, e), { id: c }), s);
|
|
106
|
-
})
|
|
107
|
-
})
|
|
106
|
+
});
|
|
107
|
+
}), i.start && i.start();
|
|
108
108
|
}
|
|
109
109
|
function l(t) {
|
|
110
110
|
(function(t) {
|
|
@@ -115,61 +115,61 @@ function c(t) {
|
|
|
115
115
|
if (t) throw new Error("Proxy has been released and is not useable");
|
|
116
116
|
}
|
|
117
117
|
function u(t) {
|
|
118
|
-
return y(t, /* @__PURE__ */ new Map(), { type: "RELEASE" }).then((
|
|
118
|
+
return y(t, /* @__PURE__ */ new Map(), { type: "RELEASE" }).then(() => {
|
|
119
119
|
l(t);
|
|
120
|
-
})
|
|
120
|
+
});
|
|
121
121
|
}
|
|
122
|
-
const f = /* @__PURE__ */ new WeakMap(), d = "FinalizationRegistry" in globalThis && new FinalizationRegistry((
|
|
122
|
+
const f = /* @__PURE__ */ new WeakMap(), d = "FinalizationRegistry" in globalThis && new FinalizationRegistry((t) => {
|
|
123
123
|
const e = (f.get(t) || 0) - 1;
|
|
124
124
|
f.set(t, e), 0 === e && u(t);
|
|
125
|
-
})
|
|
126
|
-
function p(t, e,
|
|
125
|
+
});
|
|
126
|
+
function p(t, e, h = [], n = function() {}) {
|
|
127
127
|
let r = !1;
|
|
128
|
-
const o = new Proxy(
|
|
129
|
-
get(i,
|
|
130
|
-
if (c(r),
|
|
128
|
+
const o = new Proxy(n, {
|
|
129
|
+
get(i, n) {
|
|
130
|
+
if (c(r), n === s) return () => {
|
|
131
131
|
(function(t) {
|
|
132
132
|
d && d.unregister(t);
|
|
133
133
|
})(o), u(t), e.clear(), r = !0;
|
|
134
134
|
};
|
|
135
|
-
if ("then" ===
|
|
136
|
-
if (0 ===
|
|
135
|
+
if ("then" === n) {
|
|
136
|
+
if (0 === h.length) return { then: () => o };
|
|
137
137
|
const i = y(t, e, {
|
|
138
138
|
type: "GET",
|
|
139
|
-
path:
|
|
139
|
+
path: h.map((t) => t.toString())
|
|
140
140
|
}).then(w);
|
|
141
141
|
return i.then.bind(i);
|
|
142
142
|
}
|
|
143
|
-
return p(t, e, [...
|
|
143
|
+
return p(t, e, [...h, n]);
|
|
144
144
|
},
|
|
145
|
-
set(i, s,
|
|
145
|
+
set(i, s, n) {
|
|
146
146
|
c(r);
|
|
147
|
-
const [o, a] = m(
|
|
147
|
+
const [o, a] = m(n);
|
|
148
148
|
return y(t, e, {
|
|
149
149
|
type: "SET",
|
|
150
|
-
path: [...
|
|
150
|
+
path: [...h, s].map((t) => t.toString()),
|
|
151
151
|
value: o
|
|
152
152
|
}, a).then(w);
|
|
153
153
|
},
|
|
154
|
-
apply(s,
|
|
154
|
+
apply(s, n, o) {
|
|
155
155
|
c(r);
|
|
156
|
-
const a =
|
|
156
|
+
const a = h[h.length - 1];
|
|
157
157
|
if (a === i) return y(t, e, { type: "ENDPOINT" }).then(w);
|
|
158
|
-
if ("bind" === a) return p(t, e,
|
|
158
|
+
if ("bind" === a) return p(t, e, h.slice(0, -1));
|
|
159
159
|
const [l, u] = g(o);
|
|
160
160
|
return y(t, e, {
|
|
161
161
|
type: "APPLY",
|
|
162
|
-
path:
|
|
162
|
+
path: h.map((t) => t.toString()),
|
|
163
163
|
argumentList: l
|
|
164
164
|
}, u).then(w);
|
|
165
165
|
},
|
|
166
166
|
construct(i, s) {
|
|
167
167
|
c(r);
|
|
168
|
-
const [
|
|
168
|
+
const [n, o] = g(s);
|
|
169
169
|
return y(t, e, {
|
|
170
170
|
type: "CONSTRUCT",
|
|
171
|
-
path:
|
|
172
|
-
argumentList:
|
|
171
|
+
path: h.map((t) => t.toString()),
|
|
172
|
+
argumentList: n
|
|
173
173
|
}, o).then(w);
|
|
174
174
|
}
|
|
175
175
|
});
|
|
@@ -180,18 +180,18 @@ function p(t, e, n = [], h = function() {}) {
|
|
|
180
180
|
}
|
|
181
181
|
function g(t) {
|
|
182
182
|
const e = t.map(m);
|
|
183
|
-
return [e.map((
|
|
183
|
+
return [e.map((t) => t[0]), (i = e.map((t) => t[1]), Array.prototype.concat.apply([], i))];
|
|
184
184
|
var i;
|
|
185
185
|
}
|
|
186
186
|
const v = /* @__PURE__ */ new WeakMap();
|
|
187
187
|
function m(t) {
|
|
188
188
|
for (const [e, i] of o) if (i.canHandle(t)) {
|
|
189
|
-
const [s,
|
|
189
|
+
const [s, h] = i.serialize(t);
|
|
190
190
|
return [{
|
|
191
191
|
type: "HANDLER",
|
|
192
192
|
name: e,
|
|
193
193
|
value: s
|
|
194
|
-
},
|
|
194
|
+
}, h];
|
|
195
195
|
}
|
|
196
196
|
return [{
|
|
197
197
|
type: "RAW",
|
|
@@ -205,12 +205,12 @@ function w(t) {
|
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
function y(t, e, i, s) {
|
|
208
|
-
return new Promise((
|
|
209
|
-
const
|
|
210
|
-
e.set(
|
|
211
|
-
})
|
|
208
|
+
return new Promise((h) => {
|
|
209
|
+
const n = new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
|
|
210
|
+
e.set(n, h), t.start && t.start(), t.postMessage(Object.assign({ id: n }, i), s);
|
|
211
|
+
});
|
|
212
212
|
}
|
|
213
|
-
var S = { hasSubscribers: !1 }, b = S,
|
|
213
|
+
var S = { hasSubscribers: !1 }, b = S, _ = S, T = "object" == typeof performance && performance && "function" == typeof performance.now ? performance : Date, E = () => b.hasSubscribers || _.hasSubscribers, A = /* @__PURE__ */ new Set(), O = "object" == typeof process && process ? process : {}, F = (t) => !!t && t === Math.floor(t) && t > 0 && isFinite(t), x = (t) => F(t) ? t <= Math.pow(2, 8) ? Uint8Array : t <= Math.pow(2, 16) ? Uint16Array : t <= Math.pow(2, 32) ? Uint32Array : t <= Number.MAX_SAFE_INTEGER ? z : null : null, z = class extends Array {
|
|
214
214
|
constructor(t) {
|
|
215
215
|
super(t), this.fill(0);
|
|
216
216
|
}
|
|
@@ -240,8 +240,8 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
240
240
|
#e;
|
|
241
241
|
#i;
|
|
242
242
|
#s;
|
|
243
|
-
#n;
|
|
244
243
|
#h;
|
|
244
|
+
#n;
|
|
245
245
|
#r;
|
|
246
246
|
#o;
|
|
247
247
|
get perf() {
|
|
@@ -276,8 +276,8 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
276
276
|
#y;
|
|
277
277
|
#S;
|
|
278
278
|
#b;
|
|
279
|
-
#T;
|
|
280
279
|
#_;
|
|
280
|
+
#T;
|
|
281
281
|
#E;
|
|
282
282
|
#A;
|
|
283
283
|
#O;
|
|
@@ -285,7 +285,7 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
285
285
|
return {
|
|
286
286
|
starts: t.#S,
|
|
287
287
|
ttls: t.#b,
|
|
288
|
-
autopurgeTimers: t.#
|
|
288
|
+
autopurgeTimers: t.#_,
|
|
289
289
|
sizes: t.#y,
|
|
290
290
|
keyMap: t.#c,
|
|
291
291
|
keyList: t.#u,
|
|
@@ -300,7 +300,7 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
300
300
|
},
|
|
301
301
|
free: t.#m,
|
|
302
302
|
isBackgroundFetch: (e) => t.#F(e),
|
|
303
|
-
backgroundFetch: (e, i, s,
|
|
303
|
+
backgroundFetch: (e, i, s, h) => t.#x(e, i, s, h),
|
|
304
304
|
moveToTail: (e) => t.#z(e),
|
|
305
305
|
indexes: (e) => t.#k(e),
|
|
306
306
|
rindexes: (e) => t.#C(e),
|
|
@@ -320,7 +320,7 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
320
320
|
return this.#a;
|
|
321
321
|
}
|
|
322
322
|
get fetchMethod() {
|
|
323
|
-
return this.#
|
|
323
|
+
return this.#n;
|
|
324
324
|
}
|
|
325
325
|
get memoMethod() {
|
|
326
326
|
return this.#r;
|
|
@@ -332,12 +332,12 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
332
332
|
return this.#s;
|
|
333
333
|
}
|
|
334
334
|
get disposeAfter() {
|
|
335
|
-
return this.#
|
|
335
|
+
return this.#h;
|
|
336
336
|
}
|
|
337
337
|
constructor(e) {
|
|
338
|
-
let { max: i = 0, ttl: s, ttlResolution:
|
|
338
|
+
let { max: i = 0, ttl: s, ttlResolution: h = 1, ttlAutopurge: n, updateAgeOnGet: r, updateAgeOnHas: o, allowStale: a, dispose: l, onInsert: c, disposeAfter: u, noDisposeOnSet: f, noUpdateTTL: d, maxSize: p = 0, maxEntrySize: g = 0, sizeCalculation: v, fetchMethod: m, memoMethod: w, noDeleteOnFetchRejection: y, noDeleteOnStaleGet: S, allowStaleOnFetchRejection: b, allowStaleOnFetchAbort: _, ignoreFetchAbort: E, perf: z } = e;
|
|
339
339
|
if (void 0 !== z && "function" != typeof z?.now) throw new TypeError("perf option must have a now() method if specified");
|
|
340
|
-
if (this.#o = z ??
|
|
340
|
+
if (this.#o = z ?? T, 0 !== i && !F(i)) throw new TypeError("max option must be a nonnegative integer");
|
|
341
341
|
let C = i ? x(i) : Array;
|
|
342
342
|
if (!C) throw new Error("invalid max value: " + i);
|
|
343
343
|
if (this.#t = i, this.#e = p, this.maxEntrySize = g || this.#e, this.sizeCalculation = v, this.sizeCalculation) {
|
|
@@ -346,12 +346,12 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
346
346
|
}
|
|
347
347
|
if (void 0 !== w && "function" != typeof w) throw new TypeError("memoMethod must be a function if defined");
|
|
348
348
|
if (this.#r = w, void 0 !== m && "function" != typeof m) throw new TypeError("fetchMethod must be a function if specified");
|
|
349
|
-
if (this.#
|
|
349
|
+
if (this.#n = m, this.#E = !!m, this.#c = /* @__PURE__ */ new Map(), this.#u = Array.from({ length: i }).fill(void 0), this.#f = Array.from({ length: i }).fill(void 0), this.#d = new C(i), this.#p = new C(i), this.#g = 0, this.#v = 0, this.#m = k.create(i), this.#a = 0, this.#l = 0, "function" == typeof l && (this.#i = l), "function" == typeof c && (this.#s = c), "function" == typeof u ? (this.#h = u, this.#w = []) : (this.#h = void 0, this.#w = void 0), this.#T = !!this.#i, this.#O = !!this.#s, this.#A = !!this.#h, this.noDisposeOnSet = !!f, this.noUpdateTTL = !!d, this.noDeleteOnFetchRejection = !!y, this.allowStaleOnFetchRejection = !!b, this.allowStaleOnFetchAbort = !!_, this.ignoreFetchAbort = !!E, 0 !== this.maxEntrySize) {
|
|
350
350
|
if (0 !== this.#e && !F(this.#e)) throw new TypeError("maxSize must be a positive integer if specified");
|
|
351
351
|
if (!F(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
352
352
|
this.#j();
|
|
353
353
|
}
|
|
354
|
-
if (this.allowStale = !!a, this.noDeleteOnStaleGet = !!S, this.updateAgeOnGet = !!r, this.updateAgeOnHas = !!o, this.ttlResolution = F(
|
|
354
|
+
if (this.allowStale = !!a, this.noDeleteOnStaleGet = !!S, this.updateAgeOnGet = !!r, this.updateAgeOnHas = !!o, this.ttlResolution = F(h) || 0 === h ? h : 1, this.ttlAutopurge = !!n, this.ttl = s || 0, this.ttl) {
|
|
355
355
|
if (!F(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
|
|
356
356
|
this.#D();
|
|
357
357
|
}
|
|
@@ -370,16 +370,16 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
370
370
|
let t = new z(this.#t), e = new z(this.#t);
|
|
371
371
|
this.#b = t, this.#S = e;
|
|
372
372
|
let i = this.ttlAutopurge ? Array.from({ length: this.#t }) : void 0;
|
|
373
|
-
this.#
|
|
374
|
-
e[i] = 0 !==
|
|
373
|
+
this.#_ = i, this.#W = (i, h, n = this.#o.now()) => {
|
|
374
|
+
e[i] = 0 !== h ? n : 0, t[i] = h, s(i, h);
|
|
375
375
|
}, this.#M = (i) => {
|
|
376
376
|
e[i] = 0 !== t[i] ? this.#o.now() : 0, s(i, t[i]);
|
|
377
377
|
};
|
|
378
378
|
let s = this.ttlAutopurge ? (t, e) => {
|
|
379
379
|
if (i?.[t] && (clearTimeout(i[t]), i[t] = void 0), e && 0 !== e && i) {
|
|
380
|
-
let s = setTimeout((
|
|
380
|
+
let s = setTimeout(() => {
|
|
381
381
|
this.#R(t) && this.#L(this.#u[t], "expire");
|
|
382
|
-
}
|
|
382
|
+
}, e + 1);
|
|
383
383
|
s.unref && s.unref(), i[t] = s;
|
|
384
384
|
}
|
|
385
385
|
} : () => {};
|
|
@@ -387,14 +387,14 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
387
387
|
if (t[s]) {
|
|
388
388
|
let r = t[s], o = e[s];
|
|
389
389
|
if (!r || !o) return;
|
|
390
|
-
i.ttl = r, i.start = o, i.now =
|
|
390
|
+
i.ttl = r, i.start = o, i.now = h || n(), i.remainingTTL = r - (i.now - o);
|
|
391
391
|
}
|
|
392
392
|
};
|
|
393
|
-
let
|
|
393
|
+
let h = 0, n = () => {
|
|
394
394
|
let t = this.#o.now();
|
|
395
395
|
if (this.ttlResolution > 0) {
|
|
396
|
-
|
|
397
|
-
let e = setTimeout((
|
|
396
|
+
h = t;
|
|
397
|
+
let e = setTimeout(() => h = 0, this.ttlResolution);
|
|
398
398
|
e.unref && e.unref();
|
|
399
399
|
}
|
|
400
400
|
return t;
|
|
@@ -403,10 +403,10 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
403
403
|
let s = this.#c.get(i);
|
|
404
404
|
if (void 0 === s) return 0;
|
|
405
405
|
let r = t[s], o = e[s];
|
|
406
|
-
return r && o ? r - ((
|
|
406
|
+
return r && o ? r - ((h || n()) - o) : Infinity;
|
|
407
407
|
}, this.#R = (i) => {
|
|
408
408
|
let s = e[i], r = t[i];
|
|
409
|
-
return !!r && !!s && (
|
|
409
|
+
return !!r && !!s && (h || n()) - s > r;
|
|
410
410
|
};
|
|
411
411
|
}
|
|
412
412
|
#M = () => {};
|
|
@@ -428,7 +428,7 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
428
428
|
}, this.#N = (e, i, s) => {
|
|
429
429
|
if (t[e] = i, this.#e) {
|
|
430
430
|
let i = this.#e - t[e];
|
|
431
|
-
for (; this.#l > i;) this.#
|
|
431
|
+
for (; this.#l > i;) this.#I(!0);
|
|
432
432
|
}
|
|
433
433
|
this.#l += t[e], s && (s.entrySize = i, s.totalCalculatedSize = this.#l);
|
|
434
434
|
};
|
|
@@ -440,12 +440,12 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
440
440
|
return 0;
|
|
441
441
|
};
|
|
442
442
|
*#k({ allowStale: t = this.allowStale } = {}) {
|
|
443
|
-
if (this.#a) for (let e = this.#v; this.#
|
|
443
|
+
if (this.#a) for (let e = this.#v; this.#H(e) && ((t || !this.#R(e)) && (yield e), e !== this.#g);) e = this.#p[e];
|
|
444
444
|
}
|
|
445
445
|
*#C({ allowStale: t = this.allowStale } = {}) {
|
|
446
|
-
if (this.#a) for (let e = this.#g; this.#
|
|
446
|
+
if (this.#a) for (let e = this.#g; this.#H(e) && ((t || !this.#R(e)) && (yield e), e !== this.#v);) e = this.#d[e];
|
|
447
447
|
}
|
|
448
|
-
#
|
|
448
|
+
#H(t) {
|
|
449
449
|
return void 0 !== t && this.#c.get(this.#u[t]) === t;
|
|
450
450
|
}
|
|
451
451
|
*entries() {
|
|
@@ -478,20 +478,20 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
478
478
|
[Symbol.toStringTag] = "LRUCache";
|
|
479
479
|
find(t, e = {}) {
|
|
480
480
|
for (let i of this.#k()) {
|
|
481
|
-
let s = this.#f[i],
|
|
482
|
-
if (void 0 !==
|
|
481
|
+
let s = this.#f[i], h = this.#F(s) ? s.__staleWhileFetching : s;
|
|
482
|
+
if (void 0 !== h && t(h, this.#u[i], this)) return this.#$(this.#u[i], e);
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
485
|
forEach(t, e = this) {
|
|
486
486
|
for (let i of this.#k()) {
|
|
487
|
-
let s = this.#f[i],
|
|
488
|
-
void 0 !==
|
|
487
|
+
let s = this.#f[i], h = this.#F(s) ? s.__staleWhileFetching : s;
|
|
488
|
+
void 0 !== h && t.call(e, h, this.#u[i], this);
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
491
|
rforEach(t, e = this) {
|
|
492
492
|
for (let i of this.#C()) {
|
|
493
|
-
let s = this.#f[i],
|
|
494
|
-
void 0 !==
|
|
493
|
+
let s = this.#f[i], h = this.#F(s) ? s.__staleWhileFetching : s;
|
|
494
|
+
void 0 !== h && t.call(e, h, this.#u[i], this);
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
497
|
purgeStale() {
|
|
@@ -504,25 +504,25 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
504
504
|
if (void 0 === e) return;
|
|
505
505
|
let i = this.#f[e], s = this.#F(i) ? i.__staleWhileFetching : i;
|
|
506
506
|
if (void 0 === s) return;
|
|
507
|
-
let
|
|
507
|
+
let h = { value: s };
|
|
508
508
|
if (this.#b && this.#S) {
|
|
509
509
|
let t = this.#b[e], i = this.#S[e];
|
|
510
|
-
t && i && (
|
|
510
|
+
t && i && (h.ttl = t - (this.#o.now() - i), h.start = Date.now());
|
|
511
511
|
}
|
|
512
|
-
return this.#y && (
|
|
512
|
+
return this.#y && (h.size = this.#y[e]), h;
|
|
513
513
|
}
|
|
514
514
|
dump() {
|
|
515
515
|
let t = [];
|
|
516
516
|
for (let e of this.#k({ allowStale: !0 })) {
|
|
517
|
-
let i = this.#u[e], s = this.#f[e],
|
|
518
|
-
if (void 0 ===
|
|
519
|
-
let
|
|
517
|
+
let i = this.#u[e], s = this.#f[e], h = this.#F(s) ? s.__staleWhileFetching : s;
|
|
518
|
+
if (void 0 === h || void 0 === i) continue;
|
|
519
|
+
let n = { value: h };
|
|
520
520
|
if (this.#b && this.#S) {
|
|
521
|
-
|
|
521
|
+
n.ttl = this.#b[e];
|
|
522
522
|
let t = this.#o.now() - this.#S[e];
|
|
523
|
-
|
|
523
|
+
n.start = Math.floor(Date.now() - t);
|
|
524
524
|
}
|
|
525
|
-
this.#y && (
|
|
525
|
+
this.#y && (n.size = this.#y[e]), t.unshift([i, n]);
|
|
526
526
|
}
|
|
527
527
|
return t;
|
|
528
528
|
}
|
|
@@ -538,47 +538,45 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
538
538
|
}
|
|
539
539
|
set(t, e, i = {}) {
|
|
540
540
|
let { status: s = b.hasSubscribers ? {} : void 0 } = i;
|
|
541
|
-
i.status = s, s && (s.op = "set", s.key = t, void 0 !== e && (s.value = e));
|
|
542
|
-
let
|
|
543
|
-
return s && b.hasSubscribers && b.publish(s),
|
|
544
|
-
}
|
|
545
|
-
#B(t, e, i
|
|
546
|
-
let { ttl:
|
|
547
|
-
if (void 0 === e) return
|
|
548
|
-
let { noUpdateTTL:
|
|
549
|
-
|
|
550
|
-
let
|
|
551
|
-
if (this.maxEntrySize &&
|
|
552
|
-
let
|
|
553
|
-
if (void 0 ===
|
|
541
|
+
i.status = s, s && (s.op = "set", s.key = t, void 0 !== e && (s.value = e), s.cache = this);
|
|
542
|
+
let h = this.#B(t, e, i);
|
|
543
|
+
return s && b.hasSubscribers && b.publish(s), h;
|
|
544
|
+
}
|
|
545
|
+
#B(t, e, i, s) {
|
|
546
|
+
let { ttl: h = this.ttl, start: n, noDisposeOnSet: r = this.noDisposeOnSet, sizeCalculation: o = this.sizeCalculation, status: a } = i;
|
|
547
|
+
if (void 0 === e) return a && (a.set = "deleted"), this.delete(t), this;
|
|
548
|
+
let { noUpdateTTL: l = this.noUpdateTTL } = i, c = this.#F(e);
|
|
549
|
+
a && !c && (a.value = e);
|
|
550
|
+
let u = this.#P(t, e, i.size || 0, o, a);
|
|
551
|
+
if (this.maxEntrySize && u > this.maxEntrySize) return this.#L(t, "set"), a && (a.set = "miss", a.maxEntrySizeExceeded = !0), this;
|
|
552
|
+
let f = 0 === this.#a ? void 0 : this.#c.get(t);
|
|
553
|
+
if (void 0 === f) f = 0 === this.#a ? this.#v : 0 !== this.#m.length ? this.#m.pop() : this.#a === this.#t ? this.#I(!1) : this.#a, this.#u[f] = t, this.#f[f] = e, this.#c.set(t, f), this.#d[this.#v] = f, this.#p[f] = this.#v, this.#v = f, this.#a++, this.#N(f, u, a), a && (a.set = "add"), l = !1, this.#O && !c && this.#s?.(e, t, "add");
|
|
554
554
|
else {
|
|
555
|
-
this.#z(
|
|
556
|
-
let i = this.#f[
|
|
555
|
+
this.#z(f);
|
|
556
|
+
let i = this.#f[f];
|
|
557
557
|
if (e !== i) {
|
|
558
|
-
if (
|
|
559
|
-
i.__abortController.abort(/* @__PURE__ */ new Error("replaced"));
|
|
560
|
-
let { __staleWhileFetching:
|
|
561
|
-
void 0 !==
|
|
562
|
-
|
|
558
|
+
if (!r) if (this.#F(i)) {
|
|
559
|
+
i !== s && i.__abortController.abort(/* @__PURE__ */ new Error("replaced"));
|
|
560
|
+
let { __staleWhileFetching: h } = i;
|
|
561
|
+
void 0 !== h && h !== e && (this.#T && this.#i?.(h, t, "set"), this.#A && this.#w?.push([
|
|
562
|
+
h,
|
|
563
563
|
t,
|
|
564
564
|
"set"
|
|
565
565
|
]));
|
|
566
|
-
} else
|
|
566
|
+
} else this.#T && this.#i?.(i, t, "set"), this.#A && this.#w?.push([
|
|
567
567
|
i,
|
|
568
568
|
t,
|
|
569
569
|
"set"
|
|
570
|
-
])
|
|
571
|
-
if (this.#U(
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
void 0 !== t && (o.oldValue = t);
|
|
570
|
+
]);
|
|
571
|
+
if (this.#U(f), this.#N(f, u, a), this.#f[f] = e, !c) {
|
|
572
|
+
let s = i && this.#F(i) ? i.__staleWhileFetching : i, h = void 0 === s ? "add" : e !== s ? "replace" : "update";
|
|
573
|
+
a && (a.set = h, void 0 !== s && (a.oldValue = s)), this.#O && this.onInsert?.(e, t, h);
|
|
575
574
|
}
|
|
576
|
-
} else
|
|
577
|
-
this.#O && this.onInsert?.(e, t, e === i ? "update" : "replace");
|
|
575
|
+
} else c || (a && (a.set = "update"), this.#O && this.onInsert?.(e, t, "update"));
|
|
578
576
|
}
|
|
579
|
-
if (0 !==
|
|
577
|
+
if (0 !== h && !this.#b && this.#D(), this.#b && (l || this.#W(f, h, n), a && this.#G(a, f)), !r && this.#A && this.#w) {
|
|
580
578
|
let t, e = this.#w;
|
|
581
|
-
for (; t = e?.shift();) this.#
|
|
579
|
+
for (; t = e?.shift();) this.#h?.(...t);
|
|
582
580
|
}
|
|
583
581
|
return this;
|
|
584
582
|
}
|
|
@@ -586,81 +584,83 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
586
584
|
try {
|
|
587
585
|
for (; this.#a;) {
|
|
588
586
|
let t = this.#f[this.#g];
|
|
589
|
-
if (this.#
|
|
587
|
+
if (this.#I(!0), this.#F(t)) {
|
|
590
588
|
if (t.__staleWhileFetching) return t.__staleWhileFetching;
|
|
591
589
|
} else if (void 0 !== t) return t;
|
|
592
590
|
}
|
|
593
591
|
} finally {
|
|
594
592
|
if (this.#A && this.#w) {
|
|
595
593
|
let t, e = this.#w;
|
|
596
|
-
for (; t = e?.shift();) this.#
|
|
594
|
+
for (; t = e?.shift();) this.#h?.(...t);
|
|
597
595
|
}
|
|
598
596
|
}
|
|
599
597
|
}
|
|
600
|
-
#
|
|
601
|
-
let e = this.#g, i = this.#u[e], s = this.#f[e];
|
|
602
|
-
|
|
603
|
-
|
|
598
|
+
#I(t) {
|
|
599
|
+
let e = this.#g, i = this.#u[e], s = this.#f[e], h = this.#F(s);
|
|
600
|
+
h && s.__abortController.abort(/* @__PURE__ */ new Error("evicted"));
|
|
601
|
+
let n = h ? s.__staleWhileFetching : s;
|
|
602
|
+
return (this.#T || this.#A) && void 0 !== n && (this.#T && this.#i?.(n, i, "evict"), this.#A && this.#w?.push([
|
|
603
|
+
n,
|
|
604
604
|
i,
|
|
605
605
|
"evict"
|
|
606
|
-
])), this.#U(e), this.#
|
|
606
|
+
])), this.#U(e), this.#_?.[e] && (clearTimeout(this.#_[e]), this.#_[e] = void 0), t && (this.#u[e] = void 0, this.#f[e] = void 0, this.#m.push(e)), 1 === this.#a ? (this.#g = this.#v = 0, this.#m.length = 0) : this.#g = this.#d[e], this.#c.delete(i), this.#a--, e;
|
|
607
607
|
}
|
|
608
608
|
has(t, e = {}) {
|
|
609
609
|
let { status: i = b.hasSubscribers ? {} : void 0 } = e;
|
|
610
|
-
e.status = i, i && (i.op = "has", i.key = t);
|
|
610
|
+
e.status = i, i && (i.op = "has", i.key = t, i.cache = this);
|
|
611
611
|
let s = this.#X(t, e);
|
|
612
612
|
return b.hasSubscribers && b.publish(i), s;
|
|
613
613
|
}
|
|
614
614
|
#X(t, e = {}) {
|
|
615
|
-
let { updateAgeOnHas: i = this.updateAgeOnHas, status: s } = e,
|
|
616
|
-
if (void 0 !==
|
|
617
|
-
let t = this.#f[
|
|
615
|
+
let { updateAgeOnHas: i = this.updateAgeOnHas, status: s } = e, h = this.#c.get(t);
|
|
616
|
+
if (void 0 !== h) {
|
|
617
|
+
let t = this.#f[h];
|
|
618
618
|
if (this.#F(t) && void 0 === t.__staleWhileFetching) return !1;
|
|
619
|
-
if (!this.#R(
|
|
620
|
-
s && (s.has = "stale", this.#G(s,
|
|
619
|
+
if (!this.#R(h)) return i && this.#M(h), s && (s.has = "hit", this.#G(s, h)), !0;
|
|
620
|
+
s && (s.has = "stale", this.#G(s, h));
|
|
621
621
|
} else s && (s.has = "miss");
|
|
622
622
|
return !1;
|
|
623
623
|
}
|
|
624
624
|
peek(t, e = {}) {
|
|
625
625
|
let { status: i = E() ? {} : void 0 } = e;
|
|
626
|
-
i && (i.op = "peek", i.key = t), e.status = i;
|
|
626
|
+
i && (i.op = "peek", i.key = t, i.cache = this), e.status = i;
|
|
627
627
|
let s = this.#Y(t, e);
|
|
628
628
|
return b.hasSubscribers && b.publish(i), s;
|
|
629
629
|
}
|
|
630
630
|
#Y(t, e) {
|
|
631
|
-
let { status: i, allowStale: s = this.allowStale } = e,
|
|
632
|
-
if (void 0 ===
|
|
633
|
-
let
|
|
631
|
+
let { status: i, allowStale: s = this.allowStale } = e, h = this.#c.get(t);
|
|
632
|
+
if (void 0 === h || !s && this.#R(h)) return void (i && (i.peek = void 0 === h ? "miss" : "stale"));
|
|
633
|
+
let n = this.#f[h], r = this.#F(n) ? n.__staleWhileFetching : n;
|
|
634
634
|
return i && (void 0 !== r ? (i.peek = "hit", i.value = r) : i.peek = "miss"), r;
|
|
635
635
|
}
|
|
636
636
|
#x(t, e, i, s) {
|
|
637
|
-
let
|
|
638
|
-
if (this.#F(
|
|
639
|
-
let
|
|
640
|
-
r?.addEventListener("abort", (
|
|
637
|
+
let h = void 0 === e ? void 0 : this.#f[e];
|
|
638
|
+
if (this.#F(h)) return h;
|
|
639
|
+
let n = new AbortController(), { signal: r } = i;
|
|
640
|
+
r?.addEventListener("abort", () => n.abort(r.reason), { signal: n.signal });
|
|
641
641
|
let o = {
|
|
642
|
-
signal:
|
|
642
|
+
signal: n.signal,
|
|
643
643
|
options: i,
|
|
644
644
|
context: s
|
|
645
|
-
}, a = (s,
|
|
646
|
-
let { aborted: r } =
|
|
647
|
-
if (i.status && (r && !
|
|
645
|
+
}, a = (s, h = !1) => {
|
|
646
|
+
let { aborted: r } = n.signal, a = i.ignoreFetchAbort && void 0 !== s, u = i.ignoreFetchAbort || !(!i.allowStaleOnFetchAbort || void 0 === s);
|
|
647
|
+
if (i.status && (r && !h ? (i.status.fetchAborted = !0, i.status.fetchError = n.signal.reason, a && (i.status.fetchAbortIgnored = !0)) : i.status.fetchResolved = !0), r && !a && !h) return l(n.signal.reason, u);
|
|
648
648
|
let f = c, d = this.#f[e];
|
|
649
|
-
return (d === c || void 0 === d && a &&
|
|
650
|
-
}, l = (s,
|
|
651
|
-
let { aborted: r } =
|
|
652
|
-
if (this.#f[e] === c && (!l || !
|
|
649
|
+
return (d === c || void 0 === d && a && h) && (void 0 === s ? void 0 !== f.__staleWhileFetching ? this.#f[e] = f.__staleWhileFetching : this.#L(t, "fetch") : (i.status && (i.status.fetchUpdated = !0), this.#B(t, s, o.options, f))), s;
|
|
650
|
+
}, l = (s, h) => {
|
|
651
|
+
let { aborted: r } = n.signal, o = r && i.allowStaleOnFetchAbort, a = o || i.allowStaleOnFetchRejection, l = a || i.noDeleteOnFetchRejection, u = c;
|
|
652
|
+
if (this.#f[e] === c && (!l || !h && void 0 === u.__staleWhileFetching ? this.#L(t, "fetch") : o || (this.#f[e] = u.__staleWhileFetching)), a) return i.status && void 0 !== u.__staleWhileFetching && (i.status.returnedStale = !0), u.__staleWhileFetching;
|
|
653
653
|
if (u.__returned === u) throw s;
|
|
654
654
|
};
|
|
655
655
|
i.status && (i.status.fetchDispatched = !0);
|
|
656
|
-
let c = new Promise((
|
|
657
|
-
let r = this.#
|
|
658
|
-
|
|
656
|
+
let c = new Promise((e, s) => {
|
|
657
|
+
let r = this.#n?.(t, h, o);
|
|
658
|
+
n.signal.addEventListener("abort", () => {
|
|
659
659
|
(!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (e(void 0), i.allowStaleOnFetchAbort && (e = (t) => a(t, !0)));
|
|
660
|
-
}));
|
|
661
|
-
})
|
|
662
|
-
__abortController:
|
|
663
|
-
__staleWhileFetching:
|
|
660
|
+
}), r && r instanceof Promise ? r.then((t) => e(void 0 === t ? void 0 : t), s) : void 0 !== r && e(r);
|
|
661
|
+
}).then(a, (t) => (i.status && (i.status.fetchRejected = !0, i.status.fetchError = t), l(t, !1))), u = Object.assign(c, {
|
|
662
|
+
__abortController: n,
|
|
663
|
+
__staleWhileFetching: h,
|
|
664
664
|
__returned: void 0
|
|
665
665
|
});
|
|
666
666
|
return void 0 === e ? (this.#B(t, u, {
|
|
@@ -674,24 +674,24 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
674
674
|
return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof AbortController;
|
|
675
675
|
}
|
|
676
676
|
fetch(t, e = {}) {
|
|
677
|
-
let i =
|
|
677
|
+
let i = _.hasSubscribers, { status: s = E() ? {} : void 0 } = e;
|
|
678
678
|
e.status = s, s && e.context && (s.context = e.context);
|
|
679
|
-
let
|
|
680
|
-
return s && i && (s.trace = !0,
|
|
679
|
+
let h = this.#q(t, e);
|
|
680
|
+
return s && i && (s.trace = !0, _.tracePromise(() => h, s).catch(() => {})), h;
|
|
681
681
|
}
|
|
682
682
|
async #q(t, e = {}) {
|
|
683
|
-
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet:
|
|
684
|
-
if (v && (v.op = "fetch", v.key = t, g && (v.forceRefresh = !0)), !this.#E) return v && (v.fetch = "get"), this.#$(t, {
|
|
683
|
+
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: h = this.noDeleteOnStaleGet, ttl: n = this.ttl, noDisposeOnSet: r = this.noDisposeOnSet, size: o = 0, sizeCalculation: a = this.sizeCalculation, noUpdateTTL: l = this.noUpdateTTL, noDeleteOnFetchRejection: c = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: u = this.allowStaleOnFetchRejection, ignoreFetchAbort: f = this.ignoreFetchAbort, allowStaleOnFetchAbort: d = this.allowStaleOnFetchAbort, context: p, forceRefresh: g = !1, status: v, signal: m } = e;
|
|
684
|
+
if (v && (v.op = "fetch", v.key = t, g && (v.forceRefresh = !0), v.cache = this), !this.#E) return v && (v.fetch = "get"), this.#$(t, {
|
|
685
685
|
allowStale: i,
|
|
686
686
|
updateAgeOnGet: s,
|
|
687
|
-
noDeleteOnStaleGet:
|
|
687
|
+
noDeleteOnStaleGet: h,
|
|
688
688
|
status: v
|
|
689
689
|
});
|
|
690
690
|
let w = {
|
|
691
691
|
allowStale: i,
|
|
692
692
|
updateAgeOnGet: s,
|
|
693
|
-
noDeleteOnStaleGet:
|
|
694
|
-
ttl:
|
|
693
|
+
noDeleteOnStaleGet: h,
|
|
694
|
+
ttl: n,
|
|
695
695
|
noDisposeOnSet: r,
|
|
696
696
|
size: o,
|
|
697
697
|
sizeCalculation: a,
|
|
@@ -714,17 +714,17 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
714
714
|
let t = i && void 0 !== e.__staleWhileFetching;
|
|
715
715
|
return v && (v.fetch = "inflight", t && (v.returnedStale = !0)), t ? e.__staleWhileFetching : e.__returned = e;
|
|
716
716
|
}
|
|
717
|
-
let
|
|
718
|
-
if (!g && !
|
|
719
|
-
let
|
|
720
|
-
return v && (v.fetch =
|
|
717
|
+
let h = this.#R(y);
|
|
718
|
+
if (!g && !h) return v && (v.fetch = "hit"), this.#z(y), s && this.#M(y), v && this.#G(v, y), e;
|
|
719
|
+
let n = this.#x(t, y, w, p), r = void 0 !== n.__staleWhileFetching && i;
|
|
720
|
+
return v && (v.fetch = h ? "stale" : "refresh", r && h && (v.returnedStale = !0)), r ? n.__staleWhileFetching : n.__returned = n;
|
|
721
721
|
}
|
|
722
722
|
}
|
|
723
723
|
forceFetch(t, e = {}) {
|
|
724
|
-
let i =
|
|
724
|
+
let i = _.hasSubscribers, { status: s = E() ? {} : void 0 } = e;
|
|
725
725
|
e.status = s, s && e.context && (s.context = e.context);
|
|
726
|
-
let
|
|
727
|
-
return s && i && (s.trace = !0,
|
|
726
|
+
let h = this.#K(t, e);
|
|
727
|
+
return s && i && (s.trace = !0, _.tracePromise(() => h, s).catch(() => {})), h;
|
|
728
728
|
}
|
|
729
729
|
async #K(t, e = {}) {
|
|
730
730
|
let i = await this.#q(t, e);
|
|
@@ -733,34 +733,34 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
733
733
|
}
|
|
734
734
|
memo(t, e = {}) {
|
|
735
735
|
let { status: i = b.hasSubscribers ? {} : void 0 } = e;
|
|
736
|
-
e.status = i, i && (i.op = "memo", i.key = t, e.context && (i.context = e.context));
|
|
736
|
+
e.status = i, i && (i.op = "memo", i.key = t, e.context && (i.context = e.context), i.cache = this);
|
|
737
737
|
let s = this.#Q(t, e);
|
|
738
738
|
return i && (i.value = s), b.hasSubscribers && b.publish(i), s;
|
|
739
739
|
}
|
|
740
740
|
#Q(t, e = {}) {
|
|
741
741
|
let i = this.#r;
|
|
742
742
|
if (!i) throw new Error("no memoMethod provided to constructor");
|
|
743
|
-
let { context: s, status:
|
|
744
|
-
|
|
745
|
-
let o = this.#$(t, r), a =
|
|
746
|
-
if (
|
|
743
|
+
let { context: s, status: h, forceRefresh: n, ...r } = e;
|
|
744
|
+
h && n && (h.forceRefresh = !0);
|
|
745
|
+
let o = this.#$(t, r), a = n || void 0 === o;
|
|
746
|
+
if (h && (h.memo = a ? "miss" : "hit", a || (h.value = o)), !a) return o;
|
|
747
747
|
let l = i(t, o, {
|
|
748
748
|
options: r,
|
|
749
749
|
context: s
|
|
750
750
|
});
|
|
751
|
-
return
|
|
751
|
+
return h && (h.value = l), this.#B(t, l, r), l;
|
|
752
752
|
}
|
|
753
753
|
get(t, e = {}) {
|
|
754
754
|
let { status: i = b.hasSubscribers ? {} : void 0 } = e;
|
|
755
|
-
e.status = i, i && (i.op = "get", i.key = t);
|
|
755
|
+
e.status = i, i && (i.op = "get", i.key = t, i.cache = this);
|
|
756
756
|
let s = this.#$(t, e);
|
|
757
757
|
return i && (void 0 !== s && (i.value = s), b.hasSubscribers && b.publish(i)), s;
|
|
758
758
|
}
|
|
759
759
|
#$(t, e = {}) {
|
|
760
|
-
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet:
|
|
761
|
-
if (void 0 === r) return void (
|
|
760
|
+
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: h = this.noDeleteOnStaleGet, status: n } = e, r = this.#c.get(t);
|
|
761
|
+
if (void 0 === r) return void (n && (n.get = "miss"));
|
|
762
762
|
let o = this.#f[r], a = this.#F(o);
|
|
763
|
-
return
|
|
763
|
+
return n && this.#G(n, r), this.#R(r) ? a ? (n && (n.get = "stale-fetching"), i && void 0 !== o.__staleWhileFetching ? (n && (n.returnedStale = !0), o.__staleWhileFetching) : void 0) : (h || this.#L(t, "expire"), n && (n.get = "stale"), i ? (n && (n.returnedStale = !0), o) : void 0) : (n && (n.get = a ? "fetching" : "hit"), this.#z(r), s && this.#M(r), a ? o.__staleWhileFetching : o);
|
|
764
764
|
}
|
|
765
765
|
#V(t, e) {
|
|
766
766
|
this.#p[e] = t, this.#d[t] = e;
|
|
@@ -775,16 +775,17 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
775
775
|
b.hasSubscribers && b.publish({
|
|
776
776
|
op: "delete",
|
|
777
777
|
delete: e,
|
|
778
|
-
key: t
|
|
778
|
+
key: t,
|
|
779
|
+
cache: this
|
|
779
780
|
});
|
|
780
781
|
let i = !1;
|
|
781
782
|
if (0 !== this.#a) {
|
|
782
783
|
let s = this.#c.get(t);
|
|
783
|
-
if (void 0 !== s) if (this.#
|
|
784
|
+
if (void 0 !== s) if (this.#_?.[s] && (clearTimeout(this.#_?.[s]), this.#_[s] = void 0), i = !0, 1 === this.#a) this.#J(e);
|
|
784
785
|
else {
|
|
785
786
|
this.#U(s);
|
|
786
787
|
let i = this.#f[s];
|
|
787
|
-
if (this.#F(i) ? i.__abortController.abort(/* @__PURE__ */ new Error("deleted")) : (this.#
|
|
788
|
+
if (this.#F(i) ? i.__abortController.abort(/* @__PURE__ */ new Error("deleted")) : (this.#T || this.#A) && (this.#T && this.#i?.(i, t, e), this.#A && this.#w?.push([
|
|
788
789
|
i,
|
|
789
790
|
t,
|
|
790
791
|
e
|
|
@@ -801,7 +802,7 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
801
802
|
}
|
|
802
803
|
if (this.#A && this.#w?.length) {
|
|
803
804
|
let t, e = this.#w;
|
|
804
|
-
for (; t = e?.shift();) this.#
|
|
805
|
+
for (; t = e?.shift();) this.#h?.(...t);
|
|
805
806
|
}
|
|
806
807
|
return i;
|
|
807
808
|
}
|
|
@@ -814,7 +815,7 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
814
815
|
if (this.#F(i)) i.__abortController.abort(/* @__PURE__ */ new Error("deleted"));
|
|
815
816
|
else {
|
|
816
817
|
let s = this.#u[e];
|
|
817
|
-
this.#
|
|
818
|
+
this.#T && this.#i?.(i, s, t), this.#A && this.#w?.push([
|
|
818
819
|
i,
|
|
819
820
|
s,
|
|
820
821
|
t
|
|
@@ -823,12 +824,12 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
823
824
|
}
|
|
824
825
|
if (this.#c.clear(), this.#f.fill(void 0), this.#u.fill(void 0), this.#b && this.#S) {
|
|
825
826
|
this.#b.fill(0), this.#S.fill(0);
|
|
826
|
-
for (let t of this.#
|
|
827
|
-
this.#
|
|
827
|
+
for (let t of this.#_ ?? []) void 0 !== t && clearTimeout(t);
|
|
828
|
+
this.#_?.fill(void 0);
|
|
828
829
|
}
|
|
829
830
|
if (this.#y && this.#y.fill(0), this.#g = 0, this.#v = 0, this.#m.length = 0, this.#l = 0, this.#a = 0, this.#A && this.#w) {
|
|
830
831
|
let t, e = this.#w;
|
|
831
|
-
for (; t = e?.shift();) this.#
|
|
832
|
+
for (; t = e?.shift();) this.#h?.(...t);
|
|
832
833
|
}
|
|
833
834
|
}
|
|
834
835
|
}, R = class {
|
|
@@ -878,8 +879,8 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
878
879
|
}
|
|
879
880
|
}, j = ((e, i) => {
|
|
880
881
|
let s = {};
|
|
881
|
-
for (var
|
|
882
|
-
get: e[
|
|
882
|
+
for (var h in e) t(s, h, {
|
|
883
|
+
get: e[h],
|
|
883
884
|
enumerable: !0
|
|
884
885
|
});
|
|
885
886
|
return i || t(s, Symbol.toStringTag, { value: "Module" }), s;
|
|
@@ -891,8 +892,8 @@ var S = { hasSubscribers: !1 }, b = S, T = S, _ = "object" == typeof performance
|
|
|
891
892
|
getCacheObject: () => M,
|
|
892
893
|
has: () => P,
|
|
893
894
|
keys: () => B,
|
|
894
|
-
maxSize: () =>
|
|
895
|
-
peek: () =>
|
|
895
|
+
maxSize: () => I,
|
|
896
|
+
peek: () => H,
|
|
896
897
|
remove: () => U,
|
|
897
898
|
set: () => L
|
|
898
899
|
});
|
|
@@ -907,8 +908,8 @@ async function W(t, e = void 0) {
|
|
|
907
908
|
...i,
|
|
908
909
|
...e
|
|
909
910
|
});
|
|
910
|
-
const
|
|
911
|
-
return D.set(t,
|
|
911
|
+
const h = R.createCache(s);
|
|
912
|
+
return D.set(t, h), h;
|
|
912
913
|
}
|
|
913
914
|
async function M(t = "") {
|
|
914
915
|
let e;
|
|
@@ -937,11 +938,11 @@ async function N(t = "") {
|
|
|
937
938
|
const e = await M(t);
|
|
938
939
|
return e ? R.count(e) : 0;
|
|
939
940
|
}
|
|
940
|
-
async function
|
|
941
|
+
async function I(t = "") {
|
|
941
942
|
const e = await M(t);
|
|
942
943
|
return e ? R.maxSize(e) : 0;
|
|
943
944
|
}
|
|
944
|
-
async function
|
|
945
|
+
async function H(t, e = "") {
|
|
945
946
|
const i = await M(e);
|
|
946
947
|
return !!i && R.peek(t, i);
|
|
947
948
|
}
|