@shotstack/shotstack-canvas 2.0.3 → 2.0.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/entry.node.cjs +59 -43
- package/dist/entry.node.d.cts +2 -1
- package/dist/entry.node.d.ts +2 -1
- package/dist/entry.node.js +58 -43
- package/dist/entry.web.d.ts +2 -1
- package/dist/entry.web.js +906 -1829
- package/package.json +65 -65
package/dist/entry.web.js
CHANGED
|
@@ -3484,8 +3484,8 @@ var require_decode = __commonJS({
|
|
|
3484
3484
|
if (symbol2 + repeat_delta > num_symbols) {
|
|
3485
3485
|
throw new Error("[ReadHuffmanCodeLengths] symbol + repeat_delta > num_symbols");
|
|
3486
3486
|
}
|
|
3487
|
-
for (var
|
|
3488
|
-
code_lengths[symbol2 +
|
|
3487
|
+
for (var x2 = 0; x2 < repeat_delta; x2++)
|
|
3488
|
+
code_lengths[symbol2 + x2] = repeat_code_len;
|
|
3489
3489
|
symbol2 += repeat_delta;
|
|
3490
3490
|
if (repeat_code_len !== 0) {
|
|
3491
3491
|
space -= repeat_delta << 15 - repeat_code_len;
|
|
@@ -3738,22 +3738,22 @@ var require_decode = __commonJS({
|
|
|
3738
3738
|
nbytes = br.bit_end_pos_ - br.bit_pos_ >> 3;
|
|
3739
3739
|
if (br_pos + nbytes > BrotliBitReader.IBUF_MASK) {
|
|
3740
3740
|
var tail = BrotliBitReader.IBUF_MASK + 1 - br_pos;
|
|
3741
|
-
for (var
|
|
3742
|
-
ringbuffer[rb_pos +
|
|
3741
|
+
for (var x2 = 0; x2 < tail; x2++)
|
|
3742
|
+
ringbuffer[rb_pos + x2] = br.buf_[br_pos + x2];
|
|
3743
3743
|
nbytes -= tail;
|
|
3744
3744
|
rb_pos += tail;
|
|
3745
3745
|
len -= tail;
|
|
3746
3746
|
br_pos = 0;
|
|
3747
3747
|
}
|
|
3748
|
-
for (var
|
|
3749
|
-
ringbuffer[rb_pos +
|
|
3748
|
+
for (var x2 = 0; x2 < nbytes; x2++)
|
|
3749
|
+
ringbuffer[rb_pos + x2] = br.buf_[br_pos + x2];
|
|
3750
3750
|
rb_pos += nbytes;
|
|
3751
3751
|
len -= nbytes;
|
|
3752
3752
|
if (rb_pos >= rb_size) {
|
|
3753
3753
|
output.write(ringbuffer, rb_size);
|
|
3754
3754
|
rb_pos -= rb_size;
|
|
3755
|
-
for (var
|
|
3756
|
-
ringbuffer[
|
|
3755
|
+
for (var x2 = 0; x2 < rb_pos; x2++)
|
|
3756
|
+
ringbuffer[x2] = ringbuffer[rb_size + x2];
|
|
3757
3757
|
}
|
|
3758
3758
|
while (rb_pos + len >= rb_size) {
|
|
3759
3759
|
nbytes = rb_size - rb_pos;
|
|
@@ -3825,9 +3825,9 @@ var require_decode = __commonJS({
|
|
|
3825
3825
|
ringbuffer_end = ringbuffer_size;
|
|
3826
3826
|
block_type_trees = [];
|
|
3827
3827
|
block_len_trees = [];
|
|
3828
|
-
for (var
|
|
3829
|
-
block_type_trees[
|
|
3830
|
-
block_len_trees[
|
|
3828
|
+
for (var x2 = 0; x2 < 3 * HUFFMAN_MAX_TABLE_SIZE; x2++) {
|
|
3829
|
+
block_type_trees[x2] = new HuffmanCode(0, 0);
|
|
3830
|
+
block_len_trees[x2] = new HuffmanCode(0, 0);
|
|
3831
3831
|
}
|
|
3832
3832
|
while (!input_end) {
|
|
3833
3833
|
var meta_block_remaining_len = 0;
|
|
@@ -3916,9 +3916,9 @@ var require_decode = __commonJS({
|
|
|
3916
3916
|
var _o1 = DecodeContextMap(num_block_types[0] << kLiteralContextBits, br);
|
|
3917
3917
|
num_literal_htrees = _o1.num_htrees;
|
|
3918
3918
|
context_map = _o1.context_map;
|
|
3919
|
-
var
|
|
3920
|
-
num_dist_htrees =
|
|
3921
|
-
dist_context_map =
|
|
3919
|
+
var _o22 = DecodeContextMap(num_block_types[2] << kDistanceContextBits, br);
|
|
3920
|
+
num_dist_htrees = _o22.num_htrees;
|
|
3921
|
+
dist_context_map = _o22.context_map;
|
|
3922
3922
|
hgroup[0] = new HuffmanTreeGroup(kNumLiteralCodes, num_literal_htrees);
|
|
3923
3923
|
hgroup[1] = new HuffmanTreeGroup(kNumInsertAndCopyCodes, num_block_types[1]);
|
|
3924
3924
|
hgroup[2] = new HuffmanTreeGroup(num_distance_codes, num_dist_htrees);
|
|
@@ -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 _x2 = 0; _x2 < copy_dst - ringbuffer_end; _x2++)
|
|
4067
|
+
ringbuffer[_x2] = ringbuffer[ringbuffer_end + _x2];
|
|
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);
|
|
@@ -4109,7 +4109,7 @@ var require_decompress = __commonJS({
|
|
|
4109
4109
|
}
|
|
4110
4110
|
});
|
|
4111
4111
|
|
|
4112
|
-
// node_modules/.pnpm/zod@4.3.
|
|
4112
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/external.js
|
|
4113
4113
|
var external_exports = {};
|
|
4114
4114
|
__export(external_exports, {
|
|
4115
4115
|
$brand: () => $brand,
|
|
@@ -4350,7 +4350,7 @@ __export(external_exports, {
|
|
|
4350
4350
|
xor: () => xor
|
|
4351
4351
|
});
|
|
4352
4352
|
|
|
4353
|
-
// node_modules/.pnpm/zod@4.3.
|
|
4353
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/index.js
|
|
4354
4354
|
var core_exports2 = {};
|
|
4355
4355
|
__export(core_exports2, {
|
|
4356
4356
|
$ZodAny: () => $ZodAny,
|
|
@@ -4628,7 +4628,7 @@ __export(core_exports2, {
|
|
|
4628
4628
|
version: () => version
|
|
4629
4629
|
});
|
|
4630
4630
|
|
|
4631
|
-
// node_modules/.pnpm/zod@4.3.
|
|
4631
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.js
|
|
4632
4632
|
var NEVER = Object.freeze({
|
|
4633
4633
|
status: "aborted"
|
|
4634
4634
|
});
|
|
@@ -4664,10 +4664,10 @@ function $constructor(name, initializer3, params) {
|
|
|
4664
4664
|
}
|
|
4665
4665
|
Object.defineProperty(Definition, "name", { value: name });
|
|
4666
4666
|
function _(def) {
|
|
4667
|
-
var
|
|
4667
|
+
var _a5;
|
|
4668
4668
|
const inst = params?.Parent ? new Definition() : this;
|
|
4669
4669
|
init(inst, def);
|
|
4670
|
-
(
|
|
4670
|
+
(_a5 = inst._zod).deferred ?? (_a5.deferred = []);
|
|
4671
4671
|
for (const fn of inst._zod.deferred) {
|
|
4672
4672
|
fn();
|
|
4673
4673
|
}
|
|
@@ -4703,7 +4703,7 @@ function config(newConfig) {
|
|
|
4703
4703
|
return globalConfig;
|
|
4704
4704
|
}
|
|
4705
4705
|
|
|
4706
|
-
// node_modules/.pnpm/zod@4.3.
|
|
4706
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.js
|
|
4707
4707
|
var util_exports = {};
|
|
4708
4708
|
__export(util_exports, {
|
|
4709
4709
|
BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
|
|
@@ -4777,7 +4777,7 @@ function assertNotEqual(val) {
|
|
|
4777
4777
|
}
|
|
4778
4778
|
function assertIs(_arg) {
|
|
4779
4779
|
}
|
|
4780
|
-
function assertNever(
|
|
4780
|
+
function assertNever(_x2) {
|
|
4781
4781
|
throw new Error("Unexpected value in exhaustive check");
|
|
4782
4782
|
}
|
|
4783
4783
|
function assert(_) {
|
|
@@ -5252,11 +5252,11 @@ function required(Class2, schema, mask) {
|
|
|
5252
5252
|
});
|
|
5253
5253
|
return clone(schema, def);
|
|
5254
5254
|
}
|
|
5255
|
-
function aborted(
|
|
5256
|
-
if (
|
|
5255
|
+
function aborted(x2, startIndex = 0) {
|
|
5256
|
+
if (x2.aborted === true)
|
|
5257
5257
|
return true;
|
|
5258
|
-
for (let i = startIndex; i <
|
|
5259
|
-
if (
|
|
5258
|
+
for (let i = startIndex; i < x2.issues.length; i++) {
|
|
5259
|
+
if (x2.issues[i]?.continue !== true) {
|
|
5260
5260
|
return true;
|
|
5261
5261
|
}
|
|
5262
5262
|
}
|
|
@@ -5264,8 +5264,8 @@ function aborted(x, startIndex = 0) {
|
|
|
5264
5264
|
}
|
|
5265
5265
|
function prefixIssues(path, issues) {
|
|
5266
5266
|
return issues.map((iss) => {
|
|
5267
|
-
var
|
|
5268
|
-
(
|
|
5267
|
+
var _a5;
|
|
5268
|
+
(_a5 = iss).path ?? (_a5.path = []);
|
|
5269
5269
|
iss.path.unshift(path);
|
|
5270
5270
|
return iss;
|
|
5271
5271
|
});
|
|
@@ -5382,7 +5382,7 @@ var Class = class {
|
|
|
5382
5382
|
}
|
|
5383
5383
|
};
|
|
5384
5384
|
|
|
5385
|
-
// node_modules/.pnpm/zod@4.3.
|
|
5385
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.js
|
|
5386
5386
|
var initializer = (inst, def) => {
|
|
5387
5387
|
inst.name = "$ZodError";
|
|
5388
5388
|
Object.defineProperty(inst, "_zod", {
|
|
@@ -5450,7 +5450,7 @@ function formatError(error48, mapper = (issue2) => issue2.message) {
|
|
|
5450
5450
|
function treeifyError(error48, mapper = (issue2) => issue2.message) {
|
|
5451
5451
|
const result = { errors: [] };
|
|
5452
5452
|
const processError = (error49, path = []) => {
|
|
5453
|
-
var
|
|
5453
|
+
var _a5, _b3;
|
|
5454
5454
|
for (const issue2 of error49.issues) {
|
|
5455
5455
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
5456
5456
|
issue2.errors.map((issues) => processError({ issues }, issue2.path));
|
|
@@ -5471,11 +5471,11 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
|
|
|
5471
5471
|
const terminal = i === fullpath.length - 1;
|
|
5472
5472
|
if (typeof el === "string") {
|
|
5473
5473
|
curr.properties ?? (curr.properties = {});
|
|
5474
|
-
(
|
|
5474
|
+
(_a5 = curr.properties)[el] ?? (_a5[el] = { errors: [] });
|
|
5475
5475
|
curr = curr.properties[el];
|
|
5476
5476
|
} else {
|
|
5477
5477
|
curr.items ?? (curr.items = []);
|
|
5478
|
-
(
|
|
5478
|
+
(_b3 = curr.items)[el] ?? (_b3[el] = { errors: [] });
|
|
5479
5479
|
curr = curr.items[el];
|
|
5480
5480
|
}
|
|
5481
5481
|
if (terminal) {
|
|
@@ -5518,7 +5518,7 @@ function prettifyError(error48) {
|
|
|
5518
5518
|
return lines.join("\n");
|
|
5519
5519
|
}
|
|
5520
5520
|
|
|
5521
|
-
// node_modules/.pnpm/zod@4.3.
|
|
5521
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/parse.js
|
|
5522
5522
|
var _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
5523
5523
|
const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
|
|
5524
5524
|
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
@@ -5606,7 +5606,7 @@ var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
5606
5606
|
};
|
|
5607
5607
|
var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
|
|
5608
5608
|
|
|
5609
|
-
// node_modules/.pnpm/zod@4.3.
|
|
5609
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/regexes.js
|
|
5610
5610
|
var regexes_exports = {};
|
|
5611
5611
|
__export(regexes_exports, {
|
|
5612
5612
|
base64: () => base64,
|
|
@@ -5763,12 +5763,12 @@ var sha512_hex = /^[0-9a-fA-F]{128}$/;
|
|
|
5763
5763
|
var sha512_base64 = /* @__PURE__ */ fixedBase64(86, "==");
|
|
5764
5764
|
var sha512_base64url = /* @__PURE__ */ fixedBase64url(86);
|
|
5765
5765
|
|
|
5766
|
-
// node_modules/.pnpm/zod@4.3.
|
|
5766
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.js
|
|
5767
5767
|
var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
5768
|
-
var
|
|
5768
|
+
var _a5;
|
|
5769
5769
|
inst._zod ?? (inst._zod = {});
|
|
5770
5770
|
inst._zod.def = def;
|
|
5771
|
-
(
|
|
5771
|
+
(_a5 = inst._zod).onattach ?? (_a5.onattach = []);
|
|
5772
5772
|
});
|
|
5773
5773
|
var numericOriginMap = {
|
|
5774
5774
|
number: "number",
|
|
@@ -5834,8 +5834,8 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
|
|
|
5834
5834
|
var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
5835
5835
|
$ZodCheck.init(inst, def);
|
|
5836
5836
|
inst._zod.onattach.push((inst2) => {
|
|
5837
|
-
var
|
|
5838
|
-
(
|
|
5837
|
+
var _a5;
|
|
5838
|
+
(_a5 = inst2._zod.bag).multipleOf ?? (_a5.multipleOf = def.value);
|
|
5839
5839
|
});
|
|
5840
5840
|
inst._zod.check = (payload) => {
|
|
5841
5841
|
if (typeof payload.value !== typeof def.value)
|
|
@@ -5968,9 +5968,9 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
|
|
|
5968
5968
|
};
|
|
5969
5969
|
});
|
|
5970
5970
|
var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, def) => {
|
|
5971
|
-
var
|
|
5971
|
+
var _a5;
|
|
5972
5972
|
$ZodCheck.init(inst, def);
|
|
5973
|
-
(
|
|
5973
|
+
(_a5 = inst._zod.def).when ?? (_a5.when = (payload) => {
|
|
5974
5974
|
const val = payload.value;
|
|
5975
5975
|
return !nullish(val) && val.size !== void 0;
|
|
5976
5976
|
});
|
|
@@ -5996,9 +5996,9 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
|
|
|
5996
5996
|
};
|
|
5997
5997
|
});
|
|
5998
5998
|
var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, def) => {
|
|
5999
|
-
var
|
|
5999
|
+
var _a5;
|
|
6000
6000
|
$ZodCheck.init(inst, def);
|
|
6001
|
-
(
|
|
6001
|
+
(_a5 = inst._zod.def).when ?? (_a5.when = (payload) => {
|
|
6002
6002
|
const val = payload.value;
|
|
6003
6003
|
return !nullish(val) && val.size !== void 0;
|
|
6004
6004
|
});
|
|
@@ -6024,9 +6024,9 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
|
|
|
6024
6024
|
};
|
|
6025
6025
|
});
|
|
6026
6026
|
var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (inst, def) => {
|
|
6027
|
-
var
|
|
6027
|
+
var _a5;
|
|
6028
6028
|
$ZodCheck.init(inst, def);
|
|
6029
|
-
(
|
|
6029
|
+
(_a5 = inst._zod.def).when ?? (_a5.when = (payload) => {
|
|
6030
6030
|
const val = payload.value;
|
|
6031
6031
|
return !nullish(val) && val.size !== void 0;
|
|
6032
6032
|
});
|
|
@@ -6054,9 +6054,9 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
|
|
|
6054
6054
|
};
|
|
6055
6055
|
});
|
|
6056
6056
|
var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
|
|
6057
|
-
var
|
|
6057
|
+
var _a5;
|
|
6058
6058
|
$ZodCheck.init(inst, def);
|
|
6059
|
-
(
|
|
6059
|
+
(_a5 = inst._zod.def).when ?? (_a5.when = (payload) => {
|
|
6060
6060
|
const val = payload.value;
|
|
6061
6061
|
return !nullish(val) && val.length !== void 0;
|
|
6062
6062
|
});
|
|
@@ -6083,9 +6083,9 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
|
|
|
6083
6083
|
};
|
|
6084
6084
|
});
|
|
6085
6085
|
var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
|
|
6086
|
-
var
|
|
6086
|
+
var _a5;
|
|
6087
6087
|
$ZodCheck.init(inst, def);
|
|
6088
|
-
(
|
|
6088
|
+
(_a5 = inst._zod.def).when ?? (_a5.when = (payload) => {
|
|
6089
6089
|
const val = payload.value;
|
|
6090
6090
|
return !nullish(val) && val.length !== void 0;
|
|
6091
6091
|
});
|
|
@@ -6112,9 +6112,9 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
|
|
|
6112
6112
|
};
|
|
6113
6113
|
});
|
|
6114
6114
|
var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
|
|
6115
|
-
var
|
|
6115
|
+
var _a5;
|
|
6116
6116
|
$ZodCheck.init(inst, def);
|
|
6117
|
-
(
|
|
6117
|
+
(_a5 = inst._zod.def).when ?? (_a5.when = (payload) => {
|
|
6118
6118
|
const val = payload.value;
|
|
6119
6119
|
return !nullish(val) && val.length !== void 0;
|
|
6120
6120
|
});
|
|
@@ -6143,7 +6143,7 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
6143
6143
|
};
|
|
6144
6144
|
});
|
|
6145
6145
|
var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
6146
|
-
var
|
|
6146
|
+
var _a5, _b3;
|
|
6147
6147
|
$ZodCheck.init(inst, def);
|
|
6148
6148
|
inst._zod.onattach.push((inst2) => {
|
|
6149
6149
|
const bag = inst2._zod.bag;
|
|
@@ -6154,7 +6154,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
|
|
|
6154
6154
|
}
|
|
6155
6155
|
});
|
|
6156
6156
|
if (def.pattern)
|
|
6157
|
-
(
|
|
6157
|
+
(_a5 = inst._zod).check ?? (_a5.check = (payload) => {
|
|
6158
6158
|
def.pattern.lastIndex = 0;
|
|
6159
6159
|
if (def.pattern.test(payload.value))
|
|
6160
6160
|
return;
|
|
@@ -6169,7 +6169,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
|
|
|
6169
6169
|
});
|
|
6170
6170
|
});
|
|
6171
6171
|
else
|
|
6172
|
-
(
|
|
6172
|
+
(_b3 = inst._zod).check ?? (_b3.check = () => {
|
|
6173
6173
|
});
|
|
6174
6174
|
});
|
|
6175
6175
|
var $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => {
|
|
@@ -6311,7 +6311,7 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
|
|
|
6311
6311
|
};
|
|
6312
6312
|
});
|
|
6313
6313
|
|
|
6314
|
-
// node_modules/.pnpm/zod@4.3.
|
|
6314
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/doc.js
|
|
6315
6315
|
var Doc = class {
|
|
6316
6316
|
constructor(args = []) {
|
|
6317
6317
|
this.content = [];
|
|
@@ -6331,9 +6331,9 @@ var Doc = class {
|
|
|
6331
6331
|
return;
|
|
6332
6332
|
}
|
|
6333
6333
|
const content = arg;
|
|
6334
|
-
const lines = content.split("\n").filter((
|
|
6335
|
-
const minIndent = Math.min(...lines.map((
|
|
6336
|
-
const dedented = lines.map((
|
|
6334
|
+
const lines = content.split("\n").filter((x2) => x2);
|
|
6335
|
+
const minIndent = Math.min(...lines.map((x2) => x2.length - x2.trimStart().length));
|
|
6336
|
+
const dedented = lines.map((x2) => x2.slice(minIndent)).map((x2) => " ".repeat(this.indent * 2) + x2);
|
|
6337
6337
|
for (const line of dedented) {
|
|
6338
6338
|
this.content.push(line);
|
|
6339
6339
|
}
|
|
@@ -6342,21 +6342,21 @@ var Doc = class {
|
|
|
6342
6342
|
const F = Function;
|
|
6343
6343
|
const args = this?.args;
|
|
6344
6344
|
const content = this?.content ?? [``];
|
|
6345
|
-
const lines = [...content.map((
|
|
6345
|
+
const lines = [...content.map((x2) => ` ${x2}`)];
|
|
6346
6346
|
return new F(...args, lines.join("\n"));
|
|
6347
6347
|
}
|
|
6348
6348
|
};
|
|
6349
6349
|
|
|
6350
|
-
// node_modules/.pnpm/zod@4.3.
|
|
6350
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.js
|
|
6351
6351
|
var version = {
|
|
6352
6352
|
major: 4,
|
|
6353
6353
|
minor: 3,
|
|
6354
|
-
patch:
|
|
6354
|
+
patch: 6
|
|
6355
6355
|
};
|
|
6356
6356
|
|
|
6357
|
-
// node_modules/.pnpm/zod@4.3.
|
|
6357
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.js
|
|
6358
6358
|
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
6359
|
-
var
|
|
6359
|
+
var _a5;
|
|
6360
6360
|
inst ?? (inst = {});
|
|
6361
6361
|
inst._zod.def = def;
|
|
6362
6362
|
inst._zod.bag = inst._zod.bag || {};
|
|
@@ -6371,7 +6371,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
6371
6371
|
}
|
|
6372
6372
|
}
|
|
6373
6373
|
if (checks.length === 0) {
|
|
6374
|
-
(
|
|
6374
|
+
(_a5 = inst._zod).deferred ?? (_a5.deferred = []);
|
|
6375
6375
|
inst._zod.deferred?.push(() => {
|
|
6376
6376
|
inst._zod.run = inst._zod.parse;
|
|
6377
6377
|
});
|
|
@@ -7642,7 +7642,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
7642
7642
|
if (keyResult instanceof Promise) {
|
|
7643
7643
|
throw new Error("Async schemas not supported in object keys currently");
|
|
7644
7644
|
}
|
|
7645
|
-
const checkNumericKey = typeof key === "string" && number.test(key) && keyResult.issues.length
|
|
7645
|
+
const checkNumericKey = typeof key === "string" && number.test(key) && keyResult.issues.length;
|
|
7646
7646
|
if (checkNumericKey) {
|
|
7647
7647
|
const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);
|
|
7648
7648
|
if (retryResult instanceof Promise) {
|
|
@@ -7959,7 +7959,7 @@ var $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def
|
|
|
7959
7959
|
$ZodType.init(inst, def);
|
|
7960
7960
|
defineLazy(inst._zod, "values", () => {
|
|
7961
7961
|
const v = def.innerType._zod.values;
|
|
7962
|
-
return v ? new Set([...v].filter((
|
|
7962
|
+
return v ? new Set([...v].filter((x2) => x2 !== void 0)) : void 0;
|
|
7963
7963
|
});
|
|
7964
7964
|
inst._zod.parse = (payload, ctx) => {
|
|
7965
7965
|
const result = def.innerType._zod.run(payload, ctx);
|
|
@@ -8325,7 +8325,7 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
8325
8325
|
}
|
|
8326
8326
|
}
|
|
8327
8327
|
|
|
8328
|
-
// node_modules/.pnpm/zod@4.3.
|
|
8328
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/index.js
|
|
8329
8329
|
var locales_exports = {};
|
|
8330
8330
|
__export(locales_exports, {
|
|
8331
8331
|
ar: () => ar_default,
|
|
@@ -8379,7 +8379,7 @@ __export(locales_exports, {
|
|
|
8379
8379
|
zhTW: () => zh_TW_default
|
|
8380
8380
|
});
|
|
8381
8381
|
|
|
8382
|
-
// node_modules/.pnpm/zod@4.3.
|
|
8382
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ar.js
|
|
8383
8383
|
var error = () => {
|
|
8384
8384
|
const Sizable = {
|
|
8385
8385
|
string: { unit: "\u062D\u0631\u0641", verb: "\u0623\u0646 \u064A\u062D\u0648\u064A" },
|
|
@@ -8486,7 +8486,7 @@ function ar_default() {
|
|
|
8486
8486
|
};
|
|
8487
8487
|
}
|
|
8488
8488
|
|
|
8489
|
-
// node_modules/.pnpm/zod@4.3.
|
|
8489
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/az.js
|
|
8490
8490
|
var error2 = () => {
|
|
8491
8491
|
const Sizable = {
|
|
8492
8492
|
string: { unit: "simvol", verb: "olmal\u0131d\u0131r" },
|
|
@@ -8592,7 +8592,7 @@ function az_default() {
|
|
|
8592
8592
|
};
|
|
8593
8593
|
}
|
|
8594
8594
|
|
|
8595
|
-
// node_modules/.pnpm/zod@4.3.
|
|
8595
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/be.js
|
|
8596
8596
|
function getBelarusianPlural(count, one, few, many) {
|
|
8597
8597
|
const absCount = Math.abs(count);
|
|
8598
8598
|
const lastDigit = absCount % 10;
|
|
@@ -8749,7 +8749,7 @@ function be_default() {
|
|
|
8749
8749
|
};
|
|
8750
8750
|
}
|
|
8751
8751
|
|
|
8752
|
-
// node_modules/.pnpm/zod@4.3.
|
|
8752
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/bg.js
|
|
8753
8753
|
var error4 = () => {
|
|
8754
8754
|
const Sizable = {
|
|
8755
8755
|
string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0430", verb: "\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430" },
|
|
@@ -8870,7 +8870,7 @@ function bg_default() {
|
|
|
8870
8870
|
};
|
|
8871
8871
|
}
|
|
8872
8872
|
|
|
8873
|
-
// node_modules/.pnpm/zod@4.3.
|
|
8873
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ca.js
|
|
8874
8874
|
var error5 = () => {
|
|
8875
8875
|
const Sizable = {
|
|
8876
8876
|
string: { unit: "car\xE0cters", verb: "contenir" },
|
|
@@ -8979,7 +8979,7 @@ function ca_default() {
|
|
|
8979
8979
|
};
|
|
8980
8980
|
}
|
|
8981
8981
|
|
|
8982
|
-
// node_modules/.pnpm/zod@4.3.
|
|
8982
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/cs.js
|
|
8983
8983
|
var error6 = () => {
|
|
8984
8984
|
const Sizable = {
|
|
8985
8985
|
string: { unit: "znak\u016F", verb: "m\xEDt" },
|
|
@@ -9091,7 +9091,7 @@ function cs_default() {
|
|
|
9091
9091
|
};
|
|
9092
9092
|
}
|
|
9093
9093
|
|
|
9094
|
-
// node_modules/.pnpm/zod@4.3.
|
|
9094
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/da.js
|
|
9095
9095
|
var error7 = () => {
|
|
9096
9096
|
const Sizable = {
|
|
9097
9097
|
string: { unit: "tegn", verb: "havde" },
|
|
@@ -9207,7 +9207,7 @@ function da_default() {
|
|
|
9207
9207
|
};
|
|
9208
9208
|
}
|
|
9209
9209
|
|
|
9210
|
-
// node_modules/.pnpm/zod@4.3.
|
|
9210
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/de.js
|
|
9211
9211
|
var error8 = () => {
|
|
9212
9212
|
const Sizable = {
|
|
9213
9213
|
string: { unit: "Zeichen", verb: "zu haben" },
|
|
@@ -9316,7 +9316,7 @@ function de_default() {
|
|
|
9316
9316
|
};
|
|
9317
9317
|
}
|
|
9318
9318
|
|
|
9319
|
-
// node_modules/.pnpm/zod@4.3.
|
|
9319
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/en.js
|
|
9320
9320
|
var error9 = () => {
|
|
9321
9321
|
const Sizable = {
|
|
9322
9322
|
string: { unit: "characters", verb: "to have" },
|
|
@@ -9425,7 +9425,7 @@ function en_default() {
|
|
|
9425
9425
|
};
|
|
9426
9426
|
}
|
|
9427
9427
|
|
|
9428
|
-
// node_modules/.pnpm/zod@4.3.
|
|
9428
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/eo.js
|
|
9429
9429
|
var error10 = () => {
|
|
9430
9430
|
const Sizable = {
|
|
9431
9431
|
string: { unit: "karaktrojn", verb: "havi" },
|
|
@@ -9535,7 +9535,7 @@ function eo_default() {
|
|
|
9535
9535
|
};
|
|
9536
9536
|
}
|
|
9537
9537
|
|
|
9538
|
-
// node_modules/.pnpm/zod@4.3.
|
|
9538
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/es.js
|
|
9539
9539
|
var error11 = () => {
|
|
9540
9540
|
const Sizable = {
|
|
9541
9541
|
string: { unit: "caracteres", verb: "tener" },
|
|
@@ -9668,7 +9668,7 @@ function es_default() {
|
|
|
9668
9668
|
};
|
|
9669
9669
|
}
|
|
9670
9670
|
|
|
9671
|
-
// node_modules/.pnpm/zod@4.3.
|
|
9671
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/fa.js
|
|
9672
9672
|
var error12 = () => {
|
|
9673
9673
|
const Sizable = {
|
|
9674
9674
|
string: { unit: "\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" },
|
|
@@ -9783,7 +9783,7 @@ function fa_default() {
|
|
|
9783
9783
|
};
|
|
9784
9784
|
}
|
|
9785
9785
|
|
|
9786
|
-
// node_modules/.pnpm/zod@4.3.
|
|
9786
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/fi.js
|
|
9787
9787
|
var error13 = () => {
|
|
9788
9788
|
const Sizable = {
|
|
9789
9789
|
string: { unit: "merkki\xE4", subject: "merkkijonon" },
|
|
@@ -9896,7 +9896,7 @@ function fi_default() {
|
|
|
9896
9896
|
};
|
|
9897
9897
|
}
|
|
9898
9898
|
|
|
9899
|
-
// node_modules/.pnpm/zod@4.3.
|
|
9899
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/fr.js
|
|
9900
9900
|
var error14 = () => {
|
|
9901
9901
|
const Sizable = {
|
|
9902
9902
|
string: { unit: "caract\xE8res", verb: "avoir" },
|
|
@@ -10005,7 +10005,7 @@ function fr_default() {
|
|
|
10005
10005
|
};
|
|
10006
10006
|
}
|
|
10007
10007
|
|
|
10008
|
-
// node_modules/.pnpm/zod@4.3.
|
|
10008
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/fr-CA.js
|
|
10009
10009
|
var error15 = () => {
|
|
10010
10010
|
const Sizable = {
|
|
10011
10011
|
string: { unit: "caract\xE8res", verb: "avoir" },
|
|
@@ -10113,7 +10113,7 @@ function fr_CA_default() {
|
|
|
10113
10113
|
};
|
|
10114
10114
|
}
|
|
10115
10115
|
|
|
10116
|
-
// node_modules/.pnpm/zod@4.3.
|
|
10116
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/he.js
|
|
10117
10117
|
var error16 = () => {
|
|
10118
10118
|
const TypeNames = {
|
|
10119
10119
|
string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA", gender: "f" },
|
|
@@ -10308,7 +10308,7 @@ function he_default() {
|
|
|
10308
10308
|
};
|
|
10309
10309
|
}
|
|
10310
10310
|
|
|
10311
|
-
// node_modules/.pnpm/zod@4.3.
|
|
10311
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/hu.js
|
|
10312
10312
|
var error17 = () => {
|
|
10313
10313
|
const Sizable = {
|
|
10314
10314
|
string: { unit: "karakter", verb: "legyen" },
|
|
@@ -10417,7 +10417,7 @@ function hu_default() {
|
|
|
10417
10417
|
};
|
|
10418
10418
|
}
|
|
10419
10419
|
|
|
10420
|
-
// node_modules/.pnpm/zod@4.3.
|
|
10420
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/hy.js
|
|
10421
10421
|
function getArmenianPlural(count, one, many) {
|
|
10422
10422
|
return Math.abs(count) === 1 ? one : many;
|
|
10423
10423
|
}
|
|
@@ -10565,7 +10565,7 @@ function hy_default() {
|
|
|
10565
10565
|
};
|
|
10566
10566
|
}
|
|
10567
10567
|
|
|
10568
|
-
// node_modules/.pnpm/zod@4.3.
|
|
10568
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/id.js
|
|
10569
10569
|
var error19 = () => {
|
|
10570
10570
|
const Sizable = {
|
|
10571
10571
|
string: { unit: "karakter", verb: "memiliki" },
|
|
@@ -10672,7 +10672,7 @@ function id_default() {
|
|
|
10672
10672
|
};
|
|
10673
10673
|
}
|
|
10674
10674
|
|
|
10675
|
-
// node_modules/.pnpm/zod@4.3.
|
|
10675
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/is.js
|
|
10676
10676
|
var error20 = () => {
|
|
10677
10677
|
const Sizable = {
|
|
10678
10678
|
string: { unit: "stafi", verb: "a\xF0 hafa" },
|
|
@@ -10782,7 +10782,7 @@ function is_default() {
|
|
|
10782
10782
|
};
|
|
10783
10783
|
}
|
|
10784
10784
|
|
|
10785
|
-
// node_modules/.pnpm/zod@4.3.
|
|
10785
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/it.js
|
|
10786
10786
|
var error21 = () => {
|
|
10787
10787
|
const Sizable = {
|
|
10788
10788
|
string: { unit: "caratteri", verb: "avere" },
|
|
@@ -10891,7 +10891,7 @@ function it_default() {
|
|
|
10891
10891
|
};
|
|
10892
10892
|
}
|
|
10893
10893
|
|
|
10894
|
-
// node_modules/.pnpm/zod@4.3.
|
|
10894
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ja.js
|
|
10895
10895
|
var error22 = () => {
|
|
10896
10896
|
const Sizable = {
|
|
10897
10897
|
string: { unit: "\u6587\u5B57", verb: "\u3067\u3042\u308B" },
|
|
@@ -10999,7 +10999,7 @@ function ja_default() {
|
|
|
10999
10999
|
};
|
|
11000
11000
|
}
|
|
11001
11001
|
|
|
11002
|
-
// node_modules/.pnpm/zod@4.3.
|
|
11002
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ka.js
|
|
11003
11003
|
var error23 = () => {
|
|
11004
11004
|
const Sizable = {
|
|
11005
11005
|
string: { unit: "\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD", verb: "\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1" },
|
|
@@ -11112,7 +11112,7 @@ function ka_default() {
|
|
|
11112
11112
|
};
|
|
11113
11113
|
}
|
|
11114
11114
|
|
|
11115
|
-
// node_modules/.pnpm/zod@4.3.
|
|
11115
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/km.js
|
|
11116
11116
|
var error24 = () => {
|
|
11117
11117
|
const Sizable = {
|
|
11118
11118
|
string: { unit: "\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" },
|
|
@@ -11223,12 +11223,12 @@ function km_default() {
|
|
|
11223
11223
|
};
|
|
11224
11224
|
}
|
|
11225
11225
|
|
|
11226
|
-
// node_modules/.pnpm/zod@4.3.
|
|
11226
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/kh.js
|
|
11227
11227
|
function kh_default() {
|
|
11228
11228
|
return km_default();
|
|
11229
11229
|
}
|
|
11230
11230
|
|
|
11231
|
-
// node_modules/.pnpm/zod@4.3.
|
|
11231
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ko.js
|
|
11232
11232
|
var error25 = () => {
|
|
11233
11233
|
const Sizable = {
|
|
11234
11234
|
string: { unit: "\uBB38\uC790", verb: "to have" },
|
|
@@ -11340,7 +11340,7 @@ function ko_default() {
|
|
|
11340
11340
|
};
|
|
11341
11341
|
}
|
|
11342
11342
|
|
|
11343
|
-
// node_modules/.pnpm/zod@4.3.
|
|
11343
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/lt.js
|
|
11344
11344
|
var capitalizeFirstCharacter = (text) => {
|
|
11345
11345
|
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
11346
11346
|
};
|
|
@@ -11544,7 +11544,7 @@ function lt_default() {
|
|
|
11544
11544
|
};
|
|
11545
11545
|
}
|
|
11546
11546
|
|
|
11547
|
-
// node_modules/.pnpm/zod@4.3.
|
|
11547
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/mk.js
|
|
11548
11548
|
var error27 = () => {
|
|
11549
11549
|
const Sizable = {
|
|
11550
11550
|
string: { unit: "\u0437\u043D\u0430\u0446\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" },
|
|
@@ -11654,7 +11654,7 @@ function mk_default() {
|
|
|
11654
11654
|
};
|
|
11655
11655
|
}
|
|
11656
11656
|
|
|
11657
|
-
// node_modules/.pnpm/zod@4.3.
|
|
11657
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ms.js
|
|
11658
11658
|
var error28 = () => {
|
|
11659
11659
|
const Sizable = {
|
|
11660
11660
|
string: { unit: "aksara", verb: "mempunyai" },
|
|
@@ -11762,7 +11762,7 @@ function ms_default() {
|
|
|
11762
11762
|
};
|
|
11763
11763
|
}
|
|
11764
11764
|
|
|
11765
|
-
// node_modules/.pnpm/zod@4.3.
|
|
11765
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/nl.js
|
|
11766
11766
|
var error29 = () => {
|
|
11767
11767
|
const Sizable = {
|
|
11768
11768
|
string: { unit: "tekens", verb: "heeft" },
|
|
@@ -11873,7 +11873,7 @@ function nl_default() {
|
|
|
11873
11873
|
};
|
|
11874
11874
|
}
|
|
11875
11875
|
|
|
11876
|
-
// node_modules/.pnpm/zod@4.3.
|
|
11876
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/no.js
|
|
11877
11877
|
var error30 = () => {
|
|
11878
11878
|
const Sizable = {
|
|
11879
11879
|
string: { unit: "tegn", verb: "\xE5 ha" },
|
|
@@ -11982,7 +11982,7 @@ function no_default() {
|
|
|
11982
11982
|
};
|
|
11983
11983
|
}
|
|
11984
11984
|
|
|
11985
|
-
// node_modules/.pnpm/zod@4.3.
|
|
11985
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ota.js
|
|
11986
11986
|
var error31 = () => {
|
|
11987
11987
|
const Sizable = {
|
|
11988
11988
|
string: { unit: "harf", verb: "olmal\u0131d\u0131r" },
|
|
@@ -12092,7 +12092,7 @@ function ota_default() {
|
|
|
12092
12092
|
};
|
|
12093
12093
|
}
|
|
12094
12094
|
|
|
12095
|
-
// node_modules/.pnpm/zod@4.3.
|
|
12095
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ps.js
|
|
12096
12096
|
var error32 = () => {
|
|
12097
12097
|
const Sizable = {
|
|
12098
12098
|
string: { unit: "\u062A\u0648\u06A9\u064A", verb: "\u0648\u0644\u0631\u064A" },
|
|
@@ -12207,7 +12207,7 @@ function ps_default() {
|
|
|
12207
12207
|
};
|
|
12208
12208
|
}
|
|
12209
12209
|
|
|
12210
|
-
// node_modules/.pnpm/zod@4.3.
|
|
12210
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/pl.js
|
|
12211
12211
|
var error33 = () => {
|
|
12212
12212
|
const Sizable = {
|
|
12213
12213
|
string: { unit: "znak\xF3w", verb: "mie\u0107" },
|
|
@@ -12317,7 +12317,7 @@ function pl_default() {
|
|
|
12317
12317
|
};
|
|
12318
12318
|
}
|
|
12319
12319
|
|
|
12320
|
-
// node_modules/.pnpm/zod@4.3.
|
|
12320
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/pt.js
|
|
12321
12321
|
var error34 = () => {
|
|
12322
12322
|
const Sizable = {
|
|
12323
12323
|
string: { unit: "caracteres", verb: "ter" },
|
|
@@ -12426,7 +12426,7 @@ function pt_default() {
|
|
|
12426
12426
|
};
|
|
12427
12427
|
}
|
|
12428
12428
|
|
|
12429
|
-
// node_modules/.pnpm/zod@4.3.
|
|
12429
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ru.js
|
|
12430
12430
|
function getRussianPlural(count, one, few, many) {
|
|
12431
12431
|
const absCount = Math.abs(count);
|
|
12432
12432
|
const lastDigit = absCount % 10;
|
|
@@ -12583,7 +12583,7 @@ function ru_default() {
|
|
|
12583
12583
|
};
|
|
12584
12584
|
}
|
|
12585
12585
|
|
|
12586
|
-
// node_modules/.pnpm/zod@4.3.
|
|
12586
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/sl.js
|
|
12587
12587
|
var error36 = () => {
|
|
12588
12588
|
const Sizable = {
|
|
12589
12589
|
string: { unit: "znakov", verb: "imeti" },
|
|
@@ -12693,7 +12693,7 @@ function sl_default() {
|
|
|
12693
12693
|
};
|
|
12694
12694
|
}
|
|
12695
12695
|
|
|
12696
|
-
// node_modules/.pnpm/zod@4.3.
|
|
12696
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/sv.js
|
|
12697
12697
|
var error37 = () => {
|
|
12698
12698
|
const Sizable = {
|
|
12699
12699
|
string: { unit: "tecken", verb: "att ha" },
|
|
@@ -12804,7 +12804,7 @@ function sv_default() {
|
|
|
12804
12804
|
};
|
|
12805
12805
|
}
|
|
12806
12806
|
|
|
12807
|
-
// node_modules/.pnpm/zod@4.3.
|
|
12807
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ta.js
|
|
12808
12808
|
var error38 = () => {
|
|
12809
12809
|
const Sizable = {
|
|
12810
12810
|
string: { unit: "\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" },
|
|
@@ -12915,7 +12915,7 @@ function ta_default() {
|
|
|
12915
12915
|
};
|
|
12916
12916
|
}
|
|
12917
12917
|
|
|
12918
|
-
// node_modules/.pnpm/zod@4.3.
|
|
12918
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/th.js
|
|
12919
12919
|
var error39 = () => {
|
|
12920
12920
|
const Sizable = {
|
|
12921
12921
|
string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
@@ -13026,7 +13026,7 @@ function th_default() {
|
|
|
13026
13026
|
};
|
|
13027
13027
|
}
|
|
13028
13028
|
|
|
13029
|
-
// node_modules/.pnpm/zod@4.3.
|
|
13029
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/tr.js
|
|
13030
13030
|
var error40 = () => {
|
|
13031
13031
|
const Sizable = {
|
|
13032
13032
|
string: { unit: "karakter", verb: "olmal\u0131" },
|
|
@@ -13132,7 +13132,7 @@ function tr_default() {
|
|
|
13132
13132
|
};
|
|
13133
13133
|
}
|
|
13134
13134
|
|
|
13135
|
-
// node_modules/.pnpm/zod@4.3.
|
|
13135
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/uk.js
|
|
13136
13136
|
var error41 = () => {
|
|
13137
13137
|
const Sizable = {
|
|
13138
13138
|
string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
|
|
@@ -13241,12 +13241,12 @@ function uk_default() {
|
|
|
13241
13241
|
};
|
|
13242
13242
|
}
|
|
13243
13243
|
|
|
13244
|
-
// node_modules/.pnpm/zod@4.3.
|
|
13244
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ua.js
|
|
13245
13245
|
function ua_default() {
|
|
13246
13246
|
return uk_default();
|
|
13247
13247
|
}
|
|
13248
13248
|
|
|
13249
|
-
// node_modules/.pnpm/zod@4.3.
|
|
13249
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/ur.js
|
|
13250
13250
|
var error42 = () => {
|
|
13251
13251
|
const Sizable = {
|
|
13252
13252
|
string: { unit: "\u062D\u0631\u0648\u0641", verb: "\u06C1\u0648\u0646\u0627" },
|
|
@@ -13357,7 +13357,7 @@ function ur_default() {
|
|
|
13357
13357
|
};
|
|
13358
13358
|
}
|
|
13359
13359
|
|
|
13360
|
-
// node_modules/.pnpm/zod@4.3.
|
|
13360
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/uz.js
|
|
13361
13361
|
var error43 = () => {
|
|
13362
13362
|
const Sizable = {
|
|
13363
13363
|
string: { unit: "belgi", verb: "bo\u2018lishi kerak" },
|
|
@@ -13467,7 +13467,7 @@ function uz_default() {
|
|
|
13467
13467
|
};
|
|
13468
13468
|
}
|
|
13469
13469
|
|
|
13470
|
-
// node_modules/.pnpm/zod@4.3.
|
|
13470
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/vi.js
|
|
13471
13471
|
var error44 = () => {
|
|
13472
13472
|
const Sizable = {
|
|
13473
13473
|
string: { unit: "k\xFD t\u1EF1", verb: "c\xF3" },
|
|
@@ -13576,7 +13576,7 @@ function vi_default() {
|
|
|
13576
13576
|
};
|
|
13577
13577
|
}
|
|
13578
13578
|
|
|
13579
|
-
// node_modules/.pnpm/zod@4.3.
|
|
13579
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/zh-CN.js
|
|
13580
13580
|
var error45 = () => {
|
|
13581
13581
|
const Sizable = {
|
|
13582
13582
|
string: { unit: "\u5B57\u7B26", verb: "\u5305\u542B" },
|
|
@@ -13686,7 +13686,7 @@ function zh_CN_default() {
|
|
|
13686
13686
|
};
|
|
13687
13687
|
}
|
|
13688
13688
|
|
|
13689
|
-
// node_modules/.pnpm/zod@4.3.
|
|
13689
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/zh-TW.js
|
|
13690
13690
|
var error46 = () => {
|
|
13691
13691
|
const Sizable = {
|
|
13692
13692
|
string: { unit: "\u5B57\u5143", verb: "\u64C1\u6709" },
|
|
@@ -13794,7 +13794,7 @@ function zh_TW_default() {
|
|
|
13794
13794
|
};
|
|
13795
13795
|
}
|
|
13796
13796
|
|
|
13797
|
-
// node_modules/.pnpm/zod@4.3.
|
|
13797
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/locales/yo.js
|
|
13798
13798
|
var error47 = () => {
|
|
13799
13799
|
const Sizable = {
|
|
13800
13800
|
string: { unit: "\xE0mi", verb: "n\xED" },
|
|
@@ -13902,7 +13902,7 @@ function yo_default() {
|
|
|
13902
13902
|
};
|
|
13903
13903
|
}
|
|
13904
13904
|
|
|
13905
|
-
// node_modules/.pnpm/zod@4.3.
|
|
13905
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.js
|
|
13906
13906
|
var _a;
|
|
13907
13907
|
var $output = /* @__PURE__ */ Symbol("ZodOutput");
|
|
13908
13908
|
var $input = /* @__PURE__ */ Symbol("ZodInput");
|
|
@@ -13952,7 +13952,7 @@ function registry() {
|
|
|
13952
13952
|
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
13953
13953
|
var globalRegistry = globalThis.__zod_globalRegistry;
|
|
13954
13954
|
|
|
13955
|
-
// node_modules/.pnpm/zod@4.3.
|
|
13955
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.js
|
|
13956
13956
|
// @__NO_SIDE_EFFECTS__
|
|
13957
13957
|
function _string(Class2, params) {
|
|
13958
13958
|
return new Class2({
|
|
@@ -14991,7 +14991,7 @@ function _stringFormat(Class2, format, fnOrRegex, _params = {}) {
|
|
|
14991
14991
|
return inst;
|
|
14992
14992
|
}
|
|
14993
14993
|
|
|
14994
|
-
// node_modules/.pnpm/zod@4.3.
|
|
14994
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.js
|
|
14995
14995
|
function initializeContext(params) {
|
|
14996
14996
|
let target = params?.target ?? "draft-2020-12";
|
|
14997
14997
|
if (target === "draft-4")
|
|
@@ -15014,7 +15014,7 @@ function initializeContext(params) {
|
|
|
15014
15014
|
};
|
|
15015
15015
|
}
|
|
15016
15016
|
function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
15017
|
-
var
|
|
15017
|
+
var _a5;
|
|
15018
15018
|
const def = schema._zod.def;
|
|
15019
15019
|
const seen = ctx.seen.get(schema);
|
|
15020
15020
|
if (seen) {
|
|
@@ -15062,7 +15062,7 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
15062
15062
|
delete result.schema.default;
|
|
15063
15063
|
}
|
|
15064
15064
|
if (ctx.io === "input" && result.schema._prefault)
|
|
15065
|
-
(
|
|
15065
|
+
(_a5 = result.schema).default ?? (_a5.default = result.schema._prefault);
|
|
15066
15066
|
delete result.schema._prefault;
|
|
15067
15067
|
const _result = ctx.seen.get(schema);
|
|
15068
15068
|
return _result.schema;
|
|
@@ -15190,7 +15190,7 @@ function finalize(ctx, schema) {
|
|
|
15190
15190
|
}
|
|
15191
15191
|
}
|
|
15192
15192
|
}
|
|
15193
|
-
if (refSchema.$ref) {
|
|
15193
|
+
if (refSchema.$ref && refSeen.def) {
|
|
15194
15194
|
for (const key in schema2) {
|
|
15195
15195
|
if (key === "$ref" || key === "allOf")
|
|
15196
15196
|
continue;
|
|
@@ -15343,7 +15343,7 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
|
|
|
15343
15343
|
return finalize(ctx, schema);
|
|
15344
15344
|
};
|
|
15345
15345
|
|
|
15346
|
-
// node_modules/.pnpm/zod@4.3.
|
|
15346
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema-processors.js
|
|
15347
15347
|
var formatMap = {
|
|
15348
15348
|
guid: "uuid",
|
|
15349
15349
|
url: "uri",
|
|
@@ -15636,7 +15636,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
15636
15636
|
var unionProcessor = (schema, ctx, json2, params) => {
|
|
15637
15637
|
const def = schema._zod.def;
|
|
15638
15638
|
const isExclusive = def.inclusive === false;
|
|
15639
|
-
const options = def.options.map((
|
|
15639
|
+
const options = def.options.map((x2, i) => process2(x2, ctx, {
|
|
15640
15640
|
...params,
|
|
15641
15641
|
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
15642
15642
|
}));
|
|
@@ -15669,7 +15669,7 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
15669
15669
|
json2.type = "array";
|
|
15670
15670
|
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
15671
15671
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
15672
|
-
const prefixItems = def.items.map((
|
|
15672
|
+
const prefixItems = def.items.map((x2, i) => process2(x2, ctx, {
|
|
15673
15673
|
...params,
|
|
15674
15674
|
path: [...params.path, prefixPath, i]
|
|
15675
15675
|
}));
|
|
@@ -15894,7 +15894,7 @@ function toJSONSchema(input, params) {
|
|
|
15894
15894
|
return finalize(ctx, input);
|
|
15895
15895
|
}
|
|
15896
15896
|
|
|
15897
|
-
// node_modules/.pnpm/zod@4.3.
|
|
15897
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema-generator.js
|
|
15898
15898
|
var JSONSchemaGenerator = class {
|
|
15899
15899
|
/** @deprecated Access via ctx instead */
|
|
15900
15900
|
get metadataRegistry() {
|
|
@@ -15969,10 +15969,10 @@ var JSONSchemaGenerator = class {
|
|
|
15969
15969
|
}
|
|
15970
15970
|
};
|
|
15971
15971
|
|
|
15972
|
-
// node_modules/.pnpm/zod@4.3.
|
|
15972
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema.js
|
|
15973
15973
|
var json_schema_exports = {};
|
|
15974
15974
|
|
|
15975
|
-
// node_modules/.pnpm/zod@4.3.
|
|
15975
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.js
|
|
15976
15976
|
var schemas_exports2 = {};
|
|
15977
15977
|
__export(schemas_exports2, {
|
|
15978
15978
|
ZodAny: () => ZodAny,
|
|
@@ -16141,7 +16141,7 @@ __export(schemas_exports2, {
|
|
|
16141
16141
|
xor: () => xor
|
|
16142
16142
|
});
|
|
16143
16143
|
|
|
16144
|
-
// node_modules/.pnpm/zod@4.3.
|
|
16144
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/checks.js
|
|
16145
16145
|
var checks_exports2 = {};
|
|
16146
16146
|
__export(checks_exports2, {
|
|
16147
16147
|
endsWith: () => _endsWith,
|
|
@@ -16175,7 +16175,7 @@ __export(checks_exports2, {
|
|
|
16175
16175
|
uppercase: () => _uppercase
|
|
16176
16176
|
});
|
|
16177
16177
|
|
|
16178
|
-
// node_modules/.pnpm/zod@4.3.
|
|
16178
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/iso.js
|
|
16179
16179
|
var iso_exports = {};
|
|
16180
16180
|
__export(iso_exports, {
|
|
16181
16181
|
ZodISODate: () => ZodISODate,
|
|
@@ -16216,7 +16216,7 @@ function duration2(params) {
|
|
|
16216
16216
|
return _isoDuration(ZodISODuration, params);
|
|
16217
16217
|
}
|
|
16218
16218
|
|
|
16219
|
-
// node_modules/.pnpm/zod@4.3.
|
|
16219
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/errors.js
|
|
16220
16220
|
var initializer2 = (inst, issues) => {
|
|
16221
16221
|
$ZodError.init(inst, issues);
|
|
16222
16222
|
inst.name = "ZodError";
|
|
@@ -16256,7 +16256,7 @@ var ZodRealError = $constructor("ZodError", initializer2, {
|
|
|
16256
16256
|
Parent: Error
|
|
16257
16257
|
});
|
|
16258
16258
|
|
|
16259
|
-
// node_modules/.pnpm/zod@4.3.
|
|
16259
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/parse.js
|
|
16260
16260
|
var parse2 = /* @__PURE__ */ _parse(ZodRealError);
|
|
16261
16261
|
var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
16262
16262
|
var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -16270,7 +16270,7 @@ var safeDecode2 = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
|
16270
16270
|
var safeEncodeAsync2 = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
16271
16271
|
var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
16272
16272
|
|
|
16273
|
-
// node_modules/.pnpm/zod@4.3.
|
|
16273
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.js
|
|
16274
16274
|
var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
16275
16275
|
$ZodType.init(inst, def);
|
|
16276
16276
|
Object.assign(inst["~standard"], {
|
|
@@ -17349,7 +17349,7 @@ function preprocess(fn, schema) {
|
|
|
17349
17349
|
return pipe(transform(fn), schema);
|
|
17350
17350
|
}
|
|
17351
17351
|
|
|
17352
|
-
// node_modules/.pnpm/zod@4.3.
|
|
17352
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/compat.js
|
|
17353
17353
|
var ZodIssueCode = {
|
|
17354
17354
|
invalid_type: "invalid_type",
|
|
17355
17355
|
too_big: "too_big",
|
|
@@ -17375,7 +17375,7 @@ var ZodFirstPartyTypeKind;
|
|
|
17375
17375
|
/* @__PURE__ */ (function(ZodFirstPartyTypeKind2) {
|
|
17376
17376
|
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
17377
17377
|
|
|
17378
|
-
// node_modules/.pnpm/zod@4.3.
|
|
17378
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/from-json-schema.js
|
|
17379
17379
|
var z = {
|
|
17380
17380
|
...schemas_exports2,
|
|
17381
17381
|
...checks_exports2,
|
|
@@ -17849,7 +17849,7 @@ function fromJSONSchema(schema, params) {
|
|
|
17849
17849
|
return convertSchema(schema, ctx);
|
|
17850
17850
|
}
|
|
17851
17851
|
|
|
17852
|
-
// node_modules/.pnpm/zod@4.3.
|
|
17852
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/coerce.js
|
|
17853
17853
|
var coerce_exports = {};
|
|
17854
17854
|
__export(coerce_exports, {
|
|
17855
17855
|
bigint: () => bigint3,
|
|
@@ -17874,7 +17874,7 @@ function date4(params) {
|
|
|
17874
17874
|
return _coercedDate(ZodDate, params);
|
|
17875
17875
|
}
|
|
17876
17876
|
|
|
17877
|
-
// node_modules/.pnpm/zod@4.3.
|
|
17877
|
+
// node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/external.js
|
|
17878
17878
|
config(en_default());
|
|
17879
17879
|
|
|
17880
17880
|
// src/schema/zod-schema.ts
|
|
@@ -17907,7 +17907,7 @@ var CANVAS_CONFIG = {
|
|
|
17907
17907
|
width: 800,
|
|
17908
17908
|
height: 400,
|
|
17909
17909
|
pixelRatio: 2,
|
|
17910
|
-
fontFamily: "
|
|
17910
|
+
fontFamily: "Open Sans",
|
|
17911
17911
|
fontSize: 48,
|
|
17912
17912
|
color: "#ffffff",
|
|
17913
17913
|
textAlign: "center"
|
|
@@ -18062,7 +18062,7 @@ var wordTimingSchema = baseWordTimingSchema.extend({
|
|
|
18062
18062
|
confidence: external_exports.number().min(0).max(1).optional()
|
|
18063
18063
|
});
|
|
18064
18064
|
var richCaptionFontSchema = external_exports.object({
|
|
18065
|
-
family: external_exports.string().default(
|
|
18065
|
+
family: external_exports.string().default(CANVAS_CONFIG.DEFAULTS.fontFamily),
|
|
18066
18066
|
size: external_exports.number().int().min(1).max(500).default(24),
|
|
18067
18067
|
weight: external_exports.union([external_exports.string(), external_exports.number()]).default("400"),
|
|
18068
18068
|
color: external_exports.string().regex(HEX6).default("#ffffff"),
|
|
@@ -18071,7 +18071,7 @@ var richCaptionFontSchema = external_exports.object({
|
|
|
18071
18071
|
});
|
|
18072
18072
|
var richCaptionActiveSchema = baseCaptionActiveSchema.extend({
|
|
18073
18073
|
font: external_exports.object({
|
|
18074
|
-
color: external_exports.string().regex(HEX6).default("#
|
|
18074
|
+
color: external_exports.string().regex(HEX6).default("#ffffff"),
|
|
18075
18075
|
background: external_exports.string().regex(HEX6).optional(),
|
|
18076
18076
|
opacity: external_exports.number().min(0).max(1).default(1)
|
|
18077
18077
|
}).optional(),
|
|
@@ -19355,7 +19355,7 @@ var VoidPointer = class {
|
|
|
19355
19355
|
}
|
|
19356
19356
|
};
|
|
19357
19357
|
|
|
19358
|
-
// node_modules/.pnpm/@swc+helpers@0.5.
|
|
19358
|
+
// node_modules/.pnpm/@swc+helpers@0.5.19/node_modules/@swc/helpers/esm/_define_property.js
|
|
19359
19359
|
function _define_property(obj, key, value) {
|
|
19360
19360
|
if (key in obj) {
|
|
19361
19361
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
@@ -24620,11 +24620,11 @@ var $f08dd41ef10b694c$export$2e2bcd8739ae039 = class {
|
|
|
24620
24620
|
getVariationSelector(codepoint, variationSelector) {
|
|
24621
24621
|
if (!this.uvs) return 0;
|
|
24622
24622
|
let selectors = this.uvs.varSelectors.toArray();
|
|
24623
|
-
let i = (0, $12727730ddfc8bfe$export$2e0ae67339d5f1ac)(selectors, (
|
|
24623
|
+
let i = (0, $12727730ddfc8bfe$export$2e0ae67339d5f1ac)(selectors, (x2) => variationSelector - x2.varSelector);
|
|
24624
24624
|
let sel = selectors[i];
|
|
24625
|
-
if (i !== -1 && sel.defaultUVS) i = (0, $12727730ddfc8bfe$export$2e0ae67339d5f1ac)(sel.defaultUVS, (
|
|
24625
|
+
if (i !== -1 && sel.defaultUVS) i = (0, $12727730ddfc8bfe$export$2e0ae67339d5f1ac)(sel.defaultUVS, (x2) => codepoint < x2.startUnicodeValue ? -1 : codepoint > x2.startUnicodeValue + x2.additionalCount ? 1 : 0);
|
|
24626
24626
|
if (i !== -1 && sel.nonDefaultUVS) {
|
|
24627
|
-
i = (0, $12727730ddfc8bfe$export$2e0ae67339d5f1ac)(sel.nonDefaultUVS, (
|
|
24627
|
+
i = (0, $12727730ddfc8bfe$export$2e0ae67339d5f1ac)(sel.nonDefaultUVS, (x2) => codepoint - x2.unicodeValue);
|
|
24628
24628
|
if (i !== -1) return sel.nonDefaultUVS[i].glyphID;
|
|
24629
24629
|
}
|
|
24630
24630
|
return 0;
|
|
@@ -25004,14 +25004,14 @@ var $f34600ab9d7f70d8$export$2e2bcd8739ae039 = class _$f34600ab9d7f70d8$export$2
|
|
|
25004
25004
|
get height() {
|
|
25005
25005
|
return this.maxY - this.minY;
|
|
25006
25006
|
}
|
|
25007
|
-
addPoint(
|
|
25008
|
-
if (Math.abs(
|
|
25009
|
-
if (
|
|
25010
|
-
if (
|
|
25007
|
+
addPoint(x2, y2) {
|
|
25008
|
+
if (Math.abs(x2) !== Infinity) {
|
|
25009
|
+
if (x2 < this.minX) this.minX = x2;
|
|
25010
|
+
if (x2 > this.maxX) this.maxX = x2;
|
|
25011
25011
|
}
|
|
25012
|
-
if (Math.abs(
|
|
25013
|
-
if (
|
|
25014
|
-
if (
|
|
25012
|
+
if (Math.abs(y2) !== Infinity) {
|
|
25013
|
+
if (y2 < this.minY) this.minY = y2;
|
|
25014
|
+
if (y2 > this.maxY) this.maxY = y2;
|
|
25015
25015
|
}
|
|
25016
25016
|
}
|
|
25017
25017
|
copy() {
|
|
@@ -25275,16 +25275,16 @@ var $be07b3e97a42687a$export$2e2bcd8739ae039 = class {
|
|
|
25275
25275
|
*/
|
|
25276
25276
|
get bbox() {
|
|
25277
25277
|
let bbox = new (0, $f34600ab9d7f70d8$export$2e2bcd8739ae039)();
|
|
25278
|
-
let
|
|
25279
|
-
let
|
|
25278
|
+
let x2 = 0;
|
|
25279
|
+
let y2 = 0;
|
|
25280
25280
|
for (let index = 0; index < this.glyphs.length; index++) {
|
|
25281
25281
|
let glyph = this.glyphs[index];
|
|
25282
25282
|
let p = this.positions[index];
|
|
25283
25283
|
let b = glyph.bbox;
|
|
25284
|
-
bbox.addPoint(b.minX +
|
|
25285
|
-
bbox.addPoint(b.maxX +
|
|
25286
|
-
|
|
25287
|
-
|
|
25284
|
+
bbox.addPoint(b.minX + x2 + p.xOffset, b.minY + y2 + p.yOffset);
|
|
25285
|
+
bbox.addPoint(b.maxX + x2 + p.xOffset, b.maxY + y2 + p.yOffset);
|
|
25286
|
+
x2 += p.xAdvance;
|
|
25287
|
+
y2 += p.yAdvance;
|
|
25288
25288
|
}
|
|
25289
25289
|
return bbox;
|
|
25290
25290
|
}
|
|
@@ -28536,17 +28536,17 @@ var $c96c93587d49c14d$export$2e2bcd8739ae039 = class extends (0, $a83b9c36aaa94f
|
|
|
28536
28536
|
this.glyphIterator.cur.markAttachment = baseGlyphIndex;
|
|
28537
28537
|
}
|
|
28538
28538
|
getAnchor(anchor) {
|
|
28539
|
-
let
|
|
28540
|
-
let
|
|
28539
|
+
let x2 = anchor.xCoordinate;
|
|
28540
|
+
let y2 = anchor.yCoordinate;
|
|
28541
28541
|
let variationProcessor = this.font._variationProcessor;
|
|
28542
28542
|
let variationStore = this.font.GDEF && this.font.GDEF.itemVariationStore;
|
|
28543
28543
|
if (variationProcessor && variationStore) {
|
|
28544
|
-
if (anchor.xDeviceTable)
|
|
28545
|
-
if (anchor.yDeviceTable)
|
|
28544
|
+
if (anchor.xDeviceTable) x2 += variationProcessor.getDelta(variationStore, anchor.xDeviceTable.a, anchor.xDeviceTable.b);
|
|
28545
|
+
if (anchor.yDeviceTable) y2 += variationProcessor.getDelta(variationStore, anchor.yDeviceTable.a, anchor.yDeviceTable.b);
|
|
28546
28546
|
}
|
|
28547
28547
|
return {
|
|
28548
|
-
x,
|
|
28549
|
-
y
|
|
28548
|
+
x: x2,
|
|
28549
|
+
y: y2
|
|
28550
28550
|
};
|
|
28551
28551
|
}
|
|
28552
28552
|
applyFeatures(userFeatures, glyphs, advances) {
|
|
@@ -28814,10 +28814,10 @@ var $f43aec954cdfdf21$export$2e2bcd8739ae039 = class _$f43aec954cdfdf21$export$2
|
|
|
28814
28814
|
for (let c of this.commands) switch (c.command) {
|
|
28815
28815
|
case "moveTo":
|
|
28816
28816
|
case "lineTo":
|
|
28817
|
-
let [
|
|
28818
|
-
bbox.addPoint(
|
|
28819
|
-
cx =
|
|
28820
|
-
cy =
|
|
28817
|
+
let [x2, y2] = c.args;
|
|
28818
|
+
bbox.addPoint(x2, y2);
|
|
28819
|
+
cx = x2;
|
|
28820
|
+
cy = y2;
|
|
28821
28821
|
break;
|
|
28822
28822
|
case "quadraticCurveTo":
|
|
28823
28823
|
case "bezierCurveTo":
|
|
@@ -28887,8 +28887,8 @@ var $f43aec954cdfdf21$export$2e2bcd8739ae039 = class _$f43aec954cdfdf21$export$2
|
|
|
28887
28887
|
for (let c of this.commands) {
|
|
28888
28888
|
let args = [];
|
|
28889
28889
|
for (let i = 0; i < c.args.length; i += 2) {
|
|
28890
|
-
let [
|
|
28891
|
-
args.push(
|
|
28890
|
+
let [x2, y2] = fn(c.args[i], c.args[i + 1]);
|
|
28891
|
+
args.push(x2, y2);
|
|
28892
28892
|
}
|
|
28893
28893
|
path[c.command](...args);
|
|
28894
28894
|
}
|
|
@@ -28898,9 +28898,9 @@ var $f43aec954cdfdf21$export$2e2bcd8739ae039 = class _$f43aec954cdfdf21$export$2
|
|
|
28898
28898
|
* Transforms the path by the given matrix.
|
|
28899
28899
|
*/
|
|
28900
28900
|
transform(m0, m1, m2, m3, m4, m5) {
|
|
28901
|
-
return this.mapPoints((
|
|
28902
|
-
const tx = m0 *
|
|
28903
|
-
const ty = m1 *
|
|
28901
|
+
return this.mapPoints((x2, y2) => {
|
|
28902
|
+
const tx = m0 * x2 + m2 * y2 + m4;
|
|
28903
|
+
const ty = m1 * x2 + m3 * y2 + m5;
|
|
28904
28904
|
return [
|
|
28905
28905
|
tx,
|
|
28906
28906
|
ty
|
|
@@ -28910,8 +28910,8 @@ var $f43aec954cdfdf21$export$2e2bcd8739ae039 = class _$f43aec954cdfdf21$export$2
|
|
|
28910
28910
|
/**
|
|
28911
28911
|
* Translates the path by the given offset.
|
|
28912
28912
|
*/
|
|
28913
|
-
translate(
|
|
28914
|
-
return this.transform(1, 0, 0, 1,
|
|
28913
|
+
translate(x2, y2) {
|
|
28914
|
+
return this.transform(1, 0, 0, 1, x2, y2);
|
|
28915
28915
|
}
|
|
28916
28916
|
/**
|
|
28917
28917
|
* Rotates the path by the given angle (in radians).
|
|
@@ -29390,11 +29390,11 @@ var $69aac16029968692$export$baf26146a414f24a = class _$69aac16029968692$export$
|
|
|
29390
29390
|
copy() {
|
|
29391
29391
|
return new _$69aac16029968692$export$baf26146a414f24a(this.onCurve, this.endContour, this.x, this.y);
|
|
29392
29392
|
}
|
|
29393
|
-
constructor(onCurve, endContour,
|
|
29393
|
+
constructor(onCurve, endContour, x2 = 0, y2 = 0) {
|
|
29394
29394
|
this.onCurve = onCurve;
|
|
29395
29395
|
this.endContour = endContour;
|
|
29396
|
-
this.x =
|
|
29397
|
-
this.y =
|
|
29396
|
+
this.x = x2;
|
|
29397
|
+
this.y = y2;
|
|
29398
29398
|
}
|
|
29399
29399
|
};
|
|
29400
29400
|
var $69aac16029968692$var$Component = class {
|
|
@@ -29549,9 +29549,9 @@ var $69aac16029968692$export$2e2bcd8739ae039 = class extends (0, $f92906be28e617
|
|
|
29549
29549
|
let contour = contours2[i];
|
|
29550
29550
|
for (let j = 0; j < contour.length; j++) {
|
|
29551
29551
|
let point2 = contour[j];
|
|
29552
|
-
let
|
|
29553
|
-
let
|
|
29554
|
-
points.push(new $69aac16029968692$export$baf26146a414f24a(point2.onCurve, point2.endContour,
|
|
29552
|
+
let x2 = point2.x * component.scaleX + point2.y * component.scale01 + component.dx;
|
|
29553
|
+
let y2 = point2.y * component.scaleY + point2.x * component.scale10 + component.dy;
|
|
29554
|
+
points.push(new $69aac16029968692$export$baf26146a414f24a(point2.onCurve, point2.endContour, x2, y2));
|
|
29555
29555
|
}
|
|
29556
29556
|
}
|
|
29557
29557
|
}
|
|
@@ -29648,7 +29648,7 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends (0, $f92906be28e617
|
|
|
29648
29648
|
let trans = [];
|
|
29649
29649
|
let width = null;
|
|
29650
29650
|
let nStems = 0;
|
|
29651
|
-
let
|
|
29651
|
+
let x2 = 0, y2 = 0;
|
|
29652
29652
|
let usedGsubrs;
|
|
29653
29653
|
let usedSubrs;
|
|
29654
29654
|
let open = false;
|
|
@@ -29670,9 +29670,9 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends (0, $f92906be28e617
|
|
|
29670
29670
|
nStems += stack.length >> 1;
|
|
29671
29671
|
return stack.length = 0;
|
|
29672
29672
|
}
|
|
29673
|
-
function moveTo(
|
|
29673
|
+
function moveTo(x3, y3) {
|
|
29674
29674
|
if (open) path.closePath();
|
|
29675
|
-
path.moveTo(
|
|
29675
|
+
path.moveTo(x3, y3);
|
|
29676
29676
|
open = true;
|
|
29677
29677
|
}
|
|
29678
29678
|
let parse3 = function() {
|
|
@@ -29692,35 +29692,35 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends (0, $f92906be28e617
|
|
|
29692
29692
|
break;
|
|
29693
29693
|
case 4:
|
|
29694
29694
|
if (stack.length > 1) checkWidth();
|
|
29695
|
-
|
|
29696
|
-
moveTo(
|
|
29695
|
+
y2 += stack.shift();
|
|
29696
|
+
moveTo(x2, y2);
|
|
29697
29697
|
break;
|
|
29698
29698
|
case 5:
|
|
29699
29699
|
while (stack.length >= 2) {
|
|
29700
|
-
|
|
29701
|
-
|
|
29702
|
-
path.lineTo(
|
|
29700
|
+
x2 += stack.shift();
|
|
29701
|
+
y2 += stack.shift();
|
|
29702
|
+
path.lineTo(x2, y2);
|
|
29703
29703
|
}
|
|
29704
29704
|
break;
|
|
29705
29705
|
case 6:
|
|
29706
29706
|
case 7:
|
|
29707
29707
|
phase = op === 6;
|
|
29708
29708
|
while (stack.length >= 1) {
|
|
29709
|
-
if (phase)
|
|
29710
|
-
else
|
|
29711
|
-
path.lineTo(
|
|
29709
|
+
if (phase) x2 += stack.shift();
|
|
29710
|
+
else y2 += stack.shift();
|
|
29711
|
+
path.lineTo(x2, y2);
|
|
29712
29712
|
phase = !phase;
|
|
29713
29713
|
}
|
|
29714
29714
|
break;
|
|
29715
29715
|
case 8:
|
|
29716
29716
|
while (stack.length > 0) {
|
|
29717
|
-
c1x =
|
|
29718
|
-
c1y =
|
|
29717
|
+
c1x = x2 + stack.shift();
|
|
29718
|
+
c1y = y2 + stack.shift();
|
|
29719
29719
|
c2x = c1x + stack.shift();
|
|
29720
29720
|
c2y = c1y + stack.shift();
|
|
29721
|
-
|
|
29722
|
-
|
|
29723
|
-
path.bezierCurveTo(c1x, c1y, c2x, c2y,
|
|
29721
|
+
x2 = c2x + stack.shift();
|
|
29722
|
+
y2 = c2y + stack.shift();
|
|
29723
|
+
path.bezierCurveTo(c1x, c1y, c2x, c2y, x2, y2);
|
|
29724
29724
|
}
|
|
29725
29725
|
break;
|
|
29726
29726
|
case 10:
|
|
@@ -29775,65 +29775,65 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends (0, $f92906be28e617
|
|
|
29775
29775
|
break;
|
|
29776
29776
|
case 21:
|
|
29777
29777
|
if (stack.length > 2) checkWidth();
|
|
29778
|
-
|
|
29779
|
-
|
|
29780
|
-
moveTo(
|
|
29778
|
+
x2 += stack.shift();
|
|
29779
|
+
y2 += stack.shift();
|
|
29780
|
+
moveTo(x2, y2);
|
|
29781
29781
|
break;
|
|
29782
29782
|
case 22:
|
|
29783
29783
|
if (stack.length > 1) checkWidth();
|
|
29784
|
-
|
|
29785
|
-
moveTo(
|
|
29784
|
+
x2 += stack.shift();
|
|
29785
|
+
moveTo(x2, y2);
|
|
29786
29786
|
break;
|
|
29787
29787
|
case 24:
|
|
29788
29788
|
while (stack.length >= 8) {
|
|
29789
|
-
c1x =
|
|
29790
|
-
c1y =
|
|
29789
|
+
c1x = x2 + stack.shift();
|
|
29790
|
+
c1y = y2 + stack.shift();
|
|
29791
29791
|
c2x = c1x + stack.shift();
|
|
29792
29792
|
c2y = c1y + stack.shift();
|
|
29793
|
-
|
|
29794
|
-
|
|
29795
|
-
path.bezierCurveTo(c1x, c1y, c2x, c2y,
|
|
29793
|
+
x2 = c2x + stack.shift();
|
|
29794
|
+
y2 = c2y + stack.shift();
|
|
29795
|
+
path.bezierCurveTo(c1x, c1y, c2x, c2y, x2, y2);
|
|
29796
29796
|
}
|
|
29797
|
-
|
|
29798
|
-
|
|
29799
|
-
path.lineTo(
|
|
29797
|
+
x2 += stack.shift();
|
|
29798
|
+
y2 += stack.shift();
|
|
29799
|
+
path.lineTo(x2, y2);
|
|
29800
29800
|
break;
|
|
29801
29801
|
case 25:
|
|
29802
29802
|
while (stack.length >= 8) {
|
|
29803
|
-
|
|
29804
|
-
|
|
29805
|
-
path.lineTo(
|
|
29803
|
+
x2 += stack.shift();
|
|
29804
|
+
y2 += stack.shift();
|
|
29805
|
+
path.lineTo(x2, y2);
|
|
29806
29806
|
}
|
|
29807
|
-
c1x =
|
|
29808
|
-
c1y =
|
|
29807
|
+
c1x = x2 + stack.shift();
|
|
29808
|
+
c1y = y2 + stack.shift();
|
|
29809
29809
|
c2x = c1x + stack.shift();
|
|
29810
29810
|
c2y = c1y + stack.shift();
|
|
29811
|
-
|
|
29812
|
-
|
|
29813
|
-
path.bezierCurveTo(c1x, c1y, c2x, c2y,
|
|
29811
|
+
x2 = c2x + stack.shift();
|
|
29812
|
+
y2 = c2y + stack.shift();
|
|
29813
|
+
path.bezierCurveTo(c1x, c1y, c2x, c2y, x2, y2);
|
|
29814
29814
|
break;
|
|
29815
29815
|
case 26:
|
|
29816
|
-
if (stack.length % 2)
|
|
29816
|
+
if (stack.length % 2) x2 += stack.shift();
|
|
29817
29817
|
while (stack.length >= 4) {
|
|
29818
|
-
c1x =
|
|
29819
|
-
c1y =
|
|
29818
|
+
c1x = x2;
|
|
29819
|
+
c1y = y2 + stack.shift();
|
|
29820
29820
|
c2x = c1x + stack.shift();
|
|
29821
29821
|
c2y = c1y + stack.shift();
|
|
29822
|
-
|
|
29823
|
-
|
|
29824
|
-
path.bezierCurveTo(c1x, c1y, c2x, c2y,
|
|
29822
|
+
x2 = c2x;
|
|
29823
|
+
y2 = c2y + stack.shift();
|
|
29824
|
+
path.bezierCurveTo(c1x, c1y, c2x, c2y, x2, y2);
|
|
29825
29825
|
}
|
|
29826
29826
|
break;
|
|
29827
29827
|
case 27:
|
|
29828
|
-
if (stack.length % 2)
|
|
29828
|
+
if (stack.length % 2) y2 += stack.shift();
|
|
29829
29829
|
while (stack.length >= 4) {
|
|
29830
|
-
c1x =
|
|
29831
|
-
c1y =
|
|
29830
|
+
c1x = x2 + stack.shift();
|
|
29831
|
+
c1y = y2;
|
|
29832
29832
|
c2x = c1x + stack.shift();
|
|
29833
29833
|
c2y = c1y + stack.shift();
|
|
29834
|
-
|
|
29835
|
-
|
|
29836
|
-
path.bezierCurveTo(c1x, c1y, c2x, c2y,
|
|
29834
|
+
x2 = c2x + stack.shift();
|
|
29835
|
+
y2 = c2y;
|
|
29836
|
+
path.bezierCurveTo(c1x, c1y, c2x, c2y, x2, y2);
|
|
29837
29837
|
}
|
|
29838
29838
|
break;
|
|
29839
29839
|
case 28:
|
|
@@ -29858,21 +29858,21 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends (0, $f92906be28e617
|
|
|
29858
29858
|
phase = op === 31;
|
|
29859
29859
|
while (stack.length >= 4) {
|
|
29860
29860
|
if (phase) {
|
|
29861
|
-
c1x =
|
|
29862
|
-
c1y =
|
|
29861
|
+
c1x = x2 + stack.shift();
|
|
29862
|
+
c1y = y2;
|
|
29863
29863
|
c2x = c1x + stack.shift();
|
|
29864
29864
|
c2y = c1y + stack.shift();
|
|
29865
|
-
|
|
29866
|
-
|
|
29865
|
+
y2 = c2y + stack.shift();
|
|
29866
|
+
x2 = c2x + (stack.length === 1 ? stack.shift() : 0);
|
|
29867
29867
|
} else {
|
|
29868
|
-
c1x =
|
|
29869
|
-
c1y =
|
|
29868
|
+
c1x = x2;
|
|
29869
|
+
c1y = y2 + stack.shift();
|
|
29870
29870
|
c2x = c1x + stack.shift();
|
|
29871
29871
|
c2y = c1y + stack.shift();
|
|
29872
|
-
|
|
29873
|
-
|
|
29872
|
+
x2 = c2x + stack.shift();
|
|
29873
|
+
y2 = c2y + (stack.length === 1 ? stack.shift() : 0);
|
|
29874
29874
|
}
|
|
29875
|
-
path.bezierCurveTo(c1x, c1y, c2x, c2y,
|
|
29875
|
+
path.bezierCurveTo(c1x, c1y, c2x, c2y, x2, y2);
|
|
29876
29876
|
phase = !phase;
|
|
29877
29877
|
}
|
|
29878
29878
|
break;
|
|
@@ -29984,8 +29984,8 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends (0, $f92906be28e617
|
|
|
29984
29984
|
}
|
|
29985
29985
|
break;
|
|
29986
29986
|
case 34:
|
|
29987
|
-
c1x =
|
|
29988
|
-
c1y =
|
|
29987
|
+
c1x = x2 + stack.shift();
|
|
29988
|
+
c1y = y2;
|
|
29989
29989
|
c2x = c1x + stack.shift();
|
|
29990
29990
|
c2y = c1y + stack.shift();
|
|
29991
29991
|
c3x = c2x + stack.shift();
|
|
@@ -29996,25 +29996,25 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends (0, $f92906be28e617
|
|
|
29996
29996
|
c5y = c4y;
|
|
29997
29997
|
c6x = c5x + stack.shift();
|
|
29998
29998
|
c6y = c5y;
|
|
29999
|
-
|
|
30000
|
-
|
|
29999
|
+
x2 = c6x;
|
|
30000
|
+
y2 = c6y;
|
|
30001
30001
|
path.bezierCurveTo(c1x, c1y, c2x, c2y, c3x, c3y);
|
|
30002
30002
|
path.bezierCurveTo(c4x, c4y, c5x, c5y, c6x, c6y);
|
|
30003
30003
|
break;
|
|
30004
30004
|
case 35:
|
|
30005
30005
|
pts = [];
|
|
30006
30006
|
for (let i = 0; i <= 5; i++) {
|
|
30007
|
-
|
|
30008
|
-
|
|
30009
|
-
pts.push(
|
|
30007
|
+
x2 += stack.shift();
|
|
30008
|
+
y2 += stack.shift();
|
|
30009
|
+
pts.push(x2, y2);
|
|
30010
30010
|
}
|
|
30011
30011
|
path.bezierCurveTo(...pts.slice(0, 6));
|
|
30012
30012
|
path.bezierCurveTo(...pts.slice(6));
|
|
30013
30013
|
stack.shift();
|
|
30014
30014
|
break;
|
|
30015
30015
|
case 36:
|
|
30016
|
-
c1x =
|
|
30017
|
-
c1y =
|
|
30016
|
+
c1x = x2 + stack.shift();
|
|
30017
|
+
c1y = y2 + stack.shift();
|
|
30018
30018
|
c2x = c1x + stack.shift();
|
|
30019
30019
|
c2y = c1y + stack.shift();
|
|
30020
30020
|
c3x = c2x + stack.shift();
|
|
@@ -30025,28 +30025,28 @@ var $62cc5109c6101893$export$2e2bcd8739ae039 = class extends (0, $f92906be28e617
|
|
|
30025
30025
|
c5y = c4y + stack.shift();
|
|
30026
30026
|
c6x = c5x + stack.shift();
|
|
30027
30027
|
c6y = c5y;
|
|
30028
|
-
|
|
30029
|
-
|
|
30028
|
+
x2 = c6x;
|
|
30029
|
+
y2 = c6y;
|
|
30030
30030
|
path.bezierCurveTo(c1x, c1y, c2x, c2y, c3x, c3y);
|
|
30031
30031
|
path.bezierCurveTo(c4x, c4y, c5x, c5y, c6x, c6y);
|
|
30032
30032
|
break;
|
|
30033
30033
|
case 37:
|
|
30034
|
-
let startx =
|
|
30035
|
-
let starty =
|
|
30034
|
+
let startx = x2;
|
|
30035
|
+
let starty = y2;
|
|
30036
30036
|
pts = [];
|
|
30037
30037
|
for (let i = 0; i <= 4; i++) {
|
|
30038
|
-
|
|
30039
|
-
|
|
30040
|
-
pts.push(
|
|
30038
|
+
x2 += stack.shift();
|
|
30039
|
+
y2 += stack.shift();
|
|
30040
|
+
pts.push(x2, y2);
|
|
30041
30041
|
}
|
|
30042
|
-
if (Math.abs(
|
|
30043
|
-
|
|
30044
|
-
|
|
30042
|
+
if (Math.abs(x2 - startx) > Math.abs(y2 - starty)) {
|
|
30043
|
+
x2 += stack.shift();
|
|
30044
|
+
y2 = starty;
|
|
30045
30045
|
} else {
|
|
30046
|
-
|
|
30047
|
-
|
|
30046
|
+
x2 = startx;
|
|
30047
|
+
y2 += stack.shift();
|
|
30048
30048
|
}
|
|
30049
|
-
pts.push(
|
|
30049
|
+
pts.push(x2, y2);
|
|
30050
30050
|
path.bezierCurveTo(...pts.slice(0, 6));
|
|
30051
30051
|
path.bezierCurveTo(...pts.slice(6));
|
|
30052
30052
|
break;
|
|
@@ -30540,20 +30540,20 @@ var $807e58506be70005$export$2e2bcd8739ae039 = class {
|
|
|
30540
30540
|
for (let i = 0; i < path.commands.length; i++) {
|
|
30541
30541
|
let c = path.commands[i];
|
|
30542
30542
|
for (let j = 0; j < c.args.length; j += 2) {
|
|
30543
|
-
let
|
|
30544
|
-
let
|
|
30543
|
+
let x2 = c.args[j];
|
|
30544
|
+
let y2 = c.args[j + 1];
|
|
30545
30545
|
let flag = 0;
|
|
30546
30546
|
if (c.command === "quadraticCurveTo" && j === 2) {
|
|
30547
30547
|
let next = path.commands[i + 1];
|
|
30548
30548
|
if (next && next.command === "quadraticCurveTo") {
|
|
30549
30549
|
let midX = (lastX + next.args[0]) / 2;
|
|
30550
30550
|
let midY = (lastY + next.args[1]) / 2;
|
|
30551
|
-
if (
|
|
30551
|
+
if (x2 === midX && y2 === midY) continue;
|
|
30552
30552
|
}
|
|
30553
30553
|
}
|
|
30554
30554
|
if (!(c.command === "quadraticCurveTo" && j === 0)) flag |= $807e58506be70005$var$ON_CURVE;
|
|
30555
|
-
flag = this._encodePoint(
|
|
30556
|
-
flag = this._encodePoint(
|
|
30555
|
+
flag = this._encodePoint(x2, lastX, xPoints, flag, $807e58506be70005$var$X_SHORT_VECTOR, $807e58506be70005$var$SAME_X);
|
|
30556
|
+
flag = this._encodePoint(y2, lastY, yPoints, flag, $807e58506be70005$var$Y_SHORT_VECTOR, $807e58506be70005$var$SAME_Y);
|
|
30557
30557
|
if (flag === lastFlag && same < 255) {
|
|
30558
30558
|
flags[flags.length - 1] |= $807e58506be70005$var$REPEAT;
|
|
30559
30559
|
same++;
|
|
@@ -30565,8 +30565,8 @@ var $807e58506be70005$export$2e2bcd8739ae039 = class {
|
|
|
30565
30565
|
flags.push(flag);
|
|
30566
30566
|
lastFlag = flag;
|
|
30567
30567
|
}
|
|
30568
|
-
lastX =
|
|
30569
|
-
lastY =
|
|
30568
|
+
lastX = x2;
|
|
30569
|
+
lastY = y2;
|
|
30570
30570
|
pointCount++;
|
|
30571
30571
|
}
|
|
30572
30572
|
if (c.command === "closePath") endPtsOfContours.push(pointCount - 1);
|
|
@@ -31549,8 +31549,8 @@ function $21ee218f84ac7f32$var$withSign(flag, baseval) {
|
|
|
31549
31549
|
return flag & 1 ? baseval : -baseval;
|
|
31550
31550
|
}
|
|
31551
31551
|
function $21ee218f84ac7f32$var$decodeTriplet(flags, glyphs, nPoints) {
|
|
31552
|
-
let
|
|
31553
|
-
let
|
|
31552
|
+
let y2;
|
|
31553
|
+
let x2 = y2 = 0;
|
|
31554
31554
|
let res = [];
|
|
31555
31555
|
for (let i = 0; i < nPoints; i++) {
|
|
31556
31556
|
let dx = 0, dy = 0;
|
|
@@ -31581,9 +31581,9 @@ function $21ee218f84ac7f32$var$decodeTriplet(flags, glyphs, nPoints) {
|
|
|
31581
31581
|
dx = $21ee218f84ac7f32$var$withSign(flag, glyphs.readUInt16BE());
|
|
31582
31582
|
dy = $21ee218f84ac7f32$var$withSign(flag >> 1, glyphs.readUInt16BE());
|
|
31583
31583
|
}
|
|
31584
|
-
|
|
31585
|
-
|
|
31586
|
-
res.push(new (0, $69aac16029968692$export$baf26146a414f24a)(onCurve, false,
|
|
31584
|
+
x2 += dx;
|
|
31585
|
+
y2 += dy;
|
|
31586
|
+
res.push(new (0, $69aac16029968692$export$baf26146a414f24a)(onCurve, false, x2, y2));
|
|
31587
31587
|
}
|
|
31588
31588
|
return res;
|
|
31589
31589
|
}
|
|
@@ -32382,9 +32382,9 @@ function gradientSpecFrom(g, opacity) {
|
|
|
32382
32382
|
// src/core/decoration.ts
|
|
32383
32383
|
function decorationGeometry(kind, p) {
|
|
32384
32384
|
const thickness = Math.max(1, Math.round(p.fontSize * 0.05));
|
|
32385
|
-
let
|
|
32386
|
-
if (kind === "line-through")
|
|
32387
|
-
return { x1: p.xStart, x2: p.xStart + p.lineWidth, y, width: thickness };
|
|
32385
|
+
let y2 = p.baselineY + Math.round(p.fontSize * 0.1);
|
|
32386
|
+
if (kind === "line-through") y2 = p.baselineY - Math.round(p.fontSize * 0.3);
|
|
32387
|
+
return { x1: p.xStart, x2: p.xStart + p.lineWidth, y: y2, width: thickness };
|
|
32388
32388
|
}
|
|
32389
32389
|
|
|
32390
32390
|
// src/core/drawops.ts
|
|
@@ -32612,20 +32612,20 @@ function computePathBounds(d) {
|
|
|
32612
32612
|
const t = tokenizePath(d);
|
|
32613
32613
|
let i = 0;
|
|
32614
32614
|
let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
|
|
32615
|
-
const touch = (
|
|
32616
|
-
if (
|
|
32617
|
-
if (
|
|
32618
|
-
if (
|
|
32619
|
-
if (
|
|
32615
|
+
const touch = (x2, y2) => {
|
|
32616
|
+
if (x2 < minX) minX = x2;
|
|
32617
|
+
if (y2 < minY) minY = y2;
|
|
32618
|
+
if (x2 > maxX) maxX = x2;
|
|
32619
|
+
if (y2 > maxY) maxY = y2;
|
|
32620
32620
|
};
|
|
32621
32621
|
while (i < t.length) {
|
|
32622
32622
|
const cmd = t[i++];
|
|
32623
32623
|
switch (cmd) {
|
|
32624
32624
|
case "M":
|
|
32625
32625
|
case "L": {
|
|
32626
|
-
const
|
|
32627
|
-
const
|
|
32628
|
-
touch(
|
|
32626
|
+
const x2 = parseFloat(t[i++]);
|
|
32627
|
+
const y2 = parseFloat(t[i++]);
|
|
32628
|
+
touch(x2, y2);
|
|
32629
32629
|
break;
|
|
32630
32630
|
}
|
|
32631
32631
|
case "C": {
|
|
@@ -32633,20 +32633,20 @@ function computePathBounds(d) {
|
|
|
32633
32633
|
const c1y = parseFloat(t[i++]);
|
|
32634
32634
|
const c2x = parseFloat(t[i++]);
|
|
32635
32635
|
const c2y = parseFloat(t[i++]);
|
|
32636
|
-
const
|
|
32637
|
-
const
|
|
32636
|
+
const x2 = parseFloat(t[i++]);
|
|
32637
|
+
const y2 = parseFloat(t[i++]);
|
|
32638
32638
|
touch(c1x, c1y);
|
|
32639
32639
|
touch(c2x, c2y);
|
|
32640
|
-
touch(
|
|
32640
|
+
touch(x2, y2);
|
|
32641
32641
|
break;
|
|
32642
32642
|
}
|
|
32643
32643
|
case "Q": {
|
|
32644
32644
|
const cx = parseFloat(t[i++]);
|
|
32645
32645
|
const cy = parseFloat(t[i++]);
|
|
32646
|
-
const
|
|
32647
|
-
const
|
|
32646
|
+
const x2 = parseFloat(t[i++]);
|
|
32647
|
+
const y2 = parseFloat(t[i++]);
|
|
32648
32648
|
touch(cx, cy);
|
|
32649
|
-
touch(
|
|
32649
|
+
touch(x2, y2);
|
|
32650
32650
|
break;
|
|
32651
32651
|
}
|
|
32652
32652
|
case "Z":
|
|
@@ -32730,7 +32730,7 @@ function applyTypewriterAnimation(ops, lines, progress, style, fontSize, time3,
|
|
|
32730
32730
|
const totalWords = wordSegments.length;
|
|
32731
32731
|
const visibleWords = Math.floor(progress * totalWords);
|
|
32732
32732
|
if (visibleWords === 0) {
|
|
32733
|
-
return ops.filter((
|
|
32733
|
+
return ops.filter((x2) => x2.op === "BeginFrame" || x2.op === "Rectangle" || x2.op === "RectangleStroke");
|
|
32734
32734
|
}
|
|
32735
32735
|
let totalVisibleGlyphs = 0;
|
|
32736
32736
|
for (let i = 0; i < Math.min(visibleWords, wordSegments.length); i++) {
|
|
@@ -32746,7 +32746,7 @@ function applyTypewriterAnimation(ops, lines, progress, style, fontSize, time3,
|
|
|
32746
32746
|
const totalGlyphs = lines.reduce((s, l) => s + l.glyphs.length, 0);
|
|
32747
32747
|
const visibleGlyphs = Math.floor(progress * totalGlyphs);
|
|
32748
32748
|
if (visibleGlyphs === 0) {
|
|
32749
|
-
return ops.filter((
|
|
32749
|
+
return ops.filter((x2) => x2.op === "BeginFrame" || x2.op === "Rectangle" || x2.op === "RectangleStroke");
|
|
32750
32750
|
}
|
|
32751
32751
|
const visibleOpsRaw = sliceGlyphOps(ops, visibleGlyphs);
|
|
32752
32752
|
const visibleOps = progress >= DECORATION_DONE_THRESHOLD ? visibleOpsRaw : visibleOpsRaw.filter((o) => o.op !== "DecorationLine");
|
|
@@ -33399,17 +33399,17 @@ function createWebPainter(canvas) {
|
|
|
33399
33399
|
ctx.lineWidth = op.stroke.width * 2;
|
|
33400
33400
|
if (op.borderRadius && op.borderRadius > 0) {
|
|
33401
33401
|
const p = new Path2D();
|
|
33402
|
-
const
|
|
33403
|
-
const
|
|
33402
|
+
const x2 = op.x;
|
|
33403
|
+
const y2 = op.y;
|
|
33404
33404
|
const w = op.width;
|
|
33405
33405
|
const h = op.height;
|
|
33406
33406
|
const maxRadius = Math.min(w, h) / 2;
|
|
33407
33407
|
const r = Math.min(op.borderRadius, maxRadius);
|
|
33408
|
-
p.moveTo(
|
|
33409
|
-
p.arcTo(
|
|
33410
|
-
p.arcTo(
|
|
33411
|
-
p.arcTo(
|
|
33412
|
-
p.arcTo(
|
|
33408
|
+
p.moveTo(x2 + r, y2);
|
|
33409
|
+
p.arcTo(x2 + w, y2, x2 + w, y2 + h, r);
|
|
33410
|
+
p.arcTo(x2 + w, y2 + h, x2, y2 + h, r);
|
|
33411
|
+
p.arcTo(x2, y2 + h, x2, y2, r);
|
|
33412
|
+
p.arcTo(x2, y2, x2 + w, y2, r);
|
|
33413
33413
|
p.closePath();
|
|
33414
33414
|
ctx.stroke(p);
|
|
33415
33415
|
} else {
|
|
@@ -33640,15 +33640,15 @@ function createWebPainter(canvas) {
|
|
|
33640
33640
|
}
|
|
33641
33641
|
};
|
|
33642
33642
|
}
|
|
33643
|
-
function drawRoundedRect(ctx,
|
|
33643
|
+
function drawRoundedRect(ctx, x2, y2, w, h, r) {
|
|
33644
33644
|
const maxRadius = Math.min(w, h) / 2;
|
|
33645
33645
|
const radius = Math.min(r, maxRadius);
|
|
33646
33646
|
const p = new Path2D();
|
|
33647
|
-
p.moveTo(
|
|
33648
|
-
p.arcTo(
|
|
33649
|
-
p.arcTo(
|
|
33650
|
-
p.arcTo(
|
|
33651
|
-
p.arcTo(
|
|
33647
|
+
p.moveTo(x2 + radius, y2);
|
|
33648
|
+
p.arcTo(x2 + w, y2, x2 + w, y2 + h, radius);
|
|
33649
|
+
p.arcTo(x2 + w, y2 + h, x2, y2 + h, radius);
|
|
33650
|
+
p.arcTo(x2, y2 + h, x2, y2, radius);
|
|
33651
|
+
p.arcTo(x2, y2, x2 + w, y2, radius);
|
|
33652
33652
|
p.closePath();
|
|
33653
33653
|
ctx.fill(p);
|
|
33654
33654
|
}
|
|
@@ -33717,20 +33717,20 @@ function computePathBounds2(d) {
|
|
|
33717
33717
|
let minY = Infinity;
|
|
33718
33718
|
let maxX = -Infinity;
|
|
33719
33719
|
let maxY = -Infinity;
|
|
33720
|
-
const touch = (
|
|
33721
|
-
if (
|
|
33722
|
-
if (
|
|
33723
|
-
if (
|
|
33724
|
-
if (
|
|
33720
|
+
const touch = (x2, y2) => {
|
|
33721
|
+
if (x2 < minX) minX = x2;
|
|
33722
|
+
if (y2 < minY) minY = y2;
|
|
33723
|
+
if (x2 > maxX) maxX = x2;
|
|
33724
|
+
if (y2 > maxY) maxY = y2;
|
|
33725
33725
|
};
|
|
33726
33726
|
while (i < tokens.length) {
|
|
33727
33727
|
const t = tokens[i++];
|
|
33728
33728
|
switch (t) {
|
|
33729
33729
|
case "M":
|
|
33730
33730
|
case "L": {
|
|
33731
|
-
const
|
|
33732
|
-
const
|
|
33733
|
-
touch(
|
|
33731
|
+
const x2 = parseFloat(tokens[i++]);
|
|
33732
|
+
const y2 = parseFloat(tokens[i++]);
|
|
33733
|
+
touch(x2, y2);
|
|
33734
33734
|
break;
|
|
33735
33735
|
}
|
|
33736
33736
|
case "C": {
|
|
@@ -33738,20 +33738,20 @@ function computePathBounds2(d) {
|
|
|
33738
33738
|
const c1y = parseFloat(tokens[i++]);
|
|
33739
33739
|
const c2x = parseFloat(tokens[i++]);
|
|
33740
33740
|
const c2y = parseFloat(tokens[i++]);
|
|
33741
|
-
const
|
|
33742
|
-
const
|
|
33741
|
+
const x2 = parseFloat(tokens[i++]);
|
|
33742
|
+
const y2 = parseFloat(tokens[i++]);
|
|
33743
33743
|
touch(c1x, c1y);
|
|
33744
33744
|
touch(c2x, c2y);
|
|
33745
|
-
touch(
|
|
33745
|
+
touch(x2, y2);
|
|
33746
33746
|
break;
|
|
33747
33747
|
}
|
|
33748
33748
|
case "Q": {
|
|
33749
33749
|
const cx = parseFloat(tokens[i++]);
|
|
33750
33750
|
const cy = parseFloat(tokens[i++]);
|
|
33751
|
-
const
|
|
33752
|
-
const
|
|
33751
|
+
const x2 = parseFloat(tokens[i++]);
|
|
33752
|
+
const y2 = parseFloat(tokens[i++]);
|
|
33753
33753
|
touch(cx, cy);
|
|
33754
|
-
touch(
|
|
33754
|
+
touch(x2, y2);
|
|
33755
33755
|
break;
|
|
33756
33756
|
}
|
|
33757
33757
|
case "Z":
|
|
@@ -33864,41 +33864,41 @@ function parseSvgPath(pathData) {
|
|
|
33864
33864
|
case "M": {
|
|
33865
33865
|
const coords = parseCoordinatePairs(args, isRelative, currentX, currentY);
|
|
33866
33866
|
for (let i = 0; i < coords.length; i++) {
|
|
33867
|
-
const { x, y } = coords[i];
|
|
33867
|
+
const { x: x2, y: y2 } = coords[i];
|
|
33868
33868
|
if (i === 0) {
|
|
33869
|
-
commands.push({ type: "M", x, y });
|
|
33870
|
-
startX =
|
|
33871
|
-
startY =
|
|
33869
|
+
commands.push({ type: "M", x: x2, y: y2 });
|
|
33870
|
+
startX = x2;
|
|
33871
|
+
startY = y2;
|
|
33872
33872
|
} else {
|
|
33873
|
-
commands.push({ type: "L", x, y });
|
|
33873
|
+
commands.push({ type: "L", x: x2, y: y2 });
|
|
33874
33874
|
}
|
|
33875
|
-
currentX =
|
|
33876
|
-
currentY =
|
|
33875
|
+
currentX = x2;
|
|
33876
|
+
currentY = y2;
|
|
33877
33877
|
}
|
|
33878
33878
|
break;
|
|
33879
33879
|
}
|
|
33880
33880
|
case "L": {
|
|
33881
33881
|
const coords = parseCoordinatePairs(args, isRelative, currentX, currentY);
|
|
33882
|
-
for (const { x, y } of coords) {
|
|
33883
|
-
commands.push({ type: "L", x, y });
|
|
33884
|
-
currentX =
|
|
33885
|
-
currentY =
|
|
33882
|
+
for (const { x: x2, y: y2 } of coords) {
|
|
33883
|
+
commands.push({ type: "L", x: x2, y: y2 });
|
|
33884
|
+
currentX = x2;
|
|
33885
|
+
currentY = y2;
|
|
33886
33886
|
}
|
|
33887
33887
|
break;
|
|
33888
33888
|
}
|
|
33889
33889
|
case "H": {
|
|
33890
33890
|
for (const arg of args) {
|
|
33891
|
-
const
|
|
33892
|
-
commands.push({ type: "L", x, y: currentY });
|
|
33893
|
-
currentX =
|
|
33891
|
+
const x2 = isRelative ? currentX + arg : arg;
|
|
33892
|
+
commands.push({ type: "L", x: x2, y: currentY });
|
|
33893
|
+
currentX = x2;
|
|
33894
33894
|
}
|
|
33895
33895
|
break;
|
|
33896
33896
|
}
|
|
33897
33897
|
case "V": {
|
|
33898
33898
|
for (const arg of args) {
|
|
33899
|
-
const
|
|
33900
|
-
commands.push({ type: "L", x: currentX, y });
|
|
33901
|
-
currentY =
|
|
33899
|
+
const y2 = isRelative ? currentY + arg : arg;
|
|
33900
|
+
commands.push({ type: "L", x: currentX, y: y2 });
|
|
33901
|
+
currentY = y2;
|
|
33902
33902
|
}
|
|
33903
33903
|
break;
|
|
33904
33904
|
}
|
|
@@ -33908,21 +33908,21 @@ function parseSvgPath(pathData) {
|
|
|
33908
33908
|
let y1 = args[i + 1];
|
|
33909
33909
|
let x2 = args[i + 2];
|
|
33910
33910
|
let y2 = args[i + 3];
|
|
33911
|
-
let
|
|
33912
|
-
let
|
|
33911
|
+
let x3 = args[i + 4];
|
|
33912
|
+
let y3 = args[i + 5];
|
|
33913
33913
|
if (isRelative) {
|
|
33914
33914
|
x1 += currentX;
|
|
33915
33915
|
y1 += currentY;
|
|
33916
33916
|
x2 += currentX;
|
|
33917
33917
|
y2 += currentY;
|
|
33918
|
-
|
|
33919
|
-
|
|
33918
|
+
x3 += currentX;
|
|
33919
|
+
y3 += currentY;
|
|
33920
33920
|
}
|
|
33921
|
-
commands.push({ type: "C", x1, y1, x2, y2, x, y });
|
|
33921
|
+
commands.push({ type: "C", x1, y1, x2, y2, x: x3, y: y3 });
|
|
33922
33922
|
lastControlX = x2;
|
|
33923
33923
|
lastControlY = y2;
|
|
33924
|
-
currentX =
|
|
33925
|
-
currentY =
|
|
33924
|
+
currentX = x3;
|
|
33925
|
+
currentY = y3;
|
|
33926
33926
|
}
|
|
33927
33927
|
break;
|
|
33928
33928
|
}
|
|
@@ -33939,19 +33939,19 @@ function parseSvgPath(pathData) {
|
|
|
33939
33939
|
}
|
|
33940
33940
|
let x2 = args[i];
|
|
33941
33941
|
let y2 = args[i + 1];
|
|
33942
|
-
let
|
|
33943
|
-
let
|
|
33942
|
+
let x3 = args[i + 2];
|
|
33943
|
+
let y3 = args[i + 3];
|
|
33944
33944
|
if (isRelative) {
|
|
33945
33945
|
x2 += currentX;
|
|
33946
33946
|
y2 += currentY;
|
|
33947
|
-
|
|
33948
|
-
|
|
33947
|
+
x3 += currentX;
|
|
33948
|
+
y3 += currentY;
|
|
33949
33949
|
}
|
|
33950
|
-
commands.push({ type: "C", x1, y1, x2, y2, x, y });
|
|
33950
|
+
commands.push({ type: "C", x1, y1, x2, y2, x: x3, y: y3 });
|
|
33951
33951
|
lastControlX = x2;
|
|
33952
33952
|
lastControlY = y2;
|
|
33953
|
-
currentX =
|
|
33954
|
-
currentY =
|
|
33953
|
+
currentX = x3;
|
|
33954
|
+
currentY = y3;
|
|
33955
33955
|
lastCommand = "S";
|
|
33956
33956
|
}
|
|
33957
33957
|
break;
|
|
@@ -33960,19 +33960,19 @@ function parseSvgPath(pathData) {
|
|
|
33960
33960
|
for (let i = 0; i + 3 < args.length + 1; i += 4) {
|
|
33961
33961
|
let x1 = args[i];
|
|
33962
33962
|
let y1 = args[i + 1];
|
|
33963
|
-
let
|
|
33964
|
-
let
|
|
33963
|
+
let x2 = args[i + 2];
|
|
33964
|
+
let y2 = args[i + 3];
|
|
33965
33965
|
if (isRelative) {
|
|
33966
33966
|
x1 += currentX;
|
|
33967
33967
|
y1 += currentY;
|
|
33968
|
-
|
|
33969
|
-
|
|
33968
|
+
x2 += currentX;
|
|
33969
|
+
y2 += currentY;
|
|
33970
33970
|
}
|
|
33971
|
-
commands.push({ type: "Q", x1, y1, x, y });
|
|
33971
|
+
commands.push({ type: "Q", x1, y1, x: x2, y: y2 });
|
|
33972
33972
|
lastControlX = x1;
|
|
33973
33973
|
lastControlY = y1;
|
|
33974
|
-
currentX =
|
|
33975
|
-
currentY =
|
|
33974
|
+
currentX = x2;
|
|
33975
|
+
currentY = y2;
|
|
33976
33976
|
}
|
|
33977
33977
|
break;
|
|
33978
33978
|
}
|
|
@@ -33987,17 +33987,17 @@ function parseSvgPath(pathData) {
|
|
|
33987
33987
|
x1 = currentX;
|
|
33988
33988
|
y1 = currentY;
|
|
33989
33989
|
}
|
|
33990
|
-
let
|
|
33991
|
-
let
|
|
33990
|
+
let x2 = args[i];
|
|
33991
|
+
let y2 = args[i + 1];
|
|
33992
33992
|
if (isRelative) {
|
|
33993
|
-
|
|
33994
|
-
|
|
33993
|
+
x2 += currentX;
|
|
33994
|
+
y2 += currentY;
|
|
33995
33995
|
}
|
|
33996
|
-
commands.push({ type: "Q", x1, y1, x, y });
|
|
33996
|
+
commands.push({ type: "Q", x1, y1, x: x2, y: y2 });
|
|
33997
33997
|
lastControlX = x1;
|
|
33998
33998
|
lastControlY = y1;
|
|
33999
|
-
currentX =
|
|
34000
|
-
currentY =
|
|
33999
|
+
currentX = x2;
|
|
34000
|
+
currentY = y2;
|
|
34001
34001
|
lastCommand = "T";
|
|
34002
34002
|
}
|
|
34003
34003
|
break;
|
|
@@ -34009,11 +34009,11 @@ function parseSvgPath(pathData) {
|
|
|
34009
34009
|
const xAxisRotation = args[i + 2];
|
|
34010
34010
|
const largeArcFlag = args[i + 3] !== 0;
|
|
34011
34011
|
const sweepFlag = args[i + 4] !== 0;
|
|
34012
|
-
let
|
|
34013
|
-
let
|
|
34012
|
+
let x2 = args[i + 5];
|
|
34013
|
+
let y2 = args[i + 6];
|
|
34014
34014
|
if (isRelative) {
|
|
34015
|
-
|
|
34016
|
-
|
|
34015
|
+
x2 += currentX;
|
|
34016
|
+
y2 += currentY;
|
|
34017
34017
|
}
|
|
34018
34018
|
commands.push({
|
|
34019
34019
|
type: "A",
|
|
@@ -34022,11 +34022,11 @@ function parseSvgPath(pathData) {
|
|
|
34022
34022
|
xAxisRotation,
|
|
34023
34023
|
largeArcFlag,
|
|
34024
34024
|
sweepFlag,
|
|
34025
|
-
x,
|
|
34026
|
-
y
|
|
34025
|
+
x: x2,
|
|
34026
|
+
y: y2
|
|
34027
34027
|
});
|
|
34028
|
-
currentX =
|
|
34029
|
-
currentY =
|
|
34028
|
+
currentX = x2;
|
|
34029
|
+
currentY = y2;
|
|
34030
34030
|
}
|
|
34031
34031
|
break;
|
|
34032
34032
|
}
|
|
@@ -34114,16 +34114,16 @@ function extractNumbers(str) {
|
|
|
34114
34114
|
function parseCoordinatePairs(args, isRelative, currentX, currentY) {
|
|
34115
34115
|
const coords = [];
|
|
34116
34116
|
for (let i = 0; i + 1 < args.length + 1; i += 2) {
|
|
34117
|
-
let
|
|
34118
|
-
let
|
|
34117
|
+
let x2 = args[i];
|
|
34118
|
+
let y2 = args[i + 1];
|
|
34119
34119
|
if (isRelative && coords.length === 0) {
|
|
34120
|
-
|
|
34121
|
-
|
|
34120
|
+
x2 += currentX;
|
|
34121
|
+
y2 += currentY;
|
|
34122
34122
|
} else if (isRelative) {
|
|
34123
|
-
|
|
34124
|
-
|
|
34123
|
+
x2 += coords[coords.length - 1].x;
|
|
34124
|
+
y2 += coords[coords.length - 1].y;
|
|
34125
34125
|
}
|
|
34126
|
-
coords.push({ x, y });
|
|
34126
|
+
coords.push({ x: x2, y: y2 });
|
|
34127
34127
|
}
|
|
34128
34128
|
return coords;
|
|
34129
34129
|
}
|
|
@@ -34204,11 +34204,11 @@ function arcSegmentToCubic(cx, cy, rx, ry, phi, theta1, theta2) {
|
|
|
34204
34204
|
const dx2 = t * y2;
|
|
34205
34205
|
const dy2 = -t * x2;
|
|
34206
34206
|
const transform2 = (px, py) => {
|
|
34207
|
-
const
|
|
34208
|
-
const
|
|
34207
|
+
const x3 = rx * px;
|
|
34208
|
+
const y3 = ry * py;
|
|
34209
34209
|
return {
|
|
34210
|
-
x: cosPhi *
|
|
34211
|
-
y: sinPhi *
|
|
34210
|
+
x: cosPhi * x3 - sinPhi * y3 + cx,
|
|
34211
|
+
y: sinPhi * x3 + cosPhi * y3 + cy
|
|
34212
34212
|
};
|
|
34213
34213
|
};
|
|
34214
34214
|
const p1 = transform2(x1, y1);
|
|
@@ -34225,15 +34225,15 @@ function arcSegmentToCubic(cx, cy, rx, ry, phi, theta1, theta2) {
|
|
|
34225
34225
|
y: p2.y
|
|
34226
34226
|
};
|
|
34227
34227
|
}
|
|
34228
|
-
function quadraticToCubic(x0, y0, qx, qy,
|
|
34228
|
+
function quadraticToCubic(x0, y0, qx, qy, x2, y2) {
|
|
34229
34229
|
return {
|
|
34230
34230
|
type: "C",
|
|
34231
34231
|
x1: x0 + 2 / 3 * (qx - x0),
|
|
34232
34232
|
y1: y0 + 2 / 3 * (qy - y0),
|
|
34233
|
-
x2:
|
|
34234
|
-
y2:
|
|
34235
|
-
x,
|
|
34236
|
-
y
|
|
34233
|
+
x2: x2 + 2 / 3 * (qx - x2),
|
|
34234
|
+
y2: y2 + 2 / 3 * (qy - y2),
|
|
34235
|
+
x: x2,
|
|
34236
|
+
y: y2
|
|
34237
34237
|
};
|
|
34238
34238
|
}
|
|
34239
34239
|
|
|
@@ -34491,22 +34491,22 @@ function generateShapePathData(shape) {
|
|
|
34491
34491
|
}
|
|
34492
34492
|
var KAPPA = 0.5522847498307936;
|
|
34493
34493
|
function generateRectanglePath(width, height, cornerRadius) {
|
|
34494
|
-
const
|
|
34495
|
-
const
|
|
34494
|
+
const x2 = -width / 2;
|
|
34495
|
+
const y2 = -height / 2;
|
|
34496
34496
|
const r = Math.min(cornerRadius, width / 2, height / 2);
|
|
34497
34497
|
if (r === 0) {
|
|
34498
|
-
return `M ${
|
|
34498
|
+
return `M ${x2} ${y2} L ${x2 + width} ${y2} L ${x2 + width} ${y2 + height} L ${x2} ${y2 + height} Z`;
|
|
34499
34499
|
}
|
|
34500
34500
|
return [
|
|
34501
|
-
`M ${
|
|
34502
|
-
`L ${
|
|
34503
|
-
`Q ${
|
|
34504
|
-
`L ${
|
|
34505
|
-
`Q ${
|
|
34506
|
-
`L ${
|
|
34507
|
-
`Q ${
|
|
34508
|
-
`L ${
|
|
34509
|
-
`Q ${
|
|
34501
|
+
`M ${x2 + r} ${y2}`,
|
|
34502
|
+
`L ${x2 + width - r} ${y2}`,
|
|
34503
|
+
`Q ${x2 + width} ${y2} ${x2 + width} ${y2 + r}`,
|
|
34504
|
+
`L ${x2 + width} ${y2 + height - r}`,
|
|
34505
|
+
`Q ${x2 + width} ${y2 + height} ${x2 + width - r} ${y2 + height}`,
|
|
34506
|
+
`L ${x2 + r} ${y2 + height}`,
|
|
34507
|
+
`Q ${x2} ${y2 + height} ${x2} ${y2 + height - r}`,
|
|
34508
|
+
`L ${x2} ${y2 + r}`,
|
|
34509
|
+
`Q ${x2} ${y2} ${x2 + r} ${y2}`,
|
|
34510
34510
|
"Z"
|
|
34511
34511
|
].join(" ");
|
|
34512
34512
|
}
|
|
@@ -34555,9 +34555,9 @@ function generatePolygonPath(sides, radius) {
|
|
|
34555
34555
|
const points = [];
|
|
34556
34556
|
for (let i = 0; i < sides; i++) {
|
|
34557
34557
|
const angle = startAngle + i * angleStep;
|
|
34558
|
-
const
|
|
34559
|
-
const
|
|
34560
|
-
points.push(i === 0 ? `M ${
|
|
34558
|
+
const x2 = Math.cos(angle) * radius;
|
|
34559
|
+
const y2 = Math.sin(angle) * radius;
|
|
34560
|
+
points.push(i === 0 ? `M ${x2} ${y2}` : `L ${x2} ${y2}`);
|
|
34561
34561
|
}
|
|
34562
34562
|
points.push("Z");
|
|
34563
34563
|
return points.join(" ");
|
|
@@ -34569,9 +34569,9 @@ function generateStarPath(points, outerRadius, innerRadius) {
|
|
|
34569
34569
|
for (let i = 0; i < points * 2; i++) {
|
|
34570
34570
|
const angle = startAngle + i * angleStep;
|
|
34571
34571
|
const radius = i % 2 === 0 ? outerRadius : innerRadius;
|
|
34572
|
-
const
|
|
34573
|
-
const
|
|
34574
|
-
pathParts.push(i === 0 ? `M ${
|
|
34572
|
+
const x2 = Math.cos(angle) * radius;
|
|
34573
|
+
const y2 = Math.sin(angle) * radius;
|
|
34574
|
+
pathParts.push(i === 0 ? `M ${x2} ${y2}` : `L ${x2} ${y2}`);
|
|
34575
34575
|
}
|
|
34576
34576
|
pathParts.push("Z");
|
|
34577
34577
|
return pathParts.join(" ");
|
|
@@ -34713,15 +34713,15 @@ function computeSimplePathBounds(d) {
|
|
|
34713
34713
|
case "C":
|
|
34714
34714
|
if (numIndex + 5 < numbers.length) {
|
|
34715
34715
|
for (let j = 0; j < 3; j++) {
|
|
34716
|
-
const
|
|
34717
|
-
const
|
|
34718
|
-
minX = Math.min(minX,
|
|
34719
|
-
maxX = Math.max(maxX,
|
|
34720
|
-
minY = Math.min(minY,
|
|
34721
|
-
maxY = Math.max(maxY,
|
|
34716
|
+
const x2 = numbers[numIndex++];
|
|
34717
|
+
const y2 = numbers[numIndex++];
|
|
34718
|
+
minX = Math.min(minX, x2);
|
|
34719
|
+
maxX = Math.max(maxX, x2);
|
|
34720
|
+
minY = Math.min(minY, y2);
|
|
34721
|
+
maxY = Math.max(maxY, y2);
|
|
34722
34722
|
if (j === 2) {
|
|
34723
|
-
currentX =
|
|
34724
|
-
currentY =
|
|
34723
|
+
currentX = x2;
|
|
34724
|
+
currentY = y2;
|
|
34725
34725
|
}
|
|
34726
34726
|
}
|
|
34727
34727
|
}
|
|
@@ -34729,15 +34729,15 @@ function computeSimplePathBounds(d) {
|
|
|
34729
34729
|
case "c":
|
|
34730
34730
|
if (numIndex + 5 < numbers.length) {
|
|
34731
34731
|
for (let j = 0; j < 3; j++) {
|
|
34732
|
-
const
|
|
34733
|
-
const
|
|
34734
|
-
minX = Math.min(minX,
|
|
34735
|
-
maxX = Math.max(maxX,
|
|
34736
|
-
minY = Math.min(minY,
|
|
34737
|
-
maxY = Math.max(maxY,
|
|
34732
|
+
const x2 = currentX + numbers[numIndex++];
|
|
34733
|
+
const y2 = currentY + numbers[numIndex++];
|
|
34734
|
+
minX = Math.min(minX, x2);
|
|
34735
|
+
maxX = Math.max(maxX, x2);
|
|
34736
|
+
minY = Math.min(minY, y2);
|
|
34737
|
+
maxY = Math.max(maxY, y2);
|
|
34738
34738
|
if (j === 2) {
|
|
34739
|
-
currentX =
|
|
34740
|
-
currentY =
|
|
34739
|
+
currentX = x2;
|
|
34740
|
+
currentY = y2;
|
|
34741
34741
|
}
|
|
34742
34742
|
}
|
|
34743
34743
|
}
|
|
@@ -34746,15 +34746,15 @@ function computeSimplePathBounds(d) {
|
|
|
34746
34746
|
case "Q":
|
|
34747
34747
|
if (numIndex + 3 < numbers.length) {
|
|
34748
34748
|
for (let j = 0; j < 2; j++) {
|
|
34749
|
-
const
|
|
34750
|
-
const
|
|
34751
|
-
minX = Math.min(minX,
|
|
34752
|
-
maxX = Math.max(maxX,
|
|
34753
|
-
minY = Math.min(minY,
|
|
34754
|
-
maxY = Math.max(maxY,
|
|
34749
|
+
const x2 = numbers[numIndex++];
|
|
34750
|
+
const y2 = numbers[numIndex++];
|
|
34751
|
+
minX = Math.min(minX, x2);
|
|
34752
|
+
maxX = Math.max(maxX, x2);
|
|
34753
|
+
minY = Math.min(minY, y2);
|
|
34754
|
+
maxY = Math.max(maxY, y2);
|
|
34755
34755
|
if (j === 1) {
|
|
34756
|
-
currentX =
|
|
34757
|
-
currentY =
|
|
34756
|
+
currentX = x2;
|
|
34757
|
+
currentY = y2;
|
|
34758
34758
|
}
|
|
34759
34759
|
}
|
|
34760
34760
|
}
|
|
@@ -34763,15 +34763,15 @@ function computeSimplePathBounds(d) {
|
|
|
34763
34763
|
case "q":
|
|
34764
34764
|
if (numIndex + 3 < numbers.length) {
|
|
34765
34765
|
for (let j = 0; j < 2; j++) {
|
|
34766
|
-
const
|
|
34767
|
-
const
|
|
34768
|
-
minX = Math.min(minX,
|
|
34769
|
-
maxX = Math.max(maxX,
|
|
34770
|
-
minY = Math.min(minY,
|
|
34771
|
-
maxY = Math.max(maxY,
|
|
34766
|
+
const x2 = currentX + numbers[numIndex++];
|
|
34767
|
+
const y2 = currentY + numbers[numIndex++];
|
|
34768
|
+
minX = Math.min(minX, x2);
|
|
34769
|
+
maxX = Math.max(maxX, x2);
|
|
34770
|
+
minY = Math.min(minY, y2);
|
|
34771
|
+
maxY = Math.max(maxY, y2);
|
|
34772
34772
|
if (j === 1) {
|
|
34773
|
-
currentX =
|
|
34774
|
-
currentY =
|
|
34773
|
+
currentX = x2;
|
|
34774
|
+
currentY = y2;
|
|
34775
34775
|
}
|
|
34776
34776
|
}
|
|
34777
34777
|
}
|
|
@@ -34856,1495 +34856,564 @@ function extractSvgDimensions(svgString) {
|
|
|
34856
34856
|
return { width, height };
|
|
34857
34857
|
}
|
|
34858
34858
|
|
|
34859
|
-
// node_modules/.pnpm/lru-cache@11.2.
|
|
34860
|
-
var
|
|
34861
|
-
var
|
|
34862
|
-
var
|
|
34863
|
-
var
|
|
34864
|
-
typeof
|
|
34865
|
-
};
|
|
34866
|
-
var
|
|
34867
|
-
var
|
|
34868
|
-
if (typeof
|
|
34869
|
-
|
|
34859
|
+
// node_modules/.pnpm/lru-cache@11.2.6/node_modules/lru-cache/dist/esm/index.min.js
|
|
34860
|
+
var M = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
|
|
34861
|
+
var I = /* @__PURE__ */ new Set();
|
|
34862
|
+
var R = typeof process == "object" && process ? process : {};
|
|
34863
|
+
var x = (a, t, e, i) => {
|
|
34864
|
+
typeof R.emitWarning == "function" ? R.emitWarning(a, t, e, i) : console.error(`[${e}] ${t}: ${a}`);
|
|
34865
|
+
};
|
|
34866
|
+
var C = globalThis.AbortController;
|
|
34867
|
+
var D = globalThis.AbortSignal;
|
|
34868
|
+
if (typeof C > "u") {
|
|
34869
|
+
D = class {
|
|
34870
34870
|
constructor() {
|
|
34871
34871
|
__publicField(this, "onabort");
|
|
34872
34872
|
__publicField(this, "_onabort", []);
|
|
34873
34873
|
__publicField(this, "reason");
|
|
34874
34874
|
__publicField(this, "aborted", false);
|
|
34875
34875
|
}
|
|
34876
|
-
addEventListener(
|
|
34877
|
-
this._onabort.push(
|
|
34876
|
+
addEventListener(i, s) {
|
|
34877
|
+
this._onabort.push(s);
|
|
34878
34878
|
}
|
|
34879
|
-
}
|
|
34880
|
-
AC = class AbortController {
|
|
34879
|
+
}, C = class {
|
|
34881
34880
|
constructor() {
|
|
34882
|
-
__publicField(this, "signal", new
|
|
34883
|
-
|
|
34881
|
+
__publicField(this, "signal", new D());
|
|
34882
|
+
t();
|
|
34884
34883
|
}
|
|
34885
|
-
abort(
|
|
34886
|
-
if (this.signal.aborted)
|
|
34887
|
-
|
|
34888
|
-
|
|
34889
|
-
|
|
34890
|
-
for (const fn of this.signal._onabort) {
|
|
34891
|
-
fn(reason);
|
|
34884
|
+
abort(i) {
|
|
34885
|
+
if (!this.signal.aborted) {
|
|
34886
|
+
this.signal.reason = i, this.signal.aborted = true;
|
|
34887
|
+
for (let s of this.signal._onabort) s(i);
|
|
34888
|
+
this.signal.onabort?.(i);
|
|
34892
34889
|
}
|
|
34893
|
-
this.signal.onabort?.(reason);
|
|
34894
34890
|
}
|
|
34895
34891
|
};
|
|
34896
|
-
let
|
|
34897
|
-
|
|
34898
|
-
if (!printACPolyfillWarning)
|
|
34899
|
-
return;
|
|
34900
|
-
printACPolyfillWarning = false;
|
|
34901
|
-
emitWarning("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", warnACPolyfill);
|
|
34892
|
+
let a = R.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1", t = () => {
|
|
34893
|
+
a && (a = false, x("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));
|
|
34902
34894
|
};
|
|
34903
34895
|
}
|
|
34904
|
-
var
|
|
34905
|
-
var
|
|
34906
|
-
var
|
|
34907
|
-
var
|
|
34908
|
-
constructor(
|
|
34909
|
-
super(
|
|
34910
|
-
this.fill(0);
|
|
34896
|
+
var G = (a) => !I.has(a);
|
|
34897
|
+
var y = (a) => a && a === Math.floor(a) && a > 0 && isFinite(a);
|
|
34898
|
+
var U = (a) => y(a) ? a <= Math.pow(2, 8) ? Uint8Array : a <= Math.pow(2, 16) ? Uint16Array : a <= Math.pow(2, 32) ? Uint32Array : a <= Number.MAX_SAFE_INTEGER ? z2 : null : null;
|
|
34899
|
+
var z2 = class extends Array {
|
|
34900
|
+
constructor(t) {
|
|
34901
|
+
super(t), this.fill(0);
|
|
34911
34902
|
}
|
|
34912
34903
|
};
|
|
34913
|
-
var
|
|
34914
|
-
var
|
|
34915
|
-
constructor(
|
|
34904
|
+
var _a2, _o;
|
|
34905
|
+
var W = (_a2 = class {
|
|
34906
|
+
constructor(t, e) {
|
|
34916
34907
|
__publicField(this, "heap");
|
|
34917
34908
|
__publicField(this, "length");
|
|
34918
|
-
if (!__privateGet(
|
|
34919
|
-
|
|
34920
|
-
}
|
|
34921
|
-
this.heap = new HeapCls(max);
|
|
34922
|
-
this.length = 0;
|
|
34909
|
+
if (!__privateGet(_a2, _o)) throw new TypeError("instantiate Stack using Stack.create(n)");
|
|
34910
|
+
this.heap = new e(t), this.length = 0;
|
|
34923
34911
|
}
|
|
34924
|
-
static create(
|
|
34925
|
-
|
|
34926
|
-
if (!
|
|
34927
|
-
|
|
34928
|
-
|
|
34929
|
-
|
|
34930
|
-
__privateSet(_Stack, _constructing, false);
|
|
34931
|
-
return s;
|
|
34912
|
+
static create(t) {
|
|
34913
|
+
let e = U(t);
|
|
34914
|
+
if (!e) return [];
|
|
34915
|
+
__privateSet(_a2, _o, true);
|
|
34916
|
+
let i = new _a2(t, e);
|
|
34917
|
+
return __privateSet(_a2, _o, false), i;
|
|
34932
34918
|
}
|
|
34933
|
-
push(
|
|
34934
|
-
this.heap[this.length++] =
|
|
34919
|
+
push(t) {
|
|
34920
|
+
this.heap[this.length++] = t;
|
|
34935
34921
|
}
|
|
34936
34922
|
pop() {
|
|
34937
34923
|
return this.heap[--this.length];
|
|
34938
34924
|
}
|
|
34939
|
-
};
|
|
34940
|
-
|
|
34941
|
-
|
|
34942
|
-
|
|
34943
|
-
|
|
34944
|
-
|
|
34945
|
-
|
|
34946
|
-
|
|
34947
|
-
__privateAdd(this,
|
|
34948
|
-
|
|
34949
|
-
__privateAdd(this,
|
|
34950
|
-
__privateAdd(this,
|
|
34951
|
-
__privateAdd(this,
|
|
34952
|
-
__privateAdd(this, _onInsert);
|
|
34953
|
-
__privateAdd(this, _disposeAfter);
|
|
34954
|
-
__privateAdd(this, _fetchMethod);
|
|
34955
|
-
__privateAdd(this, _memoMethod);
|
|
34956
|
-
__privateAdd(this, _perf);
|
|
34957
|
-
/**
|
|
34958
|
-
* {@link LRUCache.OptionsBase.ttl}
|
|
34959
|
-
*/
|
|
34925
|
+
}, _o = new WeakMap(), __privateAdd(_a2, _o, false), _a2);
|
|
34926
|
+
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, _x, _a_instances, j_fn, _R, _z, _N, _p, B_fn, _W, _U, _P, F_fn, O_fn, H_fn, M_fn, G_fn, e_fn, k_fn, D_fn, E_fn, V_fn, _c;
|
|
34927
|
+
var L = (_c = class {
|
|
34928
|
+
constructor(t) {
|
|
34929
|
+
__privateAdd(this, _a_instances);
|
|
34930
|
+
__privateAdd(this, _o2);
|
|
34931
|
+
__privateAdd(this, _c2);
|
|
34932
|
+
__privateAdd(this, _w);
|
|
34933
|
+
__privateAdd(this, _C);
|
|
34934
|
+
__privateAdd(this, _S);
|
|
34935
|
+
__privateAdd(this, _L);
|
|
34936
|
+
__privateAdd(this, _I);
|
|
34937
|
+
__privateAdd(this, _m);
|
|
34960
34938
|
__publicField(this, "ttl");
|
|
34961
|
-
/**
|
|
34962
|
-
* {@link LRUCache.OptionsBase.ttlResolution}
|
|
34963
|
-
*/
|
|
34964
34939
|
__publicField(this, "ttlResolution");
|
|
34965
|
-
/**
|
|
34966
|
-
* {@link LRUCache.OptionsBase.ttlAutopurge}
|
|
34967
|
-
*/
|
|
34968
34940
|
__publicField(this, "ttlAutopurge");
|
|
34969
|
-
/**
|
|
34970
|
-
* {@link LRUCache.OptionsBase.updateAgeOnGet}
|
|
34971
|
-
*/
|
|
34972
34941
|
__publicField(this, "updateAgeOnGet");
|
|
34973
|
-
/**
|
|
34974
|
-
* {@link LRUCache.OptionsBase.updateAgeOnHas}
|
|
34975
|
-
*/
|
|
34976
34942
|
__publicField(this, "updateAgeOnHas");
|
|
34977
|
-
/**
|
|
34978
|
-
* {@link LRUCache.OptionsBase.allowStale}
|
|
34979
|
-
*/
|
|
34980
34943
|
__publicField(this, "allowStale");
|
|
34981
|
-
/**
|
|
34982
|
-
* {@link LRUCache.OptionsBase.noDisposeOnSet}
|
|
34983
|
-
*/
|
|
34984
34944
|
__publicField(this, "noDisposeOnSet");
|
|
34985
|
-
/**
|
|
34986
|
-
* {@link LRUCache.OptionsBase.noUpdateTTL}
|
|
34987
|
-
*/
|
|
34988
34945
|
__publicField(this, "noUpdateTTL");
|
|
34989
|
-
/**
|
|
34990
|
-
* {@link LRUCache.OptionsBase.maxEntrySize}
|
|
34991
|
-
*/
|
|
34992
34946
|
__publicField(this, "maxEntrySize");
|
|
34993
|
-
/**
|
|
34994
|
-
* {@link LRUCache.OptionsBase.sizeCalculation}
|
|
34995
|
-
*/
|
|
34996
34947
|
__publicField(this, "sizeCalculation");
|
|
34997
|
-
/**
|
|
34998
|
-
* {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}
|
|
34999
|
-
*/
|
|
35000
34948
|
__publicField(this, "noDeleteOnFetchRejection");
|
|
35001
|
-
/**
|
|
35002
|
-
* {@link LRUCache.OptionsBase.noDeleteOnStaleGet}
|
|
35003
|
-
*/
|
|
35004
34949
|
__publicField(this, "noDeleteOnStaleGet");
|
|
35005
|
-
/**
|
|
35006
|
-
* {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}
|
|
35007
|
-
*/
|
|
35008
34950
|
__publicField(this, "allowStaleOnFetchAbort");
|
|
35009
|
-
/**
|
|
35010
|
-
* {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}
|
|
35011
|
-
*/
|
|
35012
34951
|
__publicField(this, "allowStaleOnFetchRejection");
|
|
35013
|
-
/**
|
|
35014
|
-
* {@link LRUCache.OptionsBase.ignoreFetchAbort}
|
|
35015
|
-
*/
|
|
35016
34952
|
__publicField(this, "ignoreFetchAbort");
|
|
35017
|
-
|
|
35018
|
-
__privateAdd(this,
|
|
35019
|
-
__privateAdd(this,
|
|
35020
|
-
__privateAdd(this,
|
|
35021
|
-
__privateAdd(this,
|
|
35022
|
-
__privateAdd(this,
|
|
35023
|
-
__privateAdd(this,
|
|
35024
|
-
__privateAdd(this,
|
|
35025
|
-
__privateAdd(this,
|
|
35026
|
-
__privateAdd(this,
|
|
35027
|
-
__privateAdd(this,
|
|
35028
|
-
__privateAdd(this,
|
|
35029
|
-
__privateAdd(this,
|
|
35030
|
-
__privateAdd(this,
|
|
35031
|
-
__privateAdd(this,
|
|
35032
|
-
__privateAdd(this,
|
|
35033
|
-
__privateAdd(this,
|
|
35034
|
-
__privateAdd(this,
|
|
35035
|
-
__privateAdd(this,
|
|
35036
|
-
__privateAdd(this,
|
|
35037
|
-
// conditionally set private methods related to TTL
|
|
35038
|
-
__privateAdd(this, _updateItemAge, () => {
|
|
34953
|
+
__privateAdd(this, _n);
|
|
34954
|
+
__privateAdd(this, __);
|
|
34955
|
+
__privateAdd(this, _s);
|
|
34956
|
+
__privateAdd(this, _i);
|
|
34957
|
+
__privateAdd(this, _t);
|
|
34958
|
+
__privateAdd(this, _a4);
|
|
34959
|
+
__privateAdd(this, _u);
|
|
34960
|
+
__privateAdd(this, _l);
|
|
34961
|
+
__privateAdd(this, _h);
|
|
34962
|
+
__privateAdd(this, _b2);
|
|
34963
|
+
__privateAdd(this, _r);
|
|
34964
|
+
__privateAdd(this, _y);
|
|
34965
|
+
__privateAdd(this, _A);
|
|
34966
|
+
__privateAdd(this, _d);
|
|
34967
|
+
__privateAdd(this, _g);
|
|
34968
|
+
__privateAdd(this, _T);
|
|
34969
|
+
__privateAdd(this, _v);
|
|
34970
|
+
__privateAdd(this, _f);
|
|
34971
|
+
__privateAdd(this, _x);
|
|
34972
|
+
__privateAdd(this, _R, () => {
|
|
35039
34973
|
});
|
|
35040
|
-
__privateAdd(this,
|
|
34974
|
+
__privateAdd(this, _z, () => {
|
|
35041
34975
|
});
|
|
35042
|
-
__privateAdd(this,
|
|
34976
|
+
__privateAdd(this, _N, () => {
|
|
35043
34977
|
});
|
|
35044
|
-
|
|
35045
|
-
__privateAdd(this,
|
|
35046
|
-
__privateAdd(this, _removeItemSize, (_i) => {
|
|
34978
|
+
__privateAdd(this, _p, () => false);
|
|
34979
|
+
__privateAdd(this, _W, (t) => {
|
|
35047
34980
|
});
|
|
35048
|
-
__privateAdd(this,
|
|
34981
|
+
__privateAdd(this, _U, (t, e, i) => {
|
|
35049
34982
|
});
|
|
35050
|
-
__privateAdd(this,
|
|
35051
|
-
if (
|
|
35052
|
-
throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
35053
|
-
}
|
|
34983
|
+
__privateAdd(this, _P, (t, e, i, s) => {
|
|
34984
|
+
if (i || s) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
35054
34985
|
return 0;
|
|
35055
34986
|
});
|
|
35056
|
-
|
|
35057
|
-
|
|
35058
|
-
|
|
35059
|
-
|
|
35060
|
-
|
|
35061
|
-
|
|
35062
|
-
|
|
35063
|
-
|
|
35064
|
-
if (typeof
|
|
35065
|
-
|
|
35066
|
-
|
|
35067
|
-
|
|
35068
|
-
__privateSet(this,
|
|
35069
|
-
|
|
35070
|
-
throw new TypeError("
|
|
35071
|
-
|
|
35072
|
-
|
|
35073
|
-
if (
|
|
35074
|
-
throw new
|
|
35075
|
-
|
|
35076
|
-
|
|
35077
|
-
|
|
35078
|
-
this.
|
|
35079
|
-
|
|
35080
|
-
|
|
35081
|
-
if (!__privateGet(this, _maxSize2) && !this.maxEntrySize) {
|
|
35082
|
-
throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
35083
|
-
}
|
|
35084
|
-
if (typeof this.sizeCalculation !== "function") {
|
|
35085
|
-
throw new TypeError("sizeCalculation set to non-function");
|
|
35086
|
-
}
|
|
35087
|
-
}
|
|
35088
|
-
if (memoMethod !== void 0 && typeof memoMethod !== "function") {
|
|
35089
|
-
throw new TypeError("memoMethod must be a function if defined");
|
|
35090
|
-
}
|
|
35091
|
-
__privateSet(this, _memoMethod, memoMethod);
|
|
35092
|
-
if (fetchMethod !== void 0 && typeof fetchMethod !== "function") {
|
|
35093
|
-
throw new TypeError("fetchMethod must be a function if specified");
|
|
35094
|
-
}
|
|
35095
|
-
__privateSet(this, _fetchMethod, fetchMethod);
|
|
35096
|
-
__privateSet(this, _hasFetchMethod, !!fetchMethod);
|
|
35097
|
-
__privateSet(this, _keyMap, /* @__PURE__ */ new Map());
|
|
35098
|
-
__privateSet(this, _keyList, new Array(max).fill(void 0));
|
|
35099
|
-
__privateSet(this, _valList, new Array(max).fill(void 0));
|
|
35100
|
-
__privateSet(this, _next, new UintArray(max));
|
|
35101
|
-
__privateSet(this, _prev, new UintArray(max));
|
|
35102
|
-
__privateSet(this, _head, 0);
|
|
35103
|
-
__privateSet(this, _tail, 0);
|
|
35104
|
-
__privateSet(this, _free, Stack.create(max));
|
|
35105
|
-
__privateSet(this, _size2, 0);
|
|
35106
|
-
__privateSet(this, _calculatedSize, 0);
|
|
35107
|
-
if (typeof dispose === "function") {
|
|
35108
|
-
__privateSet(this, _dispose, dispose);
|
|
35109
|
-
}
|
|
35110
|
-
if (typeof onInsert === "function") {
|
|
35111
|
-
__privateSet(this, _onInsert, onInsert);
|
|
35112
|
-
}
|
|
35113
|
-
if (typeof disposeAfter === "function") {
|
|
35114
|
-
__privateSet(this, _disposeAfter, disposeAfter);
|
|
35115
|
-
__privateSet(this, _disposed, []);
|
|
35116
|
-
} else {
|
|
35117
|
-
__privateSet(this, _disposeAfter, void 0);
|
|
35118
|
-
__privateSet(this, _disposed, void 0);
|
|
35119
|
-
}
|
|
35120
|
-
__privateSet(this, _hasDispose, !!__privateGet(this, _dispose));
|
|
35121
|
-
__privateSet(this, _hasOnInsert, !!__privateGet(this, _onInsert));
|
|
35122
|
-
__privateSet(this, _hasDisposeAfter, !!__privateGet(this, _disposeAfter));
|
|
35123
|
-
this.noDisposeOnSet = !!noDisposeOnSet;
|
|
35124
|
-
this.noUpdateTTL = !!noUpdateTTL;
|
|
35125
|
-
this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;
|
|
35126
|
-
this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;
|
|
35127
|
-
this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;
|
|
35128
|
-
this.ignoreFetchAbort = !!ignoreFetchAbort;
|
|
35129
|
-
if (this.maxEntrySize !== 0) {
|
|
35130
|
-
if (__privateGet(this, _maxSize2) !== 0) {
|
|
35131
|
-
if (!isPosInt(__privateGet(this, _maxSize2))) {
|
|
35132
|
-
throw new TypeError("maxSize must be a positive integer if specified");
|
|
35133
|
-
}
|
|
35134
|
-
}
|
|
35135
|
-
if (!isPosInt(this.maxEntrySize)) {
|
|
35136
|
-
throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
35137
|
-
}
|
|
35138
|
-
__privateMethod(this, _LRUCache_instances, initializeSizeTracking_fn).call(this);
|
|
35139
|
-
}
|
|
35140
|
-
this.allowStale = !!allowStale;
|
|
35141
|
-
this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;
|
|
35142
|
-
this.updateAgeOnGet = !!updateAgeOnGet;
|
|
35143
|
-
this.updateAgeOnHas = !!updateAgeOnHas;
|
|
35144
|
-
this.ttlResolution = isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1;
|
|
35145
|
-
this.ttlAutopurge = !!ttlAutopurge;
|
|
35146
|
-
this.ttl = ttl || 0;
|
|
35147
|
-
if (this.ttl) {
|
|
35148
|
-
if (!isPosInt(this.ttl)) {
|
|
35149
|
-
throw new TypeError("ttl must be a positive integer if specified");
|
|
35150
|
-
}
|
|
35151
|
-
__privateMethod(this, _LRUCache_instances, initializeTTLTracking_fn).call(this);
|
|
35152
|
-
}
|
|
35153
|
-
if (__privateGet(this, _max) === 0 && this.ttl === 0 && __privateGet(this, _maxSize2) === 0) {
|
|
35154
|
-
throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
35155
|
-
}
|
|
35156
|
-
if (!this.ttlAutopurge && !__privateGet(this, _max) && !__privateGet(this, _maxSize2)) {
|
|
35157
|
-
const code = "LRU_CACHE_UNBOUNDED";
|
|
35158
|
-
if (shouldWarn(code)) {
|
|
35159
|
-
warned.add(code);
|
|
35160
|
-
const msg = "TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.";
|
|
35161
|
-
emitWarning(msg, "UnboundedCacheWarning", code, _LRUCache);
|
|
35162
|
-
}
|
|
34987
|
+
__publicField(this, _a3, "LRUCache");
|
|
34988
|
+
let { max: e = 0, ttl: i, ttlResolution: s = 1, ttlAutopurge: h, updateAgeOnGet: n, updateAgeOnHas: o, allowStale: r, dispose: f, onInsert: m, disposeAfter: c, noDisposeOnSet: d, noUpdateTTL: g, maxSize: A = 0, maxEntrySize: p = 0, sizeCalculation: _, fetchMethod: l, memoMethod: w, noDeleteOnFetchRejection: b, noDeleteOnStaleGet: S, allowStaleOnFetchRejection: u, allowStaleOnFetchAbort: T, ignoreFetchAbort: F, perf: v } = t;
|
|
34989
|
+
if (v !== void 0 && typeof v?.now != "function") throw new TypeError("perf option must have a now() method if specified");
|
|
34990
|
+
if (__privateSet(this, _m, v ?? M), e !== 0 && !y(e)) throw new TypeError("max option must be a nonnegative integer");
|
|
34991
|
+
let O = e ? U(e) : Array;
|
|
34992
|
+
if (!O) throw new Error("invalid max value: " + e);
|
|
34993
|
+
if (__privateSet(this, _o2, e), __privateSet(this, _c2, A), this.maxEntrySize = p || __privateGet(this, _c2), this.sizeCalculation = _, this.sizeCalculation) {
|
|
34994
|
+
if (!__privateGet(this, _c2) && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
34995
|
+
if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
|
|
34996
|
+
}
|
|
34997
|
+
if (w !== void 0 && typeof w != "function") throw new TypeError("memoMethod must be a function if defined");
|
|
34998
|
+
if (__privateSet(this, _I, w), l !== void 0 && typeof l != "function") throw new TypeError("fetchMethod must be a function if specified");
|
|
34999
|
+
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 f == "function" && __privateSet(this, _w, f), typeof m == "function" && __privateSet(this, _C, m), typeof c == "function" ? (__privateSet(this, _S, c), __privateSet(this, _r, [])) : (__privateSet(this, _S, void 0), __privateSet(this, _r, void 0)), __privateSet(this, _T, !!__privateGet(this, _w)), __privateSet(this, _x, !!__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) {
|
|
35000
|
+
if (__privateGet(this, _c2) !== 0 && !y(__privateGet(this, _c2))) throw new TypeError("maxSize must be a positive integer if specified");
|
|
35001
|
+
if (!y(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
35002
|
+
__privateMethod(this, _a_instances, B_fn).call(this);
|
|
35003
|
+
}
|
|
35004
|
+
if (this.allowStale = !!r, this.noDeleteOnStaleGet = !!S, this.updateAgeOnGet = !!n, this.updateAgeOnHas = !!o, this.ttlResolution = y(s) || s === 0 ? s : 1, this.ttlAutopurge = !!h, this.ttl = i || 0, this.ttl) {
|
|
35005
|
+
if (!y(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
|
|
35006
|
+
__privateMethod(this, _a_instances, j_fn).call(this);
|
|
35007
|
+
}
|
|
35008
|
+
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");
|
|
35009
|
+
if (!this.ttlAutopurge && !__privateGet(this, _o2) && !__privateGet(this, _c2)) {
|
|
35010
|
+
let E = "LRU_CACHE_UNBOUNDED";
|
|
35011
|
+
G(E) && (I.add(E), x("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", E, _c));
|
|
35163
35012
|
}
|
|
35164
35013
|
}
|
|
35165
|
-
/**
|
|
35166
|
-
* {@link LRUCache.OptionsBase.perf}
|
|
35167
|
-
*/
|
|
35168
35014
|
get perf() {
|
|
35169
|
-
return __privateGet(this,
|
|
35015
|
+
return __privateGet(this, _m);
|
|
35016
|
+
}
|
|
35017
|
+
static unsafeExposeInternals(t) {
|
|
35018
|
+
return { starts: __privateGet(t, _A), ttls: __privateGet(t, _d), autopurgeTimers: __privateGet(t, _g), sizes: __privateGet(t, _y), keyMap: __privateGet(t, _s), keyList: __privateGet(t, _i), valList: __privateGet(t, _t), next: __privateGet(t, _a4), prev: __privateGet(t, _u), get head() {
|
|
35019
|
+
return __privateGet(t, _l);
|
|
35020
|
+
}, get tail() {
|
|
35021
|
+
return __privateGet(t, _h);
|
|
35022
|
+
}, free: __privateGet(t, _b2), isBackgroundFetch: (e) => {
|
|
35023
|
+
var _a5;
|
|
35024
|
+
return __privateMethod(_a5 = t, _a_instances, e_fn).call(_a5, e);
|
|
35025
|
+
}, backgroundFetch: (e, i, s, h) => {
|
|
35026
|
+
var _a5;
|
|
35027
|
+
return __privateMethod(_a5 = t, _a_instances, G_fn).call(_a5, e, i, s, h);
|
|
35028
|
+
}, moveToTail: (e) => {
|
|
35029
|
+
var _a5;
|
|
35030
|
+
return __privateMethod(_a5 = t, _a_instances, D_fn).call(_a5, e);
|
|
35031
|
+
}, indexes: (e) => {
|
|
35032
|
+
var _a5;
|
|
35033
|
+
return __privateMethod(_a5 = t, _a_instances, F_fn).call(_a5, e);
|
|
35034
|
+
}, rindexes: (e) => {
|
|
35035
|
+
var _a5;
|
|
35036
|
+
return __privateMethod(_a5 = t, _a_instances, O_fn).call(_a5, e);
|
|
35037
|
+
}, isStale: (e) => {
|
|
35038
|
+
var _a5;
|
|
35039
|
+
return __privateGet(_a5 = t, _p).call(_a5, e);
|
|
35040
|
+
} };
|
|
35170
35041
|
}
|
|
35171
|
-
/**
|
|
35172
|
-
* Do not call this method unless you need to inspect the
|
|
35173
|
-
* inner workings of the cache. If anything returned by this
|
|
35174
|
-
* object is modified in any way, strange breakage may occur.
|
|
35175
|
-
*
|
|
35176
|
-
* These fields are private for a reason!
|
|
35177
|
-
*
|
|
35178
|
-
* @internal
|
|
35179
|
-
*/
|
|
35180
|
-
static unsafeExposeInternals(c) {
|
|
35181
|
-
return {
|
|
35182
|
-
// properties
|
|
35183
|
-
starts: __privateGet(c, _starts),
|
|
35184
|
-
ttls: __privateGet(c, _ttls),
|
|
35185
|
-
autopurgeTimers: __privateGet(c, _autopurgeTimers),
|
|
35186
|
-
sizes: __privateGet(c, _sizes),
|
|
35187
|
-
keyMap: __privateGet(c, _keyMap),
|
|
35188
|
-
keyList: __privateGet(c, _keyList),
|
|
35189
|
-
valList: __privateGet(c, _valList),
|
|
35190
|
-
next: __privateGet(c, _next),
|
|
35191
|
-
prev: __privateGet(c, _prev),
|
|
35192
|
-
get head() {
|
|
35193
|
-
return __privateGet(c, _head);
|
|
35194
|
-
},
|
|
35195
|
-
get tail() {
|
|
35196
|
-
return __privateGet(c, _tail);
|
|
35197
|
-
},
|
|
35198
|
-
free: __privateGet(c, _free),
|
|
35199
|
-
// methods
|
|
35200
|
-
isBackgroundFetch: (p) => {
|
|
35201
|
-
var _a3;
|
|
35202
|
-
return __privateMethod(_a3 = c, _LRUCache_instances, isBackgroundFetch_fn).call(_a3, p);
|
|
35203
|
-
},
|
|
35204
|
-
backgroundFetch: (k, index, options, context) => {
|
|
35205
|
-
var _a3;
|
|
35206
|
-
return __privateMethod(_a3 = c, _LRUCache_instances, backgroundFetch_fn).call(_a3, k, index, options, context);
|
|
35207
|
-
},
|
|
35208
|
-
moveToTail: (index) => {
|
|
35209
|
-
var _a3;
|
|
35210
|
-
return __privateMethod(_a3 = c, _LRUCache_instances, moveToTail_fn).call(_a3, index);
|
|
35211
|
-
},
|
|
35212
|
-
indexes: (options) => {
|
|
35213
|
-
var _a3;
|
|
35214
|
-
return __privateMethod(_a3 = c, _LRUCache_instances, indexes_fn).call(_a3, options);
|
|
35215
|
-
},
|
|
35216
|
-
rindexes: (options) => {
|
|
35217
|
-
var _a3;
|
|
35218
|
-
return __privateMethod(_a3 = c, _LRUCache_instances, rindexes_fn).call(_a3, options);
|
|
35219
|
-
},
|
|
35220
|
-
isStale: (index) => {
|
|
35221
|
-
var _a3;
|
|
35222
|
-
return __privateGet(_a3 = c, _isStale).call(_a3, index);
|
|
35223
|
-
}
|
|
35224
|
-
};
|
|
35225
|
-
}
|
|
35226
|
-
// Protected read-only members
|
|
35227
|
-
/**
|
|
35228
|
-
* {@link LRUCache.OptionsBase.max} (read-only)
|
|
35229
|
-
*/
|
|
35230
35042
|
get max() {
|
|
35231
|
-
return __privateGet(this,
|
|
35043
|
+
return __privateGet(this, _o2);
|
|
35232
35044
|
}
|
|
35233
|
-
/**
|
|
35234
|
-
* {@link LRUCache.OptionsBase.maxSize} (read-only)
|
|
35235
|
-
*/
|
|
35236
35045
|
get maxSize() {
|
|
35237
|
-
return __privateGet(this,
|
|
35046
|
+
return __privateGet(this, _c2);
|
|
35238
35047
|
}
|
|
35239
|
-
/**
|
|
35240
|
-
* The total computed size of items in the cache (read-only)
|
|
35241
|
-
*/
|
|
35242
35048
|
get calculatedSize() {
|
|
35243
|
-
return __privateGet(this,
|
|
35049
|
+
return __privateGet(this, __);
|
|
35244
35050
|
}
|
|
35245
|
-
/**
|
|
35246
|
-
* The number of items stored in the cache (read-only)
|
|
35247
|
-
*/
|
|
35248
35051
|
get size() {
|
|
35249
|
-
return __privateGet(this,
|
|
35052
|
+
return __privateGet(this, _n);
|
|
35250
35053
|
}
|
|
35251
|
-
/**
|
|
35252
|
-
* {@link LRUCache.OptionsBase.fetchMethod} (read-only)
|
|
35253
|
-
*/
|
|
35254
35054
|
get fetchMethod() {
|
|
35255
|
-
return __privateGet(this,
|
|
35055
|
+
return __privateGet(this, _L);
|
|
35256
35056
|
}
|
|
35257
35057
|
get memoMethod() {
|
|
35258
|
-
return __privateGet(this,
|
|
35058
|
+
return __privateGet(this, _I);
|
|
35259
35059
|
}
|
|
35260
|
-
/**
|
|
35261
|
-
* {@link LRUCache.OptionsBase.dispose} (read-only)
|
|
35262
|
-
*/
|
|
35263
35060
|
get dispose() {
|
|
35264
|
-
return __privateGet(this,
|
|
35061
|
+
return __privateGet(this, _w);
|
|
35265
35062
|
}
|
|
35266
|
-
/**
|
|
35267
|
-
* {@link LRUCache.OptionsBase.onInsert} (read-only)
|
|
35268
|
-
*/
|
|
35269
35063
|
get onInsert() {
|
|
35270
|
-
return __privateGet(this,
|
|
35064
|
+
return __privateGet(this, _C);
|
|
35271
35065
|
}
|
|
35272
|
-
/**
|
|
35273
|
-
* {@link LRUCache.OptionsBase.disposeAfter} (read-only)
|
|
35274
|
-
*/
|
|
35275
35066
|
get disposeAfter() {
|
|
35276
|
-
return __privateGet(this,
|
|
35067
|
+
return __privateGet(this, _S);
|
|
35277
35068
|
}
|
|
35278
|
-
|
|
35279
|
-
|
|
35280
|
-
* returns `0`. Returns `Infinity` if item is in cache without a defined TTL.
|
|
35281
|
-
*/
|
|
35282
|
-
getRemainingTTL(key) {
|
|
35283
|
-
return __privateGet(this, _keyMap).has(key) ? Infinity : 0;
|
|
35069
|
+
getRemainingTTL(t) {
|
|
35070
|
+
return __privateGet(this, _s).has(t) ? 1 / 0 : 0;
|
|
35284
35071
|
}
|
|
35285
|
-
/**
|
|
35286
|
-
* Return a generator yielding `[key, value]` pairs,
|
|
35287
|
-
* in order from most recently used to least recently used.
|
|
35288
|
-
*/
|
|
35289
35072
|
*entries() {
|
|
35290
|
-
for (
|
|
35291
|
-
if (__privateGet(this, _valList)[i] !== void 0 && __privateGet(this, _keyList)[i] !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i])) {
|
|
35292
|
-
yield [__privateGet(this, _keyList)[i], __privateGet(this, _valList)[i]];
|
|
35293
|
-
}
|
|
35294
|
-
}
|
|
35073
|
+
for (let t of __privateMethod(this, _a_instances, F_fn).call(this)) __privateGet(this, _t)[t] !== void 0 && __privateGet(this, _i)[t] !== void 0 && !__privateMethod(this, _a_instances, e_fn).call(this, __privateGet(this, _t)[t]) && (yield [__privateGet(this, _i)[t], __privateGet(this, _t)[t]]);
|
|
35295
35074
|
}
|
|
35296
|
-
/**
|
|
35297
|
-
* Inverse order version of {@link LRUCache.entries}
|
|
35298
|
-
*
|
|
35299
|
-
* Return a generator yielding `[key, value]` pairs,
|
|
35300
|
-
* in order from least recently used to most recently used.
|
|
35301
|
-
*/
|
|
35302
35075
|
*rentries() {
|
|
35303
|
-
for (
|
|
35304
|
-
if (__privateGet(this, _valList)[i] !== void 0 && __privateGet(this, _keyList)[i] !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i])) {
|
|
35305
|
-
yield [__privateGet(this, _keyList)[i], __privateGet(this, _valList)[i]];
|
|
35306
|
-
}
|
|
35307
|
-
}
|
|
35076
|
+
for (let t of __privateMethod(this, _a_instances, O_fn).call(this)) __privateGet(this, _t)[t] !== void 0 && __privateGet(this, _i)[t] !== void 0 && !__privateMethod(this, _a_instances, e_fn).call(this, __privateGet(this, _t)[t]) && (yield [__privateGet(this, _i)[t], __privateGet(this, _t)[t]]);
|
|
35308
35077
|
}
|
|
35309
|
-
/**
|
|
35310
|
-
* Return a generator yielding the keys in the cache,
|
|
35311
|
-
* in order from most recently used to least recently used.
|
|
35312
|
-
*/
|
|
35313
35078
|
*keys() {
|
|
35314
|
-
for (
|
|
35315
|
-
|
|
35316
|
-
|
|
35317
|
-
yield k;
|
|
35318
|
-
}
|
|
35079
|
+
for (let t of __privateMethod(this, _a_instances, F_fn).call(this)) {
|
|
35080
|
+
let e = __privateGet(this, _i)[t];
|
|
35081
|
+
e !== void 0 && !__privateMethod(this, _a_instances, e_fn).call(this, __privateGet(this, _t)[t]) && (yield e);
|
|
35319
35082
|
}
|
|
35320
35083
|
}
|
|
35321
|
-
/**
|
|
35322
|
-
* Inverse order version of {@link LRUCache.keys}
|
|
35323
|
-
*
|
|
35324
|
-
* Return a generator yielding the keys in the cache,
|
|
35325
|
-
* in order from least recently used to most recently used.
|
|
35326
|
-
*/
|
|
35327
35084
|
*rkeys() {
|
|
35328
|
-
for (
|
|
35329
|
-
|
|
35330
|
-
|
|
35331
|
-
yield k;
|
|
35332
|
-
}
|
|
35085
|
+
for (let t of __privateMethod(this, _a_instances, O_fn).call(this)) {
|
|
35086
|
+
let e = __privateGet(this, _i)[t];
|
|
35087
|
+
e !== void 0 && !__privateMethod(this, _a_instances, e_fn).call(this, __privateGet(this, _t)[t]) && (yield e);
|
|
35333
35088
|
}
|
|
35334
35089
|
}
|
|
35335
|
-
/**
|
|
35336
|
-
* Return a generator yielding the values in the cache,
|
|
35337
|
-
* in order from most recently used to least recently used.
|
|
35338
|
-
*/
|
|
35339
35090
|
*values() {
|
|
35340
|
-
for (
|
|
35341
|
-
const v = __privateGet(this, _valList)[i];
|
|
35342
|
-
if (v !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i])) {
|
|
35343
|
-
yield __privateGet(this, _valList)[i];
|
|
35344
|
-
}
|
|
35345
|
-
}
|
|
35091
|
+
for (let t of __privateMethod(this, _a_instances, F_fn).call(this)) __privateGet(this, _t)[t] !== void 0 && !__privateMethod(this, _a_instances, e_fn).call(this, __privateGet(this, _t)[t]) && (yield __privateGet(this, _t)[t]);
|
|
35346
35092
|
}
|
|
35347
|
-
/**
|
|
35348
|
-
* Inverse order version of {@link LRUCache.values}
|
|
35349
|
-
*
|
|
35350
|
-
* Return a generator yielding the values in the cache,
|
|
35351
|
-
* in order from least recently used to most recently used.
|
|
35352
|
-
*/
|
|
35353
35093
|
*rvalues() {
|
|
35354
|
-
for (
|
|
35355
|
-
const v = __privateGet(this, _valList)[i];
|
|
35356
|
-
if (v !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i])) {
|
|
35357
|
-
yield __privateGet(this, _valList)[i];
|
|
35358
|
-
}
|
|
35359
|
-
}
|
|
35094
|
+
for (let t of __privateMethod(this, _a_instances, O_fn).call(this)) __privateGet(this, _t)[t] !== void 0 && !__privateMethod(this, _a_instances, e_fn).call(this, __privateGet(this, _t)[t]) && (yield __privateGet(this, _t)[t]);
|
|
35360
35095
|
}
|
|
35361
|
-
|
|
35362
|
-
* Iterating over the cache itself yields the same results as
|
|
35363
|
-
* {@link LRUCache.entries}
|
|
35364
|
-
*/
|
|
35365
|
-
[(_b = Symbol.iterator, _a2 = Symbol.toStringTag, _b)]() {
|
|
35096
|
+
[(_b = Symbol.iterator, _a3 = Symbol.toStringTag, _b)]() {
|
|
35366
35097
|
return this.entries();
|
|
35367
35098
|
}
|
|
35368
|
-
|
|
35369
|
-
|
|
35370
|
-
|
|
35371
|
-
|
|
35372
|
-
find(fn, getOptions = {}) {
|
|
35373
|
-
for (const i of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this)) {
|
|
35374
|
-
const v = __privateGet(this, _valList)[i];
|
|
35375
|
-
const value = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) ? v.__staleWhileFetching : v;
|
|
35376
|
-
if (value === void 0)
|
|
35377
|
-
continue;
|
|
35378
|
-
if (fn(value, __privateGet(this, _keyList)[i], this)) {
|
|
35379
|
-
return this.get(__privateGet(this, _keyList)[i], getOptions);
|
|
35380
|
-
}
|
|
35099
|
+
find(t, e = {}) {
|
|
35100
|
+
for (let i of __privateMethod(this, _a_instances, F_fn).call(this)) {
|
|
35101
|
+
let s = __privateGet(this, _t)[i], h = __privateMethod(this, _a_instances, e_fn).call(this, s) ? s.__staleWhileFetching : s;
|
|
35102
|
+
if (h !== void 0 && t(h, __privateGet(this, _i)[i], this)) return this.get(__privateGet(this, _i)[i], e);
|
|
35381
35103
|
}
|
|
35382
35104
|
}
|
|
35383
|
-
|
|
35384
|
-
|
|
35385
|
-
|
|
35386
|
-
|
|
35387
|
-
* `fn` is called as `fn(value, key, cache)`.
|
|
35388
|
-
*
|
|
35389
|
-
* If `thisp` is provided, function will be called in the `this`-context of
|
|
35390
|
-
* the provided object, or the cache if no `thisp` object is provided.
|
|
35391
|
-
*
|
|
35392
|
-
* Does not update age or recenty of use, or iterate over stale values.
|
|
35393
|
-
*/
|
|
35394
|
-
forEach(fn, thisp = this) {
|
|
35395
|
-
for (const i of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this)) {
|
|
35396
|
-
const v = __privateGet(this, _valList)[i];
|
|
35397
|
-
const value = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) ? v.__staleWhileFetching : v;
|
|
35398
|
-
if (value === void 0)
|
|
35399
|
-
continue;
|
|
35400
|
-
fn.call(thisp, value, __privateGet(this, _keyList)[i], this);
|
|
35105
|
+
forEach(t, e = this) {
|
|
35106
|
+
for (let i of __privateMethod(this, _a_instances, F_fn).call(this)) {
|
|
35107
|
+
let s = __privateGet(this, _t)[i], h = __privateMethod(this, _a_instances, e_fn).call(this, s) ? s.__staleWhileFetching : s;
|
|
35108
|
+
h !== void 0 && t.call(e, h, __privateGet(this, _i)[i], this);
|
|
35401
35109
|
}
|
|
35402
35110
|
}
|
|
35403
|
-
|
|
35404
|
-
|
|
35405
|
-
|
|
35406
|
-
|
|
35407
|
-
rforEach(fn, thisp = this) {
|
|
35408
|
-
for (const i of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this)) {
|
|
35409
|
-
const v = __privateGet(this, _valList)[i];
|
|
35410
|
-
const value = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) ? v.__staleWhileFetching : v;
|
|
35411
|
-
if (value === void 0)
|
|
35412
|
-
continue;
|
|
35413
|
-
fn.call(thisp, value, __privateGet(this, _keyList)[i], this);
|
|
35111
|
+
rforEach(t, e = this) {
|
|
35112
|
+
for (let i of __privateMethod(this, _a_instances, O_fn).call(this)) {
|
|
35113
|
+
let s = __privateGet(this, _t)[i], h = __privateMethod(this, _a_instances, e_fn).call(this, s) ? s.__staleWhileFetching : s;
|
|
35114
|
+
h !== void 0 && t.call(e, h, __privateGet(this, _i)[i], this);
|
|
35414
35115
|
}
|
|
35415
35116
|
}
|
|
35416
|
-
/**
|
|
35417
|
-
* Delete any stale entries. Returns true if anything was removed,
|
|
35418
|
-
* false otherwise.
|
|
35419
|
-
*/
|
|
35420
35117
|
purgeStale() {
|
|
35421
|
-
let
|
|
35422
|
-
for (
|
|
35423
|
-
|
|
35424
|
-
__privateMethod(this, _LRUCache_instances, delete_fn).call(this, __privateGet(this, _keyList)[i], "expire");
|
|
35425
|
-
deleted = true;
|
|
35426
|
-
}
|
|
35427
|
-
}
|
|
35428
|
-
return deleted;
|
|
35118
|
+
let t = false;
|
|
35119
|
+
for (let e of __privateMethod(this, _a_instances, O_fn).call(this, { allowStale: true })) __privateGet(this, _p).call(this, e) && (__privateMethod(this, _a_instances, E_fn).call(this, __privateGet(this, _i)[e], "expire"), t = true);
|
|
35120
|
+
return t;
|
|
35429
35121
|
}
|
|
35430
|
-
|
|
35431
|
-
|
|
35432
|
-
|
|
35433
|
-
|
|
35434
|
-
|
|
35435
|
-
|
|
35436
|
-
|
|
35437
|
-
|
|
35438
|
-
|
|
35439
|
-
|
|
35440
|
-
|
|
35441
|
-
*/
|
|
35442
|
-
info(key) {
|
|
35443
|
-
const i = __privateGet(this, _keyMap).get(key);
|
|
35444
|
-
if (i === void 0)
|
|
35445
|
-
return void 0;
|
|
35446
|
-
const v = __privateGet(this, _valList)[i];
|
|
35447
|
-
const value = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) ? v.__staleWhileFetching : v;
|
|
35448
|
-
if (value === void 0)
|
|
35449
|
-
return void 0;
|
|
35450
|
-
const entry = { value };
|
|
35451
|
-
if (__privateGet(this, _ttls) && __privateGet(this, _starts)) {
|
|
35452
|
-
const ttl = __privateGet(this, _ttls)[i];
|
|
35453
|
-
const start = __privateGet(this, _starts)[i];
|
|
35454
|
-
if (ttl && start) {
|
|
35455
|
-
const remain = ttl - (__privateGet(this, _perf).now() - start);
|
|
35456
|
-
entry.ttl = remain;
|
|
35457
|
-
entry.start = Date.now();
|
|
35122
|
+
info(t) {
|
|
35123
|
+
let e = __privateGet(this, _s).get(t);
|
|
35124
|
+
if (e === void 0) return;
|
|
35125
|
+
let i = __privateGet(this, _t)[e], s = __privateMethod(this, _a_instances, e_fn).call(this, i) ? i.__staleWhileFetching : i;
|
|
35126
|
+
if (s === void 0) return;
|
|
35127
|
+
let h = { value: s };
|
|
35128
|
+
if (__privateGet(this, _d) && __privateGet(this, _A)) {
|
|
35129
|
+
let n = __privateGet(this, _d)[e], o = __privateGet(this, _A)[e];
|
|
35130
|
+
if (n && o) {
|
|
35131
|
+
let r = n - (__privateGet(this, _m).now() - o);
|
|
35132
|
+
h.ttl = r, h.start = Date.now();
|
|
35458
35133
|
}
|
|
35459
35134
|
}
|
|
35460
|
-
|
|
35461
|
-
entry.size = __privateGet(this, _sizes)[i];
|
|
35462
|
-
}
|
|
35463
|
-
return entry;
|
|
35135
|
+
return __privateGet(this, _y) && (h.size = __privateGet(this, _y)[e]), h;
|
|
35464
35136
|
}
|
|
35465
|
-
/**
|
|
35466
|
-
* Return an array of [key, {@link LRUCache.Entry}] tuples which can be
|
|
35467
|
-
* passed to {@link LRUCache#load}.
|
|
35468
|
-
*
|
|
35469
|
-
* The `start` fields are calculated relative to a portable `Date.now()`
|
|
35470
|
-
* timestamp, even if `performance.now()` is available.
|
|
35471
|
-
*
|
|
35472
|
-
* Stale entries are always included in the `dump`, even if
|
|
35473
|
-
* {@link LRUCache.OptionsBase.allowStale} is false.
|
|
35474
|
-
*
|
|
35475
|
-
* Note: this returns an actual array, not a generator, so it can be more
|
|
35476
|
-
* easily passed around.
|
|
35477
|
-
*/
|
|
35478
35137
|
dump() {
|
|
35479
|
-
|
|
35480
|
-
for (
|
|
35481
|
-
|
|
35482
|
-
|
|
35483
|
-
|
|
35484
|
-
if (
|
|
35485
|
-
|
|
35486
|
-
|
|
35487
|
-
|
|
35488
|
-
entry.ttl = __privateGet(this, _ttls)[i];
|
|
35489
|
-
const age = __privateGet(this, _perf).now() - __privateGet(this, _starts)[i];
|
|
35490
|
-
entry.start = Math.floor(Date.now() - age);
|
|
35491
|
-
}
|
|
35492
|
-
if (__privateGet(this, _sizes)) {
|
|
35493
|
-
entry.size = __privateGet(this, _sizes)[i];
|
|
35138
|
+
let t = [];
|
|
35139
|
+
for (let e of __privateMethod(this, _a_instances, F_fn).call(this, { allowStale: true })) {
|
|
35140
|
+
let i = __privateGet(this, _i)[e], s = __privateGet(this, _t)[e], h = __privateMethod(this, _a_instances, e_fn).call(this, s) ? s.__staleWhileFetching : s;
|
|
35141
|
+
if (h === void 0 || i === void 0) continue;
|
|
35142
|
+
let n = { value: h };
|
|
35143
|
+
if (__privateGet(this, _d) && __privateGet(this, _A)) {
|
|
35144
|
+
n.ttl = __privateGet(this, _d)[e];
|
|
35145
|
+
let o = __privateGet(this, _m).now() - __privateGet(this, _A)[e];
|
|
35146
|
+
n.start = Math.floor(Date.now() - o);
|
|
35494
35147
|
}
|
|
35495
|
-
|
|
35148
|
+
__privateGet(this, _y) && (n.size = __privateGet(this, _y)[e]), t.unshift([i, n]);
|
|
35496
35149
|
}
|
|
35497
|
-
return
|
|
35150
|
+
return t;
|
|
35498
35151
|
}
|
|
35499
|
-
|
|
35500
|
-
* Reset the cache and load in the items in entries in the order listed.
|
|
35501
|
-
*
|
|
35502
|
-
* The shape of the resulting cache may be different if the same options are
|
|
35503
|
-
* not used in both caches.
|
|
35504
|
-
*
|
|
35505
|
-
* The `start` fields are assumed to be calculated relative to a portable
|
|
35506
|
-
* `Date.now()` timestamp, even if `performance.now()` is available.
|
|
35507
|
-
*/
|
|
35508
|
-
load(arr) {
|
|
35152
|
+
load(t) {
|
|
35509
35153
|
this.clear();
|
|
35510
|
-
for (
|
|
35511
|
-
if (
|
|
35512
|
-
|
|
35513
|
-
|
|
35154
|
+
for (let [e, i] of t) {
|
|
35155
|
+
if (i.start) {
|
|
35156
|
+
let s = Date.now() - i.start;
|
|
35157
|
+
i.start = __privateGet(this, _m).now() - s;
|
|
35514
35158
|
}
|
|
35515
|
-
this.set(
|
|
35159
|
+
this.set(e, i.value, i);
|
|
35516
35160
|
}
|
|
35517
35161
|
}
|
|
35518
|
-
|
|
35519
|
-
|
|
35520
|
-
|
|
35521
|
-
|
|
35522
|
-
|
|
35523
|
-
|
|
35524
|
-
|
|
35525
|
-
|
|
35526
|
-
|
|
35527
|
-
|
|
35528
|
-
|
|
35529
|
-
|
|
35530
|
-
|
|
35531
|
-
|
|
35532
|
-
|
|
35533
|
-
|
|
35534
|
-
|
|
35535
|
-
|
|
35536
|
-
|
|
35537
|
-
|
|
35538
|
-
|
|
35539
|
-
|
|
35540
|
-
|
|
35541
|
-
|
|
35542
|
-
|
|
35543
|
-
|
|
35544
|
-
|
|
35545
|
-
* If the value is `undefined`, then this is an alias for
|
|
35546
|
-
* `cache.delete(key)`. `undefined` is never stored in the cache.
|
|
35547
|
-
*/
|
|
35548
|
-
set(k, v, setOptions = {}) {
|
|
35549
|
-
var _a3, _b2, _c, _d;
|
|
35550
|
-
if (v === void 0) {
|
|
35551
|
-
this.delete(k);
|
|
35552
|
-
return this;
|
|
35553
|
-
}
|
|
35554
|
-
const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status } = setOptions;
|
|
35555
|
-
let { noUpdateTTL = this.noUpdateTTL } = setOptions;
|
|
35556
|
-
const size = __privateGet(this, _requireSize).call(this, k, v, setOptions.size || 0, sizeCalculation);
|
|
35557
|
-
if (this.maxEntrySize && size > this.maxEntrySize) {
|
|
35558
|
-
if (status) {
|
|
35559
|
-
status.set = "miss";
|
|
35560
|
-
status.maxEntrySizeExceeded = true;
|
|
35561
|
-
}
|
|
35562
|
-
__privateMethod(this, _LRUCache_instances, delete_fn).call(this, k, "set");
|
|
35563
|
-
return this;
|
|
35564
|
-
}
|
|
35565
|
-
let index = __privateGet(this, _size2) === 0 ? void 0 : __privateGet(this, _keyMap).get(k);
|
|
35566
|
-
if (index === void 0) {
|
|
35567
|
-
index = __privateGet(this, _size2) === 0 ? __privateGet(this, _tail) : __privateGet(this, _free).length !== 0 ? __privateGet(this, _free).pop() : __privateGet(this, _size2) === __privateGet(this, _max) ? __privateMethod(this, _LRUCache_instances, evict_fn).call(this, false) : __privateGet(this, _size2);
|
|
35568
|
-
__privateGet(this, _keyList)[index] = k;
|
|
35569
|
-
__privateGet(this, _valList)[index] = v;
|
|
35570
|
-
__privateGet(this, _keyMap).set(k, index);
|
|
35571
|
-
__privateGet(this, _next)[__privateGet(this, _tail)] = index;
|
|
35572
|
-
__privateGet(this, _prev)[index] = __privateGet(this, _tail);
|
|
35573
|
-
__privateSet(this, _tail, index);
|
|
35574
|
-
__privateWrapper(this, _size2)._++;
|
|
35575
|
-
__privateGet(this, _addItemSize).call(this, index, size, status);
|
|
35576
|
-
if (status)
|
|
35577
|
-
status.set = "add";
|
|
35578
|
-
noUpdateTTL = false;
|
|
35579
|
-
if (__privateGet(this, _hasOnInsert)) {
|
|
35580
|
-
(_a3 = __privateGet(this, _onInsert)) == null ? void 0 : _a3.call(this, v, k, "add");
|
|
35581
|
-
}
|
|
35582
|
-
} else {
|
|
35583
|
-
__privateMethod(this, _LRUCache_instances, moveToTail_fn).call(this, index);
|
|
35584
|
-
const oldVal = __privateGet(this, _valList)[index];
|
|
35585
|
-
if (v !== oldVal) {
|
|
35586
|
-
if (__privateGet(this, _hasFetchMethod) && __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, oldVal)) {
|
|
35587
|
-
oldVal.__abortController.abort(new Error("replaced"));
|
|
35588
|
-
const { __staleWhileFetching: s } = oldVal;
|
|
35589
|
-
if (s !== void 0 && !noDisposeOnSet) {
|
|
35590
|
-
if (__privateGet(this, _hasDispose)) {
|
|
35591
|
-
(_b2 = __privateGet(this, _dispose)) == null ? void 0 : _b2.call(this, s, k, "set");
|
|
35592
|
-
}
|
|
35593
|
-
if (__privateGet(this, _hasDisposeAfter)) {
|
|
35594
|
-
__privateGet(this, _disposed)?.push([s, k, "set"]);
|
|
35595
|
-
}
|
|
35596
|
-
}
|
|
35597
|
-
} else if (!noDisposeOnSet) {
|
|
35598
|
-
if (__privateGet(this, _hasDispose)) {
|
|
35599
|
-
(_c = __privateGet(this, _dispose)) == null ? void 0 : _c.call(this, oldVal, k, "set");
|
|
35600
|
-
}
|
|
35601
|
-
if (__privateGet(this, _hasDisposeAfter)) {
|
|
35602
|
-
__privateGet(this, _disposed)?.push([oldVal, k, "set"]);
|
|
35603
|
-
}
|
|
35604
|
-
}
|
|
35605
|
-
__privateGet(this, _removeItemSize).call(this, index);
|
|
35606
|
-
__privateGet(this, _addItemSize).call(this, index, size, status);
|
|
35607
|
-
__privateGet(this, _valList)[index] = v;
|
|
35608
|
-
if (status) {
|
|
35609
|
-
status.set = "replace";
|
|
35610
|
-
const oldValue = oldVal && __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, oldVal) ? oldVal.__staleWhileFetching : oldVal;
|
|
35611
|
-
if (oldValue !== void 0)
|
|
35612
|
-
status.oldValue = oldValue;
|
|
35613
|
-
}
|
|
35614
|
-
} else if (status) {
|
|
35615
|
-
status.set = "update";
|
|
35616
|
-
}
|
|
35617
|
-
if (__privateGet(this, _hasOnInsert)) {
|
|
35618
|
-
this.onInsert?.(v, k, v === oldVal ? "update" : "replace");
|
|
35619
|
-
}
|
|
35620
|
-
}
|
|
35621
|
-
if (ttl !== 0 && !__privateGet(this, _ttls)) {
|
|
35622
|
-
__privateMethod(this, _LRUCache_instances, initializeTTLTracking_fn).call(this);
|
|
35623
|
-
}
|
|
35624
|
-
if (__privateGet(this, _ttls)) {
|
|
35625
|
-
if (!noUpdateTTL) {
|
|
35626
|
-
__privateGet(this, _setItemTTL).call(this, index, ttl, start);
|
|
35627
|
-
}
|
|
35628
|
-
if (status)
|
|
35629
|
-
__privateGet(this, _statusTTL).call(this, status, index);
|
|
35630
|
-
}
|
|
35631
|
-
if (!noDisposeOnSet && __privateGet(this, _hasDisposeAfter) && __privateGet(this, _disposed)) {
|
|
35632
|
-
const dt = __privateGet(this, _disposed);
|
|
35633
|
-
let task;
|
|
35634
|
-
while (task = dt?.shift()) {
|
|
35635
|
-
(_d = __privateGet(this, _disposeAfter)) == null ? void 0 : _d.call(this, ...task);
|
|
35636
|
-
}
|
|
35162
|
+
set(t, e, i = {}) {
|
|
35163
|
+
var _a5, _b3, _c3, _d2;
|
|
35164
|
+
if (e === void 0) return this.delete(t), this;
|
|
35165
|
+
let { ttl: s = this.ttl, start: h, noDisposeOnSet: n = this.noDisposeOnSet, sizeCalculation: o = this.sizeCalculation, status: r } = i, { noUpdateTTL: f = this.noUpdateTTL } = i, m = __privateGet(this, _P).call(this, t, e, i.size || 0, o);
|
|
35166
|
+
if (this.maxEntrySize && m > this.maxEntrySize) return r && (r.set = "miss", r.maxEntrySizeExceeded = true), __privateMethod(this, _a_instances, E_fn).call(this, t, "set"), this;
|
|
35167
|
+
let c = __privateGet(this, _n) === 0 ? void 0 : __privateGet(this, _s).get(t);
|
|
35168
|
+
if (c === void 0) c = __privateGet(this, _n) === 0 ? __privateGet(this, _h) : __privateGet(this, _b2).length !== 0 ? __privateGet(this, _b2).pop() : __privateGet(this, _n) === __privateGet(this, _o2) ? __privateMethod(this, _a_instances, M_fn).call(this, false) : __privateGet(this, _n), __privateGet(this, _i)[c] = t, __privateGet(this, _t)[c] = e, __privateGet(this, _s).set(t, c), __privateGet(this, _a4)[__privateGet(this, _h)] = c, __privateGet(this, _u)[c] = __privateGet(this, _h), __privateSet(this, _h, c), __privateWrapper(this, _n)._++, __privateGet(this, _U).call(this, c, m, r), r && (r.set = "add"), f = false, __privateGet(this, _x) && ((_a5 = __privateGet(this, _C)) == null ? void 0 : _a5.call(this, e, t, "add"));
|
|
35169
|
+
else {
|
|
35170
|
+
__privateMethod(this, _a_instances, D_fn).call(this, c);
|
|
35171
|
+
let d = __privateGet(this, _t)[c];
|
|
35172
|
+
if (e !== d) {
|
|
35173
|
+
if (__privateGet(this, _v) && __privateMethod(this, _a_instances, e_fn).call(this, d)) {
|
|
35174
|
+
d.__abortController.abort(new Error("replaced"));
|
|
35175
|
+
let { __staleWhileFetching: g } = d;
|
|
35176
|
+
g !== void 0 && !n && (__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"]));
|
|
35177
|
+
} else n || (__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"]));
|
|
35178
|
+
if (__privateGet(this, _W).call(this, c), __privateGet(this, _U).call(this, c, m, r), __privateGet(this, _t)[c] = e, r) {
|
|
35179
|
+
r.set = "replace";
|
|
35180
|
+
let g = d && __privateMethod(this, _a_instances, e_fn).call(this, d) ? d.__staleWhileFetching : d;
|
|
35181
|
+
g !== void 0 && (r.oldValue = g);
|
|
35182
|
+
}
|
|
35183
|
+
} else r && (r.set = "update");
|
|
35184
|
+
__privateGet(this, _x) && this.onInsert?.(e, t, e === d ? "update" : "replace");
|
|
35185
|
+
}
|
|
35186
|
+
if (s !== 0 && !__privateGet(this, _d) && __privateMethod(this, _a_instances, j_fn).call(this), __privateGet(this, _d) && (f || __privateGet(this, _N).call(this, c, s, h), r && __privateGet(this, _z).call(this, r, c)), !n && __privateGet(this, _f) && __privateGet(this, _r)) {
|
|
35187
|
+
let d = __privateGet(this, _r), g;
|
|
35188
|
+
for (; g = d?.shift(); ) (_d2 = __privateGet(this, _S)) == null ? void 0 : _d2.call(this, ...g);
|
|
35637
35189
|
}
|
|
35638
35190
|
return this;
|
|
35639
35191
|
}
|
|
35640
|
-
/**
|
|
35641
|
-
* Evict the least recently used item, returning its value or
|
|
35642
|
-
* `undefined` if cache is empty.
|
|
35643
|
-
*/
|
|
35644
35192
|
pop() {
|
|
35645
|
-
var
|
|
35193
|
+
var _a5;
|
|
35646
35194
|
try {
|
|
35647
|
-
|
|
35648
|
-
|
|
35649
|
-
__privateMethod(this,
|
|
35650
|
-
|
|
35651
|
-
|
|
35652
|
-
return val.__staleWhileFetching;
|
|
35653
|
-
}
|
|
35654
|
-
} else if (val !== void 0) {
|
|
35655
|
-
return val;
|
|
35656
|
-
}
|
|
35195
|
+
for (; __privateGet(this, _n); ) {
|
|
35196
|
+
let t = __privateGet(this, _t)[__privateGet(this, _l)];
|
|
35197
|
+
if (__privateMethod(this, _a_instances, M_fn).call(this, true), __privateMethod(this, _a_instances, e_fn).call(this, t)) {
|
|
35198
|
+
if (t.__staleWhileFetching) return t.__staleWhileFetching;
|
|
35199
|
+
} else if (t !== void 0) return t;
|
|
35657
35200
|
}
|
|
35658
35201
|
} finally {
|
|
35659
|
-
if (__privateGet(this,
|
|
35660
|
-
|
|
35661
|
-
|
|
35662
|
-
while (task = dt?.shift()) {
|
|
35663
|
-
(_a3 = __privateGet(this, _disposeAfter)) == null ? void 0 : _a3.call(this, ...task);
|
|
35664
|
-
}
|
|
35202
|
+
if (__privateGet(this, _f) && __privateGet(this, _r)) {
|
|
35203
|
+
let t = __privateGet(this, _r), e;
|
|
35204
|
+
for (; e = t?.shift(); ) (_a5 = __privateGet(this, _S)) == null ? void 0 : _a5.call(this, ...e);
|
|
35665
35205
|
}
|
|
35666
35206
|
}
|
|
35667
35207
|
}
|
|
35668
|
-
|
|
35669
|
-
|
|
35670
|
-
|
|
35671
|
-
|
|
35672
|
-
|
|
35673
|
-
|
|
35674
|
-
|
|
35675
|
-
|
|
35676
|
-
*
|
|
35677
|
-
* Will return `false` if the item is stale, even though it is technically in
|
|
35678
|
-
* the cache. The difference can be determined (if it matters) by using a
|
|
35679
|
-
* `status` argument, and inspecting the `has` field.
|
|
35680
|
-
*
|
|
35681
|
-
* Will not update item age unless
|
|
35682
|
-
* {@link LRUCache.OptionsBase.updateAgeOnHas} is set.
|
|
35683
|
-
*/
|
|
35684
|
-
has(k, hasOptions = {}) {
|
|
35685
|
-
const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions;
|
|
35686
|
-
const index = __privateGet(this, _keyMap).get(k);
|
|
35687
|
-
if (index !== void 0) {
|
|
35688
|
-
const v = __privateGet(this, _valList)[index];
|
|
35689
|
-
if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) && v.__staleWhileFetching === void 0) {
|
|
35690
|
-
return false;
|
|
35691
|
-
}
|
|
35692
|
-
if (!__privateGet(this, _isStale).call(this, index)) {
|
|
35693
|
-
if (updateAgeOnHas) {
|
|
35694
|
-
__privateGet(this, _updateItemAge).call(this, index);
|
|
35695
|
-
}
|
|
35696
|
-
if (status) {
|
|
35697
|
-
status.has = "hit";
|
|
35698
|
-
__privateGet(this, _statusTTL).call(this, status, index);
|
|
35699
|
-
}
|
|
35700
|
-
return true;
|
|
35701
|
-
} else if (status) {
|
|
35702
|
-
status.has = "stale";
|
|
35703
|
-
__privateGet(this, _statusTTL).call(this, status, index);
|
|
35704
|
-
}
|
|
35705
|
-
} else if (status) {
|
|
35706
|
-
status.has = "miss";
|
|
35707
|
-
}
|
|
35208
|
+
has(t, e = {}) {
|
|
35209
|
+
let { updateAgeOnHas: i = this.updateAgeOnHas, status: s } = e, h = __privateGet(this, _s).get(t);
|
|
35210
|
+
if (h !== void 0) {
|
|
35211
|
+
let n = __privateGet(this, _t)[h];
|
|
35212
|
+
if (__privateMethod(this, _a_instances, e_fn).call(this, n) && n.__staleWhileFetching === void 0) return false;
|
|
35213
|
+
if (__privateGet(this, _p).call(this, h)) s && (s.has = "stale", __privateGet(this, _z).call(this, s, h));
|
|
35214
|
+
else return i && __privateGet(this, _R).call(this, h), s && (s.has = "hit", __privateGet(this, _z).call(this, s, h)), true;
|
|
35215
|
+
} else s && (s.has = "miss");
|
|
35708
35216
|
return false;
|
|
35709
35217
|
}
|
|
35710
|
-
|
|
35711
|
-
|
|
35712
|
-
|
|
35713
|
-
|
|
35714
|
-
|
|
35715
|
-
|
|
35716
|
-
|
|
35717
|
-
|
|
35718
|
-
|
|
35719
|
-
|
|
35720
|
-
if (
|
|
35721
|
-
|
|
35722
|
-
|
|
35723
|
-
|
|
35724
|
-
return __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v) ? v.__staleWhileFetching : v;
|
|
35725
|
-
}
|
|
35726
|
-
async fetch(k, fetchOptions = {}) {
|
|
35727
|
-
const {
|
|
35728
|
-
// get options
|
|
35729
|
-
allowStale = this.allowStale,
|
|
35730
|
-
updateAgeOnGet = this.updateAgeOnGet,
|
|
35731
|
-
noDeleteOnStaleGet = this.noDeleteOnStaleGet,
|
|
35732
|
-
// set options
|
|
35733
|
-
ttl = this.ttl,
|
|
35734
|
-
noDisposeOnSet = this.noDisposeOnSet,
|
|
35735
|
-
size = 0,
|
|
35736
|
-
sizeCalculation = this.sizeCalculation,
|
|
35737
|
-
noUpdateTTL = this.noUpdateTTL,
|
|
35738
|
-
// fetch exclusive options
|
|
35739
|
-
noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,
|
|
35740
|
-
allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,
|
|
35741
|
-
ignoreFetchAbort = this.ignoreFetchAbort,
|
|
35742
|
-
allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,
|
|
35743
|
-
context,
|
|
35744
|
-
forceRefresh = false,
|
|
35745
|
-
status,
|
|
35746
|
-
signal
|
|
35747
|
-
} = fetchOptions;
|
|
35748
|
-
if (!__privateGet(this, _hasFetchMethod)) {
|
|
35749
|
-
if (status)
|
|
35750
|
-
status.fetch = "get";
|
|
35751
|
-
return this.get(k, {
|
|
35752
|
-
allowStale,
|
|
35753
|
-
updateAgeOnGet,
|
|
35754
|
-
noDeleteOnStaleGet,
|
|
35755
|
-
status
|
|
35756
|
-
});
|
|
35757
|
-
}
|
|
35758
|
-
const options = {
|
|
35759
|
-
allowStale,
|
|
35760
|
-
updateAgeOnGet,
|
|
35761
|
-
noDeleteOnStaleGet,
|
|
35762
|
-
ttl,
|
|
35763
|
-
noDisposeOnSet,
|
|
35764
|
-
size,
|
|
35765
|
-
sizeCalculation,
|
|
35766
|
-
noUpdateTTL,
|
|
35767
|
-
noDeleteOnFetchRejection,
|
|
35768
|
-
allowStaleOnFetchRejection,
|
|
35769
|
-
allowStaleOnFetchAbort,
|
|
35770
|
-
ignoreFetchAbort,
|
|
35771
|
-
status,
|
|
35772
|
-
signal
|
|
35773
|
-
};
|
|
35774
|
-
let index = __privateGet(this, _keyMap).get(k);
|
|
35775
|
-
if (index === void 0) {
|
|
35776
|
-
if (status)
|
|
35777
|
-
status.fetch = "miss";
|
|
35778
|
-
const p = __privateMethod(this, _LRUCache_instances, backgroundFetch_fn).call(this, k, index, options, context);
|
|
35779
|
-
return p.__returned = p;
|
|
35218
|
+
peek(t, e = {}) {
|
|
35219
|
+
let { allowStale: i = this.allowStale } = e, s = __privateGet(this, _s).get(t);
|
|
35220
|
+
if (s === void 0 || !i && __privateGet(this, _p).call(this, s)) return;
|
|
35221
|
+
let h = __privateGet(this, _t)[s];
|
|
35222
|
+
return __privateMethod(this, _a_instances, e_fn).call(this, h) ? h.__staleWhileFetching : h;
|
|
35223
|
+
}
|
|
35224
|
+
async fetch(t, e = {}) {
|
|
35225
|
+
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: h = this.noDeleteOnStaleGet, ttl: n = this.ttl, noDisposeOnSet: o = this.noDisposeOnSet, size: r = 0, sizeCalculation: f = this.sizeCalculation, noUpdateTTL: m = this.noUpdateTTL, noDeleteOnFetchRejection: c = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: d = this.allowStaleOnFetchRejection, ignoreFetchAbort: g = this.ignoreFetchAbort, allowStaleOnFetchAbort: A = this.allowStaleOnFetchAbort, context: p, forceRefresh: _ = false, status: l, signal: w } = e;
|
|
35226
|
+
if (!__privateGet(this, _v)) return l && (l.fetch = "get"), this.get(t, { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: h, status: l });
|
|
35227
|
+
let b = { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: h, ttl: n, noDisposeOnSet: o, size: r, sizeCalculation: f, noUpdateTTL: m, noDeleteOnFetchRejection: c, allowStaleOnFetchRejection: d, allowStaleOnFetchAbort: A, ignoreFetchAbort: g, status: l, signal: w }, S = __privateGet(this, _s).get(t);
|
|
35228
|
+
if (S === void 0) {
|
|
35229
|
+
l && (l.fetch = "miss");
|
|
35230
|
+
let u = __privateMethod(this, _a_instances, G_fn).call(this, t, S, b, p);
|
|
35231
|
+
return u.__returned = u;
|
|
35780
35232
|
} else {
|
|
35781
|
-
|
|
35782
|
-
if (__privateMethod(this,
|
|
35783
|
-
|
|
35784
|
-
|
|
35785
|
-
|
|
35786
|
-
|
|
35787
|
-
|
|
35788
|
-
|
|
35789
|
-
|
|
35790
|
-
|
|
35791
|
-
|
|
35792
|
-
|
|
35793
|
-
|
|
35794
|
-
|
|
35795
|
-
|
|
35796
|
-
|
|
35797
|
-
|
|
35798
|
-
|
|
35799
|
-
|
|
35800
|
-
|
|
35801
|
-
|
|
35802
|
-
|
|
35803
|
-
|
|
35804
|
-
|
|
35805
|
-
|
|
35806
|
-
|
|
35807
|
-
|
|
35808
|
-
|
|
35809
|
-
|
|
35810
|
-
|
|
35811
|
-
|
|
35812
|
-
|
|
35813
|
-
|
|
35814
|
-
async forceFetch(k, fetchOptions = {}) {
|
|
35815
|
-
const v = await this.fetch(k, fetchOptions);
|
|
35816
|
-
if (v === void 0)
|
|
35817
|
-
throw new Error("fetch() returned undefined");
|
|
35818
|
-
return v;
|
|
35819
|
-
}
|
|
35820
|
-
memo(k, memoOptions = {}) {
|
|
35821
|
-
const memoMethod = __privateGet(this, _memoMethod);
|
|
35822
|
-
if (!memoMethod) {
|
|
35823
|
-
throw new Error("no memoMethod provided to constructor");
|
|
35824
|
-
}
|
|
35825
|
-
const { context, forceRefresh, ...options } = memoOptions;
|
|
35826
|
-
const v = this.get(k, options);
|
|
35827
|
-
if (!forceRefresh && v !== void 0)
|
|
35828
|
-
return v;
|
|
35829
|
-
const vv = memoMethod(k, v, {
|
|
35830
|
-
options,
|
|
35831
|
-
context
|
|
35832
|
-
});
|
|
35833
|
-
this.set(k, vv, options);
|
|
35834
|
-
return vv;
|
|
35835
|
-
}
|
|
35836
|
-
/**
|
|
35837
|
-
* Return a value from the cache. Will update the recency of the cache
|
|
35838
|
-
* entry found.
|
|
35839
|
-
*
|
|
35840
|
-
* If the key is not found, get() will return `undefined`.
|
|
35841
|
-
*/
|
|
35842
|
-
get(k, getOptions = {}) {
|
|
35843
|
-
const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status } = getOptions;
|
|
35844
|
-
const index = __privateGet(this, _keyMap).get(k);
|
|
35845
|
-
if (index !== void 0) {
|
|
35846
|
-
const value = __privateGet(this, _valList)[index];
|
|
35847
|
-
const fetching = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, value);
|
|
35848
|
-
if (status)
|
|
35849
|
-
__privateGet(this, _statusTTL).call(this, status, index);
|
|
35850
|
-
if (__privateGet(this, _isStale).call(this, index)) {
|
|
35851
|
-
if (status)
|
|
35852
|
-
status.get = "stale";
|
|
35853
|
-
if (!fetching) {
|
|
35854
|
-
if (!noDeleteOnStaleGet) {
|
|
35855
|
-
__privateMethod(this, _LRUCache_instances, delete_fn).call(this, k, "expire");
|
|
35856
|
-
}
|
|
35857
|
-
if (status && allowStale)
|
|
35858
|
-
status.returnedStale = true;
|
|
35859
|
-
return allowStale ? value : void 0;
|
|
35860
|
-
} else {
|
|
35861
|
-
if (status && allowStale && value.__staleWhileFetching !== void 0) {
|
|
35862
|
-
status.returnedStale = true;
|
|
35863
|
-
}
|
|
35864
|
-
return allowStale ? value.__staleWhileFetching : void 0;
|
|
35865
|
-
}
|
|
35866
|
-
} else {
|
|
35867
|
-
if (status)
|
|
35868
|
-
status.get = "hit";
|
|
35869
|
-
if (fetching) {
|
|
35870
|
-
return value.__staleWhileFetching;
|
|
35871
|
-
}
|
|
35872
|
-
__privateMethod(this, _LRUCache_instances, moveToTail_fn).call(this, index);
|
|
35873
|
-
if (updateAgeOnGet) {
|
|
35874
|
-
__privateGet(this, _updateItemAge).call(this, index);
|
|
35875
|
-
}
|
|
35876
|
-
return value;
|
|
35877
|
-
}
|
|
35878
|
-
} else if (status) {
|
|
35879
|
-
status.get = "miss";
|
|
35880
|
-
}
|
|
35233
|
+
let u = __privateGet(this, _t)[S];
|
|
35234
|
+
if (__privateMethod(this, _a_instances, e_fn).call(this, u)) {
|
|
35235
|
+
let E = i && u.__staleWhileFetching !== void 0;
|
|
35236
|
+
return l && (l.fetch = "inflight", E && (l.returnedStale = true)), E ? u.__staleWhileFetching : u.__returned = u;
|
|
35237
|
+
}
|
|
35238
|
+
let T = __privateGet(this, _p).call(this, S);
|
|
35239
|
+
if (!_ && !T) return l && (l.fetch = "hit"), __privateMethod(this, _a_instances, D_fn).call(this, S), s && __privateGet(this, _R).call(this, S), l && __privateGet(this, _z).call(this, l, S), u;
|
|
35240
|
+
let F = __privateMethod(this, _a_instances, G_fn).call(this, t, S, b, p), O = F.__staleWhileFetching !== void 0 && i;
|
|
35241
|
+
return l && (l.fetch = T ? "stale" : "refresh", O && T && (l.returnedStale = true)), O ? F.__staleWhileFetching : F.__returned = F;
|
|
35242
|
+
}
|
|
35243
|
+
}
|
|
35244
|
+
async forceFetch(t, e = {}) {
|
|
35245
|
+
let i = await this.fetch(t, e);
|
|
35246
|
+
if (i === void 0) throw new Error("fetch() returned undefined");
|
|
35247
|
+
return i;
|
|
35248
|
+
}
|
|
35249
|
+
memo(t, e = {}) {
|
|
35250
|
+
let i = __privateGet(this, _I);
|
|
35251
|
+
if (!i) throw new Error("no memoMethod provided to constructor");
|
|
35252
|
+
let { context: s, forceRefresh: h, ...n } = e, o = this.get(t, n);
|
|
35253
|
+
if (!h && o !== void 0) return o;
|
|
35254
|
+
let r = i(t, o, { options: n, context: s });
|
|
35255
|
+
return this.set(t, r, n), r;
|
|
35256
|
+
}
|
|
35257
|
+
get(t, e = {}) {
|
|
35258
|
+
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: h = this.noDeleteOnStaleGet, status: n } = e, o = __privateGet(this, _s).get(t);
|
|
35259
|
+
if (o !== void 0) {
|
|
35260
|
+
let r = __privateGet(this, _t)[o], f = __privateMethod(this, _a_instances, e_fn).call(this, r);
|
|
35261
|
+
return n && __privateGet(this, _z).call(this, n, o), __privateGet(this, _p).call(this, o) ? (n && (n.get = "stale"), f ? (n && i && r.__staleWhileFetching !== void 0 && (n.returnedStale = true), i ? r.__staleWhileFetching : void 0) : (h || __privateMethod(this, _a_instances, E_fn).call(this, t, "expire"), n && i && (n.returnedStale = true), i ? r : void 0)) : (n && (n.get = "hit"), f ? r.__staleWhileFetching : (__privateMethod(this, _a_instances, D_fn).call(this, o), s && __privateGet(this, _R).call(this, o), r));
|
|
35262
|
+
} else n && (n.get = "miss");
|
|
35263
|
+
}
|
|
35264
|
+
delete(t) {
|
|
35265
|
+
return __privateMethod(this, _a_instances, E_fn).call(this, t, "delete");
|
|
35881
35266
|
}
|
|
35882
|
-
/**
|
|
35883
|
-
* Deletes a key out of the cache.
|
|
35884
|
-
*
|
|
35885
|
-
* Returns true if the key was deleted, false otherwise.
|
|
35886
|
-
*/
|
|
35887
|
-
delete(k) {
|
|
35888
|
-
return __privateMethod(this, _LRUCache_instances, delete_fn).call(this, k, "delete");
|
|
35889
|
-
}
|
|
35890
|
-
/**
|
|
35891
|
-
* Clear the cache entirely, throwing away all values.
|
|
35892
|
-
*/
|
|
35893
35267
|
clear() {
|
|
35894
|
-
return __privateMethod(this,
|
|
35895
|
-
}
|
|
35896
|
-
}
|
|
35897
|
-
|
|
35898
|
-
|
|
35899
|
-
|
|
35900
|
-
|
|
35901
|
-
|
|
35902
|
-
|
|
35903
|
-
|
|
35904
|
-
|
|
35905
|
-
|
|
35906
|
-
|
|
35907
|
-
|
|
35908
|
-
|
|
35909
|
-
|
|
35910
|
-
|
|
35911
|
-
|
|
35912
|
-
|
|
35913
|
-
|
|
35914
|
-
|
|
35915
|
-
|
|
35916
|
-
_sizes = new WeakMap();
|
|
35917
|
-
_starts = new WeakMap();
|
|
35918
|
-
_ttls = new WeakMap();
|
|
35919
|
-
_autopurgeTimers = new WeakMap();
|
|
35920
|
-
_hasDispose = new WeakMap();
|
|
35921
|
-
_hasFetchMethod = new WeakMap();
|
|
35922
|
-
_hasDisposeAfter = new WeakMap();
|
|
35923
|
-
_hasOnInsert = new WeakMap();
|
|
35924
|
-
_LRUCache_instances = new WeakSet();
|
|
35925
|
-
initializeTTLTracking_fn = function() {
|
|
35926
|
-
const ttls = new ZeroArray(__privateGet(this, _max));
|
|
35927
|
-
const starts = new ZeroArray(__privateGet(this, _max));
|
|
35928
|
-
__privateSet(this, _ttls, ttls);
|
|
35929
|
-
__privateSet(this, _starts, starts);
|
|
35930
|
-
const purgeTimers = this.ttlAutopurge ? new Array(__privateGet(this, _max)) : void 0;
|
|
35931
|
-
__privateSet(this, _autopurgeTimers, purgeTimers);
|
|
35932
|
-
__privateSet(this, _setItemTTL, (index, ttl, start = __privateGet(this, _perf).now()) => {
|
|
35933
|
-
starts[index] = ttl !== 0 ? start : 0;
|
|
35934
|
-
ttls[index] = ttl;
|
|
35935
|
-
if (purgeTimers?.[index]) {
|
|
35936
|
-
clearTimeout(purgeTimers[index]);
|
|
35937
|
-
purgeTimers[index] = void 0;
|
|
35938
|
-
}
|
|
35939
|
-
if (ttl !== 0 && purgeTimers) {
|
|
35940
|
-
const t = setTimeout(() => {
|
|
35941
|
-
if (__privateGet(this, _isStale).call(this, index)) {
|
|
35942
|
-
__privateMethod(this, _LRUCache_instances, delete_fn).call(this, __privateGet(this, _keyList)[index], "expire");
|
|
35943
|
-
}
|
|
35944
|
-
}, ttl + 1);
|
|
35945
|
-
if (t.unref) {
|
|
35946
|
-
t.unref();
|
|
35947
|
-
}
|
|
35948
|
-
purgeTimers[index] = t;
|
|
35268
|
+
return __privateMethod(this, _a_instances, V_fn).call(this, "delete");
|
|
35269
|
+
}
|
|
35270
|
+
}, _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(), _x = new WeakMap(), _a_instances = new WeakSet(), j_fn = function() {
|
|
35271
|
+
let t = new z2(__privateGet(this, _o2)), e = new z2(__privateGet(this, _o2));
|
|
35272
|
+
__privateSet(this, _d, t), __privateSet(this, _A, e);
|
|
35273
|
+
let i = this.ttlAutopurge ? new Array(__privateGet(this, _o2)) : void 0;
|
|
35274
|
+
__privateSet(this, _g, i), __privateSet(this, _N, (n, o, r = __privateGet(this, _m).now()) => {
|
|
35275
|
+
if (e[n] = o !== 0 ? r : 0, t[n] = o, i?.[n] && (clearTimeout(i[n]), i[n] = void 0), o !== 0 && i) {
|
|
35276
|
+
let f = setTimeout(() => {
|
|
35277
|
+
__privateGet(this, _p).call(this, n) && __privateMethod(this, _a_instances, E_fn).call(this, __privateGet(this, _i)[n], "expire");
|
|
35278
|
+
}, o + 1);
|
|
35279
|
+
f.unref && f.unref(), i[n] = f;
|
|
35280
|
+
}
|
|
35281
|
+
}), __privateSet(this, _R, (n) => {
|
|
35282
|
+
e[n] = t[n] !== 0 ? __privateGet(this, _m).now() : 0;
|
|
35283
|
+
}), __privateSet(this, _z, (n, o) => {
|
|
35284
|
+
if (t[o]) {
|
|
35285
|
+
let r = t[o], f = e[o];
|
|
35286
|
+
if (!r || !f) return;
|
|
35287
|
+
n.ttl = r, n.start = f, n.now = s || h();
|
|
35288
|
+
let m = n.now - f;
|
|
35289
|
+
n.remainingTTL = r - m;
|
|
35949
35290
|
}
|
|
35950
35291
|
});
|
|
35951
|
-
|
|
35952
|
-
|
|
35953
|
-
});
|
|
35954
|
-
__privateSet(this, _statusTTL, (status, index) => {
|
|
35955
|
-
if (ttls[index]) {
|
|
35956
|
-
const ttl = ttls[index];
|
|
35957
|
-
const start = starts[index];
|
|
35958
|
-
if (!ttl || !start)
|
|
35959
|
-
return;
|
|
35960
|
-
status.ttl = ttl;
|
|
35961
|
-
status.start = start;
|
|
35962
|
-
status.now = cachedNow || getNow();
|
|
35963
|
-
const age = status.now - start;
|
|
35964
|
-
status.remainingTTL = ttl - age;
|
|
35965
|
-
}
|
|
35966
|
-
});
|
|
35967
|
-
let cachedNow = 0;
|
|
35968
|
-
const getNow = () => {
|
|
35969
|
-
const n = __privateGet(this, _perf).now();
|
|
35292
|
+
let s = 0, h = () => {
|
|
35293
|
+
let n = __privateGet(this, _m).now();
|
|
35970
35294
|
if (this.ttlResolution > 0) {
|
|
35971
|
-
|
|
35972
|
-
|
|
35973
|
-
|
|
35974
|
-
t.unref();
|
|
35975
|
-
}
|
|
35295
|
+
s = n;
|
|
35296
|
+
let o = setTimeout(() => s = 0, this.ttlResolution);
|
|
35297
|
+
o.unref && o.unref();
|
|
35976
35298
|
}
|
|
35977
35299
|
return n;
|
|
35978
35300
|
};
|
|
35979
|
-
this.getRemainingTTL = (
|
|
35980
|
-
|
|
35981
|
-
if (
|
|
35982
|
-
|
|
35983
|
-
|
|
35984
|
-
|
|
35985
|
-
|
|
35986
|
-
|
|
35987
|
-
|
|
35988
|
-
|
|
35989
|
-
const age = (cachedNow || getNow()) - start;
|
|
35990
|
-
return ttl - age;
|
|
35991
|
-
};
|
|
35992
|
-
__privateSet(this, _isStale, (index) => {
|
|
35993
|
-
const s = starts[index];
|
|
35994
|
-
const t = ttls[index];
|
|
35995
|
-
return !!t && !!s && (cachedNow || getNow()) - s > t;
|
|
35996
|
-
});
|
|
35997
|
-
};
|
|
35998
|
-
_updateItemAge = new WeakMap();
|
|
35999
|
-
_statusTTL = new WeakMap();
|
|
36000
|
-
_setItemTTL = new WeakMap();
|
|
36001
|
-
_isStale = new WeakMap();
|
|
36002
|
-
initializeSizeTracking_fn = function() {
|
|
36003
|
-
const sizes = new ZeroArray(__privateGet(this, _max));
|
|
36004
|
-
__privateSet(this, _calculatedSize, 0);
|
|
36005
|
-
__privateSet(this, _sizes, sizes);
|
|
36006
|
-
__privateSet(this, _removeItemSize, (index) => {
|
|
36007
|
-
__privateSet(this, _calculatedSize, __privateGet(this, _calculatedSize) - sizes[index]);
|
|
36008
|
-
sizes[index] = 0;
|
|
36009
|
-
});
|
|
36010
|
-
__privateSet(this, _requireSize, (k, v, size, sizeCalculation) => {
|
|
36011
|
-
if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {
|
|
36012
|
-
return 0;
|
|
36013
|
-
}
|
|
36014
|
-
if (!isPosInt(size)) {
|
|
36015
|
-
if (sizeCalculation) {
|
|
36016
|
-
if (typeof sizeCalculation !== "function") {
|
|
36017
|
-
throw new TypeError("sizeCalculation must be a function");
|
|
36018
|
-
}
|
|
36019
|
-
size = sizeCalculation(v, k);
|
|
36020
|
-
if (!isPosInt(size)) {
|
|
36021
|
-
throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
36022
|
-
}
|
|
36023
|
-
} else {
|
|
36024
|
-
throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
36025
|
-
}
|
|
36026
|
-
}
|
|
36027
|
-
return size;
|
|
36028
|
-
});
|
|
36029
|
-
__privateSet(this, _addItemSize, (index, size, status) => {
|
|
36030
|
-
sizes[index] = size;
|
|
36031
|
-
if (__privateGet(this, _maxSize2)) {
|
|
36032
|
-
const maxSize = __privateGet(this, _maxSize2) - sizes[index];
|
|
36033
|
-
while (__privateGet(this, _calculatedSize) > maxSize) {
|
|
36034
|
-
__privateMethod(this, _LRUCache_instances, evict_fn).call(this, true);
|
|
36035
|
-
}
|
|
36036
|
-
}
|
|
36037
|
-
__privateSet(this, _calculatedSize, __privateGet(this, _calculatedSize) + sizes[index]);
|
|
36038
|
-
if (status) {
|
|
36039
|
-
status.entrySize = size;
|
|
36040
|
-
status.totalCalculatedSize = __privateGet(this, _calculatedSize);
|
|
36041
|
-
}
|
|
35301
|
+
this.getRemainingTTL = (n) => {
|
|
35302
|
+
let o = __privateGet(this, _s).get(n);
|
|
35303
|
+
if (o === void 0) return 0;
|
|
35304
|
+
let r = t[o], f = e[o];
|
|
35305
|
+
if (!r || !f) return 1 / 0;
|
|
35306
|
+
let m = (s || h()) - f;
|
|
35307
|
+
return r - m;
|
|
35308
|
+
}, __privateSet(this, _p, (n) => {
|
|
35309
|
+
let o = e[n], r = t[n];
|
|
35310
|
+
return !!r && !!o && (s || h()) - o > r;
|
|
36042
35311
|
});
|
|
36043
|
-
}
|
|
36044
|
-
|
|
36045
|
-
|
|
36046
|
-
|
|
36047
|
-
|
|
36048
|
-
|
|
36049
|
-
|
|
36050
|
-
if (
|
|
36051
|
-
|
|
36052
|
-
|
|
36053
|
-
|
|
36054
|
-
|
|
36055
|
-
|
|
36056
|
-
|
|
36057
|
-
|
|
36058
|
-
} else {
|
|
36059
|
-
i = __privateGet(this, _prev)[i];
|
|
36060
|
-
}
|
|
36061
|
-
}
|
|
36062
|
-
}
|
|
36063
|
-
};
|
|
36064
|
-
rindexes_fn = function* ({ allowStale = this.allowStale } = {}) {
|
|
36065
|
-
if (__privateGet(this, _size2)) {
|
|
36066
|
-
for (let i = __privateGet(this, _head); true; ) {
|
|
36067
|
-
if (!__privateMethod(this, _LRUCache_instances, isValidIndex_fn).call(this, i)) {
|
|
36068
|
-
break;
|
|
36069
|
-
}
|
|
36070
|
-
if (allowStale || !__privateGet(this, _isStale).call(this, i)) {
|
|
36071
|
-
yield i;
|
|
36072
|
-
}
|
|
36073
|
-
if (i === __privateGet(this, _tail)) {
|
|
36074
|
-
break;
|
|
36075
|
-
} else {
|
|
36076
|
-
i = __privateGet(this, _next)[i];
|
|
36077
|
-
}
|
|
35312
|
+
}, _R = new WeakMap(), _z = new WeakMap(), _N = new WeakMap(), _p = new WeakMap(), B_fn = function() {
|
|
35313
|
+
let t = new z2(__privateGet(this, _o2));
|
|
35314
|
+
__privateSet(this, __, 0), __privateSet(this, _y, t), __privateSet(this, _W, (e) => {
|
|
35315
|
+
__privateSet(this, __, __privateGet(this, __) - t[e]), t[e] = 0;
|
|
35316
|
+
}), __privateSet(this, _P, (e, i, s, h) => {
|
|
35317
|
+
if (__privateMethod(this, _a_instances, e_fn).call(this, i)) return 0;
|
|
35318
|
+
if (!y(s)) if (h) {
|
|
35319
|
+
if (typeof h != "function") throw new TypeError("sizeCalculation must be a function");
|
|
35320
|
+
if (s = h(i, e), !y(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
35321
|
+
} else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
35322
|
+
return s;
|
|
35323
|
+
}), __privateSet(this, _U, (e, i, s) => {
|
|
35324
|
+
if (t[e] = i, __privateGet(this, _c2)) {
|
|
35325
|
+
let h = __privateGet(this, _c2) - t[e];
|
|
35326
|
+
for (; __privateGet(this, __) > h; ) __privateMethod(this, _a_instances, M_fn).call(this, true);
|
|
36078
35327
|
}
|
|
36079
|
-
|
|
36080
|
-
};
|
|
36081
|
-
isValidIndex_fn = function(index) {
|
|
36082
|
-
return index !== void 0 && __privateGet(this, _keyMap).get(__privateGet(this, _keyList)[index]) === index;
|
|
36083
|
-
};
|
|
36084
|
-
evict_fn = function(free) {
|
|
36085
|
-
var _a3;
|
|
36086
|
-
const head = __privateGet(this, _head);
|
|
36087
|
-
const k = __privateGet(this, _keyList)[head];
|
|
36088
|
-
const v = __privateGet(this, _valList)[head];
|
|
36089
|
-
if (__privateGet(this, _hasFetchMethod) && __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {
|
|
36090
|
-
v.__abortController.abort(new Error("evicted"));
|
|
36091
|
-
} else if (__privateGet(this, _hasDispose) || __privateGet(this, _hasDisposeAfter)) {
|
|
36092
|
-
if (__privateGet(this, _hasDispose)) {
|
|
36093
|
-
(_a3 = __privateGet(this, _dispose)) == null ? void 0 : _a3.call(this, v, k, "evict");
|
|
36094
|
-
}
|
|
36095
|
-
if (__privateGet(this, _hasDisposeAfter)) {
|
|
36096
|
-
__privateGet(this, _disposed)?.push([v, k, "evict"]);
|
|
36097
|
-
}
|
|
36098
|
-
}
|
|
36099
|
-
__privateGet(this, _removeItemSize).call(this, head);
|
|
36100
|
-
if (__privateGet(this, _autopurgeTimers)?.[head]) {
|
|
36101
|
-
clearTimeout(__privateGet(this, _autopurgeTimers)[head]);
|
|
36102
|
-
__privateGet(this, _autopurgeTimers)[head] = void 0;
|
|
36103
|
-
}
|
|
36104
|
-
if (free) {
|
|
36105
|
-
__privateGet(this, _keyList)[head] = void 0;
|
|
36106
|
-
__privateGet(this, _valList)[head] = void 0;
|
|
36107
|
-
__privateGet(this, _free).push(head);
|
|
36108
|
-
}
|
|
36109
|
-
if (__privateGet(this, _size2) === 1) {
|
|
36110
|
-
__privateSet(this, _head, __privateSet(this, _tail, 0));
|
|
36111
|
-
__privateGet(this, _free).length = 0;
|
|
36112
|
-
} else {
|
|
36113
|
-
__privateSet(this, _head, __privateGet(this, _next)[head]);
|
|
36114
|
-
}
|
|
36115
|
-
__privateGet(this, _keyMap).delete(k);
|
|
36116
|
-
__privateWrapper(this, _size2)._--;
|
|
36117
|
-
return head;
|
|
36118
|
-
};
|
|
36119
|
-
backgroundFetch_fn = function(k, index, options, context) {
|
|
36120
|
-
const v = index === void 0 ? void 0 : __privateGet(this, _valList)[index];
|
|
36121
|
-
if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {
|
|
36122
|
-
return v;
|
|
36123
|
-
}
|
|
36124
|
-
const ac = new AC();
|
|
36125
|
-
const { signal } = options;
|
|
36126
|
-
signal?.addEventListener("abort", () => ac.abort(signal.reason), {
|
|
36127
|
-
signal: ac.signal
|
|
35328
|
+
__privateSet(this, __, __privateGet(this, __) + t[e]), s && (s.entrySize = i, s.totalCalculatedSize = __privateGet(this, __));
|
|
36128
35329
|
});
|
|
36129
|
-
|
|
36130
|
-
|
|
36131
|
-
|
|
36132
|
-
|
|
36133
|
-
|
|
36134
|
-
|
|
36135
|
-
|
|
36136
|
-
|
|
36137
|
-
|
|
36138
|
-
|
|
36139
|
-
|
|
36140
|
-
|
|
36141
|
-
|
|
36142
|
-
|
|
36143
|
-
|
|
36144
|
-
|
|
36145
|
-
|
|
36146
|
-
|
|
36147
|
-
|
|
36148
|
-
|
|
36149
|
-
|
|
36150
|
-
}
|
|
36151
|
-
|
|
36152
|
-
|
|
36153
|
-
|
|
36154
|
-
|
|
36155
|
-
|
|
36156
|
-
|
|
36157
|
-
|
|
36158
|
-
__privateMethod(this, _LRUCache_instances, delete_fn).call(this, k, "fetch");
|
|
36159
|
-
}
|
|
36160
|
-
} else {
|
|
36161
|
-
if (options.status)
|
|
36162
|
-
options.status.fetchUpdated = true;
|
|
36163
|
-
this.set(k, v2, fetchOpts.options);
|
|
36164
|
-
}
|
|
36165
|
-
}
|
|
36166
|
-
return v2;
|
|
36167
|
-
};
|
|
36168
|
-
const eb = (er) => {
|
|
36169
|
-
if (options.status) {
|
|
36170
|
-
options.status.fetchRejected = true;
|
|
36171
|
-
options.status.fetchError = er;
|
|
36172
|
-
}
|
|
36173
|
-
return fetchFail(er, false);
|
|
36174
|
-
};
|
|
36175
|
-
const fetchFail = (er, proceed) => {
|
|
36176
|
-
const { aborted: aborted2 } = ac.signal;
|
|
36177
|
-
const allowStaleAborted = aborted2 && options.allowStaleOnFetchAbort;
|
|
36178
|
-
const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;
|
|
36179
|
-
const noDelete = allowStale || options.noDeleteOnFetchRejection;
|
|
36180
|
-
const bf2 = p;
|
|
36181
|
-
if (__privateGet(this, _valList)[index] === p) {
|
|
36182
|
-
const del = !noDelete || !proceed && bf2.__staleWhileFetching === void 0;
|
|
36183
|
-
if (del) {
|
|
36184
|
-
__privateMethod(this, _LRUCache_instances, delete_fn).call(this, k, "fetch");
|
|
36185
|
-
} else if (!allowStaleAborted) {
|
|
36186
|
-
__privateGet(this, _valList)[index] = bf2.__staleWhileFetching;
|
|
36187
|
-
}
|
|
36188
|
-
}
|
|
36189
|
-
if (allowStale) {
|
|
36190
|
-
if (options.status && bf2.__staleWhileFetching !== void 0) {
|
|
36191
|
-
options.status.returnedStale = true;
|
|
36192
|
-
}
|
|
36193
|
-
return bf2.__staleWhileFetching;
|
|
36194
|
-
} else if (bf2.__returned === bf2) {
|
|
36195
|
-
throw er;
|
|
36196
|
-
}
|
|
36197
|
-
};
|
|
36198
|
-
const pcall = (res, rej) => {
|
|
36199
|
-
var _a3;
|
|
36200
|
-
const fmp = (_a3 = __privateGet(this, _fetchMethod)) == null ? void 0 : _a3.call(this, k, v, fetchOpts);
|
|
36201
|
-
if (fmp && fmp instanceof Promise) {
|
|
36202
|
-
fmp.then((v2) => res(v2 === void 0 ? void 0 : v2), rej);
|
|
36203
|
-
}
|
|
36204
|
-
ac.signal.addEventListener("abort", () => {
|
|
36205
|
-
if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {
|
|
36206
|
-
res(void 0);
|
|
36207
|
-
if (options.allowStaleOnFetchAbort) {
|
|
36208
|
-
res = (v2) => cb(v2, true);
|
|
36209
|
-
}
|
|
36210
|
-
}
|
|
35330
|
+
}, _W = new WeakMap(), _U = new WeakMap(), _P = new WeakMap(), F_fn = function* ({ allowStale: t = this.allowStale } = {}) {
|
|
35331
|
+
if (__privateGet(this, _n)) for (let e = __privateGet(this, _h); !(!__privateMethod(this, _a_instances, H_fn).call(this, e) || ((t || !__privateGet(this, _p).call(this, e)) && (yield e), e === __privateGet(this, _l))); ) e = __privateGet(this, _u)[e];
|
|
35332
|
+
}, O_fn = function* ({ allowStale: t = this.allowStale } = {}) {
|
|
35333
|
+
if (__privateGet(this, _n)) for (let e = __privateGet(this, _l); !(!__privateMethod(this, _a_instances, H_fn).call(this, e) || ((t || !__privateGet(this, _p).call(this, e)) && (yield e), e === __privateGet(this, _h))); ) e = __privateGet(this, _a4)[e];
|
|
35334
|
+
}, H_fn = function(t) {
|
|
35335
|
+
return t !== void 0 && __privateGet(this, _s).get(__privateGet(this, _i)[t]) === t;
|
|
35336
|
+
}, M_fn = function(t) {
|
|
35337
|
+
var _a5;
|
|
35338
|
+
let e = __privateGet(this, _l), i = __privateGet(this, _i)[e], s = __privateGet(this, _t)[e];
|
|
35339
|
+
return __privateGet(this, _v) && __privateMethod(this, _a_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;
|
|
35340
|
+
}, G_fn = function(t, e, i, s) {
|
|
35341
|
+
let h = e === void 0 ? void 0 : __privateGet(this, _t)[e];
|
|
35342
|
+
if (__privateMethod(this, _a_instances, e_fn).call(this, h)) return h;
|
|
35343
|
+
let n = new C(), { signal: o } = i;
|
|
35344
|
+
o?.addEventListener("abort", () => n.abort(o.reason), { signal: n.signal });
|
|
35345
|
+
let r = { signal: n.signal, options: i, context: s }, f = (p, _ = false) => {
|
|
35346
|
+
let { aborted: l } = n.signal, w = i.ignoreFetchAbort && p !== void 0, b = i.ignoreFetchAbort || !!(i.allowStaleOnFetchAbort && p !== void 0);
|
|
35347
|
+
if (i.status && (l && !_ ? (i.status.fetchAborted = true, i.status.fetchError = n.signal.reason, w && (i.status.fetchAbortIgnored = true)) : i.status.fetchResolved = true), l && !w && !_) return c(n.signal.reason, b);
|
|
35348
|
+
let S = g, u = __privateGet(this, _t)[e];
|
|
35349
|
+
return (u === g || w && _ && u === void 0) && (p === void 0 ? S.__staleWhileFetching !== void 0 ? __privateGet(this, _t)[e] = S.__staleWhileFetching : __privateMethod(this, _a_instances, E_fn).call(this, t, "fetch") : (i.status && (i.status.fetchUpdated = true), this.set(t, p, r.options))), p;
|
|
35350
|
+
}, m = (p) => (i.status && (i.status.fetchRejected = true, i.status.fetchError = p), c(p, false)), c = (p, _) => {
|
|
35351
|
+
let { aborted: l } = n.signal, w = l && i.allowStaleOnFetchAbort, b = w || i.allowStaleOnFetchRejection, S = b || i.noDeleteOnFetchRejection, u = g;
|
|
35352
|
+
if (__privateGet(this, _t)[e] === g && (!S || !_ && u.__staleWhileFetching === void 0 ? __privateMethod(this, _a_instances, E_fn).call(this, t, "fetch") : w || (__privateGet(this, _t)[e] = u.__staleWhileFetching)), b) return i.status && u.__staleWhileFetching !== void 0 && (i.status.returnedStale = true), u.__staleWhileFetching;
|
|
35353
|
+
if (u.__returned === u) throw p;
|
|
35354
|
+
}, d = (p, _) => {
|
|
35355
|
+
var _a5;
|
|
35356
|
+
let l = (_a5 = __privateGet(this, _L)) == null ? void 0 : _a5.call(this, t, h, r);
|
|
35357
|
+
l && l instanceof Promise && l.then((w) => p(w === void 0 ? void 0 : w), _), n.signal.addEventListener("abort", () => {
|
|
35358
|
+
(!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (p(void 0), i.allowStaleOnFetchAbort && (p = (w) => f(w, true)));
|
|
36211
35359
|
});
|
|
36212
35360
|
};
|
|
36213
|
-
|
|
36214
|
-
|
|
36215
|
-
|
|
36216
|
-
|
|
36217
|
-
|
|
36218
|
-
|
|
36219
|
-
|
|
36220
|
-
|
|
36221
|
-
|
|
36222
|
-
|
|
36223
|
-
|
|
36224
|
-
|
|
36225
|
-
|
|
36226
|
-
|
|
36227
|
-
|
|
36228
|
-
|
|
36229
|
-
|
|
36230
|
-
|
|
36231
|
-
|
|
36232
|
-
|
|
36233
|
-
|
|
36234
|
-
|
|
36235
|
-
|
|
36236
|
-
|
|
36237
|
-
|
|
36238
|
-
|
|
36239
|
-
|
|
36240
|
-
if (index !== __privateGet(this, _tail)) {
|
|
36241
|
-
if (index === __privateGet(this, _head)) {
|
|
36242
|
-
__privateSet(this, _head, __privateGet(this, _next)[index]);
|
|
36243
|
-
} else {
|
|
36244
|
-
__privateMethod(this, _LRUCache_instances, connect_fn).call(this, __privateGet(this, _prev)[index], __privateGet(this, _next)[index]);
|
|
36245
|
-
}
|
|
36246
|
-
__privateMethod(this, _LRUCache_instances, connect_fn).call(this, __privateGet(this, _tail), index);
|
|
36247
|
-
__privateSet(this, _tail, index);
|
|
36248
|
-
}
|
|
36249
|
-
};
|
|
36250
|
-
delete_fn = function(k, reason) {
|
|
36251
|
-
var _a3, _b2;
|
|
36252
|
-
let deleted = false;
|
|
36253
|
-
if (__privateGet(this, _size2) !== 0) {
|
|
36254
|
-
const index = __privateGet(this, _keyMap).get(k);
|
|
36255
|
-
if (index !== void 0) {
|
|
36256
|
-
if (__privateGet(this, _autopurgeTimers)?.[index]) {
|
|
36257
|
-
clearTimeout(__privateGet(this, _autopurgeTimers)?.[index]);
|
|
36258
|
-
__privateGet(this, _autopurgeTimers)[index] = void 0;
|
|
36259
|
-
}
|
|
36260
|
-
deleted = true;
|
|
36261
|
-
if (__privateGet(this, _size2) === 1) {
|
|
36262
|
-
__privateMethod(this, _LRUCache_instances, clear_fn).call(this, reason);
|
|
36263
|
-
} else {
|
|
36264
|
-
__privateGet(this, _removeItemSize).call(this, index);
|
|
36265
|
-
const v = __privateGet(this, _valList)[index];
|
|
36266
|
-
if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {
|
|
36267
|
-
v.__abortController.abort(new Error("deleted"));
|
|
36268
|
-
} else if (__privateGet(this, _hasDispose) || __privateGet(this, _hasDisposeAfter)) {
|
|
36269
|
-
if (__privateGet(this, _hasDispose)) {
|
|
36270
|
-
(_a3 = __privateGet(this, _dispose)) == null ? void 0 : _a3.call(this, v, k, reason);
|
|
36271
|
-
}
|
|
36272
|
-
if (__privateGet(this, _hasDisposeAfter)) {
|
|
36273
|
-
__privateGet(this, _disposed)?.push([v, k, reason]);
|
|
36274
|
-
}
|
|
36275
|
-
}
|
|
36276
|
-
__privateGet(this, _keyMap).delete(k);
|
|
36277
|
-
__privateGet(this, _keyList)[index] = void 0;
|
|
36278
|
-
__privateGet(this, _valList)[index] = void 0;
|
|
36279
|
-
if (index === __privateGet(this, _tail)) {
|
|
36280
|
-
__privateSet(this, _tail, __privateGet(this, _prev)[index]);
|
|
36281
|
-
} else if (index === __privateGet(this, _head)) {
|
|
36282
|
-
__privateSet(this, _head, __privateGet(this, _next)[index]);
|
|
36283
|
-
} else {
|
|
36284
|
-
const pi = __privateGet(this, _prev)[index];
|
|
36285
|
-
__privateGet(this, _next)[pi] = __privateGet(this, _next)[index];
|
|
36286
|
-
const ni = __privateGet(this, _next)[index];
|
|
36287
|
-
__privateGet(this, _prev)[ni] = __privateGet(this, _prev)[index];
|
|
36288
|
-
}
|
|
36289
|
-
__privateWrapper(this, _size2)._--;
|
|
36290
|
-
__privateGet(this, _free).push(index);
|
|
35361
|
+
i.status && (i.status.fetchDispatched = true);
|
|
35362
|
+
let g = new Promise(d).then(f, m), A = Object.assign(g, { __abortController: n, __staleWhileFetching: h, __returned: void 0 });
|
|
35363
|
+
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;
|
|
35364
|
+
}, e_fn = function(t) {
|
|
35365
|
+
if (!__privateGet(this, _v)) return false;
|
|
35366
|
+
let e = t;
|
|
35367
|
+
return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof C;
|
|
35368
|
+
}, k_fn = function(t, e) {
|
|
35369
|
+
__privateGet(this, _u)[e] = t, __privateGet(this, _a4)[t] = e;
|
|
35370
|
+
}, D_fn = function(t) {
|
|
35371
|
+
t !== __privateGet(this, _h) && (t === __privateGet(this, _l) ? __privateSet(this, _l, __privateGet(this, _a4)[t]) : __privateMethod(this, _a_instances, k_fn).call(this, __privateGet(this, _u)[t], __privateGet(this, _a4)[t]), __privateMethod(this, _a_instances, k_fn).call(this, __privateGet(this, _h), t), __privateSet(this, _h, t));
|
|
35372
|
+
}, E_fn = function(t, e) {
|
|
35373
|
+
var _a5, _b3;
|
|
35374
|
+
let i = false;
|
|
35375
|
+
if (__privateGet(this, _n) !== 0) {
|
|
35376
|
+
let s = __privateGet(this, _s).get(t);
|
|
35377
|
+
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, _a_instances, V_fn).call(this, e);
|
|
35378
|
+
else {
|
|
35379
|
+
__privateGet(this, _W).call(this, s);
|
|
35380
|
+
let h = __privateGet(this, _t)[s];
|
|
35381
|
+
if (__privateMethod(this, _a_instances, e_fn).call(this, h) ? h.__abortController.abort(new Error("deleted")) : (__privateGet(this, _T) || __privateGet(this, _f)) && (__privateGet(this, _T) && ((_a5 = __privateGet(this, _w)) == null ? void 0 : _a5.call(this, h, t, e)), __privateGet(this, _f) && __privateGet(this, _r)?.push([h, 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]);
|
|
35382
|
+
else if (s === __privateGet(this, _l)) __privateSet(this, _l, __privateGet(this, _a4)[s]);
|
|
35383
|
+
else {
|
|
35384
|
+
let n = __privateGet(this, _u)[s];
|
|
35385
|
+
__privateGet(this, _a4)[n] = __privateGet(this, _a4)[s];
|
|
35386
|
+
let o = __privateGet(this, _a4)[s];
|
|
35387
|
+
__privateGet(this, _u)[o] = __privateGet(this, _u)[s];
|
|
36291
35388
|
}
|
|
35389
|
+
__privateWrapper(this, _n)._--, __privateGet(this, _b2).push(s);
|
|
36292
35390
|
}
|
|
36293
35391
|
}
|
|
36294
|
-
if (__privateGet(this,
|
|
36295
|
-
|
|
36296
|
-
|
|
36297
|
-
while (task = dt?.shift()) {
|
|
36298
|
-
(_b2 = __privateGet(this, _disposeAfter)) == null ? void 0 : _b2.call(this, ...task);
|
|
36299
|
-
}
|
|
35392
|
+
if (__privateGet(this, _f) && __privateGet(this, _r)?.length) {
|
|
35393
|
+
let s = __privateGet(this, _r), h;
|
|
35394
|
+
for (; h = s?.shift(); ) (_b3 = __privateGet(this, _S)) == null ? void 0 : _b3.call(this, ...h);
|
|
36300
35395
|
}
|
|
36301
|
-
return
|
|
36302
|
-
}
|
|
36303
|
-
|
|
36304
|
-
|
|
36305
|
-
|
|
36306
|
-
|
|
36307
|
-
|
|
36308
|
-
|
|
36309
|
-
|
|
36310
|
-
const k = __privateGet(this, _keyList)[index];
|
|
36311
|
-
if (__privateGet(this, _hasDispose)) {
|
|
36312
|
-
(_a3 = __privateGet(this, _dispose)) == null ? void 0 : _a3.call(this, v, k, reason);
|
|
36313
|
-
}
|
|
36314
|
-
if (__privateGet(this, _hasDisposeAfter)) {
|
|
36315
|
-
__privateGet(this, _disposed)?.push([v, k, reason]);
|
|
36316
|
-
}
|
|
36317
|
-
}
|
|
36318
|
-
}
|
|
36319
|
-
__privateGet(this, _keyMap).clear();
|
|
36320
|
-
__privateGet(this, _valList).fill(void 0);
|
|
36321
|
-
__privateGet(this, _keyList).fill(void 0);
|
|
36322
|
-
if (__privateGet(this, _ttls) && __privateGet(this, _starts)) {
|
|
36323
|
-
__privateGet(this, _ttls).fill(0);
|
|
36324
|
-
__privateGet(this, _starts).fill(0);
|
|
36325
|
-
for (const t of __privateGet(this, _autopurgeTimers) ?? []) {
|
|
36326
|
-
if (t !== void 0)
|
|
36327
|
-
clearTimeout(t);
|
|
35396
|
+
return i;
|
|
35397
|
+
}, V_fn = function(t) {
|
|
35398
|
+
var _a5, _b3;
|
|
35399
|
+
for (let e of __privateMethod(this, _a_instances, O_fn).call(this, { allowStale: true })) {
|
|
35400
|
+
let i = __privateGet(this, _t)[e];
|
|
35401
|
+
if (__privateMethod(this, _a_instances, e_fn).call(this, i)) i.__abortController.abort(new Error("deleted"));
|
|
35402
|
+
else {
|
|
35403
|
+
let s = __privateGet(this, _i)[e];
|
|
35404
|
+
__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]);
|
|
36328
35405
|
}
|
|
36329
|
-
__privateGet(this, _autopurgeTimers)?.fill(void 0);
|
|
36330
35406
|
}
|
|
36331
|
-
if (__privateGet(this,
|
|
36332
|
-
__privateGet(this,
|
|
35407
|
+
if (__privateGet(this, _s).clear(), __privateGet(this, _t).fill(void 0), __privateGet(this, _i).fill(void 0), __privateGet(this, _d) && __privateGet(this, _A)) {
|
|
35408
|
+
__privateGet(this, _d).fill(0), __privateGet(this, _A).fill(0);
|
|
35409
|
+
for (let e of __privateGet(this, _g) ?? []) e !== void 0 && clearTimeout(e);
|
|
35410
|
+
__privateGet(this, _g)?.fill(void 0);
|
|
36333
35411
|
}
|
|
36334
|
-
__privateSet(this,
|
|
36335
|
-
|
|
36336
|
-
|
|
36337
|
-
__privateSet(this, _calculatedSize, 0);
|
|
36338
|
-
__privateSet(this, _size2, 0);
|
|
36339
|
-
if (__privateGet(this, _hasDisposeAfter) && __privateGet(this, _disposed)) {
|
|
36340
|
-
const dt = __privateGet(this, _disposed);
|
|
36341
|
-
let task;
|
|
36342
|
-
while (task = dt?.shift()) {
|
|
36343
|
-
(_b2 = __privateGet(this, _disposeAfter)) == null ? void 0 : _b2.call(this, ...task);
|
|
36344
|
-
}
|
|
35412
|
+
if (__privateGet(this, _y) && __privateGet(this, _y).fill(0), __privateSet(this, _l, 0), __privateSet(this, _h, 0), __privateGet(this, _b2).length = 0, __privateSet(this, __, 0), __privateSet(this, _n, 0), __privateGet(this, _f) && __privateGet(this, _r)) {
|
|
35413
|
+
let e = __privateGet(this, _r), i;
|
|
35414
|
+
for (; i = e?.shift(); ) (_b3 = __privateGet(this, _S)) == null ? void 0 : _b3.call(this, ...i);
|
|
36345
35415
|
}
|
|
36346
|
-
};
|
|
36347
|
-
var LRUCache = _LRUCache;
|
|
35416
|
+
}, _c);
|
|
36348
35417
|
|
|
36349
35418
|
// src/core/rich-caption-layout.ts
|
|
36350
35419
|
var RTL_RANGES = /[\u0590-\u05FF\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/;
|
|
@@ -36420,7 +35489,7 @@ function groupWordsByPause(store, pauseThreshold = 500) {
|
|
|
36420
35489
|
}
|
|
36421
35490
|
return groups;
|
|
36422
35491
|
}
|
|
36423
|
-
function breakIntoLines(wordWidths, maxWidth,
|
|
35492
|
+
function breakIntoLines(wordWidths, maxWidth, spaceWidth) {
|
|
36424
35493
|
const lines = [];
|
|
36425
35494
|
let currentLine = [];
|
|
36426
35495
|
let currentWidth = 0;
|
|
@@ -36433,22 +35502,19 @@ function breakIntoLines(wordWidths, maxWidth, maxLines, spaceWidth) {
|
|
|
36433
35502
|
} else {
|
|
36434
35503
|
if (currentLine.length > 0) {
|
|
36435
35504
|
lines.push(currentLine);
|
|
36436
|
-
if (lines.length >= maxLines) {
|
|
36437
|
-
return lines;
|
|
36438
|
-
}
|
|
36439
35505
|
}
|
|
36440
35506
|
currentLine = [i];
|
|
36441
35507
|
currentWidth = wordWidth;
|
|
36442
35508
|
}
|
|
36443
35509
|
}
|
|
36444
|
-
if (currentLine.length > 0
|
|
35510
|
+
if (currentLine.length > 0) {
|
|
36445
35511
|
lines.push(currentLine);
|
|
36446
35512
|
}
|
|
36447
35513
|
return lines;
|
|
36448
35514
|
}
|
|
36449
35515
|
var GLYPH_SIZE_ESTIMATE = 64;
|
|
36450
35516
|
function createShapedWordCache() {
|
|
36451
|
-
return new
|
|
35517
|
+
return new L({
|
|
36452
35518
|
max: 5e4,
|
|
36453
35519
|
maxSize: 50 * 1024 * 1024,
|
|
36454
35520
|
maxEntrySize: 100 * 1024,
|
|
@@ -36474,6 +35540,13 @@ function transformText(text, transform2) {
|
|
|
36474
35540
|
return text;
|
|
36475
35541
|
}
|
|
36476
35542
|
}
|
|
35543
|
+
function splitIntoChunks(arr, chunkSize) {
|
|
35544
|
+
const chunks = [];
|
|
35545
|
+
for (let i = 0; i < arr.length; i += chunkSize) {
|
|
35546
|
+
chunks.push(arr.slice(i, i + chunkSize));
|
|
35547
|
+
}
|
|
35548
|
+
return chunks;
|
|
35549
|
+
}
|
|
36477
35550
|
var CaptionLayoutEngine = class {
|
|
36478
35551
|
constructor(fontRegistry) {
|
|
36479
35552
|
__publicField(this, "fontRegistry");
|
|
@@ -36560,31 +35633,34 @@ var CaptionLayoutEngine = class {
|
|
|
36560
35633
|
const spaceWord = await this.measureWord(" ", measurementConfig);
|
|
36561
35634
|
spaceWidth = spaceWord.width + config2.wordSpacing;
|
|
36562
35635
|
}
|
|
36563
|
-
const groups = wordGroups.
|
|
35636
|
+
const groups = wordGroups.flatMap((indices) => {
|
|
36564
35637
|
const groupWidths = indices.map((i) => store.widths[i]);
|
|
36565
|
-
const
|
|
35638
|
+
const allLines = breakIntoLines(
|
|
36566
35639
|
groupWidths,
|
|
36567
35640
|
pixelMaxWidth,
|
|
36568
|
-
config2.maxLines,
|
|
36569
35641
|
spaceWidth
|
|
36570
35642
|
);
|
|
36571
|
-
const
|
|
36572
|
-
|
|
36573
|
-
const
|
|
35643
|
+
const lineChunks = splitIntoChunks(allLines, config2.maxLines);
|
|
35644
|
+
return lineChunks.map((chunkLines) => {
|
|
35645
|
+
const lines = chunkLines.map((lineWordIndices, lineIndex) => {
|
|
35646
|
+
const actualIndices = lineWordIndices.map((i) => indices[i]);
|
|
35647
|
+
const lineWidth = actualIndices.reduce((sum, idx) => sum + store.widths[idx], 0) + (actualIndices.length - 1) * spaceWidth;
|
|
35648
|
+
return {
|
|
35649
|
+
wordIndices: actualIndices,
|
|
35650
|
+
x: 0,
|
|
35651
|
+
y: lineIndex * config2.fontSize * config2.lineHeight,
|
|
35652
|
+
width: lineWidth,
|
|
35653
|
+
height: config2.fontSize
|
|
35654
|
+
};
|
|
35655
|
+
});
|
|
35656
|
+
const allWordIndices = lines.flatMap((l) => l.wordIndices);
|
|
36574
35657
|
return {
|
|
36575
|
-
wordIndices:
|
|
36576
|
-
|
|
36577
|
-
|
|
36578
|
-
|
|
36579
|
-
height: config2.fontSize
|
|
35658
|
+
wordIndices: allWordIndices,
|
|
35659
|
+
startTime: store.startTimes[allWordIndices[0]],
|
|
35660
|
+
endTime: store.endTimes[allWordIndices[allWordIndices.length - 1]],
|
|
35661
|
+
lines
|
|
36580
35662
|
};
|
|
36581
35663
|
});
|
|
36582
|
-
return {
|
|
36583
|
-
wordIndices: lines.flatMap((l) => l.wordIndices),
|
|
36584
|
-
startTime: store.startTimes[indices[0]],
|
|
36585
|
-
endTime: store.endTimes[indices[indices.length - 1]],
|
|
36586
|
-
lines
|
|
36587
|
-
};
|
|
36588
35664
|
});
|
|
36589
35665
|
const calculateGroupY = (group) => {
|
|
36590
35666
|
const totalHeight = group.lines.length * config2.fontSize * config2.lineHeight;
|
|
@@ -36959,11 +36035,11 @@ function extractFontConfig(asset) {
|
|
|
36959
36035
|
const font = asset.font;
|
|
36960
36036
|
const active = asset.active?.font;
|
|
36961
36037
|
return {
|
|
36962
|
-
family: font?.family ??
|
|
36038
|
+
family: font?.family ?? CANVAS_CONFIG.DEFAULTS.fontFamily,
|
|
36963
36039
|
size: font?.size ?? 24,
|
|
36964
36040
|
weight: String(font?.weight ?? "400"),
|
|
36965
36041
|
baseColor: font?.color ?? "#ffffff",
|
|
36966
|
-
activeColor: active?.color ?? "#
|
|
36042
|
+
activeColor: active?.color ?? "#ffffff",
|
|
36967
36043
|
baseOpacity: font?.opacity ?? 1,
|
|
36968
36044
|
activeOpacity: active?.opacity ?? 1,
|
|
36969
36045
|
letterSpacing: asset.style?.letterSpacing ?? 0
|
|
@@ -37722,20 +36798,20 @@ function createFrameSchedule(layout, durationMs, fps, animationStyle = "highligh
|
|
|
37722
36798
|
}
|
|
37723
36799
|
|
|
37724
36800
|
// src/env/entry.web.ts
|
|
37725
|
-
var
|
|
36801
|
+
var DEFAULT_OPEN_SANS_URL = "https://fonts.gstatic.com/s/opensans/v44/mem8YaGs126MiZpBA-U1UpcaXcl0Aw.ttf";
|
|
36802
|
+
FontRegistry.setFallbackLoader(async (desc) => {
|
|
36803
|
+
const family = (desc.family ?? "Open Sans").toLowerCase();
|
|
36804
|
+
const weight = `${desc.weight ?? "400"}`;
|
|
36805
|
+
if (family === "open sans" && weight === "400") {
|
|
36806
|
+
return fetchToArrayBuffer(DEFAULT_OPEN_SANS_URL);
|
|
36807
|
+
}
|
|
36808
|
+
return void 0;
|
|
36809
|
+
});
|
|
37726
36810
|
async function createTextEngine(opts = {}) {
|
|
37727
36811
|
const width = opts.width ?? CANVAS_CONFIG.DEFAULTS.width;
|
|
37728
36812
|
const height = opts.height ?? CANVAS_CONFIG.DEFAULTS.height;
|
|
37729
36813
|
const pixelRatio = opts.pixelRatio ?? CANVAS_CONFIG.DEFAULTS.pixelRatio;
|
|
37730
36814
|
const wasmBaseURL = "https://shotstack-ingest-api-dev-sources.s3.ap-southeast-2.amazonaws.com/euo5r93oyr/zzz01k9h-yycyx-2x2y6-qx9bj-7n567b/source.wasm";
|
|
37731
|
-
FontRegistry.setFallbackLoader(async (desc) => {
|
|
37732
|
-
const family = (desc.family ?? "Roboto").toLowerCase();
|
|
37733
|
-
const weight = `${desc.weight ?? "400"}`;
|
|
37734
|
-
if (family === "roboto" && weight === "400") {
|
|
37735
|
-
return fetchToArrayBuffer(DEFAULT_ROBOTO_URL);
|
|
37736
|
-
}
|
|
37737
|
-
return void 0;
|
|
37738
|
-
});
|
|
37739
36815
|
let fonts;
|
|
37740
36816
|
try {
|
|
37741
36817
|
fonts = await FontRegistry.getSharedInstance(wasmBaseURL);
|
|
@@ -37803,7 +36879,7 @@ async function createTextEngine(opts = {}) {
|
|
|
37803
36879
|
}
|
|
37804
36880
|
}
|
|
37805
36881
|
const main = asset.font ?? {
|
|
37806
|
-
family: "
|
|
36882
|
+
family: "Open Sans",
|
|
37807
36883
|
weight: "400",
|
|
37808
36884
|
size: 48,
|
|
37809
36885
|
color: "#000000",
|
|
@@ -37814,12 +36890,12 @@ async function createTextEngine(opts = {}) {
|
|
|
37814
36890
|
try {
|
|
37815
36891
|
await fonts.getFace(desc);
|
|
37816
36892
|
} catch {
|
|
37817
|
-
const
|
|
37818
|
-
if (
|
|
37819
|
-
if (!fonts.hasRegisteredFace({ family: "
|
|
37820
|
-
const bytes = await fetchToArrayBuffer(
|
|
36893
|
+
const wantsDefaultOpenSans = (main.family || "Open Sans").toLowerCase() === "open sans" && `${main.weight}` === "400";
|
|
36894
|
+
if (wantsDefaultOpenSans) {
|
|
36895
|
+
if (!fonts.hasRegisteredFace({ family: "Open Sans", weight: "400" })) {
|
|
36896
|
+
const bytes = await fetchToArrayBuffer(DEFAULT_OPEN_SANS_URL);
|
|
37821
36897
|
await fonts.registerFromBytes(bytes, {
|
|
37822
|
-
family: "
|
|
36898
|
+
family: "Open Sans",
|
|
37823
36899
|
weight: "400"
|
|
37824
36900
|
});
|
|
37825
36901
|
}
|
|
@@ -38034,6 +37110,7 @@ export {
|
|
|
38034
37110
|
WebCodecsEncoder,
|
|
38035
37111
|
WordTimingStore,
|
|
38036
37112
|
arcToCubicBeziers,
|
|
37113
|
+
breakIntoLines,
|
|
38037
37114
|
calculateAnimationStatesForGroup,
|
|
38038
37115
|
commandsToPathString,
|
|
38039
37116
|
computeSimplePathBounds,
|