@byloth/core 1.3.1 → 1.3.3
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 +184 -166
- package/dist/core.js.map +1 -1
- package/dist/core.umd.cjs +1 -1
- package/dist/core.umd.cjs.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +1 -1
- package/src/models/aggregators/aggregated-iterator.ts +44 -8
- package/src/models/aggregators/index.ts +1 -1
- package/src/models/aggregators/reduced-iterator.ts +3 -3
- package/src/models/aggregators/types.ts +2 -2
package/dist/core.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
var w = Object.defineProperty;
|
|
2
2
|
var y = (s, e, t) => e in s ? w(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
-
var
|
|
4
|
-
class
|
|
3
|
+
var l = (s, e, t) => (y(s, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
class h extends Error {
|
|
5
5
|
static FromUnknown(e) {
|
|
6
|
-
if (e instanceof
|
|
6
|
+
if (e instanceof h)
|
|
7
7
|
return e;
|
|
8
8
|
if (e instanceof Error) {
|
|
9
|
-
const t = new
|
|
9
|
+
const t = new h(e.message);
|
|
10
10
|
return t.stack = e.stack, t.name = e.name, t;
|
|
11
11
|
}
|
|
12
|
-
return new
|
|
12
|
+
return new h(`${e}`);
|
|
13
13
|
}
|
|
14
|
-
constructor(e, t,
|
|
15
|
-
super(e), this.cause = t, this.name =
|
|
14
|
+
constructor(e, t, n = "Exception") {
|
|
15
|
+
super(e), this.cause = t, this.name = n, t && (t instanceof Error ? this.stack += `
|
|
16
16
|
|
|
17
17
|
Caused by ${t.stack}` : this.stack += `
|
|
18
18
|
|
|
19
19
|
Caused by ${t}`);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
class
|
|
22
|
+
class u {
|
|
23
23
|
constructor(e) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
l(this, "_iterator");
|
|
25
|
+
l(this, "return");
|
|
26
|
+
l(this, "throw");
|
|
27
27
|
e instanceof Function ? this._iterator = e() : Symbol.iterator in e ? this._iterator = e[Symbol.iterator]() : this._iterator = e, this._iterator.return && (this.return = (t) => this._iterator.return(t)), this._iterator.throw && (this.throw = (t) => this._iterator.throw(t));
|
|
28
28
|
}
|
|
29
29
|
every(e) {
|
|
30
30
|
let t = 0;
|
|
31
31
|
for (; ; ) {
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
32
|
+
const n = this._iterator.next();
|
|
33
|
+
if (n.done)
|
|
34
34
|
return !0;
|
|
35
|
-
if (!e(
|
|
35
|
+
if (!e(n.value, t))
|
|
36
36
|
return !1;
|
|
37
37
|
t += 1;
|
|
38
38
|
}
|
|
@@ -40,51 +40,51 @@ class l {
|
|
|
40
40
|
some(e) {
|
|
41
41
|
let t = 0;
|
|
42
42
|
for (; ; ) {
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
43
|
+
const n = this._iterator.next();
|
|
44
|
+
if (n.done)
|
|
45
45
|
return !1;
|
|
46
|
-
if (e(
|
|
46
|
+
if (e(n.value, t))
|
|
47
47
|
return !0;
|
|
48
48
|
t += 1;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
filter(e) {
|
|
52
52
|
const t = this._iterator;
|
|
53
|
-
return new
|
|
54
|
-
let
|
|
53
|
+
return new u(function* () {
|
|
54
|
+
let n = 0;
|
|
55
55
|
for (; ; ) {
|
|
56
|
-
const
|
|
57
|
-
if (
|
|
58
|
-
return
|
|
59
|
-
e(
|
|
56
|
+
const r = t.next();
|
|
57
|
+
if (r.done)
|
|
58
|
+
return r.value;
|
|
59
|
+
e(r.value, n) && (yield r.value), n += 1;
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
map(e) {
|
|
64
64
|
const t = this._iterator;
|
|
65
|
-
return new
|
|
66
|
-
let
|
|
65
|
+
return new u(function* () {
|
|
66
|
+
let n = 0;
|
|
67
67
|
for (; ; ) {
|
|
68
|
-
const
|
|
69
|
-
if (
|
|
70
|
-
return
|
|
71
|
-
yield e(
|
|
68
|
+
const r = t.next();
|
|
69
|
+
if (r.done)
|
|
70
|
+
return r.value;
|
|
71
|
+
yield e(r.value, n), n += 1;
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
reduce(e, t) {
|
|
76
|
-
let
|
|
77
|
-
if (
|
|
76
|
+
let n = 0, r = t;
|
|
77
|
+
if (r === void 0) {
|
|
78
78
|
const i = this._iterator.next();
|
|
79
79
|
if (i.done)
|
|
80
80
|
throw new TypeError("Reduce of empty iterator with no initial value");
|
|
81
|
-
|
|
81
|
+
r = i.value, n += 1;
|
|
82
82
|
}
|
|
83
83
|
for (; ; ) {
|
|
84
84
|
const i = this._iterator.next();
|
|
85
85
|
if (i.done)
|
|
86
|
-
return
|
|
87
|
-
|
|
86
|
+
return r;
|
|
87
|
+
r = e(r, i.value, n), n += 1;
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
enumerate() {
|
|
@@ -92,13 +92,13 @@ class l {
|
|
|
92
92
|
}
|
|
93
93
|
unique() {
|
|
94
94
|
const e = this._iterator;
|
|
95
|
-
return new
|
|
95
|
+
return new u(function* () {
|
|
96
96
|
const t = /* @__PURE__ */ new Set();
|
|
97
97
|
for (; ; ) {
|
|
98
|
-
const
|
|
99
|
-
if (
|
|
100
|
-
return
|
|
101
|
-
t.has(
|
|
98
|
+
const n = e.next();
|
|
99
|
+
if (n.done)
|
|
100
|
+
return n.value;
|
|
101
|
+
t.has(n.value) || (t.add(n.value), yield n.value);
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
104
|
}
|
|
@@ -113,10 +113,10 @@ class l {
|
|
|
113
113
|
forEach(e) {
|
|
114
114
|
let t = 0;
|
|
115
115
|
for (; ; ) {
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
116
|
+
const n = this._iterator.next();
|
|
117
|
+
if (n.done)
|
|
118
118
|
return;
|
|
119
|
-
e(
|
|
119
|
+
e(n.value, t), t += 1;
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
next(...e) {
|
|
@@ -129,23 +129,23 @@ class l {
|
|
|
129
129
|
return this;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
class
|
|
132
|
+
class f {
|
|
133
133
|
constructor(e) {
|
|
134
|
-
|
|
135
|
-
this._elements = new
|
|
134
|
+
l(this, "_elements");
|
|
135
|
+
this._elements = new u(e);
|
|
136
136
|
}
|
|
137
137
|
filter(e) {
|
|
138
138
|
const t = this._elements;
|
|
139
|
-
return new
|
|
140
|
-
for (const [
|
|
141
|
-
e(
|
|
139
|
+
return new f(function* () {
|
|
140
|
+
for (const [n, [r, i]] of t.enumerate())
|
|
141
|
+
e(r, i, n) && (yield [r, i]);
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
144
|
map(e) {
|
|
145
145
|
const t = this._elements;
|
|
146
|
-
return new
|
|
147
|
-
for (const [
|
|
148
|
-
yield [
|
|
146
|
+
return new f(function* () {
|
|
147
|
+
for (const [n, [r, i]] of t.enumerate())
|
|
148
|
+
yield [r, e(r, i, n)];
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
toArray() {
|
|
@@ -160,89 +160,107 @@ class h {
|
|
|
160
160
|
}
|
|
161
161
|
class d {
|
|
162
162
|
constructor(e) {
|
|
163
|
-
|
|
164
|
-
this._elements = new
|
|
163
|
+
l(this, "_elements");
|
|
164
|
+
this._elements = new u(e);
|
|
165
165
|
}
|
|
166
166
|
every(e) {
|
|
167
167
|
const t = /* @__PURE__ */ new Map();
|
|
168
|
-
for (const [
|
|
169
|
-
const [i, o] = t.get(
|
|
170
|
-
o && t.set(
|
|
168
|
+
for (const [n, r] of this._elements) {
|
|
169
|
+
const [i, o] = t.get(n) ?? [0, !0];
|
|
170
|
+
o && t.set(n, [i + 1, e(n, r, i)]);
|
|
171
171
|
}
|
|
172
|
-
return new
|
|
173
|
-
for (const [
|
|
174
|
-
yield [
|
|
172
|
+
return new f(function* () {
|
|
173
|
+
for (const [n, [r, i]] of t)
|
|
174
|
+
yield [n, i];
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
177
|
some(e) {
|
|
178
178
|
const t = /* @__PURE__ */ new Map();
|
|
179
|
-
for (const [
|
|
180
|
-
const [i, o] = t.get(
|
|
181
|
-
o || t.set(
|
|
179
|
+
for (const [n, r] of this._elements) {
|
|
180
|
+
const [i, o] = t.get(n) ?? [0, !1];
|
|
181
|
+
o || t.set(n, [i + 1, e(n, r, i)]);
|
|
182
182
|
}
|
|
183
|
-
return new
|
|
184
|
-
for (const [
|
|
185
|
-
yield [
|
|
183
|
+
return new f(function* () {
|
|
184
|
+
for (const [n, [r, i]] of t)
|
|
185
|
+
yield [n, i];
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
188
|
filter(e) {
|
|
189
189
|
const t = this._elements;
|
|
190
190
|
return new d(function* () {
|
|
191
|
-
const
|
|
192
|
-
for (const [
|
|
193
|
-
const o =
|
|
194
|
-
|
|
191
|
+
const n = /* @__PURE__ */ new Map();
|
|
192
|
+
for (const [r, i] of t) {
|
|
193
|
+
const o = n.get(r) ?? 0;
|
|
194
|
+
n.set(r, o + 1), e(r, i, o) && (yield [r, i]);
|
|
195
195
|
}
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
198
|
map(e) {
|
|
199
199
|
const t = this._elements;
|
|
200
200
|
return new d(function* () {
|
|
201
|
-
const
|
|
202
|
-
for (const [
|
|
203
|
-
const o =
|
|
204
|
-
|
|
201
|
+
const n = /* @__PURE__ */ new Map();
|
|
202
|
+
for (const [r, i] of t) {
|
|
203
|
+
const o = n.get(r) ?? 0;
|
|
204
|
+
n.set(r, o + 1), yield [r, e(r, i, o)];
|
|
205
205
|
}
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
208
|
reduce(e, t) {
|
|
209
|
-
const
|
|
210
|
-
for (const [
|
|
209
|
+
const n = /* @__PURE__ */ new Map();
|
|
210
|
+
for (const [r, i] of this._elements) {
|
|
211
211
|
let o, c;
|
|
212
|
-
if (
|
|
213
|
-
[o, c] =
|
|
212
|
+
if (n.has(r))
|
|
213
|
+
[o, c] = n.get(r), o += 1;
|
|
214
214
|
else if (t !== void 0)
|
|
215
215
|
o = 0, c = t;
|
|
216
216
|
else {
|
|
217
|
-
|
|
217
|
+
n.set(r, [0, i]);
|
|
218
218
|
continue;
|
|
219
219
|
}
|
|
220
|
-
c = e(
|
|
220
|
+
c = e(r, c, i, o), n.set(r, [o, c]);
|
|
221
221
|
}
|
|
222
|
-
return new
|
|
223
|
-
for (const [
|
|
224
|
-
yield [
|
|
222
|
+
return new f(function* () {
|
|
223
|
+
for (const [r, [i, o]] of n)
|
|
224
|
+
yield [r, o];
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
227
|
unique() {
|
|
228
228
|
const e = this._elements;
|
|
229
229
|
return new d(function* () {
|
|
230
230
|
const t = /* @__PURE__ */ new Map();
|
|
231
|
-
for (const [
|
|
232
|
-
const i = t.get(
|
|
233
|
-
i.has(
|
|
231
|
+
for (const [n, r] of e) {
|
|
232
|
+
const i = t.get(n) ?? /* @__PURE__ */ new Set();
|
|
233
|
+
i.has(r) || (i.add(r), t.set(n, i), yield [n, r]);
|
|
234
234
|
}
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
237
|
count() {
|
|
238
238
|
const e = /* @__PURE__ */ new Map();
|
|
239
239
|
for (const [t] of this._elements) {
|
|
240
|
-
const
|
|
241
|
-
e.set(t,
|
|
240
|
+
const n = e.get(t) ?? 0;
|
|
241
|
+
e.set(t, n + 1);
|
|
242
242
|
}
|
|
243
|
-
return new
|
|
244
|
-
for (const [t,
|
|
245
|
-
yield [t,
|
|
243
|
+
return new f(function* () {
|
|
244
|
+
for (const [t, n] of e)
|
|
245
|
+
yield [t, n];
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
first() {
|
|
249
|
+
const e = /* @__PURE__ */ new Map();
|
|
250
|
+
for (const [t, n] of this._elements)
|
|
251
|
+
e.has(t) || e.set(t, n);
|
|
252
|
+
return new f(function* () {
|
|
253
|
+
for (const [t, n] of e)
|
|
254
|
+
yield [t, n];
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
last() {
|
|
258
|
+
const e = /* @__PURE__ */ new Map();
|
|
259
|
+
for (const [t, n] of this._elements)
|
|
260
|
+
e.set(t, n);
|
|
261
|
+
return new f(function* () {
|
|
262
|
+
for (const [t, n] of e)
|
|
263
|
+
yield [t, n];
|
|
246
264
|
});
|
|
247
265
|
}
|
|
248
266
|
toArray() {
|
|
@@ -250,25 +268,25 @@ class d {
|
|
|
250
268
|
}
|
|
251
269
|
toMap() {
|
|
252
270
|
const e = /* @__PURE__ */ new Map();
|
|
253
|
-
for (const [t,
|
|
254
|
-
const
|
|
255
|
-
|
|
271
|
+
for (const [t, n] of this._elements) {
|
|
272
|
+
const r = e.get(t) ?? [];
|
|
273
|
+
r.push(n), e.set(t, r);
|
|
256
274
|
}
|
|
257
275
|
return e;
|
|
258
276
|
}
|
|
259
277
|
toObject() {
|
|
260
278
|
const e = {};
|
|
261
|
-
for (const [t,
|
|
262
|
-
const
|
|
263
|
-
|
|
279
|
+
for (const [t, n] of this._elements) {
|
|
280
|
+
const r = e[t] ?? [];
|
|
281
|
+
r.push(n), e[t] = r;
|
|
264
282
|
}
|
|
265
283
|
return e;
|
|
266
284
|
}
|
|
267
285
|
}
|
|
268
286
|
class _ {
|
|
269
287
|
constructor(e) {
|
|
270
|
-
|
|
271
|
-
this._elements = new
|
|
288
|
+
l(this, "_elements");
|
|
289
|
+
this._elements = new u(e);
|
|
272
290
|
}
|
|
273
291
|
filter(e) {
|
|
274
292
|
return new _(this._elements.filter(e));
|
|
@@ -280,35 +298,35 @@ class _ {
|
|
|
280
298
|
return new _(this._elements.unique());
|
|
281
299
|
}
|
|
282
300
|
byKey(e) {
|
|
283
|
-
return new d(this._elements.map((t,
|
|
301
|
+
return new d(this._elements.map((t, n) => [e(t, n), t]));
|
|
284
302
|
}
|
|
285
303
|
}
|
|
286
304
|
class x {
|
|
287
305
|
constructor(e = !0) {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
306
|
+
l(this, "_preferPersistence");
|
|
307
|
+
l(this, "_volatile");
|
|
308
|
+
l(this, "_persistent");
|
|
291
309
|
this._preferPersistence = e, this._volatile = window.sessionStorage, this._persistent = window.localStorage;
|
|
292
310
|
}
|
|
293
|
-
_get(e, t,
|
|
294
|
-
const
|
|
295
|
-
if (
|
|
311
|
+
_get(e, t, n) {
|
|
312
|
+
const r = e.getItem(t);
|
|
313
|
+
if (r)
|
|
296
314
|
try {
|
|
297
|
-
return JSON.parse(
|
|
315
|
+
return JSON.parse(r);
|
|
298
316
|
} catch {
|
|
299
317
|
console.warn(
|
|
300
|
-
`The "${
|
|
318
|
+
`The "${r}" value for "${t}" property cannot be parsed. Clearing the storage...`
|
|
301
319
|
), e.removeItem(t);
|
|
302
320
|
}
|
|
303
|
-
return
|
|
321
|
+
return n;
|
|
304
322
|
}
|
|
305
|
-
_set(e, t,
|
|
306
|
-
const
|
|
307
|
-
|
|
323
|
+
_set(e, t, n) {
|
|
324
|
+
const r = JSON.stringify(n);
|
|
325
|
+
r ? e.setItem(t, r) : e.removeItem(t);
|
|
308
326
|
}
|
|
309
|
-
get(e, t,
|
|
310
|
-
const
|
|
311
|
-
return this._get(
|
|
327
|
+
get(e, t, n = this._preferPersistence) {
|
|
328
|
+
const r = n ? this._persistent : this._volatile;
|
|
329
|
+
return this._get(r, e, t);
|
|
312
330
|
}
|
|
313
331
|
recall(e, t) {
|
|
314
332
|
return this._get(this._volatile, e, t);
|
|
@@ -369,9 +387,9 @@ class x {
|
|
|
369
387
|
* @param newValue The new value to set.
|
|
370
388
|
* @param persistent Whether to use the persistent `localStorage` or the volatile `sessionStorage`.
|
|
371
389
|
*/
|
|
372
|
-
set(e, t,
|
|
373
|
-
const
|
|
374
|
-
this._set(
|
|
390
|
+
set(e, t, n = this._preferPersistence) {
|
|
391
|
+
const r = n ? this._persistent : this._volatile;
|
|
392
|
+
this._set(r, e, t);
|
|
375
393
|
}
|
|
376
394
|
/**
|
|
377
395
|
* Sets the value with the specified name in the volatile `sessionStorage`.
|
|
@@ -420,7 +438,7 @@ class x {
|
|
|
420
438
|
}
|
|
421
439
|
class b {
|
|
422
440
|
constructor() {
|
|
423
|
-
|
|
441
|
+
l(this, "_subscribers");
|
|
424
442
|
this._subscribers = [];
|
|
425
443
|
}
|
|
426
444
|
add(e) {
|
|
@@ -429,7 +447,7 @@ class b {
|
|
|
429
447
|
remove(e) {
|
|
430
448
|
const t = this._subscribers.indexOf(e);
|
|
431
449
|
if (t < 0)
|
|
432
|
-
throw new
|
|
450
|
+
throw new h("Unable to remove the requested subscriber. It was not found.");
|
|
433
451
|
this._subscribers.splice(t, 1);
|
|
434
452
|
}
|
|
435
453
|
call(...e) {
|
|
@@ -438,21 +456,21 @@ class b {
|
|
|
438
456
|
}
|
|
439
457
|
class k {
|
|
440
458
|
constructor(e, t) {
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
459
|
+
l(this, "_isPending");
|
|
460
|
+
l(this, "_isFulfilled");
|
|
461
|
+
l(this, "_isRejected");
|
|
462
|
+
l(this, "_resolve");
|
|
463
|
+
l(this, "_reject");
|
|
464
|
+
l(this, "_promise");
|
|
447
465
|
this._isPending = !0, this._isFulfilled = !1, this._isRejected = !1;
|
|
448
|
-
let
|
|
466
|
+
let n, r;
|
|
449
467
|
const i = (a, m) => {
|
|
450
|
-
|
|
468
|
+
n = a, r = m;
|
|
451
469
|
};
|
|
452
470
|
let o;
|
|
453
471
|
e ? o = (a) => (this._isPending = !1, this._isFulfilled = !0, e(a)) : o = (a) => (this._isPending = !1, this._isFulfilled = !0, a);
|
|
454
472
|
let c;
|
|
455
|
-
t ? c = (a) => (this._isPending = !1, this._isRejected = !0, t(a)) : c = (a) => (this._isPending = !1, this._isRejected = !0, a), this._promise = new Promise(i).then(o, c), this._resolve =
|
|
473
|
+
t ? c = (a) => (this._isPending = !1, this._isRejected = !0, t(a)) : c = (a) => (this._isPending = !1, this._isRejected = !0, a), this._promise = new Promise(i).then(o, c), this._resolve = n, this._reject = r;
|
|
456
474
|
}
|
|
457
475
|
get isPending() {
|
|
458
476
|
return this._isPending;
|
|
@@ -487,13 +505,13 @@ class k {
|
|
|
487
505
|
}
|
|
488
506
|
class M {
|
|
489
507
|
constructor(e) {
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
508
|
+
l(this, "_isPending");
|
|
509
|
+
l(this, "_isFulfilled");
|
|
510
|
+
l(this, "_isRejected");
|
|
511
|
+
l(this, "_promise");
|
|
494
512
|
this._isPending = !0, this._isFulfilled = !1, this._isRejected = !1;
|
|
495
|
-
const t = (
|
|
496
|
-
this._promise = new Promise(e).then(t,
|
|
513
|
+
const t = (r) => (this._isPending = !1, this._isFulfilled = !0, r), n = (r) => (this._isPending = !1, this._isRejected = !0, r);
|
|
514
|
+
this._promise = new Promise(e).then(t, n);
|
|
497
515
|
}
|
|
498
516
|
get isPending() {
|
|
499
517
|
return this._isPending;
|
|
@@ -545,20 +563,20 @@ function R(s, e, t = 864e5) {
|
|
|
545
563
|
return Math.floor((e.getTime() - s.getTime()) / t);
|
|
546
564
|
}
|
|
547
565
|
function F(s, e, t = 864e5) {
|
|
548
|
-
return new
|
|
549
|
-
const
|
|
550
|
-
let
|
|
551
|
-
for (;
|
|
552
|
-
yield new Date(
|
|
566
|
+
return new u(function* () {
|
|
567
|
+
const n = e.getTime();
|
|
568
|
+
let r = s.getTime();
|
|
569
|
+
for (; r < n; )
|
|
570
|
+
yield new Date(r), r += t;
|
|
553
571
|
});
|
|
554
572
|
}
|
|
555
573
|
function I(s, e = 864e5) {
|
|
556
574
|
return new Date(Math.floor(s.getTime() / e) * e);
|
|
557
575
|
}
|
|
558
576
|
async function T(s, e = "text/javascript") {
|
|
559
|
-
return new Promise((t,
|
|
560
|
-
const
|
|
561
|
-
|
|
577
|
+
return new Promise((t, n) => {
|
|
578
|
+
const r = document.createElement("script");
|
|
579
|
+
r.async = !0, r.defer = !0, r.src = s, r.type = e, r.onload = () => t(), r.onerror = () => n(), document.body.appendChild(r);
|
|
562
580
|
});
|
|
563
581
|
}
|
|
564
582
|
function A(s) {
|
|
@@ -570,55 +588,55 @@ function A(s) {
|
|
|
570
588
|
return e;
|
|
571
589
|
}
|
|
572
590
|
function q(s, e, t = 1) {
|
|
573
|
-
return new
|
|
591
|
+
return new u(function* () {
|
|
574
592
|
e === void 0 && (e = s, s = 0), s > e && (t = t ?? -1);
|
|
575
|
-
for (let
|
|
576
|
-
yield
|
|
593
|
+
for (let n = s; n < e; n += t)
|
|
594
|
+
yield n;
|
|
577
595
|
});
|
|
578
596
|
}
|
|
579
597
|
function C(s) {
|
|
580
598
|
const e = Array.from(s);
|
|
581
599
|
for (let t = e.length - 1; t > 0; t -= 1) {
|
|
582
|
-
const
|
|
583
|
-
[e[t], e[
|
|
600
|
+
const n = Math.floor(Math.random() * (t + 1));
|
|
601
|
+
[e[t], e[n]] = [e[n], e[t]];
|
|
584
602
|
}
|
|
585
603
|
return e;
|
|
586
604
|
}
|
|
587
605
|
function E(s) {
|
|
588
|
-
return new
|
|
606
|
+
return new u(function* () {
|
|
589
607
|
const e = /* @__PURE__ */ new Set();
|
|
590
608
|
for (const t of s)
|
|
591
609
|
e.has(t) || (e.add(t), yield t);
|
|
592
610
|
});
|
|
593
611
|
}
|
|
594
612
|
function p(s, e) {
|
|
595
|
-
return new
|
|
596
|
-
const t = s[Symbol.iterator](),
|
|
613
|
+
return new u(function* () {
|
|
614
|
+
const t = s[Symbol.iterator](), n = e[Symbol.iterator]();
|
|
597
615
|
for (; ; ) {
|
|
598
|
-
const
|
|
599
|
-
if (
|
|
616
|
+
const r = t.next(), i = n.next();
|
|
617
|
+
if (r.done || i.done)
|
|
600
618
|
break;
|
|
601
|
-
yield [
|
|
619
|
+
yield [r.value, i.value];
|
|
602
620
|
}
|
|
603
621
|
});
|
|
604
622
|
}
|
|
605
623
|
function O(s, e) {
|
|
606
624
|
if (e === void 0) {
|
|
607
|
-
let
|
|
625
|
+
let r = 0, i = 0;
|
|
608
626
|
for (const o of s)
|
|
609
|
-
|
|
610
|
-
return
|
|
627
|
+
r += o, i += 1;
|
|
628
|
+
return r / i;
|
|
611
629
|
}
|
|
612
|
-
let t = 0,
|
|
613
|
-
for (const [
|
|
614
|
-
t +=
|
|
615
|
-
return t /
|
|
630
|
+
let t = 0, n = 0;
|
|
631
|
+
for (const [r, i] of p(s, e))
|
|
632
|
+
t += r * i, n += i;
|
|
633
|
+
return t / n;
|
|
616
634
|
}
|
|
617
635
|
function $(s) {
|
|
618
636
|
let e = 0;
|
|
619
637
|
for (let t = 0; t < s.length; t += 1) {
|
|
620
|
-
const
|
|
621
|
-
e = (e << 5) - e +
|
|
638
|
+
const n = s.charCodeAt(t);
|
|
639
|
+
e = (e << 5) - e + n, e |= 0;
|
|
622
640
|
}
|
|
623
641
|
return e;
|
|
624
642
|
}
|
|
@@ -631,17 +649,17 @@ function J(s) {
|
|
|
631
649
|
function V(s) {
|
|
632
650
|
return `${s.charAt(0).toUpperCase()}${s.slice(1)}`;
|
|
633
651
|
}
|
|
634
|
-
const z = "1.3.
|
|
652
|
+
const z = "1.3.3";
|
|
635
653
|
export {
|
|
636
654
|
d as AggregatedIterator,
|
|
637
655
|
_ as Aggregator,
|
|
638
656
|
v as DateUnit,
|
|
639
657
|
k as DeferredPromise,
|
|
640
|
-
|
|
658
|
+
h as Exception,
|
|
641
659
|
x as JsonStorage,
|
|
642
660
|
P as Random,
|
|
643
|
-
|
|
644
|
-
|
|
661
|
+
f as ReducedIterator,
|
|
662
|
+
u as SmartIterator,
|
|
645
663
|
M as SmartPromise,
|
|
646
664
|
b as Subscribers,
|
|
647
665
|
z as VERSION,
|