@ztimson/utils 0.16.2 → 0.16.4
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/cache.d.ts +72 -0
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +371 -282
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
function ot(
|
|
5
|
-
if (
|
|
1
|
+
var rt = Object.defineProperty;
|
|
2
|
+
var nt = (r, t, e) => t in r ? rt(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
|
|
3
|
+
var c = (r, t, e) => (nt(r, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
function ot(r, t = !1) {
|
|
5
|
+
if (r == null)
|
|
6
6
|
throw new Error("Cannot clean a NULL value");
|
|
7
|
-
return Array.isArray(
|
|
8
|
-
(t &&
|
|
9
|
-
}),
|
|
7
|
+
return Array.isArray(r) ? r = r.filter((e) => e != null) : Object.entries(r).forEach(([e, n]) => {
|
|
8
|
+
(t && n === void 0 || !t && n == null) && delete r[e];
|
|
9
|
+
}), r;
|
|
10
10
|
}
|
|
11
|
-
function xt(
|
|
12
|
-
return structuredClone(
|
|
11
|
+
function xt(r) {
|
|
12
|
+
return structuredClone(r);
|
|
13
13
|
}
|
|
14
|
-
function st(
|
|
14
|
+
function st(r, ...t) {
|
|
15
15
|
return t.forEach((e) => {
|
|
16
|
-
for (const
|
|
17
|
-
e[
|
|
18
|
-
}),
|
|
19
|
-
}
|
|
20
|
-
function x(
|
|
21
|
-
if (!(
|
|
22
|
-
return t.split(/[.[\]]/g).filter((
|
|
23
|
-
if ((o[0] == '"' || o[0] == "'") && (o = o.slice(1, -1)), !(
|
|
16
|
+
for (const n in e)
|
|
17
|
+
e[n] && typeof e[n] == "object" && !Array.isArray(e[n]) ? (r[n] || (r[n] = {}), st(r[n], e[n])) : r[n] = e[n];
|
|
18
|
+
}), r;
|
|
19
|
+
}
|
|
20
|
+
function x(r, t, e) {
|
|
21
|
+
if (!(r == null || !t))
|
|
22
|
+
return t.split(/[.[\]]/g).filter((n) => n.length).reduce((n, o, s, i) => {
|
|
23
|
+
if ((o[0] == '"' || o[0] == "'") && (o = o.slice(1, -1)), !(n != null && n.hasOwnProperty(o))) {
|
|
24
24
|
if (e == null)
|
|
25
25
|
return;
|
|
26
|
-
|
|
26
|
+
n[o] = {};
|
|
27
27
|
}
|
|
28
|
-
return e !== void 0 && s ==
|
|
29
|
-
},
|
|
28
|
+
return e !== void 0 && s == i.length - 1 ? n[o] = e : n[o];
|
|
29
|
+
}, r);
|
|
30
30
|
}
|
|
31
|
-
function Bt(
|
|
32
|
-
return Object.entries(
|
|
31
|
+
function Bt(r) {
|
|
32
|
+
return Object.entries(r).map(
|
|
33
33
|
([t, e]) => encodeURIComponent(t) + "=" + encodeURIComponent(e)
|
|
34
34
|
).join("&");
|
|
35
35
|
}
|
|
36
|
-
function F(
|
|
37
|
-
if (typeof
|
|
38
|
-
for (const
|
|
39
|
-
const o = t ? t + "." +
|
|
40
|
-
typeof n
|
|
36
|
+
function F(r, t, e = {}) {
|
|
37
|
+
if (typeof r == "object" && !Array.isArray(r)) {
|
|
38
|
+
for (const n of Object.keys(r)) {
|
|
39
|
+
const o = t ? t + "." + n : n;
|
|
40
|
+
typeof r[n] == "object" ? F(r[n], o, e) : e[o] = r[n];
|
|
41
41
|
}
|
|
42
42
|
return e;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
function St(
|
|
45
|
+
function St(r) {
|
|
46
46
|
const t = new FormData();
|
|
47
|
-
return Object.entries(
|
|
47
|
+
return Object.entries(r).forEach(([e, n]) => t.append(e, n)), t;
|
|
48
48
|
}
|
|
49
|
-
function G(
|
|
50
|
-
if (
|
|
49
|
+
function G(r, t, e = !1) {
|
|
50
|
+
if (r == null)
|
|
51
51
|
return e;
|
|
52
52
|
if (Array.isArray(t))
|
|
53
|
-
return t.findIndex((o, s) => !G(
|
|
54
|
-
const
|
|
55
|
-
return
|
|
53
|
+
return t.findIndex((o, s) => !G(r[s], t[s], e)) == -1;
|
|
54
|
+
const n = typeof t;
|
|
55
|
+
return n != typeof r ? !1 : n == "object" ? Object.keys(t).find((o) => !G(r[o], t[o], e)) == null : n == "function" ? r.toString() == t.toString() : r == t;
|
|
56
56
|
}
|
|
57
|
-
function b(
|
|
58
|
-
const e = typeof
|
|
59
|
-
return e != "object" ||
|
|
57
|
+
function b(r, t) {
|
|
58
|
+
const e = typeof r, n = typeof t;
|
|
59
|
+
return e != "object" || r == null || n != "object" || t == null ? e == "function" && n == "function" ? r.toString() == t.toString() : r === t : Object.keys(r).length != Object.keys(t).length ? !1 : Object.keys(r).every((s) => b(r[s], t[s]));
|
|
60
60
|
}
|
|
61
|
-
function At(
|
|
61
|
+
function At(r, t) {
|
|
62
62
|
t.forEach((e) => {
|
|
63
|
-
Object.getOwnPropertyNames(e.prototype).forEach((
|
|
63
|
+
Object.getOwnPropertyNames(e.prototype).forEach((n) => {
|
|
64
64
|
Object.defineProperty(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
Object.getOwnPropertyDescriptor(e.prototype,
|
|
65
|
+
r.prototype,
|
|
66
|
+
n,
|
|
67
|
+
Object.getOwnPropertyDescriptor(e.prototype, n) || /* @__PURE__ */ Object.create(null)
|
|
68
68
|
);
|
|
69
69
|
});
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
function U(
|
|
72
|
+
function U(r) {
|
|
73
73
|
try {
|
|
74
|
-
return JSON.parse(
|
|
74
|
+
return JSON.parse(r);
|
|
75
75
|
} catch {
|
|
76
|
-
return
|
|
76
|
+
return r;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
function bt(
|
|
79
|
+
function bt(r, t) {
|
|
80
80
|
let e = [];
|
|
81
|
-
return JSON.stringify(
|
|
81
|
+
return JSON.stringify(r, (n, o) => {
|
|
82
82
|
if (typeof o == "object" && o !== null) {
|
|
83
83
|
if (e.includes(o))
|
|
84
84
|
return;
|
|
@@ -87,40 +87,40 @@ function bt(n, t) {
|
|
|
87
87
|
return o;
|
|
88
88
|
}, t);
|
|
89
89
|
}
|
|
90
|
-
function Rt(
|
|
91
|
-
return
|
|
90
|
+
function Rt(r, t) {
|
|
91
|
+
return r.indexOf(t) === -1 && r.push(t), r;
|
|
92
92
|
}
|
|
93
|
-
function Ot(
|
|
94
|
-
return
|
|
95
|
-
...
|
|
96
|
-
...t.filter((e) => !
|
|
93
|
+
function Ot(r, t) {
|
|
94
|
+
return ct([
|
|
95
|
+
...r.filter((e) => !t.includes((n) => b(e, n))),
|
|
96
|
+
...t.filter((e) => !r.includes((n) => b(e, n)))
|
|
97
97
|
]);
|
|
98
98
|
}
|
|
99
|
-
function $t(
|
|
99
|
+
function $t(r) {
|
|
100
100
|
return function(t, e) {
|
|
101
|
-
const
|
|
102
|
-
return typeof
|
|
101
|
+
const n = x(t, r), o = x(e, r);
|
|
102
|
+
return typeof n != "string" || typeof o != "string" ? 1 : n.toLowerCase().localeCompare(o.toLowerCase());
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
-
function Lt(
|
|
106
|
-
return (e) => b(x(e,
|
|
105
|
+
function Lt(r, t) {
|
|
106
|
+
return (e) => b(x(e, r), t);
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
return
|
|
108
|
+
function it(r, t = []) {
|
|
109
|
+
return r.forEach((e) => Array.isArray(e) ? it(e, t) : t.push(e)), t;
|
|
110
110
|
}
|
|
111
|
-
function Ct(
|
|
112
|
-
return function(e,
|
|
113
|
-
const o = x(e,
|
|
111
|
+
function Ct(r, t = !1) {
|
|
112
|
+
return function(e, n) {
|
|
113
|
+
const o = x(e, r), s = x(n, r);
|
|
114
114
|
return typeof o == "number" && typeof s == "number" ? (t ? -1 : 1) * (o - s) : o > s ? t ? -1 : 1 : o < s ? t ? 1 : -1 : 0;
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
for (let t =
|
|
119
|
-
|
|
120
|
-
return
|
|
117
|
+
function ct(r) {
|
|
118
|
+
for (let t = r.length - 1; t >= 0; t--)
|
|
119
|
+
r.slice(0, t).find((e) => b(e, r[t])) && r.splice(t, 1);
|
|
120
|
+
return r;
|
|
121
121
|
}
|
|
122
|
-
function ut(
|
|
123
|
-
return Array.isArray(
|
|
122
|
+
function ut(r) {
|
|
123
|
+
return Array.isArray(r) ? r : [r];
|
|
124
124
|
}
|
|
125
125
|
class A extends Array {
|
|
126
126
|
/** Number of elements in set */
|
|
@@ -214,47 +214,135 @@ class A extends Array {
|
|
|
214
214
|
return new A([...this, ...t]);
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
217
|
+
class Nt {
|
|
218
|
+
/**
|
|
219
|
+
* Create new cache
|
|
220
|
+
*
|
|
221
|
+
* @param {keyof T} key Default property to use as primary key
|
|
222
|
+
* @param {number} ttl Default expiry in milliseconds
|
|
223
|
+
*/
|
|
224
|
+
constructor(t, e) {
|
|
225
|
+
c(this, "store", {});
|
|
226
|
+
/** Whether cache is complete */
|
|
227
|
+
c(this, "complete", !1);
|
|
228
|
+
/**
|
|
229
|
+
* Get all cached items
|
|
230
|
+
*
|
|
231
|
+
* @return {T[]} Array of items
|
|
232
|
+
*/
|
|
233
|
+
c(this, "values", this.all());
|
|
234
|
+
this.key = t, this.ttl = e;
|
|
235
|
+
}
|
|
236
|
+
getKey(t) {
|
|
237
|
+
return t[this.key];
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Get all cached items
|
|
241
|
+
*
|
|
242
|
+
* @return {T[]} Array of items
|
|
243
|
+
*/
|
|
244
|
+
all() {
|
|
245
|
+
return Object.values(this.store);
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Add a new item to the cache. Like set, but finds key automatically
|
|
249
|
+
*
|
|
250
|
+
* @param {T} value Item to add to cache
|
|
251
|
+
* @param {number | undefined} ttl Override default expiry
|
|
252
|
+
* @return {this}
|
|
253
|
+
*/
|
|
254
|
+
add(t, e = this.ttl) {
|
|
255
|
+
const n = this.getKey(t);
|
|
256
|
+
return this.set(n, t, e), this;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Add several rows to the cache
|
|
260
|
+
*
|
|
261
|
+
* @param {T[]} rows Several items that will be cached using the default key
|
|
262
|
+
* @param complete Mark cache as complete & reliable, defaults to true
|
|
263
|
+
* @return {this}
|
|
264
|
+
*/
|
|
265
|
+
addAll(t, e = !0) {
|
|
266
|
+
return t.forEach((n) => this.add(n)), this.complete = e, this;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Delete an item from the cache
|
|
270
|
+
*
|
|
271
|
+
* @param {K} key Item's primary key
|
|
272
|
+
*/
|
|
273
|
+
delete(t) {
|
|
274
|
+
delete this.store[t];
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Return cache as an array of key-value pairs
|
|
278
|
+
* @return {[K, T][]} Key-value pairs array
|
|
279
|
+
*/
|
|
280
|
+
entries() {
|
|
281
|
+
return Object.entries(this.store);
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Get a list of cached keys
|
|
285
|
+
*
|
|
286
|
+
* @return {K[]} Array of keys
|
|
287
|
+
*/
|
|
288
|
+
keys() {
|
|
289
|
+
return Object.keys(this.store);
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Add an item to the cache manually specifying the key
|
|
293
|
+
*
|
|
294
|
+
* @param {K} key Key item will be cached under
|
|
295
|
+
* @param {T} value Item to cache
|
|
296
|
+
* @param {number | undefined} ttl Override default expiry
|
|
297
|
+
* @return {this}
|
|
298
|
+
*/
|
|
299
|
+
set(t, e, n = this.ttl) {
|
|
300
|
+
return this.store[t] = e, n && setTimeout(() => {
|
|
301
|
+
this.complete = !1, this.delete(t);
|
|
302
|
+
}, n), this;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
function Tt(r, t = !0) {
|
|
306
|
+
const e = r.reduce((n, o) => (Object.keys(t ? F(o) : o).forEach((s) => {
|
|
307
|
+
n.includes(s) || n.push(s);
|
|
308
|
+
}), n), []);
|
|
221
309
|
return [
|
|
222
310
|
e.join(","),
|
|
223
|
-
...
|
|
224
|
-
const s = x(
|
|
225
|
-
return
|
|
311
|
+
...r.map((n) => e.map((o) => {
|
|
312
|
+
const s = x(n, o), i = typeof s;
|
|
313
|
+
return i == "string" && s.includes(",") ? `"${s}"` : i == "object" ? `"${JSON.stringify(s)}"` : s;
|
|
226
314
|
}).join(","))
|
|
227
315
|
].join(`
|
|
228
316
|
`);
|
|
229
317
|
}
|
|
230
|
-
class
|
|
318
|
+
class E extends Promise {
|
|
231
319
|
constructor(e) {
|
|
232
|
-
super((
|
|
233
|
-
(s) =>
|
|
320
|
+
super((n, o) => e(
|
|
321
|
+
(s) => n(s),
|
|
234
322
|
(s) => o(s),
|
|
235
323
|
(s) => this.progress = s
|
|
236
324
|
));
|
|
237
|
-
|
|
238
|
-
|
|
325
|
+
c(this, "listeners", []);
|
|
326
|
+
c(this, "_progress", 0);
|
|
239
327
|
}
|
|
240
328
|
get progress() {
|
|
241
329
|
return this._progress;
|
|
242
330
|
}
|
|
243
331
|
set progress(e) {
|
|
244
|
-
e != this._progress && (this._progress = e, this.listeners.forEach((
|
|
332
|
+
e != this._progress && (this._progress = e, this.listeners.forEach((n) => n(e)));
|
|
245
333
|
}
|
|
246
334
|
static from(e) {
|
|
247
|
-
return e instanceof
|
|
335
|
+
return e instanceof E ? e : new E((n, o) => e.then((...s) => n(...s)).catch((...s) => o(...s)));
|
|
248
336
|
}
|
|
249
337
|
from(e) {
|
|
250
|
-
const
|
|
251
|
-
return this.onProgress((o) =>
|
|
338
|
+
const n = E.from(e);
|
|
339
|
+
return this.onProgress((o) => n.progress = o), n;
|
|
252
340
|
}
|
|
253
341
|
onProgress(e) {
|
|
254
342
|
return this.listeners.push(e), this;
|
|
255
343
|
}
|
|
256
|
-
then(e,
|
|
257
|
-
const o = super.then(e,
|
|
344
|
+
then(e, n) {
|
|
345
|
+
const o = super.then(e, n);
|
|
258
346
|
return this.from(o);
|
|
259
347
|
}
|
|
260
348
|
catch(e) {
|
|
@@ -264,81 +352,81 @@ class m extends Promise {
|
|
|
264
352
|
return this.from(super.finally(e));
|
|
265
353
|
}
|
|
266
354
|
}
|
|
267
|
-
function
|
|
268
|
-
|
|
269
|
-
const e = URL.createObjectURL(
|
|
355
|
+
function It(r, t) {
|
|
356
|
+
r instanceof Blob || (r = new Blob(ut(r)));
|
|
357
|
+
const e = URL.createObjectURL(r);
|
|
270
358
|
at(e, t), URL.revokeObjectURL(e);
|
|
271
359
|
}
|
|
272
|
-
function at(
|
|
360
|
+
function at(r, t) {
|
|
273
361
|
const e = document.createElement("a");
|
|
274
|
-
e.href =
|
|
362
|
+
e.href = r, e.download = t || r.split("/").pop(), document.body.appendChild(e), e.click(), document.body.removeChild(e);
|
|
275
363
|
}
|
|
276
|
-
function
|
|
364
|
+
function Mt(r = {}) {
|
|
277
365
|
return new Promise((t) => {
|
|
278
366
|
const e = document.createElement("input");
|
|
279
|
-
e.type = "file", e.accept =
|
|
367
|
+
e.type = "file", e.accept = r.accept || "*", e.style.display = "none", e.multiple = !!r.multiple, e.onblur = e.onchange = async () => {
|
|
280
368
|
t(Array.from(e.files)), e.remove();
|
|
281
369
|
}, document.body.appendChild(e), e.click();
|
|
282
370
|
});
|
|
283
371
|
}
|
|
284
|
-
function
|
|
372
|
+
function jt(r, t = /* @__PURE__ */ new Date()) {
|
|
285
373
|
(typeof t == "number" || typeof t == "string") && (t = new Date(t));
|
|
286
374
|
const e = `${t.getFullYear()}-${(t.getMonth() + 1).toString().padStart(2, "0")}-${t.getDate().toString().padStart(2, "0")}_${t.getHours().toString().padStart(2, "0")}-${t.getMinutes().toString().padStart(2, "0")}-${t.getSeconds().toString().padStart(2, "0")}`;
|
|
287
|
-
return
|
|
375
|
+
return r ? r.replace("{{TIMESTAMP}}", e) : e;
|
|
288
376
|
}
|
|
289
|
-
function Dt(
|
|
290
|
-
return new
|
|
377
|
+
function Dt(r) {
|
|
378
|
+
return new E((t, e, n) => {
|
|
291
379
|
const o = new XMLHttpRequest(), s = new FormData();
|
|
292
|
-
|
|
380
|
+
r.files.forEach((i) => s.append("file", i)), o.withCredentials = !!r.withCredentials, o.upload.addEventListener("progress", (i) => i.lengthComputable ? n(i.loaded / i.total) : null), o.addEventListener("loadend", () => t(U(o.responseText))), o.addEventListener("error", () => e(U(o.responseText))), o.addEventListener("timeout", () => e({ error: "Request timed out" })), o.open("POST", r.url), Object.entries(r.headers || {}).forEach(([i, y]) => o.setRequestHeader(i, y)), o.send(s);
|
|
293
381
|
});
|
|
294
382
|
}
|
|
295
383
|
class v {
|
|
296
384
|
constructor() {
|
|
297
|
-
|
|
385
|
+
c(this, "listeners", {});
|
|
298
386
|
}
|
|
299
387
|
static emit(t, ...e) {
|
|
300
|
-
(this.listeners["*"] || []).forEach((
|
|
388
|
+
(this.listeners["*"] || []).forEach((n) => n(t, ...e)), (this.listeners[t.toString()] || []).forEach((n) => n(...e));
|
|
301
389
|
}
|
|
302
390
|
static off(t, e) {
|
|
303
|
-
const
|
|
304
|
-
this.listeners[
|
|
391
|
+
const n = t.toString();
|
|
392
|
+
this.listeners[n] = (this.listeners[n] || []).filter((o) => o === e);
|
|
305
393
|
}
|
|
306
394
|
static on(t, e) {
|
|
307
395
|
var o;
|
|
308
|
-
const
|
|
309
|
-
return this.listeners[
|
|
396
|
+
const n = t.toString();
|
|
397
|
+
return this.listeners[n] || (this.listeners[n] = []), (o = this.listeners[n]) == null || o.push(e), () => this.off(t, e);
|
|
310
398
|
}
|
|
311
399
|
static once(t, e) {
|
|
312
|
-
return new Promise((
|
|
400
|
+
return new Promise((n) => {
|
|
313
401
|
const o = this.on(t, (...s) => {
|
|
314
|
-
|
|
402
|
+
n(s.length == 1 ? s[0] : s), e && e(...s), o();
|
|
315
403
|
});
|
|
316
404
|
});
|
|
317
405
|
}
|
|
318
406
|
emit(t, ...e) {
|
|
319
|
-
(this.listeners["*"] || []).forEach((
|
|
407
|
+
(this.listeners["*"] || []).forEach((n) => n(t, ...e)), (this.listeners[t] || []).forEach((n) => n(...e));
|
|
320
408
|
}
|
|
321
409
|
off(t, e) {
|
|
322
|
-
this.listeners[t] = (this.listeners[t] || []).filter((
|
|
410
|
+
this.listeners[t] = (this.listeners[t] || []).filter((n) => n === e);
|
|
323
411
|
}
|
|
324
412
|
on(t, e) {
|
|
325
|
-
var
|
|
326
|
-
return this.listeners[t] || (this.listeners[t] = []), (
|
|
413
|
+
var n;
|
|
414
|
+
return this.listeners[t] || (this.listeners[t] = []), (n = this.listeners[t]) == null || n.push(e), () => this.off(t, e);
|
|
327
415
|
}
|
|
328
416
|
once(t, e) {
|
|
329
|
-
return new Promise((
|
|
417
|
+
return new Promise((n) => {
|
|
330
418
|
const o = this.on(t, (...s) => {
|
|
331
|
-
|
|
419
|
+
n(s.length == 1 ? s[0] : s), e && e(...s), o();
|
|
332
420
|
});
|
|
333
421
|
});
|
|
334
422
|
}
|
|
335
423
|
}
|
|
336
|
-
|
|
424
|
+
c(v, "listeners", {});
|
|
337
425
|
class p extends Error {
|
|
338
|
-
constructor(e,
|
|
426
|
+
constructor(e, n) {
|
|
339
427
|
super(e);
|
|
340
|
-
|
|
341
|
-
|
|
428
|
+
c(this, "_code");
|
|
429
|
+
n != null && (this._code = n);
|
|
342
430
|
}
|
|
343
431
|
get code() {
|
|
344
432
|
return this._code || this.constructor.code;
|
|
@@ -347,11 +435,11 @@ class p extends Error {
|
|
|
347
435
|
this._code = e;
|
|
348
436
|
}
|
|
349
437
|
static from(e) {
|
|
350
|
-
const
|
|
438
|
+
const n = Number(e.statusCode) ?? Number(e.code), o = new this(e.message || e.toString());
|
|
351
439
|
return Object.assign(o, {
|
|
352
440
|
stack: e.stack,
|
|
353
441
|
...e,
|
|
354
|
-
code:
|
|
442
|
+
code: n ?? void 0
|
|
355
443
|
});
|
|
356
444
|
}
|
|
357
445
|
static instanceof(e) {
|
|
@@ -361,7 +449,7 @@ class p extends Error {
|
|
|
361
449
|
return this.message || super.toString();
|
|
362
450
|
}
|
|
363
451
|
}
|
|
364
|
-
|
|
452
|
+
c(p, "code", 500);
|
|
365
453
|
class Y extends p {
|
|
366
454
|
constructor(t = "Bad Request") {
|
|
367
455
|
super(t);
|
|
@@ -370,7 +458,7 @@ class Y extends p {
|
|
|
370
458
|
return t.constructor.code == this.code;
|
|
371
459
|
}
|
|
372
460
|
}
|
|
373
|
-
|
|
461
|
+
c(Y, "code", 400);
|
|
374
462
|
class H extends p {
|
|
375
463
|
constructor(t = "Unauthorized") {
|
|
376
464
|
super(t);
|
|
@@ -379,7 +467,7 @@ class H extends p {
|
|
|
379
467
|
return t.constructor.code == this.code;
|
|
380
468
|
}
|
|
381
469
|
}
|
|
382
|
-
|
|
470
|
+
c(H, "code", 401);
|
|
383
471
|
class W extends p {
|
|
384
472
|
constructor(t = "Payment Required") {
|
|
385
473
|
super(t);
|
|
@@ -388,7 +476,7 @@ class W extends p {
|
|
|
388
476
|
return t.constructor.code == this.code;
|
|
389
477
|
}
|
|
390
478
|
}
|
|
391
|
-
|
|
479
|
+
c(W, "code", 402);
|
|
392
480
|
class z extends p {
|
|
393
481
|
constructor(t = "Forbidden") {
|
|
394
482
|
super(t);
|
|
@@ -397,8 +485,8 @@ class z extends p {
|
|
|
397
485
|
return t.constructor.code == this.code;
|
|
398
486
|
}
|
|
399
487
|
}
|
|
400
|
-
|
|
401
|
-
class
|
|
488
|
+
c(z, "code", 403);
|
|
489
|
+
class K extends p {
|
|
402
490
|
constructor(t = "Not Found") {
|
|
403
491
|
super(t);
|
|
404
492
|
}
|
|
@@ -406,8 +494,8 @@ class J extends p {
|
|
|
406
494
|
return t.constructor.code == this.code;
|
|
407
495
|
}
|
|
408
496
|
}
|
|
409
|
-
|
|
410
|
-
class
|
|
497
|
+
c(K, "code", 404);
|
|
498
|
+
class J extends p {
|
|
411
499
|
constructor(t = "Method Not Allowed") {
|
|
412
500
|
super(t);
|
|
413
501
|
}
|
|
@@ -415,7 +503,7 @@ class K extends p {
|
|
|
415
503
|
return t.constructor.code == this.code;
|
|
416
504
|
}
|
|
417
505
|
}
|
|
418
|
-
|
|
506
|
+
c(J, "code", 405);
|
|
419
507
|
class Z extends p {
|
|
420
508
|
constructor(t = "Not Acceptable") {
|
|
421
509
|
super(t);
|
|
@@ -424,7 +512,7 @@ class Z extends p {
|
|
|
424
512
|
return t.constructor.code == this.code;
|
|
425
513
|
}
|
|
426
514
|
}
|
|
427
|
-
|
|
515
|
+
c(Z, "code", 406);
|
|
428
516
|
class V extends p {
|
|
429
517
|
constructor(t = "Internal Server Error") {
|
|
430
518
|
super(t);
|
|
@@ -433,7 +521,7 @@ class V extends p {
|
|
|
433
521
|
return t.constructor.code == this.code;
|
|
434
522
|
}
|
|
435
523
|
}
|
|
436
|
-
|
|
524
|
+
c(V, "code", 500);
|
|
437
525
|
class X extends p {
|
|
438
526
|
constructor(t = "Not Implemented") {
|
|
439
527
|
super(t);
|
|
@@ -442,7 +530,7 @@ class X extends p {
|
|
|
442
530
|
return t.constructor.code == this.code;
|
|
443
531
|
}
|
|
444
532
|
}
|
|
445
|
-
|
|
533
|
+
c(X, "code", 501);
|
|
446
534
|
class Q extends p {
|
|
447
535
|
constructor(t = "Bad Gateway") {
|
|
448
536
|
super(t);
|
|
@@ -451,7 +539,7 @@ class Q extends p {
|
|
|
451
539
|
return t.constructor.code == this.code;
|
|
452
540
|
}
|
|
453
541
|
}
|
|
454
|
-
|
|
542
|
+
c(Q, "code", 502);
|
|
455
543
|
class _ extends p {
|
|
456
544
|
constructor(t = "Service Unavailable") {
|
|
457
545
|
super(t);
|
|
@@ -460,7 +548,7 @@ class _ extends p {
|
|
|
460
548
|
return t.constructor.code == this.code;
|
|
461
549
|
}
|
|
462
550
|
}
|
|
463
|
-
|
|
551
|
+
c(_, "code", 503);
|
|
464
552
|
class tt extends p {
|
|
465
553
|
constructor(t = "Gateway Timeout") {
|
|
466
554
|
super(t);
|
|
@@ -469,11 +557,11 @@ class tt extends p {
|
|
|
469
557
|
return t.constructor.code == this.code;
|
|
470
558
|
}
|
|
471
559
|
}
|
|
472
|
-
|
|
473
|
-
function
|
|
474
|
-
if (
|
|
560
|
+
c(tt, "code", 504);
|
|
561
|
+
function kt(r, t) {
|
|
562
|
+
if (r >= 200 && r < 300)
|
|
475
563
|
return null;
|
|
476
|
-
switch (
|
|
564
|
+
switch (r) {
|
|
477
565
|
case 400:
|
|
478
566
|
return new Y(t);
|
|
479
567
|
case 401:
|
|
@@ -483,9 +571,9 @@ function jt(n, t) {
|
|
|
483
571
|
case 403:
|
|
484
572
|
return new z(t);
|
|
485
573
|
case 404:
|
|
486
|
-
return new J(t);
|
|
487
|
-
case 405:
|
|
488
574
|
return new K(t);
|
|
575
|
+
case 405:
|
|
576
|
+
return new J(t);
|
|
489
577
|
case 406:
|
|
490
578
|
return new Z(t);
|
|
491
579
|
case 500:
|
|
@@ -499,14 +587,14 @@ function jt(n, t) {
|
|
|
499
587
|
case 504:
|
|
500
588
|
return new tt(t);
|
|
501
589
|
default:
|
|
502
|
-
return new p(t,
|
|
590
|
+
return new p(t, r);
|
|
503
591
|
}
|
|
504
592
|
}
|
|
505
593
|
const w = class w {
|
|
506
594
|
constructor(t = {}) {
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
595
|
+
c(this, "interceptors", {});
|
|
596
|
+
c(this, "headers", {});
|
|
597
|
+
c(this, "url");
|
|
510
598
|
this.url = t.url ?? null, this.headers = t.headers || {}, t.interceptors && t.interceptors.forEach((e) => w.addInterceptor(e));
|
|
511
599
|
}
|
|
512
600
|
static addInterceptor(t) {
|
|
@@ -526,34 +614,34 @@ const w = class w {
|
|
|
526
614
|
if (!this.url && !t.url)
|
|
527
615
|
throw new Error("URL needs to be set");
|
|
528
616
|
let e = ((o = t.url) != null && o.startsWith("http") ? t.url : (this.url || "") + (t.url || "")).replace(/([^:]\/)\/+/g, "$1");
|
|
529
|
-
if (t.fragment && (e.includes("#") ? e.replace(/#.*(\?|\n)/g, (s,
|
|
530
|
-
const s = Array.isArray(t.query) ? t.query : Object.keys(t.query).map((
|
|
531
|
-
e += (e.includes("?") ? "&" : "?") + s.map((
|
|
617
|
+
if (t.fragment && (e.includes("#") ? e.replace(/#.*(\?|\n)/g, (s, i) => `#${t.fragment}${i}`) : e += "#" + t.fragment), t.query) {
|
|
618
|
+
const s = Array.isArray(t.query) ? t.query : Object.keys(t.query).map((i) => ({ key: i, value: t.query[i] }));
|
|
619
|
+
e += (e.includes("?") ? "&" : "?") + s.map((i) => `${i.key}=${i.value}`).join("&");
|
|
532
620
|
}
|
|
533
|
-
const
|
|
621
|
+
const n = ot({
|
|
534
622
|
"Content-Type": t.body ? t.body instanceof FormData ? "multipart/form-data" : "application/json" : void 0,
|
|
535
623
|
...w.headers,
|
|
536
624
|
...this.headers,
|
|
537
625
|
...t.headers
|
|
538
626
|
});
|
|
539
|
-
return typeof t.body == "object" && t.body != null &&
|
|
627
|
+
return typeof t.body == "object" && t.body != null && n["Content-Type"] == "application/json" && (t.body = JSON.stringify(t.body)), new E((s, i, y) => {
|
|
540
628
|
fetch(e, {
|
|
541
|
-
headers:
|
|
629
|
+
headers: n,
|
|
542
630
|
method: t.method || (t.body ? "POST" : "GET"),
|
|
543
631
|
body: t.body
|
|
544
632
|
}).then(async (u) => {
|
|
545
|
-
var
|
|
633
|
+
var D, k;
|
|
546
634
|
for (let a of [...Object.values(w.interceptors), ...Object.values(this.interceptors)])
|
|
547
635
|
await new Promise((O) => a(u, () => O()));
|
|
548
636
|
const R = u.headers.get("Content-Length"), C = R ? parseInt(R, 10) : 0;
|
|
549
|
-
let
|
|
550
|
-
const N = (
|
|
637
|
+
let j = 0;
|
|
638
|
+
const N = (D = u.body) == null ? void 0 : D.getReader(), et = new ReadableStream({
|
|
551
639
|
start(a) {
|
|
552
640
|
function O() {
|
|
553
641
|
N == null || N.read().then((B) => {
|
|
554
642
|
if (B.done)
|
|
555
643
|
return a.close();
|
|
556
|
-
|
|
644
|
+
j += B.value.byteLength, y(j / C), a.enqueue(B.value), O();
|
|
557
645
|
}).catch((B) => a.error(B));
|
|
558
646
|
}
|
|
559
647
|
O();
|
|
@@ -563,12 +651,12 @@ const w = class w {
|
|
|
563
651
|
const a = (k = u.headers.get("Content-Type")) == null ? void 0 : k.toLowerCase();
|
|
564
652
|
a != null && a.includes("form") ? u.data = await u.data.formData() : a != null && a.includes("json") ? u.data = await u.data.json() : a != null && a.includes("text") ? u.data = await u.data.text() : a != null && a.includes("application") && (u.data = await u.data.blob());
|
|
565
653
|
}
|
|
566
|
-
u.ok ? s(u) :
|
|
654
|
+
u.ok ? s(u) : i(u);
|
|
567
655
|
});
|
|
568
656
|
});
|
|
569
657
|
}
|
|
570
658
|
};
|
|
571
|
-
|
|
659
|
+
c(w, "interceptors", {}), c(w, "headers", {});
|
|
572
660
|
let q = w;
|
|
573
661
|
const S = {
|
|
574
662
|
CLEAR: "\x1B[0m",
|
|
@@ -595,7 +683,7 @@ const S = {
|
|
|
595
683
|
LIGHT_MAGENTA: "\x1B[95m",
|
|
596
684
|
LIGHT_CYAN: "\x1B[96m",
|
|
597
685
|
WHITE: "\x1B[97m"
|
|
598
|
-
},
|
|
686
|
+
}, Gt = {
|
|
599
687
|
BLACK: "\x1B[40m",
|
|
600
688
|
RED: "\x1B[41m",
|
|
601
689
|
GREEN: "\x1B[42m",
|
|
@@ -606,16 +694,16 @@ const S = {
|
|
|
606
694
|
WHITE: "\x1B[47m",
|
|
607
695
|
GREY: "\x1B[100m"
|
|
608
696
|
};
|
|
609
|
-
var lt = /* @__PURE__ */ ((
|
|
697
|
+
var lt = /* @__PURE__ */ ((r) => (r[r.ERROR = 0] = "ERROR", r[r.WARN = 1] = "WARN", r[r.INFO = 2] = "INFO", r[r.LOG = 3] = "LOG", r[r.DEBUG = 4] = "DEBUG", r))(lt || {});
|
|
610
698
|
const g = class g extends v {
|
|
611
699
|
constructor(t) {
|
|
612
700
|
super(), this.namespace = t;
|
|
613
701
|
}
|
|
614
|
-
pad(t, e,
|
|
615
|
-
const s = t.toString(),
|
|
616
|
-
if (
|
|
702
|
+
pad(t, e, n, o = !1) {
|
|
703
|
+
const s = t.toString(), i = e - s.length;
|
|
704
|
+
if (i <= 0)
|
|
617
705
|
return s;
|
|
618
|
-
const y = Array(~~(
|
|
706
|
+
const y = Array(~~(i / n.length)).fill(n).join("");
|
|
619
707
|
return o ? s + y : y + s;
|
|
620
708
|
}
|
|
621
709
|
format(...t) {
|
|
@@ -653,163 +741,164 @@ const g = class g extends v {
|
|
|
653
741
|
g.emit(0, e), console.error($.RED + e + S.CLEAR);
|
|
654
742
|
}
|
|
655
743
|
};
|
|
656
|
-
|
|
744
|
+
c(g, "LOG_LEVEL", 4);
|
|
657
745
|
let P = g;
|
|
658
|
-
function
|
|
659
|
-
const t = (y, u) => u < 1e-7 ? y : t(u, ~~(y % u)), e =
|
|
660
|
-
let
|
|
661
|
-
const s = t(o,
|
|
662
|
-
o = ~~(o / s),
|
|
663
|
-
const
|
|
664
|
-
return o -=
|
|
665
|
-
}
|
|
666
|
-
function
|
|
667
|
-
let t =
|
|
746
|
+
function Ut(r) {
|
|
747
|
+
const t = (y, u) => u < 1e-7 ? y : t(u, ~~(y % u)), e = r.toString().length - 2;
|
|
748
|
+
let n = Math.pow(10, e), o = r * n;
|
|
749
|
+
const s = t(o, n);
|
|
750
|
+
o = ~~(o / s), n = ~~(n / s);
|
|
751
|
+
const i = ~~(o / n);
|
|
752
|
+
return o -= i * n, `${i ? i + " " : ""}${~~o}/${~~n}`;
|
|
753
|
+
}
|
|
754
|
+
function qt(r) {
|
|
755
|
+
let t = r.split(" ");
|
|
668
756
|
const e = t.length == 2 ? Number(t[0]) : 0;
|
|
669
757
|
return t = t.pop().split("/"), e + Number(t[0]) / Number(t[1]);
|
|
670
758
|
}
|
|
671
|
-
const T = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", I = "0123456789", M = "~`!@#$%^&*()_-+={[}]|\\:;\"'<,>.?/",
|
|
672
|
-
function
|
|
673
|
-
if (
|
|
759
|
+
const T = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", I = "0123456789", M = "~`!@#$%^&*()_-+={[}]|\\:;\"'<,>.?/", ht = T + I + M;
|
|
760
|
+
function Pt(r, t = 2) {
|
|
761
|
+
if (r === 0)
|
|
674
762
|
return "0 Bytes";
|
|
675
|
-
const e = 1024,
|
|
676
|
-
return parseFloat((
|
|
763
|
+
const e = 1024, n = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], o = Math.floor(Math.log(r) / Math.log(e));
|
|
764
|
+
return parseFloat((r / Math.pow(e, o)).toFixed(t)) + " " + n[o];
|
|
677
765
|
}
|
|
678
|
-
function
|
|
679
|
-
const t = /(\+?1)?.*?(\d{3}).*?(\d{3}).*?(\d{4})/g.exec(
|
|
766
|
+
function Ft(r) {
|
|
767
|
+
const t = /(\+?1)?.*?(\d{3}).*?(\d{3}).*?(\d{4})/g.exec(r);
|
|
680
768
|
if (!t)
|
|
681
|
-
throw new Error(`Number cannot be parsed: ${
|
|
769
|
+
throw new Error(`Number cannot be parsed: ${r}`);
|
|
682
770
|
return `${t[1] ?? ""} (${t[2]}) ${t[3]}-${t[4]}`.trim();
|
|
683
771
|
}
|
|
684
|
-
function
|
|
685
|
-
return `${
|
|
772
|
+
function vt(r, t, e) {
|
|
773
|
+
return `${r.slice(0, e)}${t}${r.slice(e + 1)}`;
|
|
686
774
|
}
|
|
687
|
-
function
|
|
688
|
-
return
|
|
775
|
+
function Yt(r, t, e = " ", n = !0) {
|
|
776
|
+
return n ? r.toString().padStart(t, e) : r.toString().padEnd(t, e);
|
|
689
777
|
}
|
|
690
|
-
function
|
|
691
|
-
return Array(
|
|
778
|
+
function Ht(r) {
|
|
779
|
+
return Array(r).fill(null).map(() => Math.round(Math.random() * 15).toString(16)).join("");
|
|
692
780
|
}
|
|
693
|
-
function
|
|
694
|
-
return Array(
|
|
781
|
+
function Wt(r, t = ht) {
|
|
782
|
+
return Array(r).fill(null).map(() => {
|
|
695
783
|
const e = ~~(Math.random() * t.length);
|
|
696
784
|
return t[e];
|
|
697
785
|
}).join("");
|
|
698
786
|
}
|
|
699
|
-
function
|
|
700
|
-
if (!t && !e && !
|
|
787
|
+
function zt(r, t = !1, e = !1, n = !1) {
|
|
788
|
+
if (!t && !e && !n)
|
|
701
789
|
throw new Error("Must enable at least one: letters, numbers, symbols");
|
|
702
|
-
return Array(
|
|
790
|
+
return Array(r).fill(null).map(() => {
|
|
703
791
|
let o;
|
|
704
792
|
do {
|
|
705
793
|
const s = ~~(Math.random() * 3);
|
|
706
|
-
t && s == 0 ? o = T[~~(Math.random() * T.length)] : e && s == 1 ? o = I[~~(Math.random() * I.length)] :
|
|
794
|
+
t && s == 0 ? o = T[~~(Math.random() * T.length)] : e && s == 1 ? o = I[~~(Math.random() * I.length)] : n && s == 2 && (o = M[~~(Math.random() * M.length)]);
|
|
707
795
|
} while (!o);
|
|
708
796
|
return o;
|
|
709
797
|
}).join("");
|
|
710
798
|
}
|
|
711
|
-
function
|
|
799
|
+
function Kt(r, t) {
|
|
712
800
|
if (typeof t == "string" && (t = new RegExp(t, "g")), !t.global)
|
|
713
801
|
throw new TypeError("Regular expression must be global.");
|
|
714
|
-
let e = [],
|
|
715
|
-
for (; (
|
|
716
|
-
e.push(
|
|
802
|
+
let e = [], n;
|
|
803
|
+
for (; (n = t.exec(r)) !== null; )
|
|
804
|
+
e.push(n);
|
|
717
805
|
return e;
|
|
718
806
|
}
|
|
719
|
-
function Jt(
|
|
807
|
+
function Jt(r) {
|
|
720
808
|
const t = new RegExp(
|
|
721
809
|
"(?:(?<protocol>[\\w\\d]+)\\:\\/\\/)?(?:(?<user>.+)\\@)?(?<host>(?<domain>[^:\\/\\?#@\\n]+)(?:\\:(?<port>\\d*))?)(?<path>\\/.*?)?(?:\\?(?<query>.*?))?(?:#(?<fragment>.*?))?$",
|
|
722
810
|
"gm"
|
|
723
|
-
).exec(
|
|
724
|
-
if (e.port != null && (e.port = Number(e.port)),
|
|
811
|
+
).exec(r), e = (t == null ? void 0 : t.groups) ?? {}, n = e.domain.split(".");
|
|
812
|
+
if (e.port != null && (e.port = Number(e.port)), n.length > 2 && (e.domain = n.splice(-2, 2).join("."), e.subdomain = n.join(".")), e.query) {
|
|
725
813
|
const o = e.query.split("&"), s = {};
|
|
726
|
-
o.forEach((
|
|
727
|
-
const [y, u] =
|
|
814
|
+
o.forEach((i) => {
|
|
815
|
+
const [y, u] = i.split("=");
|
|
728
816
|
s[y] = u;
|
|
729
817
|
}), e.query = s;
|
|
730
818
|
}
|
|
731
819
|
return e;
|
|
732
820
|
}
|
|
733
|
-
function
|
|
734
|
-
var t = dt(yt(gt(pt(
|
|
821
|
+
function ft(r) {
|
|
822
|
+
var t = dt(yt(gt(pt(r), 8 * r.length)));
|
|
735
823
|
return t.toLowerCase();
|
|
736
824
|
}
|
|
737
|
-
function dt(
|
|
738
|
-
for (var t, e = "0123456789ABCDEF",
|
|
739
|
-
t =
|
|
740
|
-
return
|
|
825
|
+
function dt(r) {
|
|
826
|
+
for (var t, e = "0123456789ABCDEF", n = "", o = 0; o < r.length; o++)
|
|
827
|
+
t = r.charCodeAt(o), n += e.charAt(t >>> 4 & 15) + e.charAt(15 & t);
|
|
828
|
+
return n;
|
|
741
829
|
}
|
|
742
|
-
function pt(
|
|
743
|
-
for (var t = Array(
|
|
830
|
+
function pt(r) {
|
|
831
|
+
for (var t = Array(r.length >> 2), e = 0; e < t.length; e++)
|
|
744
832
|
t[e] = 0;
|
|
745
|
-
for (e = 0; e < 8 *
|
|
746
|
-
t[e >> 5] |= (255 &
|
|
833
|
+
for (e = 0; e < 8 * r.length; e += 8)
|
|
834
|
+
t[e >> 5] |= (255 & r.charCodeAt(e / 8)) << e % 32;
|
|
747
835
|
return t;
|
|
748
836
|
}
|
|
749
|
-
function yt(
|
|
750
|
-
for (var t = "", e = 0; e < 32 *
|
|
751
|
-
t += String.fromCharCode(
|
|
837
|
+
function yt(r) {
|
|
838
|
+
for (var t = "", e = 0; e < 32 * r.length; e += 8)
|
|
839
|
+
t += String.fromCharCode(r[e >> 5] >>> e % 32 & 255);
|
|
752
840
|
return t;
|
|
753
841
|
}
|
|
754
|
-
function gt(
|
|
755
|
-
|
|
756
|
-
for (var e = 1732584193,
|
|
757
|
-
var y = e, u =
|
|
758
|
-
|
|
842
|
+
function gt(r, t) {
|
|
843
|
+
r[t >> 5] |= 128 << t % 32, r[14 + (t + 64 >>> 9 << 4)] = t;
|
|
844
|
+
for (var e = 1732584193, n = -271733879, o = -1732584194, s = 271733878, i = 0; i < r.length; i += 16) {
|
|
845
|
+
var y = e, u = n, R = o, C = s;
|
|
846
|
+
n = d(n = d(n = d(n = d(n = f(n = f(n = f(n = f(n = h(n = h(n = h(n = h(n = l(n = l(n = l(n = l(n, o = l(o, s = l(s, e = l(e, n, o, s, r[i + 0], 7, -680876936), n, o, r[i + 1], 12, -389564586), e, n, r[i + 2], 17, 606105819), s, e, r[i + 3], 22, -1044525330), o = l(o, s = l(s, e = l(e, n, o, s, r[i + 4], 7, -176418897), n, o, r[i + 5], 12, 1200080426), e, n, r[i + 6], 17, -1473231341), s, e, r[i + 7], 22, -45705983), o = l(o, s = l(s, e = l(e, n, o, s, r[i + 8], 7, 1770035416), n, o, r[i + 9], 12, -1958414417), e, n, r[i + 10], 17, -42063), s, e, r[i + 11], 22, -1990404162), o = l(o, s = l(s, e = l(e, n, o, s, r[i + 12], 7, 1804603682), n, o, r[i + 13], 12, -40341101), e, n, r[i + 14], 17, -1502002290), s, e, r[i + 15], 22, 1236535329), o = h(o, s = h(s, e = h(e, n, o, s, r[i + 1], 5, -165796510), n, o, r[i + 6], 9, -1069501632), e, n, r[i + 11], 14, 643717713), s, e, r[i + 0], 20, -373897302), o = h(o, s = h(s, e = h(e, n, o, s, r[i + 5], 5, -701558691), n, o, r[i + 10], 9, 38016083), e, n, r[i + 15], 14, -660478335), s, e, r[i + 4], 20, -405537848), o = h(o, s = h(s, e = h(e, n, o, s, r[i + 9], 5, 568446438), n, o, r[i + 14], 9, -1019803690), e, n, r[i + 3], 14, -187363961), s, e, r[i + 8], 20, 1163531501), o = h(o, s = h(s, e = h(e, n, o, s, r[i + 13], 5, -1444681467), n, o, r[i + 2], 9, -51403784), e, n, r[i + 7], 14, 1735328473), s, e, r[i + 12], 20, -1926607734), o = f(o, s = f(s, e = f(e, n, o, s, r[i + 5], 4, -378558), n, o, r[i + 8], 11, -2022574463), e, n, r[i + 11], 16, 1839030562), s, e, r[i + 14], 23, -35309556), o = f(o, s = f(s, e = f(e, n, o, s, r[i + 1], 4, -1530992060), n, o, r[i + 4], 11, 1272893353), e, n, r[i + 7], 16, -155497632), s, e, r[i + 10], 23, -1094730640), o = f(o, s = f(s, e = f(e, n, o, s, r[i + 13], 4, 681279174), n, o, r[i + 0], 11, -358537222), e, n, r[i + 3], 16, -722521979), s, e, r[i + 6], 23, 76029189), o = f(o, s = f(s, e = f(e, n, o, s, r[i + 9], 4, -640364487), n, o, r[i + 12], 11, -421815835), e, n, r[i + 15], 16, 530742520), s, e, r[i + 2], 23, -995338651), o = d(o, s = d(s, e = d(e, n, o, s, r[i + 0], 6, -198630844), n, o, r[i + 7], 10, 1126891415), e, n, r[i + 14], 15, -1416354905), s, e, r[i + 5], 21, -57434055), o = d(o, s = d(s, e = d(e, n, o, s, r[i + 12], 6, 1700485571), n, o, r[i + 3], 10, -1894986606), e, n, r[i + 10], 15, -1051523), s, e, r[i + 1], 21, -2054922799), o = d(o, s = d(s, e = d(e, n, o, s, r[i + 8], 6, 1873313359), n, o, r[i + 15], 10, -30611744), e, n, r[i + 6], 15, -1560198380), s, e, r[i + 13], 21, 1309151649), o = d(o, s = d(s, e = d(e, n, o, s, r[i + 4], 6, -145523070), n, o, r[i + 11], 10, -1120210379), e, n, r[i + 2], 15, 718787259), s, e, r[i + 9], 21, -343485551), e = m(e, y), n = m(n, u), o = m(o, R), s = m(s, C);
|
|
759
847
|
}
|
|
760
|
-
return Array(e,
|
|
848
|
+
return Array(e, n, o, s);
|
|
761
849
|
}
|
|
762
|
-
function L(
|
|
763
|
-
return
|
|
850
|
+
function L(r, t, e, n, o, s) {
|
|
851
|
+
return m(wt(m(m(t, r), m(n, s)), o), e);
|
|
764
852
|
}
|
|
765
|
-
function l(
|
|
766
|
-
return L(t & e | ~t &
|
|
853
|
+
function l(r, t, e, n, o, s, i) {
|
|
854
|
+
return L(t & e | ~t & n, r, t, o, s, i);
|
|
767
855
|
}
|
|
768
|
-
function
|
|
769
|
-
return L(t &
|
|
856
|
+
function h(r, t, e, n, o, s, i) {
|
|
857
|
+
return L(t & n | e & ~n, r, t, o, s, i);
|
|
770
858
|
}
|
|
771
|
-
function
|
|
772
|
-
return L(t ^ e ^
|
|
859
|
+
function f(r, t, e, n, o, s, i) {
|
|
860
|
+
return L(t ^ e ^ n, r, t, o, s, i);
|
|
773
861
|
}
|
|
774
|
-
function d(
|
|
775
|
-
return L(e ^ (t | ~
|
|
862
|
+
function d(r, t, e, n, o, s, i) {
|
|
863
|
+
return L(e ^ (t | ~n), r, t, o, s, i);
|
|
776
864
|
}
|
|
777
|
-
function
|
|
778
|
-
var e = (65535 &
|
|
779
|
-
return (
|
|
865
|
+
function m(r, t) {
|
|
866
|
+
var e = (65535 & r) + (65535 & t);
|
|
867
|
+
return (r >> 16) + (t >> 16) + (e >> 16) << 16 | 65535 & e;
|
|
780
868
|
}
|
|
781
|
-
function wt(
|
|
782
|
-
return
|
|
869
|
+
function wt(r, t) {
|
|
870
|
+
return r << t | r >>> 32 - t;
|
|
783
871
|
}
|
|
784
|
-
function
|
|
785
|
-
return /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(
|
|
872
|
+
function Zt(r) {
|
|
873
|
+
return /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(r);
|
|
786
874
|
}
|
|
787
|
-
function
|
|
788
|
-
return
|
|
875
|
+
function Vt(r, t = "mp") {
|
|
876
|
+
return r ? `https://www.gravatar.com/avatar/${ft(r)}?d=${t}` : "";
|
|
789
877
|
}
|
|
790
|
-
function
|
|
791
|
-
(typeof
|
|
792
|
-
let t =
|
|
793
|
-
return t >= 12 ? (t > 12 && (t -= 12), e = "PM") : t == 0 && (t = 12), `${
|
|
878
|
+
function Xt(r) {
|
|
879
|
+
(typeof r == "number" || typeof r == "string") && (r = new Date(r));
|
|
880
|
+
let t = r.getHours(), e = "AM";
|
|
881
|
+
return t >= 12 ? (t > 12 && (t -= 12), e = "PM") : t == 0 && (t = 12), `${r.getFullYear()}-${(r.getMonth() + 1).toString().padStart(2, "0")}-${r.getDate().toString().padStart(2, "0")}, ${t}:${r.getMinutes().toString().padStart(2, "0")} ${e}`;
|
|
794
882
|
}
|
|
795
|
-
function
|
|
796
|
-
return new Promise((t) => setTimeout(t,
|
|
883
|
+
function mt(r) {
|
|
884
|
+
return new Promise((t) => setTimeout(t, r));
|
|
797
885
|
}
|
|
798
|
-
async function
|
|
799
|
-
for (; await
|
|
800
|
-
await
|
|
886
|
+
async function Qt(r, t = 100) {
|
|
887
|
+
for (; await r(); )
|
|
888
|
+
await mt(t);
|
|
801
889
|
}
|
|
802
|
-
function
|
|
803
|
-
return (
|
|
890
|
+
function _t(r) {
|
|
891
|
+
return (r instanceof Date ? r.getTime() : r) - (/* @__PURE__ */ new Date()).getTime();
|
|
804
892
|
}
|
|
805
|
-
function
|
|
893
|
+
function te() {
|
|
806
894
|
return Object.keys({});
|
|
807
895
|
}
|
|
808
896
|
export {
|
|
809
897
|
A as ASet,
|
|
810
898
|
Q as BadGatewayError,
|
|
811
899
|
Y as BadRequestError,
|
|
812
|
-
|
|
900
|
+
Nt as Cache,
|
|
901
|
+
Gt as CliBackground,
|
|
813
902
|
S as CliEffects,
|
|
814
903
|
$ as CliForeground,
|
|
815
904
|
p as CustomError,
|
|
@@ -821,12 +910,12 @@ export {
|
|
|
821
910
|
bt as JSONSanitize,
|
|
822
911
|
lt as LOG_LEVEL,
|
|
823
912
|
P as Logger,
|
|
824
|
-
|
|
913
|
+
J as MethodNotAllowedError,
|
|
825
914
|
Z as NotAcceptableError,
|
|
826
|
-
|
|
915
|
+
K as NotFoundError,
|
|
827
916
|
X as NotImplementedError,
|
|
828
917
|
W as PaymentRequiredError,
|
|
829
|
-
|
|
918
|
+
E as PromiseProgress,
|
|
830
919
|
_ as ServiceUnavailableError,
|
|
831
920
|
v as TypedEmitter,
|
|
832
921
|
H as UnauthorizedError,
|
|
@@ -834,45 +923,45 @@ export {
|
|
|
834
923
|
Ot as arrayDiff,
|
|
835
924
|
$t as caseInsensitiveSort,
|
|
836
925
|
ot as clean,
|
|
837
|
-
|
|
838
|
-
|
|
926
|
+
Tt as csv,
|
|
927
|
+
Ut as dec2Frac,
|
|
839
928
|
xt as deepCopy,
|
|
840
929
|
st as deepMerge,
|
|
841
930
|
x as dotNotation,
|
|
842
|
-
|
|
931
|
+
It as downloadFile,
|
|
843
932
|
at as downloadUrl,
|
|
844
933
|
Bt as encodeQuery,
|
|
845
|
-
|
|
846
|
-
|
|
934
|
+
kt as errorFromCode,
|
|
935
|
+
Mt as fileBrowser,
|
|
847
936
|
Lt as findByProp,
|
|
848
|
-
|
|
937
|
+
it as flattenArr,
|
|
849
938
|
F as flattenObj,
|
|
850
939
|
St as formData,
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
940
|
+
Pt as formatBytes,
|
|
941
|
+
Xt as formatDate,
|
|
942
|
+
Ft as formatPhoneNumber,
|
|
943
|
+
qt as fracToDec,
|
|
944
|
+
Vt as gravatar,
|
|
856
945
|
G as includes,
|
|
857
|
-
|
|
946
|
+
vt as insertAt,
|
|
858
947
|
b as isEqual,
|
|
859
948
|
ut as makeArray,
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
949
|
+
ct as makeUnique,
|
|
950
|
+
Kt as matchAll,
|
|
951
|
+
ft as md5,
|
|
863
952
|
At as mixin,
|
|
864
|
-
|
|
953
|
+
Yt as pad,
|
|
865
954
|
Jt as parseUrl,
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
955
|
+
Ht as randomHex,
|
|
956
|
+
Wt as randomString,
|
|
957
|
+
zt as randomStringBuilder,
|
|
958
|
+
mt as sleep,
|
|
959
|
+
Qt as sleepUntil,
|
|
871
960
|
Ct as sortByProp,
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
961
|
+
_t as timeUntil,
|
|
962
|
+
jt as timestampFilename,
|
|
963
|
+
te as tyoeKeys,
|
|
875
964
|
Dt as uploadWithProgress,
|
|
876
|
-
|
|
965
|
+
Zt as validateEmail
|
|
877
966
|
};
|
|
878
967
|
//# sourceMappingURL=index.mjs.map
|