bt-core-app 1.4.64 → 1.4.65
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/bt-core-app.js +355 -349
- package/dist/index.d.ts +5 -0
- package/package.json +1 -1
package/dist/bt-core-app.js
CHANGED
|
@@ -35,10 +35,14 @@ function rn(e) {
|
|
|
35
35
|
let y = null;
|
|
36
36
|
try {
|
|
37
37
|
return u.requireConfirmation || u.confirmationMsg, y = await d(), u.completionMsg != null && (s.value = u.completionMsg), y;
|
|
38
|
-
} catch (
|
|
39
|
-
if (u.
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
} catch (I) {
|
|
39
|
+
if (u.onError != null)
|
|
40
|
+
u.onError(I);
|
|
41
|
+
else {
|
|
42
|
+
if (u.throwError == !0)
|
|
43
|
+
return I;
|
|
44
|
+
T(u.errorMsg ?? I ?? "error");
|
|
45
|
+
}
|
|
42
46
|
} finally {
|
|
43
47
|
x(r);
|
|
44
48
|
}
|
|
@@ -404,26 +408,26 @@ var at = { exports: {} };
|
|
|
404
408
|
};
|
|
405
409
|
} else
|
|
406
410
|
"document" in g && "onreadystatechange" in g.document.createElement("script") ? P = function() {
|
|
407
|
-
var
|
|
408
|
-
|
|
409
|
-
r(),
|
|
410
|
-
}, g.document.documentElement.appendChild(
|
|
411
|
+
var I = g.document.createElement("script");
|
|
412
|
+
I.onreadystatechange = function() {
|
|
413
|
+
r(), I.onreadystatechange = null, I.parentNode.removeChild(I), I = null;
|
|
414
|
+
}, g.document.documentElement.appendChild(I);
|
|
411
415
|
} : P = function() {
|
|
412
416
|
setTimeout(r, 0);
|
|
413
417
|
};
|
|
414
418
|
var h, u = [];
|
|
415
419
|
function r() {
|
|
416
420
|
h = !0;
|
|
417
|
-
for (var
|
|
418
|
-
for (c = u, u = [],
|
|
419
|
-
c[
|
|
420
|
-
|
|
421
|
+
for (var I, c, E = u.length; E; ) {
|
|
422
|
+
for (c = u, u = [], I = -1; ++I < E; )
|
|
423
|
+
c[I]();
|
|
424
|
+
E = u.length;
|
|
421
425
|
}
|
|
422
426
|
h = !1;
|
|
423
427
|
}
|
|
424
428
|
S.exports = y;
|
|
425
|
-
function y(
|
|
426
|
-
u.push(
|
|
429
|
+
function y(I) {
|
|
430
|
+
u.push(I) === 1 && !h && P();
|
|
427
431
|
}
|
|
428
432
|
}).call(this, typeof Qe < "u" ? Qe : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
429
433
|
}, {}], 2: [function(l, S, s) {
|
|
@@ -442,16 +446,16 @@ var at = { exports: {} };
|
|
|
442
446
|
}, d.prototype.then = function(b, _) {
|
|
443
447
|
if (typeof b != "function" && this.state === N || typeof _ != "function" && this.state === T)
|
|
444
448
|
return this;
|
|
445
|
-
var
|
|
449
|
+
var D = new this.constructor(x);
|
|
446
450
|
if (this.state !== $) {
|
|
447
451
|
var L = this.state === N ? b : _;
|
|
448
|
-
u(
|
|
452
|
+
u(D, L, this.outcome);
|
|
449
453
|
} else
|
|
450
|
-
this.queue.push(new h(
|
|
451
|
-
return
|
|
454
|
+
this.queue.push(new h(D, b, _));
|
|
455
|
+
return D;
|
|
452
456
|
};
|
|
453
|
-
function h(b, _,
|
|
454
|
-
this.promise = b, typeof _ == "function" && (this.onFulfilled = _, this.callFulfilled = this.otherCallFulfilled), typeof
|
|
457
|
+
function h(b, _, D) {
|
|
458
|
+
this.promise = b, typeof _ == "function" && (this.onFulfilled = _, this.callFulfilled = this.otherCallFulfilled), typeof D == "function" && (this.onRejected = D, this.callRejected = this.otherCallRejected);
|
|
455
459
|
}
|
|
456
460
|
h.prototype.callFulfilled = function(b) {
|
|
457
461
|
P.resolve(this.promise, b);
|
|
@@ -462,11 +466,11 @@ var at = { exports: {} };
|
|
|
462
466
|
}, h.prototype.otherCallRejected = function(b) {
|
|
463
467
|
u(this.promise, this.onRejected, b);
|
|
464
468
|
};
|
|
465
|
-
function u(b, _,
|
|
469
|
+
function u(b, _, D) {
|
|
466
470
|
g(function() {
|
|
467
471
|
var L;
|
|
468
472
|
try {
|
|
469
|
-
L = _(
|
|
473
|
+
L = _(D);
|
|
470
474
|
} catch (f) {
|
|
471
475
|
return P.reject(b, f);
|
|
472
476
|
}
|
|
@@ -474,10 +478,10 @@ var at = { exports: {} };
|
|
|
474
478
|
});
|
|
475
479
|
}
|
|
476
480
|
P.resolve = function(b, _) {
|
|
477
|
-
var
|
|
478
|
-
if (
|
|
479
|
-
return P.reject(b,
|
|
480
|
-
var L =
|
|
481
|
+
var D = I(r, _);
|
|
482
|
+
if (D.status === "error")
|
|
483
|
+
return P.reject(b, D.value);
|
|
484
|
+
var L = D.value;
|
|
481
485
|
if (L)
|
|
482
486
|
y(b, L);
|
|
483
487
|
else {
|
|
@@ -488,8 +492,8 @@ var at = { exports: {} };
|
|
|
488
492
|
return b;
|
|
489
493
|
}, P.reject = function(b, _) {
|
|
490
494
|
b.state = T, b.outcome = _;
|
|
491
|
-
for (var
|
|
492
|
-
b.queue[
|
|
495
|
+
for (var D = -1, L = b.queue.length; ++D < L; )
|
|
496
|
+
b.queue[D].callRejected(_);
|
|
493
497
|
return b;
|
|
494
498
|
};
|
|
495
499
|
function r(b) {
|
|
@@ -500,34 +504,34 @@ var at = { exports: {} };
|
|
|
500
504
|
};
|
|
501
505
|
}
|
|
502
506
|
function y(b, _) {
|
|
503
|
-
var
|
|
507
|
+
var D = !1;
|
|
504
508
|
function L(Q) {
|
|
505
|
-
|
|
509
|
+
D || (D = !0, P.reject(b, Q));
|
|
506
510
|
}
|
|
507
511
|
function f(Q) {
|
|
508
|
-
|
|
512
|
+
D || (D = !0, P.resolve(b, Q));
|
|
509
513
|
}
|
|
510
514
|
function A() {
|
|
511
515
|
_(f, L);
|
|
512
516
|
}
|
|
513
|
-
var J =
|
|
517
|
+
var J = I(A);
|
|
514
518
|
J.status === "error" && L(J.value);
|
|
515
519
|
}
|
|
516
|
-
function
|
|
517
|
-
var
|
|
520
|
+
function I(b, _) {
|
|
521
|
+
var D = {};
|
|
518
522
|
try {
|
|
519
|
-
|
|
523
|
+
D.value = b(_), D.status = "success";
|
|
520
524
|
} catch (L) {
|
|
521
|
-
|
|
525
|
+
D.status = "error", D.value = L;
|
|
522
526
|
}
|
|
523
|
-
return
|
|
527
|
+
return D;
|
|
524
528
|
}
|
|
525
529
|
d.resolve = c;
|
|
526
530
|
function c(b) {
|
|
527
531
|
return b instanceof this ? b : P.resolve(new this(x), b);
|
|
528
532
|
}
|
|
529
|
-
d.reject =
|
|
530
|
-
function
|
|
533
|
+
d.reject = E;
|
|
534
|
+
function E(b) {
|
|
531
535
|
var _ = new this(x);
|
|
532
536
|
return P.reject(_, b);
|
|
533
537
|
}
|
|
@@ -536,10 +540,10 @@ var at = { exports: {} };
|
|
|
536
540
|
var _ = this;
|
|
537
541
|
if (Object.prototype.toString.call(b) !== "[object Array]")
|
|
538
542
|
return this.reject(new TypeError("must be an array"));
|
|
539
|
-
var
|
|
540
|
-
if (!
|
|
543
|
+
var D = b.length, L = !1;
|
|
544
|
+
if (!D)
|
|
541
545
|
return this.resolve([]);
|
|
542
|
-
for (var f = new Array(
|
|
546
|
+
for (var f = new Array(D), A = 0, J = -1, Q = new this(x); ++J < D; )
|
|
543
547
|
ee(b[J], J);
|
|
544
548
|
return Q;
|
|
545
549
|
function ee(ie, we) {
|
|
@@ -547,7 +551,7 @@ var at = { exports: {} };
|
|
|
547
551
|
L || (L = !0, P.reject(Q, Y));
|
|
548
552
|
});
|
|
549
553
|
function W(Y) {
|
|
550
|
-
f[we] = Y, ++A ===
|
|
554
|
+
f[we] = Y, ++A === D && !L && (L = !0, P.resolve(Q, f));
|
|
551
555
|
}
|
|
552
556
|
}
|
|
553
557
|
}
|
|
@@ -556,10 +560,10 @@ var at = { exports: {} };
|
|
|
556
560
|
var _ = this;
|
|
557
561
|
if (Object.prototype.toString.call(b) !== "[object Array]")
|
|
558
562
|
return this.reject(new TypeError("must be an array"));
|
|
559
|
-
var
|
|
560
|
-
if (!
|
|
563
|
+
var D = b.length, L = !1;
|
|
564
|
+
if (!D)
|
|
561
565
|
return this.resolve([]);
|
|
562
|
-
for (var f = -1, A = new this(x); ++f <
|
|
566
|
+
for (var f = -1, A = new this(x); ++f < D; )
|
|
563
567
|
J(b[f]);
|
|
564
568
|
return A;
|
|
565
569
|
function J(Q) {
|
|
@@ -646,16 +650,16 @@ var at = { exports: {} };
|
|
|
646
650
|
if (arguments.length && typeof arguments[arguments.length - 1] == "function")
|
|
647
651
|
return arguments[arguments.length - 1];
|
|
648
652
|
}
|
|
649
|
-
var
|
|
653
|
+
var I = "local-forage-detect-blob-support", c = void 0, E = {}, w = Object.prototype.toString, M = "readonly", b = "readwrite";
|
|
650
654
|
function _(n) {
|
|
651
655
|
for (var i = n.length, a = new ArrayBuffer(i), m = new Uint8Array(a), v = 0; v < i; v++)
|
|
652
656
|
m[v] = n.charCodeAt(v);
|
|
653
657
|
return a;
|
|
654
658
|
}
|
|
655
|
-
function
|
|
659
|
+
function D(n) {
|
|
656
660
|
return new d(function(i) {
|
|
657
|
-
var a = n.transaction(
|
|
658
|
-
a.objectStore(
|
|
661
|
+
var a = n.transaction(I, b), m = $([""]);
|
|
662
|
+
a.objectStore(I).put(m, "key"), a.onabort = function(v) {
|
|
659
663
|
v.preventDefault(), v.stopPropagation(), i(!1);
|
|
660
664
|
}, a.oncomplete = function() {
|
|
661
665
|
var v = navigator.userAgent.match(/Chrome\/(\d+)/), o = navigator.userAgent.match(/Edge\//);
|
|
@@ -666,12 +670,12 @@ var at = { exports: {} };
|
|
|
666
670
|
});
|
|
667
671
|
}
|
|
668
672
|
function L(n) {
|
|
669
|
-
return typeof c == "boolean" ? d.resolve(c) :
|
|
673
|
+
return typeof c == "boolean" ? d.resolve(c) : D(n).then(function(i) {
|
|
670
674
|
return c = i, c;
|
|
671
675
|
});
|
|
672
676
|
}
|
|
673
677
|
function f(n) {
|
|
674
|
-
var i =
|
|
678
|
+
var i = E[n.name], a = {};
|
|
675
679
|
a.promise = new d(function(m, v) {
|
|
676
680
|
a.resolve = m, a.reject = v;
|
|
677
681
|
}), i.deferredOperations.push(a), i.dbReady ? i.dbReady = i.dbReady.then(function() {
|
|
@@ -679,18 +683,18 @@ var at = { exports: {} };
|
|
|
679
683
|
}) : i.dbReady = a.promise;
|
|
680
684
|
}
|
|
681
685
|
function A(n) {
|
|
682
|
-
var i =
|
|
686
|
+
var i = E[n.name], a = i.deferredOperations.pop();
|
|
683
687
|
if (a)
|
|
684
688
|
return a.resolve(), a.promise;
|
|
685
689
|
}
|
|
686
690
|
function J(n, i) {
|
|
687
|
-
var a =
|
|
691
|
+
var a = E[n.name], m = a.deferredOperations.pop();
|
|
688
692
|
if (m)
|
|
689
693
|
return m.reject(i), m.promise;
|
|
690
694
|
}
|
|
691
695
|
function Q(n, i) {
|
|
692
696
|
return new d(function(a, m) {
|
|
693
|
-
if (
|
|
697
|
+
if (E[n.name] = E[n.name] || ne(), n.db)
|
|
694
698
|
if (i)
|
|
695
699
|
f(n), n.db.close();
|
|
696
700
|
else
|
|
@@ -701,7 +705,7 @@ var at = { exports: {} };
|
|
|
701
705
|
i && (o.onupgradeneeded = function(C) {
|
|
702
706
|
var R = o.result;
|
|
703
707
|
try {
|
|
704
|
-
R.createObjectStore(n.storeName), C.oldVersion <= 1 && R.createObjectStore(
|
|
708
|
+
R.createObjectStore(n.storeName), C.oldVersion <= 1 && R.createObjectStore(I);
|
|
705
709
|
} catch (B) {
|
|
706
710
|
if (B.name === "ConstraintError")
|
|
707
711
|
console.warn('The database "' + n.name + '" has been upgraded from version ' + C.oldVersion + " to version " + C.newVersion + ', but the storage "' + n.storeName + '" already exists.');
|
|
@@ -759,7 +763,7 @@ var at = { exports: {} };
|
|
|
759
763
|
}
|
|
760
764
|
function ae(n) {
|
|
761
765
|
var i = this, a = i._initReady().then(function() {
|
|
762
|
-
var m =
|
|
766
|
+
var m = E[i._dbInfo.name];
|
|
763
767
|
if (m && m.dbReady)
|
|
764
768
|
return m.dbReady;
|
|
765
769
|
});
|
|
@@ -767,7 +771,7 @@ var at = { exports: {} };
|
|
|
767
771
|
}
|
|
768
772
|
function G(n) {
|
|
769
773
|
f(n);
|
|
770
|
-
for (var i =
|
|
774
|
+
for (var i = E[n.name], a = i.forages, m = 0; m < a.length; m++) {
|
|
771
775
|
var v = a[m];
|
|
772
776
|
v._dbInfo.db && (v._dbInfo.db.close(), v._dbInfo.db = null);
|
|
773
777
|
}
|
|
@@ -818,8 +822,8 @@ var at = { exports: {} };
|
|
|
818
822
|
if (n)
|
|
819
823
|
for (var m in n)
|
|
820
824
|
a[m] = n[m];
|
|
821
|
-
var v =
|
|
822
|
-
v || (v = ne(),
|
|
825
|
+
var v = E[a.name];
|
|
826
|
+
v || (v = ne(), E[a.name] = v), v.forages.push(i), i._initReady || (i._initReady = i.ready, i.ready = ae);
|
|
823
827
|
var o = [];
|
|
824
828
|
function C() {
|
|
825
829
|
return d.resolve();
|
|
@@ -865,7 +869,7 @@ var at = { exports: {} };
|
|
|
865
869
|
});
|
|
866
870
|
return h(m, i), m;
|
|
867
871
|
}
|
|
868
|
-
function
|
|
872
|
+
function Ee(n, i) {
|
|
869
873
|
var a = this, m = new d(function(v, o) {
|
|
870
874
|
a.ready().then(function() {
|
|
871
875
|
X(a._dbInfo, M, function(C, R) {
|
|
@@ -1058,7 +1062,7 @@ var at = { exports: {} };
|
|
|
1058
1062
|
v = d.reject("Invalid arguments");
|
|
1059
1063
|
else {
|
|
1060
1064
|
var o = n.name === a.name && m._dbInfo.db, C = o ? d.resolve(m._dbInfo.db) : ee(n).then(function(R) {
|
|
1061
|
-
var B =
|
|
1065
|
+
var B = E[n.name], F = B.forages;
|
|
1062
1066
|
B.db = R;
|
|
1063
1067
|
for (var k = 0; k < F.length; k++)
|
|
1064
1068
|
F[k]._dbInfo.db = R;
|
|
@@ -1068,7 +1072,7 @@ var at = { exports: {} };
|
|
|
1068
1072
|
if (R.objectStoreNames.contains(n.storeName)) {
|
|
1069
1073
|
var B = R.version + 1;
|
|
1070
1074
|
f(n);
|
|
1071
|
-
var F =
|
|
1075
|
+
var F = E[n.name], k = F.forages;
|
|
1072
1076
|
R.close();
|
|
1073
1077
|
for (var q = 0; q < k.length; q++) {
|
|
1074
1078
|
var Z = k[q];
|
|
@@ -1100,7 +1104,7 @@ var at = { exports: {} };
|
|
|
1100
1104
|
}
|
|
1101
1105
|
}) : v = C.then(function(R) {
|
|
1102
1106
|
f(n);
|
|
1103
|
-
var B =
|
|
1107
|
+
var B = E[n.name], F = B.forages;
|
|
1104
1108
|
R.close();
|
|
1105
1109
|
for (var k = 0; k < F.length; k++) {
|
|
1106
1110
|
var q = F[k];
|
|
@@ -1136,7 +1140,7 @@ var at = { exports: {} };
|
|
|
1136
1140
|
_driver: "asyncStorage",
|
|
1137
1141
|
_initStorage: fe,
|
|
1138
1142
|
_support: N(),
|
|
1139
|
-
iterate:
|
|
1143
|
+
iterate: Ee,
|
|
1140
1144
|
getItem: ce,
|
|
1141
1145
|
setItem: $e,
|
|
1142
1146
|
removeItem: Ce,
|
|
@@ -1149,7 +1153,7 @@ var at = { exports: {} };
|
|
|
1149
1153
|
function ur() {
|
|
1150
1154
|
return typeof openDatabase == "function";
|
|
1151
1155
|
}
|
|
1152
|
-
var be = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", ir = "~~local_forage_type~", Ze = /^~~local_forage_type~([^~]+)~/, Fe = "__lfsc__:", Ne = Fe.length, We = "arbf",
|
|
1156
|
+
var be = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", ir = "~~local_forage_type~", Ze = /^~~local_forage_type~([^~]+)~/, Fe = "__lfsc__:", Ne = Fe.length, We = "arbf", Ie = "blob", Je = "si08", je = "ui08", qe = "uic8", Ve = "si16", U = "si32", j = "ur16", H = "ui32", O = "fl32", oe = "fl64", ve = Ne + We.length, De = Object.prototype.toString;
|
|
1153
1157
|
function Se(n) {
|
|
1154
1158
|
var i = n.length * 0.75, a = n.length, m, v = 0, o, C, R, B;
|
|
1155
1159
|
n[n.length - 1] === "=" && (i--, n[n.length - 2] === "=" && i--);
|
|
@@ -1173,7 +1177,7 @@ var at = { exports: {} };
|
|
|
1173
1177
|
var o = new FileReader();
|
|
1174
1178
|
o.onload = function() {
|
|
1175
1179
|
var C = ir + n.type + "~" + se(this.result);
|
|
1176
|
-
i(Fe +
|
|
1180
|
+
i(Fe + Ie + C);
|
|
1177
1181
|
}, o.readAsArrayBuffer(n);
|
|
1178
1182
|
} else
|
|
1179
1183
|
try {
|
|
@@ -1186,7 +1190,7 @@ var at = { exports: {} };
|
|
|
1186
1190
|
if (n.substring(0, Ne) !== Fe)
|
|
1187
1191
|
return JSON.parse(n);
|
|
1188
1192
|
var i = n.substring(ve), a = n.substring(Ne, ve), m;
|
|
1189
|
-
if (a ===
|
|
1193
|
+
if (a === Ie && Ze.test(i)) {
|
|
1190
1194
|
var v = i.match(Ze);
|
|
1191
1195
|
m = v[1], i = i.substring(v[0].length);
|
|
1192
1196
|
}
|
|
@@ -1194,7 +1198,7 @@ var at = { exports: {} };
|
|
|
1194
1198
|
switch (a) {
|
|
1195
1199
|
case We:
|
|
1196
1200
|
return o;
|
|
1197
|
-
case
|
|
1201
|
+
case Ie:
|
|
1198
1202
|
return $([o], { type: m });
|
|
1199
1203
|
case Je:
|
|
1200
1204
|
return new Int8Array(o);
|
|
@@ -1479,7 +1483,7 @@ var at = { exports: {} };
|
|
|
1479
1483
|
keys: wt,
|
|
1480
1484
|
dropInstance: St
|
|
1481
1485
|
};
|
|
1482
|
-
function
|
|
1486
|
+
function Et() {
|
|
1483
1487
|
try {
|
|
1484
1488
|
return typeof localStorage < "u" && "setItem" in localStorage && // in IE8 typeof localStorage.setItem === 'object'
|
|
1485
1489
|
!!localStorage.setItem;
|
|
@@ -1491,7 +1495,7 @@ var at = { exports: {} };
|
|
|
1491
1495
|
var a = n.name + "/";
|
|
1492
1496
|
return n.storeName !== i.storeName && (a += n.storeName + "/"), a;
|
|
1493
1497
|
}
|
|
1494
|
-
function
|
|
1498
|
+
function It() {
|
|
1495
1499
|
var n = "_localforage_support_test";
|
|
1496
1500
|
try {
|
|
1497
1501
|
return localStorage.setItem(n, !0), localStorage.removeItem(n), !1;
|
|
@@ -1500,7 +1504,7 @@ var at = { exports: {} };
|
|
|
1500
1504
|
}
|
|
1501
1505
|
}
|
|
1502
1506
|
function Dt() {
|
|
1503
|
-
return !
|
|
1507
|
+
return !It() || localStorage.length > 0;
|
|
1504
1508
|
}
|
|
1505
1509
|
function xt(n) {
|
|
1506
1510
|
var i = this, a = {};
|
|
@@ -1617,7 +1621,7 @@ var at = { exports: {} };
|
|
|
1617
1621
|
var Bt = {
|
|
1618
1622
|
_driver: "localStorageWrapper",
|
|
1619
1623
|
_initStorage: xt,
|
|
1620
|
-
_support:
|
|
1624
|
+
_support: Et(),
|
|
1621
1625
|
iterate: Ct,
|
|
1622
1626
|
getItem: Tt,
|
|
1623
1627
|
setItem: Rt,
|
|
@@ -1882,7 +1886,7 @@ function Sn(e) {
|
|
|
1882
1886
|
throw new Error("Must supply an api object to use store");
|
|
1883
1887
|
return Vr({ ...e, storeName: e.storeName ?? "" });
|
|
1884
1888
|
} else
|
|
1885
|
-
return
|
|
1889
|
+
return En({ ...e, storeName: e.storeName ?? "" });
|
|
1886
1890
|
}
|
|
1887
1891
|
const An = (e) => {
|
|
1888
1892
|
let t = K(e.url) ?? void 0;
|
|
@@ -1895,22 +1899,22 @@ const An = (e) => {
|
|
|
1895
1899
|
}
|
|
1896
1900
|
return e.finalUrl = t, e.finalUrl ?? "";
|
|
1897
1901
|
};
|
|
1898
|
-
function
|
|
1902
|
+
function En(e) {
|
|
1899
1903
|
return et(e.storeName, () => {
|
|
1900
1904
|
var u;
|
|
1901
1905
|
const t = de.utc().toSeconds() / 86400, l = z({}), S = z({}), s = e.storageMode == "local-cache", g = e.buildUrl ?? ((u = e.api) == null ? void 0 : u.buildUrl) ?? An;
|
|
1902
1906
|
function x(r) {
|
|
1903
|
-
var c,
|
|
1907
|
+
var c, E;
|
|
1904
1908
|
let y = "";
|
|
1905
|
-
const
|
|
1906
|
-
return
|
|
1909
|
+
const I = r.params ?? {};
|
|
1910
|
+
return I != null && (y = Object.entries(I).sort(Ue.firstBy((w) => w[0])).map((w) => `${w[0]}=${JSON.stringify(w[1])}`).join("&")), `${e.storeName ?? "base"}_${((c = e.auth) == null ? void 0 : c.credentials.value.userID) ?? "no-user-id"}_${r.id ?? ((E = r.data) == null ? void 0 : E.id) ?? "no-item-id"}_${y ?? "no-params"}`;
|
|
1907
1911
|
}
|
|
1908
1912
|
async function P(r) {
|
|
1909
1913
|
r.additionalUrl ?? (r.additionalUrl = "/getAll"), g(r);
|
|
1910
|
-
const y = x(r),
|
|
1911
|
-
if (!
|
|
1914
|
+
const y = x(r), I = r.refresh;
|
|
1915
|
+
if (!I && l.value[y] !== void 0)
|
|
1912
1916
|
return l.value[y];
|
|
1913
|
-
if (!
|
|
1917
|
+
if (!I && s == !0) {
|
|
1914
1918
|
const c = await me().getItem(y);
|
|
1915
1919
|
if (c != null && (e.api == null || parseFloat(c.meta.storedOn) > t - 7))
|
|
1916
1920
|
return l.value[y] = c, c;
|
|
@@ -1922,24 +1926,24 @@ function In(e) {
|
|
|
1922
1926
|
c == null && (c = new Promise(async (w, M) => {
|
|
1923
1927
|
var b;
|
|
1924
1928
|
try {
|
|
1925
|
-
const _ = await ((b = e.api) == null ? void 0 : b.getAll(r)),
|
|
1929
|
+
const _ = await ((b = e.api) == null ? void 0 : b.getAll(r)), D = {
|
|
1926
1930
|
meta: { storedOn: t.toString() },
|
|
1927
1931
|
data: _ == null ? void 0 : _.data,
|
|
1928
1932
|
count: _ == null ? void 0 : _.count,
|
|
1929
1933
|
filters: (_ == null ? void 0 : _.filters) ?? []
|
|
1930
1934
|
};
|
|
1931
|
-
s == !0 && await me().setItem(y,
|
|
1935
|
+
s == !0 && await me().setItem(y, D), w(D);
|
|
1932
1936
|
} catch (_) {
|
|
1933
1937
|
M(_);
|
|
1934
1938
|
} finally {
|
|
1935
1939
|
delete S.value[y];
|
|
1936
1940
|
}
|
|
1937
1941
|
}), S.value[y] = c);
|
|
1938
|
-
const
|
|
1939
|
-
return l.value[y] =
|
|
1940
|
-
data:
|
|
1941
|
-
filters:
|
|
1942
|
-
count:
|
|
1942
|
+
const E = await c;
|
|
1943
|
+
return l.value[y] = E, {
|
|
1944
|
+
data: E == null ? void 0 : E.data,
|
|
1945
|
+
filters: E == null ? void 0 : E.filters,
|
|
1946
|
+
count: E == null ? void 0 : E.count
|
|
1943
1947
|
};
|
|
1944
1948
|
} catch (c) {
|
|
1945
1949
|
throw c;
|
|
@@ -1947,10 +1951,10 @@ function In(e) {
|
|
|
1947
1951
|
}
|
|
1948
1952
|
async function T(r) {
|
|
1949
1953
|
r.additionalUrl ?? (r.additionalUrl = "/get"), g(r);
|
|
1950
|
-
const y = x(r),
|
|
1951
|
-
if (!
|
|
1954
|
+
const y = x(r), I = r.refresh;
|
|
1955
|
+
if (!I && l.value[y] !== void 0)
|
|
1952
1956
|
return l.value[y];
|
|
1953
|
-
if (!
|
|
1957
|
+
if (!I && s == !0) {
|
|
1954
1958
|
const c = await me().getItem(y);
|
|
1955
1959
|
if (c != null && (e.api == null || parseFloat(c.meta.storedOn) > t - 7))
|
|
1956
1960
|
return l.value[y] = c, { data: c.data };
|
|
@@ -1963,19 +1967,19 @@ function In(e) {
|
|
|
1963
1967
|
var b;
|
|
1964
1968
|
try {
|
|
1965
1969
|
let _ = await ((b = e.api) == null ? void 0 : b.get(r));
|
|
1966
|
-
const
|
|
1970
|
+
const D = {
|
|
1967
1971
|
meta: { storedOn: t.toString() },
|
|
1968
1972
|
data: _ == null ? void 0 : _.data
|
|
1969
1973
|
};
|
|
1970
|
-
s == !0 && await me().setItem(y,
|
|
1974
|
+
s == !0 && await me().setItem(y, D), w(D);
|
|
1971
1975
|
} catch (_) {
|
|
1972
1976
|
M(_);
|
|
1973
1977
|
} finally {
|
|
1974
1978
|
delete S.value[y];
|
|
1975
1979
|
}
|
|
1976
1980
|
}), S.value[y] = c);
|
|
1977
|
-
const
|
|
1978
|
-
return l.value[y] =
|
|
1981
|
+
const E = await c;
|
|
1982
|
+
return l.value[y] = E, { data: E.data };
|
|
1979
1983
|
} catch (c) {
|
|
1980
1984
|
throw c;
|
|
1981
1985
|
}
|
|
@@ -1984,54 +1988,54 @@ function In(e) {
|
|
|
1984
1988
|
var c;
|
|
1985
1989
|
r.additionalUrl ?? (r.additionalUrl = "/patch"), g(r);
|
|
1986
1990
|
const y = x(r);
|
|
1987
|
-
let
|
|
1991
|
+
let I;
|
|
1988
1992
|
if (e.api != null)
|
|
1989
1993
|
try {
|
|
1990
|
-
let
|
|
1991
|
-
|
|
1992
|
-
} catch (
|
|
1993
|
-
throw
|
|
1994
|
+
let E = await e.api.patch(r);
|
|
1995
|
+
I = E == null ? void 0 : E.data;
|
|
1996
|
+
} catch (E) {
|
|
1997
|
+
throw E;
|
|
1994
1998
|
}
|
|
1995
1999
|
else
|
|
1996
|
-
|
|
1997
|
-
if (
|
|
1998
|
-
let
|
|
2000
|
+
I = r.data;
|
|
2001
|
+
if (I != null) {
|
|
2002
|
+
let E = {
|
|
1999
2003
|
meta: { storedOn: t.toString() },
|
|
2000
|
-
data: { ...(c = l.value[y]) == null ? void 0 : c.data, ...
|
|
2004
|
+
data: { ...(c = l.value[y]) == null ? void 0 : c.data, ...I }
|
|
2001
2005
|
};
|
|
2002
|
-
return l.value[y] =
|
|
2006
|
+
return l.value[y] = E, s == !0 && await me().setItem(y, E), I.id != null && I.rowVersion != null && Object.entries(l.value).forEach((M) => {
|
|
2003
2007
|
const b = M[1].data;
|
|
2004
2008
|
if (b != null)
|
|
2005
2009
|
if (Array.isArray(b))
|
|
2006
2010
|
for (let _ = 0; _ < b.length; _++)
|
|
2007
|
-
b[_].id ==
|
|
2011
|
+
b[_].id == I.id && b.splice(_, 1, E.data);
|
|
2008
2012
|
else
|
|
2009
|
-
b.id ==
|
|
2010
|
-
}),
|
|
2013
|
+
b.id == I.id && (l.value[M[0]] = E);
|
|
2014
|
+
}), E.data;
|
|
2011
2015
|
}
|
|
2012
|
-
return
|
|
2016
|
+
return I;
|
|
2013
2017
|
}
|
|
2014
2018
|
async function $(r) {
|
|
2015
2019
|
r.additionalUrl ?? (r.additionalUrl = "/post"), g(r);
|
|
2016
2020
|
const y = x(r);
|
|
2017
|
-
let
|
|
2021
|
+
let I;
|
|
2018
2022
|
if (e.api != null)
|
|
2019
2023
|
try {
|
|
2020
2024
|
let c = await e.api.post(r);
|
|
2021
|
-
|
|
2025
|
+
I = c == null ? void 0 : c.data;
|
|
2022
2026
|
} catch (c) {
|
|
2023
2027
|
throw c;
|
|
2024
2028
|
}
|
|
2025
2029
|
else
|
|
2026
|
-
|
|
2027
|
-
if (
|
|
2030
|
+
I = r.data;
|
|
2031
|
+
if (I != null) {
|
|
2028
2032
|
let c = {
|
|
2029
2033
|
meta: { storedOn: t.toString() },
|
|
2030
|
-
data:
|
|
2034
|
+
data: I
|
|
2031
2035
|
};
|
|
2032
2036
|
return s == !0 && await me().setItem(y, c), l.value[y] = c, c.data;
|
|
2033
2037
|
}
|
|
2034
|
-
return
|
|
2038
|
+
return I;
|
|
2035
2039
|
}
|
|
2036
2040
|
async function d(r) {
|
|
2037
2041
|
var c;
|
|
@@ -2039,20 +2043,20 @@ function In(e) {
|
|
|
2039
2043
|
const y = x(r);
|
|
2040
2044
|
if (e.api != null)
|
|
2041
2045
|
try {
|
|
2042
|
-
let
|
|
2043
|
-
if (
|
|
2044
|
-
return
|
|
2045
|
-
} catch (
|
|
2046
|
-
throw
|
|
2046
|
+
let E = await e.api.deleteItem(r);
|
|
2047
|
+
if (E != null)
|
|
2048
|
+
return E;
|
|
2049
|
+
} catch (E) {
|
|
2050
|
+
throw E;
|
|
2047
2051
|
}
|
|
2048
2052
|
delete l.value[y];
|
|
2049
|
-
const
|
|
2050
|
-
|
|
2053
|
+
const I = ((c = r.data) == null ? void 0 : c.id) ?? r.id;
|
|
2054
|
+
I != null && Object.entries(l.value).forEach((w) => {
|
|
2051
2055
|
const M = w[1].data;
|
|
2052
2056
|
if (M != null)
|
|
2053
2057
|
if (Array.isArray(M))
|
|
2054
2058
|
for (let b = 0; b < M.length; b++)
|
|
2055
|
-
M[b].id ==
|
|
2059
|
+
M[b].id == I && M.splice(b, 1);
|
|
2056
2060
|
else
|
|
2057
2061
|
delete l.value[w[0]];
|
|
2058
2062
|
}), s == !0 && await me().removeItem(y);
|
|
@@ -2094,35 +2098,35 @@ function Vr(e) {
|
|
|
2094
2098
|
});
|
|
2095
2099
|
}
|
|
2096
2100
|
function $(c) {
|
|
2097
|
-
const
|
|
2098
|
-
return x.value[
|
|
2101
|
+
const E = T();
|
|
2102
|
+
return x.value[E] || (x.value[E] = new Promise(async (w, M) => {
|
|
2099
2103
|
var b, _;
|
|
2100
2104
|
try {
|
|
2101
|
-
let
|
|
2105
|
+
let D = await ((_ = e.api) == null ? void 0 : _.getAll({
|
|
2102
2106
|
additionalUrl: "/getAll",
|
|
2103
2107
|
nav: c.nav,
|
|
2104
2108
|
params: {
|
|
2105
2109
|
lastUpdate: ((b = g.value) == null ? void 0 : b.lastUpdate) ?? un()
|
|
2106
2110
|
}
|
|
2107
2111
|
}));
|
|
2108
|
-
|
|
2112
|
+
D == null ? M(D) : (t.value ?? (t.value = []), D.data.forEach((L) => {
|
|
2109
2113
|
var A, J;
|
|
2110
2114
|
const f = t.value.findIndex((Q) => Q.id == L.id);
|
|
2111
2115
|
f >= 0 ? (A = t.value) == null || A.splice(f, 1, L) : (J = t.value) == null || J.push(L);
|
|
2112
2116
|
}), l.value = t.value.length, g.value = {
|
|
2113
2117
|
lastUpdate: de.utc().toString(),
|
|
2114
2118
|
storedOn: S.toString()
|
|
2115
|
-
}, await N(), w(
|
|
2116
|
-
} catch (
|
|
2117
|
-
M(
|
|
2119
|
+
}, await N(), w(D));
|
|
2120
|
+
} catch (D) {
|
|
2121
|
+
M(D);
|
|
2118
2122
|
} finally {
|
|
2119
|
-
delete x.value[
|
|
2123
|
+
delete x.value[E];
|
|
2120
2124
|
}
|
|
2121
|
-
})), x.value[
|
|
2125
|
+
})), x.value[E];
|
|
2122
2126
|
}
|
|
2123
2127
|
async function d(c) {
|
|
2124
2128
|
var M, b, _;
|
|
2125
|
-
const
|
|
2129
|
+
const E = T(), w = c.refresh;
|
|
2126
2130
|
if (!w && t.value != null)
|
|
2127
2131
|
return {
|
|
2128
2132
|
count: (M = t.value) == null ? void 0 : M.length,
|
|
@@ -2130,9 +2134,9 @@ function Vr(e) {
|
|
|
2130
2134
|
filters: []
|
|
2131
2135
|
};
|
|
2132
2136
|
if (!w && P == !0) {
|
|
2133
|
-
const
|
|
2134
|
-
if (
|
|
2135
|
-
return t.value =
|
|
2137
|
+
const D = await me().getItem(E);
|
|
2138
|
+
if (D != null && parseFloat(D.meta.storedOn) > S - 7)
|
|
2139
|
+
return t.value = D.data, l.value = D.data.length, s.value = D.filters ?? [], g.value = D.meta, {
|
|
2136
2140
|
count: (b = t.value) == null ? void 0 : b.length,
|
|
2137
2141
|
data: t.value ?? [],
|
|
2138
2142
|
filters: []
|
|
@@ -2147,14 +2151,14 @@ function Vr(e) {
|
|
|
2147
2151
|
t.value ?? (t.value = []);
|
|
2148
2152
|
try {
|
|
2149
2153
|
return await $(c);
|
|
2150
|
-
} catch (
|
|
2151
|
-
let L =
|
|
2154
|
+
} catch (D) {
|
|
2155
|
+
let L = D;
|
|
2152
2156
|
throw new Error(L.message ?? "Problem");
|
|
2153
2157
|
}
|
|
2154
2158
|
}
|
|
2155
2159
|
async function h(c) {
|
|
2156
|
-
var b, _,
|
|
2157
|
-
const
|
|
2160
|
+
var b, _, D, L;
|
|
2161
|
+
const E = T(), w = c.id ?? ((b = c.data) == null ? void 0 : b.id);
|
|
2158
2162
|
if (w == null)
|
|
2159
2163
|
throw new Error("no id provided");
|
|
2160
2164
|
let M = c.refresh;
|
|
@@ -2164,7 +2168,7 @@ function Vr(e) {
|
|
|
2164
2168
|
return { data: f };
|
|
2165
2169
|
}
|
|
2166
2170
|
if (!M && P == !0) {
|
|
2167
|
-
const f = await me().getItem(
|
|
2171
|
+
const f = await me().getItem(E);
|
|
2168
2172
|
if (f != null && parseFloat(f.meta.storedOn) > S - 12) {
|
|
2169
2173
|
t.value = f.data, l.value = f.data.length, s.value = f.filters ?? [], g.value = f.meta;
|
|
2170
2174
|
let A = (_ = t.value) == null ? void 0 : _.find((J) => J.id == c.id);
|
|
@@ -2174,7 +2178,7 @@ function Vr(e) {
|
|
|
2174
2178
|
}
|
|
2175
2179
|
if (e.api == null)
|
|
2176
2180
|
return {
|
|
2177
|
-
data: (
|
|
2181
|
+
data: (D = t.value) == null ? void 0 : D.find((f) => f.id == c.id)
|
|
2178
2182
|
};
|
|
2179
2183
|
t.value ?? (t.value = []);
|
|
2180
2184
|
try {
|
|
@@ -2187,38 +2191,38 @@ function Vr(e) {
|
|
|
2187
2191
|
async function u(c) {
|
|
2188
2192
|
var w, M, b;
|
|
2189
2193
|
c.additionalUrl ?? (c.additionalUrl = "/patch");
|
|
2190
|
-
let
|
|
2194
|
+
let E;
|
|
2191
2195
|
if (e.api != null)
|
|
2192
2196
|
try {
|
|
2193
2197
|
let _ = await e.api.patch(c);
|
|
2194
|
-
|
|
2198
|
+
E = { ...c.data, ..._ == null ? void 0 : _.data };
|
|
2195
2199
|
} catch (_) {
|
|
2196
|
-
let
|
|
2197
|
-
throw new Error(
|
|
2200
|
+
let D = _;
|
|
2201
|
+
throw new Error(D.message ?? "Patch Problem");
|
|
2198
2202
|
}
|
|
2199
2203
|
else
|
|
2200
|
-
|
|
2201
|
-
if (
|
|
2202
|
-
let _ = (w = t.value) == null ? void 0 : w.findIndex((
|
|
2203
|
-
_ != null && _ >= 0 && (t.value ?? (t.value = []), (M = t.value) == null || M.splice(_, 1,
|
|
2204
|
+
E = c.data;
|
|
2205
|
+
if (E != null) {
|
|
2206
|
+
let _ = (w = t.value) == null ? void 0 : w.findIndex((D) => D.id == E.id);
|
|
2207
|
+
_ != null && _ >= 0 && (t.value ?? (t.value = []), (M = t.value) == null || M.splice(_, 1, E), await N());
|
|
2204
2208
|
}
|
|
2205
2209
|
return (b = t.value) == null ? void 0 : b.find((_) => _.id == (c.id ?? c.data.id));
|
|
2206
2210
|
}
|
|
2207
2211
|
async function r(c) {
|
|
2208
2212
|
var w, M;
|
|
2209
2213
|
c.additionalUrl ?? (c.additionalUrl = "/post");
|
|
2210
|
-
let
|
|
2214
|
+
let E;
|
|
2211
2215
|
if (e.api != null)
|
|
2212
2216
|
try {
|
|
2213
2217
|
let b = await e.api.post(c);
|
|
2214
|
-
|
|
2218
|
+
E = b == null ? void 0 : b.data;
|
|
2215
2219
|
} catch (b) {
|
|
2216
2220
|
let _ = b;
|
|
2217
2221
|
throw new Error(_.message ?? "Patch Problem");
|
|
2218
2222
|
}
|
|
2219
2223
|
else
|
|
2220
|
-
|
|
2221
|
-
return
|
|
2224
|
+
E = c.data;
|
|
2225
|
+
return E != null && (t.value ?? (t.value = []), (w = t.value) == null || w.unshift(E), l.value += 1, await N()), (M = t.value) == null ? void 0 : M.find((b) => b.id == (c.id ?? c.data.id));
|
|
2222
2226
|
}
|
|
2223
2227
|
async function y(c) {
|
|
2224
2228
|
var w, M;
|
|
@@ -2231,14 +2235,14 @@ function Vr(e) {
|
|
|
2231
2235
|
let _ = b;
|
|
2232
2236
|
throw new Error(_.message ?? "Patch Problem");
|
|
2233
2237
|
}
|
|
2234
|
-
const
|
|
2235
|
-
if (
|
|
2236
|
-
let b = (w = t.value) == null ? void 0 : w.findIndex((_) => _.id ==
|
|
2238
|
+
const E = c.id ?? c.data.id;
|
|
2239
|
+
if (E != null) {
|
|
2240
|
+
let b = (w = t.value) == null ? void 0 : w.findIndex((_) => _.id == E);
|
|
2237
2241
|
b != null && b >= 0 && (t.value ?? (t.value = []), (M = t.value) == null || M.splice(b, 1), await N());
|
|
2238
2242
|
}
|
|
2239
2243
|
}
|
|
2240
|
-
async function
|
|
2241
|
-
var
|
|
2244
|
+
async function I(c) {
|
|
2245
|
+
var E;
|
|
2242
2246
|
if (c.additionalUrl ?? (c.additionalUrl = `/patch/restore?id=${c.data.id}`), e.api != null)
|
|
2243
2247
|
try {
|
|
2244
2248
|
await e.api.patch(c);
|
|
@@ -2252,7 +2256,7 @@ function Vr(e) {
|
|
|
2252
2256
|
let M = w;
|
|
2253
2257
|
throw new Error(M.message ?? "Problem");
|
|
2254
2258
|
}
|
|
2255
|
-
return (
|
|
2259
|
+
return (E = t.value) == null ? void 0 : E.find((w) => w.id == (c.id ?? c.data.id));
|
|
2256
2260
|
}
|
|
2257
2261
|
return {
|
|
2258
2262
|
deleteItem: y,
|
|
@@ -2260,15 +2264,15 @@ function Vr(e) {
|
|
|
2260
2264
|
getAll: d,
|
|
2261
2265
|
patch: u,
|
|
2262
2266
|
post: r,
|
|
2263
|
-
restore:
|
|
2267
|
+
restore: I
|
|
2264
2268
|
};
|
|
2265
2269
|
});
|
|
2266
2270
|
}
|
|
2267
2271
|
let Ar;
|
|
2268
|
-
function
|
|
2272
|
+
function Er() {
|
|
2269
2273
|
return Ar;
|
|
2270
2274
|
}
|
|
2271
|
-
function
|
|
2275
|
+
function In(e) {
|
|
2272
2276
|
const t = (e == null ? void 0 : e.buildHeaders) ?? P, l = (e == null ? void 0 : e.buildQuery) ?? g, S = (e == null ? void 0 : e.buildUrl) ?? x, s = e == null ? void 0 : e.demo;
|
|
2273
2277
|
function g(u) {
|
|
2274
2278
|
let r = new URLSearchParams();
|
|
@@ -2283,14 +2287,14 @@ function En(e) {
|
|
|
2283
2287
|
return r == null && (e == null ? void 0 : e.findPath) != null && (r = e.findPath(u.nav)), u.additionalUrl != null && (r == null ? r = u.additionalUrl : r = Be(r, u.additionalUrl)), y != null && (r != null && r.includes("{id}") ? r = r.replaceAll("{id}", y) : r = Be(r, y)), u.params != null && (r = `${r}?${l(u.params)}`), u.finalUrl = r, u.finalUrl ?? "";
|
|
2284
2288
|
}
|
|
2285
2289
|
function P(u) {
|
|
2286
|
-
var y,
|
|
2290
|
+
var y, I;
|
|
2287
2291
|
let r = { ...u.headers };
|
|
2288
|
-
return u.proxyID && (r.ManagedCompanyAccountID ?? (r.ManagedCompanyAccountID = u.proxyID)), (e == null ? void 0 : e.useBearerToken) != !1 && ((y = e == null ? void 0 : e.auth) == null ? void 0 : y.isLoggedIn.value) == !0 && (r.authorization ?? (r.authorization = `bearer ${(
|
|
2292
|
+
return u.proxyID && (r.ManagedCompanyAccountID ?? (r.ManagedCompanyAccountID = u.proxyID)), (e == null ? void 0 : e.useBearerToken) != !1 && ((y = e == null ? void 0 : e.auth) == null ? void 0 : y.isLoggedIn.value) == !0 && (r.authorization ?? (r.authorization = `bearer ${(I = e == null ? void 0 : e.auth) == null ? void 0 : I.credentials.value.token}`)), r["Content-Type"] ?? (r["Content-Type"] = u.contentType ?? (e == null ? void 0 : e.defaultContentType) ?? "application/json"), r;
|
|
2289
2293
|
}
|
|
2290
2294
|
async function T(u) {
|
|
2291
|
-
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, y = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0,
|
|
2292
|
-
let c = u.finalUrl,
|
|
2293
|
-
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (
|
|
2295
|
+
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, y = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0, I = u.returnText ?? (e == null ? void 0 : e.defaultReturnText) ?? !1;
|
|
2296
|
+
let c = u.finalUrl, E = u.headers;
|
|
2297
|
+
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (E = t(u)), s != null && s.isDemoing.value)
|
|
2294
2298
|
return console.log(`DEMO: Get from ${c}`), s.get(u);
|
|
2295
2299
|
console.log(`Get from ${c}`);
|
|
2296
2300
|
let w;
|
|
@@ -2299,7 +2303,7 @@ function En(e) {
|
|
|
2299
2303
|
method: "GET",
|
|
2300
2304
|
mode: "cors",
|
|
2301
2305
|
cache: "no-cache",
|
|
2302
|
-
headers:
|
|
2306
|
+
headers: E
|
|
2303
2307
|
}), !w.ok) {
|
|
2304
2308
|
if (w.status == 401)
|
|
2305
2309
|
throw {
|
|
@@ -2310,7 +2314,7 @@ function En(e) {
|
|
|
2310
2314
|
let M = await w.text();
|
|
2311
2315
|
throw new Error(M ?? w.statusText ?? "Get error");
|
|
2312
2316
|
}
|
|
2313
|
-
if (
|
|
2317
|
+
if (I)
|
|
2314
2318
|
return await w.text();
|
|
2315
2319
|
if (y)
|
|
2316
2320
|
return await w.json();
|
|
@@ -2323,9 +2327,9 @@ function En(e) {
|
|
|
2323
2327
|
}
|
|
2324
2328
|
}
|
|
2325
2329
|
async function N(u) {
|
|
2326
|
-
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, y = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0,
|
|
2327
|
-
let c = u.finalUrl,
|
|
2328
|
-
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (
|
|
2330
|
+
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, y = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0, I = u.returnText ?? (e == null ? void 0 : e.defaultReturnText) ?? !1;
|
|
2331
|
+
let c = u.finalUrl, E = u.headers;
|
|
2332
|
+
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (E = t(u)), s != null && s.isDemoing.value)
|
|
2329
2333
|
return console.log(`DEMO: Get all from ${c}`), s.getAll(u);
|
|
2330
2334
|
console.log(`Get all from ${c}`);
|
|
2331
2335
|
let w;
|
|
@@ -2334,7 +2338,7 @@ function En(e) {
|
|
|
2334
2338
|
method: "GET",
|
|
2335
2339
|
mode: "cors",
|
|
2336
2340
|
cache: "no-cache",
|
|
2337
|
-
headers:
|
|
2341
|
+
headers: E
|
|
2338
2342
|
}), !w.ok) {
|
|
2339
2343
|
if (w.status == 401)
|
|
2340
2344
|
throw {
|
|
@@ -2345,7 +2349,7 @@ function En(e) {
|
|
|
2345
2349
|
let M = await w.text();
|
|
2346
2350
|
throw new Error(M ?? w.statusText ?? "Get all error");
|
|
2347
2351
|
}
|
|
2348
|
-
if (
|
|
2352
|
+
if (I)
|
|
2349
2353
|
return await w.text();
|
|
2350
2354
|
if (y)
|
|
2351
2355
|
return await w.json();
|
|
@@ -2358,9 +2362,9 @@ function En(e) {
|
|
|
2358
2362
|
}
|
|
2359
2363
|
}
|
|
2360
2364
|
async function $(u) {
|
|
2361
|
-
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, y = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0,
|
|
2362
|
-
let c = u.finalUrl,
|
|
2363
|
-
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (
|
|
2365
|
+
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, y = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0, I = u.returnText ?? (e == null ? void 0 : e.defaultReturnText) ?? !1;
|
|
2366
|
+
let c = u.finalUrl, E = u.headers;
|
|
2367
|
+
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (E = t(u)), s != null && s.isDemoing.value)
|
|
2364
2368
|
return console.log(`DEMO: Post to ${c}`), s.post(u);
|
|
2365
2369
|
console.log(`Post to ${c}`);
|
|
2366
2370
|
let w;
|
|
@@ -2369,7 +2373,7 @@ function En(e) {
|
|
|
2369
2373
|
method: "POST",
|
|
2370
2374
|
mode: "cors",
|
|
2371
2375
|
cache: "no-cache",
|
|
2372
|
-
headers:
|
|
2376
|
+
headers: E,
|
|
2373
2377
|
body: JSON.stringify(u.data)
|
|
2374
2378
|
}), !w.ok) {
|
|
2375
2379
|
if (w.status == 401)
|
|
@@ -2381,7 +2385,7 @@ function En(e) {
|
|
|
2381
2385
|
let M = await w.text();
|
|
2382
2386
|
throw new Error(M ?? w.statusText ?? "Post error!");
|
|
2383
2387
|
}
|
|
2384
|
-
if (
|
|
2388
|
+
if (I)
|
|
2385
2389
|
return await w.text();
|
|
2386
2390
|
if (y)
|
|
2387
2391
|
return await w.json();
|
|
@@ -2394,9 +2398,9 @@ function En(e) {
|
|
|
2394
2398
|
}
|
|
2395
2399
|
}
|
|
2396
2400
|
async function d(u) {
|
|
2397
|
-
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, y = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0,
|
|
2398
|
-
let c = u.finalUrl,
|
|
2399
|
-
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (
|
|
2401
|
+
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, y = u.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0, I = u.returnText ?? (e == null ? void 0 : e.defaultReturnText) ?? !1;
|
|
2402
|
+
let c = u.finalUrl, E = u.headers;
|
|
2403
|
+
if (c == null && (c = S(u)), u.overrideHeaders !== !0 && (E = t(u)), s != null && s.isDemoing.value)
|
|
2400
2404
|
return console.log(`DEMO: Patch to ${c}`), s.patch(u);
|
|
2401
2405
|
console.log(`Patch to ${c}`);
|
|
2402
2406
|
let w;
|
|
@@ -2405,7 +2409,7 @@ function En(e) {
|
|
|
2405
2409
|
method: "PATCH",
|
|
2406
2410
|
mode: "cors",
|
|
2407
2411
|
cache: "no-cache",
|
|
2408
|
-
headers:
|
|
2412
|
+
headers: E,
|
|
2409
2413
|
body: JSON.stringify(u.data)
|
|
2410
2414
|
}), !w.ok) {
|
|
2411
2415
|
if (w.status == 401)
|
|
@@ -2417,7 +2421,7 @@ function En(e) {
|
|
|
2417
2421
|
let M = await w.text();
|
|
2418
2422
|
throw new Error(M ?? w.statusText ?? "Patch error!");
|
|
2419
2423
|
}
|
|
2420
|
-
if (
|
|
2424
|
+
if (I)
|
|
2421
2425
|
return await w.text();
|
|
2422
2426
|
if (y)
|
|
2423
2427
|
return await w.json();
|
|
@@ -2431,8 +2435,8 @@ function En(e) {
|
|
|
2431
2435
|
}
|
|
2432
2436
|
async function h(u) {
|
|
2433
2437
|
const r = u.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0;
|
|
2434
|
-
let y = u.finalUrl,
|
|
2435
|
-
if (y == null && (y = S(u)), u.overrideHeaders !== !0 && (
|
|
2438
|
+
let y = u.finalUrl, I = u.headers;
|
|
2439
|
+
if (y == null && (y = S(u)), u.overrideHeaders !== !0 && (I = t(u)), s != null && s.isDemoing.value)
|
|
2436
2440
|
return console.log(`DEMO: Delete ${y}`), s.deleteItem(u);
|
|
2437
2441
|
console.log(`Delete ${y}`);
|
|
2438
2442
|
let c;
|
|
@@ -2441,7 +2445,7 @@ function En(e) {
|
|
|
2441
2445
|
method: "DELETE",
|
|
2442
2446
|
mode: "cors",
|
|
2443
2447
|
cache: "no-cache",
|
|
2444
|
-
headers:
|
|
2448
|
+
headers: I,
|
|
2445
2449
|
body: JSON.stringify(u.data)
|
|
2446
2450
|
}), c.status == 401)
|
|
2447
2451
|
throw {
|
|
@@ -2450,11 +2454,11 @@ function En(e) {
|
|
|
2450
2454
|
message: c.statusText
|
|
2451
2455
|
};
|
|
2452
2456
|
return c.status == 200 ? void 0 : c.statusText;
|
|
2453
|
-
} catch (
|
|
2454
|
-
const w = `${(c == null ? void 0 : c.status) ?? ""} ${(c == null ? void 0 : c.statusText) ?? ""} ${
|
|
2457
|
+
} catch (E) {
|
|
2458
|
+
const w = `${(c == null ? void 0 : c.status) ?? ""} ${(c == null ? void 0 : c.statusText) ?? ""} ${E.message}`;
|
|
2455
2459
|
if (!r)
|
|
2456
2460
|
return w;
|
|
2457
|
-
throw
|
|
2461
|
+
throw E.code == 401 ? E : new Error(`${c.status} ${c.statusText} ${E.message}`);
|
|
2458
2462
|
}
|
|
2459
2463
|
}
|
|
2460
2464
|
return Ar = {
|
|
@@ -2473,14 +2477,14 @@ function it(e) {
|
|
|
2473
2477
|
function P(r) {
|
|
2474
2478
|
r.nav ?? (r.nav = e == null ? void 0 : e.nav), r.proxyID ?? (r.proxyID = e == null ? void 0 : e.proxyID), r.refresh ?? (r.refresh = e == null ? void 0 : e.refresh), r.throwError ?? (r.throwError = e == null ? void 0 : e.throwError), r.url ?? (r.url = e == null ? void 0 : e.url), r.confirmationMsg ?? (r.confirmationMsg = r.requireConfirmation === !0 ? "Are you sure you want to delete this item?" : void 0);
|
|
2475
2479
|
let y = (r == null ? void 0 : r.store) ?? (e == null ? void 0 : e.store);
|
|
2476
|
-
const
|
|
2480
|
+
const I = (e == null ? void 0 : e.items) ?? [];
|
|
2477
2481
|
return y == null && r.nav != null && (y = Le({ nav: r.nav })), y != null ? r.onDeleteAsync ?? (r.onDeleteAsync = () => y().deleteItem(r)) : r.onDeleteAsync ?? (r.onDeleteAsync = () => {
|
|
2478
2482
|
var w;
|
|
2479
2483
|
const c = r.id ?? ((w = r.data) == null ? void 0 : w.id);
|
|
2480
2484
|
if (c == null)
|
|
2481
2485
|
return Promise.resolve("No id found in delete action");
|
|
2482
|
-
const
|
|
2483
|
-
return
|
|
2486
|
+
const E = I.findIndex((M) => M.id == c);
|
|
2487
|
+
return E >= 0 && I.splice(E, 1), Promise.resolve(void 0);
|
|
2484
2488
|
}), g(async () => {
|
|
2485
2489
|
let c;
|
|
2486
2490
|
r.onCanDeleteAsync != null && (c = await r.onCanDeleteAsync(r.data)), c == null && r.onDeleteAsync != null && (c = await r.onDeleteAsync(r.data)), c == null && r.onDeleteSuccessAsync != null && await r.onDeleteSuccessAsync(r.data), x(c);
|
|
@@ -2496,11 +2500,11 @@ function it(e) {
|
|
|
2496
2500
|
function T(r) {
|
|
2497
2501
|
r.nav ?? (r.nav = e == null ? void 0 : e.nav), r.proxyID ?? (r.proxyID = e == null ? void 0 : e.proxyID), r.refresh ?? (r.refresh = e == null ? void 0 : e.refresh), r.throwError ?? (r.throwError = e == null ? void 0 : e.throwError), r.url ?? (r.url = e == null ? void 0 : e.url), r.confirmationMsg ?? (r.confirmationMsg = r.requireConfirmation === !0 ? "Are you sure you want to get this item?" : void 0);
|
|
2498
2502
|
let y = (r == null ? void 0 : r.store) ?? (e == null ? void 0 : e.store);
|
|
2499
|
-
const
|
|
2503
|
+
const I = (e == null ? void 0 : e.items) ?? [];
|
|
2500
2504
|
return y == null && r.nav != null && (y = Le({ nav: r.nav })), y != null ? r.onGetAsync ?? (r.onGetAsync = async () => (await y().get(r)).data) : r.onGetAsync ?? (r.onGetAsync = () => {
|
|
2501
|
-
var
|
|
2502
|
-
const c = r.id ?? ((
|
|
2503
|
-
return c == null ? Promise.resolve(void 0) : Promise.resolve(
|
|
2505
|
+
var E;
|
|
2506
|
+
const c = r.id ?? ((E = r.data) == null ? void 0 : E.id);
|
|
2507
|
+
return c == null ? Promise.resolve(void 0) : Promise.resolve(I.find((w) => w.id == c));
|
|
2504
2508
|
}), g(async () => {
|
|
2505
2509
|
let c;
|
|
2506
2510
|
return r.onGetAsync != null && (c = await r.onGetAsync(r)), r.onGetSuccessAsync != null && (c = await r.onGetSuccessAsync(c, r)), c;
|
|
@@ -2516,8 +2520,8 @@ function it(e) {
|
|
|
2516
2520
|
function N(r) {
|
|
2517
2521
|
r.nav ?? (r.nav = e == null ? void 0 : e.nav), r.proxyID ?? (r.proxyID = e == null ? void 0 : e.proxyID), r.refresh ?? (r.refresh = e == null ? void 0 : e.refresh), r.throwError ?? (r.throwError = e == null ? void 0 : e.throwError), r.url ?? (r.url = e == null ? void 0 : e.url), r.confirmationMsg ?? (r.confirmationMsg = r.requireConfirmation === !0 ? "Are you sure you want to get these items?" : void 0);
|
|
2518
2522
|
let y = (r == null ? void 0 : r.store) ?? (e == null ? void 0 : e.store);
|
|
2519
|
-
const
|
|
2520
|
-
return y == null && r.nav != null && (y = Le({ nav: r.nav })), y != null ? r.onGetAsync ?? (r.onGetAsync = () => y().getAll(r)) : r.onGetAsync ?? (r.onGetAsync = () => Promise.resolve(
|
|
2523
|
+
const I = (e == null ? void 0 : e.items) ?? [];
|
|
2524
|
+
return y == null && r.nav != null && (y = Le({ nav: r.nav })), y != null ? r.onGetAsync ?? (r.onGetAsync = () => y().getAll(r)) : r.onGetAsync ?? (r.onGetAsync = () => Promise.resolve(I)), g(async () => {
|
|
2521
2525
|
let c;
|
|
2522
2526
|
return r.onGetAsync != null && (c = await r.onGetAsync(r)), r.onGetSuccessAsync != null && (c = await r.onGetSuccessAsync(c, r)), c;
|
|
2523
2527
|
}, {
|
|
@@ -2533,8 +2537,8 @@ function it(e) {
|
|
|
2533
2537
|
r.nav ?? (r.nav = e == null ? void 0 : e.nav), r.proxyID ?? (r.proxyID = e == null ? void 0 : e.proxyID), r.refresh ?? (r.refresh = e == null ? void 0 : e.refresh), r.throwError ?? (r.throwError = e == null ? void 0 : e.throwError), r.url ?? (r.url = e == null ? void 0 : e.url), r.confirmationMsg ?? (r.confirmationMsg = r.requireConfirmation === !0 ? "Are you sure you want to restore this item?" : void 0);
|
|
2534
2538
|
let y = (r == null ? void 0 : r.store) ?? (e == null ? void 0 : e.store);
|
|
2535
2539
|
return y == null && r.nav != null && (y = Le({ nav: r.nav })), y != null && (r.onRestoreAsync ?? (r.onRestoreAsync = () => y().restore(r))), g(async () => {
|
|
2536
|
-
let
|
|
2537
|
-
return r.onCanRestoreAsync != null && (
|
|
2540
|
+
let I, c;
|
|
2541
|
+
return r.onCanRestoreAsync != null && (I = await r.onCanRestoreAsync(r.data)), I == null && r.onRestoreAsync != null && (c = await r.onRestoreAsync(r.data)), c != null && r.onRestoreSuccessAsync != null && await r.onRestoreSuccessAsync(c), x(I), c;
|
|
2538
2542
|
}, {
|
|
2539
2543
|
completionMsg: r.completionMsg ?? (e == null ? void 0 : e.completionMsg),
|
|
2540
2544
|
confirmationMsg: r.confirmationMsg ?? (e == null ? void 0 : e.confirmationMsg),
|
|
@@ -2547,13 +2551,13 @@ function it(e) {
|
|
|
2547
2551
|
function d(r) {
|
|
2548
2552
|
r.nav ?? (r.nav = e == null ? void 0 : e.nav), r.proxyID ?? (r.proxyID = e == null ? void 0 : e.proxyID), r.refresh ?? (r.refresh = e == null ? void 0 : e.refresh), r.throwError ?? (r.throwError = e == null ? void 0 : e.throwError), r.url ?? (r.url = e == null ? void 0 : e.url), r.confirmationMsg ?? (r.confirmationMsg = r.requireConfirmation === !0 ? "Are you sure you want to save this item?" : void 0);
|
|
2549
2553
|
let y = (r == null ? void 0 : r.store) ?? (e == null ? void 0 : e.store);
|
|
2550
|
-
const
|
|
2554
|
+
const I = (e == null ? void 0 : e.items) ?? [];
|
|
2551
2555
|
return r.onGetSaveAsync ?? (r.onGetSaveAsync = (c) => c), r.onCanSaveAsync ?? (r.onCanSaveAsync = () => Promise.resolve(void 0)), y == null && r.nav != null && (y = Le({ nav: r.nav })), y != null ? r.onSaveAsync ?? (r.onSaveAsync = async () => {
|
|
2552
2556
|
var c;
|
|
2553
2557
|
return r.mode ?? (r.mode = ((c = r.data) == null ? void 0 : c.id) == null ? "new" : "edit"), r.mode == "new" ? await y().post(r) : await y().patch(r);
|
|
2554
2558
|
}) : r.onSaveAsync ?? (r.onSaveAsync = (c) => {
|
|
2555
|
-
const
|
|
2556
|
-
return
|
|
2559
|
+
const E = I.findIndex((w) => w.id == c.id);
|
|
2560
|
+
return E >= 0 ? I.splice(E, 1, c) : I.push(c), Promise.resolve(c);
|
|
2557
2561
|
}), g(async () => {
|
|
2558
2562
|
let c;
|
|
2559
2563
|
if (r.onGetSaveAsync != null && (c = await r.onGetSaveAsync(r.data)), c == null)
|
|
@@ -2563,8 +2567,8 @@ function it(e) {
|
|
|
2563
2567
|
if (x(w), w != null)
|
|
2564
2568
|
return;
|
|
2565
2569
|
}
|
|
2566
|
-
let
|
|
2567
|
-
return r.onSaveAsync != null && (
|
|
2570
|
+
let E;
|
|
2571
|
+
return r.onSaveAsync != null && (E = await r.onSaveAsync(c), E = E.data != null ? E.data : E), r.onSaveSuccessAsync != null && (E = await r.onSaveSuccessAsync(E)), E;
|
|
2568
2572
|
}, {
|
|
2569
2573
|
completionMsg: r.completionMsg ?? (e == null ? void 0 : e.completionMsg),
|
|
2570
2574
|
confirmationMsg: r.confirmationMsg ?? (e == null ? void 0 : e.confirmationMsg),
|
|
@@ -2575,10 +2579,10 @@ function it(e) {
|
|
|
2575
2579
|
});
|
|
2576
2580
|
}
|
|
2577
2581
|
function h(r) {
|
|
2578
|
-
return r.nav ?? (r.nav = e == null ? void 0 : e.nav), r.proxyID ?? (r.proxyID = e == null ? void 0 : e.proxyID), r.throwError ?? (r.throwError = e == null ? void 0 : e.throwError), r.url ?? (r.url = e == null ? void 0 : e.url), g(async () => await (r.api ??
|
|
2582
|
+
return r.nav ?? (r.nav = e == null ? void 0 : e.nav), r.proxyID ?? (r.proxyID = e == null ? void 0 : e.proxyID), r.throwError ?? (r.throwError = e == null ? void 0 : e.throwError), r.url ?? (r.url = e == null ? void 0 : e.url), g(async () => await (r.api ?? Er()).get(r), { ...e, ...r });
|
|
2579
2583
|
}
|
|
2580
2584
|
function u(r) {
|
|
2581
|
-
return r.nav ?? (r.nav = e == null ? void 0 : e.nav), r.proxyID ?? (r.proxyID = e == null ? void 0 : e.proxyID), r.throwError ?? (r.throwError = e == null ? void 0 : e.throwError), r.url ?? (r.url = e == null ? void 0 : e.url), g(async () => await (r.api ??
|
|
2585
|
+
return r.nav ?? (r.nav = e == null ? void 0 : e.nav), r.proxyID ?? (r.proxyID = e == null ? void 0 : e.proxyID), r.throwError ?? (r.throwError = e == null ? void 0 : e.throwError), r.url ?? (r.url = e == null ? void 0 : e.url), g(async () => await (r.api ?? Er()).post(r), { ...e, ...r });
|
|
2582
2586
|
}
|
|
2583
2587
|
return {
|
|
2584
2588
|
actionLoadingMsg: l,
|
|
@@ -2596,10 +2600,10 @@ function it(e) {
|
|
|
2596
2600
|
saveItem: d
|
|
2597
2601
|
};
|
|
2598
2602
|
}
|
|
2599
|
-
let hr = "Australia/Melbourne",
|
|
2603
|
+
let hr = "Australia/Melbourne", Ir;
|
|
2600
2604
|
const Hr = "auth-credentials-state";
|
|
2601
2605
|
function Dn() {
|
|
2602
|
-
return
|
|
2606
|
+
return Ir;
|
|
2603
2607
|
}
|
|
2604
2608
|
function xn(e) {
|
|
2605
2609
|
const t = e.expiryTokenFormat ?? "d/MM/yyyy h:mm:ss a";
|
|
@@ -2609,10 +2613,10 @@ function xn(e) {
|
|
|
2609
2613
|
l.value = Math.random().toString(36).substring(4, 19) + Math.random().toString(12).substring(1, 11), localStorage.setItem(Hr, l.value);
|
|
2610
2614
|
}
|
|
2611
2615
|
const s = Jt("auth-credentials", {});
|
|
2612
|
-
function g(
|
|
2613
|
-
if (
|
|
2616
|
+
function g(D) {
|
|
2617
|
+
if (D == null)
|
|
2614
2618
|
return !0;
|
|
2615
|
-
var L = e.getAuthItem != null ? e.getAuthItem(
|
|
2619
|
+
var L = e.getAuthItem != null ? e.getAuthItem(D) : null;
|
|
2616
2620
|
if (L == null)
|
|
2617
2621
|
return !1;
|
|
2618
2622
|
if (L.requiresAuth === !1)
|
|
@@ -2629,20 +2633,20 @@ function xn(e) {
|
|
|
2629
2633
|
}
|
|
2630
2634
|
return !0;
|
|
2631
2635
|
}
|
|
2632
|
-
function x(
|
|
2636
|
+
function x(D) {
|
|
2633
2637
|
const L = K(s);
|
|
2634
2638
|
if (L.userPermissions != null)
|
|
2635
2639
|
for (var f = 0; f < L.userPermissions.length; f++) {
|
|
2636
2640
|
var A = L.userPermissions[f].split(".");
|
|
2637
|
-
if (L.userPermissions[f] == "everything.edit" ||
|
|
2641
|
+
if (L.userPermissions[f] == "everything.edit" || D == A[0] && A.length > 1 && A[1] == "edit")
|
|
2638
2642
|
return !0;
|
|
2639
2643
|
}
|
|
2640
2644
|
return !1;
|
|
2641
2645
|
}
|
|
2642
|
-
function P(
|
|
2643
|
-
if (
|
|
2646
|
+
function P(D) {
|
|
2647
|
+
if (D == null)
|
|
2644
2648
|
return !0;
|
|
2645
|
-
var L = e.getAuthItem != null ? e.getAuthItem(
|
|
2649
|
+
var L = e.getAuthItem != null ? e.getAuthItem(D) : null;
|
|
2646
2650
|
if (L == null)
|
|
2647
2651
|
return !1;
|
|
2648
2652
|
if (L.requiresAuth === !1)
|
|
@@ -2659,24 +2663,24 @@ function xn(e) {
|
|
|
2659
2663
|
}
|
|
2660
2664
|
return !0;
|
|
2661
2665
|
}
|
|
2662
|
-
function T(
|
|
2666
|
+
function T(D) {
|
|
2663
2667
|
const L = K(s);
|
|
2664
2668
|
if (L.userPermissions != null)
|
|
2665
2669
|
for (var f = 0; f < L.userPermissions.length; f++) {
|
|
2666
2670
|
var A = L.userPermissions[f].split(".");
|
|
2667
|
-
if (
|
|
2671
|
+
if (D == A[0] || D == "everything" || L.userPermissions[f] == "everything.view" || L.userPermissions[f] == "everything.edit")
|
|
2668
2672
|
return !0;
|
|
2669
2673
|
}
|
|
2670
2674
|
return !1;
|
|
2671
2675
|
}
|
|
2672
|
-
function N(
|
|
2676
|
+
function N(D, L, f) {
|
|
2673
2677
|
let A = !0;
|
|
2674
2678
|
return K(s).isGlobalAdmin ? !0 : (L != null && L.length > 0 && L.forEach((Q) => {
|
|
2675
2679
|
f == "edit" ? x(Q) || (A = !1) : T(Q) || (A = !1);
|
|
2676
|
-
}),
|
|
2680
|
+
}), D != null && D.length > 0 && (D.some((Q) => u(Q)) || (A = !1)), A);
|
|
2677
2681
|
}
|
|
2678
|
-
function $(
|
|
2679
|
-
var f = e.getAuthItem != null ? e.getAuthItem(
|
|
2682
|
+
function $(D, L = !1) {
|
|
2683
|
+
var f = e.getAuthItem != null ? e.getAuthItem(D) : null;
|
|
2680
2684
|
let A = !1;
|
|
2681
2685
|
if (f == null)
|
|
2682
2686
|
return !1;
|
|
@@ -2685,43 +2689,43 @@ function xn(e) {
|
|
|
2685
2689
|
$(ie, !0) && (A = !0);
|
|
2686
2690
|
}), A);
|
|
2687
2691
|
}
|
|
2688
|
-
function d(
|
|
2692
|
+
function d(D) {
|
|
2689
2693
|
return e.getAuthorizeUrl ?? (e.getAuthorizeUrl = (L, f) => {
|
|
2690
2694
|
const A = Be(qr(), `authorize?response_type=code&client_id=${e.oauthClientID}&redirect_uri=${window.location.origin}/authentication&state=${f}`);
|
|
2691
2695
|
return L ? `${A}&redirect_path=${L}` : A;
|
|
2692
|
-
}), e.getAuthorizeUrl != null ? e.getAuthorizeUrl(
|
|
2696
|
+
}), e.getAuthorizeUrl != null ? e.getAuthorizeUrl(D, l.value) ?? "" : "";
|
|
2693
2697
|
}
|
|
2694
|
-
function h(
|
|
2698
|
+
function h(D) {
|
|
2695
2699
|
var f;
|
|
2696
|
-
return
|
|
2700
|
+
return D == null ? 0 : ((f = (e.subscriptionOptions ?? []).find((A) => A.code == D)) == null ? void 0 : f.value) ?? 0;
|
|
2697
2701
|
}
|
|
2698
|
-
function u(
|
|
2702
|
+
function u(D) {
|
|
2699
2703
|
const L = K(s);
|
|
2700
2704
|
if (L.subscriptionCode == null)
|
|
2701
2705
|
return !1;
|
|
2702
|
-
if (L.subscriptionCode ==
|
|
2706
|
+
if (L.subscriptionCode == D)
|
|
2703
2707
|
return !0;
|
|
2704
|
-
const f = h(
|
|
2708
|
+
const f = h(D), A = h(L.subscriptionCode);
|
|
2705
2709
|
return f <= A;
|
|
2706
2710
|
}
|
|
2707
|
-
function r(
|
|
2708
|
-
const f =
|
|
2711
|
+
function r(D) {
|
|
2712
|
+
const f = D.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), A = decodeURIComponent(
|
|
2709
2713
|
atob(f).split("").map(function(J) {
|
|
2710
2714
|
return "%" + ("00" + J.charCodeAt(0).toString(16)).slice(-2);
|
|
2711
2715
|
}).join("")
|
|
2712
2716
|
);
|
|
2713
2717
|
return JSON.parse(A);
|
|
2714
2718
|
}
|
|
2715
|
-
function y(
|
|
2716
|
-
s.value = void 0, M(),
|
|
2719
|
+
function y(D, L) {
|
|
2720
|
+
s.value = void 0, M(), D != null && L != null && L.currentRoute.value.path != D && L.push({ path: D });
|
|
2717
2721
|
}
|
|
2718
|
-
function D
|
|
2722
|
+
function I(D) {
|
|
2719
2723
|
var f;
|
|
2720
|
-
K(s).isLoggedIn || ((f = e.demo) == null || f.endDemo(), _() && (y(), window.location.href = d(
|
|
2724
|
+
K(s).isLoggedIn || ((f = e.demo) == null || f.endDemo(), _() && (y(), window.location.href = d(D)));
|
|
2721
2725
|
}
|
|
2722
|
-
async function c(
|
|
2726
|
+
async function c(D, L) {
|
|
2723
2727
|
return e.getToken ?? (e.getToken = async () => {
|
|
2724
|
-
let f =
|
|
2728
|
+
let f = D, A = L, J = e.oauthGrantType ?? "authorization_token", Q = e.oauthClientID ?? "";
|
|
2725
2729
|
if (f == null || A == null)
|
|
2726
2730
|
throw new Error("Code and State required in OAuth token process");
|
|
2727
2731
|
if (A != l.value)
|
|
@@ -2730,40 +2734,40 @@ function xn(e) {
|
|
|
2730
2734
|
e.getTokenUrl ?? (e.getTokenUrl = () => Be(qr(), "token")), ee = e.getTokenUrl(f, `${window.location.origin}/authentication`, J, Q);
|
|
2731
2735
|
const ie = {};
|
|
2732
2736
|
ie.grant_type = J, ie.code = f, ie.redirect_uri = `${window.location.origin}/authentication`, ie.client_id = Q;
|
|
2733
|
-
const W = await
|
|
2737
|
+
const W = await Er().post({
|
|
2734
2738
|
additionalUrl: ee,
|
|
2735
2739
|
data: ie
|
|
2736
2740
|
});
|
|
2737
|
-
|
|
2738
|
-
}), await e.getToken(
|
|
2741
|
+
E(W.access_token);
|
|
2742
|
+
}), await e.getToken(D, L);
|
|
2739
2743
|
}
|
|
2740
|
-
function
|
|
2741
|
-
if (
|
|
2742
|
-
const L = r(
|
|
2743
|
-
w(L,
|
|
2744
|
+
function E(D) {
|
|
2745
|
+
if (D != null && (e.demo == null || !e.demo.isDemoing.value)) {
|
|
2746
|
+
const L = r(D);
|
|
2747
|
+
w(L, D), e.processTokenPayload != null && e.processTokenPayload(s, L);
|
|
2744
2748
|
}
|
|
2745
2749
|
}
|
|
2746
|
-
function w(
|
|
2750
|
+
function w(D, L) {
|
|
2747
2751
|
var A;
|
|
2748
2752
|
const f = s.value;
|
|
2749
|
-
f.expiresOn =
|
|
2753
|
+
f.expiresOn = D.ExpiresOn, f.isGlobalAdmin = D.IsGlobalAdmin == "True", f.isLoggedIn = !0, f.permissions = D.Permissions, f.subscriptionCode = D.Subscription, f.timeZone ?? (f.timeZone = e.defaultTimeZone ?? hr), f.token = L, f.userID = D.UserLoginID, f.userPermissions = ((A = D.Permissions) == null ? void 0 : A.split(",")) ?? [];
|
|
2750
2754
|
}
|
|
2751
2755
|
function M() {
|
|
2752
|
-
var
|
|
2753
|
-
s.value ?? (s.value = {}), (
|
|
2756
|
+
var D;
|
|
2757
|
+
s.value ?? (s.value = {}), (D = s.value).timeZone ?? (D.timeZone = e.defaultTimeZone ?? hr);
|
|
2754
2758
|
}
|
|
2755
2759
|
function b() {
|
|
2756
|
-
const
|
|
2757
|
-
return
|
|
2760
|
+
const D = K(s);
|
|
2761
|
+
return D.isLoggedIn && _() && (y(), window.location.href = d()), D.isLoggedIn;
|
|
2758
2762
|
}
|
|
2759
2763
|
function _() {
|
|
2760
|
-
const
|
|
2761
|
-
if (
|
|
2764
|
+
const D = K(s);
|
|
2765
|
+
if (D == null || D.expiresOn == null)
|
|
2762
2766
|
return !0;
|
|
2763
|
-
const L = de.fromFormat(
|
|
2767
|
+
const L = de.fromFormat(D.expiresOn, t), f = de.utc();
|
|
2764
2768
|
return L <= f;
|
|
2765
2769
|
}
|
|
2766
|
-
return M(),
|
|
2770
|
+
return M(), Ir = {
|
|
2767
2771
|
authState: l,
|
|
2768
2772
|
canEdit: g,
|
|
2769
2773
|
canEditPermit: x,
|
|
@@ -2775,13 +2779,13 @@ function xn(e) {
|
|
|
2775
2779
|
getAuthorizeUrl: d,
|
|
2776
2780
|
getToken: c,
|
|
2777
2781
|
isLoggedIn: te(() => s.value.isLoggedIn === !0),
|
|
2778
|
-
login:
|
|
2782
|
+
login: I,
|
|
2779
2783
|
logout: y,
|
|
2780
2784
|
resetAuthState: S,
|
|
2781
|
-
setAuth:
|
|
2785
|
+
setAuth: E,
|
|
2782
2786
|
timeZone: te(() => s.value.timeZone ?? e.defaultTimeZone ?? hr),
|
|
2783
2787
|
tryLogin: b
|
|
2784
|
-
},
|
|
2788
|
+
}, Ir;
|
|
2785
2789
|
}
|
|
2786
2790
|
function _n(e, t, l = {}) {
|
|
2787
2791
|
const {
|
|
@@ -2805,17 +2809,17 @@ function _n(e, t, l = {}) {
|
|
|
2805
2809
|
}, P = {
|
|
2806
2810
|
x: _.offsetLeft,
|
|
2807
2811
|
y: _.offsetTop
|
|
2808
|
-
}, ((f = l.onStart) == null ? void 0 : f.call(l, N, M)) !== !1 && (d.push(he("mousemove", y)), d.push(he("touchmove", y)), d.push(he("mouseup",
|
|
2812
|
+
}, ((f = l.onStart) == null ? void 0 : f.call(l, N, M)) !== !1 && (d.push(he("mousemove", y)), d.push(he("touchmove", y)), d.push(he("mouseup", I)), d.push(he("touchend", I)), u(M));
|
|
2809
2813
|
}
|
|
2810
2814
|
function y(M) {
|
|
2811
2815
|
var A;
|
|
2812
2816
|
if (!N || !K(e))
|
|
2813
2817
|
return;
|
|
2814
|
-
const
|
|
2815
|
-
let L =
|
|
2818
|
+
const D = M.type === "touchmove" && M.touches.length > 0 ? M.touches[0] : M;
|
|
2819
|
+
let L = D.clientX - N.x, f = D.clientY - N.y;
|
|
2816
2820
|
(g === "x" || g === "both") && (P.x = T.x + L), (g === "y" || g === "both") && (P.y = T.y + f), (A = l.onMove) == null || A.call(l, P, M), u(M), c(P);
|
|
2817
2821
|
}
|
|
2818
|
-
function
|
|
2822
|
+
function I(M) {
|
|
2819
2823
|
var b;
|
|
2820
2824
|
document.documentElement.style.cursor = "", d.forEach((_) => {
|
|
2821
2825
|
_();
|
|
@@ -2828,7 +2832,7 @@ function _n(e, t, l = {}) {
|
|
|
2828
2832
|
const _ = b.$el;
|
|
2829
2833
|
_.style.left = `${M.x}px`, _.style.top = `${M.y}px`;
|
|
2830
2834
|
}
|
|
2831
|
-
function
|
|
2835
|
+
function E() {
|
|
2832
2836
|
if (K(h))
|
|
2833
2837
|
return;
|
|
2834
2838
|
const M = K(t);
|
|
@@ -2851,7 +2855,7 @@ function _n(e, t, l = {}) {
|
|
|
2851
2855
|
return {
|
|
2852
2856
|
draggingIsOn: h,
|
|
2853
2857
|
turnDraggableOff: w,
|
|
2854
|
-
turnDraggableOn:
|
|
2858
|
+
turnDraggableOn: E
|
|
2855
2859
|
};
|
|
2856
2860
|
}
|
|
2857
2861
|
const Tn = ["t", "r", "b", "l", "tr", "br", "bl", "tl"];
|
|
@@ -2859,18 +2863,18 @@ function Cn(e, t = {}) {
|
|
|
2859
2863
|
let l, S = t.handleWidth ?? 12, s = t.handleZIndex ?? 100, g = t.minWidth ?? 0, x = t.maxWidth ?? Number.MAX_SAFE_INTEGER, P = t.minHeight ?? 0, T = t.maxHeight ?? Number.MAX_SAFE_INTEGER, N = t.preventDefault ?? !1, $ = t.stopPropagation ?? !1, d, h = [];
|
|
2860
2864
|
const u = z(!1);
|
|
2861
2865
|
let r = [], y = [];
|
|
2862
|
-
const
|
|
2863
|
-
let
|
|
2866
|
+
const I = z(!1), c = z({ x: 0, y: 0 });
|
|
2867
|
+
let E = { left: 0, top: 0, height: 0, width: 0, position: "absolute" }, w = {};
|
|
2864
2868
|
function M(W) {
|
|
2865
2869
|
Ae(N) && W.preventDefault(), Ae($) && W.stopPropagation();
|
|
2866
2870
|
}
|
|
2867
2871
|
function b(W, Y) {
|
|
2868
|
-
h = Y.map(
|
|
2872
|
+
h = Y.map(D), h.forEach((V) => W.$el.appendChild(V));
|
|
2869
2873
|
}
|
|
2870
2874
|
function _(W) {
|
|
2871
2875
|
h.forEach((Y) => W.$el.removeChild(Y));
|
|
2872
2876
|
}
|
|
2873
|
-
function
|
|
2877
|
+
function D(W) {
|
|
2874
2878
|
const Y = S + "px", V = -S / 2 + "px", ae = s + 1, G = document.createElement("div");
|
|
2875
2879
|
return G.dataset.handle = W, G.style.position = "absolute", G.style.touchAction = "none", G.style.userSelect = "none", G.style.zIndex = (W.length === 1 ? s : ae).toString(), G.style.cursor = J(W), W.includes("t") && (G.style.top = V, G.style.height = Y, W === "t" && (G.style.left = "0", G.style.width = "100%")), W.includes("b") && (G.style.bottom = V, G.style.height = Y, W === "b" && (G.style.left = "0", G.style.width = "100%")), W.includes("r") && (G.style.right = V, G.style.width = Y, W === "r" && (G.style.top = "0", G.style.height = "100%")), W.includes("l") && (G.style.left = V, G.style.width = Y, W === "l" && (G.style.top = "0", G.style.height = "100%")), G;
|
|
2876
2880
|
}
|
|
@@ -2882,12 +2886,12 @@ function Cn(e, t = {}) {
|
|
|
2882
2886
|
if (!Y)
|
|
2883
2887
|
return;
|
|
2884
2888
|
const V = Y.$el, G = W.type === "touchstart" && W.touches.length > 0 ? W.touches[0] : W;
|
|
2885
|
-
if (c.value.x = G.clientX, c.value.y = G.clientY,
|
|
2889
|
+
if (c.value.x = G.clientX, c.value.y = G.clientY, E = {
|
|
2886
2890
|
left: V.offsetLeft,
|
|
2887
2891
|
top: V.offsetTop,
|
|
2888
2892
|
height: parseInt(window.getComputedStyle(V).getPropertyValue("height")),
|
|
2889
2893
|
width: parseInt(window.getComputedStyle(V).getPropertyValue("width"))
|
|
2890
|
-
}, w = Lr(
|
|
2894
|
+
}, w = Lr(E), ((ne = t.onStart) == null ? void 0 : ne.call(t, c.value, W)) === !1)
|
|
2891
2895
|
return;
|
|
2892
2896
|
let X = W.target;
|
|
2893
2897
|
document.documentElement.style.cursor = J(X.dataset.handle), d = X.dataset.handle, y.push(he("mousemove", f)), y.push(he("mouseup", A)), y.push(he("touchmove", f)), y.push(he("touchend", A)), M(W);
|
|
@@ -2898,7 +2902,7 @@ function Cn(e, t = {}) {
|
|
|
2898
2902
|
return;
|
|
2899
2903
|
const V = Y.$el, G = W.type === "touchmove" && W.touches.length > 0 ? W.touches[0] : W;
|
|
2900
2904
|
let X = G.clientX - c.value.x, ne = G.clientY - c.value.y;
|
|
2901
|
-
const fe = Ae(
|
|
2905
|
+
const fe = Ae(E);
|
|
2902
2906
|
if (d.includes("t")) {
|
|
2903
2907
|
const ce = Math.min(T, Math.max(P, (fe.height ?? 0) - ne));
|
|
2904
2908
|
w.height = ce, w.top = (fe.top ?? 0) + ne;
|
|
@@ -2953,14 +2957,14 @@ function Cn(e, t = {}) {
|
|
|
2953
2957
|
V.style.width = "auto", V.style.top = "", V.style.left = "", V.style.position = "", V.style.transition = "", u.value = !1;
|
|
2954
2958
|
}, { once: !0 });
|
|
2955
2959
|
} else if ((l == "page" || Y.$el.style.position !== "absolute") && W !== "page") {
|
|
2956
|
-
V.style.transition = "width 0.5s, height 0.5s, top 0.5s, left 0.5s", u.value = !0,
|
|
2960
|
+
V.style.transition = "width 0.5s, height 0.5s, top 0.5s, left 0.5s", u.value = !0, E = {
|
|
2957
2961
|
height: parseInt(window.getComputedStyle(V).getPropertyValue("height")),
|
|
2958
2962
|
width: parseInt(window.getComputedStyle(V).getPropertyValue("width")),
|
|
2959
2963
|
top: V.offsetTop,
|
|
2960
2964
|
left: V.offsetLeft,
|
|
2961
2965
|
position: "absolute"
|
|
2962
|
-
}, ee(
|
|
2963
|
-
const ae =
|
|
2966
|
+
}, ee(E), V.offsetHeight;
|
|
2967
|
+
const ae = E;
|
|
2964
2968
|
W == "freestyle" ? w = {
|
|
2965
2969
|
height: ae.height,
|
|
2966
2970
|
width: (ae.width ?? 100) / 2,
|
|
@@ -2986,21 +2990,21 @@ function Cn(e, t = {}) {
|
|
|
2986
2990
|
W.top ? V.style.top = `${W.top}px` : V.style.top = void 0, W.left ? V.style.left = `${W.left}px` : V.style.left = void 0, W.height ? V.style.height = `${W.height}px` : V.style.height = void 0, W.width ? V.style.width = `${W.width}px` : V.style.width = void 0, W.position ? V.style.position = `${W.position}` : V.style.position = void 0, console.log(V.style.position);
|
|
2987
2991
|
}
|
|
2988
2992
|
function ie(W, Y) {
|
|
2989
|
-
if (
|
|
2993
|
+
if (I.value)
|
|
2990
2994
|
return;
|
|
2991
2995
|
const V = Ae(e);
|
|
2992
|
-
V && (b(V, W ?? Tn), Q(Y), r.push(he(V.$el, "mousedown", L)), r.push(he(V.$el, "touchstart", L)),
|
|
2996
|
+
V && (b(V, W ?? Tn), Q(Y), r.push(he(V.$el, "mousedown", L)), r.push(he(V.$el, "touchstart", L)), I.value = !0, l = Y);
|
|
2993
2997
|
}
|
|
2994
2998
|
function we(W) {
|
|
2995
|
-
if (!
|
|
2999
|
+
if (!I.value)
|
|
2996
3000
|
return;
|
|
2997
3001
|
const Y = Ae(e);
|
|
2998
3002
|
Y && (_(Y), Q(W), r.forEach((V) => {
|
|
2999
3003
|
V();
|
|
3000
|
-
}), r.length = 0,
|
|
3004
|
+
}), r.length = 0, I.value = !1);
|
|
3001
3005
|
}
|
|
3002
3006
|
return {
|
|
3003
|
-
resizingIsOn:
|
|
3007
|
+
resizingIsOn: I,
|
|
3004
3008
|
turnResizingOn: ie,
|
|
3005
3009
|
turnResizingOff: we
|
|
3006
3010
|
};
|
|
@@ -3136,29 +3140,29 @@ function Mn() {
|
|
|
3136
3140
|
if (!Te(l))
|
|
3137
3141
|
return;
|
|
3138
3142
|
let x = [];
|
|
3139
|
-
S != null ? x = S == null ? void 0 : S.filter((
|
|
3140
|
-
header:
|
|
3141
|
-
itemText:
|
|
3142
|
-
value:
|
|
3143
|
-
})) : x = Object.keys(l[0]).map((
|
|
3143
|
+
S != null ? x = S == null ? void 0 : S.filter((I) => (I.csv ?? I.csvText ?? I.csvFilter ?? I.csvArray) != null).map((I) => ({
|
|
3144
|
+
header: I.title ?? I.value ?? "",
|
|
3145
|
+
itemText: I.itemText,
|
|
3146
|
+
value: I.value
|
|
3147
|
+
})) : x = Object.keys(l[0]).map((I) => ({ header: nn(I) ?? "", value: I })), x = x.filter((I) => I.header.length > 0);
|
|
3144
3148
|
var P = [];
|
|
3145
|
-
for (let
|
|
3146
|
-
const c = l[
|
|
3149
|
+
for (let I = 0; I < l.length; I++) {
|
|
3150
|
+
const c = l[I];
|
|
3147
3151
|
var T = {}, N = [];
|
|
3148
|
-
for (let
|
|
3149
|
-
const w = x[
|
|
3152
|
+
for (let E = 0; E < x.length; E++) {
|
|
3153
|
+
const w = x[E];
|
|
3150
3154
|
var $ = null;
|
|
3151
3155
|
typeof w.value == "function" ? $ = w.value(c) : typeof w.value == "string" && ($ = Sr(c, w.value)), w.itemText != null ? T[w.header] = Sr($, w.itemText) : T[w.header] = $;
|
|
3152
3156
|
}
|
|
3153
|
-
P.push(T), Te(N) && N.forEach((
|
|
3154
|
-
P.push(
|
|
3157
|
+
P.push(T), Te(N) && N.forEach((E) => {
|
|
3158
|
+
P.push(E);
|
|
3155
3159
|
}), N = [];
|
|
3156
3160
|
}
|
|
3157
3161
|
var d = [];
|
|
3158
|
-
if (d.push(x.map((
|
|
3162
|
+
if (d.push(x.map((I) => I.header).toString()), P.forEach((I) => {
|
|
3159
3163
|
let c = [];
|
|
3160
|
-
x.forEach(function(
|
|
3161
|
-
var w =
|
|
3164
|
+
x.forEach(function(E) {
|
|
3165
|
+
var w = I[E.header];
|
|
3162
3166
|
c.push(w ?? "");
|
|
3163
3167
|
}), d.push(c.join(","));
|
|
3164
3168
|
}), g == "array")
|
|
@@ -3249,7 +3253,7 @@ function Rn(e) {
|
|
|
3249
3253
|
return Promise.resolve("no demo data available for this api");
|
|
3250
3254
|
const h = d.id ?? ((r = d.data) == null ? void 0 : r.id), u = g(d);
|
|
3251
3255
|
if (h != null && (u == null ? void 0 : u.data) != null) {
|
|
3252
|
-
const y = u.data.findIndex((
|
|
3256
|
+
const y = u.data.findIndex((I) => I.id == h);
|
|
3253
3257
|
y >= 0 && u.data.splice(y, 1);
|
|
3254
3258
|
}
|
|
3255
3259
|
return new Promise(function(y) {
|
|
@@ -3259,14 +3263,14 @@ function Rn(e) {
|
|
|
3259
3263
|
});
|
|
3260
3264
|
}
|
|
3261
3265
|
function P(d) {
|
|
3262
|
-
var y,
|
|
3266
|
+
var y, I, c;
|
|
3263
3267
|
if (l == null)
|
|
3264
3268
|
throw new Error("no demo data available for this api");
|
|
3265
3269
|
const h = d.id ?? ((y = d.data) == null ? void 0 : y.id), u = g(d);
|
|
3266
3270
|
let r;
|
|
3267
|
-
return u != null && (u.data ?? (u.data = []), u.getAction != null ? r = u.getAction(u.data, h) : h != null ? r = (
|
|
3271
|
+
return u != null && (u.data ?? (u.data = []), u.getAction != null ? r = u.getAction(u.data, h) : h != null ? r = (I = u.data) == null ? void 0 : I.find((E) => E.id == h) : u.path != null && ((c = u.data) == null ? void 0 : c.length) == 1 && (r = u.data[0])), r == null ? Promise.resolve(void 0) : new Promise((E) => {
|
|
3268
3272
|
setTimeout(() => {
|
|
3269
|
-
|
|
3273
|
+
E({
|
|
3270
3274
|
data: r
|
|
3271
3275
|
});
|
|
3272
3276
|
});
|
|
@@ -3293,9 +3297,9 @@ function Rn(e) {
|
|
|
3293
3297
|
throw new Error("no demo data available for this api");
|
|
3294
3298
|
const h = g(d);
|
|
3295
3299
|
let u;
|
|
3296
|
-
return h != null && (h.data ?? (h.data = []), h.postAction != null ? u = h.postAction(h.data, d.data) : d.data != null && (d.data.id == null && (d.data.id = ((((r = h.data) == null ? void 0 : r.length) ?? 0) + 1).toString()), u = d.data, (y = h.data) == null || y.push(u))), u == null ? Promise.resolve(void 0) : new Promise((
|
|
3300
|
+
return h != null && (h.data ?? (h.data = []), h.postAction != null ? u = h.postAction(h.data, d.data) : d.data != null && (d.data.id == null && (d.data.id = ((((r = h.data) == null ? void 0 : r.length) ?? 0) + 1).toString()), u = d.data, (y = h.data) == null || y.push(u))), u == null ? Promise.resolve(void 0) : new Promise((I) => {
|
|
3297
3301
|
setTimeout(() => {
|
|
3298
|
-
|
|
3302
|
+
I({
|
|
3299
3303
|
data: u
|
|
3300
3304
|
});
|
|
3301
3305
|
});
|
|
@@ -3311,13 +3315,13 @@ function Rn(e) {
|
|
|
3311
3315
|
if (h.data ?? (h.data = []), h.patchAction != null)
|
|
3312
3316
|
u = h.patchAction(h.data, d.data);
|
|
3313
3317
|
else if (d.data.id != null) {
|
|
3314
|
-
const
|
|
3315
|
-
|
|
3318
|
+
const I = (r = h.data) == null ? void 0 : r.findIndex((c) => c.id == d.data.id);
|
|
3319
|
+
I != null && I > -1 && ((y = h.data) == null || y.splice(I, 1, d.data)), u = d.data;
|
|
3316
3320
|
}
|
|
3317
3321
|
}
|
|
3318
|
-
return u == null ? Promise.resolve(void 0) : new Promise((
|
|
3322
|
+
return u == null ? Promise.resolve(void 0) : new Promise((I) => {
|
|
3319
3323
|
setTimeout(() => {
|
|
3320
|
-
|
|
3324
|
+
I({
|
|
3321
3325
|
data: u
|
|
3322
3326
|
});
|
|
3323
3327
|
});
|
|
@@ -3336,7 +3340,7 @@ function Rn(e) {
|
|
|
3336
3340
|
}, _r;
|
|
3337
3341
|
}
|
|
3338
3342
|
var Un = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
|
|
3339
|
-
function
|
|
3343
|
+
function Ea(e) {
|
|
3340
3344
|
function t(l) {
|
|
3341
3345
|
var s;
|
|
3342
3346
|
const S = l.matched.slice().reverse().find((g) => g.meta && g.meta.title);
|
|
@@ -3353,7 +3357,7 @@ function Ia(e) {
|
|
|
3353
3357
|
};
|
|
3354
3358
|
}
|
|
3355
3359
|
let Tr;
|
|
3356
|
-
function
|
|
3360
|
+
function Ia() {
|
|
3357
3361
|
return Tr;
|
|
3358
3362
|
}
|
|
3359
3363
|
function Bn(e) {
|
|
@@ -3422,7 +3426,7 @@ function Bn(e) {
|
|
|
3422
3426
|
function y(f, A) {
|
|
3423
3427
|
return t(f, "ddd DD MMM YYYY", A);
|
|
3424
3428
|
}
|
|
3425
|
-
function
|
|
3429
|
+
function I(f, A) {
|
|
3426
3430
|
return t(f, "ccc dd LLL yyyy hh:mm a", A);
|
|
3427
3431
|
}
|
|
3428
3432
|
function c(f) {
|
|
@@ -3432,7 +3436,7 @@ function Bn(e) {
|
|
|
3432
3436
|
});
|
|
3433
3437
|
return A.format(f);
|
|
3434
3438
|
}
|
|
3435
|
-
function
|
|
3439
|
+
function E(f) {
|
|
3436
3440
|
return f.replaceAll(",", " ");
|
|
3437
3441
|
}
|
|
3438
3442
|
function w(f, A) {
|
|
@@ -3447,7 +3451,7 @@ function Bn(e) {
|
|
|
3447
3451
|
function _(f) {
|
|
3448
3452
|
return f == null ? "" : typeof f == "number" ? e.dates.tzDate().startOf("day").plus({ minutes: f }).toFormat("T") : typeof f == "string" ? e.dates.tzString(f, "t") : "unknown";
|
|
3449
3453
|
}
|
|
3450
|
-
const
|
|
3454
|
+
const D = {
|
|
3451
3455
|
toCompanyNameAndLocationLine: l,
|
|
3452
3456
|
toCurrency: S,
|
|
3453
3457
|
toDayDate: s,
|
|
@@ -3462,9 +3466,9 @@ function Bn(e) {
|
|
|
3462
3466
|
toLocationLine: u,
|
|
3463
3467
|
toLocationLineNoCommas: r,
|
|
3464
3468
|
toLongDate: y,
|
|
3465
|
-
toLongDateAndTime:
|
|
3469
|
+
toLongDateAndTime: I,
|
|
3466
3470
|
toPercent: c,
|
|
3467
|
-
toPrettyCSV:
|
|
3471
|
+
toPrettyCSV: E,
|
|
3468
3472
|
toShortDate: w,
|
|
3469
3473
|
toShortDateAndTime: M,
|
|
3470
3474
|
toTime: b,
|
|
@@ -3473,14 +3477,14 @@ function Bn(e) {
|
|
|
3473
3477
|
function L(f) {
|
|
3474
3478
|
if (f != null) {
|
|
3475
3479
|
let A = f;
|
|
3476
|
-
if (A != null &&
|
|
3477
|
-
return
|
|
3480
|
+
if (A != null && D[A] != null)
|
|
3481
|
+
return D[A];
|
|
3478
3482
|
}
|
|
3479
3483
|
return (A) => A;
|
|
3480
3484
|
}
|
|
3481
3485
|
return Tr = {
|
|
3482
3486
|
findFilter: L,
|
|
3483
|
-
...
|
|
3487
|
+
...D
|
|
3484
3488
|
}, Tr;
|
|
3485
3489
|
}
|
|
3486
3490
|
function $n(e, t) {
|
|
@@ -3514,15 +3518,16 @@ function Da(e, t) {
|
|
|
3514
3518
|
} = t ?? {}, S = e.storeMode ?? (t == null ? void 0 : t.storeMode), s = e.storageMode ?? (t == null ? void 0 : t.storageMode), g = e.nav ?? e.bladeName ?? "basic", x = Mr(), P = rt(), T = K(e.proxyQueryKey), N = te(() => {
|
|
3515
3519
|
var G;
|
|
3516
3520
|
return K(e.proxyID) ?? (T != null ? (G = P == null ? void 0 : P.query) == null ? void 0 : G[T] : void 0);
|
|
3517
|
-
}), $ = z(void 0), { actionErrorMsg: d, actionLoadingMsg: h, deleteItem: u, getItem: r, getAllItems: y, restoreItem:
|
|
3521
|
+
}), $ = z(void 0), { actionErrorMsg: d, actionLoadingMsg: h, deleteItem: u, getItem: r, getAllItems: y, restoreItem: I, saveItem: c } = it({
|
|
3518
3522
|
nav: g,
|
|
3523
|
+
onError: e.onError ?? (t == null ? void 0 : t.onError),
|
|
3519
3524
|
proxyID: N.value,
|
|
3520
3525
|
store: Le({
|
|
3521
3526
|
storeMode: S,
|
|
3522
3527
|
storageMode: s,
|
|
3523
3528
|
nav: g
|
|
3524
3529
|
})
|
|
3525
|
-
}),
|
|
3530
|
+
}), E = te(() => e.errorMsg ?? d.value), w = te(() => e.loadingMsg ?? h.value), M = te(() => w.value != null), b = z(e.itemID ?? (l ? (ae = P == null ? void 0 : P.params) == null ? void 0 : ae.id : void 0)), _ = z(b.value == "new" ? "new" : e.startEditing ? "edit" : "view"), D = Re(!1), L = te(() => {
|
|
3526
3531
|
if (_.value == "new")
|
|
3527
3532
|
return !1;
|
|
3528
3533
|
const G = K($);
|
|
@@ -3571,7 +3576,7 @@ function Da(e, t) {
|
|
|
3571
3576
|
onRestoreSuccessAsync: fe,
|
|
3572
3577
|
proxyID: ce
|
|
3573
3578
|
} = { ...e };
|
|
3574
|
-
|
|
3579
|
+
I({
|
|
3575
3580
|
additionalUrl: X,
|
|
3576
3581
|
data: G,
|
|
3577
3582
|
nav: g,
|
|
@@ -3583,7 +3588,7 @@ function Da(e, t) {
|
|
|
3583
3588
|
});
|
|
3584
3589
|
}
|
|
3585
3590
|
async function W(G) {
|
|
3586
|
-
if (
|
|
3591
|
+
if (D.value = !1, e.item != null)
|
|
3587
3592
|
$.value = e.item;
|
|
3588
3593
|
else {
|
|
3589
3594
|
const X = {
|
|
@@ -3611,7 +3616,7 @@ function Da(e, t) {
|
|
|
3611
3616
|
additionalUrl: ne,
|
|
3612
3617
|
onCanSaveAsync: fe,
|
|
3613
3618
|
onGetSaveAsync: ce,
|
|
3614
|
-
onSaveAsync:
|
|
3619
|
+
onSaveAsync: Ee,
|
|
3615
3620
|
onSaveSuccessAsync: $e = (Ce) => ((X == null ? void 0 : X.navBack) === !0 ? x.back() : (G.rowVersion != null && Ce.rowVersion != null && (G.rowVersion = Ce.rowVersion), ee(), _.value = "view"), Promise.resolve(void 0))
|
|
3616
3621
|
} = { ...e };
|
|
3617
3622
|
c({
|
|
@@ -3620,7 +3625,7 @@ function Da(e, t) {
|
|
|
3620
3625
|
nav: g,
|
|
3621
3626
|
onCanSaveAsync: fe,
|
|
3622
3627
|
onGetSaveAsync: ce,
|
|
3623
|
-
onSaveAsync:
|
|
3628
|
+
onSaveAsync: Ee,
|
|
3624
3629
|
onSaveSuccessAsync: $e,
|
|
3625
3630
|
proxyID: N.value,
|
|
3626
3631
|
// ...params.getOptions(),
|
|
@@ -3632,8 +3637,8 @@ function Da(e, t) {
|
|
|
3632
3637
|
const G = K(_);
|
|
3633
3638
|
!G || G == "view" ? _.value = "edit" : G == "edit" && (_.value = "view");
|
|
3634
3639
|
}
|
|
3635
|
-
return _e(
|
|
3636
|
-
|
|
3640
|
+
return _e(E, (G) => {
|
|
3641
|
+
D.value = G != null;
|
|
3637
3642
|
}), _e(() => e.refreshToggle, () => {
|
|
3638
3643
|
W({ deepRefresh: !0 });
|
|
3639
3644
|
}), Or(async () => {
|
|
@@ -3642,7 +3647,7 @@ function Da(e, t) {
|
|
|
3642
3647
|
}), {
|
|
3643
3648
|
asyncItem: $,
|
|
3644
3649
|
deleteItem: ie,
|
|
3645
|
-
errorMsg:
|
|
3650
|
+
errorMsg: E,
|
|
3646
3651
|
isChanged: Q,
|
|
3647
3652
|
isDeletable: L,
|
|
3648
3653
|
isEditing: te(() => _.value == "new" || _.value == "edit"),
|
|
@@ -3656,7 +3661,7 @@ function Da(e, t) {
|
|
|
3656
3661
|
refresh: W,
|
|
3657
3662
|
restoreItem: we,
|
|
3658
3663
|
saveItem: Y,
|
|
3659
|
-
showError:
|
|
3664
|
+
showError: D,
|
|
3660
3665
|
toggleMode: V
|
|
3661
3666
|
};
|
|
3662
3667
|
}
|
|
@@ -3696,7 +3701,7 @@ function Fn(e) {
|
|
|
3696
3701
|
function P(h) {
|
|
3697
3702
|
return h == null ? null : typeof h != "string" ? h : nt(l, (r) => r.children).find((r) => {
|
|
3698
3703
|
var y;
|
|
3699
|
-
return r.name == h || r.singleName == h || ((y = r.aliases) == null ? void 0 : y.some((
|
|
3704
|
+
return r.name == h || r.singleName == h || ((y = r.aliases) == null ? void 0 : y.some((I) => I == h));
|
|
3700
3705
|
}) ?? null;
|
|
3701
3706
|
}
|
|
3702
3707
|
function T(h) {
|
|
@@ -3749,9 +3754,9 @@ function xa(e, t, l) {
|
|
|
3749
3754
|
...u.filter((U) => U.name != null).map((U) => U.name),
|
|
3750
3755
|
...e.defaultFilters ?? [],
|
|
3751
3756
|
...r.value
|
|
3752
|
-
]).value),
|
|
3753
|
-
let c = z([...
|
|
3754
|
-
const
|
|
3757
|
+
]).value), I = z((e.defaultFilters ?? []).map((U) => y.value.indexOf(U)));
|
|
3758
|
+
let c = z([...I.value]);
|
|
3759
|
+
const E = te(() => Wr(c, I).value.length > 0 || Wr(I, c).value.length > 0), w = z(M());
|
|
3755
3760
|
function M() {
|
|
3756
3761
|
var U, j;
|
|
3757
3762
|
if (T) {
|
|
@@ -3779,8 +3784,8 @@ function xa(e, t, l) {
|
|
|
3779
3784
|
return H;
|
|
3780
3785
|
}
|
|
3781
3786
|
return e.proxyID;
|
|
3782
|
-
}), _ = z(
|
|
3783
|
-
function
|
|
3787
|
+
}), _ = z(D());
|
|
3788
|
+
function D() {
|
|
3784
3789
|
var U, j;
|
|
3785
3790
|
if (T) {
|
|
3786
3791
|
const H = (U = P.value) == null ? void 0 : U.search;
|
|
@@ -3800,15 +3805,16 @@ function xa(e, t, l) {
|
|
|
3800
3805
|
let ee;
|
|
3801
3806
|
const { actionErrorMsg: ie, actionLoadingMsg: we, deleteItem: W, doAction: Y, getItem: V, getAllItems: ae, restoreItem: G } = it({
|
|
3802
3807
|
nav: $,
|
|
3808
|
+
onError: e.onError ?? (l == null ? void 0 : l.onError),
|
|
3803
3809
|
proxyID: b.value,
|
|
3804
3810
|
store: Le({
|
|
3805
3811
|
storeMode: d,
|
|
3806
3812
|
storageMode: h,
|
|
3807
3813
|
nav: $
|
|
3808
3814
|
})
|
|
3809
|
-
}), X = te(() => e.errorMsg ?? ie.value), ne = te(() => e.loadingMsg ?? we.value), fe = te(() => ne.value != null), ce = Re(!1),
|
|
3815
|
+
}), X = te(() => e.errorMsg ?? ie.value), ne = te(() => e.loadingMsg ?? we.value), fe = te(() => ne.value != null), ce = Re(!1), Ee = Re(e.showSearch ?? !0), $e = z(0), Ce = te(() => {
|
|
3810
3816
|
let U, j = [];
|
|
3811
|
-
|
|
3817
|
+
I.value.forEach((O) => {
|
|
3812
3818
|
const oe = y.value[O], ve = u.find((De) => De.name == oe);
|
|
3813
3819
|
ve != null ? U = U != null ? `${U}ANDALSO${ve.filterFunction()}` : ve.filterFunction() : j.push(oe);
|
|
3814
3820
|
});
|
|
@@ -3904,8 +3910,8 @@ function xa(e, t, l) {
|
|
|
3904
3910
|
const U = (l == null ? void 0 : l.hideActions) ?? e.hideActions;
|
|
3905
3911
|
e.headers != null && (Q.value = [...e.headers], U || Q.value.push({ title: "Actions", value: "itemActions", align: "end" }));
|
|
3906
3912
|
}
|
|
3907
|
-
async function
|
|
3908
|
-
if (ce.value = !1, (U == null ? void 0 : U.resetSearch) === !0 && (
|
|
3913
|
+
async function Ie(U) {
|
|
3914
|
+
if (ce.value = !1, (U == null ? void 0 : U.resetSearch) === !0 && (Ee.value = e.showSearch ?? !1, _.value = void 0), e.items != null) {
|
|
3909
3915
|
A.value = e.onGetSuccessAsync != null ? await e.onGetSuccessAsync(e.items) : e.items;
|
|
3910
3916
|
return;
|
|
3911
3917
|
}
|
|
@@ -3955,21 +3961,21 @@ function xa(e, t, l) {
|
|
|
3955
3961
|
}
|
|
3956
3962
|
}
|
|
3957
3963
|
function je() {
|
|
3958
|
-
|
|
3964
|
+
Ee.value ? (Ee.value = e.showSearch ?? !1, _.value = void 0, Ie()) : Ee.value = e.showSearch ?? !0;
|
|
3959
3965
|
}
|
|
3960
3966
|
return We(), Xt([_], () => {
|
|
3961
3967
|
Ne();
|
|
3962
3968
|
}, { debounce: 500, maxWait: 500 }), _e([L, w], async () => {
|
|
3963
|
-
await
|
|
3969
|
+
await Ie();
|
|
3964
3970
|
}), _e([X, () => e.errorMsg], ([U, j]) => {
|
|
3965
3971
|
ce.value = U != null || j != null;
|
|
3966
3972
|
}), _e(() => e.refreshToggle, () => {
|
|
3967
|
-
|
|
3973
|
+
Ie({ deepRefresh: !0 });
|
|
3968
3974
|
}), pr([A, () => e.items], () => {
|
|
3969
3975
|
Ne();
|
|
3970
3976
|
}), Or(async () => {
|
|
3971
3977
|
var U;
|
|
3972
|
-
e.eager == !0 && await
|
|
3978
|
+
e.eager == !0 && await Ie({ deepRefresh: ((U = x == null ? void 0 : x.params) == null ? void 0 : U.refresh) == "true" });
|
|
3973
3979
|
}), {
|
|
3974
3980
|
add: be,
|
|
3975
3981
|
asyncItems: A,
|
|
@@ -3980,21 +3986,21 @@ function xa(e, t, l) {
|
|
|
3980
3986
|
exportToCSV: Fe,
|
|
3981
3987
|
filteredItems: J,
|
|
3982
3988
|
filters: y,
|
|
3983
|
-
filtersChanged:
|
|
3989
|
+
filtersChanged: E,
|
|
3984
3990
|
headerOptions: Q,
|
|
3985
3991
|
isDeletable: tr,
|
|
3986
3992
|
isLoading: fe,
|
|
3987
3993
|
isRestorable: nr,
|
|
3988
3994
|
loadingMsg: ne,
|
|
3989
|
-
refresh:
|
|
3995
|
+
refresh: Ie,
|
|
3990
3996
|
restoreItem: Ze,
|
|
3991
3997
|
searchString: _,
|
|
3992
|
-
selectedFilters:
|
|
3998
|
+
selectedFilters: I,
|
|
3993
3999
|
selectItem: Je,
|
|
3994
4000
|
// serverFilters,
|
|
3995
4001
|
showError: ce,
|
|
3996
4002
|
showInactive: L,
|
|
3997
|
-
showSearch:
|
|
4003
|
+
showSearch: Ee,
|
|
3998
4004
|
subtitleOptions: ar,
|
|
3999
4005
|
tableHeaders: Pe,
|
|
4000
4006
|
titleOptions: lr,
|
|
@@ -4109,7 +4115,7 @@ function Na(e) {
|
|
|
4109
4115
|
Gn(e), (T = e.auth).demo ?? (T.demo = S), e.auth.getAuthItem = s.findItem;
|
|
4110
4116
|
const g = xn(e.auth);
|
|
4111
4117
|
kn(e.menu);
|
|
4112
|
-
const x =
|
|
4118
|
+
const x = In({
|
|
4113
4119
|
auth: g,
|
|
4114
4120
|
findPath: s.findPath,
|
|
4115
4121
|
useBearerToken: !0
|
|
@@ -4136,7 +4142,7 @@ export {
|
|
|
4136
4142
|
aa as containsWeekday,
|
|
4137
4143
|
Lr as copyDeep,
|
|
4138
4144
|
fn as copyItemByAlphabet,
|
|
4139
|
-
|
|
4145
|
+
In as createApi,
|
|
4140
4146
|
xn as createAuth,
|
|
4141
4147
|
Na as createCore,
|
|
4142
4148
|
Nn as createCosmetics,
|
|
@@ -4147,7 +4153,7 @@ export {
|
|
|
4147
4153
|
Fn as createNavigation,
|
|
4148
4154
|
Wn as createPWA,
|
|
4149
4155
|
Gn as createPresets,
|
|
4150
|
-
|
|
4156
|
+
En as createSessionStoreDefinition,
|
|
4151
4157
|
bn as createStoreBuilder,
|
|
4152
4158
|
wn as createUrl,
|
|
4153
4159
|
Vr as createWholeLastUpdateStoreDefinition,
|
|
@@ -4181,7 +4187,7 @@ export {
|
|
|
4181
4187
|
ha as twiddleThumbs,
|
|
4182
4188
|
it as useActions,
|
|
4183
4189
|
rn as useActionsTracker,
|
|
4184
|
-
|
|
4190
|
+
Er as useApi,
|
|
4185
4191
|
Dn as useAuth,
|
|
4186
4192
|
qr as useAuthUrl,
|
|
4187
4193
|
Pn as useBlade,
|
|
@@ -4191,9 +4197,9 @@ export {
|
|
|
4191
4197
|
Sa as useDates,
|
|
4192
4198
|
ut as useDbName,
|
|
4193
4199
|
Aa as useDemo,
|
|
4194
|
-
|
|
4200
|
+
Ea as useDocumentMeta,
|
|
4195
4201
|
_n as useDraggable,
|
|
4196
|
-
|
|
4202
|
+
Ia as useFilters,
|
|
4197
4203
|
pt as useId,
|
|
4198
4204
|
Da as useItem,
|
|
4199
4205
|
xa as useList,
|