@ztimson/utils 0.20.7 → 0.20.8
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/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +357 -354
- package/dist/index.mjs.map +1 -1
- package/dist/path-events.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var c = (
|
|
4
|
-
function
|
|
5
|
-
if (
|
|
6
|
-
return Array.isArray(
|
|
7
|
-
(t &&
|
|
8
|
-
}),
|
|
9
|
-
}
|
|
10
|
-
function
|
|
11
|
-
return structuredClone(
|
|
12
|
-
}
|
|
13
|
-
function
|
|
1
|
+
var it = Object.defineProperty;
|
|
2
|
+
var ot = (n, t, e) => t in n ? it(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var c = (n, t, e) => ot(n, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
function ct(n, t = !1) {
|
|
5
|
+
if (n == null) throw new Error("Cannot clean a NULL value");
|
|
6
|
+
return Array.isArray(n) ? n = n.filter((e) => e != null) : Object.entries(n).forEach(([e, r]) => {
|
|
7
|
+
(t && r === void 0 || !t && r == null) && delete n[e];
|
|
8
|
+
}), n;
|
|
9
|
+
}
|
|
10
|
+
function Bt(n) {
|
|
11
|
+
return structuredClone(n);
|
|
12
|
+
}
|
|
13
|
+
function ut(n, ...t) {
|
|
14
14
|
return t.forEach((e) => {
|
|
15
|
-
for (const
|
|
16
|
-
e[
|
|
17
|
-
}),
|
|
18
|
-
}
|
|
19
|
-
function B(
|
|
20
|
-
if (!(
|
|
21
|
-
return t.split(/[.[\]]/g).filter((
|
|
22
|
-
if ((s[0] == '"' || s[0] == "'") && (s = s.slice(1, -1)), !(
|
|
15
|
+
for (const r in e)
|
|
16
|
+
e[r] && typeof e[r] == "object" && !Array.isArray(e[r]) ? (n[r] || (n[r] = {}), ut(n[r], e[r])) : n[r] = e[r];
|
|
17
|
+
}), n;
|
|
18
|
+
}
|
|
19
|
+
function B(n, t, e) {
|
|
20
|
+
if (!(n == null || !t))
|
|
21
|
+
return t.split(/[.[\]]/g).filter((r) => r.length).reduce((r, s, i, o) => {
|
|
22
|
+
if ((s[0] == '"' || s[0] == "'") && (s = s.slice(1, -1)), !(r != null && r.hasOwnProperty(s))) {
|
|
23
23
|
if (e == null) return;
|
|
24
|
-
|
|
24
|
+
r[s] = {};
|
|
25
25
|
}
|
|
26
|
-
return e !== void 0 && i == o.length - 1 ?
|
|
27
|
-
},
|
|
26
|
+
return e !== void 0 && i == o.length - 1 ? r[s] = e : r[s];
|
|
27
|
+
}, n);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return Object.entries(
|
|
29
|
+
function At(n) {
|
|
30
|
+
return Object.entries(n).map(
|
|
31
31
|
([t, e]) => encodeURIComponent(t) + "=" + encodeURIComponent(e)
|
|
32
32
|
).join("&");
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
if (typeof
|
|
36
|
-
for (const
|
|
37
|
-
const s = t ? t + "." +
|
|
38
|
-
typeof r
|
|
34
|
+
function K(n, t, e = {}) {
|
|
35
|
+
if (typeof n == "object" && !Array.isArray(n)) {
|
|
36
|
+
for (const r of Object.keys(n)) {
|
|
37
|
+
const s = t ? t + "." + r : r;
|
|
38
|
+
typeof n[r] == "object" ? K(n[r], s, e) : e[s] = n[r];
|
|
39
39
|
}
|
|
40
40
|
return e;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function Rt(n) {
|
|
44
44
|
const t = new FormData();
|
|
45
|
-
return Object.entries(
|
|
45
|
+
return Object.entries(n).forEach(([e, r]) => t.append(e, r)), t;
|
|
46
46
|
}
|
|
47
|
-
function q(
|
|
48
|
-
if (
|
|
49
|
-
if (Array.isArray(t)) return t.findIndex((s, i) => !q(
|
|
50
|
-
const
|
|
51
|
-
return
|
|
47
|
+
function q(n, t, e = !1) {
|
|
48
|
+
if (n == null) return e;
|
|
49
|
+
if (Array.isArray(t)) return t.findIndex((s, i) => !q(n[i], t[i], e)) == -1;
|
|
50
|
+
const r = typeof t;
|
|
51
|
+
return r != typeof n ? !1 : r == "object" ? Object.keys(t).find((s) => !q(n[s], t[s], e)) == null : r == "function" ? n.toString() == t.toString() : n == t;
|
|
52
52
|
}
|
|
53
|
-
function O(
|
|
54
|
-
const e = typeof
|
|
55
|
-
return e != "object" ||
|
|
53
|
+
function O(n, t) {
|
|
54
|
+
const e = typeof n, r = typeof t;
|
|
55
|
+
return e != "object" || n == null || r != "object" || t == null ? e == "function" && r == "function" ? n.toString() == t.toString() : n === t : Object.keys(n).length != Object.keys(t).length ? !1 : Object.keys(n).every((i) => O(n[i], t[i]));
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function Ot(n, t) {
|
|
58
58
|
t.forEach((e) => {
|
|
59
|
-
Object.getOwnPropertyNames(e.prototype).forEach((
|
|
59
|
+
Object.getOwnPropertyNames(e.prototype).forEach((r) => {
|
|
60
60
|
Object.defineProperty(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
Object.getOwnPropertyDescriptor(e.prototype,
|
|
61
|
+
n.prototype,
|
|
62
|
+
r,
|
|
63
|
+
Object.getOwnPropertyDescriptor(e.prototype, r) || /* @__PURE__ */ Object.create(null)
|
|
64
64
|
);
|
|
65
65
|
});
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
function I(
|
|
68
|
+
function I(n) {
|
|
69
69
|
try {
|
|
70
|
-
return JSON.parse(
|
|
70
|
+
return JSON.parse(n);
|
|
71
71
|
} catch {
|
|
72
|
-
return
|
|
72
|
+
return n;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function $t(n, t) {
|
|
76
76
|
let e = [];
|
|
77
|
-
return JSON.stringify(
|
|
77
|
+
return JSON.stringify(n, (r, s) => {
|
|
78
78
|
if (typeof s == "object" && s !== null) {
|
|
79
79
|
if (e.includes(s)) return;
|
|
80
80
|
e.push(s);
|
|
@@ -82,40 +82,40 @@ function Ot(r, t) {
|
|
|
82
82
|
return s;
|
|
83
83
|
}, t);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
return
|
|
85
|
+
function Ct(n, t) {
|
|
86
|
+
return n.indexOf(t) === -1 && n.push(t), n;
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
return
|
|
90
|
-
...
|
|
91
|
-
...t.filter((e) => !
|
|
88
|
+
function Lt(n, t) {
|
|
89
|
+
return lt([
|
|
90
|
+
...n.filter((e) => !t.includes((r) => O(e, r))),
|
|
91
|
+
...t.filter((e) => !n.includes((r) => O(e, r)))
|
|
92
92
|
]);
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function Nt(n) {
|
|
95
95
|
return function(t, e) {
|
|
96
|
-
const
|
|
97
|
-
return typeof
|
|
96
|
+
const r = B(t, n), s = B(e, n);
|
|
97
|
+
return typeof r != "string" || typeof s != "string" ? 1 : r.toLowerCase().localeCompare(s.toLowerCase());
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
return (e) => O(B(e,
|
|
100
|
+
function jt(n, t) {
|
|
101
|
+
return (e) => O(B(e, n), t);
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
return
|
|
103
|
+
function at(n, t = []) {
|
|
104
|
+
return n.forEach((e) => Array.isArray(e) ? at(e, t) : t.push(e)), t;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
return function(e,
|
|
108
|
-
const s = B(e,
|
|
106
|
+
function Tt(n, t = !1) {
|
|
107
|
+
return function(e, r) {
|
|
108
|
+
const s = B(e, n), i = B(r, n);
|
|
109
109
|
return typeof s == "number" && typeof i == "number" ? (t ? -1 : 1) * (s - i) : s > i ? t ? -1 : 1 : s < i ? t ? 1 : -1 : 0;
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
for (let t =
|
|
114
|
-
|
|
115
|
-
return
|
|
112
|
+
function lt(n) {
|
|
113
|
+
for (let t = n.length - 1; t >= 0; t--)
|
|
114
|
+
n.slice(0, t).find((e) => O(e, n[t])) && n.splice(t, 1);
|
|
115
|
+
return n;
|
|
116
116
|
}
|
|
117
|
-
function m(
|
|
118
|
-
return Array.isArray(
|
|
117
|
+
function m(n) {
|
|
118
|
+
return Array.isArray(n) ? n : [n];
|
|
119
119
|
}
|
|
120
120
|
class S extends Array {
|
|
121
121
|
/** Number of elements in set */
|
|
@@ -142,8 +142,8 @@ class S extends Array {
|
|
|
142
142
|
*/
|
|
143
143
|
delete(...t) {
|
|
144
144
|
t.forEach((e) => {
|
|
145
|
-
const
|
|
146
|
-
|
|
145
|
+
const r = this.indexOf(e);
|
|
146
|
+
r != -1 && this.slice(r, 1);
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
149
|
/**
|
|
@@ -211,7 +211,7 @@ class S extends Array {
|
|
|
211
211
|
return new S([...this, ...t]);
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
class
|
|
214
|
+
class It {
|
|
215
215
|
/**
|
|
216
216
|
* Create new cache
|
|
217
217
|
*
|
|
@@ -229,16 +229,16 @@ class Tt {
|
|
|
229
229
|
*/
|
|
230
230
|
c(this, "values", this.all());
|
|
231
231
|
if (this.key = t, this.options = e, e.storageKey && !e.storage && typeof Storage < "u" && (e.storage = localStorage), e.storageKey && e.storage) {
|
|
232
|
-
const
|
|
233
|
-
if (
|
|
232
|
+
const r = e.storage.getItem(e.storageKey);
|
|
233
|
+
if (r)
|
|
234
234
|
try {
|
|
235
|
-
Object.assign(this.store, JSON.parse(
|
|
235
|
+
Object.assign(this.store, JSON.parse(r));
|
|
236
236
|
} catch {
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
return new Proxy(this, {
|
|
240
|
-
get: (
|
|
241
|
-
set: (
|
|
240
|
+
get: (r, s) => s in r ? r[s] : r.store[s],
|
|
241
|
+
set: (r, s, i) => (s in r ? r[s] = i : r.store[s] = i, !0)
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
244
|
getKey(t) {
|
|
@@ -261,8 +261,8 @@ class Tt {
|
|
|
261
261
|
* @return {this}
|
|
262
262
|
*/
|
|
263
263
|
add(t, e = this.ttl) {
|
|
264
|
-
const
|
|
265
|
-
return this.set(
|
|
264
|
+
const r = this.getKey(t);
|
|
265
|
+
return this.set(r, t, e), this;
|
|
266
266
|
}
|
|
267
267
|
/**
|
|
268
268
|
* Add several rows to the cache
|
|
@@ -272,7 +272,7 @@ class Tt {
|
|
|
272
272
|
* @return {this}
|
|
273
273
|
*/
|
|
274
274
|
addAll(t, e = !0) {
|
|
275
|
-
return t.forEach((
|
|
275
|
+
return t.forEach((r) => this.add(r)), this.complete = e, this;
|
|
276
276
|
}
|
|
277
277
|
/**
|
|
278
278
|
* Remove all keys from cache
|
|
@@ -327,29 +327,29 @@ class Tt {
|
|
|
327
327
|
* @param {number | undefined} ttl Override default expiry in seconds
|
|
328
328
|
* @return {this}
|
|
329
329
|
*/
|
|
330
|
-
set(t, e,
|
|
331
|
-
return this.store[t] = e, this.options.storageKey && this.options.storage && this.options.storage.setItem(this.options.storageKey, JSON.stringify(this.store)),
|
|
330
|
+
set(t, e, r = this.options.ttl) {
|
|
331
|
+
return this.store[t] = e, this.options.storageKey && this.options.storage && this.options.storage.setItem(this.options.storageKey, JSON.stringify(this.store)), r && setTimeout(() => {
|
|
332
332
|
this.complete = !1, this.delete(t);
|
|
333
|
-
},
|
|
333
|
+
}, r * 1e3), this;
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
|
-
function
|
|
337
|
-
const e =
|
|
338
|
-
|
|
339
|
-
}),
|
|
336
|
+
function Dt(n, t = !0) {
|
|
337
|
+
const e = n.reduce((r, s) => (Object.keys(t ? K(s) : s).forEach((i) => {
|
|
338
|
+
r.includes(i) || r.push(i);
|
|
339
|
+
}), r), []);
|
|
340
340
|
return [
|
|
341
341
|
e.join(","),
|
|
342
|
-
...
|
|
343
|
-
const i = B(
|
|
342
|
+
...n.map((r) => e.map((s) => {
|
|
343
|
+
const i = B(r, s), o = typeof i;
|
|
344
344
|
return o == "string" && i.includes(",") ? `"${i}"` : o == "object" ? `"${JSON.stringify(i)}"` : i;
|
|
345
345
|
}).join(","))
|
|
346
346
|
].join(`
|
|
347
347
|
`);
|
|
348
348
|
}
|
|
349
|
-
class
|
|
349
|
+
class b extends Promise {
|
|
350
350
|
constructor(e) {
|
|
351
|
-
super((
|
|
352
|
-
(i) =>
|
|
351
|
+
super((r, s) => e(
|
|
352
|
+
(i) => r(i),
|
|
353
353
|
(i) => s(i),
|
|
354
354
|
(i) => this.progress = i
|
|
355
355
|
));
|
|
@@ -360,20 +360,20 @@ class x extends Promise {
|
|
|
360
360
|
return this._progress;
|
|
361
361
|
}
|
|
362
362
|
set progress(e) {
|
|
363
|
-
e != this._progress && (this._progress = e, this.listeners.forEach((
|
|
363
|
+
e != this._progress && (this._progress = e, this.listeners.forEach((r) => r(e)));
|
|
364
364
|
}
|
|
365
365
|
static from(e) {
|
|
366
|
-
return e instanceof
|
|
366
|
+
return e instanceof b ? e : new b((r, s) => e.then((...i) => r(...i)).catch((...i) => s(...i)));
|
|
367
367
|
}
|
|
368
368
|
from(e) {
|
|
369
|
-
const
|
|
370
|
-
return this.onProgress((s) =>
|
|
369
|
+
const r = b.from(e);
|
|
370
|
+
return this.onProgress((s) => r.progress = s), r;
|
|
371
371
|
}
|
|
372
372
|
onProgress(e) {
|
|
373
373
|
return this.listeners.push(e), this;
|
|
374
374
|
}
|
|
375
|
-
then(e,
|
|
376
|
-
const s = super.then(e,
|
|
375
|
+
then(e, r) {
|
|
376
|
+
const s = super.then(e, r);
|
|
377
377
|
return this.from(s);
|
|
378
378
|
}
|
|
379
379
|
catch(e) {
|
|
@@ -383,81 +383,81 @@ class x extends Promise {
|
|
|
383
383
|
return this.from(super.finally(e));
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
|
-
function
|
|
387
|
-
|
|
388
|
-
const e = URL.createObjectURL(
|
|
389
|
-
|
|
386
|
+
function Mt(n, t) {
|
|
387
|
+
n instanceof Blob || (n = new Blob(m(n)));
|
|
388
|
+
const e = URL.createObjectURL(n);
|
|
389
|
+
ft(e, t), URL.revokeObjectURL(e);
|
|
390
390
|
}
|
|
391
|
-
function
|
|
391
|
+
function ft(n, t) {
|
|
392
392
|
const e = document.createElement("a");
|
|
393
|
-
e.href =
|
|
393
|
+
e.href = n, e.download = t || n.split("/").pop(), document.body.appendChild(e), e.click(), document.body.removeChild(e);
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function kt(n = {}) {
|
|
396
396
|
return new Promise((t) => {
|
|
397
397
|
const e = document.createElement("input");
|
|
398
|
-
e.type = "file", e.accept =
|
|
398
|
+
e.type = "file", e.accept = n.accept || "*", e.style.display = "none", e.multiple = !!n.multiple, e.onblur = e.onchange = async () => {
|
|
399
399
|
t(Array.from(e.files)), e.remove();
|
|
400
400
|
}, document.body.appendChild(e), e.click();
|
|
401
401
|
});
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function Pt(n, t = /* @__PURE__ */ new Date()) {
|
|
404
404
|
(typeof t == "number" || typeof t == "string") && (t = new Date(t));
|
|
405
405
|
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")}`;
|
|
406
|
-
return
|
|
406
|
+
return n ? n.replace("{{TIMESTAMP}}", e) : e;
|
|
407
407
|
}
|
|
408
|
-
function
|
|
409
|
-
return new
|
|
408
|
+
function Gt(n) {
|
|
409
|
+
return new b((t, e, r) => {
|
|
410
410
|
const s = new XMLHttpRequest(), i = new FormData();
|
|
411
|
-
|
|
411
|
+
n.files.forEach((o) => i.append("file", o)), s.withCredentials = !!n.withCredentials, s.upload.addEventListener("progress", (o) => o.lengthComputable ? r(o.loaded / o.total) : null), s.addEventListener("loadend", () => t(I(s.responseText))), s.addEventListener("error", () => e(I(s.responseText))), s.addEventListener("timeout", () => e({ error: "Request timed out" })), s.open("POST", n.url), Object.entries(n.headers || {}).forEach(([o, a]) => s.setRequestHeader(o, a)), s.send(i);
|
|
412
412
|
});
|
|
413
413
|
}
|
|
414
|
-
class
|
|
414
|
+
class W {
|
|
415
415
|
constructor() {
|
|
416
416
|
c(this, "listeners", {});
|
|
417
417
|
}
|
|
418
418
|
static emit(t, ...e) {
|
|
419
|
-
(this.listeners["*"] || []).forEach((
|
|
419
|
+
(this.listeners["*"] || []).forEach((r) => r(t, ...e)), (this.listeners[t.toString()] || []).forEach((r) => r(...e));
|
|
420
420
|
}
|
|
421
421
|
static off(t, e) {
|
|
422
|
-
const
|
|
423
|
-
this.listeners[
|
|
422
|
+
const r = t.toString();
|
|
423
|
+
this.listeners[r] = (this.listeners[r] || []).filter((s) => s === e);
|
|
424
424
|
}
|
|
425
425
|
static on(t, e) {
|
|
426
426
|
var s;
|
|
427
|
-
const
|
|
428
|
-
return this.listeners[
|
|
427
|
+
const r = t.toString();
|
|
428
|
+
return this.listeners[r] || (this.listeners[r] = []), (s = this.listeners[r]) == null || s.push(e), () => this.off(t, e);
|
|
429
429
|
}
|
|
430
430
|
static once(t, e) {
|
|
431
|
-
return new Promise((
|
|
431
|
+
return new Promise((r) => {
|
|
432
432
|
const s = this.on(t, (...i) => {
|
|
433
|
-
|
|
433
|
+
r(i.length == 1 ? i[0] : i), e && e(...i), s();
|
|
434
434
|
});
|
|
435
435
|
});
|
|
436
436
|
}
|
|
437
437
|
emit(t, ...e) {
|
|
438
|
-
(this.listeners["*"] || []).forEach((
|
|
438
|
+
(this.listeners["*"] || []).forEach((r) => r(t, ...e)), (this.listeners[t] || []).forEach((r) => r(...e));
|
|
439
439
|
}
|
|
440
440
|
off(t, e) {
|
|
441
|
-
this.listeners[t] = (this.listeners[t] || []).filter((
|
|
441
|
+
this.listeners[t] = (this.listeners[t] || []).filter((r) => r === e);
|
|
442
442
|
}
|
|
443
443
|
on(t, e) {
|
|
444
|
-
var
|
|
445
|
-
return this.listeners[t] || (this.listeners[t] = []), (
|
|
444
|
+
var r;
|
|
445
|
+
return this.listeners[t] || (this.listeners[t] = []), (r = this.listeners[t]) == null || r.push(e), () => this.off(t, e);
|
|
446
446
|
}
|
|
447
447
|
once(t, e) {
|
|
448
|
-
return new Promise((
|
|
448
|
+
return new Promise((r) => {
|
|
449
449
|
const s = this.on(t, (...i) => {
|
|
450
|
-
|
|
450
|
+
r(i.length == 1 ? i[0] : i), e && e(...i), s();
|
|
451
451
|
});
|
|
452
452
|
});
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
|
-
c(
|
|
455
|
+
c(W, "listeners", {});
|
|
456
456
|
class g extends Error {
|
|
457
|
-
constructor(e,
|
|
457
|
+
constructor(e, r) {
|
|
458
458
|
super(e);
|
|
459
459
|
c(this, "_code");
|
|
460
|
-
|
|
460
|
+
r != null && (this._code = r);
|
|
461
461
|
}
|
|
462
462
|
get code() {
|
|
463
463
|
return this._code || this.constructor.code;
|
|
@@ -466,11 +466,11 @@ class g extends Error {
|
|
|
466
466
|
this._code = e;
|
|
467
467
|
}
|
|
468
468
|
static from(e) {
|
|
469
|
-
const
|
|
469
|
+
const r = Number(e.statusCode) ?? Number(e.code), s = new this(e.message || e.toString());
|
|
470
470
|
return Object.assign(s, {
|
|
471
471
|
stack: e.stack,
|
|
472
472
|
...e,
|
|
473
|
-
code:
|
|
473
|
+
code: r ?? void 0
|
|
474
474
|
});
|
|
475
475
|
}
|
|
476
476
|
static instanceof(e) {
|
|
@@ -481,7 +481,7 @@ class g extends Error {
|
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
c(g, "code", 500);
|
|
484
|
-
class
|
|
484
|
+
class v extends g {
|
|
485
485
|
constructor(t = "Bad Request") {
|
|
486
486
|
super(t);
|
|
487
487
|
}
|
|
@@ -489,8 +489,8 @@ class W extends g {
|
|
|
489
489
|
return t.constructor.code == this.code;
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
|
-
c(
|
|
493
|
-
class
|
|
492
|
+
c(v, "code", 400);
|
|
493
|
+
class J extends g {
|
|
494
494
|
constructor(t = "Unauthorized") {
|
|
495
495
|
super(t);
|
|
496
496
|
}
|
|
@@ -498,8 +498,8 @@ class v extends g {
|
|
|
498
498
|
return t.constructor.code == this.code;
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
|
-
c(
|
|
502
|
-
class
|
|
501
|
+
c(J, "code", 401);
|
|
502
|
+
class z extends g {
|
|
503
503
|
constructor(t = "Payment Required") {
|
|
504
504
|
super(t);
|
|
505
505
|
}
|
|
@@ -507,8 +507,8 @@ class J extends g {
|
|
|
507
507
|
return t.constructor.code == this.code;
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
|
-
c(
|
|
511
|
-
class
|
|
510
|
+
c(z, "code", 402);
|
|
511
|
+
class Z extends g {
|
|
512
512
|
constructor(t = "Forbidden") {
|
|
513
513
|
super(t);
|
|
514
514
|
}
|
|
@@ -516,8 +516,8 @@ class z extends g {
|
|
|
516
516
|
return t.constructor.code == this.code;
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
|
-
c(
|
|
520
|
-
class
|
|
519
|
+
c(Z, "code", 403);
|
|
520
|
+
class V extends g {
|
|
521
521
|
constructor(t = "Not Found") {
|
|
522
522
|
super(t);
|
|
523
523
|
}
|
|
@@ -525,8 +525,8 @@ class Z extends g {
|
|
|
525
525
|
return t.constructor.code == this.code;
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
|
-
c(
|
|
529
|
-
class
|
|
528
|
+
c(V, "code", 404);
|
|
529
|
+
class X extends g {
|
|
530
530
|
constructor(t = "Method Not Allowed") {
|
|
531
531
|
super(t);
|
|
532
532
|
}
|
|
@@ -534,8 +534,8 @@ class V extends g {
|
|
|
534
534
|
return t.constructor.code == this.code;
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
|
-
c(
|
|
538
|
-
class
|
|
537
|
+
c(X, "code", 405);
|
|
538
|
+
class Q extends g {
|
|
539
539
|
constructor(t = "Not Acceptable") {
|
|
540
540
|
super(t);
|
|
541
541
|
}
|
|
@@ -543,8 +543,8 @@ class X extends g {
|
|
|
543
543
|
return t.constructor.code == this.code;
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
|
-
c(
|
|
547
|
-
class
|
|
546
|
+
c(Q, "code", 406);
|
|
547
|
+
class _ extends g {
|
|
548
548
|
constructor(t = "Internal Server Error") {
|
|
549
549
|
super(t);
|
|
550
550
|
}
|
|
@@ -552,8 +552,8 @@ class Q extends g {
|
|
|
552
552
|
return t.constructor.code == this.code;
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
-
c(
|
|
556
|
-
class
|
|
555
|
+
c(_, "code", 500);
|
|
556
|
+
class tt extends g {
|
|
557
557
|
constructor(t = "Not Implemented") {
|
|
558
558
|
super(t);
|
|
559
559
|
}
|
|
@@ -561,8 +561,8 @@ class _ extends g {
|
|
|
561
561
|
return t.constructor.code == this.code;
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
|
-
c(
|
|
565
|
-
class
|
|
564
|
+
c(tt, "code", 501);
|
|
565
|
+
class et extends g {
|
|
566
566
|
constructor(t = "Bad Gateway") {
|
|
567
567
|
super(t);
|
|
568
568
|
}
|
|
@@ -570,8 +570,8 @@ class tt extends g {
|
|
|
570
570
|
return t.constructor.code == this.code;
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
|
-
c(
|
|
574
|
-
class
|
|
573
|
+
c(et, "code", 502);
|
|
574
|
+
class nt extends g {
|
|
575
575
|
constructor(t = "Service Unavailable") {
|
|
576
576
|
super(t);
|
|
577
577
|
}
|
|
@@ -579,7 +579,7 @@ class et extends g {
|
|
|
579
579
|
return t.constructor.code == this.code;
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
|
-
c(
|
|
582
|
+
c(nt, "code", 503);
|
|
583
583
|
class rt extends g {
|
|
584
584
|
constructor(t = "Gateway Timeout") {
|
|
585
585
|
super(t);
|
|
@@ -589,35 +589,35 @@ class rt extends g {
|
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
591
|
c(rt, "code", 504);
|
|
592
|
-
function
|
|
593
|
-
if (
|
|
594
|
-
switch (
|
|
592
|
+
function Ut(n, t) {
|
|
593
|
+
if (n >= 200 && n < 300) return null;
|
|
594
|
+
switch (n) {
|
|
595
595
|
case 400:
|
|
596
|
-
return new W(t);
|
|
597
|
-
case 401:
|
|
598
596
|
return new v(t);
|
|
599
|
-
case
|
|
597
|
+
case 401:
|
|
600
598
|
return new J(t);
|
|
601
|
-
case
|
|
599
|
+
case 402:
|
|
602
600
|
return new z(t);
|
|
603
|
-
case
|
|
601
|
+
case 403:
|
|
604
602
|
return new Z(t);
|
|
605
|
-
case
|
|
603
|
+
case 404:
|
|
606
604
|
return new V(t);
|
|
607
|
-
case
|
|
605
|
+
case 405:
|
|
608
606
|
return new X(t);
|
|
609
|
-
case
|
|
607
|
+
case 406:
|
|
610
608
|
return new Q(t);
|
|
611
|
-
case
|
|
609
|
+
case 500:
|
|
612
610
|
return new _(t);
|
|
613
|
-
case
|
|
611
|
+
case 501:
|
|
614
612
|
return new tt(t);
|
|
615
|
-
case
|
|
613
|
+
case 502:
|
|
616
614
|
return new et(t);
|
|
615
|
+
case 503:
|
|
616
|
+
return new nt(t);
|
|
617
617
|
case 504:
|
|
618
618
|
return new rt(t);
|
|
619
619
|
default:
|
|
620
|
-
return new g(t,
|
|
620
|
+
return new g(t, n);
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
623
|
const E = class E {
|
|
@@ -647,16 +647,16 @@ const E = class E {
|
|
|
647
647
|
const i = Array.isArray(t.query) ? t.query : Object.keys(t.query).map((o) => ({ key: o, value: t.query[o] }));
|
|
648
648
|
e += (e.includes("?") ? "&" : "?") + i.map((o) => `${o.key}=${o.value}`).join("&");
|
|
649
649
|
}
|
|
650
|
-
const
|
|
650
|
+
const r = ct({
|
|
651
651
|
"Content-Type": t.body ? t.body instanceof FormData ? "multipart/form-data" : "application/json" : void 0,
|
|
652
652
|
...E.headers,
|
|
653
653
|
...this.headers,
|
|
654
654
|
...t.headers
|
|
655
655
|
});
|
|
656
|
-
return typeof t.body == "object" && t.body != null &&
|
|
656
|
+
return typeof t.body == "object" && t.body != null && r["Content-Type"] == "application/json" && (t.body = JSON.stringify(t.body)), new b((i, o, a) => {
|
|
657
657
|
try {
|
|
658
658
|
fetch(e, {
|
|
659
|
-
headers:
|
|
659
|
+
headers: r,
|
|
660
660
|
method: t.method || (t.body ? "POST" : "GET"),
|
|
661
661
|
body: t.body
|
|
662
662
|
}).then(async (u) => {
|
|
@@ -665,7 +665,7 @@ const E = class E {
|
|
|
665
665
|
await new Promise((C) => l(u, () => C()));
|
|
666
666
|
const $ = u.headers.get("Content-Length"), j = $ ? parseInt($, 10) : 0;
|
|
667
667
|
let P = 0;
|
|
668
|
-
const T = (G = u.body) == null ? void 0 : G.getReader(),
|
|
668
|
+
const T = (G = u.body) == null ? void 0 : G.getReader(), st = new ReadableStream({
|
|
669
669
|
start(l) {
|
|
670
670
|
function C() {
|
|
671
671
|
T == null || T.read().then((A) => {
|
|
@@ -676,7 +676,7 @@ const E = class E {
|
|
|
676
676
|
C();
|
|
677
677
|
}
|
|
678
678
|
});
|
|
679
|
-
if (u.data = new Response(
|
|
679
|
+
if (u.data = new Response(st), t.decode == null || t.decode) {
|
|
680
680
|
const l = (U = u.headers.get("Content-Type")) == null ? void 0 : U.toLowerCase();
|
|
681
681
|
l != null && l.includes("form") ? u.data = await u.data.formData() : l != null && l.includes("json") ? u.data = await u.data.json() : l != null && l.includes("text") ? u.data = await u.data.text() : l != null && l.includes("application") && (u.data = await u.data.blob());
|
|
682
682
|
}
|
|
@@ -690,8 +690,8 @@ const E = class E {
|
|
|
690
690
|
};
|
|
691
691
|
c(E, "interceptors", {}), c(E, "headers", {});
|
|
692
692
|
let F = E;
|
|
693
|
-
function
|
|
694
|
-
const t =
|
|
693
|
+
function qt(n) {
|
|
694
|
+
const t = n.split(".")[1].replace(/-/g, "+").replace(/_/g, "/");
|
|
695
695
|
return I(decodeURIComponent(atob(t).split("").map(function(e) {
|
|
696
696
|
return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2);
|
|
697
697
|
}).join("")));
|
|
@@ -721,7 +721,7 @@ const R = {
|
|
|
721
721
|
LIGHT_MAGENTA: "\x1B[95m",
|
|
722
722
|
LIGHT_CYAN: "\x1B[96m",
|
|
723
723
|
WHITE: "\x1B[97m"
|
|
724
|
-
},
|
|
724
|
+
}, Ft = {
|
|
725
725
|
BLACK: "\x1B[40m",
|
|
726
726
|
RED: "\x1B[41m",
|
|
727
727
|
GREEN: "\x1B[42m",
|
|
@@ -732,15 +732,15 @@ const R = {
|
|
|
732
732
|
WHITE: "\x1B[47m",
|
|
733
733
|
GREY: "\x1B[100m"
|
|
734
734
|
};
|
|
735
|
-
var
|
|
736
|
-
const w = class w extends
|
|
735
|
+
var ht = /* @__PURE__ */ ((n) => (n[n.ERROR = 0] = "ERROR", n[n.WARN = 1] = "WARN", n[n.INFO = 2] = "INFO", n[n.LOG = 3] = "LOG", n[n.DEBUG = 4] = "DEBUG", n))(ht || {});
|
|
736
|
+
const w = class w extends W {
|
|
737
737
|
constructor(t) {
|
|
738
738
|
super(), this.namespace = t;
|
|
739
739
|
}
|
|
740
|
-
pad(t, e,
|
|
740
|
+
pad(t, e, r, s = !1) {
|
|
741
741
|
const i = t.toString(), o = e - i.length;
|
|
742
742
|
if (o <= 0) return i;
|
|
743
|
-
const a = Array(~~(o /
|
|
743
|
+
const a = Array(~~(o / r.length)).fill(r).join("");
|
|
744
744
|
return s ? i + a : a + i;
|
|
745
745
|
}
|
|
746
746
|
format(...t) {
|
|
@@ -775,70 +775,70 @@ const w = class w extends K {
|
|
|
775
775
|
};
|
|
776
776
|
c(w, "LOG_LEVEL", 4);
|
|
777
777
|
let Y = w;
|
|
778
|
-
function
|
|
779
|
-
const t = (a, u) => u < 1e-7 ? a : t(u, ~~(a % u)), e =
|
|
780
|
-
let
|
|
781
|
-
const i = t(s,
|
|
782
|
-
s = ~~(s / i),
|
|
783
|
-
const o = ~~(s /
|
|
784
|
-
return s -= o *
|
|
785
|
-
}
|
|
786
|
-
function
|
|
787
|
-
let t =
|
|
778
|
+
function Yt(n) {
|
|
779
|
+
const t = (a, u) => u < 1e-7 ? a : t(u, ~~(a % u)), e = n.toString().length - 2;
|
|
780
|
+
let r = Math.pow(10, e), s = n * r;
|
|
781
|
+
const i = t(s, r);
|
|
782
|
+
s = ~~(s / i), r = ~~(r / i);
|
|
783
|
+
const o = ~~(s / r);
|
|
784
|
+
return s -= o * r, `${o ? o + " " : ""}${~~s}/${~~r}`;
|
|
785
|
+
}
|
|
786
|
+
function Ht(n) {
|
|
787
|
+
let t = n.split(" ");
|
|
788
788
|
const e = t.length == 2 ? Number(t[0]) : 0;
|
|
789
789
|
return t = t.pop().split("/"), e + Number(t[0]) / Number(t[1]);
|
|
790
790
|
}
|
|
791
|
-
const D = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", M = "0123456789", k = "~`!@#$%^&*()_-+={[}]|\\:;\"'<,>.?/",
|
|
792
|
-
function
|
|
793
|
-
if (
|
|
794
|
-
const e = 1024,
|
|
795
|
-
return parseFloat((
|
|
791
|
+
const D = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", M = "0123456789", k = "~`!@#$%^&*()_-+={[}]|\\:;\"'<,>.?/", dt = D + M + k;
|
|
792
|
+
function Kt(n, t = 2) {
|
|
793
|
+
if (n === 0) return "0 Bytes";
|
|
794
|
+
const e = 1024, r = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], s = Math.floor(Math.log(n) / Math.log(e));
|
|
795
|
+
return parseFloat((n / Math.pow(e, s)).toFixed(t)) + " " + r[s];
|
|
796
796
|
}
|
|
797
|
-
function
|
|
798
|
-
const t = /(\+?1)?.*?(\d{3}).*?(\d{3}).*?(\d{4})/g.exec(
|
|
799
|
-
if (!t) throw new Error(`Number cannot be parsed: ${
|
|
797
|
+
function Wt(n) {
|
|
798
|
+
const t = /(\+?1)?.*?(\d{3}).*?(\d{3}).*?(\d{4})/g.exec(n);
|
|
799
|
+
if (!t) throw new Error(`Number cannot be parsed: ${n}`);
|
|
800
800
|
return `${t[1] ?? ""} (${t[2]}) ${t[3]}-${t[4]}`.trim();
|
|
801
801
|
}
|
|
802
|
-
function
|
|
803
|
-
return `${
|
|
802
|
+
function vt(n, t, e) {
|
|
803
|
+
return `${n.slice(0, e)}${t}${n.slice(e + 1)}`;
|
|
804
804
|
}
|
|
805
|
-
function
|
|
806
|
-
return
|
|
805
|
+
function Jt(n, t, e = " ", r = !0) {
|
|
806
|
+
return r ? n.toString().padStart(t, e) : n.toString().padEnd(t, e);
|
|
807
807
|
}
|
|
808
|
-
function
|
|
809
|
-
return Array(
|
|
808
|
+
function zt(n) {
|
|
809
|
+
return Array(n).fill(null).map(() => Math.round(Math.random() * 15).toString(16)).join("");
|
|
810
810
|
}
|
|
811
|
-
function
|
|
812
|
-
return Array(
|
|
811
|
+
function Zt(n, t = dt) {
|
|
812
|
+
return Array(n).fill(null).map(() => {
|
|
813
813
|
const e = ~~(Math.random() * t.length);
|
|
814
814
|
return t[e];
|
|
815
815
|
}).join("");
|
|
816
816
|
}
|
|
817
|
-
function
|
|
818
|
-
if (!t && !e && !
|
|
819
|
-
return Array(
|
|
817
|
+
function Vt(n, t = !1, e = !1, r = !1) {
|
|
818
|
+
if (!t && !e && !r) throw new Error("Must enable at least one: letters, numbers, symbols");
|
|
819
|
+
return Array(n).fill(null).map(() => {
|
|
820
820
|
let s;
|
|
821
821
|
do {
|
|
822
822
|
const i = ~~(Math.random() * 3);
|
|
823
|
-
t && i == 0 ? s = D[~~(Math.random() * D.length)] : e && i == 1 ? s = M[~~(Math.random() * M.length)] :
|
|
823
|
+
t && i == 0 ? s = D[~~(Math.random() * D.length)] : e && i == 1 ? s = M[~~(Math.random() * M.length)] : r && i == 2 && (s = k[~~(Math.random() * k.length)]);
|
|
824
824
|
} while (!s);
|
|
825
825
|
return s;
|
|
826
826
|
}).join("");
|
|
827
827
|
}
|
|
828
|
-
function
|
|
828
|
+
function Xt(n, t) {
|
|
829
829
|
if (typeof t == "string" && (t = new RegExp(t, "g")), !t.global)
|
|
830
830
|
throw new TypeError("Regular expression must be global.");
|
|
831
|
-
let e = [],
|
|
832
|
-
for (; (
|
|
833
|
-
e.push(
|
|
831
|
+
let e = [], r;
|
|
832
|
+
for (; (r = t.exec(n)) !== null; )
|
|
833
|
+
e.push(r);
|
|
834
834
|
return e;
|
|
835
835
|
}
|
|
836
|
-
function
|
|
836
|
+
function Qt(n) {
|
|
837
837
|
const t = new RegExp(
|
|
838
838
|
"(?:(?<protocol>[\\w\\d]+)\\:\\/\\/)?(?:(?<user>.+)\\@)?(?<host>(?<domain>[^:\\/\\?#@\\n]+)(?:\\:(?<port>\\d*))?)(?<path>\\/.*?)?(?:\\?(?<query>.*?))?(?:#(?<fragment>.*?))?$",
|
|
839
839
|
"gm"
|
|
840
|
-
).exec(
|
|
841
|
-
if (e.port != null && (e.port = Number(e.port)),
|
|
840
|
+
).exec(n), e = (t == null ? void 0 : t.groups) ?? {}, r = e.domain.split(".");
|
|
841
|
+
if (e.port != null && (e.port = Number(e.port)), r.length > 2 && (e.domain = r.splice(-2, 2).join("."), e.subdomain = r.join(".")), e.query) {
|
|
842
842
|
const s = e.query.split("&"), i = {};
|
|
843
843
|
s.forEach((o) => {
|
|
844
844
|
const [a, u] = o.split("=");
|
|
@@ -847,74 +847,76 @@ function Xt(r) {
|
|
|
847
847
|
}
|
|
848
848
|
return e;
|
|
849
849
|
}
|
|
850
|
-
function
|
|
851
|
-
var t =
|
|
850
|
+
function pt(n) {
|
|
851
|
+
var t = yt(wt(Et(gt(n), 8 * n.length)));
|
|
852
852
|
return t.toLowerCase();
|
|
853
853
|
}
|
|
854
|
-
function
|
|
855
|
-
for (var t, e = "0123456789ABCDEF",
|
|
856
|
-
return
|
|
854
|
+
function yt(n) {
|
|
855
|
+
for (var t, e = "0123456789ABCDEF", r = "", s = 0; s < n.length; s++) t = n.charCodeAt(s), r += e.charAt(t >>> 4 & 15) + e.charAt(15 & t);
|
|
856
|
+
return r;
|
|
857
857
|
}
|
|
858
|
-
function
|
|
859
|
-
for (var t = Array(
|
|
860
|
-
for (e = 0; e < 8 *
|
|
858
|
+
function gt(n) {
|
|
859
|
+
for (var t = Array(n.length >> 2), e = 0; e < t.length; e++) t[e] = 0;
|
|
860
|
+
for (e = 0; e < 8 * n.length; e += 8) t[e >> 5] |= (255 & n.charCodeAt(e / 8)) << e % 32;
|
|
861
861
|
return t;
|
|
862
862
|
}
|
|
863
|
-
function
|
|
864
|
-
for (var t = "", e = 0; e < 32 *
|
|
863
|
+
function wt(n) {
|
|
864
|
+
for (var t = "", e = 0; e < 32 * n.length; e += 8) t += String.fromCharCode(n[e >> 5] >>> e % 32 & 255);
|
|
865
865
|
return t;
|
|
866
866
|
}
|
|
867
|
-
function
|
|
868
|
-
|
|
869
|
-
for (var e = 1732584193,
|
|
870
|
-
var a = e, u =
|
|
871
|
-
|
|
867
|
+
function Et(n, t) {
|
|
868
|
+
n[t >> 5] |= 128 << t % 32, n[14 + (t + 64 >>> 9 << 4)] = t;
|
|
869
|
+
for (var e = 1732584193, r = -271733879, s = -1732584194, i = 271733878, o = 0; o < n.length; o += 16) {
|
|
870
|
+
var a = e, u = r, $ = s, j = i;
|
|
871
|
+
r = p(r = p(r = p(r = p(r = d(r = d(r = d(r = d(r = h(r = h(r = h(r = h(r = f(r = f(r = f(r = f(r, s = f(s, i = f(i, e = f(e, r, s, i, n[o + 0], 7, -680876936), r, s, n[o + 1], 12, -389564586), e, r, n[o + 2], 17, 606105819), i, e, n[o + 3], 22, -1044525330), s = f(s, i = f(i, e = f(e, r, s, i, n[o + 4], 7, -176418897), r, s, n[o + 5], 12, 1200080426), e, r, n[o + 6], 17, -1473231341), i, e, n[o + 7], 22, -45705983), s = f(s, i = f(i, e = f(e, r, s, i, n[o + 8], 7, 1770035416), r, s, n[o + 9], 12, -1958414417), e, r, n[o + 10], 17, -42063), i, e, n[o + 11], 22, -1990404162), s = f(s, i = f(i, e = f(e, r, s, i, n[o + 12], 7, 1804603682), r, s, n[o + 13], 12, -40341101), e, r, n[o + 14], 17, -1502002290), i, e, n[o + 15], 22, 1236535329), s = h(s, i = h(i, e = h(e, r, s, i, n[o + 1], 5, -165796510), r, s, n[o + 6], 9, -1069501632), e, r, n[o + 11], 14, 643717713), i, e, n[o + 0], 20, -373897302), s = h(s, i = h(i, e = h(e, r, s, i, n[o + 5], 5, -701558691), r, s, n[o + 10], 9, 38016083), e, r, n[o + 15], 14, -660478335), i, e, n[o + 4], 20, -405537848), s = h(s, i = h(i, e = h(e, r, s, i, n[o + 9], 5, 568446438), r, s, n[o + 14], 9, -1019803690), e, r, n[o + 3], 14, -187363961), i, e, n[o + 8], 20, 1163531501), s = h(s, i = h(i, e = h(e, r, s, i, n[o + 13], 5, -1444681467), r, s, n[o + 2], 9, -51403784), e, r, n[o + 7], 14, 1735328473), i, e, n[o + 12], 20, -1926607734), s = d(s, i = d(i, e = d(e, r, s, i, n[o + 5], 4, -378558), r, s, n[o + 8], 11, -2022574463), e, r, n[o + 11], 16, 1839030562), i, e, n[o + 14], 23, -35309556), s = d(s, i = d(i, e = d(e, r, s, i, n[o + 1], 4, -1530992060), r, s, n[o + 4], 11, 1272893353), e, r, n[o + 7], 16, -155497632), i, e, n[o + 10], 23, -1094730640), s = d(s, i = d(i, e = d(e, r, s, i, n[o + 13], 4, 681279174), r, s, n[o + 0], 11, -358537222), e, r, n[o + 3], 16, -722521979), i, e, n[o + 6], 23, 76029189), s = d(s, i = d(i, e = d(e, r, s, i, n[o + 9], 4, -640364487), r, s, n[o + 12], 11, -421815835), e, r, n[o + 15], 16, 530742520), i, e, n[o + 2], 23, -995338651), s = p(s, i = p(i, e = p(e, r, s, i, n[o + 0], 6, -198630844), r, s, n[o + 7], 10, 1126891415), e, r, n[o + 14], 15, -1416354905), i, e, n[o + 5], 21, -57434055), s = p(s, i = p(i, e = p(e, r, s, i, n[o + 12], 6, 1700485571), r, s, n[o + 3], 10, -1894986606), e, r, n[o + 10], 15, -1051523), i, e, n[o + 1], 21, -2054922799), s = p(s, i = p(i, e = p(e, r, s, i, n[o + 8], 6, 1873313359), r, s, n[o + 15], 10, -30611744), e, r, n[o + 6], 15, -1560198380), i, e, n[o + 13], 21, 1309151649), s = p(s, i = p(i, e = p(e, r, s, i, n[o + 4], 6, -145523070), r, s, n[o + 11], 10, -1120210379), e, r, n[o + 2], 15, 718787259), i, e, n[o + 9], 21, -343485551), e = x(e, a), r = x(r, u), s = x(s, $), i = x(i, j);
|
|
872
872
|
}
|
|
873
|
-
return Array(e,
|
|
873
|
+
return Array(e, r, s, i);
|
|
874
874
|
}
|
|
875
|
-
function N(
|
|
876
|
-
return
|
|
875
|
+
function N(n, t, e, r, s, i) {
|
|
876
|
+
return x(mt(x(x(t, n), x(r, i)), s), e);
|
|
877
877
|
}
|
|
878
|
-
function f(
|
|
879
|
-
return N(t & e | ~t &
|
|
878
|
+
function f(n, t, e, r, s, i, o) {
|
|
879
|
+
return N(t & e | ~t & r, n, t, s, i, o);
|
|
880
880
|
}
|
|
881
|
-
function h(
|
|
882
|
-
return N(t &
|
|
881
|
+
function h(n, t, e, r, s, i, o) {
|
|
882
|
+
return N(t & r | e & ~r, n, t, s, i, o);
|
|
883
883
|
}
|
|
884
|
-
function d(
|
|
885
|
-
return N(t ^ e ^
|
|
884
|
+
function d(n, t, e, r, s, i, o) {
|
|
885
|
+
return N(t ^ e ^ r, n, t, s, i, o);
|
|
886
886
|
}
|
|
887
|
-
function p(
|
|
888
|
-
return N(e ^ (t | ~
|
|
887
|
+
function p(n, t, e, r, s, i, o) {
|
|
888
|
+
return N(e ^ (t | ~r), n, t, s, i, o);
|
|
889
889
|
}
|
|
890
|
-
function
|
|
891
|
-
var e = (65535 &
|
|
892
|
-
return (
|
|
890
|
+
function x(n, t) {
|
|
891
|
+
var e = (65535 & n) + (65535 & t);
|
|
892
|
+
return (n >> 16) + (t >> 16) + (e >> 16) << 16 | 65535 & e;
|
|
893
893
|
}
|
|
894
|
-
function
|
|
895
|
-
return
|
|
894
|
+
function mt(n, t) {
|
|
895
|
+
return n << t | n >>> 32 - t;
|
|
896
896
|
}
|
|
897
|
-
function
|
|
898
|
-
return /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(
|
|
897
|
+
function _t(n) {
|
|
898
|
+
return /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(n);
|
|
899
899
|
}
|
|
900
|
-
function
|
|
901
|
-
return
|
|
900
|
+
function te(n, t = "mp") {
|
|
901
|
+
return n ? `https://www.gravatar.com/avatar/${pt(n)}?d=${t}` : "";
|
|
902
902
|
}
|
|
903
|
-
function
|
|
904
|
-
return
|
|
903
|
+
function ee(n) {
|
|
904
|
+
return n.replace(/[.*+?^${}()|\[\]\\]/g, "\\$&");
|
|
905
905
|
}
|
|
906
|
-
function
|
|
906
|
+
function ne(n, ...t) {
|
|
907
907
|
const e = [];
|
|
908
|
-
for (let
|
|
909
|
-
r
|
|
908
|
+
for (let r = 0; r < n.length || r < t.length; r++)
|
|
909
|
+
n[r] && e.push(n[r]), t[r] && e.push(t[r]);
|
|
910
910
|
return new y(e.join(""));
|
|
911
911
|
}
|
|
912
|
-
function
|
|
912
|
+
function St(n, ...t) {
|
|
913
913
|
let e = [];
|
|
914
|
-
for (let i = 0; i <
|
|
915
|
-
|
|
916
|
-
const [
|
|
917
|
-
return y.toString(
|
|
914
|
+
for (let i = 0; i < n.length || i < t.length; i++)
|
|
915
|
+
n[i] && e.push(n[i]), t[i] && e.push(t[i]);
|
|
916
|
+
const [r, s] = e.join("").split(":");
|
|
917
|
+
return y.toString(r, s == null ? void 0 : s.split(""));
|
|
918
|
+
}
|
|
919
|
+
class H extends Error {
|
|
918
920
|
}
|
|
919
921
|
class y {
|
|
920
922
|
constructor(t) {
|
|
@@ -942,8 +944,8 @@ class y {
|
|
|
942
944
|
c(this, "delete");
|
|
943
945
|
var o;
|
|
944
946
|
if (typeof t == "object") return Object.assign(this, t);
|
|
945
|
-
let [e,
|
|
946
|
-
s || (s =
|
|
947
|
+
let [e, r, s] = t.split(":");
|
|
948
|
+
s || (s = r || "*"), (e == "*" || !e && s == "*") && (e = "", s = "*");
|
|
947
949
|
let i = e.split("/").filter((a) => !!a);
|
|
948
950
|
this.module = ((o = i.splice(0, 1)[0]) == null ? void 0 : o.toLowerCase()) || "", this.fullPath = e, this.path = i.join("/"), this.name = i.pop() || "", this.methods = s.split(""), this.all = s == null ? void 0 : s.includes("*"), this.none = s == null ? void 0 : s.includes("n"), this.create = !(s != null && s.includes("n")) && ((s == null ? void 0 : s.includes("*")) || (s == null ? void 0 : s.includes("w")) || (s == null ? void 0 : s.includes("c"))), this.read = !(s != null && s.includes("n")) && ((s == null ? void 0 : s.includes("*")) || (s == null ? void 0 : s.includes("r"))), this.update = !(s != null && s.includes("n")) && ((s == null ? void 0 : s.includes("*")) || (s == null ? void 0 : s.includes("w")) || (s == null ? void 0 : s.includes("u"))), this.delete = !(s != null && s.includes("n")) && ((s == null ? void 0 : s.includes("*")) || (s == null ? void 0 : s.includes("w")) || (s == null ? void 0 : s.includes("d")));
|
|
949
951
|
}
|
|
@@ -956,11 +958,11 @@ class y {
|
|
|
956
958
|
*/
|
|
957
959
|
static combine(t) {
|
|
958
960
|
let e = !1;
|
|
959
|
-
const
|
|
961
|
+
const r = t.map((s) => new y(s)).toSorted((s, i) => {
|
|
960
962
|
const o = s.fullPath.length, a = i.fullPath.length;
|
|
961
963
|
return o < a ? 1 : o > a ? -1 : 0;
|
|
962
964
|
}).reduce((s, i) => (i.none && (e = !0), s ? (e || (i.all && (s.all = !0), (i.all || i.create) && (s.create = !0), (i.all || i.read) && (s.read = !0), (i.all || i.update) && (s.update = !0), (i.all || i.delete) && (s.delete = !0), s.methods = [...s.methods, ...i.methods]), s) : i), null);
|
|
963
|
-
return
|
|
965
|
+
return r.all && (r.methods = ["*"]), r.none && (r.methods = ["n"]), r.methods = new S(r.methods), r.raw = St`${r.fullPath}:${r.methods}`, r;
|
|
964
966
|
}
|
|
965
967
|
/**
|
|
966
968
|
* Squash 2 sets of paths & return true if any overlap is found
|
|
@@ -970,8 +972,8 @@ class y {
|
|
|
970
972
|
* @return {boolean} Whether there is any overlap
|
|
971
973
|
*/
|
|
972
974
|
static has(t, ...e) {
|
|
973
|
-
const
|
|
974
|
-
return !!
|
|
975
|
+
const r = m(e).map((i) => new y(i)), s = m(t).map((i) => new y(i));
|
|
976
|
+
return !!r.find((i) => {
|
|
975
977
|
if (!i.fullPath && i.all) return !0;
|
|
976
978
|
const o = s.filter((u) => i.fullPath.startsWith(u.fullPath));
|
|
977
979
|
if (!o.length) return !1;
|
|
@@ -987,7 +989,7 @@ class y {
|
|
|
987
989
|
* @return {boolean} Whether there is any overlap
|
|
988
990
|
*/
|
|
989
991
|
static hasAll(t, ...e) {
|
|
990
|
-
return e.filter((
|
|
992
|
+
return e.filter((r) => y.has(t, r)).length == e.length;
|
|
991
993
|
}
|
|
992
994
|
/**
|
|
993
995
|
* Same as `has` but raises an error if there is no overlap
|
|
@@ -996,7 +998,7 @@ class y {
|
|
|
996
998
|
* @param has Target must have at least one of these path
|
|
997
999
|
*/
|
|
998
1000
|
static hasFatal(t, ...e) {
|
|
999
|
-
if (!y.has(t, ...e)) throw new
|
|
1001
|
+
if (!y.has(t, ...e)) throw new H(`Requires one of: ${m(e).join(", ")}`);
|
|
1000
1002
|
}
|
|
1001
1003
|
/**
|
|
1002
1004
|
* Same as `hasAll` but raises an error if the target is missing any paths
|
|
@@ -1005,7 +1007,7 @@ class y {
|
|
|
1005
1007
|
* @param has Target must have all these paths
|
|
1006
1008
|
*/
|
|
1007
1009
|
static hasAllFatal(t, ...e) {
|
|
1008
|
-
if (!y.hasAll(t, ...e)) throw new
|
|
1010
|
+
if (!y.hasAll(t, ...e)) throw new H(`Requires all: ${m(e).join(", ")}`);
|
|
1009
1011
|
}
|
|
1010
1012
|
/**
|
|
1011
1013
|
* Create event string from its components
|
|
@@ -1015,8 +1017,8 @@ class y {
|
|
|
1015
1017
|
* @return {string} String representation of Event
|
|
1016
1018
|
*/
|
|
1017
1019
|
static toString(t, e) {
|
|
1018
|
-
let
|
|
1019
|
-
return e != null && e.length && (
|
|
1020
|
+
let r = m(t).filter((s) => s != null).join("/");
|
|
1021
|
+
return e != null && e.length && (r += `:${m(e).map((s) => s.toLowerCase()).join("")}`), r == null ? void 0 : r.trim().replaceAll(/\/{2,}/g, "/").replaceAll(/(^\/|\/$)/g, "");
|
|
1020
1022
|
}
|
|
1021
1023
|
/**
|
|
1022
1024
|
* Create event string from its components
|
|
@@ -1032,118 +1034,119 @@ class re {
|
|
|
1032
1034
|
c(this, "listeners", []);
|
|
1033
1035
|
}
|
|
1034
1036
|
emit(t, ...e) {
|
|
1035
|
-
const
|
|
1036
|
-
this.listeners.filter((s) => y.has(s[0], t)).forEach(async (s) => s[1](
|
|
1037
|
+
const r = new y(t);
|
|
1038
|
+
this.listeners.filter((s) => y.has(s[0], t)).forEach(async (s) => s[1](r, ...e));
|
|
1037
1039
|
}
|
|
1038
1040
|
off(t) {
|
|
1039
1041
|
this.listeners = this.listeners.filter((e) => e[1] != t);
|
|
1040
1042
|
}
|
|
1041
1043
|
on(t, e) {
|
|
1042
|
-
return m(t).forEach((
|
|
1044
|
+
return m(t).forEach((r) => this.listeners.push([new y(r), e])), () => this.off(e);
|
|
1043
1045
|
}
|
|
1044
1046
|
once(t, e) {
|
|
1045
|
-
return new Promise((
|
|
1047
|
+
return new Promise((r) => {
|
|
1046
1048
|
const s = this.on(t, (i, ...o) => {
|
|
1047
|
-
|
|
1049
|
+
r(o.length < 2 ? o[0] : o), e && e(i, ...o), s();
|
|
1048
1050
|
});
|
|
1049
1051
|
});
|
|
1050
1052
|
}
|
|
1051
1053
|
relayEvents(t) {
|
|
1052
|
-
t.on("*", (e, ...
|
|
1054
|
+
t.on("*", (e, ...r) => this.emit(e, ...r));
|
|
1053
1055
|
}
|
|
1054
1056
|
}
|
|
1055
|
-
function
|
|
1056
|
-
(typeof
|
|
1057
|
-
let t =
|
|
1058
|
-
return t >= 12 ? (t > 12 && (t -= 12), e = "PM") : t == 0 && (t = 12), `${
|
|
1057
|
+
function se(n) {
|
|
1058
|
+
(typeof n == "number" || typeof n == "string") && (n = new Date(n));
|
|
1059
|
+
let t = n.getHours(), e = "AM";
|
|
1060
|
+
return t >= 12 ? (t > 12 && (t -= 12), e = "PM") : t == 0 && (t = 12), `${n.getFullYear()}-${(n.getMonth() + 1).toString().padStart(2, "0")}-${n.getDate().toString().padStart(2, "0")}, ${t}:${n.getMinutes().toString().padStart(2, "0")} ${e}`;
|
|
1059
1061
|
}
|
|
1060
|
-
function
|
|
1061
|
-
return new Promise((t) => setTimeout(t,
|
|
1062
|
+
function xt(n) {
|
|
1063
|
+
return new Promise((t) => setTimeout(t, n));
|
|
1062
1064
|
}
|
|
1063
|
-
async function
|
|
1064
|
-
for (; await
|
|
1065
|
+
async function ie(n, t = 100) {
|
|
1066
|
+
for (; await n(); ) await xt(t);
|
|
1065
1067
|
}
|
|
1066
|
-
function
|
|
1067
|
-
return (
|
|
1068
|
+
function oe(n) {
|
|
1069
|
+
return (n instanceof Date ? n.getTime() : n) - (/* @__PURE__ */ new Date()).getTime();
|
|
1068
1070
|
}
|
|
1069
|
-
function
|
|
1071
|
+
function ce() {
|
|
1070
1072
|
return Object.keys({});
|
|
1071
1073
|
}
|
|
1072
1074
|
export {
|
|
1073
1075
|
S as ASet,
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1076
|
+
et as BadGatewayError,
|
|
1077
|
+
v as BadRequestError,
|
|
1078
|
+
It as Cache,
|
|
1079
|
+
Ft as CliBackground,
|
|
1078
1080
|
R as CliEffects,
|
|
1079
1081
|
L as CliForeground,
|
|
1080
1082
|
g as CustomError,
|
|
1081
|
-
|
|
1083
|
+
Z as ForbiddenError,
|
|
1082
1084
|
rt as GatewayTimeoutError,
|
|
1083
1085
|
F as Http,
|
|
1084
|
-
|
|
1086
|
+
_ as InternalServerError,
|
|
1085
1087
|
I as JSONAttemptParse,
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
+
$t as JSONSanitize,
|
|
1089
|
+
ht as LOG_LEVEL,
|
|
1088
1090
|
Y as Logger,
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1091
|
+
X as MethodNotAllowedError,
|
|
1092
|
+
Q as NotAcceptableError,
|
|
1093
|
+
V as NotFoundError,
|
|
1094
|
+
tt as NotImplementedError,
|
|
1095
|
+
ne as PE,
|
|
1096
|
+
St as PES,
|
|
1097
|
+
H as PathError,
|
|
1095
1098
|
y as PathEvent,
|
|
1096
1099
|
re as PathEventEmitter,
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1100
|
+
z as PaymentRequiredError,
|
|
1101
|
+
b as PromiseProgress,
|
|
1102
|
+
nt as ServiceUnavailableError,
|
|
1103
|
+
W as TypedEmitter,
|
|
1104
|
+
J as UnauthorizedError,
|
|
1105
|
+
Ct as addUnique,
|
|
1106
|
+
Lt as arrayDiff,
|
|
1107
|
+
Nt as caseInsensitiveSort,
|
|
1108
|
+
ct as clean,
|
|
1109
|
+
Dt as csv,
|
|
1110
|
+
Yt as dec2Frac,
|
|
1111
|
+
Bt as deepCopy,
|
|
1112
|
+
ut as deepMerge,
|
|
1110
1113
|
B as dotNotation,
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1114
|
+
Mt as downloadFile,
|
|
1115
|
+
ft as downloadUrl,
|
|
1116
|
+
At as encodeQuery,
|
|
1117
|
+
Ut as errorFromCode,
|
|
1118
|
+
ee as escapeRegex,
|
|
1119
|
+
kt as fileBrowser,
|
|
1120
|
+
jt as findByProp,
|
|
1121
|
+
at as flattenArr,
|
|
1122
|
+
K as flattenObj,
|
|
1123
|
+
Rt as formData,
|
|
1124
|
+
Kt as formatBytes,
|
|
1125
|
+
se as formatDate,
|
|
1126
|
+
Wt as formatPhoneNumber,
|
|
1127
|
+
Ht as fracToDec,
|
|
1128
|
+
te as gravatar,
|
|
1126
1129
|
q as includes,
|
|
1127
|
-
|
|
1130
|
+
vt as insertAt,
|
|
1128
1131
|
O as isEqual,
|
|
1129
|
-
|
|
1132
|
+
qt as jwtDecode,
|
|
1130
1133
|
m as makeArray,
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1134
|
+
lt as makeUnique,
|
|
1135
|
+
Xt as matchAll,
|
|
1136
|
+
pt as md5,
|
|
1137
|
+
Ot as mixin,
|
|
1138
|
+
Jt as pad,
|
|
1139
|
+
Qt as parseUrl,
|
|
1140
|
+
zt as randomHex,
|
|
1141
|
+
Zt as randomString,
|
|
1142
|
+
Vt as randomStringBuilder,
|
|
1143
|
+
xt as sleep,
|
|
1144
|
+
ie as sleepWhile,
|
|
1145
|
+
Tt as sortByProp,
|
|
1146
|
+
oe as timeUntil,
|
|
1147
|
+
Pt as timestampFilename,
|
|
1148
|
+
ce as tyoeKeys,
|
|
1149
|
+
Gt as uploadWithProgress,
|
|
1150
|
+
_t as validateEmail
|
|
1148
1151
|
};
|
|
1149
1152
|
//# sourceMappingURL=index.mjs.map
|