@byloth/core 1.2.0 → 1.2.1-rc.1
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 +400 -214
- 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 +4 -4
- package/src/index.ts +13 -2
- package/src/models/aggregators/_index.old.ts +384 -0
- package/src/models/aggregators/aggregated-iterator.ts +214 -0
- package/src/models/aggregators/index.ts +45 -0
- package/src/models/aggregators/reduced-iterator.ts +59 -0
- package/src/models/aggregators/types.ts +2 -0
- package/src/models/index.ts +14 -3
- package/src/models/smart-iterator.ts +56 -6
- package/src/utils/iterator.ts +19 -4
package/dist/core.js
CHANGED
|
@@ -1,15 +1,297 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
class
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var _ = (s, e, t) => e in s ? d(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
+
var u = (s, e, t) => (_(s, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
class f extends Error {
|
|
5
|
+
static FromUnknown(e) {
|
|
6
|
+
if (e instanceof f)
|
|
7
|
+
return e;
|
|
8
|
+
if (e instanceof Error) {
|
|
9
|
+
const t = new f(e.message);
|
|
10
|
+
return t.stack = e.stack, t.name = e.name, t;
|
|
11
|
+
}
|
|
12
|
+
return new f(`${e}`);
|
|
13
|
+
}
|
|
14
|
+
constructor(e, t, r = "Exception") {
|
|
15
|
+
super(e), this.cause = t, this.name = r, t && (t instanceof Error ? this.stack += `
|
|
16
|
+
|
|
17
|
+
Caused by ${t.stack}` : this.stack += `
|
|
18
|
+
|
|
19
|
+
Caused by ${t}`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
class l {
|
|
23
|
+
constructor(e) {
|
|
24
|
+
u(this, "_iterator");
|
|
25
|
+
u(this, "return");
|
|
26
|
+
u(this, "throw");
|
|
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
|
+
}
|
|
29
|
+
every(e) {
|
|
30
|
+
let t = 0;
|
|
31
|
+
for (; ; ) {
|
|
32
|
+
const r = this._iterator.next();
|
|
33
|
+
if (r.done)
|
|
34
|
+
return !0;
|
|
35
|
+
if (!e(r.value, t))
|
|
36
|
+
return !1;
|
|
37
|
+
t += 1;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
some(e) {
|
|
41
|
+
let t = 0;
|
|
42
|
+
for (; ; ) {
|
|
43
|
+
const r = this._iterator.next();
|
|
44
|
+
if (r.done)
|
|
45
|
+
return !1;
|
|
46
|
+
if (e(r.value, t))
|
|
47
|
+
return !0;
|
|
48
|
+
t += 1;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
filter(e) {
|
|
52
|
+
const t = this._iterator;
|
|
53
|
+
return new l(function* () {
|
|
54
|
+
let r = 0;
|
|
55
|
+
for (; ; ) {
|
|
56
|
+
const n = t.next();
|
|
57
|
+
if (n.done)
|
|
58
|
+
return n.value;
|
|
59
|
+
e(n.value, r) && (yield n.value), r += 1;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
map(e) {
|
|
64
|
+
const t = this._iterator;
|
|
65
|
+
return new l(function* () {
|
|
66
|
+
let r = 0;
|
|
67
|
+
for (; ; ) {
|
|
68
|
+
const n = t.next();
|
|
69
|
+
if (n.done)
|
|
70
|
+
return n.value;
|
|
71
|
+
yield e(n.value, r), r += 1;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
reduce(e, t) {
|
|
76
|
+
let r = 0, n = t;
|
|
77
|
+
if (n === void 0) {
|
|
78
|
+
const o = this._iterator.next();
|
|
79
|
+
if (o.done)
|
|
80
|
+
throw new TypeError("Reduce of empty iterator with no initial value");
|
|
81
|
+
n = o.value, r += 1;
|
|
82
|
+
}
|
|
83
|
+
for (; ; ) {
|
|
84
|
+
const o = this._iterator.next();
|
|
85
|
+
if (o.done)
|
|
86
|
+
return n;
|
|
87
|
+
n = e(n, o.value, r), r += 1;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
enumerate() {
|
|
91
|
+
return this.map((e, t) => [t, e]);
|
|
92
|
+
}
|
|
93
|
+
unique() {
|
|
94
|
+
const e = this._iterator;
|
|
95
|
+
return new l(function* () {
|
|
96
|
+
const t = /* @__PURE__ */ new Set();
|
|
97
|
+
for (; ; ) {
|
|
98
|
+
const r = e.next();
|
|
99
|
+
if (r.done)
|
|
100
|
+
return r.value;
|
|
101
|
+
t.has(r.value) || (t.add(r.value), yield r.value);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
count() {
|
|
106
|
+
let e = 0;
|
|
107
|
+
for (; ; ) {
|
|
108
|
+
if (this._iterator.next().done)
|
|
109
|
+
return e;
|
|
110
|
+
e += 1;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
forEach(e) {
|
|
114
|
+
let t = 0;
|
|
115
|
+
for (; ; ) {
|
|
116
|
+
const r = this._iterator.next();
|
|
117
|
+
if (r.done)
|
|
118
|
+
return;
|
|
119
|
+
e(r.value, t), t += 1;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
next(...e) {
|
|
123
|
+
return this._iterator.next(...e);
|
|
124
|
+
}
|
|
125
|
+
toArray() {
|
|
126
|
+
return Array.from(this);
|
|
127
|
+
}
|
|
128
|
+
[Symbol.iterator]() {
|
|
129
|
+
return this;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
class c {
|
|
133
|
+
constructor(e) {
|
|
134
|
+
u(this, "_elements");
|
|
135
|
+
this._elements = new l(e);
|
|
136
|
+
}
|
|
137
|
+
filter(e) {
|
|
138
|
+
const t = this._elements;
|
|
139
|
+
return new c(function* () {
|
|
140
|
+
for (const [r, [n, o]] of t.enumerate())
|
|
141
|
+
e(n, o, r) && (yield [n, o]);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
map(e) {
|
|
145
|
+
const t = this._elements;
|
|
146
|
+
return new c(function* () {
|
|
147
|
+
for (const [r, [n, o]] of t.enumerate())
|
|
148
|
+
yield [n, e(n, o, r)];
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
toArray() {
|
|
152
|
+
return Array.from(this.toMap().values());
|
|
153
|
+
}
|
|
154
|
+
toMap() {
|
|
155
|
+
return new Map(this._elements.toArray());
|
|
156
|
+
}
|
|
157
|
+
toObject() {
|
|
158
|
+
return Object.fromEntries(this._elements.toArray());
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
class h {
|
|
162
|
+
constructor(e) {
|
|
163
|
+
u(this, "_elements");
|
|
164
|
+
this._elements = new l(e);
|
|
165
|
+
}
|
|
166
|
+
every(e) {
|
|
167
|
+
const t = /* @__PURE__ */ new Map();
|
|
168
|
+
for (const [r, n] of this._elements) {
|
|
169
|
+
const [o, i] = t.get(r) ?? [0, !0];
|
|
170
|
+
i && t.set(r, [o + 1, e(r, n, o)]);
|
|
171
|
+
}
|
|
172
|
+
return new c(function* () {
|
|
173
|
+
for (const [r, [n, o]] of t)
|
|
174
|
+
yield [r, o];
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
some(e) {
|
|
178
|
+
const t = /* @__PURE__ */ new Map();
|
|
179
|
+
for (const [r, n] of this._elements) {
|
|
180
|
+
const [o, i] = t.get(r) ?? [0, !1];
|
|
181
|
+
i || t.set(r, [o + 1, e(r, n, o)]);
|
|
182
|
+
}
|
|
183
|
+
return new c(function* () {
|
|
184
|
+
for (const [r, [n, o]] of t)
|
|
185
|
+
yield [r, o];
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
filter(e) {
|
|
189
|
+
const t = this._elements;
|
|
190
|
+
return new h(function* () {
|
|
191
|
+
const r = /* @__PURE__ */ new Map();
|
|
192
|
+
for (const [n, o] of t) {
|
|
193
|
+
const i = r.get(n) ?? 0;
|
|
194
|
+
r.set(n, i + 1), e(n, o, i) && (yield [n, o]);
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
map(e) {
|
|
199
|
+
const t = this._elements;
|
|
200
|
+
return new h(function* () {
|
|
201
|
+
const r = /* @__PURE__ */ new Map();
|
|
202
|
+
for (const [n, o] of t) {
|
|
203
|
+
const i = r.get(n) ?? 0;
|
|
204
|
+
r.set(n, i + 1), yield [n, e(n, o, i)];
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
reduce(e, t) {
|
|
209
|
+
const r = /* @__PURE__ */ new Map();
|
|
210
|
+
for (const [n, o] of this._elements) {
|
|
211
|
+
let i, a;
|
|
212
|
+
if (r.has(n))
|
|
213
|
+
[i, a] = r.get(n), i += 1;
|
|
214
|
+
else if (t !== void 0)
|
|
215
|
+
i = 0, a = t;
|
|
216
|
+
else {
|
|
217
|
+
r.set(n, [0, o]);
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
a = e(n, a, o, i), r.set(n, [i, a]);
|
|
221
|
+
}
|
|
222
|
+
return new c(function* () {
|
|
223
|
+
for (const [n, [o, i]] of r)
|
|
224
|
+
yield [n, i];
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
unique() {
|
|
228
|
+
const e = this._elements;
|
|
229
|
+
return new h(function* () {
|
|
230
|
+
const t = /* @__PURE__ */ new Map();
|
|
231
|
+
for (const [r, n] of e) {
|
|
232
|
+
const o = t.get(r) ?? /* @__PURE__ */ new Set();
|
|
233
|
+
o.has(n) || (o.add(n), t.set(r, o), yield [r, n]);
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
count() {
|
|
238
|
+
const e = /* @__PURE__ */ new Map();
|
|
239
|
+
for (const [t] of this._elements) {
|
|
240
|
+
const r = e.get(t) ?? 0;
|
|
241
|
+
e.set(t, r + 1);
|
|
242
|
+
}
|
|
243
|
+
return new c(function* () {
|
|
244
|
+
for (const [t, r] of e)
|
|
245
|
+
yield [t, r];
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
toArray() {
|
|
249
|
+
return Array.from(this.toMap().values());
|
|
250
|
+
}
|
|
251
|
+
toMap() {
|
|
252
|
+
const e = /* @__PURE__ */ new Map();
|
|
253
|
+
for (const [t, r] of this._elements) {
|
|
254
|
+
const n = e.get(t) ?? [];
|
|
255
|
+
n.push(r), e.set(t, n);
|
|
256
|
+
}
|
|
257
|
+
return e;
|
|
258
|
+
}
|
|
259
|
+
toObject() {
|
|
260
|
+
const e = {};
|
|
261
|
+
for (const [t, r] of this._elements) {
|
|
262
|
+
const n = e[t] ?? [];
|
|
263
|
+
n.push(r), e[t] = n;
|
|
264
|
+
}
|
|
265
|
+
return e;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
class m {
|
|
269
|
+
constructor(e) {
|
|
270
|
+
u(this, "_elements");
|
|
271
|
+
this._elements = new l(e);
|
|
272
|
+
}
|
|
273
|
+
filter(e) {
|
|
274
|
+
return new m(this._elements.filter(e));
|
|
275
|
+
}
|
|
276
|
+
map(e) {
|
|
277
|
+
return new m(this._elements.map(e));
|
|
278
|
+
}
|
|
279
|
+
unique() {
|
|
280
|
+
return new m(this._elements.unique());
|
|
281
|
+
}
|
|
282
|
+
byKey(e) {
|
|
283
|
+
return new h(this._elements.map((t, r) => [e(t, r), t]));
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
class p {
|
|
5
287
|
constructor(e, t) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
let
|
|
10
|
-
this._promise = new Promise((
|
|
11
|
-
|
|
12
|
-
}).then(e, t), this._resolve =
|
|
288
|
+
u(this, "_resolve");
|
|
289
|
+
u(this, "_reject");
|
|
290
|
+
u(this, "_promise");
|
|
291
|
+
let r, n;
|
|
292
|
+
this._promise = new Promise((o, i) => {
|
|
293
|
+
r = o, n = i;
|
|
294
|
+
}).then(e, t), this._resolve = r, this._reject = n;
|
|
13
295
|
}
|
|
14
296
|
get resolve() {
|
|
15
297
|
return this._resolve;
|
|
@@ -33,32 +315,14 @@ class v {
|
|
|
33
315
|
return "DeferredPromise";
|
|
34
316
|
}
|
|
35
317
|
}
|
|
36
|
-
class
|
|
37
|
-
static FromUnknown(e) {
|
|
38
|
-
if (e instanceof l)
|
|
39
|
-
return e;
|
|
40
|
-
if (e instanceof Error) {
|
|
41
|
-
const t = new l(e.message);
|
|
42
|
-
return t.stack = e.stack, t.name = e.name, t;
|
|
43
|
-
}
|
|
44
|
-
return new l(`${e}`);
|
|
45
|
-
}
|
|
46
|
-
constructor(e, t, s = "Exception") {
|
|
47
|
-
super(e), this.cause = t, this.name = s, t && (t instanceof Error ? this.stack += `
|
|
48
|
-
|
|
49
|
-
Caused by ${t.stack}` : this.stack += `
|
|
50
|
-
|
|
51
|
-
Caused by ${t}`);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
class m {
|
|
318
|
+
class x {
|
|
55
319
|
constructor(e = !0) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
320
|
+
u(this, "_preferPersistence");
|
|
321
|
+
u(this, "_volatile");
|
|
322
|
+
u(this, "_persistent");
|
|
59
323
|
this._preferPersistence = e, this._volatile = window.sessionStorage, this._persistent = window.localStorage;
|
|
60
324
|
}
|
|
61
|
-
_get(e, t,
|
|
325
|
+
_get(e, t, r) {
|
|
62
326
|
const n = e.getItem(t);
|
|
63
327
|
if (n)
|
|
64
328
|
try {
|
|
@@ -68,14 +332,14 @@ class m {
|
|
|
68
332
|
`The "${n}" value for "${t}" property cannot be parsed. Clearing the storage...`
|
|
69
333
|
), e.removeItem(t);
|
|
70
334
|
}
|
|
71
|
-
return
|
|
335
|
+
return r;
|
|
72
336
|
}
|
|
73
|
-
_set(e, t,
|
|
74
|
-
const n = JSON.stringify(
|
|
337
|
+
_set(e, t, r) {
|
|
338
|
+
const n = JSON.stringify(r);
|
|
75
339
|
n ? e.setItem(t, n) : e.removeItem(t);
|
|
76
340
|
}
|
|
77
|
-
get(e, t,
|
|
78
|
-
const n =
|
|
341
|
+
get(e, t, r = this._preferPersistence) {
|
|
342
|
+
const n = r ? this._persistent : this._volatile;
|
|
79
343
|
return this._get(n, e, t);
|
|
80
344
|
}
|
|
81
345
|
recall(e, t) {
|
|
@@ -137,8 +401,8 @@ class m {
|
|
|
137
401
|
* @param newValue The new value to set.
|
|
138
402
|
* @param persistent Whether to use the persistent `localStorage` or the volatile `sessionStorage`.
|
|
139
403
|
*/
|
|
140
|
-
set(e, t,
|
|
141
|
-
const n =
|
|
404
|
+
set(e, t, r = this._preferPersistence) {
|
|
405
|
+
const n = r ? this._persistent : this._volatile;
|
|
142
406
|
this._set(n, e, t);
|
|
143
407
|
}
|
|
144
408
|
/**
|
|
@@ -186,90 +450,9 @@ class m {
|
|
|
186
450
|
this._volatile.removeItem(e), this._persistent.removeItem(e);
|
|
187
451
|
}
|
|
188
452
|
}
|
|
189
|
-
class
|
|
190
|
-
constructor(e) {
|
|
191
|
-
o(this, "_iterator");
|
|
192
|
-
o(this, "return");
|
|
193
|
-
o(this, "throw");
|
|
194
|
-
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));
|
|
195
|
-
}
|
|
196
|
-
every(e) {
|
|
197
|
-
let t = 0;
|
|
198
|
-
for (; ; ) {
|
|
199
|
-
const s = this._iterator.next();
|
|
200
|
-
if (s.done)
|
|
201
|
-
return !0;
|
|
202
|
-
if (!e(s.value, t))
|
|
203
|
-
return !1;
|
|
204
|
-
t += 1;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
some(e) {
|
|
208
|
-
let t = 0;
|
|
209
|
-
for (; ; ) {
|
|
210
|
-
const s = this._iterator.next();
|
|
211
|
-
if (s.done)
|
|
212
|
-
return !1;
|
|
213
|
-
if (e(s.value, t))
|
|
214
|
-
return !0;
|
|
215
|
-
t += 1;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
filter(e) {
|
|
219
|
-
let t = 0;
|
|
220
|
-
const s = this._iterator;
|
|
221
|
-
return new u(function* () {
|
|
222
|
-
for (; ; ) {
|
|
223
|
-
const n = s.next();
|
|
224
|
-
if (n.done)
|
|
225
|
-
return n.value;
|
|
226
|
-
e(n.value, t) && (yield n.value), t += 1;
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
map(e) {
|
|
231
|
-
let t = 0;
|
|
232
|
-
const s = this._iterator;
|
|
233
|
-
return new u(function* () {
|
|
234
|
-
for (; ; ) {
|
|
235
|
-
const n = s.next();
|
|
236
|
-
if (n.done)
|
|
237
|
-
return n.value;
|
|
238
|
-
yield e(n.value, t), t += 1;
|
|
239
|
-
}
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
reduce(e, t) {
|
|
243
|
-
let s = 0, n = t;
|
|
244
|
-
for (; ; ) {
|
|
245
|
-
const i = this._iterator.next();
|
|
246
|
-
if (i.done)
|
|
247
|
-
return n;
|
|
248
|
-
n = e(n, i.value, s), s += 1;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
forEach(e) {
|
|
252
|
-
let t = 0;
|
|
253
|
-
for (; ; ) {
|
|
254
|
-
const s = this._iterator.next();
|
|
255
|
-
if (s.done)
|
|
256
|
-
return;
|
|
257
|
-
e(s.value, t), t += 1;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
next(...e) {
|
|
261
|
-
return this._iterator.next(...e);
|
|
262
|
-
}
|
|
263
|
-
toArray() {
|
|
264
|
-
return [...this];
|
|
265
|
-
}
|
|
266
|
-
[Symbol.iterator]() {
|
|
267
|
-
return this;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
class w {
|
|
453
|
+
class b {
|
|
271
454
|
constructor() {
|
|
272
|
-
|
|
455
|
+
u(this, "_subscribers");
|
|
273
456
|
this._subscribers = [];
|
|
274
457
|
}
|
|
275
458
|
add(e) {
|
|
@@ -278,150 +461,153 @@ class w {
|
|
|
278
461
|
remove(e) {
|
|
279
462
|
const t = this._subscribers.indexOf(e);
|
|
280
463
|
if (t < 0)
|
|
281
|
-
throw new
|
|
464
|
+
throw new f("Unable to remove the requested subscriber. It was not found.");
|
|
282
465
|
this._subscribers.splice(t, 1);
|
|
283
466
|
}
|
|
284
467
|
call(...e) {
|
|
285
468
|
return this._subscribers.slice().map((t) => t(...e));
|
|
286
469
|
}
|
|
287
470
|
}
|
|
288
|
-
async function g(
|
|
289
|
-
return new Promise((e, t) => setTimeout(e,
|
|
471
|
+
async function g(s) {
|
|
472
|
+
return new Promise((e, t) => setTimeout(e, s));
|
|
290
473
|
}
|
|
291
|
-
async function
|
|
292
|
-
return new Promise((
|
|
474
|
+
async function k() {
|
|
475
|
+
return new Promise((s, e) => requestAnimationFrame(() => s()));
|
|
293
476
|
}
|
|
294
|
-
var
|
|
295
|
-
function
|
|
296
|
-
return Math.floor((e.getTime() -
|
|
477
|
+
var w = /* @__PURE__ */ ((s) => (s[s.Second = 1e3] = "Second", s[s.Minute = 6e4] = "Minute", s[s.Hour = 36e5] = "Hour", s[s.Day = 864e5] = "Day", s[s.Week = 6048e5] = "Week", s[s.Month = 2592e6] = "Month", s[s.Year = 31536e6] = "Year", s))(w || {});
|
|
478
|
+
function M(s, e, t = 864e5) {
|
|
479
|
+
return Math.floor((e.getTime() - s.getTime()) / t);
|
|
297
480
|
}
|
|
298
|
-
function
|
|
299
|
-
return new
|
|
300
|
-
const
|
|
301
|
-
let n =
|
|
302
|
-
for (; n <
|
|
481
|
+
function S(s, e, t = 864e5) {
|
|
482
|
+
return new l(function* () {
|
|
483
|
+
const r = e.getTime();
|
|
484
|
+
let n = s.getTime();
|
|
485
|
+
for (; n < r; )
|
|
303
486
|
yield new Date(n), n += t;
|
|
304
487
|
});
|
|
305
488
|
}
|
|
306
|
-
function
|
|
307
|
-
return new Date(Math.floor(
|
|
489
|
+
function j(s, e = 864e5) {
|
|
490
|
+
return new Date(Math.floor(s.getTime() / e) * e);
|
|
308
491
|
}
|
|
309
|
-
async function
|
|
310
|
-
return new Promise((t,
|
|
492
|
+
async function A(s, e = "text/javascript") {
|
|
493
|
+
return new Promise((t, r) => {
|
|
311
494
|
const n = document.createElement("script");
|
|
312
|
-
n.async = !0, n.defer = !0, n.src =
|
|
495
|
+
n.async = !0, n.defer = !0, n.src = s, n.type = e, n.onload = () => t(), n.onerror = () => r(), document.body.appendChild(n);
|
|
313
496
|
});
|
|
314
497
|
}
|
|
315
|
-
function
|
|
316
|
-
if (Array.isArray(
|
|
317
|
-
return
|
|
498
|
+
function T(s) {
|
|
499
|
+
if (Array.isArray(s))
|
|
500
|
+
return s.length;
|
|
318
501
|
let e = 0;
|
|
319
|
-
for (const t of
|
|
502
|
+
for (const t of s)
|
|
320
503
|
e += 1;
|
|
321
504
|
return e;
|
|
322
505
|
}
|
|
323
|
-
function
|
|
324
|
-
return new
|
|
325
|
-
e === void 0 && (e =
|
|
326
|
-
for (let
|
|
327
|
-
yield
|
|
506
|
+
function I(s, e, t = 1) {
|
|
507
|
+
return new l(function* () {
|
|
508
|
+
e === void 0 && (e = s, s = 0), s > e && (t = t ?? -1);
|
|
509
|
+
for (let r = s; r < e; r += t)
|
|
510
|
+
yield r;
|
|
328
511
|
});
|
|
329
512
|
}
|
|
330
|
-
function
|
|
331
|
-
const e =
|
|
513
|
+
function P(s) {
|
|
514
|
+
const e = Array.from(s);
|
|
332
515
|
for (let t = e.length - 1; t > 0; t -= 1) {
|
|
333
|
-
const
|
|
334
|
-
[e[t], e[
|
|
516
|
+
const r = Math.floor(Math.random() * (t + 1));
|
|
517
|
+
[e[t], e[r]] = [e[r], e[t]];
|
|
335
518
|
}
|
|
336
519
|
return e;
|
|
337
520
|
}
|
|
338
|
-
function
|
|
339
|
-
return new
|
|
521
|
+
function q(s) {
|
|
522
|
+
return new l(function* () {
|
|
340
523
|
const e = /* @__PURE__ */ new Set();
|
|
341
|
-
for (const t of
|
|
524
|
+
for (const t of s)
|
|
342
525
|
e.has(t) || (e.add(t), yield t);
|
|
343
526
|
});
|
|
344
527
|
}
|
|
345
|
-
function
|
|
346
|
-
return new
|
|
347
|
-
const t =
|
|
528
|
+
function y(s, e) {
|
|
529
|
+
return new l(function* () {
|
|
530
|
+
const t = s[Symbol.iterator](), r = e[Symbol.iterator]();
|
|
348
531
|
for (; ; ) {
|
|
349
|
-
const n = t.next(),
|
|
350
|
-
if (n.done ||
|
|
532
|
+
const n = t.next(), o = r.next();
|
|
533
|
+
if (n.done || o.done)
|
|
351
534
|
break;
|
|
352
|
-
yield [n.value,
|
|
535
|
+
yield [n.value, o.value];
|
|
353
536
|
}
|
|
354
537
|
});
|
|
355
538
|
}
|
|
356
|
-
function
|
|
539
|
+
function E(s, e) {
|
|
357
540
|
if (e === void 0) {
|
|
358
|
-
let n = 0,
|
|
359
|
-
for (const
|
|
360
|
-
n +=
|
|
361
|
-
return n /
|
|
362
|
-
}
|
|
363
|
-
let t = 0,
|
|
364
|
-
for (const [n,
|
|
365
|
-
t += n *
|
|
366
|
-
return t /
|
|
541
|
+
let n = 0, o = 0;
|
|
542
|
+
for (const i of s)
|
|
543
|
+
n += i, o += 1;
|
|
544
|
+
return n / o;
|
|
545
|
+
}
|
|
546
|
+
let t = 0, r = 0;
|
|
547
|
+
for (const [n, o] of y(s, e))
|
|
548
|
+
t += n * o, r += o;
|
|
549
|
+
return t / r;
|
|
367
550
|
}
|
|
368
|
-
function
|
|
551
|
+
function O(s) {
|
|
369
552
|
let e = 0;
|
|
370
|
-
for (let t = 0; t <
|
|
371
|
-
const
|
|
372
|
-
e = (e << 5) - e +
|
|
553
|
+
for (let t = 0; t < s.length; t++) {
|
|
554
|
+
const r = s.charCodeAt(t);
|
|
555
|
+
e = (e << 5) - e + r, e |= 0;
|
|
373
556
|
}
|
|
374
557
|
return e;
|
|
375
558
|
}
|
|
376
|
-
function
|
|
377
|
-
if (e === void 0 && (e =
|
|
378
|
-
return
|
|
379
|
-
let
|
|
559
|
+
function $(s = 1, e, t) {
|
|
560
|
+
if (e === void 0 && (e = s, s = 0), s === e)
|
|
561
|
+
return s;
|
|
562
|
+
let r;
|
|
380
563
|
if (t === !0)
|
|
381
|
-
|
|
564
|
+
r = (n) => n;
|
|
382
565
|
else if (t === void 0)
|
|
383
|
-
Math.abs(e -
|
|
566
|
+
Math.abs(e - s) <= 1 ? r = (n) => n : r = Math.floor;
|
|
384
567
|
else if (t === !1)
|
|
385
|
-
|
|
568
|
+
r = Math.floor;
|
|
386
569
|
else {
|
|
387
570
|
const n = 10 ** t;
|
|
388
|
-
|
|
571
|
+
r = (o) => Math.floor(o * n) / n;
|
|
389
572
|
}
|
|
390
|
-
return
|
|
573
|
+
return r(Math.random() * (e - s) + s);
|
|
391
574
|
}
|
|
392
|
-
function
|
|
575
|
+
function C(s) {
|
|
393
576
|
let e = 0;
|
|
394
|
-
for (const t of
|
|
577
|
+
for (const t of s)
|
|
395
578
|
e += t;
|
|
396
579
|
return e;
|
|
397
580
|
}
|
|
398
|
-
function
|
|
399
|
-
return `${
|
|
581
|
+
function R(s) {
|
|
582
|
+
return `${s.charAt(0).toUpperCase()}${s.slice(1)}`;
|
|
400
583
|
}
|
|
401
|
-
const
|
|
584
|
+
const F = "1.2.1-rc.1";
|
|
402
585
|
export {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
586
|
+
h as AggregatedIterator,
|
|
587
|
+
m as Aggregator,
|
|
588
|
+
w as DateUnit,
|
|
589
|
+
p as DeferredPromise,
|
|
590
|
+
f as Exception,
|
|
591
|
+
x as JsonStorage,
|
|
592
|
+
c as ReducedIterator,
|
|
593
|
+
l as SmartIterator,
|
|
594
|
+
b as Subscribers,
|
|
595
|
+
F as VERSION,
|
|
596
|
+
E as average,
|
|
597
|
+
R as capitalize,
|
|
598
|
+
T as count,
|
|
599
|
+
M as dateDifference,
|
|
600
|
+
S as dateRange,
|
|
601
|
+
j as dateRound,
|
|
416
602
|
g as delay,
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
603
|
+
O as hash,
|
|
604
|
+
A as loadScript,
|
|
605
|
+
k as nextAnimationFrame,
|
|
606
|
+
$ as random,
|
|
607
|
+
I as range,
|
|
608
|
+
P as shuffle,
|
|
609
|
+
C as sum,
|
|
610
|
+
q as unique,
|
|
611
|
+
y as zip
|
|
426
612
|
};
|
|
427
613
|
//# sourceMappingURL=core.js.map
|