@byloth/core 2.2.7 → 2.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.esm.js +114 -109
- package/dist/core.esm.js.map +1 -1
- package/dist/core.global.js +1 -1
- package/dist/core.global.js.map +1 -1
- package/dist/core.umd.cjs +1 -1
- package/dist/core.umd.cjs.map +1 -1
- package/package.json +8 -8
- package/src/index.ts +1 -1
- package/src/models/callbacks/switchable-callback.ts +65 -8
- package/src/models/exceptions/index.ts +14 -1
package/dist/core.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var j = typeof window < "u" && typeof window.document < "u", W = typeof process < "u" && !!process.versions?.node, U = typeof self == "object" && self.constructor?.name === "DedicatedWorkerGlobalScope", m = class M extends Error {
|
|
2
2
|
static FromUnknown(e) {
|
|
3
3
|
if (e instanceof M) return e;
|
|
4
4
|
if (e instanceof Error) {
|
|
@@ -16,22 +16,22 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
16
16
|
r === void 0 && (r = "The program has encountered an unrecoverable error and cannot continue as expected. Please, try again later. If the problem persists, contact the support team."), super(r, e, t);
|
|
17
17
|
}
|
|
18
18
|
[Symbol.toStringTag] = "FatalErrorException";
|
|
19
|
-
},
|
|
19
|
+
}, B = class extends E {
|
|
20
20
|
constructor(r, e, t = "NotImplementedException") {
|
|
21
21
|
r === void 0 && (r = "This feature isn't implemented yet. Please, try again later."), super(r, e, t);
|
|
22
22
|
}
|
|
23
23
|
[Symbol.toStringTag] = "NotImplementedException";
|
|
24
|
-
},
|
|
24
|
+
}, D = class extends m {
|
|
25
25
|
constructor(r, e, t = "FileException") {
|
|
26
26
|
super(r, e, t);
|
|
27
27
|
}
|
|
28
28
|
[Symbol.toStringTag] = "FileException";
|
|
29
|
-
},
|
|
29
|
+
}, ee = class extends D {
|
|
30
30
|
constructor(r, e, t = "FileExistsException") {
|
|
31
31
|
super(r, e, t);
|
|
32
32
|
}
|
|
33
33
|
[Symbol.toStringTag] = "FileExistsException";
|
|
34
|
-
},
|
|
34
|
+
}, te = class extends D {
|
|
35
35
|
constructor(r, e, t = "FileNotFoundException") {
|
|
36
36
|
super(r, e, t);
|
|
37
37
|
}
|
|
@@ -41,18 +41,20 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
41
41
|
super(r, e, t);
|
|
42
42
|
}
|
|
43
43
|
[Symbol.toStringTag] = "KeyException";
|
|
44
|
-
},
|
|
44
|
+
}, Y = class extends m {
|
|
45
45
|
constructor(r, e, t = "NetworkException") {
|
|
46
46
|
super(r, e, t);
|
|
47
47
|
}
|
|
48
48
|
[Symbol.toStringTag] = "NetworkException";
|
|
49
|
-
},
|
|
49
|
+
}, ne = class extends Y {
|
|
50
50
|
response;
|
|
51
51
|
constructor(r, e, t = "ResponseException") {
|
|
52
|
-
|
|
52
|
+
let n;
|
|
53
|
+
const s = r.url ? ` to "${r.url}"` : "", i = r.statusText ? `${r.status} (${r.statusText})` : r.status;
|
|
54
|
+
r.statusText ? n = `The request${s} failed with status ${i}.` : n = `The request${s} failed with status ${i}.`, super(n, e, t), this.response = r;
|
|
53
55
|
}
|
|
54
56
|
[Symbol.toStringTag] = "ResponseException";
|
|
55
|
-
},
|
|
57
|
+
}, re = class extends m {
|
|
56
58
|
constructor(r, e, t = "PermissionException") {
|
|
57
59
|
super(r, e, t);
|
|
58
60
|
}
|
|
@@ -67,17 +69,17 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
67
69
|
super(r, e, t);
|
|
68
70
|
}
|
|
69
71
|
[Symbol.toStringTag] = "RuntimeException";
|
|
70
|
-
},
|
|
72
|
+
}, V = class extends w {
|
|
71
73
|
constructor(r, e, t = "EnvironmentException") {
|
|
72
74
|
super(r, e, t);
|
|
73
75
|
}
|
|
74
76
|
[Symbol.toStringTag] = "EnvironmentException";
|
|
75
|
-
},
|
|
77
|
+
}, J = class extends m {
|
|
76
78
|
constructor(r, e, t = "TimeoutException") {
|
|
77
79
|
super(r, e, t);
|
|
78
80
|
}
|
|
79
81
|
[Symbol.toStringTag] = "TimeoutException";
|
|
80
|
-
},
|
|
82
|
+
}, se = class extends m {
|
|
81
83
|
constructor(r, e, t = "TypeException") {
|
|
82
84
|
super(r, e, t);
|
|
83
85
|
}
|
|
@@ -365,7 +367,7 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
365
367
|
return Object.fromEntries(this.entries());
|
|
366
368
|
}
|
|
367
369
|
[Symbol.toStringTag] = "ReducedIterator";
|
|
368
|
-
},
|
|
370
|
+
}, L = class p {
|
|
369
371
|
_elements;
|
|
370
372
|
constructor(e) {
|
|
371
373
|
this._elements = new R(e);
|
|
@@ -729,7 +731,7 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
729
731
|
throw e;
|
|
730
732
|
}
|
|
731
733
|
groupBy(e) {
|
|
732
|
-
return new
|
|
734
|
+
return new L(this.map(async (t, n) => [await e(t, n), t]));
|
|
733
735
|
}
|
|
734
736
|
toArray() {
|
|
735
737
|
return Array.fromAsync(this);
|
|
@@ -924,14 +926,14 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
924
926
|
return e;
|
|
925
927
|
}
|
|
926
928
|
[Symbol.toStringTag] = "AggregatedIterator";
|
|
927
|
-
},
|
|
929
|
+
}, G = Function, $ = class extends G {
|
|
928
930
|
constructor() {
|
|
929
931
|
super("return this._invoke(...arguments);");
|
|
930
932
|
const r = this.bind(this);
|
|
931
933
|
return Object.setPrototypeOf(this, r), r;
|
|
932
934
|
}
|
|
933
935
|
[Symbol.toStringTag] = "CallableObject";
|
|
934
|
-
},
|
|
936
|
+
}, ie = class extends $ {
|
|
935
937
|
_callbacks;
|
|
936
938
|
get size() {
|
|
937
939
|
return this._callbacks.length;
|
|
@@ -997,8 +999,10 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
997
999
|
this.publish("__internals__:clear"), this._subscribers.clear();
|
|
998
1000
|
}
|
|
999
1001
|
[Symbol.toStringTag] = "Publisher";
|
|
1000
|
-
},
|
|
1001
|
-
},
|
|
1002
|
+
}, H = () => {
|
|
1003
|
+
}, P = () => {
|
|
1004
|
+
throw new B("The `SwitchableCallback` has no callback defined yet. Did you forget to call the `register` method?");
|
|
1005
|
+
}, oe = class extends $ {
|
|
1002
1006
|
_callback;
|
|
1003
1007
|
_callbacks;
|
|
1004
1008
|
_isEnabled;
|
|
@@ -1011,9 +1015,7 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
1011
1015
|
}
|
|
1012
1016
|
_invoke;
|
|
1013
1017
|
constructor(r, e = "default") {
|
|
1014
|
-
super(), this._callbacks = /* @__PURE__ */ new Map(), this._isEnabled = !0, r ? this._callbacks.set(e, r) : (e = "", r = (
|
|
1015
|
-
throw new $("The `SwitchableCallback` has no callback defined yet. Did you forget to call the `register` method?");
|
|
1016
|
-
})), this._key = e, this._callback = r, this._invoke = (...t) => this._callback(...t);
|
|
1018
|
+
super(), this._callbacks = /* @__PURE__ */ new Map(), this._isEnabled = !0, r ? this._callbacks.set(e, r) : (e = "", r = P), this._key = e, this._callback = r, this._invoke = (...t) => this._callback(...t);
|
|
1017
1019
|
}
|
|
1018
1020
|
enable(r) {
|
|
1019
1021
|
if (r === void 0) {
|
|
@@ -1027,7 +1029,7 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
1027
1029
|
}
|
|
1028
1030
|
disable() {
|
|
1029
1031
|
if (!this._isEnabled) throw new w("The `SwitchableCallback` is already disabled.");
|
|
1030
|
-
this._callback =
|
|
1032
|
+
this._callback = H, this._isEnabled = !1;
|
|
1031
1033
|
}
|
|
1032
1034
|
register(r, e) {
|
|
1033
1035
|
if (this._callbacks.size === 0)
|
|
@@ -1044,8 +1046,11 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
1044
1046
|
if (!this._callbacks.has(r)) throw new g(`The key '${r}' doesn't yet have any associated callback.`);
|
|
1045
1047
|
this._key !== r && (this._key = r, this._isEnabled && (this._callback = this._callbacks.get(r)));
|
|
1046
1048
|
}
|
|
1049
|
+
reset(r, e = "default") {
|
|
1050
|
+
this._callbacks.clear(), this._isEnabled = !0, r ? this._callbacks.set(e, r) : (e = "", r = P), this._key = e, this._callback = r;
|
|
1051
|
+
}
|
|
1047
1052
|
[Symbol.toStringTag] = "SwitchableCallback";
|
|
1048
|
-
},
|
|
1053
|
+
}, ae = class extends Array {
|
|
1049
1054
|
_publisher;
|
|
1050
1055
|
constructor(...r) {
|
|
1051
1056
|
super(...r), this._publisher = new I();
|
|
@@ -1092,7 +1097,7 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
1092
1097
|
}
|
|
1093
1098
|
[Symbol.toStringTag] = "ArrayView";
|
|
1094
1099
|
static [Symbol.species] = Array;
|
|
1095
|
-
},
|
|
1100
|
+
}, le = class extends Map {
|
|
1096
1101
|
_publisher;
|
|
1097
1102
|
constructor(r) {
|
|
1098
1103
|
if (super(), this._publisher = new I(), r) for (const [e, t] of r) super.set(e, t);
|
|
@@ -1118,7 +1123,7 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
1118
1123
|
return this._publisher.subscribe("clear", r);
|
|
1119
1124
|
}
|
|
1120
1125
|
[Symbol.toStringTag] = "MapView";
|
|
1121
|
-
},
|
|
1126
|
+
}, ue = class extends Set {
|
|
1122
1127
|
_publisher;
|
|
1123
1128
|
constructor(r) {
|
|
1124
1129
|
if (super(), this._publisher = new I(), r) for (const e of r) super.add(e);
|
|
@@ -1144,12 +1149,12 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
1144
1149
|
return this._publisher.subscribe("clear", r);
|
|
1145
1150
|
}
|
|
1146
1151
|
[Symbol.toStringTag] = "SetView";
|
|
1147
|
-
},
|
|
1152
|
+
}, ce = class {
|
|
1148
1153
|
_preferPersistence;
|
|
1149
1154
|
_volatile;
|
|
1150
1155
|
_persistent;
|
|
1151
1156
|
constructor(r = !0) {
|
|
1152
|
-
if (!
|
|
1157
|
+
if (!j) throw new V("The `JSONStorage` class can only be instantiated within a browser environment.");
|
|
1153
1158
|
this._preferPersistence = r, this._volatile = window.sessionStorage, this._persistent = window.localStorage;
|
|
1154
1159
|
}
|
|
1155
1160
|
_get(r, e, t) {
|
|
@@ -1266,19 +1271,19 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
1266
1271
|
return r.then(this.resolve, this.reject), this;
|
|
1267
1272
|
}
|
|
1268
1273
|
[Symbol.toStringTag] = "DeferredPromise";
|
|
1269
|
-
},
|
|
1274
|
+
}, K = class extends b {
|
|
1270
1275
|
constructor(r, e) {
|
|
1271
1276
|
super((t, n) => {
|
|
1272
1277
|
const s = (a) => {
|
|
1273
1278
|
clearTimeout(l), t(a);
|
|
1274
1279
|
}, i = (a) => {
|
|
1275
1280
|
clearTimeout(l), n(a);
|
|
1276
|
-
}, l = setTimeout(() => i(new
|
|
1281
|
+
}, l = setTimeout(() => i(new J("The operation has timed out.")), e);
|
|
1277
1282
|
r(s, i);
|
|
1278
1283
|
});
|
|
1279
1284
|
}
|
|
1280
1285
|
[Symbol.toStringTag] = "TimedPromise";
|
|
1281
|
-
},
|
|
1286
|
+
}, he = class extends b {
|
|
1282
1287
|
_count;
|
|
1283
1288
|
get isPending() {
|
|
1284
1289
|
return this._count > 0;
|
|
@@ -1304,19 +1309,19 @@ var P = typeof window < "u" && typeof window.document < "u", Z = typeof process
|
|
|
1304
1309
|
this._count -= 1, s(i);
|
|
1305
1310
|
});
|
|
1306
1311
|
};
|
|
1307
|
-
return e ? new
|
|
1312
|
+
return e ? new K(t, e) : new b(t);
|
|
1308
1313
|
}
|
|
1309
1314
|
[Symbol.toStringTag] = "PromiseQueue";
|
|
1310
1315
|
}, y = /* @__PURE__ */ (function(r) {
|
|
1311
1316
|
return r[r.Millisecond = 1] = "Millisecond", r[r.Second = 1e3] = "Second", r[r.Minute = 60 * r.Second] = "Minute", r[r.Hour = 60 * r.Minute] = "Hour", r[r.Day = 24 * r.Hour] = "Day", r[r.Week = 7 * r.Day] = "Week", r[r.Month = 30 * r.Day] = "Month", r[r.Year = 365 * r.Day] = "Year", r;
|
|
1312
|
-
})({}),
|
|
1317
|
+
})({}), Q = /* @__PURE__ */ (function(r) {
|
|
1313
1318
|
return r[r.Sunday = 0] = "Sunday", r[r.Monday = 1] = "Monday", r[r.Tuesday = 2] = "Tuesday", r[r.Wednesday = 3] = "Wednesday", r[r.Thursday = 4] = "Thursday", r[r.Friday = 5] = "Friday", r[r.Saturday = 6] = "Saturday", r;
|
|
1314
1319
|
})({});
|
|
1315
|
-
function
|
|
1320
|
+
function fe(r, e, t = y.Day) {
|
|
1316
1321
|
let n;
|
|
1317
1322
|
return r = new Date(r), e = new Date(e), r < e ? n = Math.floor : n = Math.ceil, n((e.getTime() - r.getTime()) / t);
|
|
1318
1323
|
}
|
|
1319
|
-
function
|
|
1324
|
+
function de(r, e, t = y.Day) {
|
|
1320
1325
|
if (r = new Date(r), e = new Date(e), r >= e) throw new k("The end date must be greater than the start date.");
|
|
1321
1326
|
return new h(function* () {
|
|
1322
1327
|
const n = e.getTime();
|
|
@@ -1325,15 +1330,15 @@ function fe(r, e, t = y.Day) {
|
|
|
1325
1330
|
yield new Date(s), s += t;
|
|
1326
1331
|
});
|
|
1327
1332
|
}
|
|
1328
|
-
function
|
|
1333
|
+
function X(r, e = y.Day) {
|
|
1329
1334
|
if (e <= y.Millisecond) throw new k("Rounding a timestamp by milliseconds or less makes no sense.Use the timestamp value directly instead.");
|
|
1330
1335
|
if (e > y.Day) throw new k("Rounding by more than a day leads to unexpected results. Consider using other methods to round dates by weeks, months or years.");
|
|
1331
1336
|
return r = new Date(r), new Date(Math.floor(r.getTime() / e) * e);
|
|
1332
1337
|
}
|
|
1333
|
-
function
|
|
1338
|
+
function me(r, e = Q.Sunday) {
|
|
1334
1339
|
r = new Date(r);
|
|
1335
1340
|
const t = 7 - e, n = (r.getUTCDay() + t) % 7, s = r.getTime() - y.Day * n;
|
|
1336
|
-
return
|
|
1341
|
+
return X(new Date(s));
|
|
1337
1342
|
}
|
|
1338
1343
|
var O = class {
|
|
1339
1344
|
_handle;
|
|
@@ -1352,7 +1357,7 @@ var O = class {
|
|
|
1352
1357
|
_start;
|
|
1353
1358
|
_stop;
|
|
1354
1359
|
constructor(r, e = 40) {
|
|
1355
|
-
this._startTime = 0, this._isRunning = !1,
|
|
1360
|
+
this._startTime = 0, this._isRunning = !1, j ? (this._start = () => {
|
|
1356
1361
|
r(this.elapsedTime), this._handle = window.requestAnimationFrame(this._start);
|
|
1357
1362
|
}, this._stop = () => window.cancelAnimationFrame(this._handle)) : (console.warn(`Not a browser environment detected. Using setInterval@${e}ms instead of requestAnimationFrame...`), this._start = () => {
|
|
1358
1363
|
this._handle = setInterval(() => r(this.elapsedTime), e);
|
|
@@ -1374,7 +1379,7 @@ var O = class {
|
|
|
1374
1379
|
return this._publisher.subscribe("stop", r);
|
|
1375
1380
|
}
|
|
1376
1381
|
[Symbol.toStringTag] = "GameLoop";
|
|
1377
|
-
},
|
|
1382
|
+
}, we = class extends O {
|
|
1378
1383
|
constructor(r = y.Second) {
|
|
1379
1384
|
super((e) => this._publisher.publish("tick", e), r);
|
|
1380
1385
|
}
|
|
@@ -1396,7 +1401,7 @@ var O = class {
|
|
|
1396
1401
|
});
|
|
1397
1402
|
}
|
|
1398
1403
|
[Symbol.toStringTag] = "Clock";
|
|
1399
|
-
},
|
|
1404
|
+
}, pe = class extends O {
|
|
1400
1405
|
_duration;
|
|
1401
1406
|
get duration() {
|
|
1402
1407
|
return this._duration;
|
|
@@ -1437,7 +1442,7 @@ var O = class {
|
|
|
1437
1442
|
return this._publisher.subscribe("expire", r);
|
|
1438
1443
|
}
|
|
1439
1444
|
[Symbol.toStringTag] = "Countdown";
|
|
1440
|
-
},
|
|
1445
|
+
}, _e = class {
|
|
1441
1446
|
static Linear(r) {
|
|
1442
1447
|
const e = r - 1;
|
|
1443
1448
|
return new h(function* () {
|
|
@@ -1454,7 +1459,7 @@ var O = class {
|
|
|
1454
1459
|
constructor() {
|
|
1455
1460
|
}
|
|
1456
1461
|
[Symbol.toStringTag] = "Curve";
|
|
1457
|
-
},
|
|
1462
|
+
}, ye = class u {
|
|
1458
1463
|
static #t(e) {
|
|
1459
1464
|
let t = e | 0;
|
|
1460
1465
|
return () => {
|
|
@@ -1588,40 +1593,40 @@ var O = class {
|
|
|
1588
1593
|
}
|
|
1589
1594
|
[Symbol.toStringTag] = "Random";
|
|
1590
1595
|
};
|
|
1591
|
-
function
|
|
1596
|
+
function be(r) {
|
|
1592
1597
|
return new b((e) => setTimeout(e, r));
|
|
1593
1598
|
}
|
|
1594
|
-
function
|
|
1599
|
+
function ge() {
|
|
1595
1600
|
return new b((r) => requestAnimationFrame(() => r()));
|
|
1596
1601
|
}
|
|
1597
|
-
function
|
|
1602
|
+
function xe() {
|
|
1598
1603
|
return new b((r) => setTimeout(r));
|
|
1599
1604
|
}
|
|
1600
|
-
function
|
|
1605
|
+
function ve(r, e = "text/javascript") {
|
|
1601
1606
|
return new b((t, n) => {
|
|
1602
1607
|
const s = document.createElement("script");
|
|
1603
1608
|
s.async = !0, s.defer = !0, s.src = r, s.type = e, s.onload = (i) => t(), s.onerror = (i) => n(i), document.body.appendChild(s);
|
|
1604
1609
|
});
|
|
1605
1610
|
}
|
|
1606
|
-
function
|
|
1611
|
+
function Se(...r) {
|
|
1607
1612
|
return new h(function* () {
|
|
1608
1613
|
for (const e of r) for (const t of e) yield t;
|
|
1609
1614
|
});
|
|
1610
1615
|
}
|
|
1611
|
-
function
|
|
1616
|
+
function ke(r) {
|
|
1612
1617
|
if (r instanceof Array) return r.length;
|
|
1613
1618
|
let e = 0;
|
|
1614
1619
|
for (const t of r) e += 1;
|
|
1615
1620
|
return e;
|
|
1616
1621
|
}
|
|
1617
|
-
function
|
|
1622
|
+
function Te(r) {
|
|
1618
1623
|
return new h(function* () {
|
|
1619
1624
|
let e = 0;
|
|
1620
1625
|
for (const t of r)
|
|
1621
1626
|
yield [e, t], e += 1;
|
|
1622
1627
|
});
|
|
1623
1628
|
}
|
|
1624
|
-
function
|
|
1629
|
+
function Ee(r, e, t = 1) {
|
|
1625
1630
|
if (t <= 0) throw new k("Step must be always a positive number, even when generating numbers in reverse order.");
|
|
1626
1631
|
return e === void 0 && (e = r, r = 0), r > e ? new h(function* () {
|
|
1627
1632
|
for (let n = r; n > e; n -= t) yield n;
|
|
@@ -1629,7 +1634,7 @@ function Te(r, e, t = 1) {
|
|
|
1629
1634
|
for (let n = r; n < e; n += t) yield n;
|
|
1630
1635
|
});
|
|
1631
1636
|
}
|
|
1632
|
-
function
|
|
1637
|
+
function Me(r) {
|
|
1633
1638
|
const e = Array.from(r);
|
|
1634
1639
|
for (let t = e.length - 1; t > 0; t -= 1) {
|
|
1635
1640
|
const n = Math.floor(Math.random() * (t + 1));
|
|
@@ -1637,14 +1642,14 @@ function Ee(r) {
|
|
|
1637
1642
|
}
|
|
1638
1643
|
return e;
|
|
1639
1644
|
}
|
|
1640
|
-
function
|
|
1645
|
+
function Ie(r) {
|
|
1641
1646
|
return new h(function* () {
|
|
1642
1647
|
const e = /* @__PURE__ */ new Set();
|
|
1643
1648
|
for (const t of r)
|
|
1644
1649
|
e.has(t) || (e.add(t), yield t);
|
|
1645
1650
|
});
|
|
1646
1651
|
}
|
|
1647
|
-
function
|
|
1652
|
+
function Z(r, e) {
|
|
1648
1653
|
const t = r[Symbol.iterator](), n = e[Symbol.iterator]();
|
|
1649
1654
|
return new h(function* () {
|
|
1650
1655
|
for (; ; ) {
|
|
@@ -1654,7 +1659,7 @@ function X(r, e) {
|
|
|
1654
1659
|
}
|
|
1655
1660
|
});
|
|
1656
1661
|
}
|
|
1657
|
-
function
|
|
1662
|
+
function Ae(r, e) {
|
|
1658
1663
|
if (e === void 0) {
|
|
1659
1664
|
let i = 0, o = 0;
|
|
1660
1665
|
for (const l of r)
|
|
@@ -1663,7 +1668,7 @@ function Ie(r, e) {
|
|
|
1663
1668
|
return i / o;
|
|
1664
1669
|
}
|
|
1665
1670
|
let t = 0, n = 0, s = 0;
|
|
1666
|
-
for (const [i, o] of
|
|
1671
|
+
for (const [i, o] of Z(r, e)) {
|
|
1667
1672
|
if (o <= 0) throw new c(`The weight for the value #${s} must be greater than zero.`);
|
|
1668
1673
|
t += i * o, n += o, s += 1;
|
|
1669
1674
|
}
|
|
@@ -1671,11 +1676,11 @@ function Ie(r, e) {
|
|
|
1671
1676
|
if (n <= 0) throw new c("The sum of weights must be greater than zero.");
|
|
1672
1677
|
return t / n;
|
|
1673
1678
|
}
|
|
1674
|
-
function
|
|
1679
|
+
function Re(r, e, t) {
|
|
1675
1680
|
if (e > t) throw new c("The minimum bound must be less than or equal to the maximum bound.");
|
|
1676
1681
|
return r < e ? e : r > t ? t : r;
|
|
1677
1682
|
}
|
|
1678
|
-
function
|
|
1683
|
+
function Fe(r) {
|
|
1679
1684
|
let e = 0;
|
|
1680
1685
|
for (let t = 0; t < r.length; t += 1) {
|
|
1681
1686
|
const n = r.charCodeAt(t);
|
|
@@ -1683,81 +1688,81 @@ function Re(r) {
|
|
|
1683
1688
|
}
|
|
1684
1689
|
return e;
|
|
1685
1690
|
}
|
|
1686
|
-
function
|
|
1691
|
+
function Ce(r) {
|
|
1687
1692
|
let e = 0;
|
|
1688
1693
|
for (const t of r) e += t;
|
|
1689
1694
|
return e;
|
|
1690
1695
|
}
|
|
1691
|
-
function
|
|
1696
|
+
function Pe(r) {
|
|
1692
1697
|
return `${r.charAt(0).toUpperCase()}${r.slice(1)}`;
|
|
1693
1698
|
}
|
|
1694
|
-
var
|
|
1699
|
+
var je = "2.2.9";
|
|
1695
1700
|
export {
|
|
1696
|
-
|
|
1701
|
+
L as AggregatedAsyncIterator,
|
|
1697
1702
|
F as AggregatedIterator,
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1703
|
+
ae as ArrayView,
|
|
1704
|
+
$ as CallableObject,
|
|
1705
|
+
ie as CallbackChain,
|
|
1706
|
+
we as Clock,
|
|
1707
|
+
pe as Countdown,
|
|
1708
|
+
_e as Curve,
|
|
1704
1709
|
q as DeferredPromise,
|
|
1705
|
-
|
|
1710
|
+
V as EnvironmentException,
|
|
1706
1711
|
m as Exception,
|
|
1707
1712
|
E as FatalErrorException,
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1713
|
+
D as FileException,
|
|
1714
|
+
ee as FileExistsException,
|
|
1715
|
+
te as FileNotFoundException,
|
|
1711
1716
|
O as GameLoop,
|
|
1712
|
-
|
|
1717
|
+
ce as JSONStorage,
|
|
1713
1718
|
g as KeyException,
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
+
le as MapView,
|
|
1720
|
+
Y as NetworkException,
|
|
1721
|
+
B as NotImplementedException,
|
|
1722
|
+
re as PermissionException,
|
|
1723
|
+
he as PromiseQueue,
|
|
1719
1724
|
I as Publisher,
|
|
1720
|
-
|
|
1725
|
+
ye as Random,
|
|
1721
1726
|
k as RangeException,
|
|
1722
1727
|
d as ReducedIterator,
|
|
1723
1728
|
A as ReferenceException,
|
|
1724
|
-
|
|
1729
|
+
ne as ResponseException,
|
|
1725
1730
|
w as RuntimeException,
|
|
1726
|
-
|
|
1731
|
+
ue as SetView,
|
|
1727
1732
|
R as SmartAsyncIterator,
|
|
1728
1733
|
h as SmartIterator,
|
|
1729
1734
|
b as SmartPromise,
|
|
1730
|
-
|
|
1735
|
+
oe as SwitchableCallback,
|
|
1731
1736
|
y as TimeUnit,
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1737
|
+
K as TimedPromise,
|
|
1738
|
+
J as TimeoutException,
|
|
1739
|
+
se as TypeException,
|
|
1740
|
+
je as VERSION,
|
|
1736
1741
|
c as ValueException,
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1742
|
+
Q as WeekDay,
|
|
1743
|
+
Ae as average,
|
|
1744
|
+
Pe as capitalize,
|
|
1745
|
+
Se as chain,
|
|
1746
|
+
Re as clamp,
|
|
1747
|
+
ke as count,
|
|
1748
|
+
fe as dateDifference,
|
|
1749
|
+
de as dateRange,
|
|
1750
|
+
X as dateRound,
|
|
1751
|
+
be as delay,
|
|
1752
|
+
Te as enumerate,
|
|
1753
|
+
me as getWeek,
|
|
1754
|
+
Fe as hash,
|
|
1755
|
+
j as isBrowser,
|
|
1756
|
+
W as isNode,
|
|
1757
|
+
U as isWorker,
|
|
1758
|
+
ve as loadScript,
|
|
1759
|
+
ge as nextAnimationFrame,
|
|
1760
|
+
Ee as range,
|
|
1761
|
+
Me as shuffle,
|
|
1762
|
+
Ce as sum,
|
|
1763
|
+
Ie as unique,
|
|
1764
|
+
xe as yieldToEventLoop,
|
|
1765
|
+
Z as zip
|
|
1761
1766
|
};
|
|
1762
1767
|
|
|
1763
1768
|
//# sourceMappingURL=core.esm.js.map
|