szdl-utils-kit 0.2.20 → 0.2.22
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.js +251 -248
- package/dist/index.umd.cjs +2 -2
- package/dist/types/batch.d.ts +1 -1
- package/dist/types/bx-boot.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var C = (y, A, e) => (
|
|
1
|
+
var Ne = Object.defineProperty;
|
|
2
|
+
var _e = (y, A, e) => A in y ? Ne(y, A, { enumerable: !0, configurable: !0, writable: !0, value: e }) : y[A] = e;
|
|
3
|
+
var C = (y, A, e) => (_e(y, typeof A != "symbol" ? A + "" : A, e), e), jt = (y, A, e) => {
|
|
4
4
|
if (!A.has(y))
|
|
5
5
|
throw TypeError("Cannot " + e);
|
|
6
6
|
};
|
|
7
|
-
var o = (y, A, e) => (
|
|
7
|
+
var o = (y, A, e) => (jt(y, A, "read from private field"), e ? e.call(y) : A.get(y)), f = (y, A, e) => {
|
|
8
8
|
if (A.has(y))
|
|
9
9
|
throw TypeError("Cannot add the same private member more than once");
|
|
10
10
|
A instanceof WeakSet ? A.add(y) : A.set(y, e);
|
|
11
|
-
},
|
|
12
|
-
var _ = (y, A, e) => (
|
|
13
|
-
var
|
|
14
|
-
function
|
|
11
|
+
}, d = (y, A, e, n) => (jt(y, A, "write to private field"), n ? n.call(y, e) : A.set(y, e), e);
|
|
12
|
+
var _ = (y, A, e) => (jt(y, A, "access private method"), e);
|
|
13
|
+
var Oe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
14
|
+
function ye(y) {
|
|
15
15
|
return y && y.__esModule && Object.prototype.hasOwnProperty.call(y, "default") ? y.default : y;
|
|
16
16
|
}
|
|
17
|
-
var
|
|
17
|
+
var Qt = { exports: {} };
|
|
18
18
|
(function(y, A) {
|
|
19
19
|
(function(e) {
|
|
20
20
|
Array.prototype.indexOf || (Array.prototype.indexOf = function(t, s) {
|
|
21
|
-
var a,
|
|
22
|
-
for (a = s || 0,
|
|
21
|
+
var a, l;
|
|
22
|
+
for (a = s || 0, l = this.length; a < l; a += 1)
|
|
23
23
|
if (this[a] === t)
|
|
24
24
|
return a;
|
|
25
25
|
return -1;
|
|
@@ -30,18 +30,18 @@ var jt = { exports: {} };
|
|
|
30
30
|
return a;
|
|
31
31
|
}, h = function(t, s) {
|
|
32
32
|
return s !== e ? (t.year(s.year() || s.year), t.month(s.month() || s.month), t.day(s.day() || s.day), t.hours(s.hours() || s.hours), t.minutes(s.minutes() || s.minutes), t.seconds(s.seconds() || s.seconds), t.milliseconds(s.milliseconds() || s.milliseconds), t) : e;
|
|
33
|
-
},
|
|
34
|
-
var a,
|
|
35
|
-
return a = t.slice(s, s + 1), a !== "" && !isNaN(Number(a)) && (
|
|
33
|
+
}, c = function(t, s) {
|
|
34
|
+
var a, l = "";
|
|
35
|
+
return a = t.slice(s, s + 1), a !== "" && !isNaN(Number(a)) && (l += "%H"), a = t.charAt(s + 2), a !== "" && a === ":" && (l += a), a = t.slice(s + 3, s + 4), a !== "" && !isNaN(Number(a)) && (l += "%M"), a = t.charAt(s + 5), a !== "" && a === ":" && (l += a), a = t.slice(s + 6, s + 7), a !== "" && !isNaN(Number(a)) && (l += "%S"), l;
|
|
36
36
|
}, O = function(t, s) {
|
|
37
|
-
var a,
|
|
37
|
+
var a, l = [
|
|
38
38
|
t.slice(s, s + 1),
|
|
39
39
|
t.charAt(s + 2),
|
|
40
40
|
t.slice(s + 3, s + 4),
|
|
41
41
|
t.charAt(s + 5),
|
|
42
42
|
t.slice(s + 6, s + 9)
|
|
43
43
|
], L;
|
|
44
|
-
return !isNaN(Number(
|
|
44
|
+
return !isNaN(Number(l[0])) && !isNaN(Number(l[2])) && !isNaN(Number(l[4])) ? (l[1] === "." && l[3] === "." ? a = "%d.%m.%Y" : l[1] === "-" && l[3] === "-" ? a = "%m-%d-%Y" : l[1] === "/" && l[3] === "/" && (a = "%m/%d/%Y"), a) : (L = [
|
|
45
45
|
t.slice(s, s + 3),
|
|
46
46
|
t.charAt(s + 4),
|
|
47
47
|
t.slice(s + 5, s + 6),
|
|
@@ -224,7 +224,7 @@ var jt = { exports: {} };
|
|
|
224
224
|
N[m].NOVEMBER_LONG,
|
|
225
225
|
N[m].DECEMBER_LONG
|
|
226
226
|
];
|
|
227
|
-
},
|
|
227
|
+
}, ct = function() {
|
|
228
228
|
return [
|
|
229
229
|
N[m].JANUARY_SHORT,
|
|
230
230
|
N[m].FEBRUARY_SHORT,
|
|
@@ -259,12 +259,12 @@ var jt = { exports: {} };
|
|
|
259
259
|
N[m].FRIDAY_SHORT,
|
|
260
260
|
N[m].SATURDAY_SHORT
|
|
261
261
|
];
|
|
262
|
-
}, P,
|
|
263
|
-
var
|
|
264
|
-
n.XMLHttpRequest ?
|
|
265
|
-
|
|
266
|
-
https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.parse(
|
|
267
|
-
},
|
|
262
|
+
}, P, pt, lt, ut, fe = function(t, s, a) {
|
|
263
|
+
var l;
|
|
264
|
+
n.XMLHttpRequest ? l = new XMLHttpRequest() : l = new ActiveXObject("Microsoft.XMLHTTP"), l.onreadystatechange = function() {
|
|
265
|
+
l.readyState === 4 && (l.status === 200 ? s && (n.JSON === e ? alert(`Please, include json2 into your project if you want use old browsers!
|
|
266
|
+
https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.parse(l.responseText))) : a && a(l));
|
|
267
|
+
}, l.open("GET", t, !1), l.send();
|
|
268
268
|
}, U = {
|
|
269
269
|
"%d": {
|
|
270
270
|
format: function(t) {
|
|
@@ -316,7 +316,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
316
316
|
"%a": {
|
|
317
317
|
format: function(t) {
|
|
318
318
|
var s = t.dayOfWeek();
|
|
319
|
-
return
|
|
319
|
+
return ut[s !== e ? s : i.MIN_DAY_OF_WEEK];
|
|
320
320
|
},
|
|
321
321
|
parse: function() {
|
|
322
322
|
return {};
|
|
@@ -328,7 +328,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
328
328
|
"%A": {
|
|
329
329
|
format: function(t) {
|
|
330
330
|
var s = t.dayOfWeek();
|
|
331
|
-
return
|
|
331
|
+
return lt[s !== e ? s : i.MIN_DAY_OF_WEEK];
|
|
332
332
|
},
|
|
333
333
|
parse: function() {
|
|
334
334
|
return {};
|
|
@@ -340,7 +340,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
340
340
|
"%b": {
|
|
341
341
|
format: function(t) {
|
|
342
342
|
var s = i.options("monthFromZero") ? t.month() : t.month() - 1;
|
|
343
|
-
return
|
|
343
|
+
return pt[s !== e ? s : i.MIN_MONTH];
|
|
344
344
|
},
|
|
345
345
|
parse: function(t) {
|
|
346
346
|
var s = i.monthNames().indexOf(t) + (i.options("monthFromZero") ? 0 : 1);
|
|
@@ -415,11 +415,11 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
415
415
|
return r(t.year() || i.MIN_YEAR, 4) + "-" + r(t.month() || i.MIN_MONTH, 2) + "-" + r(t.day() || i.MIN_DAY, 2);
|
|
416
416
|
},
|
|
417
417
|
parse: function(t) {
|
|
418
|
-
var s = Number(t.slice(0, 4)), a = Number(t.slice(5, 7)),
|
|
418
|
+
var s = Number(t.slice(0, 4)), a = Number(t.slice(5, 7)), l = Number(t.slice(8, 10));
|
|
419
419
|
return {
|
|
420
420
|
year: s,
|
|
421
421
|
month: a,
|
|
422
|
-
day:
|
|
422
|
+
day: l
|
|
423
423
|
};
|
|
424
424
|
},
|
|
425
425
|
minLength: 10,
|
|
@@ -431,9 +431,9 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
431
431
|
return r(t.month() || i.MIN_MONTH, 2) + "/" + r(t.day() || i.MIN_DAY, 2) + "/" + r(t.year() || i.MIN_YEAR, 4);
|
|
432
432
|
},
|
|
433
433
|
parse: function(t) {
|
|
434
|
-
var s = Number(t.slice(0, 2)), a = Number(t.slice(3, 5)),
|
|
434
|
+
var s = Number(t.slice(0, 2)), a = Number(t.slice(3, 5)), l = Number(t.slice(6, 10));
|
|
435
435
|
return {
|
|
436
|
-
year:
|
|
436
|
+
year: l,
|
|
437
437
|
month: s,
|
|
438
438
|
day: a
|
|
439
439
|
};
|
|
@@ -442,7 +442,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
442
442
|
maxLength: 10,
|
|
443
443
|
type: "string"
|
|
444
444
|
}
|
|
445
|
-
},
|
|
445
|
+
}, bt = {
|
|
446
446
|
useMilliseconds: !1,
|
|
447
447
|
monthFromZero: !1
|
|
448
448
|
}, R;
|
|
@@ -520,9 +520,9 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
520
520
|
if (typeof t == "number")
|
|
521
521
|
return this._d = new Date(t * (i.options("useMilliseconds") ? 1 : 1e3)), this;
|
|
522
522
|
if (typeof t == "object" && (t instanceof Array ? (this.day(i.MIN_DAY), this.year(t[0]), this.month(t[1]), this.day(t[2]), this.hours(t[3]), this.minutes(t[4]), this.seconds(t[5]), this.milliseconds(t[6])) : (this.day(i.MIN_DAY), this.year(t.year), this.month(t.month), this.day(t.day), this.hours(t.hours), this.minutes(t.minutes), this.seconds(t.seconds), this.milliseconds(t.milliseconds))), typeof t == "string") {
|
|
523
|
-
var
|
|
523
|
+
var l, L = [], E, S, X = [], H = 0, D = 0, M, w, p = {}, b;
|
|
524
524
|
if (t === e)
|
|
525
|
-
return
|
|
525
|
+
return E = h(this, a), E === e && (this._i = {
|
|
526
526
|
year: -1,
|
|
527
527
|
month: -1,
|
|
528
528
|
day: -1,
|
|
@@ -530,7 +530,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
530
530
|
minutes: -1,
|
|
531
531
|
seconds: -1,
|
|
532
532
|
milliseconds: -1
|
|
533
|
-
}),
|
|
533
|
+
}), E;
|
|
534
534
|
for (s === e && (s = i.detectFormat(t)); H < s.length; ) {
|
|
535
535
|
if (s.charAt(H) === "%") {
|
|
536
536
|
if (S = s.charAt(H) + s.charAt(H + 1), U[S] !== e) {
|
|
@@ -549,7 +549,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
549
549
|
break;
|
|
550
550
|
}
|
|
551
551
|
if (M < U[S].minLength)
|
|
552
|
-
return
|
|
552
|
+
return E = h(this, a), E === e && (this._i = {
|
|
553
553
|
year: -1,
|
|
554
554
|
month: -1,
|
|
555
555
|
day: -1,
|
|
@@ -557,11 +557,11 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
557
557
|
minutes: -1,
|
|
558
558
|
seconds: -1,
|
|
559
559
|
milliseconds: -1
|
|
560
|
-
}),
|
|
560
|
+
}), E;
|
|
561
561
|
L.push(S), X.push(w), M -= 1, D += M, H += 1;
|
|
562
562
|
}
|
|
563
563
|
} else if (t.charAt(D) !== s.charAt(H))
|
|
564
|
-
return
|
|
564
|
+
return E = h(this, a), E === e && (this._i = {
|
|
565
565
|
year: -1,
|
|
566
566
|
month: -1,
|
|
567
567
|
day: -1,
|
|
@@ -569,11 +569,11 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
569
569
|
minutes: -1,
|
|
570
570
|
seconds: -1,
|
|
571
571
|
milliseconds: -1
|
|
572
|
-
}),
|
|
572
|
+
}), E;
|
|
573
573
|
H += 1, D += 1;
|
|
574
574
|
}
|
|
575
|
-
for (
|
|
576
|
-
L.hasOwnProperty(
|
|
575
|
+
for (l in L)
|
|
576
|
+
L.hasOwnProperty(l) && U.hasOwnProperty(L[l]) && (b = U[L[l]].parse(X[l]), p = {
|
|
577
577
|
year: b.year !== e ? b.year : p.year,
|
|
578
578
|
month: b.month !== e ? b.month : p.month,
|
|
579
579
|
day: b.day !== e ? b.day : p.day,
|
|
@@ -593,9 +593,9 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
593
593
|
return arguments.length !== 0 ? (this._d = new Date(Number(t) * (i.options("useMilliseconds") ? 1 : 1e3)), this) : i.options("useMilliseconds") ? this._d.getTime() : Math.floor(this._d.getTime() / 1e3);
|
|
594
594
|
}, R.fn.dayOfWeek = function(t) {
|
|
595
595
|
if (t === "long")
|
|
596
|
-
return ct[this._d.getDay()];
|
|
597
|
-
if (t === "short")
|
|
598
596
|
return lt[this._d.getDay()];
|
|
597
|
+
if (t === "short")
|
|
598
|
+
return ut[this._d.getDay()];
|
|
599
599
|
if (t === e)
|
|
600
600
|
return this._d.getDay();
|
|
601
601
|
if (t === 0 || t === "Sunday")
|
|
@@ -671,28 +671,28 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
671
671
|
};
|
|
672
672
|
}
|
|
673
673
|
}, R.fn.format = function(t) {
|
|
674
|
-
for (var s = 0, a = "",
|
|
675
|
-
t.charAt(s) === "%" ? (
|
|
674
|
+
for (var s = 0, a = "", l; s < t.length; )
|
|
675
|
+
t.charAt(s) === "%" ? (l = t.charAt(s) + t.charAt(s + 1), U[l] !== e ? (a += U[l].format(this), s += 1) : a += "%") : a += t.charAt(s), s += 1;
|
|
676
676
|
return a;
|
|
677
677
|
}, R.fn.valid = function() {
|
|
678
678
|
return this._i.year === !1 && this._i.month === !1 && this._i.day === !1 && this._i.hours === !1 && this._i.minutes === !1 && this._i.seconds === !1 && this._i.milliseconds === !1;
|
|
679
679
|
}, R.fn.errors = function() {
|
|
680
680
|
return this._i;
|
|
681
681
|
}, R.fn.between = function(t, s) {
|
|
682
|
-
var a = this.timestamp(),
|
|
682
|
+
var a = this.timestamp(), l = t.timestamp();
|
|
683
683
|
switch (s) {
|
|
684
684
|
case "year":
|
|
685
|
-
return Math.floor((
|
|
685
|
+
return Math.floor((l - a) / 31556952);
|
|
686
686
|
case "month":
|
|
687
|
-
return Math.floor((
|
|
687
|
+
return Math.floor((l - a) / 2629746);
|
|
688
688
|
case "day":
|
|
689
|
-
return Math.floor((
|
|
689
|
+
return Math.floor((l - a) / 86400);
|
|
690
690
|
case "hours":
|
|
691
|
-
return Math.floor((
|
|
691
|
+
return Math.floor((l - a) / 3600);
|
|
692
692
|
case "minutes":
|
|
693
|
-
return Math.floor((
|
|
693
|
+
return Math.floor((l - a) / 60);
|
|
694
694
|
case "seconds":
|
|
695
|
-
return
|
|
695
|
+
return l - a;
|
|
696
696
|
default:
|
|
697
697
|
return e;
|
|
698
698
|
}
|
|
@@ -702,32 +702,32 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
702
702
|
return new R(t, s, a);
|
|
703
703
|
}, i.MIN_YEAR = 1e3, i.MAX_YEAR = 3e3, i.MIN_MONTH = 1, i.MAX_MONTH = 12, i.MIN_DAY = 1, i.MAX_DAY_IN_MONTHS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], i.MIN_DAY_OF_WEEK = 0, i.MAX_DAY_OF_WEEK = 6, i.MIN_HOURS = 0, i.MAX_HOURS = 23, i.MIN_MINUTES = 0, i.MAX_MINUTES = 59, i.MIN_SECONDS = 0, i.MAX_SECONDS = 59, i.MIN_MILLISECONDS = 0, i.MAX_MILLISECONDS = 999, i.VERSION = "0.2.18", i.options = function(t, s) {
|
|
704
704
|
if (t === e)
|
|
705
|
-
return
|
|
706
|
-
if (
|
|
705
|
+
return bt;
|
|
706
|
+
if (bt.hasOwnProperty(t)) {
|
|
707
707
|
if (s === e)
|
|
708
|
-
return
|
|
709
|
-
|
|
708
|
+
return bt[t];
|
|
709
|
+
bt[t] = s, t === "monthFromZero" && (i.MIN_MONTH = s ? 0 : 1, i.MAX_MONTH = s ? 11 : 12);
|
|
710
710
|
}
|
|
711
711
|
return e;
|
|
712
712
|
}, i.noConflict = function() {
|
|
713
713
|
return n.tempus = u, i;
|
|
714
714
|
}, i.generate = function(t) {
|
|
715
|
-
var s, a,
|
|
716
|
-
if (typeof t.dateFrom != "number" && (t.dateFrom instanceof R ? s = t.dateFrom.utc() : s = i(t.dateFrom, t.formatFrom).utc()), typeof t.dateTo != "number" && (t.dateTo instanceof R ? a = t.dateTo.utc() : a = i(t.dateTo, t.formatTo !== e ? t.formatTo : t.formatFrom).utc()), typeof t.period == "number" ?
|
|
715
|
+
var s, a, l, L, E, S, X, H;
|
|
716
|
+
if (typeof t.dateFrom != "number" && (t.dateFrom instanceof R ? s = t.dateFrom.utc() : s = i(t.dateFrom, t.formatFrom).utc()), typeof t.dateTo != "number" && (t.dateTo instanceof R ? a = t.dateTo.utc() : a = i(t.dateTo, t.formatTo !== e ? t.formatTo : t.formatFrom).utc()), typeof t.period == "number" ? E = {
|
|
717
717
|
year: 0,
|
|
718
718
|
month: 0,
|
|
719
719
|
day: 0,
|
|
720
720
|
hours: 0,
|
|
721
721
|
minutes: 0,
|
|
722
722
|
seconds: t.period
|
|
723
|
-
} : typeof t.period == "string" ?
|
|
723
|
+
} : typeof t.period == "string" ? E = {
|
|
724
724
|
year: t.period === "year" ? 1 : 0,
|
|
725
725
|
month: t.period === "month" ? 1 : 0,
|
|
726
726
|
day: t.period === "day" ? 1 : 0,
|
|
727
727
|
hours: t.period === "hours" ? 1 : 0,
|
|
728
728
|
minutes: t.period === "minutes" ? 1 : 0,
|
|
729
729
|
seconds: t.period === "seconds" ? 1 : 0
|
|
730
|
-
} : typeof t.period == "object" && (
|
|
730
|
+
} : typeof t.period == "object" && (E = {
|
|
731
731
|
year: t.period.year !== e ? t.period.year : 0,
|
|
732
732
|
month: t.period.month !== e ? t.period.month : 0,
|
|
733
733
|
day: t.period.day !== e ? t.period.day : 0,
|
|
@@ -738,63 +738,63 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
738
738
|
return t.asObject === !0 ? t.format !== e ? w[i(p).format(t.format)] = {} : w[i(p).format("%F %H:%M:%S")] = {} : t.format !== e ? w.push(b ? null : i(p).format(t.format)) : w.push(b ? null : i(p)), w;
|
|
739
739
|
}, t.groupBy !== e && t.fillNulls) {
|
|
740
740
|
var D = {
|
|
741
|
-
year:
|
|
742
|
-
month:
|
|
743
|
-
day:
|
|
744
|
-
hours:
|
|
745
|
-
minutes:
|
|
746
|
-
seconds:
|
|
747
|
-
milliseconds:
|
|
741
|
+
year: E.year ? -E.year : e,
|
|
742
|
+
month: E.month ? -E.month : e,
|
|
743
|
+
day: E.day ? -E.day : e,
|
|
744
|
+
hours: E.hours ? -E.hours : e,
|
|
745
|
+
minutes: E.minutes ? -E.minutes : e,
|
|
746
|
+
seconds: E.seconds ? -E.seconds : e,
|
|
747
|
+
milliseconds: E.milliseconds ? -E.milliseconds : e
|
|
748
748
|
};
|
|
749
|
-
for (
|
|
750
|
-
H(S[S.length - 1],
|
|
749
|
+
for (l = i(s).calc(D).utc(); i(l).get()[t.groupBy] === X; )
|
|
750
|
+
H(S[S.length - 1], l, !0), l = i(l).calc(D).utc();
|
|
751
751
|
if (t.groupBy === "week") {
|
|
752
752
|
var M = i(s).dayOfWeek();
|
|
753
|
-
for (
|
|
754
|
-
H(S[S.length - 1],
|
|
753
|
+
for (l = i(s).dayOfWeek(0).utc(); S[0].length < M && l < s; )
|
|
754
|
+
H(S[S.length - 1], l, !0), l = i(l).calc(E).utc();
|
|
755
755
|
}
|
|
756
756
|
}
|
|
757
757
|
for (; s <= a; )
|
|
758
|
-
t.groupBy === e ? H(S, s) : i(s).get()[t.groupBy] === X ? H(S[S.length - 1], s) : (S.push([]), H(S[S.length - 1], s), X = i(s).get()[t.groupBy]), s = i(s).calc(
|
|
758
|
+
t.groupBy === e ? H(S, s) : i(s).get()[t.groupBy] === X ? H(S[S.length - 1], s) : (S.push([]), H(S[S.length - 1], s), X = i(s).get()[t.groupBy]), s = i(s).calc(E).utc();
|
|
759
759
|
if (t.groupBy !== e && t.fillNulls)
|
|
760
|
-
for (L = i(a).calc(
|
|
761
|
-
H(S[S.length - 1], L, !0), L = i(L).calc(
|
|
760
|
+
for (L = i(a).calc(E).utc(); i(L).get()[t.groupBy] === X; )
|
|
761
|
+
H(S[S.length - 1], L, !0), L = i(L).calc(E).utc();
|
|
762
762
|
return S;
|
|
763
763
|
}, i.monthNames = function(t) {
|
|
764
764
|
switch (t) {
|
|
765
765
|
case "long":
|
|
766
766
|
return P;
|
|
767
767
|
default:
|
|
768
|
-
return
|
|
768
|
+
return pt;
|
|
769
769
|
}
|
|
770
770
|
}, i.dayNames = function(t) {
|
|
771
771
|
switch (t) {
|
|
772
772
|
case "long":
|
|
773
|
-
return ct;
|
|
774
|
-
default:
|
|
775
773
|
return lt;
|
|
774
|
+
default:
|
|
775
|
+
return ut;
|
|
776
776
|
}
|
|
777
777
|
}, i.lang = function(t) {
|
|
778
778
|
if (t !== e)
|
|
779
|
-
m = t, N[m] === e && (m = "en"), P = G(),
|
|
779
|
+
m = t, N[m] === e && (m = "en"), P = G(), pt = ct(), lt = z(), ut = k();
|
|
780
780
|
else
|
|
781
781
|
return m;
|
|
782
782
|
return e;
|
|
783
783
|
}, i.availableLangs = function() {
|
|
784
784
|
return Object.keys(N);
|
|
785
|
-
}, i.registerFormat = function(t, s, a,
|
|
785
|
+
}, i.registerFormat = function(t, s, a, l, L, E) {
|
|
786
786
|
U[t] = {
|
|
787
787
|
format: s,
|
|
788
788
|
parse: a,
|
|
789
|
-
minLength:
|
|
789
|
+
minLength: l,
|
|
790
790
|
maxLength: L,
|
|
791
|
-
type:
|
|
791
|
+
type: E
|
|
792
792
|
};
|
|
793
793
|
}, i.unregisterFormat = function(t) {
|
|
794
794
|
delete U[t];
|
|
795
795
|
}, i.detectFormat = function(t) {
|
|
796
|
-
var s, a,
|
|
797
|
-
return s = O(t, 0), s !== "" && (
|
|
796
|
+
var s, a, l;
|
|
797
|
+
return s = O(t, 0), s !== "" && (l = 10), a = t.charAt(l), (a === "T" || a === " ") && (s += a, l += 1), s += c(t, l), s;
|
|
798
798
|
}, T = {
|
|
799
799
|
TempusDate: R
|
|
800
800
|
}, i.classes = function(t, s) {
|
|
@@ -802,53 +802,53 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
802
802
|
return T[t];
|
|
803
803
|
T[t] = s;
|
|
804
804
|
}, i.loadTranslations = function(t) {
|
|
805
|
-
typeof t == "object" ? N = t : typeof t == "string" &&
|
|
805
|
+
typeof t == "object" ? N = t : typeof t == "string" && fe(t, function(s) {
|
|
806
806
|
N = s;
|
|
807
807
|
}, function(s) {
|
|
808
808
|
});
|
|
809
|
-
}, m = (g.language || g.systemLanguage || g.userLanguage || "en").substr(0, 2).toLowerCase(), N[m] === e && (m = "en"), P = G(),
|
|
810
|
-
}).call(
|
|
811
|
-
})(
|
|
812
|
-
var
|
|
813
|
-
const
|
|
814
|
-
var K,
|
|
809
|
+
}, m = (g.language || g.systemLanguage || g.userLanguage || "en").substr(0, 2).toLowerCase(), N[m] === e && (m = "en"), P = G(), pt = ct(), lt = z(), ut = k(), y.exports && (A = y.exports = i), A.tempus = i;
|
|
810
|
+
}).call(Oe);
|
|
811
|
+
})(Qt, Qt.exports);
|
|
812
|
+
var de = Qt.exports;
|
|
813
|
+
const Dt = /* @__PURE__ */ ye(de);
|
|
814
|
+
var K, ft, q, Y, W, j, v, $, I, Q, Ut, tt, F, et, At, nt, Yt, Nt, Zt, _t, Vt, Ot, zt, yt, Kt, dt, qt, Gt, ie, wt, re, Et, vt, gt, $t, Tt, te, ot, Bt, Rt, ee, Ct, ne, st, mt, at, It, St, Ae;
|
|
815
815
|
class x {
|
|
816
816
|
constructor(A, e = {}) {
|
|
817
817
|
f(this, nt);
|
|
818
|
-
f(this, ft);
|
|
819
818
|
f(this, Nt);
|
|
820
819
|
f(this, _t);
|
|
821
820
|
f(this, Ot);
|
|
822
821
|
f(this, yt);
|
|
823
|
-
f(this, Ut);
|
|
824
|
-
f(this, Gt);
|
|
825
822
|
f(this, dt);
|
|
823
|
+
f(this, Gt);
|
|
824
|
+
f(this, wt);
|
|
826
825
|
f(this, Et);
|
|
827
826
|
f(this, gt);
|
|
828
|
-
f(this, ot);
|
|
829
827
|
f(this, Tt);
|
|
830
|
-
f(this,
|
|
828
|
+
f(this, ot);
|
|
829
|
+
f(this, Rt);
|
|
830
|
+
f(this, Ct);
|
|
831
831
|
f(this, st);
|
|
832
832
|
f(this, at);
|
|
833
|
-
f(this,
|
|
833
|
+
f(this, St);
|
|
834
834
|
f(this, K, null);
|
|
835
|
-
f(this,
|
|
835
|
+
f(this, ft, null);
|
|
836
836
|
f(this, q, []);
|
|
837
837
|
f(this, Y, {});
|
|
838
838
|
f(this, W, 50);
|
|
839
|
-
f(this, j,
|
|
839
|
+
f(this, j, 50);
|
|
840
840
|
f(this, v, !0);
|
|
841
841
|
f(this, $, null);
|
|
842
842
|
f(this, I, null);
|
|
843
843
|
f(this, Q, null);
|
|
844
|
-
f(this,
|
|
844
|
+
f(this, Ut, 100);
|
|
845
845
|
f(this, tt, "no");
|
|
846
846
|
f(this, F, !1);
|
|
847
847
|
f(this, et, !1);
|
|
848
848
|
f(this, At, !1);
|
|
849
849
|
C(this, "errors", {});
|
|
850
850
|
C(this, "answerData", {});
|
|
851
|
-
|
|
851
|
+
d(this, K, A), d(this, ft, e);
|
|
852
852
|
}
|
|
853
853
|
get serial() {
|
|
854
854
|
return o(this, F);
|
|
@@ -859,48 +859,48 @@ class x {
|
|
|
859
859
|
set limitCommandSerial(A) {
|
|
860
860
|
if (A < 10)
|
|
861
861
|
throw new Error("limitCommandSerial не может быть меньше 10");
|
|
862
|
-
A >= 10 && A < 50 && (
|
|
862
|
+
A >= 10 && A < 50 && (d(this, W, A), d(this, j, A)), d(this, j, A);
|
|
863
863
|
}
|
|
864
864
|
setSerial() {
|
|
865
|
-
|
|
865
|
+
d(this, F, !0), d(this, et, !0), d(this, At, !1);
|
|
866
866
|
}
|
|
867
867
|
setParallel() {
|
|
868
|
-
|
|
868
|
+
d(this, F, !1), d(this, et, !1), d(this, At, !0);
|
|
869
869
|
}
|
|
870
870
|
stop() {
|
|
871
|
-
|
|
871
|
+
d(this, v, !1);
|
|
872
872
|
}
|
|
873
873
|
async batch(A, e) {
|
|
874
|
-
o(this, Q) && _(this,
|
|
875
|
-
const n = _(this,
|
|
874
|
+
o(this, Q) && _(this, Nt, Zt).call(this), e && d(this, $, e), o(this, et) === !1 && d(this, F, !1), Object.keys(A).length > o(this, j) && d(this, F, !0), d(this, v, !0), d(this, q, []), d(this, Y, {}), this.errors = {}, this.answerData = {};
|
|
875
|
+
const n = _(this, Ot, zt).call(this, A);
|
|
876
876
|
if (Object.keys(A).length < o(this, j)) {
|
|
877
|
-
const r = n.map((h,
|
|
877
|
+
const r = n.map((h, c) => _(this, yt, Kt).call(this, h, n[c]));
|
|
878
878
|
return Promise.allSettled(r).then((h) => {
|
|
879
|
-
let
|
|
879
|
+
let c = {};
|
|
880
880
|
for (let O of h)
|
|
881
|
-
O.status === "fulfilled" && (
|
|
882
|
-
return
|
|
881
|
+
O.status === "fulfilled" && (c = { ...c, ...O.value });
|
|
882
|
+
return c;
|
|
883
883
|
});
|
|
884
884
|
} else {
|
|
885
|
-
let r = {}, h = 0,
|
|
886
|
-
h += Object.keys(i).length,
|
|
885
|
+
let r = {}, h = 0, c = 1, O = Object.keys(A).length || 1, u = (i) => {
|
|
886
|
+
h += Object.keys(i).length, c = Math.round(h / O * 100);
|
|
887
887
|
};
|
|
888
888
|
for (let [i, T] of Object.entries(n)) {
|
|
889
|
-
let g = await _(this,
|
|
890
|
-
u(T), e && e({ percent:
|
|
889
|
+
let g = await _(this, yt, Kt).call(this, T, n[i], !0);
|
|
890
|
+
u(T), e && e({ percent: c }), r = { ...r, ...g };
|
|
891
891
|
}
|
|
892
892
|
return r;
|
|
893
893
|
}
|
|
894
894
|
}
|
|
895
895
|
async batchTotalCount(A, e) {
|
|
896
|
-
|
|
897
|
-
let n = 1, r = 0, h = Object.keys(A).length || 1,
|
|
896
|
+
d(this, Y, {}), this.errors = {};
|
|
897
|
+
let n = 1, r = 0, h = Object.keys(A).length || 1, c = (u) => {
|
|
898
898
|
r += Object.keys(u).length, n = Math.round(r / h * 100);
|
|
899
899
|
};
|
|
900
900
|
e && e({ percent: n });
|
|
901
|
-
const O = _(this,
|
|
901
|
+
const O = _(this, Ot, zt).call(this, A);
|
|
902
902
|
if (o(this, At)) {
|
|
903
|
-
const u = O.map((i) => _(this,
|
|
903
|
+
const u = O.map((i) => _(this, dt, qt).call(this, i).then((T) => (c(i), e && e({ percent: n }), T)));
|
|
904
904
|
return Promise.allSettled(u).then((i) => {
|
|
905
905
|
let T = {};
|
|
906
906
|
for (let g of i)
|
|
@@ -910,46 +910,46 @@ class x {
|
|
|
910
910
|
} else {
|
|
911
911
|
let u = {};
|
|
912
912
|
for (let i of O) {
|
|
913
|
-
let T = await _(this,
|
|
914
|
-
|
|
913
|
+
let T = await _(this, dt, qt).call(this, i);
|
|
914
|
+
c(i), e && e({ percent: n }), u = { ...u, ...T };
|
|
915
915
|
}
|
|
916
916
|
return u;
|
|
917
917
|
}
|
|
918
918
|
}
|
|
919
919
|
}
|
|
920
|
-
K = new WeakMap(),
|
|
920
|
+
K = new WeakMap(), ft = new WeakMap(), q = new WeakMap(), Y = new WeakMap(), W = new WeakMap(), j = new WeakMap(), v = new WeakMap(), $ = new WeakMap(), I = new WeakMap(), Q = new WeakMap(), Ut = new WeakMap(), tt = new WeakMap(), F = new WeakMap(), et = new WeakMap(), At = new WeakMap(), nt = new WeakSet(), Yt = function() {
|
|
921
921
|
let A = 0;
|
|
922
922
|
if (!o(this, I))
|
|
923
923
|
return Math.round(A);
|
|
924
924
|
let e = 0, n = 0;
|
|
925
925
|
return Object.values(o(this, I)).forEach((r) => {
|
|
926
|
-
const { total: h, count:
|
|
927
|
-
e += h ?? 0, n +=
|
|
926
|
+
const { total: h, count: c } = r;
|
|
927
|
+
e += h ?? 0, n += c ?? 0;
|
|
928
928
|
}), e ? A = n / e * 100 : A = 100, { percent: Math.round(A), allCount: n, allTotal: e };
|
|
929
|
-
},
|
|
930
|
-
clearInterval(o(this, Q)),
|
|
931
|
-
},
|
|
932
|
-
const n = _(this, st,
|
|
933
|
-
let
|
|
934
|
-
n && (
|
|
935
|
-
const { percent: O, allCount: u, allTotal: i } = o(this, nt,
|
|
936
|
-
(o(this, tt) === "no" || o(this, tt) < o(this, nt,
|
|
929
|
+
}, Nt = new WeakSet(), Zt = function() {
|
|
930
|
+
clearInterval(o(this, Q)), d(this, Q, ""), d(this, I, ""), d(this, $, ""), d(this, tt, "no");
|
|
931
|
+
}, _t = new WeakSet(), Vt = function({ key: A, value: e }) {
|
|
932
|
+
const n = _(this, st, mt).call(this, e.data()), r = Array.isArray(n) ? n.length : 0, h = _(this, at, It).call(this, e.total(), r);
|
|
933
|
+
let c = 1;
|
|
934
|
+
n && (c = r), o(this, $) && (o(this, I) || d(this, I, {}), o(this, I)[A] && o(this, I)[A].count && (c += o(this, I)[A].count), o(this, I)[A] = { total: h, count: c }, o(this, Q) || d(this, Q, setInterval(() => {
|
|
935
|
+
const { percent: O, allCount: u, allTotal: i } = o(this, nt, Yt);
|
|
936
|
+
(o(this, tt) === "no" || o(this, tt) < o(this, nt, Yt).percent) && (o(this, $).call(this, {
|
|
937
937
|
data: o(this, I),
|
|
938
938
|
percent: O,
|
|
939
939
|
allCount: u,
|
|
940
940
|
allTotal: i
|
|
941
|
-
}),
|
|
942
|
-
}, o(this,
|
|
943
|
-
},
|
|
941
|
+
}), d(this, tt, o(this, nt, Yt).percent)), O === 100 && _(this, Nt, Zt).call(this);
|
|
942
|
+
}, o(this, Ut))));
|
|
943
|
+
}, Ot = new WeakSet(), zt = function(A) {
|
|
944
944
|
const e = [], n = Object.entries(A);
|
|
945
945
|
for (let r = 0; r < n.length; r += o(this, W)) {
|
|
946
946
|
const h = n.slice(r, r + o(this, W));
|
|
947
947
|
e.push(Object.fromEntries(h));
|
|
948
948
|
}
|
|
949
949
|
return e;
|
|
950
|
-
},
|
|
950
|
+
}, yt = new WeakSet(), Kt = function(A, e, n) {
|
|
951
951
|
return new Promise((r) => {
|
|
952
|
-
const h = _(this,
|
|
952
|
+
const h = _(this, Rt, ee).call(this, e), c = [];
|
|
953
953
|
let O = 0, u = 0;
|
|
954
954
|
o(this, K).call(this, A, (i) => {
|
|
955
955
|
Object.entries(i).forEach(([T, g]) => {
|
|
@@ -964,94 +964,94 @@ K = new WeakMap(), mt = new WeakMap(), q = new WeakMap(), Y = new WeakMap(), W =
|
|
|
964
964
|
k != "result" && P && (m[k] = P);
|
|
965
965
|
Object.keys(m).length && (this.answerData[T] = m);
|
|
966
966
|
}
|
|
967
|
-
const G = _(this, st,
|
|
968
|
-
if (Array.isArray(G) ? o(this, Y)[T] = G : typeof G == "object" && G !== null && Object.keys(G).length === 0 ? o(this, Y)[T] = [] : o(this, Y)[T] = G, u += z, n || _(this,
|
|
967
|
+
const G = _(this, st, mt).call(this, g.data()), ct = Array.isArray(G) ? G.length : 0, z = _(this, at, It).call(this, g.total(), ct);
|
|
968
|
+
if (Array.isArray(G) ? o(this, Y)[T] = G : typeof G == "object" && G !== null && Object.keys(G).length === 0 ? o(this, Y)[T] = [] : o(this, Y)[T] = G, u += z, n || _(this, _t, Vt).call(this, { key: T, value: g }), z > o(this, W) && z > ct) {
|
|
969
969
|
const k = Math.ceil(z / o(this, W)) - 1, P = Array.from({ length: k });
|
|
970
|
-
|
|
970
|
+
c.push([T, h[T], P]);
|
|
971
971
|
}
|
|
972
|
-
}), u > 5e3 && o(this, et) === !1 && o(this, At) === !1 &&
|
|
972
|
+
}), u > 5e3 && o(this, et) === !1 && o(this, At) === !1 && d(this, F, !0), O > 0 && _(this, St, Ae).call(this), c.length ? (_(this, Gt, ie).call(this, c), _(this, wt, re).call(this).then(() => r(_(this, ot, Bt).call(this)))) : r(_(this, ot, Bt).call(this));
|
|
973
973
|
});
|
|
974
974
|
});
|
|
975
|
-
},
|
|
975
|
+
}, dt = new WeakSet(), qt = function(A) {
|
|
976
976
|
return new Promise((e) => {
|
|
977
|
-
const n = _(this,
|
|
977
|
+
const n = _(this, Rt, ee).call(this, A);
|
|
978
978
|
let r = 0;
|
|
979
979
|
o(this, K).call(this, n, (h) => {
|
|
980
|
-
Object.entries(h).forEach(([
|
|
980
|
+
Object.entries(h).forEach(([c, O]) => {
|
|
981
981
|
const u = O.error();
|
|
982
|
-
u && (this.errors[
|
|
983
|
-
const i = _(this, st,
|
|
984
|
-
o(this, Y)[
|
|
985
|
-
}), r > 0 && _(this,
|
|
982
|
+
u && (this.errors[c] = u, r += 1);
|
|
983
|
+
const i = _(this, st, mt).call(this, O.data()), T = Array.isArray(i) ? i.length : 0, g = _(this, at, It).call(this, O.total(), T);
|
|
984
|
+
o(this, Y)[c] = g;
|
|
985
|
+
}), r > 0 && _(this, St, Ae).call(this), e(_(this, ot, Bt).call(this));
|
|
986
986
|
});
|
|
987
987
|
});
|
|
988
|
-
},
|
|
988
|
+
}, Gt = new WeakSet(), ie = function(A) {
|
|
989
989
|
let e = [];
|
|
990
990
|
A.forEach(([n, r, h]) => {
|
|
991
|
-
h.forEach((
|
|
992
|
-
const u = O + 1, i = o(this, W) * u, g = [[n, u].join("_"), _(this,
|
|
991
|
+
h.forEach((c, O) => {
|
|
992
|
+
const u = O + 1, i = o(this, W) * u, g = [[n, u].join("_"), _(this, Ct, ne).call(this, r, i)];
|
|
993
993
|
e.length === o(this, W) ? (o(this, q).push(e), e = [g]) : e.push(g);
|
|
994
994
|
});
|
|
995
995
|
}), e.length && o(this, q).push(e);
|
|
996
|
-
},
|
|
996
|
+
}, wt = new WeakSet(), re = function() {
|
|
997
997
|
const A = [], e = [], n = (r) => {
|
|
998
|
-
Object.entries(r).forEach(([h,
|
|
999
|
-
const [O] = h.split("_"), u = _(this, st,
|
|
1000
|
-
Array.isArray(u) && o(this, Y)[O].push(...u), _(this,
|
|
998
|
+
Object.entries(r).forEach(([h, c]) => {
|
|
999
|
+
const [O] = h.split("_"), u = _(this, st, mt).call(this, c.data());
|
|
1000
|
+
Array.isArray(u) && o(this, Y)[O].push(...u), _(this, _t, Vt).call(this, { key: O, value: c });
|
|
1001
1001
|
});
|
|
1002
1002
|
};
|
|
1003
1003
|
return o(this, q).forEach((r, h) => {
|
|
1004
|
-
const
|
|
1004
|
+
const c = Object.fromEntries(r), O = () => new Promise((u) => o(this, K).call(this, c, (i) => {
|
|
1005
1005
|
o(this, F) ? n(i) : e[h] = i, u();
|
|
1006
1006
|
}));
|
|
1007
1007
|
A.push(O);
|
|
1008
|
-
}), o(this, F) ? _(this,
|
|
1008
|
+
}), o(this, F) ? _(this, gt, $t).call(this, A) : _(this, Tt, te).call(this, A).then(() => {
|
|
1009
1009
|
e.forEach(n);
|
|
1010
1010
|
});
|
|
1011
|
-
},
|
|
1011
|
+
}, Et = new WeakSet(), vt = function() {
|
|
1012
1012
|
return new Promise((A) => setTimeout(A, 500));
|
|
1013
|
-
},
|
|
1013
|
+
}, gt = new WeakSet(), $t = function(A) {
|
|
1014
1014
|
if (!A.length)
|
|
1015
1015
|
return Promise.resolve();
|
|
1016
1016
|
const e = A.shift();
|
|
1017
1017
|
return Promise.allSettled([
|
|
1018
1018
|
e(),
|
|
1019
|
-
_(this,
|
|
1020
|
-
]).then(() => o(this, v) ? _(this,
|
|
1021
|
-
},
|
|
1019
|
+
_(this, Et, vt).call(this)
|
|
1020
|
+
]).then(() => o(this, v) ? _(this, gt, $t).call(this, A) : Promise.resolve());
|
|
1021
|
+
}, Tt = new WeakSet(), te = function(A) {
|
|
1022
1022
|
if (!A.length)
|
|
1023
1023
|
return Promise.resolve();
|
|
1024
1024
|
const e = A.shift();
|
|
1025
|
-
return _(this,
|
|
1026
|
-
}, ot = new WeakSet(),
|
|
1027
|
-
return Object.entries(o(this,
|
|
1025
|
+
return _(this, Et, vt).call(this).then(() => e()).then(() => o(this, v) ? _(this, Tt, te).call(this, A) : Promise.resolve());
|
|
1026
|
+
}, ot = new WeakSet(), Bt = function() {
|
|
1027
|
+
return Object.entries(o(this, ft)).forEach(([A, e]) => {
|
|
1028
1028
|
o(this, Y)[A] && (o(this, Y)[A] = e(o(this, Y)[A]));
|
|
1029
1029
|
}), o(this, Y);
|
|
1030
|
-
},
|
|
1030
|
+
}, Rt = new WeakSet(), ee = function(A) {
|
|
1031
1031
|
return Object.entries(A).reduce((e, [n, r]) => {
|
|
1032
1032
|
if (Array.isArray(r)) {
|
|
1033
|
-
const [h,
|
|
1034
|
-
e[n] = [h,
|
|
1033
|
+
const [h, c = {}] = r;
|
|
1034
|
+
e[n] = [h, c];
|
|
1035
1035
|
} else {
|
|
1036
|
-
const { method: h, params:
|
|
1037
|
-
e[n] = [h,
|
|
1036
|
+
const { method: h, params: c = {} } = r;
|
|
1037
|
+
e[n] = [h, c];
|
|
1038
1038
|
}
|
|
1039
1039
|
return e;
|
|
1040
1040
|
}, {});
|
|
1041
|
-
},
|
|
1041
|
+
}, Ct = new WeakSet(), ne = function(A, e) {
|
|
1042
1042
|
const [n, r] = A;
|
|
1043
1043
|
return [n, { start: e, ...r }];
|
|
1044
|
-
}, st = new WeakSet(),
|
|
1044
|
+
}, st = new WeakSet(), mt = function(A) {
|
|
1045
1045
|
return ((A == null ? void 0 : A.items) || (A == null ? void 0 : A.documents)) ?? A;
|
|
1046
|
-
}, at = new WeakSet(),
|
|
1046
|
+
}, at = new WeakSet(), It = function(A, e) {
|
|
1047
1047
|
return A !== A && (A = 0), A === 0 && e === 0 ? 0 : A || e;
|
|
1048
|
-
},
|
|
1048
|
+
}, St = new WeakSet(), Ae = function() {
|
|
1049
1049
|
console.group(`${this.constructor.name}: Ошибки в методах!`), Object.entries(this.errors).forEach(([A, e]) => {
|
|
1050
1050
|
console.info(`[${A}]`, e);
|
|
1051
1051
|
}), console.groupEnd();
|
|
1052
1052
|
};
|
|
1053
1053
|
var it;
|
|
1054
|
-
class
|
|
1054
|
+
class oe {
|
|
1055
1055
|
constructor() {
|
|
1056
1056
|
f(this, it, {});
|
|
1057
1057
|
}
|
|
@@ -1094,27 +1094,28 @@ class ne {
|
|
|
1094
1094
|
}
|
|
1095
1095
|
}
|
|
1096
1096
|
it = new WeakMap();
|
|
1097
|
-
const
|
|
1098
|
-
var J, Z,
|
|
1099
|
-
class
|
|
1097
|
+
const Ht = new oe();
|
|
1098
|
+
var J, Z, Ft, rt, Lt, V, ht, Pt, ae, Mt, se, Wt, he, Jt, ce, kt, le;
|
|
1099
|
+
class Ee {
|
|
1100
1100
|
constructor() {
|
|
1101
|
-
f(this,
|
|
1101
|
+
f(this, Pt);
|
|
1102
1102
|
/** Вывод ошибок логера
|
|
1103
1103
|
* @param {'entity'} type - тип ошибки
|
|
1104
1104
|
*/
|
|
1105
|
-
f(this,
|
|
1106
|
-
f(this, Pt);
|
|
1105
|
+
f(this, Mt);
|
|
1107
1106
|
f(this, Wt);
|
|
1108
1107
|
f(this, Jt);
|
|
1108
|
+
f(this, kt);
|
|
1109
1109
|
f(this, J, "logger");
|
|
1110
1110
|
f(this, Z, !1);
|
|
1111
|
-
f(this,
|
|
1111
|
+
f(this, Ft, 2e3);
|
|
1112
1112
|
f(this, rt, /* @__PURE__ */ new Map());
|
|
1113
|
-
f(this,
|
|
1113
|
+
f(this, Lt, {});
|
|
1114
1114
|
f(this, V, null);
|
|
1115
|
+
f(this, ht, !1);
|
|
1115
1116
|
/** Очистка хранилища элементов старше 'N' месяцев */
|
|
1116
1117
|
C(this, "periodClear", 3);
|
|
1117
|
-
_(this,
|
|
1118
|
+
_(this, Pt, ae).call(this);
|
|
1118
1119
|
}
|
|
1119
1120
|
/** Инициализация логера */
|
|
1120
1121
|
async init() {
|
|
@@ -1123,7 +1124,7 @@ class de {
|
|
|
1123
1124
|
});
|
|
1124
1125
|
if (e != null && e.length)
|
|
1125
1126
|
if (e.find((r) => r.ENTITY == o(this, J)))
|
|
1126
|
-
|
|
1127
|
+
d(this, Z, !0);
|
|
1127
1128
|
else {
|
|
1128
1129
|
let { entityAdd: r } = await A.batch({
|
|
1129
1130
|
entityAdd: {
|
|
@@ -1135,9 +1136,9 @@ class de {
|
|
|
1135
1136
|
}
|
|
1136
1137
|
}
|
|
1137
1138
|
});
|
|
1138
|
-
r &&
|
|
1139
|
+
r && d(this, Z, !0);
|
|
1139
1140
|
}
|
|
1140
|
-
return _(this,
|
|
1141
|
+
return _(this, Jt, ce).call(this), o(this, Z);
|
|
1141
1142
|
}
|
|
1142
1143
|
/**
|
|
1143
1144
|
* @param {{ type: 'call'|'batch'|'batch-total-count';
|
|
@@ -1150,14 +1151,14 @@ class de {
|
|
|
1150
1151
|
*/
|
|
1151
1152
|
start({ type: A, data: e }) {
|
|
1152
1153
|
if (!o(this, Z)) {
|
|
1153
|
-
_(this,
|
|
1154
|
+
_(this, Mt, se).call(this, "entity");
|
|
1154
1155
|
return;
|
|
1155
1156
|
}
|
|
1156
|
-
const n =
|
|
1157
|
+
const n = Ht.hash;
|
|
1157
1158
|
return o(this, rt).set(n, {
|
|
1158
1159
|
type: A,
|
|
1159
1160
|
data: e,
|
|
1160
|
-
userInfo: o(this,
|
|
1161
|
+
userInfo: o(this, Lt),
|
|
1161
1162
|
errorList: [],
|
|
1162
1163
|
status: "",
|
|
1163
1164
|
answer: null,
|
|
@@ -1173,15 +1174,16 @@ class de {
|
|
|
1173
1174
|
*/
|
|
1174
1175
|
stop({ key: A, errorList: e, status: n, answer: r }) {
|
|
1175
1176
|
if (!o(this, Z)) {
|
|
1176
|
-
_(this,
|
|
1177
|
+
_(this, Mt, se).call(this, "entity");
|
|
1177
1178
|
return;
|
|
1178
1179
|
}
|
|
1179
1180
|
let h = o(this, rt).get(A);
|
|
1180
|
-
e && (h.errorList = e), n && (h.status = n), r && (h.answer = r),
|
|
1181
|
+
e && (h.errorList = e), n && (h.status = n), r && (h.answer = r), Ht.actionFilter({
|
|
1181
1182
|
keyTimer: "add.entity.items",
|
|
1182
|
-
duration: o(this,
|
|
1183
|
-
action: () => {
|
|
1184
|
-
|
|
1183
|
+
duration: o(this, Ft),
|
|
1184
|
+
action: async () => {
|
|
1185
|
+
var c;
|
|
1186
|
+
await _(this, Wt, he).call(this), (c = h == null ? void 0 : h.data) != null && c.updateList && d(this, ht, !0);
|
|
1185
1187
|
}
|
|
1186
1188
|
});
|
|
1187
1189
|
}
|
|
@@ -1190,7 +1192,7 @@ class de {
|
|
|
1190
1192
|
*/
|
|
1191
1193
|
async getEntityList(A) {
|
|
1192
1194
|
var r;
|
|
1193
|
-
if ((r = o(this, V)) != null && r.length)
|
|
1195
|
+
if ((r = o(this, V)) != null && r.length && !o(this, ht))
|
|
1194
1196
|
return o(this, V);
|
|
1195
1197
|
let e = new x(BX24.callBatch), { entityList: n } = await e.batch({
|
|
1196
1198
|
entityList: {
|
|
@@ -1202,34 +1204,34 @@ class de {
|
|
|
1202
1204
|
}
|
|
1203
1205
|
}, A);
|
|
1204
1206
|
return n = n.map((h) => {
|
|
1205
|
-
const { ID:
|
|
1207
|
+
const { ID: c, DATE_CREATE: O, DETAIL_TEXT: u } = h;
|
|
1206
1208
|
return {
|
|
1207
1209
|
...JSON.parse(u),
|
|
1208
|
-
id:
|
|
1210
|
+
id: c,
|
|
1209
1211
|
dateCreate: O
|
|
1210
1212
|
};
|
|
1211
|
-
}), n;
|
|
1213
|
+
}), d(this, ht, !1), n;
|
|
1212
1214
|
}
|
|
1213
1215
|
/** Выгрузка всех данных из хранилища в JSON-файл */
|
|
1214
1216
|
async downAllEntityJson() {
|
|
1215
|
-
let A = await this.getEntityList(), e =
|
|
1216
|
-
|
|
1217
|
+
let A = await this.getEntityList(), e = Dt().format("%Y-%m-%d");
|
|
1218
|
+
Ht.downloadFileJson(A, `sdklogger-entity-data__${e}`);
|
|
1217
1219
|
}
|
|
1218
1220
|
}
|
|
1219
|
-
J = new WeakMap(), Z = new WeakMap(),
|
|
1221
|
+
J = new WeakMap(), Z = new WeakMap(), Ft = new WeakMap(), rt = new WeakMap(), Lt = new WeakMap(), V = new WeakMap(), ht = new WeakMap(), Pt = new WeakSet(), ae = async function() {
|
|
1220
1222
|
const A = new x(BX24.callBatch), e = BX24.isAdmin(), { curUser: n } = await A.batch({
|
|
1221
1223
|
curUser: { method: "user.current" }
|
|
1222
1224
|
});
|
|
1223
|
-
|
|
1224
|
-
},
|
|
1225
|
-
A == "entity" &&
|
|
1225
|
+
d(this, Lt, { isAdmin: e, curUser: n });
|
|
1226
|
+
}, Mt = new WeakSet(), se = function(A) {
|
|
1227
|
+
A == "entity" && Ht.actionFilter({
|
|
1226
1228
|
keyTimer: "error.logger.entity",
|
|
1227
1229
|
duration: 500,
|
|
1228
1230
|
action: () => {
|
|
1229
1231
|
console.error("Хранилище для логгера не инициализировано");
|
|
1230
1232
|
}
|
|
1231
1233
|
});
|
|
1232
|
-
},
|
|
1234
|
+
}, Wt = new WeakSet(), he = async function() {
|
|
1233
1235
|
let A = {}, e = new x(BX24.callBatch);
|
|
1234
1236
|
for (let [n, r] of o(this, rt).entries())
|
|
1235
1237
|
r.status && (A[n] = {
|
|
@@ -1242,20 +1244,21 @@ J = new WeakMap(), Z = new WeakMap(), Ct = new WeakMap(), rt = new WeakMap(), St
|
|
|
1242
1244
|
});
|
|
1243
1245
|
if (Object.keys(A).length) {
|
|
1244
1246
|
let n = await e.batch(A), { errors: r } = e;
|
|
1245
|
-
for (let [h,
|
|
1247
|
+
for (let [h, c] of Object.entries({ ...n, ...r }))
|
|
1246
1248
|
o(this, rt).delete(h);
|
|
1249
|
+
return !0;
|
|
1247
1250
|
}
|
|
1248
|
-
},
|
|
1251
|
+
}, Jt = new WeakSet(), ce = async function() {
|
|
1249
1252
|
let A = new x(BX24.callBatch), { serverTime: e } = await A.batch({
|
|
1250
1253
|
serverTime: { method: "server.time" }
|
|
1251
1254
|
});
|
|
1252
|
-
o(this, V) ||
|
|
1255
|
+
o(this, V) || d(this, V, await this.getEntityList());
|
|
1253
1256
|
let n = o(this, V).filter((r) => {
|
|
1254
1257
|
let { dateCreate: h } = r;
|
|
1255
|
-
return
|
|
1258
|
+
return Dt(new Date(h)).between(Dt(new Date(e)), "month") >= this.periodClear;
|
|
1256
1259
|
});
|
|
1257
|
-
_(this,
|
|
1258
|
-
},
|
|
1260
|
+
_(this, kt, le).call(this, n);
|
|
1261
|
+
}, kt = new WeakSet(), le = async function(A) {
|
|
1259
1262
|
let e = new x(BX24.callBatch), n = A.map((r) => {
|
|
1260
1263
|
let { id: h } = r;
|
|
1261
1264
|
return {
|
|
@@ -1268,14 +1271,14 @@ J = new WeakMap(), Z = new WeakMap(), Ct = new WeakMap(), rt = new WeakMap(), St
|
|
|
1268
1271
|
});
|
|
1269
1272
|
return await e.batch(n);
|
|
1270
1273
|
};
|
|
1271
|
-
const B = new
|
|
1272
|
-
var
|
|
1273
|
-
class
|
|
1274
|
+
const B = new Ee();
|
|
1275
|
+
var Xt, ue, xt, me;
|
|
1276
|
+
class Te {
|
|
1274
1277
|
constructor(A) {
|
|
1275
1278
|
/** Запрос данных о приложении */
|
|
1276
|
-
f(this, kt);
|
|
1277
|
-
/** Запрос данных о текущем пользователе */
|
|
1278
1279
|
f(this, Xt);
|
|
1280
|
+
/** Запрос данных о текущем пользователе */
|
|
1281
|
+
f(this, xt);
|
|
1279
1282
|
C(this, "domain", "");
|
|
1280
1283
|
C(this, "isAdmin", !1);
|
|
1281
1284
|
C(this, "appInfo", null);
|
|
@@ -1291,10 +1294,10 @@ class ge {
|
|
|
1291
1294
|
window.BX24 && BX24.init(async () => {
|
|
1292
1295
|
console.info("init BX24"), clearInterval(e), this.domain = BX24.getDomain(), this.isAdmin = BX24.isAdmin(), this.placeInfo = BX24.placement.info(), await B.init();
|
|
1293
1296
|
const [n, r] = await Promise.all([
|
|
1294
|
-
_(this,
|
|
1295
|
-
_(this,
|
|
1297
|
+
_(this, Xt, ue).call(this),
|
|
1298
|
+
_(this, xt, me).call(this)
|
|
1296
1299
|
]);
|
|
1297
|
-
this.appInfo = n, this.userInfo = r, new
|
|
1300
|
+
this.appInfo = n, this.userInfo = r, new oe().noSleep(), A(!0);
|
|
1298
1301
|
});
|
|
1299
1302
|
}, 100);
|
|
1300
1303
|
});
|
|
@@ -1326,13 +1329,13 @@ class ge {
|
|
|
1326
1329
|
data: { method: A, params: e, updateList: n }
|
|
1327
1330
|
});
|
|
1328
1331
|
return new Promise((h) => {
|
|
1329
|
-
e || (e = {}), BX24.callMethod(A, e, function(
|
|
1332
|
+
e || (e = {}), BX24.callMethod(A, e, function(c) {
|
|
1330
1333
|
let O = {};
|
|
1331
|
-
if (
|
|
1332
|
-
for (let [u, i] of Object.entries(
|
|
1334
|
+
if (c != null && c.answer)
|
|
1335
|
+
for (let [u, i] of Object.entries(c.answer))
|
|
1333
1336
|
u != "result" && i && (O[u] = i);
|
|
1334
|
-
if (
|
|
1335
|
-
let u =
|
|
1337
|
+
if (c.error()) {
|
|
1338
|
+
let u = c.error();
|
|
1336
1339
|
console.error(u), B.stop({
|
|
1337
1340
|
answer: O,
|
|
1338
1341
|
key: r,
|
|
@@ -1340,7 +1343,7 @@ class ge {
|
|
|
1340
1343
|
errorList: [u.toSting()]
|
|
1341
1344
|
}), h(!1);
|
|
1342
1345
|
} else {
|
|
1343
|
-
let u =
|
|
1346
|
+
let u = c.data();
|
|
1344
1347
|
u != null && u.items && (u = u.items), B.stop({
|
|
1345
1348
|
answer: O,
|
|
1346
1349
|
key: r,
|
|
@@ -1370,32 +1373,32 @@ class ge {
|
|
|
1370
1373
|
* }}
|
|
1371
1374
|
*/
|
|
1372
1375
|
async batch(A, e, { updateList: n, errorCall: r, limitCommandSerial: h } = {}) {
|
|
1373
|
-
let
|
|
1376
|
+
let c = new x(BX24.callBatch), O = B.start({
|
|
1374
1377
|
type: "batch",
|
|
1375
1378
|
data: { commandList: A, updateList: n }
|
|
1376
1379
|
});
|
|
1377
|
-
h && (
|
|
1380
|
+
h && (c.limitCommandSerial = h);
|
|
1378
1381
|
try {
|
|
1379
|
-
let u = await
|
|
1380
|
-
if (Object.keys(
|
|
1381
|
-
let i = Object.entries(
|
|
1382
|
+
let u = await c.batch(A, e);
|
|
1383
|
+
if (Object.keys(c.errors).length) {
|
|
1384
|
+
let i = Object.entries(c.errors).map(([T, g]) => {
|
|
1382
1385
|
var m;
|
|
1383
1386
|
return {
|
|
1384
1387
|
key: T,
|
|
1385
1388
|
error: `${g == null ? void 0 : g.method} ${(m = g == null ? void 0 : g.error) == null ? void 0 : m.toString()}`.trim()
|
|
1386
1389
|
};
|
|
1387
1390
|
});
|
|
1388
|
-
r && r(
|
|
1391
|
+
r && r(c.errors), B.stop({
|
|
1389
1392
|
key: O,
|
|
1390
1393
|
status: "fail",
|
|
1391
1394
|
errorList: i,
|
|
1392
|
-
answer:
|
|
1395
|
+
answer: c.answerData
|
|
1393
1396
|
});
|
|
1394
1397
|
} else
|
|
1395
1398
|
B.stop({
|
|
1396
1399
|
key: O,
|
|
1397
1400
|
status: "success",
|
|
1398
|
-
answer:
|
|
1401
|
+
answer: c.answerData
|
|
1399
1402
|
});
|
|
1400
1403
|
return u;
|
|
1401
1404
|
} catch (u) {
|
|
@@ -1404,7 +1407,7 @@ class ge {
|
|
|
1404
1407
|
key: O,
|
|
1405
1408
|
status: "fail-runtime",
|
|
1406
1409
|
errorList: [i],
|
|
1407
|
-
answer:
|
|
1410
|
+
answer: c.answerData
|
|
1408
1411
|
}), console.error(u), !1;
|
|
1409
1412
|
}
|
|
1410
1413
|
}
|
|
@@ -1420,14 +1423,14 @@ class ge {
|
|
|
1420
1423
|
try {
|
|
1421
1424
|
let h = await n.batchTotalCount(A, e);
|
|
1422
1425
|
if (Object.keys(n.errors).length) {
|
|
1423
|
-
let
|
|
1426
|
+
let c = Object.entries(n.errors).map(([O, u]) => ({
|
|
1424
1427
|
key: O,
|
|
1425
1428
|
error: u.toSting()
|
|
1426
1429
|
}));
|
|
1427
1430
|
B.stop({
|
|
1428
1431
|
key: r,
|
|
1429
1432
|
status: "fail",
|
|
1430
|
-
errorList:
|
|
1433
|
+
errorList: c
|
|
1431
1434
|
});
|
|
1432
1435
|
} else
|
|
1433
1436
|
B.stop({
|
|
@@ -1450,8 +1453,8 @@ class ge {
|
|
|
1450
1453
|
/** Встройка приложения в place */
|
|
1451
1454
|
async placementBind(A) {
|
|
1452
1455
|
this.placeData || (this.placeData = await this.getPlacement());
|
|
1453
|
-
const { appName: e, pathApp: n } = this.appConst, r = this.placeData.map((
|
|
1454
|
-
let h = this.placeData.find((
|
|
1456
|
+
const { appName: e, pathApp: n } = this.appConst, r = this.placeData.map((c) => c.placement);
|
|
1457
|
+
let h = this.placeData.find((c) => c.placement == A);
|
|
1455
1458
|
r.includes(A) ? h.handler != n && (window.placementUnBind || (window.placementUnBind = {}), window.placementUnBind[A] || this.placementUnBind(h).then(() => {
|
|
1456
1459
|
window.placementUnBind[A] || (window.placementUnBind[A] = !0, this.placementBind(A));
|
|
1457
1460
|
})) : this.call({
|
|
@@ -1465,8 +1468,8 @@ class ge {
|
|
|
1465
1468
|
}
|
|
1466
1469
|
}
|
|
1467
1470
|
}
|
|
1468
|
-
}).then((
|
|
1469
|
-
|
|
1471
|
+
}).then((c) => {
|
|
1472
|
+
c ? console.info("Приложение успешно встроено в", A) : console.warn("Приложение не может быть встроено в", A);
|
|
1470
1473
|
});
|
|
1471
1474
|
}
|
|
1472
1475
|
/** Отвязка встройки из place */
|
|
@@ -1498,7 +1501,7 @@ class ge {
|
|
|
1498
1501
|
}
|
|
1499
1502
|
/* регистрация бота */
|
|
1500
1503
|
regBot({ code: A, type: e, name: n }) {
|
|
1501
|
-
const { appName: r, pathApp: h, chatBotLogo:
|
|
1504
|
+
const { appName: r, pathApp: h, chatBotLogo: c } = this.appConst, O = this.appInfo.ID;
|
|
1502
1505
|
return this.call({
|
|
1503
1506
|
method: "imbot.register",
|
|
1504
1507
|
params: {
|
|
@@ -1522,7 +1525,7 @@ class ge {
|
|
|
1522
1525
|
// Цвет чат-бота для мобильного приложения RED, GREEN, MINT, LIGHT_BLUE, DARK_BLUE, PURPLE, AQUA, PINK, LIME, BROWN, AZURE, KHAKI, SAND, MARENGO, GRAY, GRAPHITE
|
|
1523
1526
|
EMAIL: "",
|
|
1524
1527
|
// E-mail для связи. НЕЛЬЗЯ использовать e-mail, дублирующий e-mail реальных пользователей
|
|
1525
|
-
PERSONAL_BIRTHDAY:
|
|
1528
|
+
PERSONAL_BIRTHDAY: Dt().format("%Y-%m-%d"),
|
|
1526
1529
|
// День рождения в формате YYYY-mm-dd
|
|
1527
1530
|
WORK_POSITION: "Почтальон",
|
|
1528
1531
|
// Занимаемая должность, используется как описание чат-бота
|
|
@@ -1530,7 +1533,7 @@ class ge {
|
|
|
1530
1533
|
// Ссылка на сайт
|
|
1531
1534
|
PERSONAL_GENDER: "M",
|
|
1532
1535
|
// Пол чат-бота, допустимые значения M - мужской, F - женский, пусто, если не требуется указывать
|
|
1533
|
-
PERSONAL_PHOTO:
|
|
1536
|
+
PERSONAL_PHOTO: c ?? ""
|
|
1534
1537
|
// Аватар чат-бота - base64
|
|
1535
1538
|
}
|
|
1536
1539
|
}
|
|
@@ -1550,15 +1553,15 @@ class ge {
|
|
|
1550
1553
|
return B.getEntityList(A);
|
|
1551
1554
|
}
|
|
1552
1555
|
}
|
|
1553
|
-
|
|
1556
|
+
Xt = new WeakSet(), ue = function() {
|
|
1554
1557
|
return this.call({ method: "app.info" });
|
|
1555
|
-
},
|
|
1558
|
+
}, xt = new WeakSet(), me = function() {
|
|
1556
1559
|
return this.call({ method: "user.current" });
|
|
1557
1560
|
};
|
|
1558
1561
|
export {
|
|
1559
1562
|
x as Batch,
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1563
|
+
Te as BxBoot,
|
|
1564
|
+
oe as BxHelper,
|
|
1565
|
+
Ee as BxLogger,
|
|
1566
|
+
Dt as tempus
|
|
1564
1567
|
};
|