esexts 1.2.5 → 1.2.7

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/esexts.js CHANGED
@@ -1,1111 +1,881 @@
1
- function h(e = { array: !1 }) {
2
- return function(t = {}, ...r) {
3
- const u = (n, l) => {
4
- const a = Object.prototype.toString.call(n), f = Object.prototype.toString.call(l);
5
- if (a !== f)
6
- return l;
7
- if (a === "[object Array]")
8
- return e.array ? n.concat(...l) : l;
9
- if (a === "[object Object]") {
10
- for (const o in l)
11
- n[o] = u(n[o], l[o]);
12
- return n;
1
+ const l = Object.defineProperties, n = { enumerable: !1, configurable: !0, writable: !0 };
2
+ function p(t = { array: !1 }) {
3
+ return function(e = {}, ...r) {
4
+ const u = (i, s) => {
5
+ const o = Object.prototype.toString.call(i), f = Object.prototype.toString.call(s);
6
+ if (o !== f)
7
+ return s;
8
+ if (o === "[object Array]")
9
+ return t.array ? i.concat(...s) : s;
10
+ if (o === "[object Object]") {
11
+ for (const a in s)
12
+ i[a] = u(i[a], s[a]);
13
+ return i;
13
14
  } else
14
- return l;
15
+ return s;
15
16
  };
16
- for (const n of r)
17
- t = u(t, n);
18
- return t;
17
+ for (const i of r)
18
+ e = u(e, i);
19
+ return e;
19
20
  };
20
21
  }
21
- const g = h({ array: !1 }), m = h({ array: !0 });
22
- Object.defineProperties(Object, {
22
+ const b = p({ array: !1 }), d = p({ array: !0 });
23
+ l(Object, {
23
24
  isObject: {
24
- value: function(e) {
25
- return Object.prototype.toString.call(e) === "[object Object]";
25
+ value: function(t) {
26
+ return Object.prototype.toString.call(t) === "[object Object]";
26
27
  },
27
- enumerable: !1,
28
- configurable: !0,
29
- writable: !0
28
+ ...n
30
29
  },
31
30
  merge0: {
32
- value: function(...e) {
33
- return g(this, ...e);
31
+ value: function(...t) {
32
+ return b(this, ...t);
34
33
  },
35
- enumerable: !1,
36
- configurable: !0,
37
- writable: !0
34
+ ...n
38
35
  },
39
36
  concat0: {
40
- value: function(...e) {
41
- return m(this, ...e);
37
+ value: function(...t) {
38
+ return d(this, ...t);
42
39
  },
43
- enumerable: !1,
44
- configurable: !0,
45
- writable: !0
40
+ ...n
46
41
  }
47
42
  });
48
- Object.defineProperties(Object.prototype, {
43
+ l(Object.prototype, {
49
44
  clone0: {
50
45
  value: function() {
51
46
  return JSON.parse(JSON.stringify(this));
52
47
  },
53
- enumerable: !1,
54
- configurable: !0,
55
- writable: !0
48
+ ...n
56
49
  },
57
50
  length0: {
58
51
  value: function() {
59
52
  return Object.keys(this).length;
60
53
  },
61
- enumerable: !1,
62
- configurable: !0,
63
- writable: !0
54
+ ...n
64
55
  },
65
56
  entries0: {
66
57
  value: function() {
67
58
  return Object.entries(this);
68
59
  },
69
- enumerable: !1,
70
- configurable: !0,
71
- writable: !0
60
+ ...n
72
61
  },
73
62
  keys0: {
74
63
  value: function() {
75
64
  return Object.keys(this);
76
65
  },
77
- enumerable: !1,
78
- configurable: !0,
79
- writable: !0
66
+ ...n
80
67
  },
81
68
  values0: {
82
69
  value: function() {
83
70
  return Object.values(this);
84
71
  },
85
- enumerable: !1,
86
- configurable: !0,
87
- writable: !0
72
+ ...n
88
73
  },
89
74
  merge0: {
90
- value: function(...e) {
91
- return g(this, ...e);
75
+ value: function(...t) {
76
+ return b(this, ...t);
92
77
  },
93
- enumerable: !1,
94
- configurable: !0,
95
- writable: !0
78
+ ...n
96
79
  },
97
80
  concat0: {
98
- value: function(...e) {
99
- return m(this, ...e);
81
+ value: function(...t) {
82
+ return d(this, ...t);
100
83
  },
101
- enumerable: !1,
102
- configurable: !0,
103
- writable: !0
84
+ ...n
104
85
  },
105
86
  map0: {
106
- value: function(e = (r, u, n) => [r, u], t = 0) {
107
- return Object.entries(this).map(([r, u]) => e(r, u, t++));
87
+ value: function(t = (r, u, i) => [r, u], e = 0) {
88
+ return Object.entries(this).map(([r, u]) => t(r, u, e++));
108
89
  },
109
- enumerable: !1,
110
- configurable: !0,
111
- writable: !0
90
+ ...n
112
91
  },
113
92
  pick0: {
114
- value: function(...e) {
115
- const t = {};
116
- for (const r of e)
117
- t[r] = this[r];
118
- return t;
93
+ value: function(...t) {
94
+ const e = {};
95
+ for (const r of t)
96
+ e[r] = this[r];
97
+ return e;
119
98
  },
120
- enumerable: !1,
121
- configurable: !0,
122
- writable: !0
99
+ ...n
123
100
  },
124
101
  omit0: {
125
- value: function(...e) {
126
- const t = {}, r = new Set(e);
102
+ value: function(...t) {
103
+ const e = {}, r = new Set(t);
127
104
  for (const u in this)
128
- r.has(u) || (t[u] = this[u]);
129
- return t;
105
+ r.has(u) || (e[u] = this[u]);
106
+ return e;
130
107
  },
131
- enumerable: !1,
132
- configurable: !0,
133
- writable: !0
108
+ ...n
134
109
  },
135
110
  attr0: {
136
- value: function(e, ...t) {
137
- return typeof this != "object" ? this : typeof e == "function" ? e(this, ...t) : this[e];
111
+ value: function(t, ...e) {
112
+ return typeof this != "object" ? this : typeof t == "function" ? t(this, ...e) : this[t];
138
113
  },
139
- enumerable: !1,
140
- configurable: !0,
141
- writable: !0
114
+ ...n
142
115
  },
143
116
  log0: {
144
- value: function(...e) {
145
- return console.log(...e, this), this;
117
+ value: function(...t) {
118
+ return console.log(...t, this), this;
146
119
  },
147
- enumerable: !1,
148
- configurable: !0,
149
- writable: !0
120
+ ...n
150
121
  },
151
122
  debug0: {
152
- value: function(...e) {
153
- return console.debug(...e, this), this;
123
+ value: function(...t) {
124
+ return console.debug(...t, this), this;
154
125
  },
155
- enumerable: !1,
156
- configurable: !0,
157
- writable: !0
126
+ ...n
158
127
  },
159
128
  // ====== Tree ======
160
129
  getParents0: {
161
- value: function(e = !1, t = -1, r = "parent") {
162
- const u = e ? [this] : [];
163
- let n = this[r];
164
- for (; n && t-- != 0; )
165
- u.push(n), n = n[r];
130
+ value: function(t = !1, e = -1, r = "parent") {
131
+ const u = t ? [this] : [];
132
+ let i = this[r];
133
+ for (; i && e-- != 0; )
134
+ u.push(i), i = i[r];
166
135
  return u;
167
136
  },
168
- enumerable: !1,
169
- configurable: !0,
170
- writable: !0
137
+ ...n
171
138
  },
172
139
  getChildrens0: {
173
- value: function(e = !1, t = -1, r = "children") {
174
- const u = [], n = (l, a, f) => {
175
- if (a && u.push(l), !(f == 0 || !l[r] || l[r].length == 0))
176
- for (const o of l[r])
177
- n(o, !0, f - 1);
140
+ value: function(t = !1, e = -1, r = "children") {
141
+ const u = [], i = (s, o, f) => {
142
+ if (o && u.push(s), !(f == 0 || !s[r] || s[r].length == 0))
143
+ for (const a of s[r])
144
+ i(a, !0, f - 1);
178
145
  };
179
- return n(this, e, t), u;
146
+ return i(this, t, e), u;
180
147
  },
181
- enumerable: !1,
182
- configurable: !0,
183
- writable: !0
148
+ ...n
184
149
  },
185
150
  treeFind0: {
186
- value: function(e, t = !0, r = -1, u = "children") {
187
- if (t && e(this))
151
+ value: function(t, e = !0, r = -1, u = "children") {
152
+ if (e && t(this))
188
153
  return this;
189
154
  if (r == 0 || !this[u] || this[u].length == 0)
190
155
  return null;
191
- for (const n of this[u]) {
192
- const l = n.treeFind0(e, !0, r - 1, u);
193
- if (l !== null)
194
- return l;
156
+ for (const i of this[u]) {
157
+ const s = i.treeFind0(t, !0, r - 1, u);
158
+ if (s !== null)
159
+ return s;
195
160
  }
196
161
  return null;
197
162
  },
198
- enumerable: !1,
199
- configurable: !0,
200
- writable: !0
163
+ ...n
201
164
  },
202
165
  treeEach0: {
203
- value: function(e, t = !0, r = -1, u = "children") {
204
- if (t && e(this), !(r == 0 || !this[u] || this[u].length == 0)) {
205
- for (const n of this[u])
206
- n.treeEach0(e, !0, r - 1, u);
166
+ value: function(t, e = !0, r = -1, u = "children") {
167
+ if (e && t(this), !(r == 0 || !this[u] || this[u].length == 0)) {
168
+ for (const i of this[u])
169
+ i.treeEach0(t, !0, r - 1, u);
207
170
  return this;
208
171
  }
209
172
  },
210
- enumerable: !1,
211
- configurable: !0,
212
- writable: !0
173
+ ...n
213
174
  },
214
175
  treeMap0: {
215
- value: function(e, t = !0, r = -1, u = "children", n = null) {
216
- const l = t ? e(this) : this, a = [];
176
+ value: function(t, e = !0, r = -1, u = "children", i = null) {
177
+ const s = e ? t(this) : this, o = [];
217
178
  if (r == 0 || !this[u] || this[u].length == 0)
218
- return l;
179
+ return s;
219
180
  for (const f of this[u])
220
- a.push(f.treeMap0(e, !0, r - 1, u, n));
221
- return l[u] = a, l;
181
+ o.push(f.treeMap0(t, !0, r - 1, u, i));
182
+ return s[u] = o, s;
222
183
  },
223
- enumerable: !1,
224
- configurable: !0,
225
- writable: !0
184
+ ...n
226
185
  }
227
186
  });
228
- Object.defineProperties(Number.prototype, {
187
+ l(Number.prototype, {
229
188
  ceil: {
230
189
  value: function() {
231
190
  return Math.ceil(this);
232
191
  },
233
- enumerable: !1,
234
- configurable: !0,
235
- writable: !0
192
+ ...n
236
193
  },
237
194
  floor: {
238
195
  value: function() {
239
196
  return Math.floor(this);
240
197
  },
241
- enumerable: !1,
242
- configurable: !0,
243
- writable: !0
198
+ ...n
244
199
  },
245
200
  round: {
246
- value: function(e = 0) {
247
- return e == 0 ? Math.round(this) : Math.round(this * 10 ** e) / 10 ** e;
201
+ value: function(t = 0) {
202
+ return t == 0 ? Math.round(this) : Math.round(this * 10 ** t) / 10 ** t;
248
203
  },
249
- enumerable: !1,
250
- configurable: !0,
251
- writable: !0
204
+ ...n
252
205
  },
253
206
  trunc: {
254
207
  value: function() {
255
208
  return Math.trunc(this);
256
209
  },
257
- enumerable: !1,
258
- configurable: !0,
259
- writable: !0
210
+ ...n
260
211
  },
261
212
  abs: {
262
213
  value: function() {
263
214
  return Math.abs(this);
264
215
  },
265
- enumerable: !1,
266
- configurable: !0,
267
- writable: !0
216
+ ...n
268
217
  },
269
218
  max: {
270
- value: function(...e) {
271
- return Math.max(this, ...e);
219
+ value: function(...t) {
220
+ return Math.max(this, ...t);
272
221
  },
273
- enumerable: !1,
274
- configurable: !0,
275
- writable: !0
222
+ ...n
276
223
  },
277
224
  min: {
278
- value: function(...e) {
279
- return Math.min(this, ...e);
225
+ value: function(...t) {
226
+ return Math.min(this, ...t);
280
227
  },
281
- enumerable: !1,
282
- configurable: !0,
283
- writable: !0
228
+ ...n
284
229
  },
285
230
  baseConvert: {
286
- value: function(e = 64) {
287
- let t = "", r = this, u = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";
231
+ value: function(t = 64) {
232
+ let e = "", r = this, u = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";
288
233
  for (; r > 0; )
289
- t = u.at(r % e) + t, r = Math.floor(r / e);
290
- return t || "0";
234
+ e = u.at(r % t) + e, r = Math.floor(r / t);
235
+ return e || "0";
291
236
  },
292
- enumerable: !1,
293
- configurable: !0,
294
- writable: !0
237
+ ...n
295
238
  },
296
239
  toFixed0: {
297
- value: function(...e) {
298
- return +this.toFixed(...e);
240
+ value: function(...t) {
241
+ return +this.toFixed(...t);
299
242
  },
300
- enumerable: !1,
301
- configurable: !0,
302
- writable: !0
243
+ ...n
303
244
  },
304
245
  toDate: {
305
246
  value: function() {
306
247
  return Date.new(this);
307
248
  },
308
- enumerable: !1,
309
- configurable: !0,
310
- writable: !0
249
+ ...n
311
250
  }
312
251
  });
313
- Object.defineProperties(BigInt.prototype, {
252
+ l(BigInt.prototype, {
314
253
  toJSON: {
315
254
  value: function() {
316
255
  return this > 9007199254740991n || this < -9007199254740991n ? this.toString() : Number(this);
317
256
  },
318
- enumerable: !1,
319
- configurable: !0,
320
- writable: !0
257
+ ...n
321
258
  }
322
259
  });
323
- Object.defineProperties(String.prototype, {
260
+ l(String.prototype, {
324
261
  length0: {
325
262
  value: function() {
326
263
  return this.length;
327
264
  },
328
- enumerable: !1,
329
- configurable: !0,
330
- writable: !0
265
+ ...n
331
266
  },
332
267
  substring0: {
333
- value: function(e = 0, t = this.length) {
334
- return e = e >= 0 ? e : this.length + e, t = t >= 0 ? t : this.length + t, this.substring(e, t);
268
+ value: function(t = 0, e = this.length) {
269
+ return t = t >= 0 ? t : this.length + t, e = e >= 0 ? e : this.length + e, this.substring(t, e);
335
270
  },
336
- enumerable: !1,
337
- configurable: !0,
338
- writable: !0
271
+ ...n
339
272
  },
340
273
  substr0: {
341
- value: function(e = 0, t = this.length) {
342
- return e = e >= 0 ? e : this.length + e, t = e + t, this.substring(e, t);
274
+ value: function(t = 0, e = this.length) {
275
+ return t = t >= 0 ? t : this.length + t, e = t + e, this.substring(t, e);
343
276
  },
344
- enumerable: !1,
345
- configurable: !0,
346
- writable: !0
277
+ ...n
347
278
  },
348
279
  split0: {
349
- value: function(e = ",", t = -1) {
350
- const r = this ? this.split(e) : [];
351
- return t === -1 ? r : r.push0(r.splice(t - 1).join(e));
280
+ value: function(t = ",", e = -1) {
281
+ const r = this ? this.split(t) : [];
282
+ return e === -1 ? r : r.push0(r.splice(e - 1).join(t));
352
283
  },
353
- enumerable: !1,
354
- configurable: !0,
355
- writable: !0
284
+ ...n
356
285
  },
357
286
  splitNumber: {
358
- value: function(e = ",") {
359
- return this.split0(e).map((t) => +t);
287
+ value: function(t = ",") {
288
+ return this.split0(t).map((e) => +e);
360
289
  },
361
- enumerable: !1,
362
- configurable: !0,
363
- writable: !0
290
+ ...n
364
291
  },
365
292
  splitSegment: {
366
- value: function(e = 1) {
367
- const t = [];
368
- for (let r = 0; r < this.length; r += e)
369
- t.push(this.substring(r, e));
370
- return t;
293
+ value: function(t = 1) {
294
+ const e = [];
295
+ for (let r = 0; r < this.length; r += t)
296
+ e.push(this.substring(r, t));
297
+ return e;
371
298
  },
372
- enumerable: !1,
373
- configurable: !0,
374
- writable: !0
299
+ ...n
375
300
  },
376
301
  sprintf: {
377
- value: function(...e) {
378
- let [t, ...r] = this.split(/%[sd]/);
302
+ value: function(...t) {
303
+ let [e, ...r] = this.split(/%[sd]/);
379
304
  for (let u = 0; u < r.length; u++)
380
- t += e[u] + r[u];
381
- return t;
305
+ e += t[u] + r[u];
306
+ return e;
382
307
  },
383
- enumerable: !1,
384
- configurable: !0,
385
- writable: !0
308
+ ...n
386
309
  },
387
310
  subOf: {
388
- value: function(e, t, r = 0, u = 0) {
389
- for (let a = 0; a < r && u != -1; a++, u++)
390
- u = this.indexOf(e, u);
391
- let n = this.indexOf(e, u), l = this.indexOf(t, n);
392
- return n == -1 || l == -1 ? "" : (n += e.length, this.substring(n, l));
311
+ value: function(t, e, r = 0, u = 0) {
312
+ for (let o = 0; o < r && u != -1; o++, u++)
313
+ u = this.indexOf(t, u);
314
+ let i = this.indexOf(t, u), s = this.indexOf(e, i);
315
+ return i == -1 || s == -1 ? "" : (i += t.length, this.substring(i, s));
393
316
  },
394
- enumerable: !1,
395
- configurable: !0,
396
- writable: !0
317
+ ...n
397
318
  },
398
319
  lastSubOf: {
399
- value: function(e, t, r = 0, u = 1 / 0) {
400
- for (let a = 0; a < r && u != -1; a++, u--)
401
- u = this.lastIndexOf(e, u);
402
- let n = this.lastIndexOf(e, u), l = this.indexOf(t, n);
403
- return n == -1 || l == -1 ? "" : (n += e.length, this.substring(n, l));
320
+ value: function(t, e, r = 0, u = 1 / 0) {
321
+ for (let o = 0; o < r && u != -1; o++, u--)
322
+ u = this.lastIndexOf(t, u);
323
+ let i = this.lastIndexOf(t, u), s = this.indexOf(e, i);
324
+ return i == -1 || s == -1 ? "" : (i += t.length, this.substring(i, s));
404
325
  },
405
- enumerable: !1,
406
- configurable: !0,
407
- writable: !0
326
+ ...n
408
327
  },
409
328
  camel2under: {
410
329
  value: function() {
411
- return this.substr(0, 1).toLowerCase() + this.substr(1).replace(/([A-Z])/g, (e, t) => "_" + t.toLowerCase());
330
+ return this.substr(0, 1).toLowerCase() + this.substr(1).replace(/([A-Z])/g, (t, e) => "_" + e.toLowerCase());
412
331
  },
413
- enumerable: !1,
414
- configurable: !0,
415
- writable: !0
332
+ ...n
416
333
  },
417
334
  under2camel: {
418
335
  value: function() {
419
- return this.replace(/_([a-z])/g, (e, t) => t.toUpperCase());
336
+ return this.replace(/_([a-z])/g, (t, e) => e.toUpperCase());
420
337
  },
421
- enumerable: !1,
422
- configurable: !0,
423
- writable: !0
338
+ ...n
424
339
  },
425
340
  camel2pascal: {
426
341
  value: function() {
427
342
  return this.substr(0, 1).toUpperCase() + this.substr(1);
428
343
  },
429
- enumerable: !1,
430
- configurable: !0,
431
- writable: !0
344
+ ...n
432
345
  },
433
346
  pascal2camel: {
434
347
  value: function() {
435
348
  return this.substr(0, 1).toLowerCase() + this.substr(1);
436
349
  },
437
- enumerable: !1,
438
- configurable: !0,
439
- writable: !0
350
+ ...n
440
351
  },
441
352
  under2kebab: {
442
353
  value: function() {
443
354
  return this.replace(/_/g, "-");
444
355
  },
445
- enumerable: !1,
446
- configurable: !0,
447
- writable: !0
356
+ ...n
448
357
  },
449
358
  kebab2under: {
450
359
  value: function() {
451
360
  return this.replace(/-/g, "_");
452
361
  },
453
- enumerable: !1,
454
- configurable: !0,
455
- writable: !0
362
+ ...n
456
363
  },
457
364
  baseConvert: {
458
- value: function(e = 64) {
459
- let t = 0, r = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";
365
+ value: function(t = 64) {
366
+ let e = 0, r = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";
460
367
  for (let u = 0; u < this.length; u++)
461
- t = t * e + r.indexOf(this.at(u));
462
- return t;
368
+ e = e * t + r.indexOf(this.at(u));
369
+ return e;
463
370
  },
464
- enumerable: !1,
465
- configurable: !0,
466
- writable: !0
371
+ ...n
467
372
  },
468
373
  toFixed0: {
469
- value: function(...e) {
470
- return +(+this).toFixed(...e);
374
+ value: function(...t) {
375
+ return +(+this).toFixed(...t);
471
376
  },
472
- enumerable: !1,
473
- configurable: !0,
474
- writable: !0
377
+ ...n
475
378
  },
476
379
  toDate: {
477
380
  value: function() {
478
381
  return Date.new(this);
479
382
  },
480
- enumerable: !1,
481
- configurable: !0,
482
- writable: !0
383
+ ...n
483
384
  },
484
385
  hex2bytes: {
485
386
  value: function() {
486
- const e = [];
487
- for (let t = 0; t < this.length; t += 2)
488
- e.push(Number.parseInt(this.substring(t, t + 2), 16));
489
- return e;
387
+ const t = [];
388
+ for (let e = 0; e < this.length; e += 2)
389
+ t.push(Number.parseInt(this.substring(e, e + 2), 16));
390
+ return t;
490
391
  },
491
- enumerable: !1,
492
- configurable: !0,
493
- writable: !0
392
+ ...n
494
393
  },
495
394
  string2bytes: {
496
395
  value: function() {
497
396
  if (typeof TextEncoder < "u")
498
397
  return Array.from(new TextEncoder().encode(this));
499
- const e = [], t = encodeURIComponent(this);
500
- for (let r = 0; r < t.length; )
501
- e.push(t.charAt(r) == "%" ? Number.parseInt(t.substring(r + 1, r += 3), 16) : t.charCodeAt(r++));
502
- return e;
398
+ const t = [], e = encodeURIComponent(this);
399
+ for (let r = 0; r < e.length; )
400
+ t.push(e.charAt(r) == "%" ? Number.parseInt(e.substring(r + 1, r += 3), 16) : e.charCodeAt(r++));
401
+ return t;
503
402
  },
504
- enumerable: !1,
505
- configurable: !0,
506
- writable: !0
403
+ ...n
507
404
  },
508
405
  base64decode: {
509
- value: function(e) {
510
- const t = [], r = {}, u = e === !0 ? "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_" : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
511
- for (let l = 0; l < u.length; l++)
512
- r[u.charAt(l)] = l;
513
- const n = this.charAt(this.length - 1) != "=" ? this.length : this.charAt(this.length - 2) != "=" ? this.length - 1 : this.length - 2;
514
- for (let l = 3; l < n; l += 4) {
515
- const a = (r[this.charAt(l - 3)] << 18) + (r[this.charAt(l - 2)] << 12) + (r[this.charAt(l - 1)] << 6) + r[this.charAt(l)];
516
- t.push((a & 16711680) >> 16, (a & 65280) >> 8, a & 255);
406
+ value: function(t) {
407
+ const e = [], r = {}, u = t === !0 ? "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_" : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
408
+ for (let s = 0; s < u.length; s++)
409
+ r[u.charAt(s)] = s;
410
+ const i = this.charAt(this.length - 1) != "=" ? this.length : this.charAt(this.length - 2) != "=" ? this.length - 1 : this.length - 2;
411
+ for (let s = 3; s < i; s += 4) {
412
+ const o = (r[this.charAt(s - 3)] << 18) + (r[this.charAt(s - 2)] << 12) + (r[this.charAt(s - 1)] << 6) + r[this.charAt(s)];
413
+ e.push((o & 16711680) >> 16, (o & 65280) >> 8, o & 255);
517
414
  }
518
- if (n % 4 == 3) {
519
- const l = (r[this.charAt(n - 3)] << 18) + (r[this.charAt(n - 2)] << 12) + (r[this.charAt(n - 1)] << 6);
520
- t.push((l & 16711680) >> 16, (l & 65280) >> 8);
521
- } else if (n % 4 == 2) {
522
- const l = (r[this.charAt(n - 2)] << 18) + (r[this.charAt(n - 1)] << 12);
523
- t.push((l & 16711680) >> 16);
415
+ if (i % 4 == 3) {
416
+ const s = (r[this.charAt(i - 3)] << 18) + (r[this.charAt(i - 2)] << 12) + (r[this.charAt(i - 1)] << 6);
417
+ e.push((s & 16711680) >> 16, (s & 65280) >> 8);
418
+ } else if (i % 4 == 2) {
419
+ const s = (r[this.charAt(i - 2)] << 18) + (r[this.charAt(i - 1)] << 12);
420
+ e.push((s & 16711680) >> 16);
524
421
  }
525
- return t;
422
+ return e;
526
423
  },
527
- enumerable: !1,
528
- configurable: !0,
529
- writable: !0
424
+ ...n
530
425
  }
531
426
  });
532
- typeof Iterator < "u" && Object.defineProperties(Iterator.prototype, {
427
+ typeof Iterator < "u" && l(Iterator.prototype, {
533
428
  toArray: {
534
429
  value: function() {
535
430
  return Array.from(this);
536
431
  },
537
- enumerable: !1,
538
- configurable: !0,
539
- writable: !0
432
+ ...n
540
433
  }
541
434
  });
542
- Object.defineProperties(Array.prototype, {
435
+ l(Array.prototype, {
543
436
  length0: {
544
437
  value: function() {
545
438
  return this.length;
546
439
  },
547
- enumerable: !1,
548
- configurable: !0,
549
- writable: !0
440
+ ...n
550
441
  },
551
442
  entries0: {
552
443
  value: function() {
553
444
  return this.entries();
554
445
  },
555
- enumerable: !1,
556
- configurable: !0,
557
- writable: !0
446
+ ...n
558
447
  },
559
448
  push0: {
560
- value: function(...e) {
561
- return this.push(...e), this;
449
+ value: function(...t) {
450
+ return this.push(...t), this;
562
451
  },
563
- enumerable: !1,
564
- configurable: !0,
565
- writable: !0
452
+ ...n
566
453
  },
567
454
  push1: {
568
- value: function(...e) {
569
- return this.push(...e), e[0];
455
+ value: function(...t) {
456
+ return this.push(...t), t[0];
570
457
  },
571
- enumerable: !1,
572
- configurable: !0,
573
- writable: !0
458
+ ...n
574
459
  },
575
460
  push3: {
576
- value: function(...e) {
577
- return this.push(...e), e;
461
+ value: function(...t) {
462
+ return this.push(...t), t;
578
463
  },
579
- enumerable: !1,
580
- configurable: !0,
581
- writable: !0
464
+ ...n
582
465
  },
583
466
  pop0: {
584
- value: function(...e) {
585
- return this.pop(...e), this;
467
+ value: function(...t) {
468
+ return this.pop(...t), this;
586
469
  },
587
- enumerable: !1,
588
- configurable: !0,
589
- writable: !0
470
+ ...n
590
471
  },
591
472
  pop1: {
592
- value: function(...e) {
593
- return this.pop(...e), e[0];
473
+ value: function(...t) {
474
+ return this.pop(...t), t[0];
594
475
  },
595
- enumerable: !1,
596
- configurable: !0,
597
- writable: !0
476
+ ...n
598
477
  },
599
478
  pop3: {
600
- value: function(...e) {
601
- return this.pop(...e), e;
479
+ value: function(...t) {
480
+ return this.pop(...t), t;
602
481
  },
603
- enumerable: !1,
604
- configurable: !0,
605
- writable: !0
482
+ ...n
606
483
  },
607
484
  unshift0: {
608
- value: function(...e) {
609
- return this.unshift(...e), this;
485
+ value: function(...t) {
486
+ return this.unshift(...t), this;
610
487
  },
611
- enumerable: !1,
612
- configurable: !0,
613
- writable: !0
488
+ ...n
614
489
  },
615
490
  unshift1: {
616
- value: function(...e) {
617
- return this.unshift(...e), e[0];
491
+ value: function(...t) {
492
+ return this.unshift(...t), t[0];
618
493
  },
619
- enumerable: !1,
620
- configurable: !0,
621
- writable: !0
494
+ ...n
622
495
  },
623
496
  unshift3: {
624
- value: function(...e) {
625
- return this.unshift(...e), e;
497
+ value: function(...t) {
498
+ return this.unshift(...t), t;
626
499
  },
627
- enumerable: !1,
628
- configurable: !0,
629
- writable: !0
500
+ ...n
630
501
  },
631
502
  shift0: {
632
- value: function(...e) {
633
- return this.shift(...e), this;
503
+ value: function(...t) {
504
+ return this.shift(...t), this;
634
505
  },
635
- enumerable: !1,
636
- configurable: !0,
637
- writable: !0
506
+ ...n
638
507
  },
639
508
  shift1: {
640
- value: function(...e) {
641
- return this.shift(...e), e[0];
509
+ value: function(...t) {
510
+ return this.shift(...t), t[0];
642
511
  },
643
- enumerable: !1,
644
- configurable: !0,
645
- writable: !0
512
+ ...n
646
513
  },
647
514
  shift3: {
648
- value: function(...e) {
649
- return this.shift(...e), e;
515
+ value: function(...t) {
516
+ return this.shift(...t), t;
650
517
  },
651
- enumerable: !1,
652
- configurable: !0,
653
- writable: !0
518
+ ...n
654
519
  },
655
520
  first0: {
656
- value: function(e = null) {
657
- return this.length ? this[0] : e;
521
+ value: function(t = null) {
522
+ return this.length ? this[0] : t;
658
523
  },
659
- enumerable: !1,
660
- configurable: !0,
661
- writable: !0
524
+ ...n
662
525
  },
663
526
  last0: {
664
- value: function(e = null) {
665
- return this.length ? this[this.length - 1] : e;
527
+ value: function(t = null) {
528
+ return this.length ? this[this.length - 1] : t;
666
529
  },
667
- enumerable: !1,
668
- configurable: !0,
669
- writable: !0
530
+ ...n
670
531
  },
671
532
  find0: {
672
- value: function(e, t = null) {
673
- return this.find(e) ?? t;
533
+ value: function(t, e = null) {
534
+ return this.find(t) ?? e;
674
535
  },
675
- enumerable: !1,
676
- configurable: !0,
677
- writable: !0
536
+ ...n
678
537
  },
679
538
  equals0: {
680
- value: function(e) {
681
- return this.length === e.length && (this === e || this.length === 0 || this.every((t, r) => t === e[r]));
539
+ value: function(t) {
540
+ return this.length === t.length && (this === t || this.length === 0 || this.every((e, r) => e === t[r]));
682
541
  },
683
- enumerable: !1,
684
- configurable: !0,
685
- writable: !0
542
+ ...n
686
543
  },
687
544
  unique0: {
688
- value: function(e = (t) => t) {
689
- const t = /* @__PURE__ */ new Set();
690
- return this.filter((r) => t.has(e(r)) ? !1 : !!t.add(e(r)));
545
+ value: function(t = (e) => e) {
546
+ const e = /* @__PURE__ */ new Set();
547
+ return this.filter((r) => e.has(t(r)) ? !1 : !!e.add(t(r)));
691
548
  },
692
- enumerable: !1,
693
- configurable: !0,
694
- writable: !0
549
+ ...n
695
550
  },
696
551
  each0: {
697
- value: function(e) {
698
- return this.forEach(e), this;
552
+ value: function(t) {
553
+ return this.forEach(t), this;
699
554
  },
700
- enumerable: !1,
701
- configurable: !0,
702
- writable: !0
555
+ ...n
703
556
  },
704
557
  toObject: {
705
- value: function(e = (t, r) => [r, t]) {
706
- return Object.fromEntries(this.map(e));
558
+ value: function(t = (e, r) => [r, e]) {
559
+ return Object.fromEntries(this.map(t));
707
560
  },
708
- enumerable: !1,
709
- configurable: !0,
710
- writable: !0
561
+ ...n
711
562
  },
712
563
  toMap: {
713
- value: function(e = (t, r) => [r, t]) {
714
- return new Map(this.map(e));
564
+ value: function(t = (e, r) => [r, e]) {
565
+ return new Map(this.map(t));
715
566
  },
716
- enumerable: !1,
717
- configurable: !0,
718
- writable: !0
567
+ ...n
719
568
  },
720
569
  toSet: {
721
570
  value: function() {
722
571
  return new Set(this);
723
572
  },
724
- enumerable: !1,
725
- configurable: !0,
726
- writable: !0
573
+ ...n
727
574
  },
728
575
  toGroup: {
729
- value: function(e = (t) => [t.id, t]) {
730
- const t = {};
576
+ value: function(t = (e) => [e.id, e]) {
577
+ const e = {};
731
578
  for (const r of this) {
732
- const [u, n] = e(r);
733
- u in t || (t[u] = []), t[u].push(n);
579
+ const [u, i] = t(r);
580
+ u in e || (e[u] = []), e[u].push(i);
734
581
  }
735
- return t;
582
+ return e;
736
583
  },
737
- enumerable: !1,
738
- configurable: !0,
739
- writable: !0
584
+ ...n
740
585
  },
741
586
  toMerge: {
742
- value: function(e = (u) => u.id, t = (u) => ({ ...u, children: u.children || [] }), r = (u, n) => u.children.push(n)) {
587
+ value: function(t = (u) => u.id, e = (u) => ({ ...u, children: u.children || [] }), r = (u, i) => u.children.push(i)) {
743
588
  const u = [];
744
- for (const n of this)
745
- r(u.find((l) => e(l) == e(n)) ?? u.push1(t(n)), n);
589
+ for (const i of this)
590
+ r(u.find((s) => t(s) == t(i)) ?? u.push1(e(i)), i);
746
591
  return u;
747
592
  },
748
- enumerable: !1,
749
- configurable: !0,
750
- writable: !0
593
+ ...n
751
594
  },
752
595
  bytes2hex: {
753
596
  value: function() {
754
- let e = "";
755
- for (let t = 0; t < this.length; t++)
756
- e += (this[t] < 16 ? "0" : "") + this[t].toString(16);
757
- return e;
597
+ let t = "";
598
+ for (let e = 0; e < this.length; e++)
599
+ t += (this[e] < 16 ? "0" : "") + this[e].toString(16);
600
+ return t;
758
601
  },
759
- enumerable: !1,
760
- configurable: !0,
761
- writable: !0
602
+ ...n
762
603
  },
763
604
  bytes2string: {
764
605
  value: function() {
765
606
  if (typeof TextDecoder < "u")
766
607
  return new TextDecoder().decode(new Uint8Array(this));
767
- let e = "";
768
- for (let t = 0; t < this.length; t++)
769
- e += "%" + (this[t] < 16 ? "0" : "") + this[t].toString(16);
770
- return decodeURIComponent(e);
608
+ let t = "";
609
+ for (let e = 0; e < this.length; e++)
610
+ t += "%" + (this[e] < 16 ? "0" : "") + this[e].toString(16);
611
+ return decodeURIComponent(t);
771
612
  },
772
- enumerable: !1,
773
- configurable: !0,
774
- writable: !0
613
+ ...n
775
614
  },
776
615
  base64encode: {
777
- value: function(e = !1, t = !0) {
778
- let r = "", u = e === !0 ? "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_" : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
779
- for (let n = 2; n < this.length; n += 3) {
780
- const l = (this[n - 2] << 16) + (this[n - 1] << 8) + this[n];
781
- r += u.charAt((l & 16515072) >> 18) + u.charAt((l & 258048) >> 12) + u.charAt((l & 4032) >> 6) + u.charAt(l & 63);
616
+ value: function(t = !1, e = !0) {
617
+ let r = "", u = t === !0 ? "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_" : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
618
+ for (let i = 2; i < this.length; i += 3) {
619
+ const s = (this[i - 2] << 16) + (this[i - 1] << 8) + this[i];
620
+ r += u.charAt((s & 16515072) >> 18) + u.charAt((s & 258048) >> 12) + u.charAt((s & 4032) >> 6) + u.charAt(s & 63);
782
621
  }
783
622
  if (this.length % 3 == 2) {
784
- const n = (this[this.length - 2] << 16) + (this[this.length - 1] << 8);
785
- r += u.charAt((n & 16515072) >> 18) + u.charAt((n & 258048) >> 12) + u.charAt((n & 4032) >> 6) + (t === !1 ? "" : "=");
623
+ const i = (this[this.length - 2] << 16) + (this[this.length - 1] << 8);
624
+ r += u.charAt((i & 16515072) >> 18) + u.charAt((i & 258048) >> 12) + u.charAt((i & 4032) >> 6) + (e === !1 ? "" : "=");
786
625
  } else if (this.length % 3 == 1) {
787
- const n = this[this.length - 1] << 16;
788
- r += u.charAt((n & 16515072) >> 18) + u.charAt((n & 258048) >> 12) + (t === !1 ? "" : "==");
626
+ const i = this[this.length - 1] << 16;
627
+ r += u.charAt((i & 16515072) >> 18) + u.charAt((i & 258048) >> 12) + (e === !1 ? "" : "==");
789
628
  }
790
629
  return r;
791
630
  },
792
- enumerable: !1,
793
- configurable: !0,
794
- writable: !0
631
+ ...n
795
632
  },
796
633
  toUint8Array: {
797
634
  value: function() {
798
635
  return new Uint8Array(this);
799
636
  },
800
- enumerable: !1,
801
- configurable: !0,
802
- writable: !0
637
+ ...n
803
638
  },
804
639
  // ====== Relational ======
805
640
  assoc: {
806
- value: function(e, t, r = {}) {
807
- const u = this.unique0((l) => l[e]), n = u.length == 0 ? {} : typeof r == "function" ? r(u) : r;
808
- return this.each0((l) => l[t] = n[l[e]] ?? null);
641
+ value: function(t, e, r = {}) {
642
+ const u = this.unique0((s) => s[t]), i = u.length == 0 ? {} : typeof r == "function" ? r(u) : r;
643
+ return this.each0((s) => s[e] = i[s[t]] ?? null);
809
644
  },
810
- enumerable: !1,
811
- configurable: !0,
812
- writable: !0
645
+ ...n
813
646
  },
814
647
  // ====== Tree ======
815
648
  toTree: {
816
- value: function(e = {}) {
817
- const { id: t = "id", pid: r = "pid", level: u = "level", root: n = "root", parent: l = "parent", children: a = "children", empty: f = null, hasRoot: o = !0 } = e, c = this.toObject((i) => [i[t], i]), b = this.toGroup((i) => [i[r], i]), s = this.length && o ? this.find((i) => i[r] === 0) : { [t]: 0, [r]: -1, [n]: null, [l]: null, [a]: b[0] };
818
- Object.defineProperties(s, { [n]: { value: s, enumerable: !1, configurable: !0, writable: !0 } });
819
- for (const i of this)
820
- Object.defineProperties(i, {
821
- [n]: { value: s, enumerable: !1, configurable: !0, writable: !0 },
822
- [l]: { value: c[i[r]], enumerable: !1, configurable: !0, writable: !0 }
823
- }), i[a] = b[i[t]] ?? f;
824
- return s.treeEach0((i) => i[u] = i[l] ? i[l][u] + 1 : 0, -1, a), s;
825
- },
826
- enumerable: !1,
827
- configurable: !0,
828
- writable: !0
649
+ value: function(t = {}) {
650
+ const { id: e = "id", pid: r = "pid", level: u = "level", root: i = "root", parent: s = "parent", children: o = "children", empty: f = null, hasRoot: a = !0 } = t, v = this.toObject((h) => [h[e], h]), c = this.toGroup((h) => [h[r], h]), g = this.length && a ? this.find((h) => h[r] === 0) : { [e]: 0, [r]: -1, [i]: null, [s]: null, [o]: c[0] };
651
+ l(g, { [i]: { value: g, enumerable: !1, configurable: !0, writable: !0 } });
652
+ for (const h of this)
653
+ l(h, {
654
+ [i]: { value: g, enumerable: !1, configurable: !0, writable: !0 },
655
+ [s]: { value: v[h[r]], enumerable: !1, configurable: !0, writable: !0 }
656
+ }), h[o] = c[h[e]] || f;
657
+ return g.treeEach0((h) => h[u] = h[s] ? h[s][u] + 1 : 0, -1, o), g;
658
+ },
659
+ ...n
829
660
  },
830
661
  tree2tree: {
831
- value: function(e = {}, t = null, r = null) {
832
- var b;
833
- const { id: u = "id", pid: n = "pid", level: l = "level", root: a = "root", parent: f = "parent", children: o = "children", empty: c = null } = e;
834
- t = t ?? { [u]: 0, [n]: -1, [l]: 0, [a]: null, [f]: null, [o]: this }, r = r ?? t;
835
- for (const s of this)
836
- Object.defineProperties(s, {
837
- [a]: { value: t, enumerable: !1, configurable: !0, writable: !0 },
662
+ value: function(t = {}, e = null, r = null) {
663
+ const { id: u = "id", pid: i = "pid", level: s = "level", root: o = "root", parent: f = "parent", children: a = "children", empty: v = null } = t;
664
+ e = e || { [u]: 0, [i]: -1, [s]: 0, [o]: null, [f]: null, [a]: this }, r = r || e;
665
+ for (const c of this)
666
+ l(c, {
667
+ [o]: { value: e, enumerable: !1, configurable: !0, writable: !0 },
838
668
  [f]: { value: r, enumerable: !1, configurable: !0, writable: !0 }
839
- }), s[n] = r[u], s[l] = r[l] + 1, s[o] = s[o] && s[o].length ? s[o] : c, (b = s[o]) == null || b.tree2tree(e, t, s);
840
- return t;
669
+ }), c[i] = r[u], c[s] = r[s] + 1, c[a] = c[a] && c[a].length ? c[a] : v, c[a]?.tree2tree(t, e, c);
670
+ return e;
841
671
  },
842
- enumerable: !1,
843
- configurable: !0,
844
- writable: !0
672
+ ...n
845
673
  },
846
674
  treeFind0: {
847
- value: function(e, t = !0, r = -1, u = "children") {
848
- for (const n of this) {
849
- const l = n.treeFind0(e, t, r, u);
850
- if (l !== null)
851
- return l;
675
+ value: function(t, e = !0, r = -1, u = "children") {
676
+ for (const i of this) {
677
+ const s = i.treeFind0(t, e, r, u);
678
+ if (s !== null)
679
+ return s;
852
680
  }
853
681
  return null;
854
682
  },
855
- enumerable: !1,
856
- configurable: !0,
857
- writable: !0
683
+ ...n
858
684
  },
859
685
  treeEach0: {
860
- value: function(e, t = !0, r = -1, u = "children") {
861
- for (const n of this)
862
- n.treeEach0(e, t, r, u);
686
+ value: function(t, e = !0, r = -1, u = "children") {
687
+ for (const i of this)
688
+ i.treeEach0(t, e, r, u);
863
689
  return this;
864
690
  },
865
- enumerable: !1,
866
- configurable: !0,
867
- writable: !0
691
+ ...n
868
692
  },
869
693
  treeMap0: {
870
- value: function(e, t = !0, r = -1, u = "children", n = null) {
871
- return this.map((l) => l.treeMap0(e, t, r, u, n));
694
+ value: function(t, e = !0, r = -1, u = "children", i = null) {
695
+ return this.map((s) => s.treeMap0(t, e, r, u, i));
872
696
  },
873
- enumerable: !1,
874
- configurable: !0,
875
- writable: !0
697
+ ...n
876
698
  }
877
699
  });
878
- Object.defineProperties(ArrayBuffer.prototype, {
700
+ l(ArrayBuffer.prototype, {
879
701
  toUint8Array: {
880
702
  value: function() {
881
703
  return new Uint8Array(this);
882
704
  },
883
- enumerable: !1,
884
- configurable: !0,
885
- writable: !0
705
+ ...n
886
706
  }
887
707
  });
888
- Object.defineProperties(Uint8Array.prototype, {
708
+ l(Uint8Array.prototype, {
889
709
  bytes2hex: {
890
710
  value: Array.prototype.bytes2hex,
891
- enumerable: !1,
892
- configurable: !0,
893
- writable: !0
711
+ ...n
894
712
  },
895
713
  bytes2string: {
896
714
  value: Array.prototype.bytes2string,
897
- enumerable: !1,
898
- configurable: !0,
899
- writable: !0
715
+ ...n
900
716
  },
901
717
  base64encode: {
902
718
  value: Array.prototype.base64encode,
903
- enumerable: !1,
904
- configurable: !0,
905
- writable: !0
719
+ ...n
906
720
  },
907
721
  toArray: {
908
722
  value: function() {
909
723
  return new Array(...this);
910
724
  },
911
- enumerable: !1,
912
- configurable: !0,
913
- writable: !0
725
+ ...n
914
726
  }
915
727
  });
916
- Object.defineProperties(Map.prototype, {
728
+ l(Map.prototype, {
917
729
  length0: {
918
730
  value: function() {
919
731
  return this.size;
920
732
  },
921
- enumerable: !1,
922
- configurable: !0,
923
- writable: !0
733
+ ...n
924
734
  },
925
735
  entries0: {
926
736
  value: function() {
927
737
  return [...this.entries()];
928
738
  },
929
- enumerable: !1,
930
- configurable: !0,
931
- writable: !0
739
+ ...n
932
740
  },
933
741
  keys0: {
934
742
  value: function() {
935
743
  return [...this.keys()];
936
744
  },
937
- enumerable: !1,
938
- configurable: !0,
939
- writable: !0
745
+ ...n
940
746
  },
941
747
  values0: {
942
748
  value: function() {
943
749
  return [...this.values()];
944
750
  },
945
- enumerable: !1,
946
- configurable: !0,
947
- writable: !0
751
+ ...n
948
752
  },
949
753
  get0: {
950
- value: function(e, t = null, ...r) {
951
- if (this.has(e))
952
- return this.get(e);
953
- const u = typeof t != "function" ? t : t(e, ...r);
954
- return this.set(e, u), u;
754
+ value: function(t, e = null, ...r) {
755
+ if (this.has(t))
756
+ return this.get(t);
757
+ const u = typeof e != "function" ? e : e(t, ...r);
758
+ return this.set(t, u), u;
955
759
  },
956
- enumerable: !1,
957
- configurable: !0,
958
- writable: !0
760
+ ...n
959
761
  },
960
762
  get1: {
961
- value: async function(e, t = null, ...r) {
962
- if (this.has(e))
963
- return this.get(e);
964
- const u = typeof t != "function" ? t : await t(e, ...r);
965
- return this.set(e, u), u;
763
+ value: async function(t, e = null, ...r) {
764
+ if (this.has(t))
765
+ return this.get(t);
766
+ const u = typeof e != "function" ? e : await e(t, ...r);
767
+ return this.set(t, u), u;
966
768
  },
967
- enumerable: !1,
968
- configurable: !0,
969
- writable: !0
769
+ ...n
970
770
  },
971
771
  toObject: {
972
772
  value: function() {
973
773
  return Object.fromEntries(this);
974
774
  },
975
- enumerable: !1,
976
- configurable: !0,
977
- writable: !0
775
+ ...n
978
776
  },
979
777
  toJSON: {
980
778
  value: function() {
981
779
  return [...this];
982
780
  },
983
- enumerable: !1,
984
- configurable: !0,
985
- writable: !0
781
+ ...n
986
782
  }
987
783
  });
988
- Object.defineProperties(Set.prototype, {
784
+ l(Set.prototype, {
989
785
  length0: {
990
786
  value: function() {
991
787
  return this.size;
992
788
  },
993
- enumerable: !1,
994
- configurable: !0,
995
- writable: !0
789
+ ...n
996
790
  },
997
791
  entries0: {
998
792
  value: function() {
999
793
  return this.entries();
1000
794
  },
1001
- enumerable: !1,
1002
- configurable: !0,
1003
- writable: !0
795
+ ...n
1004
796
  },
1005
797
  toArray: {
1006
798
  value: function() {
1007
799
  return [...this];
1008
800
  },
1009
- enumerable: !1,
1010
- configurable: !0,
1011
- writable: !0
801
+ ...n
1012
802
  },
1013
803
  toJSON: {
1014
804
  value: function() {
1015
805
  return [...this];
1016
806
  },
1017
- enumerable: !1,
1018
- configurable: !0,
1019
- writable: !0
807
+ ...n
1020
808
  }
1021
809
  });
1022
- Object.defineProperties(Date, {
810
+ l(Date, {
1023
811
  new: {
1024
- value: function(...e) {
1025
- return e.length != 1 ? new Date(...e) : Number.isNaN(+e[0]) ? new Date(e[0].includes("T") ? e[0] : e[0].replace(/-/g, "/")) : new Date(e[0] > 25e8 ? e[0] : e[0] * 1e3);
812
+ value: function(...t) {
813
+ return t.length != 1 ? new Date(...t) : Number.isNaN(+t[0]) ? new Date(t[0].includes("T") ? t[0] : t[0].replace(/-/g, "/")) : new Date(t[0] > 25e8 ? t[0] : t[0] * 1e3);
1026
814
  },
1027
- enumerable: !1,
1028
- configurable: !0,
1029
- writable: !0
815
+ ...n
1030
816
  },
1031
817
  format: {
1032
- value: function(e = "y-m-d h:i:s") {
1033
- return (/* @__PURE__ */ new Date()).format(e);
818
+ value: function(t = "y-m-d h:i:s") {
819
+ return (/* @__PURE__ */ new Date()).format(t);
1034
820
  },
1035
- enumerable: !1,
1036
- configurable: !0,
1037
- writable: !0
821
+ ...n
1038
822
  },
1039
823
  unix: {
1040
824
  value: function() {
1041
825
  return this.now() / 1e3 | 0;
1042
826
  },
1043
- enumerable: !1,
1044
- configurable: !0,
1045
- writable: !0
827
+ ...n
1046
828
  },
1047
829
  fromUnix: {
1048
- value: function(e = 0) {
1049
- return this.new((e || 0) * 1e3);
830
+ value: function(t = 0) {
831
+ return this.new((t || 0) * 1e3);
1050
832
  },
1051
- enumerable: !1,
1052
- configurable: !0,
1053
- writable: !0
833
+ ...n
1054
834
  },
1055
835
  expr: {
1056
- value: function(e = {}) {
1057
- return (/* @__PURE__ */ new Date()).expr(e);
836
+ value: function(t = {}) {
837
+ return (/* @__PURE__ */ new Date()).expr(t);
1058
838
  },
1059
- enumerable: !1,
1060
- configurable: !0,
1061
- writable: !0
839
+ ...n
1062
840
  },
1063
841
  toDayRange: {
1064
842
  value: function() {
1065
- const e = /* @__PURE__ */ new Date(), t = e.getFullYear(), r = e.getMonth(), u = e.getDate(), n = new Date(t, r, u).getTime() / 1e3 | 0;
1066
- return [n, n + 86400 - 1];
843
+ const t = /* @__PURE__ */ new Date(), e = t.getFullYear(), r = t.getMonth(), u = t.getDate(), i = new Date(e, r, u).getTime() / 1e3 | 0;
844
+ return [i, i + 86400 - 1];
1067
845
  },
1068
- enumerable: !1,
1069
- configurable: !0,
1070
- writable: !0
846
+ ...n
1071
847
  },
1072
848
  toWeekRange: {
1073
849
  value: function() {
1074
- let e = /* @__PURE__ */ new Date();
1075
- for (; e.getDay() != 1; )
1076
- e = new Date(e.getTime() - 86400);
1077
- const t = e.getFullYear(), r = e.getMonth(), u = e.getDate(), n = new Date(t, r, u).getTime() / 1e3 | 0;
1078
- return [n, n + 86400 * 7 - 1];
850
+ let t = /* @__PURE__ */ new Date();
851
+ for (; t.getDay() != 1; )
852
+ t = new Date(t.getTime() - 86400);
853
+ const e = t.getFullYear(), r = t.getMonth(), u = t.getDate(), i = new Date(e, r, u).getTime() / 1e3 | 0;
854
+ return [i, i + 86400 * 7 - 1];
1079
855
  },
1080
- enumerable: !1,
1081
- configurable: !0,
1082
- writable: !0
856
+ ...n
1083
857
  },
1084
858
  toMonthRange: {
1085
859
  value: function() {
1086
- const e = /* @__PURE__ */ new Date(), t = e.getFullYear(), r = e.getMonth(), u = new Date(t, r, 1).getTime() / 1e3 | 0, n = new Date(t, r + 1, 0, 23, 59, 59).getTime() / 1e3 | 0;
1087
- return [u, n];
860
+ const t = /* @__PURE__ */ new Date(), e = t.getFullYear(), r = t.getMonth(), u = new Date(e, r, 1).getTime() / 1e3 | 0, i = new Date(e, r + 1, 0, 23, 59, 59).getTime() / 1e3 | 0;
861
+ return [u, i];
1088
862
  },
1089
- enumerable: !1,
1090
- configurable: !0,
1091
- writable: !0
863
+ ...n
1092
864
  },
1093
865
  toYearRange: {
1094
866
  value: function() {
1095
- const t = (/* @__PURE__ */ new Date()).getFullYear(), r = new Date(t, 1, 1).getTime() / 1e3 | 0, u = new Date(t + 1, 1, 0, 23, 59, 59).getTime() / 1e3 | 0;
867
+ const e = (/* @__PURE__ */ new Date()).getFullYear(), r = new Date(e, 1, 1).getTime() / 1e3 | 0, u = new Date(e + 1, 1, 0, 23, 59, 59).getTime() / 1e3 | 0;
1096
868
  return [r, u];
1097
869
  },
1098
- enumerable: !1,
1099
- configurable: !0,
1100
- writable: !0
870
+ ...n
1101
871
  }
1102
872
  });
1103
- Object.defineProperties(Date.prototype, {
873
+ l(Date.prototype, {
1104
874
  format: {
1105
- value: function(e = "y-m-d h:i:s") {
875
+ value: function(t = "y-m-d h:i:s") {
1106
876
  if (this.getTime() === 0)
1107
877
  return "-";
1108
- const t = {
878
+ const e = {
1109
879
  y: this.getFullYear(),
1110
880
  m: this.getMonth() + 1,
1111
881
  d: this.getDate(),
@@ -1115,140 +885,112 @@ Object.defineProperties(Date.prototype, {
1115
885
  l: this.getMilliseconds(),
1116
886
  e: this.getMonthDay()
1117
887
  };
1118
- return e.replace(/([ymdhisle])/ig, (r, u) => u >= "A" && u <= "Z" ? t[u.toLowerCase()] : t[u].toString().padStart(u === "l" ? 3 : 2, "0"));
888
+ return t.replace(/([ymdhisle])/ig, (r, u) => u >= "A" && u <= "Z" ? e[u.toLowerCase()] : e[u].toString().padStart(u === "l" ? 3 : 2, "0"));
1119
889
  },
1120
- enumerable: !1,
1121
- configurable: !0,
1122
- writable: !0
890
+ ...n
1123
891
  },
1124
892
  unix: {
1125
893
  value: function() {
1126
894
  return this.getTime() / 1e3 | 0;
1127
895
  },
1128
- enumerable: !1,
1129
- configurable: !0,
1130
- writable: !0
896
+ ...n
1131
897
  },
1132
898
  isLeapYear: {
1133
899
  value: function() {
1134
900
  return this.getFullYear() % 4 === 0 && this.getFullYear() % 400 !== 0;
1135
901
  },
1136
- enumerable: !1,
1137
- configurable: !0,
1138
- writable: !0
902
+ ...n
1139
903
  },
1140
904
  getMonthDay: {
1141
905
  value: function() {
1142
906
  return [31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][this.getMonth()] || (this.isLeapYear() ? 29 : 28);
1143
907
  },
1144
- enumerable: !1,
1145
- configurable: !0,
1146
- writable: !0
908
+ ...n
1147
909
  },
1148
910
  expr: {
1149
- value: function({ y: e = 0, m: t = 0, d: r = 0, h: u = 0, i: n = 0, s: l = 0 }) {
1150
- const a = new Date(this.getFullYear() + e, this.getMonth() + t + 1, 0);
1151
- return new Date(this.getFullYear() + e, this.getMonth() + t, Math.min(a.getDate(), this.getDate()) + r, this.getHours() + u, this.getMinutes() + n, this.getSeconds() + l);
911
+ value: function({ y: t = 0, m: e = 0, d: r = 0, h: u = 0, i = 0, s = 0 }) {
912
+ const o = new Date(this.getFullYear() + t, this.getMonth() + e + 1, 0);
913
+ return new Date(this.getFullYear() + t, this.getMonth() + e, Math.min(o.getDate(), this.getDate()) + r, this.getHours() + u, this.getMinutes() + i, this.getSeconds() + s);
1152
914
  },
1153
- enumerable: !1,
1154
- configurable: !0,
1155
- writable: !0
915
+ ...n
1156
916
  },
1157
917
  begin: {
1158
- value: function(e = 3) {
1159
- return new Date(...[this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()].slice(0, e), ...[this.getFullYear(), 0, 1, 0, 0, 0].slice(e));
918
+ value: function(t = 3) {
919
+ return new Date(...[this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()].slice(0, t), ...[this.getFullYear(), 0, 1, 0, 0, 0].slice(t));
1160
920
  },
1161
- enumerable: !1,
1162
- configurable: !0,
1163
- writable: !0
921
+ ...n
1164
922
  },
1165
923
  end: {
1166
- value: function(e = 3) {
1167
- return new Date(...[this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()].slice(0, e), ...[this.getFullYear(), 11, e < 2 ? 31 : this.getMonthDay(), 23, 59, 59].slice(e));
924
+ value: function(t = 3) {
925
+ return new Date(...[this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()].slice(0, t), ...[this.getFullYear(), 11, t < 2 ? 31 : this.getMonthDay(), 23, 59, 59].slice(t));
1168
926
  },
1169
- enumerable: !1,
1170
- configurable: !0,
1171
- writable: !0
927
+ ...n
1172
928
  },
1173
929
  week: {
1174
- value: function(e, t = 1) {
930
+ value: function(t, e = 1) {
1175
931
  let r = new Date(this.getTime());
1176
- for (; r.getDay() !== e; )
1177
- r = new Date(r.getTime() + 864e5 * t);
932
+ for (; r.getDay() !== t; )
933
+ r = new Date(r.getTime() + 864e5 * e);
1178
934
  return r;
1179
935
  },
1180
- enumerable: !1,
1181
- configurable: !0,
1182
- writable: !0
936
+ ...n
1183
937
  },
1184
938
  toJSON: {
1185
939
  value: function() {
1186
940
  return this.getTime();
1187
941
  },
1188
- enumerable: !1,
1189
- configurable: !0,
1190
- writable: !0
942
+ ...n
1191
943
  }
1192
944
  });
1193
- Object.defineProperties(RegExp.prototype, {
945
+ l(RegExp.prototype, {
1194
946
  toJSON: {
1195
947
  value: function() {
1196
948
  return this.toString();
1197
949
  },
1198
- enumerable: !1,
1199
- configurable: !0,
1200
- writable: !0
950
+ ...n
1201
951
  }
1202
952
  });
1203
- Object.defineProperties(Promise.prototype, {
953
+ l(Promise.prototype, {
1204
954
  tryCatch: {
1205
955
  value: function() {
1206
- return new Promise((e) => this.then((t) => e([t, null])).catch((t) => e([null, t])));
956
+ return new Promise((t) => this.then((e) => t([e, null])).catch((e) => t([null, e])));
1207
957
  },
1208
- enumerable: !1,
1209
- configurable: !0,
1210
- writable: !0
958
+ ...n
1211
959
  }
1212
960
  });
1213
- typeof Promise.withResolvers > "u" && Object.defineProperties(Promise, {
961
+ typeof Promise.withResolvers > "u" && l(Promise, {
1214
962
  withResolvers: {
1215
963
  value: function() {
1216
- let e = null, t = null;
1217
- return { promise: new this((u, n) => {
1218
- e = u, t = n;
1219
- }), resolve: e, reject: t };
1220
- },
1221
- enumerable: !1,
1222
- configurable: !0,
1223
- writable: !0
964
+ let t = null, e = null;
965
+ return { promise: new this((u, i) => {
966
+ t = u, e = i;
967
+ }), resolve: t, reject: e };
968
+ },
969
+ ...n
1224
970
  }
1225
971
  });
1226
- Object.defineProperties(Promise, {
972
+ l(Promise, {
1227
973
  channel: {
1228
974
  value: function() {
1229
- let e = null, t = null;
1230
- return [new this((u, n) => {
1231
- e = u, t = n;
1232
- }), e, t];
1233
- },
1234
- enumerable: !1,
1235
- configurable: !0,
1236
- writable: !0
975
+ let t = null, e = null;
976
+ return [new this((u, i) => {
977
+ t = u, e = i;
978
+ }), t, e];
979
+ },
980
+ ...n
1237
981
  }
1238
982
  });
1239
- Object.defineProperties(JSON, {
983
+ l(JSON, {
1240
984
  parse0: {
1241
- value: function(e, t = null) {
985
+ value: function(t, e = null) {
1242
986
  try {
1243
- if (typeof e != "string")
987
+ if (typeof t != "string")
1244
988
  throw new Error("not string");
1245
- return JSON.parse(e);
989
+ return JSON.parse(t);
1246
990
  } catch {
1247
- return t;
991
+ return e;
1248
992
  }
1249
993
  },
1250
- enumerable: !1,
1251
- configurable: !0,
1252
- writable: !0
994
+ ...n
1253
995
  }
1254
996
  });