szdl-utils-kit 0.2.22 → 0.2.24
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 +389 -389
- package/dist/index.umd.cjs +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var fe = Object.defineProperty;
|
|
2
|
+
var Ne = (y, A, e) => A in y ? fe(y, A, { enumerable: !0, configurable: !0, writable: !0, value: e }) : y[A] = e;
|
|
3
|
+
var U = (y, A, e) => (Ne(y, typeof A != "symbol" ? A + "" : A, e), e), xt = (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) => (xt(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
|
-
}, d = (y, A, e, n) => (
|
|
12
|
-
var _ = (y, A, e) => (
|
|
13
|
-
var
|
|
14
|
-
function
|
|
11
|
+
}, d = (y, A, e, n) => (xt(y, A, "write to private field"), n ? n.call(y, e) : A.set(y, e), e);
|
|
12
|
+
var _ = (y, A, e) => (xt(y, A, "access private method"), e);
|
|
13
|
+
var _e = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
14
|
+
function Oe(y) {
|
|
15
15
|
return y && y.__esModule && Object.prototype.hasOwnProperty.call(y, "default") ? y.default : y;
|
|
16
16
|
}
|
|
17
|
-
var
|
|
17
|
+
var jt = { exports: {} };
|
|
18
18
|
(function(y, A) {
|
|
19
19
|
(function(e) {
|
|
20
20
|
Array.prototype.indexOf || (Array.prototype.indexOf = function(t, s) {
|
|
21
|
-
var
|
|
22
|
-
for (
|
|
23
|
-
if (this[
|
|
24
|
-
return
|
|
21
|
+
var h, c;
|
|
22
|
+
for (h = s || 0, c = this.length; h < c; h += 1)
|
|
23
|
+
if (this[h] === t)
|
|
24
|
+
return h;
|
|
25
25
|
return -1;
|
|
26
26
|
});
|
|
27
27
|
var n = this, r = function(t, s) {
|
|
28
|
-
for (var
|
|
29
|
-
|
|
30
|
-
return
|
|
31
|
-
},
|
|
28
|
+
for (var h = t.toString(); h.length < s; )
|
|
29
|
+
h = "0" + h;
|
|
30
|
+
return h;
|
|
31
|
+
}, a = 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
|
|
35
|
-
return
|
|
33
|
+
}, l = function(t, s) {
|
|
34
|
+
var h, c = "";
|
|
35
|
+
return h = t.slice(s, s + 1), h !== "" && !isNaN(Number(h)) && (c += "%H"), h = t.charAt(s + 2), h !== "" && h === ":" && (c += h), h = t.slice(s + 3, s + 4), h !== "" && !isNaN(Number(h)) && (c += "%M"), h = t.charAt(s + 5), h !== "" && h === ":" && (c += h), h = t.slice(s + 6, s + 7), h !== "" && !isNaN(Number(h)) && (c += "%S"), c;
|
|
36
36
|
}, O = function(t, s) {
|
|
37
|
-
var
|
|
37
|
+
var h, c = [
|
|
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(c[0])) && !isNaN(Number(c[2])) && !isNaN(Number(c[4])) ? (c[1] === "." && c[3] === "." ? h = "%d.%m.%Y" : c[1] === "-" && c[3] === "-" ? h = "%m-%d-%Y" : c[1] === "/" && c[3] === "/" && (h = "%m/%d/%Y"), h) : (L = [
|
|
45
45
|
t.slice(s, s + 3),
|
|
46
46
|
t.charAt(s + 4),
|
|
47
47
|
t.slice(s + 5, s + 6),
|
|
48
48
|
t.charAt(s + 7),
|
|
49
49
|
t.slice(s + 8, s + 9)
|
|
50
|
-
], !isNaN(Number(L[0])) && !isNaN(Number(L[2])) && !isNaN(Number(L[4])) ? (L[1] === "-" && L[3] === "-" && (
|
|
51
|
-
}, u = n.tempus, i, T,
|
|
50
|
+
], !isNaN(Number(L[0])) && !isNaN(Number(L[2])) && !isNaN(Number(L[4])) ? (L[1] === "-" && L[3] === "-" && (h = "%Y-%m-%d"), h) : "");
|
|
51
|
+
}, u = n.tempus, i, T, E = n.navigator || {}, m = "en", N = {
|
|
52
52
|
en: {
|
|
53
53
|
JANUARY_SHORT: "Jan",
|
|
54
54
|
FEBRUARY_SHORT: "Feb",
|
|
@@ -224,7 +224,7 @@ var Qt = { exports: {} };
|
|
|
224
224
|
N[m].NOVEMBER_LONG,
|
|
225
225
|
N[m].DECEMBER_LONG
|
|
226
226
|
];
|
|
227
|
-
},
|
|
227
|
+
}, at = function() {
|
|
228
228
|
return [
|
|
229
229
|
N[m].JANUARY_SHORT,
|
|
230
230
|
N[m].FEBRUARY_SHORT,
|
|
@@ -239,7 +239,7 @@ var Qt = { exports: {} };
|
|
|
239
239
|
N[m].NOVEMBER_SHORT,
|
|
240
240
|
N[m].DECEMBER_SHORT
|
|
241
241
|
];
|
|
242
|
-
},
|
|
242
|
+
}, V = function() {
|
|
243
243
|
return [
|
|
244
244
|
N[m].SUNDAY_LONG,
|
|
245
245
|
N[m].MONDAY_LONG,
|
|
@@ -249,7 +249,7 @@ var Qt = { exports: {} };
|
|
|
249
249
|
N[m].FRIDAY_LONG,
|
|
250
250
|
N[m].SATURDAY_LONG
|
|
251
251
|
];
|
|
252
|
-
},
|
|
252
|
+
}, J = function() {
|
|
253
253
|
return [
|
|
254
254
|
N[m].SUNDAY_SHORT,
|
|
255
255
|
N[m].MONDAY_SHORT,
|
|
@@ -259,13 +259,13 @@ var Qt = { exports: {} };
|
|
|
259
259
|
N[m].FRIDAY_SHORT,
|
|
260
260
|
N[m].SATURDAY_SHORT
|
|
261
261
|
];
|
|
262
|
-
},
|
|
263
|
-
var
|
|
264
|
-
n.XMLHttpRequest ?
|
|
265
|
-
|
|
266
|
-
https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.parse(
|
|
267
|
-
},
|
|
268
|
-
},
|
|
262
|
+
}, F, Mt, lt, ct, me = function(t, s, h) {
|
|
263
|
+
var c;
|
|
264
|
+
n.XMLHttpRequest ? c = new XMLHttpRequest() : c = new ActiveXObject("Microsoft.XMLHTTP"), c.onreadystatechange = function() {
|
|
265
|
+
c.readyState === 4 && (c.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(c.responseText))) : h && h(c));
|
|
267
|
+
}, c.open("GET", t, !1), c.send();
|
|
268
|
+
}, I = {
|
|
269
269
|
"%d": {
|
|
270
270
|
format: function(t) {
|
|
271
271
|
return r(t.day() || i.MIN_DAY, 2);
|
|
@@ -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 ct[s !== e ? s : i.MIN_DAY_OF_WEEK];
|
|
320
320
|
},
|
|
321
321
|
parse: function() {
|
|
322
322
|
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 Mt[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);
|
|
@@ -353,7 +353,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
353
353
|
"%B": {
|
|
354
354
|
format: function(t) {
|
|
355
355
|
var s = i.options("monthFromZero") ? t.month() : t.month() - 1;
|
|
356
|
-
return
|
|
356
|
+
return F[s !== e ? s : i.MIN_MONTH];
|
|
357
357
|
},
|
|
358
358
|
parse: function(t) {
|
|
359
359
|
var s = i.monthNames(!0).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)),
|
|
418
|
+
var s = Number(t.slice(0, 4)), h = Number(t.slice(5, 7)), c = Number(t.slice(8, 10));
|
|
419
419
|
return {
|
|
420
420
|
year: s,
|
|
421
|
-
month:
|
|
422
|
-
day:
|
|
421
|
+
month: h,
|
|
422
|
+
day: c
|
|
423
423
|
};
|
|
424
424
|
},
|
|
425
425
|
minLength: 10,
|
|
@@ -431,22 +431,22 @@ 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)),
|
|
434
|
+
var s = Number(t.slice(0, 2)), h = Number(t.slice(3, 5)), c = Number(t.slice(6, 10));
|
|
435
435
|
return {
|
|
436
|
-
year:
|
|
436
|
+
year: c,
|
|
437
437
|
month: s,
|
|
438
|
-
day:
|
|
438
|
+
day: h
|
|
439
439
|
};
|
|
440
440
|
},
|
|
441
441
|
minLength: 10,
|
|
442
442
|
maxLength: 10,
|
|
443
443
|
type: "string"
|
|
444
444
|
}
|
|
445
|
-
},
|
|
445
|
+
}, pt = {
|
|
446
446
|
useMilliseconds: !1,
|
|
447
447
|
monthFromZero: !1
|
|
448
448
|
}, R;
|
|
449
|
-
R = function(t, s,
|
|
449
|
+
R = function(t, s, h) {
|
|
450
450
|
return this._d = /* @__PURE__ */ new Date(), this._i = {
|
|
451
451
|
year: !1,
|
|
452
452
|
month: !1,
|
|
@@ -455,7 +455,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
455
455
|
minutes: !1,
|
|
456
456
|
seconds: !1,
|
|
457
457
|
milliseconds: !1
|
|
458
|
-
}, t !== e && this.set(t, s,
|
|
458
|
+
}, t !== e && this.set(t, s, h), this;
|
|
459
459
|
}, R.fn = R.prototype, R.fn.dayCount = function() {
|
|
460
460
|
var t = this.month(), s = i.MAX_DAY_IN_MONTHS[t - (i.options("monthFromZero") ? 0 : 1)];
|
|
461
461
|
return this.leapYear() && t === (i.options("monthFromZero") ? 1 : 2) && (s += 1), s;
|
|
@@ -504,7 +504,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
504
504
|
}, R.fn.week = function() {
|
|
505
505
|
var t = new Date(this.year(), 0, 1), s = i(this.utc()).hours(0).minutes(0).seconds(0).milliseconds(0).utc() * 1e3;
|
|
506
506
|
return Math.ceil(((s - t.getTime()) / 864e5 + t.getDay() + 1) / 7);
|
|
507
|
-
}, R.fn.set = function(t, s,
|
|
507
|
+
}, R.fn.set = function(t, s, h) {
|
|
508
508
|
if (this._i = {
|
|
509
509
|
year: !1,
|
|
510
510
|
month: !1,
|
|
@@ -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 c, L = [], g, S, k = [], H = 0, D = 0, M, w, p = {}, b;
|
|
524
524
|
if (t === e)
|
|
525
|
-
return
|
|
525
|
+
return g = a(this, h), g === e && (this._i = {
|
|
526
526
|
year: -1,
|
|
527
527
|
month: -1,
|
|
528
528
|
day: -1,
|
|
@@ -530,26 +530,26 @@ 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
|
+
}), g;
|
|
534
534
|
for (s === e && (s = i.detectFormat(t)); H < s.length; ) {
|
|
535
535
|
if (s.charAt(H) === "%") {
|
|
536
|
-
if (S = s.charAt(H) + s.charAt(H + 1),
|
|
537
|
-
switch (M = 0, w = "",
|
|
536
|
+
if (S = s.charAt(H) + s.charAt(H + 1), I[S] !== e) {
|
|
537
|
+
switch (M = 0, w = "", I[S].type) {
|
|
538
538
|
case "number":
|
|
539
|
-
for (; M <
|
|
539
|
+
for (; M < I[S].maxLength && D + M < t.length && !isNaN(Number(t.charAt(D + M))); )
|
|
540
540
|
w += t.charAt(D + M), M += 1;
|
|
541
541
|
break;
|
|
542
542
|
case "word":
|
|
543
|
-
for (; M <
|
|
543
|
+
for (; M < I[S].maxLength && D + M < t.length && /^[\u00BF-\u1FFF\u2C00-\uD7FF\w]+$/.test(t.charAt(D + M)); )
|
|
544
544
|
w += t.charAt(D + M), M += 1;
|
|
545
545
|
break;
|
|
546
546
|
case "string":
|
|
547
|
-
for (; M <
|
|
547
|
+
for (; M < I[S].maxLength && D + M < t.length; )
|
|
548
548
|
w += t.charAt(D + M), M += 1;
|
|
549
549
|
break;
|
|
550
550
|
}
|
|
551
|
-
if (M <
|
|
552
|
-
return
|
|
551
|
+
if (M < I[S].minLength)
|
|
552
|
+
return g = a(this, h), g === 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
|
-
}),
|
|
561
|
-
L.push(S),
|
|
560
|
+
}), g;
|
|
561
|
+
L.push(S), k.push(w), M -= 1, D += M, H += 1;
|
|
562
562
|
}
|
|
563
563
|
} else if (t.charAt(D) !== s.charAt(H))
|
|
564
|
-
return
|
|
564
|
+
return g = a(this, h), g === 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
|
+
}), g;
|
|
573
573
|
H += 1, D += 1;
|
|
574
574
|
}
|
|
575
|
-
for (
|
|
576
|
-
L.hasOwnProperty(
|
|
575
|
+
for (c in L)
|
|
576
|
+
L.hasOwnProperty(c) && I.hasOwnProperty(L[c]) && (b = I[L[c]].parse(k[c]), 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,
|
|
@@ -595,7 +595,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
595
595
|
if (t === "long")
|
|
596
596
|
return lt[this._d.getDay()];
|
|
597
597
|
if (t === "short")
|
|
598
|
-
return
|
|
598
|
+
return ct[this._d.getDay()];
|
|
599
599
|
if (t === e)
|
|
600
600
|
return this._d.getDay();
|
|
601
601
|
if (t === 0 || t === "Sunday")
|
|
@@ -671,130 +671,130 @@ 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,
|
|
675
|
-
t.charAt(s) === "%" ? (
|
|
676
|
-
return
|
|
674
|
+
for (var s = 0, h = "", c; s < t.length; )
|
|
675
|
+
t.charAt(s) === "%" ? (c = t.charAt(s) + t.charAt(s + 1), I[c] !== e ? (h += I[c].format(this), s += 1) : h += "%") : h += t.charAt(s), s += 1;
|
|
676
|
+
return h;
|
|
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
|
|
682
|
+
var h = this.timestamp(), c = t.timestamp();
|
|
683
683
|
switch (s) {
|
|
684
684
|
case "year":
|
|
685
|
-
return Math.floor((
|
|
685
|
+
return Math.floor((c - h) / 31556952);
|
|
686
686
|
case "month":
|
|
687
|
-
return Math.floor((
|
|
687
|
+
return Math.floor((c - h) / 2629746);
|
|
688
688
|
case "day":
|
|
689
|
-
return Math.floor((
|
|
689
|
+
return Math.floor((c - h) / 86400);
|
|
690
690
|
case "hours":
|
|
691
|
-
return Math.floor((
|
|
691
|
+
return Math.floor((c - h) / 3600);
|
|
692
692
|
case "minutes":
|
|
693
|
-
return Math.floor((
|
|
693
|
+
return Math.floor((c - h) / 60);
|
|
694
694
|
case "seconds":
|
|
695
|
-
return
|
|
695
|
+
return c - h;
|
|
696
696
|
default:
|
|
697
697
|
return e;
|
|
698
698
|
}
|
|
699
699
|
}, R.fn.calc = function(t) {
|
|
700
700
|
return t.year !== e && this._d.setFullYear(this._d.getFullYear() + t.year), t.month !== e && this._d.setMonth(this._d.getMonth() + t.month), t.day !== e && this._d.setDate(this._d.getDate() + t.day), t.hours !== e && this._d.setHours(this._d.getHours() + t.hours), t.minutes !== e && this._d.setMinutes(this._d.getMinutes() + t.minutes), t.seconds !== e && this._d.setSeconds(this._d.getSeconds() + t.seconds), t.milliseconds !== e && this._d.setMilliseconds(this._d.getMilliseconds() + t.milliseconds), this;
|
|
701
|
-
}, i = function(t, s,
|
|
702
|
-
return new R(t, s,
|
|
701
|
+
}, i = function(t, s, h) {
|
|
702
|
+
return new R(t, s, h);
|
|
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 pt;
|
|
706
|
+
if (pt.hasOwnProperty(t)) {
|
|
707
707
|
if (s === e)
|
|
708
|
-
return
|
|
709
|
-
|
|
708
|
+
return pt[t];
|
|
709
|
+
pt[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,
|
|
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 ?
|
|
715
|
+
var s, h, c, L, g, S, k, 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 ? h = t.dateTo.utc() : h = i(t.dateTo, t.formatTo !== e ? t.formatTo : t.formatFrom).utc()), typeof t.period == "number" ? g = {
|
|
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" ? g = {
|
|
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" && (g = {
|
|
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,
|
|
734
734
|
hours: t.period.hours !== e ? t.period.hours : 0,
|
|
735
735
|
minutes: t.period.minutes !== e ? t.period.minutes : 0,
|
|
736
736
|
seconds: t.period.seconds !== e ? t.period.seconds : 0
|
|
737
|
-
}), t.groupBy === e ? S = t.asObject === !0 ? {} : [] : (S = [], S.push([]),
|
|
737
|
+
}), t.groupBy === e ? S = t.asObject === !0 ? {} : [] : (S = [], S.push([]), k = i(s).get()[t.groupBy]), H = function(w, p, b) {
|
|
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: g.year ? -g.year : e,
|
|
742
|
+
month: g.month ? -g.month : e,
|
|
743
|
+
day: g.day ? -g.day : e,
|
|
744
|
+
hours: g.hours ? -g.hours : e,
|
|
745
|
+
minutes: g.minutes ? -g.minutes : e,
|
|
746
|
+
seconds: g.seconds ? -g.seconds : e,
|
|
747
|
+
milliseconds: g.milliseconds ? -g.milliseconds : e
|
|
748
748
|
};
|
|
749
|
-
for (
|
|
750
|
-
H(S[S.length - 1],
|
|
749
|
+
for (c = i(s).calc(D).utc(); i(c).get()[t.groupBy] === k; )
|
|
750
|
+
H(S[S.length - 1], c, !0), c = i(c).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 (c = i(s).dayOfWeek(0).utc(); S[0].length < M && c < s; )
|
|
754
|
+
H(S[S.length - 1], c, !0), c = i(c).calc(g).utc();
|
|
755
755
|
}
|
|
756
756
|
}
|
|
757
|
-
for (; s <=
|
|
758
|
-
t.groupBy === e ? H(S, s) : i(s).get()[t.groupBy] ===
|
|
757
|
+
for (; s <= h; )
|
|
758
|
+
t.groupBy === e ? H(S, s) : i(s).get()[t.groupBy] === k ? H(S[S.length - 1], s) : (S.push([]), H(S[S.length - 1], s), k = i(s).get()[t.groupBy]), s = i(s).calc(g).utc();
|
|
759
759
|
if (t.groupBy !== e && t.fillNulls)
|
|
760
|
-
for (L = i(
|
|
761
|
-
H(S[S.length - 1], L, !0), L = i(L).calc(
|
|
760
|
+
for (L = i(h).calc(g).utc(); i(L).get()[t.groupBy] === k; )
|
|
761
|
+
H(S[S.length - 1], L, !0), L = i(L).calc(g).utc();
|
|
762
762
|
return S;
|
|
763
763
|
}, i.monthNames = function(t) {
|
|
764
764
|
switch (t) {
|
|
765
765
|
case "long":
|
|
766
|
-
return
|
|
766
|
+
return F;
|
|
767
767
|
default:
|
|
768
|
-
return
|
|
768
|
+
return Mt;
|
|
769
769
|
}
|
|
770
770
|
}, i.dayNames = function(t) {
|
|
771
771
|
switch (t) {
|
|
772
772
|
case "long":
|
|
773
773
|
return lt;
|
|
774
774
|
default:
|
|
775
|
-
return
|
|
775
|
+
return ct;
|
|
776
776
|
}
|
|
777
777
|
}, i.lang = function(t) {
|
|
778
778
|
if (t !== e)
|
|
779
|
-
m = t, N[m] === e && (m = "en"),
|
|
779
|
+
m = t, N[m] === e && (m = "en"), F = G(), Mt = at(), lt = V(), ct = J();
|
|
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,
|
|
786
|
-
|
|
785
|
+
}, i.registerFormat = function(t, s, h, c, L, g) {
|
|
786
|
+
I[t] = {
|
|
787
787
|
format: s,
|
|
788
|
-
parse:
|
|
789
|
-
minLength:
|
|
788
|
+
parse: h,
|
|
789
|
+
minLength: c,
|
|
790
790
|
maxLength: L,
|
|
791
|
-
type:
|
|
791
|
+
type: g
|
|
792
792
|
};
|
|
793
793
|
}, i.unregisterFormat = function(t) {
|
|
794
|
-
delete
|
|
794
|
+
delete I[t];
|
|
795
795
|
}, i.detectFormat = function(t) {
|
|
796
|
-
var s,
|
|
797
|
-
return s = O(t, 0), s !== "" && (
|
|
796
|
+
var s, h, c;
|
|
797
|
+
return s = O(t, 0), s !== "" && (c = 10), h = t.charAt(c), (h === "T" || h === " ") && (s += h, c += 1), s += l(t, c), s;
|
|
798
798
|
}, T = {
|
|
799
799
|
TempusDate: R
|
|
800
800
|
}, i.classes = function(t, s) {
|
|
@@ -802,258 +802,258 @@ 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" && me(t, function(s) {
|
|
806
806
|
N = s;
|
|
807
807
|
}, function(s) {
|
|
808
808
|
});
|
|
809
|
-
}, m = (
|
|
810
|
-
}).call(
|
|
811
|
-
})(
|
|
812
|
-
var
|
|
813
|
-
const
|
|
814
|
-
var
|
|
815
|
-
class
|
|
809
|
+
}, m = (E.language || E.systemLanguage || E.userLanguage || "en").substr(0, 2).toLowerCase(), N[m] === e && (m = "en"), F = G(), Mt = at(), lt = V(), ct = J(), y.exports && (A = y.exports = i), A.tempus = i;
|
|
810
|
+
}).call(_e);
|
|
811
|
+
})(jt, jt.exports);
|
|
812
|
+
var ye = jt.exports;
|
|
813
|
+
const Ht = /* @__PURE__ */ Oe(ye);
|
|
814
|
+
var z, mt, K, Y, P, x, q, v, B, j, It, $, C, tt, et, rt, Dt, ft, Qt, Nt, Zt, _t, Vt, Ot, zt, yt, Kt, Ut, se, Gt, ie, dt, qt, gt, vt, Et, $t, nt, Yt, Tt, te, wt, re, At, ut, ot, Bt, Rt, ee;
|
|
815
|
+
class X {
|
|
816
816
|
constructor(A, e = {}) {
|
|
817
|
-
f(this,
|
|
817
|
+
f(this, rt);
|
|
818
|
+
f(this, ft);
|
|
818
819
|
f(this, Nt);
|
|
819
820
|
f(this, _t);
|
|
820
821
|
f(this, Ot);
|
|
821
822
|
f(this, yt);
|
|
822
|
-
f(this,
|
|
823
|
+
f(this, Ut);
|
|
823
824
|
f(this, Gt);
|
|
824
|
-
f(this,
|
|
825
|
-
f(this, Et);
|
|
825
|
+
f(this, dt);
|
|
826
826
|
f(this, gt);
|
|
827
|
+
f(this, Et);
|
|
828
|
+
f(this, nt);
|
|
827
829
|
f(this, Tt);
|
|
830
|
+
f(this, wt);
|
|
831
|
+
f(this, At);
|
|
828
832
|
f(this, ot);
|
|
829
833
|
f(this, Rt);
|
|
830
|
-
f(this,
|
|
831
|
-
f(this,
|
|
832
|
-
f(this,
|
|
833
|
-
f(this, St);
|
|
834
|
-
f(this, K, null);
|
|
835
|
-
f(this, ft, null);
|
|
836
|
-
f(this, q, []);
|
|
834
|
+
f(this, z, null);
|
|
835
|
+
f(this, mt, null);
|
|
836
|
+
f(this, K, []);
|
|
837
837
|
f(this, Y, {});
|
|
838
|
-
f(this,
|
|
839
|
-
f(this,
|
|
840
|
-
f(this,
|
|
841
|
-
f(this,
|
|
842
|
-
f(this,
|
|
843
|
-
f(this,
|
|
844
|
-
f(this,
|
|
845
|
-
f(this,
|
|
846
|
-
f(this,
|
|
838
|
+
f(this, P, 50);
|
|
839
|
+
f(this, x, 50);
|
|
840
|
+
f(this, q, !0);
|
|
841
|
+
f(this, v, null);
|
|
842
|
+
f(this, B, null);
|
|
843
|
+
f(this, j, null);
|
|
844
|
+
f(this, It, 100);
|
|
845
|
+
f(this, $, "no");
|
|
846
|
+
f(this, C, !1);
|
|
847
|
+
f(this, tt, !1);
|
|
847
848
|
f(this, et, !1);
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
d(this, K, A), d(this, ft, e);
|
|
849
|
+
U(this, "errors", {});
|
|
850
|
+
U(this, "answerData", {});
|
|
851
|
+
d(this, z, A), d(this, mt, e);
|
|
852
852
|
}
|
|
853
853
|
get serial() {
|
|
854
|
-
return o(this,
|
|
854
|
+
return o(this, C);
|
|
855
855
|
}
|
|
856
856
|
get limitCommandSerial() {
|
|
857
|
-
return o(this,
|
|
857
|
+
return o(this, x);
|
|
858
858
|
}
|
|
859
859
|
set limitCommandSerial(A) {
|
|
860
860
|
if (A < 10)
|
|
861
861
|
throw new Error("limitCommandSerial не может быть меньше 10");
|
|
862
|
-
A >= 10 && A < 50 && (d(this,
|
|
862
|
+
A >= 10 && A < 50 && (d(this, P, A), d(this, x, A)), d(this, x, A);
|
|
863
863
|
}
|
|
864
864
|
setSerial() {
|
|
865
|
-
d(this,
|
|
865
|
+
d(this, C, !0), d(this, tt, !0), d(this, et, !1);
|
|
866
866
|
}
|
|
867
867
|
setParallel() {
|
|
868
|
-
d(this,
|
|
868
|
+
d(this, C, !1), d(this, tt, !1), d(this, et, !0);
|
|
869
869
|
}
|
|
870
870
|
stop() {
|
|
871
|
-
d(this,
|
|
871
|
+
d(this, q, !1);
|
|
872
872
|
}
|
|
873
873
|
async batch(A, e) {
|
|
874
|
-
o(this,
|
|
875
|
-
const n = _(this,
|
|
876
|
-
if (Object.keys(A).length < o(this,
|
|
877
|
-
const r = n.map((
|
|
878
|
-
return Promise.allSettled(r).then((
|
|
879
|
-
let
|
|
880
|
-
for (let O of
|
|
881
|
-
O.status === "fulfilled" && (
|
|
882
|
-
return
|
|
874
|
+
o(this, j) && _(this, ft, Qt).call(this), e && d(this, v, e), o(this, tt) === !1 && d(this, C, !1), Object.keys(A).length > o(this, x) && d(this, C, !0), d(this, q, !0), d(this, K, []), d(this, Y, {}), this.errors = {}, this.answerData = {};
|
|
875
|
+
const n = _(this, _t, Vt).call(this, A);
|
|
876
|
+
if (Object.keys(A).length < o(this, x)) {
|
|
877
|
+
const r = n.map((a, l) => _(this, Ot, zt).call(this, a, n[l]));
|
|
878
|
+
return Promise.allSettled(r).then((a) => {
|
|
879
|
+
let l = {};
|
|
880
|
+
for (let O of a)
|
|
881
|
+
O.status === "fulfilled" && (l = { ...l, ...O.value });
|
|
882
|
+
return l;
|
|
883
883
|
});
|
|
884
884
|
} else {
|
|
885
|
-
let r = {},
|
|
886
|
-
|
|
885
|
+
let r = {}, a = 0, l = 1, O = Object.keys(A).length || 1, u = (i) => {
|
|
886
|
+
a += Object.keys(i).length, l = Math.round(a / O * 100);
|
|
887
887
|
};
|
|
888
888
|
for (let [i, T] of Object.entries(n)) {
|
|
889
|
-
let
|
|
890
|
-
u(T), e && e({ percent:
|
|
889
|
+
let E = await _(this, Ot, zt).call(this, T, n[i], !0);
|
|
890
|
+
u(T), e && e({ percent: l }), r = { ...r, ...E };
|
|
891
891
|
}
|
|
892
892
|
return r;
|
|
893
893
|
}
|
|
894
894
|
}
|
|
895
895
|
async batchTotalCount(A, e) {
|
|
896
896
|
d(this, Y, {}), this.errors = {};
|
|
897
|
-
let n = 1, r = 0,
|
|
898
|
-
r += Object.keys(u).length, n = Math.round(r /
|
|
897
|
+
let n = 1, r = 0, a = Object.keys(A).length || 1, l = (u) => {
|
|
898
|
+
r += Object.keys(u).length, n = Math.round(r / a * 100);
|
|
899
899
|
};
|
|
900
900
|
e && e({ percent: n });
|
|
901
|
-
const O = _(this,
|
|
902
|
-
if (o(this,
|
|
903
|
-
const u = O.map((i) => _(this,
|
|
901
|
+
const O = _(this, _t, Vt).call(this, A);
|
|
902
|
+
if (o(this, et)) {
|
|
903
|
+
const u = O.map((i) => _(this, yt, Kt).call(this, i).then((T) => (l(i), e && e({ percent: n }), T)));
|
|
904
904
|
return Promise.allSettled(u).then((i) => {
|
|
905
905
|
let T = {};
|
|
906
|
-
for (let
|
|
907
|
-
|
|
906
|
+
for (let E of i)
|
|
907
|
+
E.status === "fulfilled" && (T = { ...T, ...E.value });
|
|
908
908
|
return T;
|
|
909
909
|
});
|
|
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, yt, Kt).call(this, i);
|
|
914
|
+
l(i), e && e({ percent: n }), u = { ...u, ...T };
|
|
915
915
|
}
|
|
916
916
|
return u;
|
|
917
917
|
}
|
|
918
918
|
}
|
|
919
919
|
}
|
|
920
|
-
|
|
920
|
+
z = new WeakMap(), mt = new WeakMap(), K = new WeakMap(), Y = new WeakMap(), P = new WeakMap(), x = new WeakMap(), q = new WeakMap(), v = new WeakMap(), B = new WeakMap(), j = new WeakMap(), It = new WeakMap(), $ = new WeakMap(), C = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), rt = new WeakSet(), Dt = function() {
|
|
921
921
|
let A = 0;
|
|
922
|
-
if (!o(this,
|
|
922
|
+
if (!o(this, B))
|
|
923
923
|
return Math.round(A);
|
|
924
924
|
let e = 0, n = 0;
|
|
925
|
-
return Object.values(o(this,
|
|
926
|
-
const { total:
|
|
927
|
-
e +=
|
|
925
|
+
return Object.values(o(this, B)).forEach((r) => {
|
|
926
|
+
const { total: a, count: l } = r;
|
|
927
|
+
e += a ?? 0, n += l ?? 0;
|
|
928
928
|
}), e ? A = n / e * 100 : A = 100, { percent: Math.round(A), allCount: n, allTotal: e };
|
|
929
|
-
},
|
|
930
|
-
clearInterval(o(this,
|
|
931
|
-
},
|
|
932
|
-
const n = _(this,
|
|
933
|
-
let
|
|
934
|
-
n && (
|
|
935
|
-
const { percent: O, allCount: u, allTotal: i } = o(this,
|
|
936
|
-
(o(this,
|
|
937
|
-
data: o(this,
|
|
929
|
+
}, ft = new WeakSet(), Qt = function() {
|
|
930
|
+
clearInterval(o(this, j)), d(this, j, ""), d(this, B, ""), d(this, v, ""), d(this, $, "no");
|
|
931
|
+
}, Nt = new WeakSet(), Zt = function({ key: A, value: e }) {
|
|
932
|
+
const n = _(this, At, ut).call(this, e.data()), r = Array.isArray(n) ? n.length : 0, a = _(this, ot, Bt).call(this, e.total(), r);
|
|
933
|
+
let l = 1;
|
|
934
|
+
n && (l = r), o(this, v) && (o(this, B) || d(this, B, {}), o(this, B)[A] && o(this, B)[A].count && (l += o(this, B)[A].count), o(this, B)[A] = { total: a, count: l }, o(this, j) || d(this, j, setInterval(() => {
|
|
935
|
+
const { percent: O, allCount: u, allTotal: i } = o(this, rt, Dt);
|
|
936
|
+
(o(this, $) === "no" || o(this, $) < o(this, rt, Dt).percent) && (o(this, v).call(this, {
|
|
937
|
+
data: o(this, B),
|
|
938
938
|
percent: O,
|
|
939
939
|
allCount: u,
|
|
940
940
|
allTotal: i
|
|
941
|
-
}), d(this,
|
|
942
|
-
}, o(this,
|
|
943
|
-
},
|
|
941
|
+
}), d(this, $, o(this, rt, Dt).percent)), O === 100 && _(this, ft, Qt).call(this);
|
|
942
|
+
}, o(this, It))));
|
|
943
|
+
}, _t = new WeakSet(), Vt = function(A) {
|
|
944
944
|
const e = [], n = Object.entries(A);
|
|
945
|
-
for (let r = 0; r < n.length; r += o(this,
|
|
946
|
-
const
|
|
947
|
-
e.push(Object.fromEntries(
|
|
945
|
+
for (let r = 0; r < n.length; r += o(this, P)) {
|
|
946
|
+
const a = n.slice(r, r + o(this, P));
|
|
947
|
+
e.push(Object.fromEntries(a));
|
|
948
948
|
}
|
|
949
949
|
return e;
|
|
950
|
-
},
|
|
950
|
+
}, Ot = new WeakSet(), zt = function(A, e, n) {
|
|
951
951
|
return new Promise((r) => {
|
|
952
|
-
const
|
|
952
|
+
const a = _(this, Tt, te).call(this, e), l = [];
|
|
953
953
|
let O = 0, u = 0;
|
|
954
|
-
o(this,
|
|
955
|
-
Object.entries(i).forEach(([T,
|
|
954
|
+
o(this, z).call(this, A, (i) => {
|
|
955
|
+
Object.entries(i).forEach(([T, E]) => {
|
|
956
956
|
let m = {};
|
|
957
|
-
const N =
|
|
957
|
+
const N = E.error();
|
|
958
958
|
if (N) {
|
|
959
|
-
let { query: { method:
|
|
960
|
-
this.errors[T] = { error: N, method:
|
|
959
|
+
let { query: { method: J }, answer: F } = E;
|
|
960
|
+
this.errors[T] = { error: N, method: J }, O += 1;
|
|
961
961
|
}
|
|
962
|
-
if (
|
|
963
|
-
for (let [
|
|
964
|
-
|
|
962
|
+
if (E != null && E.answer && Object.keys(E.answer).length) {
|
|
963
|
+
for (let [J, F] of Object.entries(E.answer))
|
|
964
|
+
J != "result" && F && (m[J] = F);
|
|
965
965
|
Object.keys(m).length && (this.answerData[T] = m);
|
|
966
966
|
}
|
|
967
|
-
const G = _(this,
|
|
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 +=
|
|
969
|
-
const
|
|
970
|
-
|
|
967
|
+
const G = _(this, At, ut).call(this, E.data()), at = Array.isArray(G) ? G.length : 0, V = _(this, ot, Bt).call(this, E.total(), at);
|
|
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 += V, n || _(this, Nt, Zt).call(this, { key: T, value: E }), V > o(this, P) && V > at) {
|
|
969
|
+
const J = Math.ceil(V / o(this, P)) - 1, F = Array.from({ length: J });
|
|
970
|
+
l.push([T, a[T], F]);
|
|
971
971
|
}
|
|
972
|
-
}), u > 5e3 && o(this,
|
|
972
|
+
}), u > 5e3 && o(this, tt) === !1 && o(this, et) === !1 && d(this, C, !0), O > 0 && _(this, Rt, ee).call(this), l.length ? (_(this, Ut, se).call(this, l), _(this, Gt, ie).call(this).then(() => r(_(this, nt, Yt).call(this)))) : r(_(this, nt, Yt).call(this));
|
|
973
973
|
});
|
|
974
974
|
});
|
|
975
|
-
},
|
|
975
|
+
}, yt = new WeakSet(), Kt = function(A) {
|
|
976
976
|
return new Promise((e) => {
|
|
977
|
-
const n = _(this,
|
|
977
|
+
const n = _(this, Tt, te).call(this, A);
|
|
978
978
|
let r = 0;
|
|
979
|
-
o(this,
|
|
980
|
-
Object.entries(
|
|
979
|
+
o(this, z).call(this, n, (a) => {
|
|
980
|
+
Object.entries(a).forEach(([l, O]) => {
|
|
981
981
|
const u = O.error();
|
|
982
|
-
u && (this.errors[
|
|
983
|
-
const i = _(this,
|
|
984
|
-
o(this, Y)[
|
|
985
|
-
}), r > 0 && _(this,
|
|
982
|
+
u && (this.errors[l] = u, r += 1);
|
|
983
|
+
const i = _(this, At, ut).call(this, O.data()), T = Array.isArray(i) ? i.length : 0, E = _(this, ot, Bt).call(this, O.total(), T);
|
|
984
|
+
o(this, Y)[l] = E;
|
|
985
|
+
}), r > 0 && _(this, Rt, ee).call(this), e(_(this, nt, Yt).call(this));
|
|
986
986
|
});
|
|
987
987
|
});
|
|
988
|
-
},
|
|
988
|
+
}, Ut = new WeakSet(), se = function(A) {
|
|
989
989
|
let e = [];
|
|
990
|
-
A.forEach(([n, r,
|
|
991
|
-
|
|
992
|
-
const u = O + 1, i = o(this,
|
|
993
|
-
e.length === o(this,
|
|
990
|
+
A.forEach(([n, r, a]) => {
|
|
991
|
+
a.forEach((l, O) => {
|
|
992
|
+
const u = O + 1, i = o(this, P) * u, E = [[n, u].join("_"), _(this, wt, re).call(this, r, i)];
|
|
993
|
+
e.length === o(this, P) ? (o(this, K).push(e), e = [E]) : e.push(E);
|
|
994
994
|
});
|
|
995
|
-
}), e.length && o(this,
|
|
996
|
-
},
|
|
995
|
+
}), e.length && o(this, K).push(e);
|
|
996
|
+
}, Gt = new WeakSet(), ie = function() {
|
|
997
997
|
const A = [], e = [], n = (r) => {
|
|
998
|
-
Object.entries(r).forEach(([
|
|
999
|
-
const [O] =
|
|
1000
|
-
Array.isArray(u) && o(this, Y)[O].push(...u), _(this,
|
|
998
|
+
Object.entries(r).forEach(([a, l]) => {
|
|
999
|
+
const [O] = a.split("_"), u = _(this, At, ut).call(this, l.data());
|
|
1000
|
+
Array.isArray(u) && o(this, Y)[O].push(...u), _(this, Nt, Zt).call(this, { key: O, value: l });
|
|
1001
1001
|
});
|
|
1002
1002
|
};
|
|
1003
|
-
return o(this,
|
|
1004
|
-
const
|
|
1005
|
-
o(this,
|
|
1003
|
+
return o(this, K).forEach((r, a) => {
|
|
1004
|
+
const l = Object.fromEntries(r), O = () => new Promise((u) => o(this, z).call(this, l, (i) => {
|
|
1005
|
+
o(this, C) ? n(i) : e[a] = i, u();
|
|
1006
1006
|
}));
|
|
1007
1007
|
A.push(O);
|
|
1008
|
-
}), o(this,
|
|
1008
|
+
}), o(this, C) ? _(this, gt, vt).call(this, A) : _(this, Et, $t).call(this, A).then(() => {
|
|
1009
1009
|
e.forEach(n);
|
|
1010
1010
|
});
|
|
1011
|
-
},
|
|
1011
|
+
}, dt = new WeakSet(), qt = function() {
|
|
1012
1012
|
return new Promise((A) => setTimeout(A, 500));
|
|
1013
|
-
}, gt = new WeakSet(),
|
|
1013
|
+
}, gt = new WeakSet(), vt = 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,
|
|
1021
|
-
},
|
|
1019
|
+
_(this, dt, qt).call(this)
|
|
1020
|
+
]).then(() => o(this, q) ? _(this, gt, vt).call(this, A) : Promise.resolve());
|
|
1021
|
+
}, Et = new WeakSet(), $t = function(A) {
|
|
1022
1022
|
if (!A.length)
|
|
1023
1023
|
return Promise.resolve();
|
|
1024
1024
|
const e = A.shift();
|
|
1025
|
-
return _(this,
|
|
1026
|
-
},
|
|
1027
|
-
return Object.entries(o(this,
|
|
1025
|
+
return _(this, dt, qt).call(this).then(() => e()).then(() => o(this, q) ? _(this, Et, $t).call(this, A) : Promise.resolve());
|
|
1026
|
+
}, nt = new WeakSet(), Yt = function() {
|
|
1027
|
+
return Object.entries(o(this, mt)).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
|
+
}, Tt = new WeakSet(), te = function(A) {
|
|
1031
1031
|
return Object.entries(A).reduce((e, [n, r]) => {
|
|
1032
1032
|
if (Array.isArray(r)) {
|
|
1033
|
-
const [
|
|
1034
|
-
e[n] = [
|
|
1033
|
+
const [a, l = {}] = r;
|
|
1034
|
+
e[n] = [a, l];
|
|
1035
1035
|
} else {
|
|
1036
|
-
const { method:
|
|
1037
|
-
e[n] = [
|
|
1036
|
+
const { method: a, params: l = {} } = r;
|
|
1037
|
+
e[n] = [a, l];
|
|
1038
1038
|
}
|
|
1039
1039
|
return e;
|
|
1040
1040
|
}, {});
|
|
1041
|
-
},
|
|
1041
|
+
}, wt = new WeakSet(), re = function(A, e) {
|
|
1042
1042
|
const [n, r] = A;
|
|
1043
1043
|
return [n, { start: e, ...r }];
|
|
1044
|
-
},
|
|
1044
|
+
}, At = new WeakSet(), ut = function(A) {
|
|
1045
1045
|
return ((A == null ? void 0 : A.items) || (A == null ? void 0 : A.documents)) ?? A;
|
|
1046
|
-
},
|
|
1046
|
+
}, ot = new WeakSet(), Bt = function(A, e) {
|
|
1047
1047
|
return A !== A && (A = 0), A === 0 && e === 0 ? 0 : A || e;
|
|
1048
|
-
},
|
|
1048
|
+
}, Rt = new WeakSet(), ee = 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
|
-
var
|
|
1054
|
-
class
|
|
1053
|
+
var st;
|
|
1054
|
+
class ne {
|
|
1055
1055
|
constructor() {
|
|
1056
|
-
f(this,
|
|
1056
|
+
f(this, st, {});
|
|
1057
1057
|
}
|
|
1058
1058
|
get hash() {
|
|
1059
1059
|
return this.createHash(8);
|
|
@@ -1068,7 +1068,7 @@ class oe {
|
|
|
1068
1068
|
}
|
|
1069
1069
|
/** Фильтр часто запускаемых действий */
|
|
1070
1070
|
actionFilter({ keyTimer: A, duration: e = 10, action: n }) {
|
|
1071
|
-
o(this,
|
|
1071
|
+
o(this, st)[A] && (clearTimeout(o(this, st)[A]), o(this, st)[A] = null), n && (o(this, st)[A] = setTimeout(() => {
|
|
1072
1072
|
n();
|
|
1073
1073
|
}, e));
|
|
1074
1074
|
}
|
|
@@ -1087,58 +1087,58 @@ class oe {
|
|
|
1087
1087
|
}
|
|
1088
1088
|
/** Скачать данные в JSON-файл */
|
|
1089
1089
|
downloadFileJson(A, e) {
|
|
1090
|
-
let n = new Blob([JSON.stringify(A)], { type: "application/json" }), r = URL.createObjectURL(n),
|
|
1091
|
-
|
|
1092
|
-
document.body.removeChild(
|
|
1090
|
+
let n = new Blob([JSON.stringify(A)], { type: "application/json" }), r = URL.createObjectURL(n), a = document.createElement("a");
|
|
1091
|
+
a.style.display = "none", a.href = r, a.download = `${e}.json`, document.body.appendChild(a), a.click(), setTimeout(() => {
|
|
1092
|
+
document.body.removeChild(a), URL.revokeObjectURL(r);
|
|
1093
1093
|
}, 200);
|
|
1094
1094
|
}
|
|
1095
1095
|
}
|
|
1096
|
-
|
|
1097
|
-
const
|
|
1098
|
-
var
|
|
1099
|
-
class
|
|
1096
|
+
st = new WeakMap();
|
|
1097
|
+
const bt = new ne();
|
|
1098
|
+
var W, Q, Ct, it, St, Z, ht, Ft, oe, Lt, Ae, Pt, he, Wt, ae, Jt, le;
|
|
1099
|
+
class de {
|
|
1100
1100
|
constructor() {
|
|
1101
|
-
f(this,
|
|
1101
|
+
f(this, Ft);
|
|
1102
1102
|
/** Вывод ошибок логера
|
|
1103
1103
|
* @param {'entity'} type - тип ошибки
|
|
1104
1104
|
*/
|
|
1105
|
-
f(this,
|
|
1105
|
+
f(this, Lt);
|
|
1106
|
+
f(this, Pt);
|
|
1106
1107
|
f(this, Wt);
|
|
1107
1108
|
f(this, Jt);
|
|
1108
|
-
f(this,
|
|
1109
|
-
f(this,
|
|
1110
|
-
f(this,
|
|
1111
|
-
f(this,
|
|
1112
|
-
f(this,
|
|
1113
|
-
f(this,
|
|
1114
|
-
f(this, V, null);
|
|
1109
|
+
f(this, W, "logger");
|
|
1110
|
+
f(this, Q, !1);
|
|
1111
|
+
f(this, Ct, 2e3);
|
|
1112
|
+
f(this, it, /* @__PURE__ */ new Map());
|
|
1113
|
+
f(this, St, {});
|
|
1114
|
+
f(this, Z, null);
|
|
1115
1115
|
f(this, ht, !1);
|
|
1116
1116
|
/** Очистка хранилища элементов старше 'N' месяцев */
|
|
1117
|
-
|
|
1118
|
-
_(this,
|
|
1117
|
+
U(this, "periodClear", 3);
|
|
1118
|
+
_(this, Ft, oe).call(this);
|
|
1119
1119
|
}
|
|
1120
1120
|
/** Инициализация логера */
|
|
1121
1121
|
async init() {
|
|
1122
|
-
let A = new
|
|
1122
|
+
let A = new X(BX24.callBatch), { entityList: e } = await A.batch({
|
|
1123
1123
|
entityList: { method: "entity.get" }
|
|
1124
1124
|
});
|
|
1125
1125
|
if (e != null && e.length)
|
|
1126
|
-
if (e.find((r) => r.ENTITY == o(this,
|
|
1127
|
-
d(this,
|
|
1126
|
+
if (e.find((r) => r.ENTITY == o(this, W)))
|
|
1127
|
+
d(this, Q, !0);
|
|
1128
1128
|
else {
|
|
1129
1129
|
let { entityAdd: r } = await A.batch({
|
|
1130
1130
|
entityAdd: {
|
|
1131
1131
|
method: "entity.add",
|
|
1132
1132
|
params: {
|
|
1133
|
-
ENTITY: o(this,
|
|
1134
|
-
NAME: o(this,
|
|
1133
|
+
ENTITY: o(this, W),
|
|
1134
|
+
NAME: o(this, W),
|
|
1135
1135
|
ACCESS: { AU: "X" }
|
|
1136
1136
|
}
|
|
1137
1137
|
}
|
|
1138
1138
|
});
|
|
1139
|
-
r && d(this,
|
|
1139
|
+
r && d(this, Q, !0);
|
|
1140
1140
|
}
|
|
1141
|
-
return _(this,
|
|
1141
|
+
return _(this, Wt, ae).call(this), o(this, Q);
|
|
1142
1142
|
}
|
|
1143
1143
|
/**
|
|
1144
1144
|
* @param {{ type: 'call'|'batch'|'batch-total-count';
|
|
@@ -1150,15 +1150,15 @@ class Ee {
|
|
|
1150
1150
|
* @returns {string}
|
|
1151
1151
|
*/
|
|
1152
1152
|
start({ type: A, data: e }) {
|
|
1153
|
-
if (!o(this,
|
|
1154
|
-
_(this,
|
|
1153
|
+
if (!o(this, Q)) {
|
|
1154
|
+
_(this, Lt, Ae).call(this, "entity");
|
|
1155
1155
|
return;
|
|
1156
1156
|
}
|
|
1157
|
-
const n =
|
|
1158
|
-
return o(this,
|
|
1157
|
+
const n = bt.hash;
|
|
1158
|
+
return o(this, it).set(n, {
|
|
1159
1159
|
type: A,
|
|
1160
1160
|
data: e,
|
|
1161
|
-
userInfo: o(this,
|
|
1161
|
+
userInfo: o(this, St),
|
|
1162
1162
|
errorList: [],
|
|
1163
1163
|
status: "",
|
|
1164
1164
|
answer: null,
|
|
@@ -1173,17 +1173,17 @@ class Ee {
|
|
|
1173
1173
|
* answer: { [key]: unknown } }}
|
|
1174
1174
|
*/
|
|
1175
1175
|
stop({ key: A, errorList: e, status: n, answer: r }) {
|
|
1176
|
-
if (!o(this,
|
|
1177
|
-
_(this,
|
|
1176
|
+
if (!o(this, Q)) {
|
|
1177
|
+
_(this, Lt, Ae).call(this, "entity");
|
|
1178
1178
|
return;
|
|
1179
1179
|
}
|
|
1180
|
-
let
|
|
1181
|
-
e && (
|
|
1180
|
+
let a = o(this, it).get(A);
|
|
1181
|
+
e && (a.errorList = e), n && (a.status = n), r && (a.answer = r), bt.actionFilter({
|
|
1182
1182
|
keyTimer: "add.entity.items",
|
|
1183
|
-
duration: o(this,
|
|
1183
|
+
duration: o(this, Ct),
|
|
1184
1184
|
action: async () => {
|
|
1185
|
-
var
|
|
1186
|
-
await _(this,
|
|
1185
|
+
var l;
|
|
1186
|
+
await _(this, Pt, he).call(this), (l = a == null ? void 0 : a.data) != null && l.updateList && d(this, ht, !0);
|
|
1187
1187
|
}
|
|
1188
1188
|
});
|
|
1189
1189
|
}
|
|
@@ -1192,112 +1192,112 @@ class Ee {
|
|
|
1192
1192
|
*/
|
|
1193
1193
|
async getEntityList(A) {
|
|
1194
1194
|
var r;
|
|
1195
|
-
if ((r = o(this,
|
|
1196
|
-
return o(this,
|
|
1197
|
-
let e = new
|
|
1195
|
+
if ((r = o(this, Z)) != null && r.length && !o(this, ht))
|
|
1196
|
+
return o(this, Z);
|
|
1197
|
+
let e = new X(BX24.callBatch), { entityList: n } = await e.batch({
|
|
1198
1198
|
entityList: {
|
|
1199
1199
|
method: "entity.item.get",
|
|
1200
1200
|
params: {
|
|
1201
|
-
ENTITY: o(this,
|
|
1201
|
+
ENTITY: o(this, W),
|
|
1202
1202
|
SORT: { ID: "DESC" }
|
|
1203
1203
|
}
|
|
1204
1204
|
}
|
|
1205
1205
|
}, A);
|
|
1206
|
-
return n = n.map((
|
|
1207
|
-
const { ID:
|
|
1206
|
+
return n = n.map((a) => {
|
|
1207
|
+
const { ID: l, DATE_CREATE: O, DETAIL_TEXT: u } = a;
|
|
1208
1208
|
return {
|
|
1209
1209
|
...JSON.parse(u),
|
|
1210
|
-
id:
|
|
1210
|
+
id: l,
|
|
1211
1211
|
dateCreate: O
|
|
1212
1212
|
};
|
|
1213
1213
|
}), d(this, ht, !1), n;
|
|
1214
1214
|
}
|
|
1215
1215
|
/** Выгрузка всех данных из хранилища в JSON-файл */
|
|
1216
1216
|
async downAllEntityJson() {
|
|
1217
|
-
let A = await this.getEntityList(), e =
|
|
1218
|
-
|
|
1217
|
+
let A = await this.getEntityList(), e = Ht().format("%Y-%m-%d");
|
|
1218
|
+
bt.downloadFileJson(A, `sdklogger-entity-data__${e}`);
|
|
1219
1219
|
}
|
|
1220
1220
|
}
|
|
1221
|
-
|
|
1222
|
-
const A = new
|
|
1221
|
+
W = new WeakMap(), Q = new WeakMap(), Ct = new WeakMap(), it = new WeakMap(), St = new WeakMap(), Z = new WeakMap(), ht = new WeakMap(), Ft = new WeakSet(), oe = async function() {
|
|
1222
|
+
const A = new X(BX24.callBatch), e = BX24.isAdmin(), { curUser: n } = await A.batch({
|
|
1223
1223
|
curUser: { method: "user.current" }
|
|
1224
1224
|
});
|
|
1225
|
-
d(this,
|
|
1226
|
-
},
|
|
1227
|
-
A == "entity" &&
|
|
1225
|
+
d(this, St, { isAdmin: e, curUser: n });
|
|
1226
|
+
}, Lt = new WeakSet(), Ae = function(A) {
|
|
1227
|
+
A == "entity" && bt.actionFilter({
|
|
1228
1228
|
keyTimer: "error.logger.entity",
|
|
1229
1229
|
duration: 500,
|
|
1230
1230
|
action: () => {
|
|
1231
1231
|
console.error("Хранилище для логгера не инициализировано");
|
|
1232
1232
|
}
|
|
1233
1233
|
});
|
|
1234
|
-
},
|
|
1235
|
-
let A = {}, e = new
|
|
1236
|
-
for (let [n, r] of o(this,
|
|
1234
|
+
}, Pt = new WeakSet(), he = async function() {
|
|
1235
|
+
let A = {}, e = new X(BX24.callBatch);
|
|
1236
|
+
for (let [n, r] of o(this, it).entries())
|
|
1237
1237
|
r.status && (A[n] = {
|
|
1238
1238
|
method: "entity.item.add",
|
|
1239
1239
|
params: {
|
|
1240
|
-
ENTITY: o(this,
|
|
1241
|
-
NAME: o(this,
|
|
1240
|
+
ENTITY: o(this, W),
|
|
1241
|
+
NAME: o(this, W),
|
|
1242
1242
|
DETAIL_TEXT: JSON.stringify(r)
|
|
1243
1243
|
}
|
|
1244
1244
|
});
|
|
1245
1245
|
if (Object.keys(A).length) {
|
|
1246
1246
|
let n = await e.batch(A), { errors: r } = e;
|
|
1247
|
-
for (let [
|
|
1248
|
-
o(this,
|
|
1247
|
+
for (let [a, l] of Object.entries({ ...n, ...r }))
|
|
1248
|
+
o(this, it).delete(a);
|
|
1249
1249
|
return !0;
|
|
1250
1250
|
}
|
|
1251
|
-
},
|
|
1252
|
-
let A = new
|
|
1251
|
+
}, Wt = new WeakSet(), ae = async function() {
|
|
1252
|
+
let A = new X(BX24.callBatch), { serverTime: e } = await A.batch({
|
|
1253
1253
|
serverTime: { method: "server.time" }
|
|
1254
1254
|
});
|
|
1255
|
-
o(this,
|
|
1256
|
-
let n = o(this,
|
|
1257
|
-
let { dateCreate:
|
|
1258
|
-
return
|
|
1255
|
+
o(this, Z) || d(this, Z, await this.getEntityList());
|
|
1256
|
+
let n = o(this, Z).filter((r) => {
|
|
1257
|
+
let { dateCreate: a } = r;
|
|
1258
|
+
return Ht(new Date(a)).between(Ht(new Date(e)), "month") >= this.periodClear;
|
|
1259
1259
|
});
|
|
1260
|
-
_(this,
|
|
1261
|
-
},
|
|
1262
|
-
let e = new
|
|
1263
|
-
let { id:
|
|
1260
|
+
_(this, Jt, le).call(this, n);
|
|
1261
|
+
}, Jt = new WeakSet(), le = async function(A) {
|
|
1262
|
+
let e = new X(BX24.callBatch), n = A.map((r) => {
|
|
1263
|
+
let { id: a } = r;
|
|
1264
1264
|
return {
|
|
1265
1265
|
method: "entity.item.delete",
|
|
1266
1266
|
params: {
|
|
1267
|
-
ENTITY: o(this,
|
|
1268
|
-
ID:
|
|
1267
|
+
ENTITY: o(this, W),
|
|
1268
|
+
ID: a
|
|
1269
1269
|
}
|
|
1270
1270
|
};
|
|
1271
1271
|
});
|
|
1272
1272
|
return await e.batch(n);
|
|
1273
1273
|
};
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
class Te {
|
|
1274
|
+
var kt, ce, Xt, ue;
|
|
1275
|
+
class Ee {
|
|
1277
1276
|
constructor(A) {
|
|
1278
1277
|
/** Запрос данных о приложении */
|
|
1279
|
-
f(this,
|
|
1278
|
+
f(this, kt);
|
|
1280
1279
|
/** Запрос данных о текущем пользователе */
|
|
1281
|
-
f(this,
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1280
|
+
f(this, Xt);
|
|
1281
|
+
U(this, "domain", "");
|
|
1282
|
+
U(this, "isAdmin", !1);
|
|
1283
|
+
U(this, "appInfo", null);
|
|
1284
|
+
U(this, "appConst", null);
|
|
1285
|
+
U(this, "userInfo", null);
|
|
1286
|
+
U(this, "placeData", null);
|
|
1287
|
+
U(this, "placeInfo", null);
|
|
1288
|
+
U(this, "logger", new de());
|
|
1289
1289
|
this.appConst = A;
|
|
1290
1290
|
}
|
|
1291
1291
|
init() {
|
|
1292
1292
|
return new Promise((A) => {
|
|
1293
1293
|
let e = setInterval(() => {
|
|
1294
1294
|
window.BX24 && BX24.init(async () => {
|
|
1295
|
-
console.info("init BX24"), clearInterval(e), this.domain = BX24.getDomain(), this.isAdmin = BX24.isAdmin(), this.placeInfo = BX24.placement.info(), await
|
|
1295
|
+
console.info("init BX24"), clearInterval(e), this.domain = BX24.getDomain(), this.isAdmin = BX24.isAdmin(), this.placeInfo = BX24.placement.info(), await this.logger.init();
|
|
1296
1296
|
const [n, r] = await Promise.all([
|
|
1297
|
-
_(this,
|
|
1298
|
-
_(this,
|
|
1297
|
+
_(this, kt, ce).call(this),
|
|
1298
|
+
_(this, Xt, ue).call(this)
|
|
1299
1299
|
]);
|
|
1300
|
-
this.appInfo = n, this.userInfo = r, new
|
|
1300
|
+
this.appInfo = n, this.userInfo = r, new ne().noSleep(), A(!0);
|
|
1301
1301
|
});
|
|
1302
1302
|
}, 100);
|
|
1303
1303
|
});
|
|
@@ -1324,31 +1324,31 @@ class Te {
|
|
|
1324
1324
|
* }[]
|
|
1325
1325
|
*/
|
|
1326
1326
|
call({ method: A, params: e, updateList: n }) {
|
|
1327
|
-
let r =
|
|
1327
|
+
let r = this.logger.start({
|
|
1328
1328
|
type: "call",
|
|
1329
1329
|
data: { method: A, params: e, updateList: n }
|
|
1330
1330
|
});
|
|
1331
|
-
return new Promise((
|
|
1332
|
-
e || (e = {}), BX24.callMethod(A, e,
|
|
1331
|
+
return new Promise((a) => {
|
|
1332
|
+
e || (e = {}), BX24.callMethod(A, e, (l) => {
|
|
1333
1333
|
let O = {};
|
|
1334
|
-
if (
|
|
1335
|
-
for (let [u, i] of Object.entries(
|
|
1334
|
+
if (l != null && l.answer)
|
|
1335
|
+
for (let [u, i] of Object.entries(l.answer))
|
|
1336
1336
|
u != "result" && i && (O[u] = i);
|
|
1337
|
-
if (
|
|
1338
|
-
let u =
|
|
1339
|
-
console.error(u),
|
|
1337
|
+
if (l.error()) {
|
|
1338
|
+
let u = l.error();
|
|
1339
|
+
console.error(u), this.logger.stop({
|
|
1340
1340
|
answer: O,
|
|
1341
1341
|
key: r,
|
|
1342
1342
|
status: "fail",
|
|
1343
1343
|
errorList: [u.toSting()]
|
|
1344
|
-
}),
|
|
1344
|
+
}), a(!1);
|
|
1345
1345
|
} else {
|
|
1346
|
-
let u =
|
|
1347
|
-
u != null && u.items && (u = u.items),
|
|
1346
|
+
let u = l.data();
|
|
1347
|
+
u != null && u.items && (u = u.items), this.logger.stop({
|
|
1348
1348
|
answer: O,
|
|
1349
1349
|
key: r,
|
|
1350
1350
|
status: "success"
|
|
1351
|
-
}),
|
|
1351
|
+
}), a(u);
|
|
1352
1352
|
}
|
|
1353
1353
|
});
|
|
1354
1354
|
});
|
|
@@ -1372,42 +1372,42 @@ class Te {
|
|
|
1372
1372
|
* }[]
|
|
1373
1373
|
* }}
|
|
1374
1374
|
*/
|
|
1375
|
-
async batch(A, e, { updateList: n, errorCall: r, limitCommandSerial:
|
|
1376
|
-
let
|
|
1375
|
+
async batch(A, e, { updateList: n, errorCall: r, limitCommandSerial: a } = {}) {
|
|
1376
|
+
let l = new X(BX24.callBatch), O = this.logger.start({
|
|
1377
1377
|
type: "batch",
|
|
1378
1378
|
data: { commandList: A, updateList: n }
|
|
1379
1379
|
});
|
|
1380
|
-
|
|
1380
|
+
a && (l.limitCommandSerial = a);
|
|
1381
1381
|
try {
|
|
1382
|
-
let u = await
|
|
1383
|
-
if (Object.keys(
|
|
1384
|
-
let i = Object.entries(
|
|
1382
|
+
let u = await l.batch(A, e);
|
|
1383
|
+
if (Object.keys(l.errors).length) {
|
|
1384
|
+
let i = Object.entries(l.errors).map(([T, E]) => {
|
|
1385
1385
|
var m;
|
|
1386
1386
|
return {
|
|
1387
1387
|
key: T,
|
|
1388
|
-
error: `${
|
|
1388
|
+
error: `${E == null ? void 0 : E.method} ${(m = E == null ? void 0 : E.error) == null ? void 0 : m.toString()}`.trim()
|
|
1389
1389
|
};
|
|
1390
1390
|
});
|
|
1391
|
-
r && r(
|
|
1391
|
+
r && r(l.errors), this.logger.stop({
|
|
1392
1392
|
key: O,
|
|
1393
1393
|
status: "fail",
|
|
1394
1394
|
errorList: i,
|
|
1395
|
-
answer:
|
|
1395
|
+
answer: l.answerData
|
|
1396
1396
|
});
|
|
1397
1397
|
} else
|
|
1398
|
-
|
|
1398
|
+
this.logger.stop({
|
|
1399
1399
|
key: O,
|
|
1400
1400
|
status: "success",
|
|
1401
|
-
answer:
|
|
1401
|
+
answer: l.answerData
|
|
1402
1402
|
});
|
|
1403
1403
|
return u;
|
|
1404
1404
|
} catch (u) {
|
|
1405
1405
|
let i = u == null ? void 0 : u.toString();
|
|
1406
|
-
return
|
|
1406
|
+
return this.logger.stop({
|
|
1407
1407
|
key: O,
|
|
1408
1408
|
status: "fail-runtime",
|
|
1409
1409
|
errorList: [i],
|
|
1410
|
-
answer:
|
|
1410
|
+
answer: l.answerData
|
|
1411
1411
|
}), console.error(u), !1;
|
|
1412
1412
|
}
|
|
1413
1413
|
}
|
|
@@ -1416,34 +1416,34 @@ class Te {
|
|
|
1416
1416
|
* @param progressCall - callback(data), в data приходят данные о загрузке данных
|
|
1417
1417
|
*/
|
|
1418
1418
|
async batchTotalCount(A, e) {
|
|
1419
|
-
let n = new
|
|
1419
|
+
let n = new X(BX24.callBatch), r = this.logger.start({
|
|
1420
1420
|
type: "batch",
|
|
1421
1421
|
data: { commandList: A }
|
|
1422
1422
|
});
|
|
1423
1423
|
try {
|
|
1424
|
-
let
|
|
1424
|
+
let a = await n.batchTotalCount(A, e);
|
|
1425
1425
|
if (Object.keys(n.errors).length) {
|
|
1426
|
-
let
|
|
1426
|
+
let l = Object.entries(n.errors).map(([O, u]) => ({
|
|
1427
1427
|
key: O,
|
|
1428
1428
|
error: u.toSting()
|
|
1429
1429
|
}));
|
|
1430
|
-
|
|
1430
|
+
this.logger.stop({
|
|
1431
1431
|
key: r,
|
|
1432
1432
|
status: "fail",
|
|
1433
|
-
errorList:
|
|
1433
|
+
errorList: l
|
|
1434
1434
|
});
|
|
1435
1435
|
} else
|
|
1436
|
-
|
|
1436
|
+
this.logger.stop({
|
|
1437
1437
|
key: r,
|
|
1438
1438
|
status: "success"
|
|
1439
1439
|
});
|
|
1440
|
-
return
|
|
1441
|
-
} catch (
|
|
1442
|
-
return
|
|
1440
|
+
return a;
|
|
1441
|
+
} catch (a) {
|
|
1442
|
+
return this.logger.stop({
|
|
1443
1443
|
key: r,
|
|
1444
1444
|
status: "fail",
|
|
1445
|
-
errorList: [
|
|
1446
|
-
}), console.error(
|
|
1445
|
+
errorList: [a.toSting()]
|
|
1446
|
+
}), console.error(a), !1;
|
|
1447
1447
|
}
|
|
1448
1448
|
}
|
|
1449
1449
|
/** Запрос данных о местах встройки приложения */
|
|
@@ -1453,9 +1453,9 @@ class Te {
|
|
|
1453
1453
|
/** Встройка приложения в place */
|
|
1454
1454
|
async placementBind(A) {
|
|
1455
1455
|
this.placeData || (this.placeData = await this.getPlacement());
|
|
1456
|
-
const { appName: e, pathApp: n } = this.appConst, r = this.placeData.map((
|
|
1457
|
-
let
|
|
1458
|
-
r.includes(A) ?
|
|
1456
|
+
const { appName: e, pathApp: n } = this.appConst, r = this.placeData.map((l) => l.placement);
|
|
1457
|
+
let a = this.placeData.find((l) => l.placement == A);
|
|
1458
|
+
r.includes(A) ? a.handler != n && (window.placementUnBind || (window.placementUnBind = {}), window.placementUnBind[A] || this.placementUnBind(a).then(() => {
|
|
1459
1459
|
window.placementUnBind[A] || (window.placementUnBind[A] = !0, this.placementBind(A));
|
|
1460
1460
|
})) : this.call({
|
|
1461
1461
|
method: "placement.bind",
|
|
@@ -1468,8 +1468,8 @@ class Te {
|
|
|
1468
1468
|
}
|
|
1469
1469
|
}
|
|
1470
1470
|
}
|
|
1471
|
-
}).then((
|
|
1472
|
-
|
|
1471
|
+
}).then((l) => {
|
|
1472
|
+
l ? console.info("Приложение успешно встроено в", A) : console.warn("Приложение не может быть встроено в", A);
|
|
1473
1473
|
});
|
|
1474
1474
|
}
|
|
1475
1475
|
/** Отвязка встройки из place */
|
|
@@ -1501,7 +1501,7 @@ class Te {
|
|
|
1501
1501
|
}
|
|
1502
1502
|
/* регистрация бота */
|
|
1503
1503
|
regBot({ code: A, type: e, name: n }) {
|
|
1504
|
-
const { appName: r, pathApp:
|
|
1504
|
+
const { appName: r, pathApp: a, chatBotLogo: l } = this.appConst, O = this.appInfo.ID;
|
|
1505
1505
|
return this.call({
|
|
1506
1506
|
method: "imbot.register",
|
|
1507
1507
|
params: {
|
|
@@ -1509,7 +1509,7 @@ class Te {
|
|
|
1509
1509
|
// Строковой идентификатор бота, уникальный в рамках вашего приложения (обяз.)
|
|
1510
1510
|
TYPE: e ?? "O",
|
|
1511
1511
|
// Тип бота, B - чат-бот, ответы поступают сразу, H - человек, ответы поступают с задержкой от 2-х до 10 секунд, O - чат-бот для Открытых линий, S - чат-бот с повышенными привилегиями (supervisor)
|
|
1512
|
-
EVENT_HANDLER:
|
|
1512
|
+
EVENT_HANDLER: a,
|
|
1513
1513
|
// Ссылка на обработчик событий, поступивших от сервера - см. Обработчики событий ниже (обяз).
|
|
1514
1514
|
OPENLINE: "Y",
|
|
1515
1515
|
// Включение режима поддержки Открытых линий, можно не указывать, если TYPE = 'O'
|
|
@@ -1525,7 +1525,7 @@ class Te {
|
|
|
1525
1525
|
// Цвет чат-бота для мобильного приложения RED, GREEN, MINT, LIGHT_BLUE, DARK_BLUE, PURPLE, AQUA, PINK, LIME, BROWN, AZURE, KHAKI, SAND, MARENGO, GRAY, GRAPHITE
|
|
1526
1526
|
EMAIL: "",
|
|
1527
1527
|
// E-mail для связи. НЕЛЬЗЯ использовать e-mail, дублирующий e-mail реальных пользователей
|
|
1528
|
-
PERSONAL_BIRTHDAY:
|
|
1528
|
+
PERSONAL_BIRTHDAY: Ht().format("%Y-%m-%d"),
|
|
1529
1529
|
// День рождения в формате YYYY-mm-dd
|
|
1530
1530
|
WORK_POSITION: "Почтальон",
|
|
1531
1531
|
// Занимаемая должность, используется как описание чат-бота
|
|
@@ -1533,7 +1533,7 @@ class Te {
|
|
|
1533
1533
|
// Ссылка на сайт
|
|
1534
1534
|
PERSONAL_GENDER: "M",
|
|
1535
1535
|
// Пол чат-бота, допустимые значения M - мужской, F - женский, пусто, если не требуется указывать
|
|
1536
|
-
PERSONAL_PHOTO:
|
|
1536
|
+
PERSONAL_PHOTO: l ?? ""
|
|
1537
1537
|
// Аватар чат-бота - base64
|
|
1538
1538
|
}
|
|
1539
1539
|
}
|
|
@@ -1550,18 +1550,18 @@ class Te {
|
|
|
1550
1550
|
}
|
|
1551
1551
|
/* Получение данных логера */
|
|
1552
1552
|
getLoggerList(A) {
|
|
1553
|
-
return
|
|
1553
|
+
return this.logger.getEntityList(A);
|
|
1554
1554
|
}
|
|
1555
1555
|
}
|
|
1556
|
-
|
|
1556
|
+
kt = new WeakSet(), ce = function() {
|
|
1557
1557
|
return this.call({ method: "app.info" });
|
|
1558
|
-
},
|
|
1558
|
+
}, Xt = new WeakSet(), ue = function() {
|
|
1559
1559
|
return this.call({ method: "user.current" });
|
|
1560
1560
|
};
|
|
1561
1561
|
export {
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1562
|
+
X as Batch,
|
|
1563
|
+
Ee as BxBoot,
|
|
1564
|
+
ne as BxHelper,
|
|
1565
|
+
de as BxLogger,
|
|
1566
|
+
Ht as tempus
|
|
1567
1567
|
};
|