@shotstack/shotstack-canvas 2.1.7 → 2.1.9
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/entry.node.cjs +2 -1
- package/dist/entry.node.d.cts +0 -2
- package/dist/entry.node.d.ts +0 -2
- package/dist/entry.node.js +2 -1
- package/dist/entry.web.d.ts +0 -2
- package/dist/entry.web.js +192 -186
- package/package.json +2 -2
package/dist/entry.node.cjs
CHANGED
|
@@ -503,6 +503,7 @@ var canvasStyleSchema = import_zod2.richTextStyleSchema.extend({
|
|
|
503
503
|
textDecoration: import_zod.z.enum(["none", "underline", "line-through"]).default("none"),
|
|
504
504
|
gradient: canvasGradientSchema.optional()
|
|
505
505
|
});
|
|
506
|
+
var captionStyleSchema = canvasStyleSchema.omit({ wordSpacing: true });
|
|
506
507
|
var canvasStrokeSchema = import_zod2.richTextStrokeSchema.extend({
|
|
507
508
|
width: import_zod.z.number().min(0).default(0),
|
|
508
509
|
color: import_zod.z.string().regex(HEX6).default("#000000"),
|
|
@@ -628,7 +629,7 @@ var richCaptionAssetSchema = import_zod.z.object({
|
|
|
628
629
|
src: import_zod.z.string().min(1).optional(),
|
|
629
630
|
words: import_zod.z.array(wordTimingSchema).max(1e5).optional(),
|
|
630
631
|
font: richCaptionFontSchema.optional(),
|
|
631
|
-
style:
|
|
632
|
+
style: captionStyleSchema.optional(),
|
|
632
633
|
stroke: canvasStrokeSchema.optional(),
|
|
633
634
|
shadow: canvasShadowSchema.optional(),
|
|
634
635
|
background: canvasBackgroundSchema.optional(),
|
package/dist/entry.node.d.cts
CHANGED
|
@@ -273,7 +273,6 @@ declare const richCaptionAssetSchema: z.ZodObject<{
|
|
|
273
273
|
background: z.ZodOptional<z.ZodString>;
|
|
274
274
|
}, z.core.$strip>>;
|
|
275
275
|
style: z.ZodOptional<z.ZodObject<{
|
|
276
|
-
wordSpacing: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>, z.ZodString]>>>;
|
|
277
276
|
letterSpacing: z.ZodDefault<z.ZodNumber>;
|
|
278
277
|
lineHeight: z.ZodDefault<z.ZodNumber>;
|
|
279
278
|
textTransform: z.ZodDefault<z.ZodEnum<{
|
|
@@ -410,7 +409,6 @@ declare const CanvasRichCaptionAssetSchema: z.ZodObject<{
|
|
|
410
409
|
background: z.ZodOptional<z.ZodString>;
|
|
411
410
|
}, z.core.$strip>>;
|
|
412
411
|
style: z.ZodOptional<z.ZodObject<{
|
|
413
|
-
wordSpacing: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>, z.ZodString]>>>;
|
|
414
412
|
letterSpacing: z.ZodDefault<z.ZodNumber>;
|
|
415
413
|
lineHeight: z.ZodDefault<z.ZodNumber>;
|
|
416
414
|
textTransform: z.ZodDefault<z.ZodEnum<{
|
package/dist/entry.node.d.ts
CHANGED
|
@@ -273,7 +273,6 @@ declare const richCaptionAssetSchema: z.ZodObject<{
|
|
|
273
273
|
background: z.ZodOptional<z.ZodString>;
|
|
274
274
|
}, z.core.$strip>>;
|
|
275
275
|
style: z.ZodOptional<z.ZodObject<{
|
|
276
|
-
wordSpacing: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>, z.ZodString]>>>;
|
|
277
276
|
letterSpacing: z.ZodDefault<z.ZodNumber>;
|
|
278
277
|
lineHeight: z.ZodDefault<z.ZodNumber>;
|
|
279
278
|
textTransform: z.ZodDefault<z.ZodEnum<{
|
|
@@ -410,7 +409,6 @@ declare const CanvasRichCaptionAssetSchema: z.ZodObject<{
|
|
|
410
409
|
background: z.ZodOptional<z.ZodString>;
|
|
411
410
|
}, z.core.$strip>>;
|
|
412
411
|
style: z.ZodOptional<z.ZodObject<{
|
|
413
|
-
wordSpacing: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>, z.ZodString]>>>;
|
|
414
412
|
letterSpacing: z.ZodDefault<z.ZodNumber>;
|
|
415
413
|
lineHeight: z.ZodDefault<z.ZodNumber>;
|
|
416
414
|
textTransform: z.ZodDefault<z.ZodEnum<{
|
package/dist/entry.node.js
CHANGED
|
@@ -100,6 +100,7 @@ var canvasStyleSchema = richTextStyleSchema.extend({
|
|
|
100
100
|
textDecoration: z.enum(["none", "underline", "line-through"]).default("none"),
|
|
101
101
|
gradient: canvasGradientSchema.optional()
|
|
102
102
|
});
|
|
103
|
+
var captionStyleSchema = canvasStyleSchema.omit({ wordSpacing: true });
|
|
103
104
|
var canvasStrokeSchema = richTextStrokeSchema.extend({
|
|
104
105
|
width: z.number().min(0).default(0),
|
|
105
106
|
color: z.string().regex(HEX6).default("#000000"),
|
|
@@ -225,7 +226,7 @@ var richCaptionAssetSchema = z.object({
|
|
|
225
226
|
src: z.string().min(1).optional(),
|
|
226
227
|
words: z.array(wordTimingSchema).max(1e5).optional(),
|
|
227
228
|
font: richCaptionFontSchema.optional(),
|
|
228
|
-
style:
|
|
229
|
+
style: captionStyleSchema.optional(),
|
|
229
230
|
stroke: canvasStrokeSchema.optional(),
|
|
230
231
|
shadow: canvasShadowSchema.optional(),
|
|
231
232
|
background: canvasBackgroundSchema.optional(),
|
package/dist/entry.web.d.ts
CHANGED
|
@@ -273,7 +273,6 @@ declare const richCaptionAssetSchema: z.ZodObject<{
|
|
|
273
273
|
background: z.ZodOptional<z.ZodString>;
|
|
274
274
|
}, z.core.$strip>>;
|
|
275
275
|
style: z.ZodOptional<z.ZodObject<{
|
|
276
|
-
wordSpacing: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>, z.ZodString]>>>;
|
|
277
276
|
letterSpacing: z.ZodDefault<z.ZodNumber>;
|
|
278
277
|
lineHeight: z.ZodDefault<z.ZodNumber>;
|
|
279
278
|
textTransform: z.ZodDefault<z.ZodEnum<{
|
|
@@ -410,7 +409,6 @@ declare const CanvasRichCaptionAssetSchema: z.ZodObject<{
|
|
|
410
409
|
background: z.ZodOptional<z.ZodString>;
|
|
411
410
|
}, z.core.$strip>>;
|
|
412
411
|
style: z.ZodOptional<z.ZodObject<{
|
|
413
|
-
wordSpacing: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>, z.ZodString]>>>;
|
|
414
412
|
letterSpacing: z.ZodDefault<z.ZodNumber>;
|
|
415
413
|
lineHeight: z.ZodDefault<z.ZodNumber>;
|
|
416
414
|
textTransform: z.ZodDefault<z.ZodEnum<{
|
package/dist/entry.web.js
CHANGED
|
@@ -4063,8 +4063,8 @@ var require_decode = __commonJS({
|
|
|
4063
4063
|
meta_block_remaining_len -= len;
|
|
4064
4064
|
if (copy_dst >= ringbuffer_end) {
|
|
4065
4065
|
output.write(ringbuffer, ringbuffer_size);
|
|
4066
|
-
for (var
|
|
4067
|
-
ringbuffer[
|
|
4066
|
+
for (var _x = 0; _x < copy_dst - ringbuffer_end; _x++)
|
|
4067
|
+
ringbuffer[_x] = ringbuffer[ringbuffer_end + _x];
|
|
4068
4068
|
}
|
|
4069
4069
|
} else {
|
|
4070
4070
|
throw new Error("Invalid backward reference. pos: " + pos + " distance: " + distance + " len: " + copy_length + " bytes left: " + meta_block_remaining_len);
|
|
@@ -4777,7 +4777,7 @@ function assertNotEqual(val) {
|
|
|
4777
4777
|
}
|
|
4778
4778
|
function assertIs(_arg) {
|
|
4779
4779
|
}
|
|
4780
|
-
function assertNever(
|
|
4780
|
+
function assertNever(_x) {
|
|
4781
4781
|
throw new Error("Unexpected value in exhaustive check");
|
|
4782
4782
|
}
|
|
4783
4783
|
function assert(_) {
|
|
@@ -17978,6 +17978,7 @@ var canvasStyleSchema = richTextStyleSchema.extend({
|
|
|
17978
17978
|
textDecoration: external_exports.enum(["none", "underline", "line-through"]).default("none"),
|
|
17979
17979
|
gradient: canvasGradientSchema.optional()
|
|
17980
17980
|
});
|
|
17981
|
+
var captionStyleSchema = canvasStyleSchema.omit({ wordSpacing: true });
|
|
17981
17982
|
var canvasStrokeSchema = richTextStrokeSchema.extend({
|
|
17982
17983
|
width: external_exports.number().min(0).default(0),
|
|
17983
17984
|
color: external_exports.string().regex(HEX6).default("#000000"),
|
|
@@ -18103,7 +18104,7 @@ var richCaptionAssetSchema = external_exports.object({
|
|
|
18103
18104
|
src: external_exports.string().min(1).optional(),
|
|
18104
18105
|
words: external_exports.array(wordTimingSchema).max(1e5).optional(),
|
|
18105
18106
|
font: richCaptionFontSchema.optional(),
|
|
18106
|
-
style:
|
|
18107
|
+
style: captionStyleSchema.optional(),
|
|
18107
18108
|
stroke: canvasStrokeSchema.optional(),
|
|
18108
18109
|
shadow: canvasShadowSchema.optional(),
|
|
18109
18110
|
background: canvasBackgroundSchema.optional(),
|
|
@@ -34264,12 +34265,12 @@ function parseHex6(hex3, alpha = 1) {
|
|
|
34264
34265
|
return { r, g, b, a: alpha };
|
|
34265
34266
|
}
|
|
34266
34267
|
|
|
34267
|
-
// node_modules/.pnpm/lru-cache@11.2.
|
|
34268
|
-
var
|
|
34268
|
+
// node_modules/.pnpm/lru-cache@11.2.7/node_modules/lru-cache/dist/esm/index.min.js
|
|
34269
|
+
var x = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
|
|
34269
34270
|
var I = /* @__PURE__ */ new Set();
|
|
34270
34271
|
var R = typeof process == "object" && process ? process : {};
|
|
34271
|
-
var
|
|
34272
|
-
typeof R.emitWarning == "function" ? R.emitWarning(
|
|
34272
|
+
var U = (c, t, e, i) => {
|
|
34273
|
+
typeof R.emitWarning == "function" ? R.emitWarning(c, t, e, i) : console.error(`[${e}] ${t}: ${c}`);
|
|
34273
34274
|
};
|
|
34274
34275
|
var C = globalThis.AbortController;
|
|
34275
34276
|
var D = globalThis.AbortSignal;
|
|
@@ -34297,13 +34298,13 @@ if (typeof C > "u") {
|
|
|
34297
34298
|
}
|
|
34298
34299
|
}
|
|
34299
34300
|
};
|
|
34300
|
-
let
|
|
34301
|
-
|
|
34301
|
+
let c = R.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1", t = () => {
|
|
34302
|
+
c && (c = false, U("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", t));
|
|
34302
34303
|
};
|
|
34303
34304
|
}
|
|
34304
|
-
var G = (
|
|
34305
|
-
var y = (
|
|
34306
|
-
var
|
|
34305
|
+
var G = (c) => !I.has(c);
|
|
34306
|
+
var y = (c) => c && c === Math.floor(c) && c > 0 && isFinite(c);
|
|
34307
|
+
var M = (c) => y(c) ? c <= Math.pow(2, 8) ? Uint8Array : c <= Math.pow(2, 16) ? Uint16Array : c <= Math.pow(2, 32) ? Uint32Array : c <= Number.MAX_SAFE_INTEGER ? z2 : null : null;
|
|
34307
34308
|
var z2 = class extends Array {
|
|
34308
34309
|
constructor(t) {
|
|
34309
34310
|
super(t), this.fill(0);
|
|
@@ -34318,7 +34319,7 @@ var W = (_a2 = class {
|
|
|
34318
34319
|
this.heap = new e(t), this.length = 0;
|
|
34319
34320
|
}
|
|
34320
34321
|
static create(t) {
|
|
34321
|
-
let e =
|
|
34322
|
+
let e = M(t);
|
|
34322
34323
|
if (!e) return [];
|
|
34323
34324
|
__privateSet(_a2, _o, true);
|
|
34324
34325
|
let i = new _a2(t, e);
|
|
@@ -34331,10 +34332,10 @@ var W = (_a2 = class {
|
|
|
34331
34332
|
return this.heap[--this.length];
|
|
34332
34333
|
}
|
|
34333
34334
|
}, _o = new WeakMap(), __privateAdd(_a2, _o, false), _a2);
|
|
34334
|
-
var _a3, _b, _o2, _c2, _w, _C, _S, _L, _I, _m, _n, __, _s, _i, _t, _a4, _u, _l, _h, _b2, _r, _y, _A, _d, _g, _T, _v, _f,
|
|
34335
|
+
var _a3, _b, _o2, _c2, _w, _C, _S, _L, _I, _m, _n, __, _s, _i, _t, _a4, _u, _l, _h, _b2, _r, _y, _A, _d, _g, _T, _v, _f, _U, _c_instances, j_fn, _R, _z, _N, _p, B_fn, _W, _M, _P, F_fn, O_fn, H_fn, x_fn, G_fn, e_fn, k_fn, D_fn, E_fn, V_fn, _c;
|
|
34335
34336
|
var L = (_c = class {
|
|
34336
34337
|
constructor(t) {
|
|
34337
|
-
__privateAdd(this,
|
|
34338
|
+
__privateAdd(this, _c_instances);
|
|
34338
34339
|
__privateAdd(this, _o2);
|
|
34339
34340
|
__privateAdd(this, _c2);
|
|
34340
34341
|
__privateAdd(this, _w);
|
|
@@ -34376,7 +34377,7 @@ var L = (_c = class {
|
|
|
34376
34377
|
__privateAdd(this, _T);
|
|
34377
34378
|
__privateAdd(this, _v);
|
|
34378
34379
|
__privateAdd(this, _f);
|
|
34379
|
-
__privateAdd(this,
|
|
34380
|
+
__privateAdd(this, _U);
|
|
34380
34381
|
__privateAdd(this, _R, () => {
|
|
34381
34382
|
});
|
|
34382
34383
|
__privateAdd(this, _z, () => {
|
|
@@ -34386,37 +34387,37 @@ var L = (_c = class {
|
|
|
34386
34387
|
__privateAdd(this, _p, () => false);
|
|
34387
34388
|
__privateAdd(this, _W, (t) => {
|
|
34388
34389
|
});
|
|
34389
|
-
__privateAdd(this,
|
|
34390
|
+
__privateAdd(this, _M, (t, e, i) => {
|
|
34390
34391
|
});
|
|
34391
34392
|
__privateAdd(this, _P, (t, e, i, s) => {
|
|
34392
34393
|
if (i || s) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
34393
34394
|
return 0;
|
|
34394
34395
|
});
|
|
34395
34396
|
__publicField(this, _a3, "LRUCache");
|
|
34396
|
-
let { max: e = 0, ttl: i, ttlResolution: s = 1, ttlAutopurge:
|
|
34397
|
+
let { max: e = 0, ttl: i, ttlResolution: s = 1, ttlAutopurge: n, updateAgeOnGet: o, updateAgeOnHas: h, allowStale: r, dispose: a, onInsert: w, disposeAfter: f, noDisposeOnSet: d, noUpdateTTL: g, maxSize: A = 0, maxEntrySize: p = 0, sizeCalculation: _, fetchMethod: l, memoMethod: S, noDeleteOnFetchRejection: b, noDeleteOnStaleGet: m, allowStaleOnFetchRejection: u, allowStaleOnFetchAbort: T, ignoreFetchAbort: F, perf: v } = t;
|
|
34397
34398
|
if (v !== void 0 && typeof v?.now != "function") throw new TypeError("perf option must have a now() method if specified");
|
|
34398
|
-
if (__privateSet(this, _m, v ??
|
|
34399
|
-
let O = e ?
|
|
34399
|
+
if (__privateSet(this, _m, v ?? x), e !== 0 && !y(e)) throw new TypeError("max option must be a nonnegative integer");
|
|
34400
|
+
let O = e ? M(e) : Array;
|
|
34400
34401
|
if (!O) throw new Error("invalid max value: " + e);
|
|
34401
34402
|
if (__privateSet(this, _o2, e), __privateSet(this, _c2, A), this.maxEntrySize = p || __privateGet(this, _c2), this.sizeCalculation = _, this.sizeCalculation) {
|
|
34402
34403
|
if (!__privateGet(this, _c2) && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
34403
34404
|
if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
|
|
34404
34405
|
}
|
|
34405
|
-
if (
|
|
34406
|
-
if (__privateSet(this, _I,
|
|
34407
|
-
if (__privateSet(this, _L, l), __privateSet(this, _v, !!l), __privateSet(this, _s, /* @__PURE__ */ new Map()), __privateSet(this, _i, new Array(e).fill(void 0)), __privateSet(this, _t, new Array(e).fill(void 0)), __privateSet(this, _a4, new O(e)), __privateSet(this, _u, new O(e)), __privateSet(this, _l, 0), __privateSet(this, _h, 0), __privateSet(this, _b2, W.create(e)), __privateSet(this, _n, 0), __privateSet(this, __, 0), typeof
|
|
34406
|
+
if (S !== void 0 && typeof S != "function") throw new TypeError("memoMethod must be a function if defined");
|
|
34407
|
+
if (__privateSet(this, _I, S), l !== void 0 && typeof l != "function") throw new TypeError("fetchMethod must be a function if specified");
|
|
34408
|
+
if (__privateSet(this, _L, l), __privateSet(this, _v, !!l), __privateSet(this, _s, /* @__PURE__ */ new Map()), __privateSet(this, _i, new Array(e).fill(void 0)), __privateSet(this, _t, new Array(e).fill(void 0)), __privateSet(this, _a4, new O(e)), __privateSet(this, _u, new O(e)), __privateSet(this, _l, 0), __privateSet(this, _h, 0), __privateSet(this, _b2, W.create(e)), __privateSet(this, _n, 0), __privateSet(this, __, 0), typeof a == "function" && __privateSet(this, _w, a), typeof w == "function" && __privateSet(this, _C, w), typeof f == "function" ? (__privateSet(this, _S, f), __privateSet(this, _r, [])) : (__privateSet(this, _S, void 0), __privateSet(this, _r, void 0)), __privateSet(this, _T, !!__privateGet(this, _w)), __privateSet(this, _U, !!__privateGet(this, _C)), __privateSet(this, _f, !!__privateGet(this, _S)), this.noDisposeOnSet = !!d, this.noUpdateTTL = !!g, this.noDeleteOnFetchRejection = !!b, this.allowStaleOnFetchRejection = !!u, this.allowStaleOnFetchAbort = !!T, this.ignoreFetchAbort = !!F, this.maxEntrySize !== 0) {
|
|
34408
34409
|
if (__privateGet(this, _c2) !== 0 && !y(__privateGet(this, _c2))) throw new TypeError("maxSize must be a positive integer if specified");
|
|
34409
34410
|
if (!y(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
34410
|
-
__privateMethod(this,
|
|
34411
|
+
__privateMethod(this, _c_instances, B_fn).call(this);
|
|
34411
34412
|
}
|
|
34412
|
-
if (this.allowStale = !!r, this.noDeleteOnStaleGet = !!
|
|
34413
|
+
if (this.allowStale = !!r, this.noDeleteOnStaleGet = !!m, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!h, this.ttlResolution = y(s) || s === 0 ? s : 1, this.ttlAutopurge = !!n, this.ttl = i || 0, this.ttl) {
|
|
34413
34414
|
if (!y(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
|
|
34414
|
-
__privateMethod(this,
|
|
34415
|
+
__privateMethod(this, _c_instances, j_fn).call(this);
|
|
34415
34416
|
}
|
|
34416
34417
|
if (__privateGet(this, _o2) === 0 && this.ttl === 0 && __privateGet(this, _c2) === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
34417
34418
|
if (!this.ttlAutopurge && !__privateGet(this, _o2) && !__privateGet(this, _c2)) {
|
|
34418
34419
|
let E = "LRU_CACHE_UNBOUNDED";
|
|
34419
|
-
G(E) && (I.add(E),
|
|
34420
|
+
G(E) && (I.add(E), U("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", E, _c));
|
|
34420
34421
|
}
|
|
34421
34422
|
}
|
|
34422
34423
|
get perf() {
|
|
@@ -34429,19 +34430,19 @@ var L = (_c = class {
|
|
|
34429
34430
|
return __privateGet(t, _h);
|
|
34430
34431
|
}, free: __privateGet(t, _b2), isBackgroundFetch: (e) => {
|
|
34431
34432
|
var _a5;
|
|
34432
|
-
return __privateMethod(_a5 = t,
|
|
34433
|
-
}, backgroundFetch: (e, i, s,
|
|
34433
|
+
return __privateMethod(_a5 = t, _c_instances, e_fn).call(_a5, e);
|
|
34434
|
+
}, backgroundFetch: (e, i, s, n) => {
|
|
34434
34435
|
var _a5;
|
|
34435
|
-
return __privateMethod(_a5 = t,
|
|
34436
|
+
return __privateMethod(_a5 = t, _c_instances, G_fn).call(_a5, e, i, s, n);
|
|
34436
34437
|
}, moveToTail: (e) => {
|
|
34437
34438
|
var _a5;
|
|
34438
|
-
return __privateMethod(_a5 = t,
|
|
34439
|
+
return __privateMethod(_a5 = t, _c_instances, D_fn).call(_a5, e);
|
|
34439
34440
|
}, indexes: (e) => {
|
|
34440
34441
|
var _a5;
|
|
34441
|
-
return __privateMethod(_a5 = t,
|
|
34442
|
+
return __privateMethod(_a5 = t, _c_instances, F_fn).call(_a5, e);
|
|
34442
34443
|
}, rindexes: (e) => {
|
|
34443
34444
|
var _a5;
|
|
34444
|
-
return __privateMethod(_a5 = t,
|
|
34445
|
+
return __privateMethod(_a5 = t, _c_instances, O_fn).call(_a5, e);
|
|
34445
34446
|
}, isStale: (e) => {
|
|
34446
34447
|
var _a5;
|
|
34447
34448
|
return __privateGet(_a5 = t, _p).call(_a5, e);
|
|
@@ -34478,82 +34479,82 @@ var L = (_c = class {
|
|
|
34478
34479
|
return __privateGet(this, _s).has(t) ? 1 / 0 : 0;
|
|
34479
34480
|
}
|
|
34480
34481
|
*entries() {
|
|
34481
|
-
for (let t of __privateMethod(this,
|
|
34482
|
+
for (let t of __privateMethod(this, _c_instances, F_fn).call(this)) __privateGet(this, _t)[t] !== void 0 && __privateGet(this, _i)[t] !== void 0 && !__privateMethod(this, _c_instances, e_fn).call(this, __privateGet(this, _t)[t]) && (yield [__privateGet(this, _i)[t], __privateGet(this, _t)[t]]);
|
|
34482
34483
|
}
|
|
34483
34484
|
*rentries() {
|
|
34484
|
-
for (let t of __privateMethod(this,
|
|
34485
|
+
for (let t of __privateMethod(this, _c_instances, O_fn).call(this)) __privateGet(this, _t)[t] !== void 0 && __privateGet(this, _i)[t] !== void 0 && !__privateMethod(this, _c_instances, e_fn).call(this, __privateGet(this, _t)[t]) && (yield [__privateGet(this, _i)[t], __privateGet(this, _t)[t]]);
|
|
34485
34486
|
}
|
|
34486
34487
|
*keys() {
|
|
34487
|
-
for (let t of __privateMethod(this,
|
|
34488
|
+
for (let t of __privateMethod(this, _c_instances, F_fn).call(this)) {
|
|
34488
34489
|
let e = __privateGet(this, _i)[t];
|
|
34489
|
-
e !== void 0 && !__privateMethod(this,
|
|
34490
|
+
e !== void 0 && !__privateMethod(this, _c_instances, e_fn).call(this, __privateGet(this, _t)[t]) && (yield e);
|
|
34490
34491
|
}
|
|
34491
34492
|
}
|
|
34492
34493
|
*rkeys() {
|
|
34493
|
-
for (let t of __privateMethod(this,
|
|
34494
|
+
for (let t of __privateMethod(this, _c_instances, O_fn).call(this)) {
|
|
34494
34495
|
let e = __privateGet(this, _i)[t];
|
|
34495
|
-
e !== void 0 && !__privateMethod(this,
|
|
34496
|
+
e !== void 0 && !__privateMethod(this, _c_instances, e_fn).call(this, __privateGet(this, _t)[t]) && (yield e);
|
|
34496
34497
|
}
|
|
34497
34498
|
}
|
|
34498
34499
|
*values() {
|
|
34499
|
-
for (let t of __privateMethod(this,
|
|
34500
|
+
for (let t of __privateMethod(this, _c_instances, F_fn).call(this)) __privateGet(this, _t)[t] !== void 0 && !__privateMethod(this, _c_instances, e_fn).call(this, __privateGet(this, _t)[t]) && (yield __privateGet(this, _t)[t]);
|
|
34500
34501
|
}
|
|
34501
34502
|
*rvalues() {
|
|
34502
|
-
for (let t of __privateMethod(this,
|
|
34503
|
+
for (let t of __privateMethod(this, _c_instances, O_fn).call(this)) __privateGet(this, _t)[t] !== void 0 && !__privateMethod(this, _c_instances, e_fn).call(this, __privateGet(this, _t)[t]) && (yield __privateGet(this, _t)[t]);
|
|
34503
34504
|
}
|
|
34504
34505
|
[(_b = Symbol.iterator, _a3 = Symbol.toStringTag, _b)]() {
|
|
34505
34506
|
return this.entries();
|
|
34506
34507
|
}
|
|
34507
34508
|
find(t, e = {}) {
|
|
34508
|
-
for (let i of __privateMethod(this,
|
|
34509
|
-
let s = __privateGet(this, _t)[i],
|
|
34510
|
-
if (
|
|
34509
|
+
for (let i of __privateMethod(this, _c_instances, F_fn).call(this)) {
|
|
34510
|
+
let s = __privateGet(this, _t)[i], n = __privateMethod(this, _c_instances, e_fn).call(this, s) ? s.__staleWhileFetching : s;
|
|
34511
|
+
if (n !== void 0 && t(n, __privateGet(this, _i)[i], this)) return this.get(__privateGet(this, _i)[i], e);
|
|
34511
34512
|
}
|
|
34512
34513
|
}
|
|
34513
34514
|
forEach(t, e = this) {
|
|
34514
|
-
for (let i of __privateMethod(this,
|
|
34515
|
-
let s = __privateGet(this, _t)[i],
|
|
34516
|
-
|
|
34515
|
+
for (let i of __privateMethod(this, _c_instances, F_fn).call(this)) {
|
|
34516
|
+
let s = __privateGet(this, _t)[i], n = __privateMethod(this, _c_instances, e_fn).call(this, s) ? s.__staleWhileFetching : s;
|
|
34517
|
+
n !== void 0 && t.call(e, n, __privateGet(this, _i)[i], this);
|
|
34517
34518
|
}
|
|
34518
34519
|
}
|
|
34519
34520
|
rforEach(t, e = this) {
|
|
34520
|
-
for (let i of __privateMethod(this,
|
|
34521
|
-
let s = __privateGet(this, _t)[i],
|
|
34522
|
-
|
|
34521
|
+
for (let i of __privateMethod(this, _c_instances, O_fn).call(this)) {
|
|
34522
|
+
let s = __privateGet(this, _t)[i], n = __privateMethod(this, _c_instances, e_fn).call(this, s) ? s.__staleWhileFetching : s;
|
|
34523
|
+
n !== void 0 && t.call(e, n, __privateGet(this, _i)[i], this);
|
|
34523
34524
|
}
|
|
34524
34525
|
}
|
|
34525
34526
|
purgeStale() {
|
|
34526
34527
|
let t = false;
|
|
34527
|
-
for (let e of __privateMethod(this,
|
|
34528
|
+
for (let e of __privateMethod(this, _c_instances, O_fn).call(this, { allowStale: true })) __privateGet(this, _p).call(this, e) && (__privateMethod(this, _c_instances, E_fn).call(this, __privateGet(this, _i)[e], "expire"), t = true);
|
|
34528
34529
|
return t;
|
|
34529
34530
|
}
|
|
34530
34531
|
info(t) {
|
|
34531
34532
|
let e = __privateGet(this, _s).get(t);
|
|
34532
34533
|
if (e === void 0) return;
|
|
34533
|
-
let i = __privateGet(this, _t)[e], s = __privateMethod(this,
|
|
34534
|
+
let i = __privateGet(this, _t)[e], s = __privateMethod(this, _c_instances, e_fn).call(this, i) ? i.__staleWhileFetching : i;
|
|
34534
34535
|
if (s === void 0) return;
|
|
34535
|
-
let
|
|
34536
|
+
let n = { value: s };
|
|
34536
34537
|
if (__privateGet(this, _d) && __privateGet(this, _A)) {
|
|
34537
|
-
let
|
|
34538
|
-
if (
|
|
34539
|
-
let r =
|
|
34540
|
-
|
|
34538
|
+
let o = __privateGet(this, _d)[e], h = __privateGet(this, _A)[e];
|
|
34539
|
+
if (o && h) {
|
|
34540
|
+
let r = o - (__privateGet(this, _m).now() - h);
|
|
34541
|
+
n.ttl = r, n.start = Date.now();
|
|
34541
34542
|
}
|
|
34542
34543
|
}
|
|
34543
|
-
return __privateGet(this, _y) && (
|
|
34544
|
+
return __privateGet(this, _y) && (n.size = __privateGet(this, _y)[e]), n;
|
|
34544
34545
|
}
|
|
34545
34546
|
dump() {
|
|
34546
34547
|
let t = [];
|
|
34547
|
-
for (let e of __privateMethod(this,
|
|
34548
|
-
let i = __privateGet(this, _i)[e], s = __privateGet(this, _t)[e],
|
|
34549
|
-
if (
|
|
34550
|
-
let
|
|
34548
|
+
for (let e of __privateMethod(this, _c_instances, F_fn).call(this, { allowStale: true })) {
|
|
34549
|
+
let i = __privateGet(this, _i)[e], s = __privateGet(this, _t)[e], n = __privateMethod(this, _c_instances, e_fn).call(this, s) ? s.__staleWhileFetching : s;
|
|
34550
|
+
if (n === void 0 || i === void 0) continue;
|
|
34551
|
+
let o = { value: n };
|
|
34551
34552
|
if (__privateGet(this, _d) && __privateGet(this, _A)) {
|
|
34552
|
-
|
|
34553
|
-
let
|
|
34554
|
-
|
|
34553
|
+
o.ttl = __privateGet(this, _d)[e];
|
|
34554
|
+
let h = __privateGet(this, _m).now() - __privateGet(this, _A)[e];
|
|
34555
|
+
o.start = Math.floor(Date.now() - h);
|
|
34555
34556
|
}
|
|
34556
|
-
__privateGet(this, _y) && (
|
|
34557
|
+
__privateGet(this, _y) && (o.size = __privateGet(this, _y)[e]), t.unshift([i, o]);
|
|
34557
34558
|
}
|
|
34558
34559
|
return t;
|
|
34559
34560
|
}
|
|
@@ -34570,28 +34571,28 @@ var L = (_c = class {
|
|
|
34570
34571
|
set(t, e, i = {}) {
|
|
34571
34572
|
var _a5, _b3, _c3, _d2;
|
|
34572
34573
|
if (e === void 0) return this.delete(t), this;
|
|
34573
|
-
let { ttl: s = this.ttl, start:
|
|
34574
|
-
if (this.maxEntrySize &&
|
|
34575
|
-
let
|
|
34576
|
-
if (
|
|
34574
|
+
let { ttl: s = this.ttl, start: n, noDisposeOnSet: o = this.noDisposeOnSet, sizeCalculation: h = this.sizeCalculation, status: r } = i, { noUpdateTTL: a = this.noUpdateTTL } = i, w = __privateGet(this, _P).call(this, t, e, i.size || 0, h);
|
|
34575
|
+
if (this.maxEntrySize && w > this.maxEntrySize) return r && (r.set = "miss", r.maxEntrySizeExceeded = true), __privateMethod(this, _c_instances, E_fn).call(this, t, "set"), this;
|
|
34576
|
+
let f = __privateGet(this, _n) === 0 ? void 0 : __privateGet(this, _s).get(t);
|
|
34577
|
+
if (f === void 0) f = __privateGet(this, _n) === 0 ? __privateGet(this, _h) : __privateGet(this, _b2).length !== 0 ? __privateGet(this, _b2).pop() : __privateGet(this, _n) === __privateGet(this, _o2) ? __privateMethod(this, _c_instances, x_fn).call(this, false) : __privateGet(this, _n), __privateGet(this, _i)[f] = t, __privateGet(this, _t)[f] = e, __privateGet(this, _s).set(t, f), __privateGet(this, _a4)[__privateGet(this, _h)] = f, __privateGet(this, _u)[f] = __privateGet(this, _h), __privateSet(this, _h, f), __privateWrapper(this, _n)._++, __privateGet(this, _M).call(this, f, w, r), r && (r.set = "add"), a = false, __privateGet(this, _U) && ((_a5 = __privateGet(this, _C)) == null ? void 0 : _a5.call(this, e, t, "add"));
|
|
34577
34578
|
else {
|
|
34578
|
-
__privateMethod(this,
|
|
34579
|
-
let d = __privateGet(this, _t)[
|
|
34579
|
+
__privateMethod(this, _c_instances, D_fn).call(this, f);
|
|
34580
|
+
let d = __privateGet(this, _t)[f];
|
|
34580
34581
|
if (e !== d) {
|
|
34581
|
-
if (__privateGet(this, _v) && __privateMethod(this,
|
|
34582
|
+
if (__privateGet(this, _v) && __privateMethod(this, _c_instances, e_fn).call(this, d)) {
|
|
34582
34583
|
d.__abortController.abort(new Error("replaced"));
|
|
34583
34584
|
let { __staleWhileFetching: g } = d;
|
|
34584
|
-
g !== void 0 && !
|
|
34585
|
-
} else
|
|
34586
|
-
if (__privateGet(this, _W).call(this,
|
|
34585
|
+
g !== void 0 && !o && (__privateGet(this, _T) && ((_b3 = __privateGet(this, _w)) == null ? void 0 : _b3.call(this, g, t, "set")), __privateGet(this, _f) && __privateGet(this, _r)?.push([g, t, "set"]));
|
|
34586
|
+
} else o || (__privateGet(this, _T) && ((_c3 = __privateGet(this, _w)) == null ? void 0 : _c3.call(this, d, t, "set")), __privateGet(this, _f) && __privateGet(this, _r)?.push([d, t, "set"]));
|
|
34587
|
+
if (__privateGet(this, _W).call(this, f), __privateGet(this, _M).call(this, f, w, r), __privateGet(this, _t)[f] = e, r) {
|
|
34587
34588
|
r.set = "replace";
|
|
34588
|
-
let g = d && __privateMethod(this,
|
|
34589
|
+
let g = d && __privateMethod(this, _c_instances, e_fn).call(this, d) ? d.__staleWhileFetching : d;
|
|
34589
34590
|
g !== void 0 && (r.oldValue = g);
|
|
34590
34591
|
}
|
|
34591
34592
|
} else r && (r.set = "update");
|
|
34592
|
-
__privateGet(this,
|
|
34593
|
+
__privateGet(this, _U) && this.onInsert?.(e, t, e === d ? "update" : "replace");
|
|
34593
34594
|
}
|
|
34594
|
-
if (s !== 0 && !__privateGet(this, _d) && __privateMethod(this,
|
|
34595
|
+
if (s !== 0 && !__privateGet(this, _d) && __privateMethod(this, _c_instances, j_fn).call(this), __privateGet(this, _d) && (a || __privateGet(this, _N).call(this, f, s, n), r && __privateGet(this, _z).call(this, r, f)), !o && __privateGet(this, _f) && __privateGet(this, _r)) {
|
|
34595
34596
|
let d = __privateGet(this, _r), g;
|
|
34596
34597
|
for (; g = d?.shift(); ) (_d2 = __privateGet(this, _S)) == null ? void 0 : _d2.call(this, ...g);
|
|
34597
34598
|
}
|
|
@@ -34602,7 +34603,7 @@ var L = (_c = class {
|
|
|
34602
34603
|
try {
|
|
34603
34604
|
for (; __privateGet(this, _n); ) {
|
|
34604
34605
|
let t = __privateGet(this, _t)[__privateGet(this, _l)];
|
|
34605
|
-
if (__privateMethod(this,
|
|
34606
|
+
if (__privateMethod(this, _c_instances, x_fn).call(this, true), __privateMethod(this, _c_instances, e_fn).call(this, t)) {
|
|
34606
34607
|
if (t.__staleWhileFetching) return t.__staleWhileFetching;
|
|
34607
34608
|
} else if (t !== void 0) return t;
|
|
34608
34609
|
}
|
|
@@ -34614,38 +34615,38 @@ var L = (_c = class {
|
|
|
34614
34615
|
}
|
|
34615
34616
|
}
|
|
34616
34617
|
has(t, e = {}) {
|
|
34617
|
-
let { updateAgeOnHas: i = this.updateAgeOnHas, status: s } = e,
|
|
34618
|
-
if (
|
|
34619
|
-
let
|
|
34620
|
-
if (__privateMethod(this,
|
|
34621
|
-
if (__privateGet(this, _p).call(this,
|
|
34622
|
-
else return i && __privateGet(this, _R).call(this,
|
|
34618
|
+
let { updateAgeOnHas: i = this.updateAgeOnHas, status: s } = e, n = __privateGet(this, _s).get(t);
|
|
34619
|
+
if (n !== void 0) {
|
|
34620
|
+
let o = __privateGet(this, _t)[n];
|
|
34621
|
+
if (__privateMethod(this, _c_instances, e_fn).call(this, o) && o.__staleWhileFetching === void 0) return false;
|
|
34622
|
+
if (__privateGet(this, _p).call(this, n)) s && (s.has = "stale", __privateGet(this, _z).call(this, s, n));
|
|
34623
|
+
else return i && __privateGet(this, _R).call(this, n), s && (s.has = "hit", __privateGet(this, _z).call(this, s, n)), true;
|
|
34623
34624
|
} else s && (s.has = "miss");
|
|
34624
34625
|
return false;
|
|
34625
34626
|
}
|
|
34626
34627
|
peek(t, e = {}) {
|
|
34627
34628
|
let { allowStale: i = this.allowStale } = e, s = __privateGet(this, _s).get(t);
|
|
34628
34629
|
if (s === void 0 || !i && __privateGet(this, _p).call(this, s)) return;
|
|
34629
|
-
let
|
|
34630
|
-
return __privateMethod(this,
|
|
34630
|
+
let n = __privateGet(this, _t)[s];
|
|
34631
|
+
return __privateMethod(this, _c_instances, e_fn).call(this, n) ? n.__staleWhileFetching : n;
|
|
34631
34632
|
}
|
|
34632
34633
|
async fetch(t, e = {}) {
|
|
34633
|
-
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet:
|
|
34634
|
-
if (!__privateGet(this, _v)) return l && (l.fetch = "get"), this.get(t, { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet:
|
|
34635
|
-
let b = { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet:
|
|
34636
|
-
if (
|
|
34634
|
+
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet: h = this.noDisposeOnSet, size: r = 0, sizeCalculation: a = this.sizeCalculation, noUpdateTTL: w = this.noUpdateTTL, noDeleteOnFetchRejection: f = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: d = this.allowStaleOnFetchRejection, ignoreFetchAbort: g = this.ignoreFetchAbort, allowStaleOnFetchAbort: A = this.allowStaleOnFetchAbort, context: p, forceRefresh: _ = false, status: l, signal: S } = e;
|
|
34635
|
+
if (!__privateGet(this, _v)) return l && (l.fetch = "get"), this.get(t, { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n, status: l });
|
|
34636
|
+
let b = { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n, ttl: o, noDisposeOnSet: h, size: r, sizeCalculation: a, noUpdateTTL: w, noDeleteOnFetchRejection: f, allowStaleOnFetchRejection: d, allowStaleOnFetchAbort: A, ignoreFetchAbort: g, status: l, signal: S }, m = __privateGet(this, _s).get(t);
|
|
34637
|
+
if (m === void 0) {
|
|
34637
34638
|
l && (l.fetch = "miss");
|
|
34638
|
-
let u = __privateMethod(this,
|
|
34639
|
+
let u = __privateMethod(this, _c_instances, G_fn).call(this, t, m, b, p);
|
|
34639
34640
|
return u.__returned = u;
|
|
34640
34641
|
} else {
|
|
34641
|
-
let u = __privateGet(this, _t)[
|
|
34642
|
-
if (__privateMethod(this,
|
|
34642
|
+
let u = __privateGet(this, _t)[m];
|
|
34643
|
+
if (__privateMethod(this, _c_instances, e_fn).call(this, u)) {
|
|
34643
34644
|
let E = i && u.__staleWhileFetching !== void 0;
|
|
34644
34645
|
return l && (l.fetch = "inflight", E && (l.returnedStale = true)), E ? u.__staleWhileFetching : u.__returned = u;
|
|
34645
34646
|
}
|
|
34646
|
-
let T = __privateGet(this, _p).call(this,
|
|
34647
|
-
if (!_ && !T) return l && (l.fetch = "hit"), __privateMethod(this,
|
|
34648
|
-
let F = __privateMethod(this,
|
|
34647
|
+
let T = __privateGet(this, _p).call(this, m);
|
|
34648
|
+
if (!_ && !T) return l && (l.fetch = "hit"), __privateMethod(this, _c_instances, D_fn).call(this, m), s && __privateGet(this, _R).call(this, m), l && __privateGet(this, _z).call(this, l, m), u;
|
|
34649
|
+
let F = __privateMethod(this, _c_instances, G_fn).call(this, t, m, b, p), O = F.__staleWhileFetching !== void 0 && i;
|
|
34649
34650
|
return l && (l.fetch = T ? "stale" : "refresh", O && T && (l.returnedStale = true)), O ? F.__staleWhileFetching : F.__returned = F;
|
|
34650
34651
|
}
|
|
34651
34652
|
}
|
|
@@ -34657,117 +34658,122 @@ var L = (_c = class {
|
|
|
34657
34658
|
memo(t, e = {}) {
|
|
34658
34659
|
let i = __privateGet(this, _I);
|
|
34659
34660
|
if (!i) throw new Error("no memoMethod provided to constructor");
|
|
34660
|
-
let { context: s, forceRefresh:
|
|
34661
|
-
if (!
|
|
34662
|
-
let r = i(t,
|
|
34663
|
-
return this.set(t, r,
|
|
34661
|
+
let { context: s, forceRefresh: n, ...o } = e, h = this.get(t, o);
|
|
34662
|
+
if (!n && h !== void 0) return h;
|
|
34663
|
+
let r = i(t, h, { options: o, context: s });
|
|
34664
|
+
return this.set(t, r, o), r;
|
|
34664
34665
|
}
|
|
34665
34666
|
get(t, e = {}) {
|
|
34666
|
-
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet:
|
|
34667
|
-
if (
|
|
34668
|
-
let r = __privateGet(this, _t)[
|
|
34669
|
-
return
|
|
34670
|
-
} else
|
|
34667
|
+
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, status: o } = e, h = __privateGet(this, _s).get(t);
|
|
34668
|
+
if (h !== void 0) {
|
|
34669
|
+
let r = __privateGet(this, _t)[h], a = __privateMethod(this, _c_instances, e_fn).call(this, r);
|
|
34670
|
+
return o && __privateGet(this, _z).call(this, o, h), __privateGet(this, _p).call(this, h) ? (o && (o.get = "stale"), a ? (o && i && r.__staleWhileFetching !== void 0 && (o.returnedStale = true), i ? r.__staleWhileFetching : void 0) : (n || __privateMethod(this, _c_instances, E_fn).call(this, t, "expire"), o && i && (o.returnedStale = true), i ? r : void 0)) : (o && (o.get = "hit"), a ? r.__staleWhileFetching : (__privateMethod(this, _c_instances, D_fn).call(this, h), s && __privateGet(this, _R).call(this, h), r));
|
|
34671
|
+
} else o && (o.get = "miss");
|
|
34671
34672
|
}
|
|
34672
34673
|
delete(t) {
|
|
34673
|
-
return __privateMethod(this,
|
|
34674
|
+
return __privateMethod(this, _c_instances, E_fn).call(this, t, "delete");
|
|
34674
34675
|
}
|
|
34675
34676
|
clear() {
|
|
34676
|
-
return __privateMethod(this,
|
|
34677
|
+
return __privateMethod(this, _c_instances, V_fn).call(this, "delete");
|
|
34677
34678
|
}
|
|
34678
|
-
}, _o2 = new WeakMap(), _c2 = new WeakMap(), _w = new WeakMap(), _C = new WeakMap(), _S = new WeakMap(), _L = new WeakMap(), _I = new WeakMap(), _m = new WeakMap(), _n = new WeakMap(), __ = new WeakMap(), _s = new WeakMap(), _i = new WeakMap(), _t = new WeakMap(), _a4 = new WeakMap(), _u = new WeakMap(), _l = new WeakMap(), _h = new WeakMap(), _b2 = new WeakMap(), _r = new WeakMap(), _y = new WeakMap(), _A = new WeakMap(), _d = new WeakMap(), _g = new WeakMap(), _T = new WeakMap(), _v = new WeakMap(), _f = new WeakMap(),
|
|
34679
|
+
}, _o2 = new WeakMap(), _c2 = new WeakMap(), _w = new WeakMap(), _C = new WeakMap(), _S = new WeakMap(), _L = new WeakMap(), _I = new WeakMap(), _m = new WeakMap(), _n = new WeakMap(), __ = new WeakMap(), _s = new WeakMap(), _i = new WeakMap(), _t = new WeakMap(), _a4 = new WeakMap(), _u = new WeakMap(), _l = new WeakMap(), _h = new WeakMap(), _b2 = new WeakMap(), _r = new WeakMap(), _y = new WeakMap(), _A = new WeakMap(), _d = new WeakMap(), _g = new WeakMap(), _T = new WeakMap(), _v = new WeakMap(), _f = new WeakMap(), _U = new WeakMap(), _c_instances = new WeakSet(), j_fn = function() {
|
|
34679
34680
|
let t = new z2(__privateGet(this, _o2)), e = new z2(__privateGet(this, _o2));
|
|
34680
34681
|
__privateSet(this, _d, t), __privateSet(this, _A, e);
|
|
34681
34682
|
let i = this.ttlAutopurge ? new Array(__privateGet(this, _o2)) : void 0;
|
|
34682
|
-
__privateSet(this, _g, i), __privateSet(this, _N, (
|
|
34683
|
-
|
|
34684
|
-
|
|
34685
|
-
|
|
34686
|
-
|
|
34687
|
-
|
|
34688
|
-
|
|
34689
|
-
|
|
34690
|
-
|
|
34691
|
-
|
|
34692
|
-
|
|
34693
|
-
|
|
34694
|
-
|
|
34695
|
-
|
|
34696
|
-
|
|
34697
|
-
|
|
34683
|
+
__privateSet(this, _g, i), __privateSet(this, _N, (h, r, a = __privateGet(this, _m).now()) => {
|
|
34684
|
+
e[h] = r !== 0 ? a : 0, t[h] = r, s(h, r);
|
|
34685
|
+
}), __privateSet(this, _R, (h) => {
|
|
34686
|
+
e[h] = t[h] !== 0 ? __privateGet(this, _m).now() : 0, s(h, t[h]);
|
|
34687
|
+
});
|
|
34688
|
+
let s = this.ttlAutopurge ? (h, r) => {
|
|
34689
|
+
if (i?.[h] && (clearTimeout(i[h]), i[h] = void 0), r && r !== 0 && i) {
|
|
34690
|
+
let a = setTimeout(() => {
|
|
34691
|
+
__privateGet(this, _p).call(this, h) && __privateMethod(this, _c_instances, E_fn).call(this, __privateGet(this, _i)[h], "expire");
|
|
34692
|
+
}, r + 1);
|
|
34693
|
+
a.unref && a.unref(), i[h] = a;
|
|
34694
|
+
}
|
|
34695
|
+
} : () => {
|
|
34696
|
+
};
|
|
34697
|
+
__privateSet(this, _z, (h, r) => {
|
|
34698
|
+
if (t[r]) {
|
|
34699
|
+
let a = t[r], w = e[r];
|
|
34700
|
+
if (!a || !w) return;
|
|
34701
|
+
h.ttl = a, h.start = w, h.now = n || o();
|
|
34702
|
+
let f = h.now - w;
|
|
34703
|
+
h.remainingTTL = a - f;
|
|
34698
34704
|
}
|
|
34699
34705
|
});
|
|
34700
|
-
let
|
|
34701
|
-
let
|
|
34706
|
+
let n = 0, o = () => {
|
|
34707
|
+
let h = __privateGet(this, _m).now();
|
|
34702
34708
|
if (this.ttlResolution > 0) {
|
|
34703
|
-
|
|
34704
|
-
let
|
|
34705
|
-
|
|
34706
|
-
}
|
|
34707
|
-
return
|
|
34708
|
-
};
|
|
34709
|
-
this.getRemainingTTL = (
|
|
34710
|
-
let
|
|
34711
|
-
if (
|
|
34712
|
-
let
|
|
34713
|
-
if (!
|
|
34714
|
-
let
|
|
34715
|
-
return
|
|
34716
|
-
}, __privateSet(this, _p, (
|
|
34717
|
-
let
|
|
34718
|
-
return !!
|
|
34709
|
+
n = h;
|
|
34710
|
+
let r = setTimeout(() => n = 0, this.ttlResolution);
|
|
34711
|
+
r.unref && r.unref();
|
|
34712
|
+
}
|
|
34713
|
+
return h;
|
|
34714
|
+
};
|
|
34715
|
+
this.getRemainingTTL = (h) => {
|
|
34716
|
+
let r = __privateGet(this, _s).get(h);
|
|
34717
|
+
if (r === void 0) return 0;
|
|
34718
|
+
let a = t[r], w = e[r];
|
|
34719
|
+
if (!a || !w) return 1 / 0;
|
|
34720
|
+
let f = (n || o()) - w;
|
|
34721
|
+
return a - f;
|
|
34722
|
+
}, __privateSet(this, _p, (h) => {
|
|
34723
|
+
let r = e[h], a = t[h];
|
|
34724
|
+
return !!a && !!r && (n || o()) - r > a;
|
|
34719
34725
|
});
|
|
34720
34726
|
}, _R = new WeakMap(), _z = new WeakMap(), _N = new WeakMap(), _p = new WeakMap(), B_fn = function() {
|
|
34721
34727
|
let t = new z2(__privateGet(this, _o2));
|
|
34722
34728
|
__privateSet(this, __, 0), __privateSet(this, _y, t), __privateSet(this, _W, (e) => {
|
|
34723
34729
|
__privateSet(this, __, __privateGet(this, __) - t[e]), t[e] = 0;
|
|
34724
|
-
}), __privateSet(this, _P, (e, i, s,
|
|
34725
|
-
if (__privateMethod(this,
|
|
34726
|
-
if (!y(s)) if (
|
|
34727
|
-
if (typeof
|
|
34728
|
-
if (s =
|
|
34730
|
+
}), __privateSet(this, _P, (e, i, s, n) => {
|
|
34731
|
+
if (__privateMethod(this, _c_instances, e_fn).call(this, i)) return 0;
|
|
34732
|
+
if (!y(s)) if (n) {
|
|
34733
|
+
if (typeof n != "function") throw new TypeError("sizeCalculation must be a function");
|
|
34734
|
+
if (s = n(i, e), !y(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
34729
34735
|
} else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
34730
34736
|
return s;
|
|
34731
|
-
}), __privateSet(this,
|
|
34737
|
+
}), __privateSet(this, _M, (e, i, s) => {
|
|
34732
34738
|
if (t[e] = i, __privateGet(this, _c2)) {
|
|
34733
|
-
let
|
|
34734
|
-
for (; __privateGet(this, __) >
|
|
34739
|
+
let n = __privateGet(this, _c2) - t[e];
|
|
34740
|
+
for (; __privateGet(this, __) > n; ) __privateMethod(this, _c_instances, x_fn).call(this, true);
|
|
34735
34741
|
}
|
|
34736
34742
|
__privateSet(this, __, __privateGet(this, __) + t[e]), s && (s.entrySize = i, s.totalCalculatedSize = __privateGet(this, __));
|
|
34737
34743
|
});
|
|
34738
|
-
}, _W = new WeakMap(),
|
|
34739
|
-
if (__privateGet(this, _n)) for (let e = __privateGet(this, _h); !(!__privateMethod(this,
|
|
34744
|
+
}, _W = new WeakMap(), _M = new WeakMap(), _P = new WeakMap(), F_fn = function* ({ allowStale: t = this.allowStale } = {}) {
|
|
34745
|
+
if (__privateGet(this, _n)) for (let e = __privateGet(this, _h); !(!__privateMethod(this, _c_instances, H_fn).call(this, e) || ((t || !__privateGet(this, _p).call(this, e)) && (yield e), e === __privateGet(this, _l))); ) e = __privateGet(this, _u)[e];
|
|
34740
34746
|
}, O_fn = function* ({ allowStale: t = this.allowStale } = {}) {
|
|
34741
|
-
if (__privateGet(this, _n)) for (let e = __privateGet(this, _l); !(!__privateMethod(this,
|
|
34747
|
+
if (__privateGet(this, _n)) for (let e = __privateGet(this, _l); !(!__privateMethod(this, _c_instances, H_fn).call(this, e) || ((t || !__privateGet(this, _p).call(this, e)) && (yield e), e === __privateGet(this, _h))); ) e = __privateGet(this, _a4)[e];
|
|
34742
34748
|
}, H_fn = function(t) {
|
|
34743
34749
|
return t !== void 0 && __privateGet(this, _s).get(__privateGet(this, _i)[t]) === t;
|
|
34744
|
-
},
|
|
34750
|
+
}, x_fn = function(t) {
|
|
34745
34751
|
var _a5;
|
|
34746
34752
|
let e = __privateGet(this, _l), i = __privateGet(this, _i)[e], s = __privateGet(this, _t)[e];
|
|
34747
|
-
return __privateGet(this, _v) && __privateMethod(this,
|
|
34753
|
+
return __privateGet(this, _v) && __privateMethod(this, _c_instances, e_fn).call(this, s) ? s.__abortController.abort(new Error("evicted")) : (__privateGet(this, _T) || __privateGet(this, _f)) && (__privateGet(this, _T) && ((_a5 = __privateGet(this, _w)) == null ? void 0 : _a5.call(this, s, i, "evict")), __privateGet(this, _f) && __privateGet(this, _r)?.push([s, i, "evict"])), __privateGet(this, _W).call(this, e), __privateGet(this, _g)?.[e] && (clearTimeout(__privateGet(this, _g)[e]), __privateGet(this, _g)[e] = void 0), t && (__privateGet(this, _i)[e] = void 0, __privateGet(this, _t)[e] = void 0, __privateGet(this, _b2).push(e)), __privateGet(this, _n) === 1 ? (__privateSet(this, _l, __privateSet(this, _h, 0)), __privateGet(this, _b2).length = 0) : __privateSet(this, _l, __privateGet(this, _a4)[e]), __privateGet(this, _s).delete(i), __privateWrapper(this, _n)._--, e;
|
|
34748
34754
|
}, G_fn = function(t, e, i, s) {
|
|
34749
|
-
let
|
|
34750
|
-
if (__privateMethod(this,
|
|
34751
|
-
let
|
|
34752
|
-
|
|
34753
|
-
let r = { signal:
|
|
34754
|
-
let { aborted: l } =
|
|
34755
|
-
if (i.status && (l && !_ ? (i.status.fetchAborted = true, i.status.fetchError =
|
|
34756
|
-
let
|
|
34757
|
-
return (u === g ||
|
|
34758
|
-
},
|
|
34759
|
-
let { aborted: l } =
|
|
34760
|
-
if (__privateGet(this, _t)[e] === g && (!
|
|
34755
|
+
let n = e === void 0 ? void 0 : __privateGet(this, _t)[e];
|
|
34756
|
+
if (__privateMethod(this, _c_instances, e_fn).call(this, n)) return n;
|
|
34757
|
+
let o = new C(), { signal: h } = i;
|
|
34758
|
+
h?.addEventListener("abort", () => o.abort(h.reason), { signal: o.signal });
|
|
34759
|
+
let r = { signal: o.signal, options: i, context: s }, a = (p, _ = false) => {
|
|
34760
|
+
let { aborted: l } = o.signal, S = i.ignoreFetchAbort && p !== void 0, b = i.ignoreFetchAbort || !!(i.allowStaleOnFetchAbort && p !== void 0);
|
|
34761
|
+
if (i.status && (l && !_ ? (i.status.fetchAborted = true, i.status.fetchError = o.signal.reason, S && (i.status.fetchAbortIgnored = true)) : i.status.fetchResolved = true), l && !S && !_) return f(o.signal.reason, b);
|
|
34762
|
+
let m = g, u = __privateGet(this, _t)[e];
|
|
34763
|
+
return (u === g || S && _ && u === void 0) && (p === void 0 ? m.__staleWhileFetching !== void 0 ? __privateGet(this, _t)[e] = m.__staleWhileFetching : __privateMethod(this, _c_instances, E_fn).call(this, t, "fetch") : (i.status && (i.status.fetchUpdated = true), this.set(t, p, r.options))), p;
|
|
34764
|
+
}, w = (p) => (i.status && (i.status.fetchRejected = true, i.status.fetchError = p), f(p, false)), f = (p, _) => {
|
|
34765
|
+
let { aborted: l } = o.signal, S = l && i.allowStaleOnFetchAbort, b = S || i.allowStaleOnFetchRejection, m = b || i.noDeleteOnFetchRejection, u = g;
|
|
34766
|
+
if (__privateGet(this, _t)[e] === g && (!m || !_ && u.__staleWhileFetching === void 0 ? __privateMethod(this, _c_instances, E_fn).call(this, t, "fetch") : S || (__privateGet(this, _t)[e] = u.__staleWhileFetching)), b) return i.status && u.__staleWhileFetching !== void 0 && (i.status.returnedStale = true), u.__staleWhileFetching;
|
|
34761
34767
|
if (u.__returned === u) throw p;
|
|
34762
34768
|
}, d = (p, _) => {
|
|
34763
34769
|
var _a5;
|
|
34764
|
-
let l = (_a5 = __privateGet(this, _L)) == null ? void 0 : _a5.call(this, t,
|
|
34765
|
-
l && l instanceof Promise && l.then((
|
|
34766
|
-
(!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (p(void 0), i.allowStaleOnFetchAbort && (p = (
|
|
34770
|
+
let l = (_a5 = __privateGet(this, _L)) == null ? void 0 : _a5.call(this, t, n, r);
|
|
34771
|
+
l && l instanceof Promise && l.then((S) => p(S === void 0 ? void 0 : S), _), o.signal.addEventListener("abort", () => {
|
|
34772
|
+
(!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (p(void 0), i.allowStaleOnFetchAbort && (p = (S) => a(S, true)));
|
|
34767
34773
|
});
|
|
34768
34774
|
};
|
|
34769
34775
|
i.status && (i.status.fetchDispatched = true);
|
|
34770
|
-
let g = new Promise(d).then(
|
|
34776
|
+
let g = new Promise(d).then(a, w), A = Object.assign(g, { __abortController: o, __staleWhileFetching: n, __returned: void 0 });
|
|
34771
34777
|
return e === void 0 ? (this.set(t, A, { ...r.options, status: void 0 }), e = __privateGet(this, _s).get(t)) : __privateGet(this, _t)[e] = A, A;
|
|
34772
34778
|
}, e_fn = function(t) {
|
|
34773
34779
|
if (!__privateGet(this, _v)) return false;
|
|
@@ -34776,37 +34782,37 @@ var L = (_c = class {
|
|
|
34776
34782
|
}, k_fn = function(t, e) {
|
|
34777
34783
|
__privateGet(this, _u)[e] = t, __privateGet(this, _a4)[t] = e;
|
|
34778
34784
|
}, D_fn = function(t) {
|
|
34779
|
-
t !== __privateGet(this, _h) && (t === __privateGet(this, _l) ? __privateSet(this, _l, __privateGet(this, _a4)[t]) : __privateMethod(this,
|
|
34785
|
+
t !== __privateGet(this, _h) && (t === __privateGet(this, _l) ? __privateSet(this, _l, __privateGet(this, _a4)[t]) : __privateMethod(this, _c_instances, k_fn).call(this, __privateGet(this, _u)[t], __privateGet(this, _a4)[t]), __privateMethod(this, _c_instances, k_fn).call(this, __privateGet(this, _h), t), __privateSet(this, _h, t));
|
|
34780
34786
|
}, E_fn = function(t, e) {
|
|
34781
34787
|
var _a5, _b3;
|
|
34782
34788
|
let i = false;
|
|
34783
34789
|
if (__privateGet(this, _n) !== 0) {
|
|
34784
34790
|
let s = __privateGet(this, _s).get(t);
|
|
34785
|
-
if (s !== void 0) if (__privateGet(this, _g)?.[s] && (clearTimeout(__privateGet(this, _g)?.[s]), __privateGet(this, _g)[s] = void 0), i = true, __privateGet(this, _n) === 1) __privateMethod(this,
|
|
34791
|
+
if (s !== void 0) if (__privateGet(this, _g)?.[s] && (clearTimeout(__privateGet(this, _g)?.[s]), __privateGet(this, _g)[s] = void 0), i = true, __privateGet(this, _n) === 1) __privateMethod(this, _c_instances, V_fn).call(this, e);
|
|
34786
34792
|
else {
|
|
34787
34793
|
__privateGet(this, _W).call(this, s);
|
|
34788
|
-
let
|
|
34789
|
-
if (__privateMethod(this,
|
|
34794
|
+
let n = __privateGet(this, _t)[s];
|
|
34795
|
+
if (__privateMethod(this, _c_instances, e_fn).call(this, n) ? n.__abortController.abort(new Error("deleted")) : (__privateGet(this, _T) || __privateGet(this, _f)) && (__privateGet(this, _T) && ((_a5 = __privateGet(this, _w)) == null ? void 0 : _a5.call(this, n, t, e)), __privateGet(this, _f) && __privateGet(this, _r)?.push([n, t, e])), __privateGet(this, _s).delete(t), __privateGet(this, _i)[s] = void 0, __privateGet(this, _t)[s] = void 0, s === __privateGet(this, _h)) __privateSet(this, _h, __privateGet(this, _u)[s]);
|
|
34790
34796
|
else if (s === __privateGet(this, _l)) __privateSet(this, _l, __privateGet(this, _a4)[s]);
|
|
34791
34797
|
else {
|
|
34792
|
-
let
|
|
34793
|
-
__privateGet(this, _a4)[
|
|
34794
|
-
let
|
|
34795
|
-
__privateGet(this, _u)[
|
|
34798
|
+
let o = __privateGet(this, _u)[s];
|
|
34799
|
+
__privateGet(this, _a4)[o] = __privateGet(this, _a4)[s];
|
|
34800
|
+
let h = __privateGet(this, _a4)[s];
|
|
34801
|
+
__privateGet(this, _u)[h] = __privateGet(this, _u)[s];
|
|
34796
34802
|
}
|
|
34797
34803
|
__privateWrapper(this, _n)._--, __privateGet(this, _b2).push(s);
|
|
34798
34804
|
}
|
|
34799
34805
|
}
|
|
34800
34806
|
if (__privateGet(this, _f) && __privateGet(this, _r)?.length) {
|
|
34801
|
-
let s = __privateGet(this, _r),
|
|
34802
|
-
for (;
|
|
34807
|
+
let s = __privateGet(this, _r), n;
|
|
34808
|
+
for (; n = s?.shift(); ) (_b3 = __privateGet(this, _S)) == null ? void 0 : _b3.call(this, ...n);
|
|
34803
34809
|
}
|
|
34804
34810
|
return i;
|
|
34805
34811
|
}, V_fn = function(t) {
|
|
34806
34812
|
var _a5, _b3;
|
|
34807
|
-
for (let e of __privateMethod(this,
|
|
34813
|
+
for (let e of __privateMethod(this, _c_instances, O_fn).call(this, { allowStale: true })) {
|
|
34808
34814
|
let i = __privateGet(this, _t)[e];
|
|
34809
|
-
if (__privateMethod(this,
|
|
34815
|
+
if (__privateMethod(this, _c_instances, e_fn).call(this, i)) i.__abortController.abort(new Error("deleted"));
|
|
34810
34816
|
else {
|
|
34811
34817
|
let s = __privateGet(this, _i)[e];
|
|
34812
34818
|
__privateGet(this, _T) && ((_a5 = __privateGet(this, _w)) == null ? void 0 : _a5.call(this, i, s, t)), __privateGet(this, _f) && __privateGet(this, _r)?.push([i, s, t]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shotstack/shotstack-canvas",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.9",
|
|
4
4
|
"description": "Text layout & animation engine (HarfBuzz) for Node & Web - fully self-contained.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/entry.node.cjs",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@resvg/resvg-js": "^2.6.2",
|
|
53
53
|
"@resvg/resvg-wasm": "^2.6.2",
|
|
54
|
-
"@shotstack/schemas": "1.9.
|
|
54
|
+
"@shotstack/schemas": "1.9.3",
|
|
55
55
|
"bidi-js": "^1.0.3",
|
|
56
56
|
"canvas": "npm:@napi-rs/canvas@^0.1.54",
|
|
57
57
|
"ffmpeg-static": "^5.2.0",
|