@byloth/core 2.0.0-rc.11 → 2.0.0-rc.12
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.js +169 -147
- package/dist/core.js.map +1 -1
- package/dist/core.umd.cjs +2 -2
- package/dist/core.umd.cjs.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +2 -1
- package/src/models/callbacks/callable-object.ts +5 -6
- package/src/models/callbacks/switchable-callback.ts +3 -3
- package/src/models/exceptions/core.ts +2 -2
- package/src/models/exceptions/index.ts +13 -13
- package/src/models/promises/deferred-promise.ts +1 -1
- package/src/models/promises/timed-promise.ts +1 -1
- package/src/models/timers/clock.ts +3 -3
- package/src/models/timers/countdown.ts +3 -3
- package/src/utils/curve.ts +27 -0
- package/src/utils/index.ts +2 -1
package/dist/core.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var Be = (i, t, e) => t in i ?
|
|
1
|
+
var Le = Object.defineProperty;
|
|
2
|
+
var Be = (i, t, e) => t in i ? Le(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
3
|
var a = (i, t, e) => Be(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
-
const
|
|
4
|
+
const ze = typeof window < "u" && typeof window.document < "u";
|
|
5
5
|
var A;
|
|
6
|
-
const
|
|
6
|
+
const tt = typeof process < "u" && ((A = process.versions) == null ? void 0 : A.node);
|
|
7
7
|
var $;
|
|
8
|
-
const
|
|
8
|
+
const nt = typeof self == "object" && (($ = self.constructor) == null ? void 0 : $.name) === "DedicatedWorkerGlobalScope";
|
|
9
9
|
var q, N;
|
|
10
10
|
class f extends (N = Error, q = Symbol.toStringTag, N) {
|
|
11
11
|
constructor(e, n, s = "Exception") {
|
|
@@ -43,25 +43,25 @@ class Ge extends (V = k, J = Symbol.toStringTag, V) {
|
|
|
43
43
|
a(this, J, "NotImplementedException");
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
var W,
|
|
47
|
-
class
|
|
46
|
+
var W, L;
|
|
47
|
+
class Je extends (L = f, W = Symbol.toStringTag, L) {
|
|
48
48
|
constructor(e, n, s = "FileException") {
|
|
49
49
|
super(e, n, s);
|
|
50
50
|
a(this, W, "FileException");
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
var
|
|
54
|
-
class
|
|
53
|
+
var B, G;
|
|
54
|
+
class st extends (G = Je, B = Symbol.toStringTag, G) {
|
|
55
55
|
constructor(e, n, s = "FileExistsException") {
|
|
56
56
|
super(e, n, s);
|
|
57
|
-
a(this,
|
|
57
|
+
a(this, B, "FileExistsException");
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
var
|
|
61
|
-
class
|
|
60
|
+
var K, H;
|
|
61
|
+
class rt extends (H = Je, K = Symbol.toStringTag, H) {
|
|
62
62
|
constructor(e, n, s = "FileNotFoundException") {
|
|
63
63
|
super(e, n, s);
|
|
64
|
-
a(this,
|
|
64
|
+
a(this, K, "FileNotFoundException");
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
var Q, X;
|
|
@@ -72,14 +72,14 @@ class x extends (X = f, Q = Symbol.toStringTag, X) {
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
var Z, U;
|
|
75
|
-
class
|
|
75
|
+
class it extends (U = f, Z = Symbol.toStringTag, U) {
|
|
76
76
|
constructor(e, n, s = "NetworkException") {
|
|
77
77
|
super(e, n, s);
|
|
78
78
|
a(this, Z, "NetworkException");
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
var ee, te;
|
|
82
|
-
class
|
|
82
|
+
class ot extends (te = f, ee = Symbol.toStringTag, te) {
|
|
83
83
|
constructor(e, n, s = "PermissionException") {
|
|
84
84
|
super(e, n, s);
|
|
85
85
|
a(this, ee, "PermissionException");
|
|
@@ -107,14 +107,14 @@ class Ke extends (ae = m, oe = Symbol.toStringTag, ae) {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
var le, ue;
|
|
110
|
-
class
|
|
110
|
+
class He extends (ue = f, le = Symbol.toStringTag, ue) {
|
|
111
111
|
constructor(e, n, s = "TimeoutException") {
|
|
112
112
|
super(e, n, s);
|
|
113
113
|
a(this, le, "TimeoutException");
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
var ce, he;
|
|
117
|
-
class
|
|
117
|
+
class at extends (he = f, ce = Symbol.toStringTag, he) {
|
|
118
118
|
constructor(e, n, s = "TypeException") {
|
|
119
119
|
super(e, n, s);
|
|
120
120
|
a(this, ce, "TypeException");
|
|
@@ -128,14 +128,14 @@ class p extends (de = f, fe = Symbol.toStringTag, de) {
|
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
var me, _e;
|
|
131
|
-
class
|
|
131
|
+
class Ve extends (_e = p, me = Symbol.toStringTag, _e) {
|
|
132
132
|
constructor(e, n, s = "RangeException") {
|
|
133
133
|
super(e, n, s);
|
|
134
134
|
a(this, me, "RangeException");
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
var we;
|
|
138
|
-
class
|
|
138
|
+
class u {
|
|
139
139
|
constructor(t) {
|
|
140
140
|
a(this, "_iterator");
|
|
141
141
|
a(this, "return");
|
|
@@ -167,7 +167,7 @@ class c {
|
|
|
167
167
|
}
|
|
168
168
|
filter(t) {
|
|
169
169
|
const e = this._iterator;
|
|
170
|
-
return new
|
|
170
|
+
return new u(function* () {
|
|
171
171
|
let n = 0;
|
|
172
172
|
for (; ; ) {
|
|
173
173
|
const s = e.next();
|
|
@@ -179,7 +179,7 @@ class c {
|
|
|
179
179
|
}
|
|
180
180
|
map(t) {
|
|
181
181
|
const e = this._iterator;
|
|
182
|
-
return new
|
|
182
|
+
return new u(function* () {
|
|
183
183
|
let n = 0;
|
|
184
184
|
for (; ; ) {
|
|
185
185
|
const s = e.next();
|
|
@@ -206,7 +206,7 @@ class c {
|
|
|
206
206
|
}
|
|
207
207
|
flatMap(t) {
|
|
208
208
|
const e = this._iterator;
|
|
209
|
-
return new
|
|
209
|
+
return new u(function* () {
|
|
210
210
|
let n = 0;
|
|
211
211
|
for (; ; ) {
|
|
212
212
|
const s = e.next();
|
|
@@ -221,7 +221,7 @@ class c {
|
|
|
221
221
|
}
|
|
222
222
|
drop(t) {
|
|
223
223
|
const e = this._iterator;
|
|
224
|
-
return new
|
|
224
|
+
return new u(function* () {
|
|
225
225
|
let n = 0;
|
|
226
226
|
for (; n < t; ) {
|
|
227
227
|
if (e.next().done)
|
|
@@ -238,7 +238,7 @@ class c {
|
|
|
238
238
|
}
|
|
239
239
|
take(t) {
|
|
240
240
|
const e = this._iterator;
|
|
241
|
-
return new
|
|
241
|
+
return new u(function* () {
|
|
242
242
|
let n = 0;
|
|
243
243
|
for (; n < t; ) {
|
|
244
244
|
const s = e.next();
|
|
@@ -264,7 +264,7 @@ class c {
|
|
|
264
264
|
}
|
|
265
265
|
unique() {
|
|
266
266
|
const t = this._iterator;
|
|
267
|
-
return new
|
|
267
|
+
return new u(function* () {
|
|
268
268
|
const e = /* @__PURE__ */ new Set();
|
|
269
269
|
for (; ; ) {
|
|
270
270
|
const n = t.next();
|
|
@@ -310,7 +310,7 @@ const b = class b {
|
|
|
310
310
|
constructor(t) {
|
|
311
311
|
a(this, "_elements");
|
|
312
312
|
a(this, pe, "ReducedIterator");
|
|
313
|
-
this._elements = new
|
|
313
|
+
this._elements = new u(t);
|
|
314
314
|
}
|
|
315
315
|
every(t) {
|
|
316
316
|
for (const [e, [n, s]] of this._elements.enumerate())
|
|
@@ -398,7 +398,7 @@ const b = class b {
|
|
|
398
398
|
}
|
|
399
399
|
keys() {
|
|
400
400
|
const t = this._elements;
|
|
401
|
-
return new
|
|
401
|
+
return new u(function* () {
|
|
402
402
|
for (const [e] of t)
|
|
403
403
|
yield e;
|
|
404
404
|
});
|
|
@@ -408,7 +408,7 @@ const b = class b {
|
|
|
408
408
|
}
|
|
409
409
|
values() {
|
|
410
410
|
const t = this._elements;
|
|
411
|
-
return new
|
|
411
|
+
return new u(function* () {
|
|
412
412
|
for (const [e, n] of t)
|
|
413
413
|
yield n;
|
|
414
414
|
});
|
|
@@ -499,8 +499,8 @@ const y = class y {
|
|
|
499
499
|
const n = /* @__PURE__ */ new Map();
|
|
500
500
|
for await (const [s, r] of e) {
|
|
501
501
|
const o = n.get(s) ?? 0, l = await t(s, r, o);
|
|
502
|
-
for await (const
|
|
503
|
-
yield [s,
|
|
502
|
+
for await (const c of l)
|
|
503
|
+
yield [s, c];
|
|
504
504
|
n.set(s, o + 1);
|
|
505
505
|
}
|
|
506
506
|
});
|
|
@@ -817,7 +817,7 @@ const g = class g {
|
|
|
817
817
|
constructor(t) {
|
|
818
818
|
a(this, "_elements");
|
|
819
819
|
a(this, be, "AggregatedIterator");
|
|
820
|
-
this._elements = new
|
|
820
|
+
this._elements = new u(t);
|
|
821
821
|
}
|
|
822
822
|
every(t) {
|
|
823
823
|
const e = /* @__PURE__ */ new Map();
|
|
@@ -886,8 +886,8 @@ const g = class g {
|
|
|
886
886
|
const n = /* @__PURE__ */ new Map();
|
|
887
887
|
for (const [s, r] of e) {
|
|
888
888
|
const o = n.get(s) ?? 0, l = t(s, r, o);
|
|
889
|
-
for (const
|
|
890
|
-
yield [s,
|
|
889
|
+
for (const c of l)
|
|
890
|
+
yield [s, c];
|
|
891
891
|
n.set(s, o + 1);
|
|
892
892
|
}
|
|
893
893
|
});
|
|
@@ -960,7 +960,7 @@ const g = class g {
|
|
|
960
960
|
}
|
|
961
961
|
keys() {
|
|
962
962
|
const t = this._elements;
|
|
963
|
-
return new
|
|
963
|
+
return new u(function* () {
|
|
964
964
|
const e = /* @__PURE__ */ new Set();
|
|
965
965
|
for (const [n] of t)
|
|
966
966
|
e.has(n) || (e.add(n), yield n);
|
|
@@ -971,7 +971,7 @@ const g = class g {
|
|
|
971
971
|
}
|
|
972
972
|
values() {
|
|
973
973
|
const t = this._elements;
|
|
974
|
-
return new
|
|
974
|
+
return new u(function* () {
|
|
975
975
|
for (const [e, n] of t)
|
|
976
976
|
yield n;
|
|
977
977
|
});
|
|
@@ -998,11 +998,11 @@ const g = class g {
|
|
|
998
998
|
}
|
|
999
999
|
};
|
|
1000
1000
|
let S = g;
|
|
1001
|
-
const
|
|
1001
|
+
const Qe = Function;
|
|
1002
1002
|
var xe, ve;
|
|
1003
|
-
class
|
|
1003
|
+
class Xe extends (ve = Qe, xe = Symbol.toStringTag, ve) {
|
|
1004
1004
|
constructor() {
|
|
1005
|
-
super("return this.
|
|
1005
|
+
super("return this._invoke(...arguments);");
|
|
1006
1006
|
a(this, xe, "CallableObject");
|
|
1007
1007
|
const e = this.bind(this);
|
|
1008
1008
|
return Object.setPrototypeOf(this, e), e;
|
|
@@ -1044,7 +1044,7 @@ class M {
|
|
|
1044
1044
|
}
|
|
1045
1045
|
}
|
|
1046
1046
|
var Se, Te;
|
|
1047
|
-
class
|
|
1047
|
+
class lt extends (Te = Xe, Se = Symbol.toStringTag, Te) {
|
|
1048
1048
|
constructor() {
|
|
1049
1049
|
const e = () => {
|
|
1050
1050
|
throw new Ge(
|
|
@@ -1056,9 +1056,9 @@ class at extends (Te = Qe, Se = Symbol.toStringTag, Te) {
|
|
|
1056
1056
|
a(this, "_callbacks");
|
|
1057
1057
|
a(this, "_isEnabled");
|
|
1058
1058
|
a(this, "_key");
|
|
1059
|
-
a(this, "
|
|
1059
|
+
a(this, "_invoke");
|
|
1060
1060
|
a(this, Se, "SwitchableCallback");
|
|
1061
|
-
this._callback = e, this._callbacks = /* @__PURE__ */ new Map(), this._isEnabled = !0, this._key = "", this.
|
|
1061
|
+
this._callback = e, this._callbacks = /* @__PURE__ */ new Map(), this._isEnabled = !0, this._key = "", this._invoke = (...n) => this._callback(...n);
|
|
1062
1062
|
}
|
|
1063
1063
|
get isEnabled() {
|
|
1064
1064
|
return this._isEnabled;
|
|
@@ -1101,7 +1101,7 @@ class at extends (Te = Qe, Se = Symbol.toStringTag, Te) {
|
|
|
1101
1101
|
}
|
|
1102
1102
|
var Ee;
|
|
1103
1103
|
Ee = Symbol.toStringTag;
|
|
1104
|
-
class
|
|
1104
|
+
class We {
|
|
1105
1105
|
constructor(t, e = 40) {
|
|
1106
1106
|
a(this, "_handle");
|
|
1107
1107
|
a(this, "_startTime");
|
|
@@ -1109,7 +1109,7 @@ class Ve {
|
|
|
1109
1109
|
a(this, "_start");
|
|
1110
1110
|
a(this, "_stop");
|
|
1111
1111
|
a(this, Ee, "GameLoop");
|
|
1112
|
-
this._startTime = 0, this._isRunning = !1,
|
|
1112
|
+
this._startTime = 0, this._isRunning = !1, ze ? (this._start = () => {
|
|
1113
1113
|
t(this.elapsedTime), this._handle = window.requestAnimationFrame(this._start);
|
|
1114
1114
|
}, this._stop = () => window.cancelAnimationFrame(this._handle)) : (console.warn(
|
|
1115
1115
|
`Not a browser environment detected. Using setInterval@${e}ms instead of requestAnimationFrame...`
|
|
@@ -1141,13 +1141,13 @@ class Ve {
|
|
|
1141
1141
|
}
|
|
1142
1142
|
var Me;
|
|
1143
1143
|
Me = Symbol.toStringTag;
|
|
1144
|
-
class
|
|
1144
|
+
class ut {
|
|
1145
1145
|
constructor(t = !0) {
|
|
1146
1146
|
a(this, "_preferPersistence");
|
|
1147
1147
|
a(this, "_volatile");
|
|
1148
1148
|
a(this, "_persistent");
|
|
1149
1149
|
a(this, Me, "JSONStorage");
|
|
1150
|
-
if (this._preferPersistence = t, !
|
|
1150
|
+
if (this._preferPersistence = t, !ze)
|
|
1151
1151
|
throw new Ke(
|
|
1152
1152
|
"The `JSONStorage` class can only be instantiated within a browser environment."
|
|
1153
1153
|
);
|
|
@@ -1320,7 +1320,7 @@ const R = class R {
|
|
|
1320
1320
|
};
|
|
1321
1321
|
let T = R;
|
|
1322
1322
|
var Re, Pe;
|
|
1323
|
-
class
|
|
1323
|
+
class Ze extends (Pe = T, Re = Symbol.toStringTag, Pe) {
|
|
1324
1324
|
constructor(e, n) {
|
|
1325
1325
|
let s, r;
|
|
1326
1326
|
super((o, l) => {
|
|
@@ -1341,17 +1341,17 @@ class Xe extends (Pe = T, Re = Symbol.toStringTag, Pe) {
|
|
|
1341
1341
|
return e.then(this.resolve, this.reject), this;
|
|
1342
1342
|
}
|
|
1343
1343
|
}
|
|
1344
|
-
function
|
|
1344
|
+
function ct(i) {
|
|
1345
1345
|
return new Promise((t) => setTimeout(t, i));
|
|
1346
1346
|
}
|
|
1347
|
-
function
|
|
1347
|
+
function ht() {
|
|
1348
1348
|
return new Promise((i) => requestAnimationFrame(() => i()));
|
|
1349
1349
|
}
|
|
1350
1350
|
function v() {
|
|
1351
1351
|
return new Promise((i) => setTimeout(i));
|
|
1352
1352
|
}
|
|
1353
|
-
var
|
|
1354
|
-
|
|
1353
|
+
var Ce;
|
|
1354
|
+
Ce = Symbol.toStringTag;
|
|
1355
1355
|
const P = class P {
|
|
1356
1356
|
constructor(t, e) {
|
|
1357
1357
|
a(this, "_startTime");
|
|
@@ -1364,7 +1364,7 @@ const P = class P {
|
|
|
1364
1364
|
a(this, "_hasFailed");
|
|
1365
1365
|
a(this, "_promise");
|
|
1366
1366
|
a(this, "_publisher");
|
|
1367
|
-
a(this,
|
|
1367
|
+
a(this, Ce, "LongRunningTask");
|
|
1368
1368
|
this._startTime = 0, this._estimatedTime = 0, this._currentStep = 0, this._percentage = 0, this._isRunning = !0, this._hasCompleted = !1, this._hasFailed = !1;
|
|
1369
1369
|
const n = (o) => (this._estimatedTime = 0, this._endTime = Date.now(), this._percentage = 100, this._isRunning = !1, this._hasCompleted = !0, o), s = (o) => {
|
|
1370
1370
|
throw this._endTime = Date.now(), this._isRunning = !1, this._hasFailed = !0, o;
|
|
@@ -1374,23 +1374,23 @@ const P = class P {
|
|
|
1374
1374
|
let o;
|
|
1375
1375
|
this._publisher = new M(), e.totalSteps ? e.stepIncrement ? o = (l) => {
|
|
1376
1376
|
l ? this._currentStep += l : this._currentStep += e.stepIncrement, this._percentage = this._currentStep / e.totalSteps * 100;
|
|
1377
|
-
const
|
|
1378
|
-
this._estimatedTime =
|
|
1377
|
+
const c = Date.now() - this._startTime, h = e.totalSteps - this._currentStep;
|
|
1378
|
+
this._estimatedTime = c / this._currentStep * h;
|
|
1379
1379
|
} : o = (l) => {
|
|
1380
1380
|
if (l) {
|
|
1381
1381
|
this._currentStep += l, this._percentage = this._currentStep / e.totalSteps * 100;
|
|
1382
|
-
const
|
|
1383
|
-
this._estimatedTime =
|
|
1382
|
+
const c = Date.now() - this._startTime, h = e.totalSteps - this._currentStep;
|
|
1383
|
+
this._estimatedTime = c / this._currentStep * h;
|
|
1384
1384
|
}
|
|
1385
1385
|
} : e.stepIncrement ? o = (l) => {
|
|
1386
1386
|
l ? this._currentStep += l : this._currentStep += e.stepIncrement;
|
|
1387
1387
|
} : o = (l) => {
|
|
1388
1388
|
l && (this._currentStep += l);
|
|
1389
1389
|
}, e.ignoreErrors ? r = async (l) => {
|
|
1390
|
-
const
|
|
1390
|
+
const c = t();
|
|
1391
1391
|
for (this._startTime = Date.now(); ; ) {
|
|
1392
1392
|
try {
|
|
1393
|
-
const { done: h, value: _ } = await
|
|
1393
|
+
const { done: h, value: _ } = await c.next();
|
|
1394
1394
|
if (h)
|
|
1395
1395
|
return l(_);
|
|
1396
1396
|
o(_);
|
|
@@ -1399,42 +1399,42 @@ const P = class P {
|
|
|
1399
1399
|
}
|
|
1400
1400
|
this._publisher.publish("progress"), await v();
|
|
1401
1401
|
}
|
|
1402
|
-
} : r = async (l,
|
|
1402
|
+
} : r = async (l, c) => {
|
|
1403
1403
|
try {
|
|
1404
1404
|
const h = t();
|
|
1405
1405
|
for (this._startTime = Date.now(); ; ) {
|
|
1406
|
-
const { done: _, value:
|
|
1406
|
+
const { done: _, value: D } = await h.next();
|
|
1407
1407
|
if (_)
|
|
1408
|
-
return l(
|
|
1409
|
-
o(
|
|
1408
|
+
return l(D);
|
|
1409
|
+
o(D), this._publisher.publish("progress"), await v();
|
|
1410
1410
|
}
|
|
1411
1411
|
} catch (h) {
|
|
1412
|
-
|
|
1412
|
+
c(h);
|
|
1413
1413
|
}
|
|
1414
1414
|
};
|
|
1415
1415
|
} else e.ignoreErrors ? r = async (o) => {
|
|
1416
1416
|
const l = t();
|
|
1417
1417
|
for (this._startTime = Date.now(); ; ) {
|
|
1418
1418
|
try {
|
|
1419
|
-
const { done:
|
|
1420
|
-
if (
|
|
1419
|
+
const { done: c, value: h } = await l.next();
|
|
1420
|
+
if (c)
|
|
1421
1421
|
return o(h);
|
|
1422
|
-
} catch (
|
|
1423
|
-
console.error(
|
|
1422
|
+
} catch (c) {
|
|
1423
|
+
console.error(c);
|
|
1424
1424
|
}
|
|
1425
1425
|
await v();
|
|
1426
1426
|
}
|
|
1427
1427
|
} : r = async (o, l) => {
|
|
1428
1428
|
try {
|
|
1429
|
-
const
|
|
1429
|
+
const c = t();
|
|
1430
1430
|
for (this._startTime = Date.now(); ; ) {
|
|
1431
|
-
const { done: h, value: _ } = await
|
|
1431
|
+
const { done: h, value: _ } = await c.next();
|
|
1432
1432
|
if (h)
|
|
1433
1433
|
return o(_);
|
|
1434
1434
|
await v();
|
|
1435
1435
|
}
|
|
1436
|
-
} catch (
|
|
1437
|
-
l(
|
|
1436
|
+
} catch (c) {
|
|
1437
|
+
l(c);
|
|
1438
1438
|
}
|
|
1439
1439
|
};
|
|
1440
1440
|
this._promise = new Promise(r).then(n, s);
|
|
@@ -1494,12 +1494,12 @@ const P = class P {
|
|
|
1494
1494
|
}
|
|
1495
1495
|
};
|
|
1496
1496
|
let j = P;
|
|
1497
|
-
var
|
|
1498
|
-
|
|
1499
|
-
class
|
|
1497
|
+
var De;
|
|
1498
|
+
De = Symbol.toStringTag;
|
|
1499
|
+
class ft {
|
|
1500
1500
|
constructor() {
|
|
1501
1501
|
a(this, "_onFulfilled");
|
|
1502
|
-
a(this,
|
|
1502
|
+
a(this, De, "Thenable");
|
|
1503
1503
|
this._onFulfilled = (t) => t;
|
|
1504
1504
|
}
|
|
1505
1505
|
_resolve(t) {
|
|
@@ -1549,36 +1549,36 @@ class ht {
|
|
|
1549
1549
|
}
|
|
1550
1550
|
}
|
|
1551
1551
|
var Ie, je;
|
|
1552
|
-
class
|
|
1552
|
+
class dt extends (je = T, Ie = Symbol.toStringTag, je) {
|
|
1553
1553
|
constructor(e, n) {
|
|
1554
1554
|
super((s, r) => {
|
|
1555
1555
|
const o = (_) => {
|
|
1556
1556
|
clearTimeout(h), s(_);
|
|
1557
1557
|
}, l = (_) => {
|
|
1558
1558
|
clearTimeout(h), r(_);
|
|
1559
|
-
}, h = setTimeout(() => l(new
|
|
1559
|
+
}, h = setTimeout(() => l(new He("The operation has timed out.")), n);
|
|
1560
1560
|
e(o, l);
|
|
1561
1561
|
});
|
|
1562
1562
|
a(this, Ie, "TimedPromise");
|
|
1563
1563
|
}
|
|
1564
1564
|
}
|
|
1565
1565
|
var F = /* @__PURE__ */ ((i) => (i[i.Millisecond = 1] = "Millisecond", i[i.Second = 1e3] = "Second", i[i.Minute = 6e4] = "Minute", i[i.Hour = 36e5] = "Hour", i[i.Day = 864e5] = "Day", i[i.Week = 6048e5] = "Week", i[i.Month = 2592e6] = "Month", i[i.Year = 31536e6] = "Year", i))(F || {});
|
|
1566
|
-
function
|
|
1566
|
+
function mt(i, t, e = 864e5) {
|
|
1567
1567
|
return i = new Date(i), t = new Date(t), Math.floor((t.getTime() - i.getTime()) / e);
|
|
1568
1568
|
}
|
|
1569
|
-
function
|
|
1570
|
-
return i = new Date(i), t = new Date(t), new
|
|
1569
|
+
function _t(i, t, e = 864e5) {
|
|
1570
|
+
return i = new Date(i), t = new Date(t), new u(function* () {
|
|
1571
1571
|
const n = t.getTime();
|
|
1572
1572
|
let s = i.getTime();
|
|
1573
1573
|
for (; s < n; )
|
|
1574
1574
|
yield new Date(s), s += e;
|
|
1575
1575
|
});
|
|
1576
1576
|
}
|
|
1577
|
-
function
|
|
1577
|
+
function wt(i, t = 864e5) {
|
|
1578
1578
|
return i = new Date(i), new Date(Math.floor(i.getTime() / t) * t);
|
|
1579
1579
|
}
|
|
1580
1580
|
var Oe, Ae;
|
|
1581
|
-
class
|
|
1581
|
+
class pt extends (Ae = We, Oe = Symbol.toStringTag, Ae) {
|
|
1582
1582
|
constructor(e = F.Second) {
|
|
1583
1583
|
super((n) => this._publisher.publish("tick", n), e);
|
|
1584
1584
|
a(this, "_publisher");
|
|
@@ -1603,7 +1603,7 @@ class wt extends (Ae = Ve, Oe = Symbol.toStringTag, Ae) {
|
|
|
1603
1603
|
}
|
|
1604
1604
|
onTick(e, n = 0) {
|
|
1605
1605
|
if (n < 0)
|
|
1606
|
-
throw new
|
|
1606
|
+
throw new Ve("The tick step must be a non-negative number.");
|
|
1607
1607
|
if (n === 0)
|
|
1608
1608
|
return this._publisher.subscribe("tick", e);
|
|
1609
1609
|
let s = 0;
|
|
@@ -1613,7 +1613,7 @@ class wt extends (Ae = Ve, Oe = Symbol.toStringTag, Ae) {
|
|
|
1613
1613
|
}
|
|
1614
1614
|
}
|
|
1615
1615
|
var $e, qe;
|
|
1616
|
-
class
|
|
1616
|
+
class yt extends (qe = We, $e = Symbol.toStringTag, qe) {
|
|
1617
1617
|
constructor(e, n = F.Second) {
|
|
1618
1618
|
super(() => {
|
|
1619
1619
|
const r = this.remainingTime;
|
|
@@ -1643,7 +1643,7 @@ class pt extends (qe = Ve, $e = Symbol.toStringTag, qe) {
|
|
|
1643
1643
|
throw new m("The countdown has already been started.");
|
|
1644
1644
|
if (this._deferrer)
|
|
1645
1645
|
throw new k();
|
|
1646
|
-
return this._deferrer = new
|
|
1646
|
+
return this._deferrer = new Ze(), super.start(this.duration - e), this._publisher.publish("start"), this._deferrer;
|
|
1647
1647
|
}
|
|
1648
1648
|
stop(e) {
|
|
1649
1649
|
this._deferrerStop(e), this._publisher.publish("stop", e);
|
|
@@ -1659,7 +1659,7 @@ class pt extends (qe = Ve, $e = Symbol.toStringTag, qe) {
|
|
|
1659
1659
|
}
|
|
1660
1660
|
onTick(e, n = 0) {
|
|
1661
1661
|
if (n < 0)
|
|
1662
|
-
throw new
|
|
1662
|
+
throw new Ve("The tick step must be a non-negative number.");
|
|
1663
1663
|
if (n === 0)
|
|
1664
1664
|
return this._publisher.subscribe("tick", e);
|
|
1665
1665
|
let s = 0;
|
|
@@ -1670,9 +1670,30 @@ class pt extends (qe = Ve, $e = Symbol.toStringTag, qe) {
|
|
|
1670
1670
|
}
|
|
1671
1671
|
var Ne;
|
|
1672
1672
|
Ne = Symbol.toStringTag;
|
|
1673
|
-
|
|
1673
|
+
class gt {
|
|
1674
1674
|
constructor() {
|
|
1675
|
-
a(this, Ne, "
|
|
1675
|
+
a(this, Ne, "Curve");
|
|
1676
|
+
}
|
|
1677
|
+
static Linear(t) {
|
|
1678
|
+
const e = 1 / t;
|
|
1679
|
+
return new u(function* () {
|
|
1680
|
+
for (let n = 0; n < t; n += 1)
|
|
1681
|
+
yield n * e;
|
|
1682
|
+
});
|
|
1683
|
+
}
|
|
1684
|
+
static Exponential(t, e = 2) {
|
|
1685
|
+
const n = t - 1;
|
|
1686
|
+
return new u(function* () {
|
|
1687
|
+
for (let s = 0; s < t; s += 1)
|
|
1688
|
+
yield Math.pow(s / n, e);
|
|
1689
|
+
});
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
var Ye;
|
|
1693
|
+
Ye = Symbol.toStringTag;
|
|
1694
|
+
const C = class C {
|
|
1695
|
+
constructor() {
|
|
1696
|
+
a(this, Ye, "Random");
|
|
1676
1697
|
}
|
|
1677
1698
|
static Boolean(t = 0.5) {
|
|
1678
1699
|
return Math.random() < t;
|
|
@@ -1689,24 +1710,24 @@ const D = class D {
|
|
|
1689
1710
|
return this.Integer(t.length);
|
|
1690
1711
|
}
|
|
1691
1712
|
static Choice(t) {
|
|
1692
|
-
return t[
|
|
1713
|
+
return t[C.Index(t)];
|
|
1693
1714
|
}
|
|
1694
1715
|
};
|
|
1695
|
-
let O =
|
|
1696
|
-
function
|
|
1716
|
+
let O = C;
|
|
1717
|
+
function bt(i, t = "text/javascript") {
|
|
1697
1718
|
return new Promise((e, n) => {
|
|
1698
1719
|
const s = document.createElement("script");
|
|
1699
1720
|
s.async = !0, s.defer = !0, s.src = i, s.type = t, s.onload = () => e(), s.onerror = () => n(), document.body.appendChild(s);
|
|
1700
1721
|
});
|
|
1701
1722
|
}
|
|
1702
|
-
function
|
|
1703
|
-
return new
|
|
1723
|
+
function xt(...i) {
|
|
1724
|
+
return new u(function* () {
|
|
1704
1725
|
for (const t of i)
|
|
1705
1726
|
for (const e of t)
|
|
1706
1727
|
yield e;
|
|
1707
1728
|
});
|
|
1708
1729
|
}
|
|
1709
|
-
function
|
|
1730
|
+
function vt(i) {
|
|
1710
1731
|
if (Array.isArray(i))
|
|
1711
1732
|
return i.length;
|
|
1712
1733
|
let t = 0;
|
|
@@ -1714,21 +1735,21 @@ function bt(i) {
|
|
|
1714
1735
|
t += 1;
|
|
1715
1736
|
return t;
|
|
1716
1737
|
}
|
|
1717
|
-
function
|
|
1718
|
-
return new
|
|
1738
|
+
function kt(i) {
|
|
1739
|
+
return new u(function* () {
|
|
1719
1740
|
let t = 0;
|
|
1720
1741
|
for (const e of i)
|
|
1721
1742
|
yield [t, e], t += 1;
|
|
1722
1743
|
});
|
|
1723
1744
|
}
|
|
1724
|
-
function
|
|
1725
|
-
return new
|
|
1745
|
+
function St(i, t, e = 1) {
|
|
1746
|
+
return new u(function* () {
|
|
1726
1747
|
t === void 0 && (t = i, i = 0), i > t && (e = e ?? -1);
|
|
1727
1748
|
for (let n = i; n < t; n += e)
|
|
1728
1749
|
yield n;
|
|
1729
1750
|
});
|
|
1730
1751
|
}
|
|
1731
|
-
function
|
|
1752
|
+
function Tt(i) {
|
|
1732
1753
|
const t = Array.from(i);
|
|
1733
1754
|
for (let e = t.length - 1; e > 0; e -= 1) {
|
|
1734
1755
|
const n = Math.floor(Math.random() * (e + 1));
|
|
@@ -1736,15 +1757,15 @@ function kt(i) {
|
|
|
1736
1757
|
}
|
|
1737
1758
|
return t;
|
|
1738
1759
|
}
|
|
1739
|
-
function
|
|
1740
|
-
return new
|
|
1760
|
+
function Et(i) {
|
|
1761
|
+
return new u(function* () {
|
|
1741
1762
|
const t = /* @__PURE__ */ new Set();
|
|
1742
1763
|
for (const e of i)
|
|
1743
1764
|
t.has(e) || (t.add(e), yield e);
|
|
1744
1765
|
});
|
|
1745
1766
|
}
|
|
1746
|
-
function
|
|
1747
|
-
return new
|
|
1767
|
+
function Ue(i, t) {
|
|
1768
|
+
return new u(function* () {
|
|
1748
1769
|
const e = i[Symbol.iterator](), n = t[Symbol.iterator]();
|
|
1749
1770
|
for (; ; ) {
|
|
1750
1771
|
const s = e.next(), r = n.next();
|
|
@@ -1754,7 +1775,7 @@ function Ze(i, t) {
|
|
|
1754
1775
|
}
|
|
1755
1776
|
});
|
|
1756
1777
|
}
|
|
1757
|
-
function
|
|
1778
|
+
function Mt(i, t) {
|
|
1758
1779
|
if (t === void 0) {
|
|
1759
1780
|
let r = 0, o = 0;
|
|
1760
1781
|
for (const l of i)
|
|
@@ -1764,7 +1785,7 @@ function Tt(i, t) {
|
|
|
1764
1785
|
return r / o;
|
|
1765
1786
|
}
|
|
1766
1787
|
let e = 0, n = 0, s = 0;
|
|
1767
|
-
for (const [r, o] of
|
|
1788
|
+
for (const [r, o] of Ue(i, t)) {
|
|
1768
1789
|
if (o <= 0)
|
|
1769
1790
|
throw new p(`The weight for the value #${s} must be greater than zero.`);
|
|
1770
1791
|
e += r * o, n += o, s += 1;
|
|
@@ -1775,7 +1796,7 @@ function Tt(i, t) {
|
|
|
1775
1796
|
throw new p("The sum of weights must be greater than zero.");
|
|
1776
1797
|
return e / n;
|
|
1777
1798
|
}
|
|
1778
|
-
function
|
|
1799
|
+
function Ft(i) {
|
|
1779
1800
|
let t = 0;
|
|
1780
1801
|
for (let e = 0; e < i.length; e += 1) {
|
|
1781
1802
|
const n = i.charCodeAt(e);
|
|
@@ -1783,72 +1804,73 @@ function Et(i) {
|
|
|
1783
1804
|
}
|
|
1784
1805
|
return t;
|
|
1785
1806
|
}
|
|
1786
|
-
function
|
|
1807
|
+
function Rt(i) {
|
|
1787
1808
|
let t = 0;
|
|
1788
1809
|
for (const e of i)
|
|
1789
1810
|
t += e;
|
|
1790
1811
|
return t;
|
|
1791
1812
|
}
|
|
1792
|
-
function
|
|
1813
|
+
function Pt(i) {
|
|
1793
1814
|
return `${i.charAt(0).toUpperCase()}${i.slice(1)}`;
|
|
1794
1815
|
}
|
|
1795
|
-
const
|
|
1816
|
+
const Ct = "2.0.0-rc.12";
|
|
1796
1817
|
export {
|
|
1797
1818
|
E as AggregatedAsyncIterator,
|
|
1798
1819
|
S as AggregatedIterator,
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1820
|
+
Xe as CallableObject,
|
|
1821
|
+
pt as Clock,
|
|
1822
|
+
yt as Countdown,
|
|
1823
|
+
gt as Curve,
|
|
1824
|
+
Ze as DeferredPromise,
|
|
1803
1825
|
f as Exception,
|
|
1804
1826
|
k as FatalErrorException,
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1827
|
+
Je as FileException,
|
|
1828
|
+
st as FileExistsException,
|
|
1829
|
+
rt as FileNotFoundException,
|
|
1830
|
+
We as GameLoop,
|
|
1831
|
+
ut as JSONStorage,
|
|
1810
1832
|
x as KeyException,
|
|
1811
1833
|
j as LongRunningTask,
|
|
1812
|
-
|
|
1834
|
+
it as NetworkException,
|
|
1813
1835
|
Ge as NotImplementedException,
|
|
1814
|
-
|
|
1836
|
+
ot as PermissionException,
|
|
1815
1837
|
M as Publisher,
|
|
1816
1838
|
O as Random,
|
|
1817
|
-
|
|
1839
|
+
Ve as RangeException,
|
|
1818
1840
|
d as ReducedIterator,
|
|
1819
1841
|
I as ReferenceException,
|
|
1820
1842
|
m as RuntimeException,
|
|
1821
1843
|
w as SmartAsyncIterator,
|
|
1822
|
-
|
|
1844
|
+
u as SmartIterator,
|
|
1823
1845
|
T as SmartPromise,
|
|
1824
|
-
|
|
1825
|
-
|
|
1846
|
+
lt as SwitchableCallback,
|
|
1847
|
+
ft as Thenable,
|
|
1826
1848
|
F as TimeUnit,
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1849
|
+
dt as TimedPromise,
|
|
1850
|
+
He as TimeoutException,
|
|
1851
|
+
at as TypeException,
|
|
1852
|
+
Ct as VERSION,
|
|
1831
1853
|
p as ValueException,
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1854
|
+
Mt as average,
|
|
1855
|
+
Pt as capitalize,
|
|
1856
|
+
xt as chain,
|
|
1857
|
+
vt as count,
|
|
1858
|
+
mt as dateDifference,
|
|
1859
|
+
_t as dateRange,
|
|
1860
|
+
wt as dateRound,
|
|
1861
|
+
ct as delay,
|
|
1862
|
+
kt as enumerate,
|
|
1863
|
+
Ft as hash,
|
|
1864
|
+
ze as isBrowser,
|
|
1865
|
+
tt as isNode,
|
|
1866
|
+
nt as isWebWorker,
|
|
1867
|
+
bt as loadScript,
|
|
1868
|
+
ht as nextAnimationFrame,
|
|
1869
|
+
St as range,
|
|
1870
|
+
Tt as shuffle,
|
|
1871
|
+
Rt as sum,
|
|
1872
|
+
Et as unique,
|
|
1851
1873
|
v as yieldToEventLoop,
|
|
1852
|
-
|
|
1874
|
+
Ue as zip
|
|
1853
1875
|
};
|
|
1854
1876
|
//# sourceMappingURL=core.js.map
|