buzzcasting-storage 2.10.2 → 2.10.3
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/buzzcasting-storage.esm.js +765 -756
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var Ei = Object.defineProperty;
|
|
2
|
-
var Oi = (v, o,
|
|
3
|
-
var
|
|
4
|
-
const xi = "2.10.
|
|
2
|
+
var Oi = (v, o, l) => o in v ? Ei(v, o, { enumerable: !0, configurable: !0, writable: !0, value: l }) : v[o] = l;
|
|
3
|
+
var I = (v, o, l) => (Oi(v, typeof o != "symbol" ? o + "" : o, l), l);
|
|
4
|
+
const xi = "2.10.2";
|
|
5
5
|
class ki {
|
|
6
6
|
constructor(o) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
I(this, "options");
|
|
8
|
+
I(this, "url");
|
|
9
|
+
I(this, "headers", () => {
|
|
10
10
|
const o = `Bearer ${this.options.bearer}`;
|
|
11
11
|
return {
|
|
12
12
|
headers: new Headers({
|
|
@@ -19,9 +19,9 @@ class ki {
|
|
|
19
19
|
this.options = o, this.url = `https://${o.app}.buzzcasting.net`;
|
|
20
20
|
}
|
|
21
21
|
async get(o) {
|
|
22
|
-
const { version:
|
|
23
|
-
delete
|
|
24
|
-
const
|
|
22
|
+
const { version: l } = this.options, y = this.headers(), P = Object.assign({}, o);
|
|
23
|
+
delete P.slide, delete P.type, delete P.hash;
|
|
24
|
+
const M = Object.keys(P).length > 0 ? `?${new URLSearchParams(P).toString()}` : "";
|
|
25
25
|
return console.debug(
|
|
26
26
|
"%capi%c %cget",
|
|
27
27
|
x.API,
|
|
@@ -30,8 +30,8 @@ class ki {
|
|
|
30
30
|
o.slide,
|
|
31
31
|
o.widget
|
|
32
32
|
), await fetch(
|
|
33
|
-
[this.url, "api",
|
|
34
|
-
{ ...
|
|
33
|
+
[this.url, "api", l, o.type].join("/") + M,
|
|
34
|
+
{ ...y, method: "get" }
|
|
35
35
|
).then(async (j) => {
|
|
36
36
|
if (!j.ok)
|
|
37
37
|
throw new Error(`${j.status}`);
|
|
@@ -39,18 +39,18 @@ class ki {
|
|
|
39
39
|
}).then((j) => j.json()).then((j) => (j.query = o, j)).catch((j) => ({ success: !1, message: `${j}`, data: null }));
|
|
40
40
|
}
|
|
41
41
|
async hideMessage(o) {
|
|
42
|
-
const { app:
|
|
42
|
+
const { app: l, version: y } = this.options, P = this.headers(), M = "?action=visible";
|
|
43
43
|
return console.info(
|
|
44
44
|
"%capi%c %cpost",
|
|
45
45
|
x.API,
|
|
46
46
|
x.NONE,
|
|
47
47
|
x.GET_DATA,
|
|
48
48
|
ue.HIDE_MESSAGE,
|
|
49
|
-
[
|
|
50
|
-
{ ...
|
|
49
|
+
[l, "api", y, o.type, o.id].join("/") + M,
|
|
50
|
+
{ ...P, method: "put" }
|
|
51
51
|
), await fetch(
|
|
52
|
-
[
|
|
53
|
-
{ ...
|
|
52
|
+
[l, "api", y, o.type, o.id].join("/") + M,
|
|
53
|
+
{ ...P, method: "put" }
|
|
54
54
|
).then((j) => {
|
|
55
55
|
if (!j.ok)
|
|
56
56
|
throw new Error(j.statusText);
|
|
@@ -64,37 +64,37 @@ function Ai(v) {
|
|
|
64
64
|
}
|
|
65
65
|
var Rr = { exports: {} };
|
|
66
66
|
(function(v, o) {
|
|
67
|
-
(function(
|
|
68
|
-
v.exports =
|
|
67
|
+
(function(l, y) {
|
|
68
|
+
v.exports = y();
|
|
69
69
|
})(Ir, function() {
|
|
70
|
-
var
|
|
71
|
-
return (
|
|
70
|
+
var l = function(e, t) {
|
|
71
|
+
return (l = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) {
|
|
72
72
|
n.__proto__ = r;
|
|
73
73
|
} || function(n, r) {
|
|
74
74
|
for (var i in r)
|
|
75
75
|
Object.prototype.hasOwnProperty.call(r, i) && (n[i] = r[i]);
|
|
76
76
|
})(e, t);
|
|
77
|
-
},
|
|
78
|
-
return (
|
|
77
|
+
}, y = function() {
|
|
78
|
+
return (y = Object.assign || function(e) {
|
|
79
79
|
for (var t, n = 1, r = arguments.length; n < r; n++)
|
|
80
80
|
for (var i in t = arguments[n])
|
|
81
81
|
Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
82
82
|
return e;
|
|
83
83
|
}).apply(this, arguments);
|
|
84
84
|
};
|
|
85
|
-
function
|
|
85
|
+
function P(e, t, n) {
|
|
86
86
|
if (n || arguments.length === 2)
|
|
87
87
|
for (var r, i = 0, a = t.length; i < a; i++)
|
|
88
88
|
!r && i in t || ((r = r || Array.prototype.slice.call(t, 0, i))[i] = t[i]);
|
|
89
89
|
return e.concat(r || Array.prototype.slice.call(t));
|
|
90
90
|
}
|
|
91
|
-
var
|
|
91
|
+
var M = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Ir, j = Object.keys, N = Array.isArray;
|
|
92
92
|
function Z(e, t) {
|
|
93
93
|
return typeof t != "object" || j(t).forEach(function(n) {
|
|
94
94
|
e[n] = t[n];
|
|
95
95
|
}), e;
|
|
96
96
|
}
|
|
97
|
-
typeof Promise > "u" ||
|
|
97
|
+
typeof Promise > "u" || M.Promise || (M.Promise = Promise);
|
|
98
98
|
var te = Object.getPrototypeOf, be = {}.hasOwnProperty;
|
|
99
99
|
function ie(e, t) {
|
|
100
100
|
return be.call(e, t);
|
|
@@ -125,7 +125,7 @@ var Rr = { exports: {} };
|
|
|
125
125
|
throw new Error("Assertion Failed");
|
|
126
126
|
}
|
|
127
127
|
function Hn(e) {
|
|
128
|
-
|
|
128
|
+
M.setImmediate ? setImmediate(e) : setTimeout(e, 0);
|
|
129
129
|
}
|
|
130
130
|
function ve(e, t) {
|
|
131
131
|
if (typeof t == "string" && ie(e, t))
|
|
@@ -171,9 +171,9 @@ var Rr = { exports: {} };
|
|
|
171
171
|
return t + e + "Array";
|
|
172
172
|
});
|
|
173
173
|
}))).filter(function(e) {
|
|
174
|
-
return
|
|
174
|
+
return M[e];
|
|
175
175
|
}), Xn = new Set(ge.map(function(e) {
|
|
176
|
-
return
|
|
176
|
+
return M[e];
|
|
177
177
|
})), it = null;
|
|
178
178
|
function Ae(e) {
|
|
179
179
|
return it = /* @__PURE__ */ new WeakMap(), e = function t(n) {
|
|
@@ -348,12 +348,12 @@ var Rr = { exports: {} };
|
|
|
348
348
|
return [t, te(t), e];
|
|
349
349
|
}(), st = ge[0], de = ge[1], ge = ge[2], de = de && de.then, ut = st && st.constructor, nn = !!ge, ct = function(e, t) {
|
|
350
350
|
lt.push([e, t]), Et && (queueMicrotask(qr), Et = !1);
|
|
351
|
-
}, rn = !0, Et = !0, Be = [], Ot = [], on = ot, De = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: H, pgp: !1, env: {}, finalize: H },
|
|
351
|
+
}, rn = !0, Et = !0, Be = [], Ot = [], on = ot, De = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: H, pgp: !1, env: {}, finalize: H }, B = De, lt = [], Ne = 0, xt = [];
|
|
352
352
|
function T(e) {
|
|
353
353
|
if (typeof this != "object")
|
|
354
354
|
throw new TypeError("Promises must be constructed via new");
|
|
355
355
|
this._listeners = [], this._lib = !1;
|
|
356
|
-
var t = this._PSD =
|
|
356
|
+
var t = this._PSD = B;
|
|
357
357
|
if (typeof e != "function") {
|
|
358
358
|
if (e !== at)
|
|
359
359
|
throw new TypeError("Not a function");
|
|
@@ -377,10 +377,10 @@ var Rr = { exports: {} };
|
|
|
377
377
|
}(this, e);
|
|
378
378
|
}
|
|
379
379
|
var an = { get: function() {
|
|
380
|
-
var e =
|
|
380
|
+
var e = B, t = Pt;
|
|
381
381
|
function n(r, i) {
|
|
382
|
-
var a = this, s = !e.global && (e !==
|
|
383
|
-
un(a, new tr(ir(r, e, s, u), ir(i, e, s, u),
|
|
382
|
+
var a = this, s = !e.global && (e !== B || t !== Pt), u = s && !Ie(), h = new T(function(f, b) {
|
|
383
|
+
un(a, new tr(ir(r, e, s, u), ir(i, e, s, u), f, b, e));
|
|
384
384
|
});
|
|
385
385
|
return this._consoleTask && (h._consoleTask = this._consoleTask), h;
|
|
386
386
|
}
|
|
@@ -466,9 +466,9 @@ var Rr = { exports: {} };
|
|
|
466
466
|
return new T(at, !1, e);
|
|
467
467
|
}
|
|
468
468
|
function J(e, t) {
|
|
469
|
-
var n =
|
|
469
|
+
var n = B;
|
|
470
470
|
return function() {
|
|
471
|
-
var r = Ve(), i =
|
|
471
|
+
var r = Ve(), i = B;
|
|
472
472
|
try {
|
|
473
473
|
return Ce(n, !0), e.apply(this, arguments);
|
|
474
474
|
} catch (a) {
|
|
@@ -479,7 +479,7 @@ var Rr = { exports: {} };
|
|
|
479
479
|
};
|
|
480
480
|
}
|
|
481
481
|
xe(T.prototype, { then: an, _then: function(e, t) {
|
|
482
|
-
un(this, new tr(null, null, e, t,
|
|
482
|
+
un(this, new tr(null, null, e, t, B));
|
|
483
483
|
}, catch: function(e) {
|
|
484
484
|
if (arguments.length === 1)
|
|
485
485
|
return this.then(null, e);
|
|
@@ -530,9 +530,9 @@ var Rr = { exports: {} };
|
|
|
530
530
|
});
|
|
531
531
|
});
|
|
532
532
|
}, PSD: { get: function() {
|
|
533
|
-
return
|
|
533
|
+
return B;
|
|
534
534
|
}, set: function(e) {
|
|
535
|
-
return
|
|
535
|
+
return B = e;
|
|
536
536
|
} }, totalEchoes: { get: function() {
|
|
537
537
|
return Pt;
|
|
538
538
|
} }, newPSD: Pe, usePSD: Ge, scheduler: { get: function() {
|
|
@@ -546,13 +546,13 @@ var Rr = { exports: {} };
|
|
|
546
546
|
} }, follow: function(e, t) {
|
|
547
547
|
return new T(function(n, r) {
|
|
548
548
|
return Pe(function(i, a) {
|
|
549
|
-
var s =
|
|
549
|
+
var s = B;
|
|
550
550
|
s.unhandleds = [], s.onunhandled = a, s.finalize = Ke(function() {
|
|
551
551
|
var u, h = this;
|
|
552
552
|
u = function() {
|
|
553
553
|
h.unhandleds.length === 0 ? i() : a(h.unhandleds[0]);
|
|
554
|
-
}, xt.push(function
|
|
555
|
-
u(), xt.splice(xt.indexOf(
|
|
554
|
+
}, xt.push(function f() {
|
|
555
|
+
u(), xt.splice(xt.indexOf(f), 1);
|
|
556
556
|
}), ++Ne, ct(function() {
|
|
557
557
|
--Ne == 0 && cn();
|
|
558
558
|
}, []);
|
|
@@ -590,7 +590,7 @@ var Rr = { exports: {} };
|
|
|
590
590
|
}));
|
|
591
591
|
var ne = { awaits: 0, echoes: 0, id: 0 }, ei = 0, At = [], Dt = 0, Pt = 0, ti = 0;
|
|
592
592
|
function Pe(e, t, n, r) {
|
|
593
|
-
var i =
|
|
593
|
+
var i = B, a = Object.create(i);
|
|
594
594
|
return a.parent = i, a.ref = 0, a.global = !1, a.id = ++ti, De.env, a.env = nn ? { Promise: T, PromiseProp: { value: T, configurable: !0, writable: !0 }, all: T.all, race: T.race, allSettled: T.allSettled, any: T.any, resolve: T.resolve, reject: T.reject } : {}, t && Z(a, t), ++i.ref, a.finalize = function() {
|
|
595
595
|
--this.parent.ref || this.parent.finalize();
|
|
596
596
|
}, r = Ge(a, e, n, r), a.ref === 0 && a.finalize(), r;
|
|
@@ -613,17 +613,17 @@ var Rr = { exports: {} };
|
|
|
613
613
|
At.pop(), Ce(e, !1);
|
|
614
614
|
}
|
|
615
615
|
function Ce(e, t) {
|
|
616
|
-
var n, r =
|
|
617
|
-
(t ? !ne.echoes || Dt++ && e ===
|
|
618
|
-
++Pt, ne.echoes && --ne.echoes != 0 || (ne.echoes = ne.awaits = ne.id = 0), At.push(
|
|
619
|
-
}).bind(null, e) : ni), e !==
|
|
616
|
+
var n, r = B;
|
|
617
|
+
(t ? !ne.echoes || Dt++ && e === B : !Dt || --Dt && e === B) || queueMicrotask(t ? (function(i) {
|
|
618
|
+
++Pt, ne.echoes && --ne.echoes != 0 || (ne.echoes = ne.awaits = ne.id = 0), At.push(B), Ce(i, !0);
|
|
619
|
+
}).bind(null, e) : ni), e !== B && (B = e, r === De && (De.env = rr()), nn && (n = De.env.Promise, t = e.env, (r.global || e.global) && (Object.defineProperty(M, "Promise", t.PromiseProp), n.all = t.all, n.race = t.race, n.resolve = t.resolve, n.reject = t.reject, t.allSettled && (n.allSettled = t.allSettled), t.any && (n.any = t.any))));
|
|
620
620
|
}
|
|
621
621
|
function rr() {
|
|
622
|
-
var e =
|
|
623
|
-
return nn ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(
|
|
622
|
+
var e = M.Promise;
|
|
623
|
+
return nn ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(M, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
|
|
624
624
|
}
|
|
625
625
|
function Ge(e, t, n, r, i) {
|
|
626
|
-
var a =
|
|
626
|
+
var a = B;
|
|
627
627
|
try {
|
|
628
628
|
return Ce(e, !0), t(n, r, i);
|
|
629
629
|
} finally {
|
|
@@ -632,7 +632,7 @@ var Rr = { exports: {} };
|
|
|
632
632
|
}
|
|
633
633
|
function ir(e, t, n, r) {
|
|
634
634
|
return typeof e != "function" ? e : function() {
|
|
635
|
-
var i =
|
|
635
|
+
var i = B;
|
|
636
636
|
n && Je(), Ce(t, !0);
|
|
637
637
|
try {
|
|
638
638
|
return e.apply(this, arguments);
|
|
@@ -674,15 +674,15 @@ var Rr = { exports: {} };
|
|
|
674
674
|
return t < e ? 1 : e < t ? -1 : 0;
|
|
675
675
|
case "binary":
|
|
676
676
|
return function(i, a) {
|
|
677
|
-
for (var s = i.length, u = a.length, h = s < u ? s : u,
|
|
678
|
-
if (i[
|
|
679
|
-
return i[
|
|
677
|
+
for (var s = i.length, u = a.length, h = s < u ? s : u, f = 0; f < h; ++f)
|
|
678
|
+
if (i[f] !== a[f])
|
|
679
|
+
return i[f] < a[f] ? -1 : 1;
|
|
680
680
|
return s === u ? 0 : s < u ? -1 : 1;
|
|
681
681
|
}(cr(e), cr(t));
|
|
682
682
|
case "Array":
|
|
683
683
|
return function(i, a) {
|
|
684
|
-
for (var s = i.length, u = a.length, h = s < u ? s : u,
|
|
685
|
-
var b = $(i[
|
|
684
|
+
for (var s = i.length, u = a.length, h = s < u ? s : u, f = 0; f < h; ++f) {
|
|
685
|
+
var b = $(i[f], a[f]);
|
|
686
686
|
if (b !== 0)
|
|
687
687
|
return b;
|
|
688
688
|
}
|
|
@@ -701,37 +701,37 @@ var Rr = { exports: {} };
|
|
|
701
701
|
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
702
702
|
}
|
|
703
703
|
var lr = (V.prototype._trans = function(e, t, n) {
|
|
704
|
-
var r = this._tx ||
|
|
705
|
-
function s(
|
|
704
|
+
var r = this._tx || B.trans, i = this.name, a = pe && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
705
|
+
function s(f, b, c) {
|
|
706
706
|
if (!c.schema[i])
|
|
707
707
|
throw new L.NotFound("Table " + i + " not part of transaction");
|
|
708
708
|
return t(c.idbtrans, c);
|
|
709
709
|
}
|
|
710
710
|
var u = Ve();
|
|
711
711
|
try {
|
|
712
|
-
var h = r && r.db._novip === this.db._novip ? r ===
|
|
712
|
+
var h = r && r.db._novip === this.db._novip ? r === B.trans ? r._promise(e, s, n) : Pe(function() {
|
|
713
713
|
return r._promise(e, s, n);
|
|
714
|
-
}, { trans: r, transless:
|
|
715
|
-
if (b.idbdb && (b._state.openComplete ||
|
|
716
|
-
var
|
|
714
|
+
}, { trans: r, transless: B.transless || B }) : function f(b, c, d, p) {
|
|
715
|
+
if (b.idbdb && (b._state.openComplete || B.letThrough || b._vip)) {
|
|
716
|
+
var m = b._createTransaction(c, d, b._dbSchema);
|
|
717
717
|
try {
|
|
718
|
-
|
|
718
|
+
m.create(), b._state.PR1398_maxLoop = 3;
|
|
719
719
|
} catch (w) {
|
|
720
720
|
return w.name === en.InvalidState && b.isOpen() && 0 < --b._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), b.close({ disableAutoOpen: !1 }), b.open().then(function() {
|
|
721
|
-
return
|
|
721
|
+
return f(b, c, d, p);
|
|
722
722
|
})) : q(w);
|
|
723
723
|
}
|
|
724
|
-
return
|
|
724
|
+
return m._promise(c, function(w, g) {
|
|
725
725
|
return Pe(function() {
|
|
726
|
-
return
|
|
726
|
+
return B.trans = m, p(w, g, m);
|
|
727
727
|
});
|
|
728
728
|
}).then(function(w) {
|
|
729
729
|
if (c === "readwrite")
|
|
730
730
|
try {
|
|
731
|
-
|
|
731
|
+
m.idbtrans.commit();
|
|
732
732
|
} catch {
|
|
733
733
|
}
|
|
734
|
-
return c === "readonly" ? w :
|
|
734
|
+
return c === "readonly" ? w : m._completion.then(function() {
|
|
735
735
|
return w;
|
|
736
736
|
});
|
|
737
737
|
});
|
|
@@ -744,11 +744,11 @@ var Rr = { exports: {} };
|
|
|
744
744
|
b.open().catch(H);
|
|
745
745
|
}
|
|
746
746
|
return b._state.dbReadyPromise.then(function() {
|
|
747
|
-
return
|
|
747
|
+
return f(b, c, d, p);
|
|
748
748
|
});
|
|
749
749
|
}(this.db, e, [this.name], s);
|
|
750
|
-
return a && (h._consoleTask = a, h = h.catch(function(
|
|
751
|
-
return console.trace(
|
|
750
|
+
return a && (h._consoleTask = a, h = h.catch(function(f) {
|
|
751
|
+
return console.trace(f), q(f);
|
|
752
752
|
})), h;
|
|
753
753
|
} finally {
|
|
754
754
|
u && Xe();
|
|
@@ -772,34 +772,34 @@ var Rr = { exports: {} };
|
|
|
772
772
|
if (h.compound && t.every(function(b) {
|
|
773
773
|
return 0 <= h.keyPath.indexOf(b);
|
|
774
774
|
})) {
|
|
775
|
-
for (var
|
|
776
|
-
if (t.indexOf(h.keyPath[
|
|
775
|
+
for (var f = 0; f < t.length; ++f)
|
|
776
|
+
if (t.indexOf(h.keyPath[f]) === -1)
|
|
777
777
|
return !1;
|
|
778
778
|
return !0;
|
|
779
779
|
}
|
|
780
780
|
return !1;
|
|
781
|
-
}).sort(function(h,
|
|
782
|
-
return h.keyPath.length -
|
|
781
|
+
}).sort(function(h, f) {
|
|
782
|
+
return h.keyPath.length - f.keyPath.length;
|
|
783
783
|
})[0];
|
|
784
784
|
if (n && this.db._maxKey !== Le) {
|
|
785
785
|
var s = n.keyPath.slice(0, t.length);
|
|
786
|
-
return this.where(s).equals(s.map(function(
|
|
787
|
-
return e[
|
|
786
|
+
return this.where(s).equals(s.map(function(f) {
|
|
787
|
+
return e[f];
|
|
788
788
|
}));
|
|
789
789
|
}
|
|
790
790
|
!n && pe && console.warn("The query ".concat(JSON.stringify(e), " on ").concat(this.name, " would benefit from a ") + "compound index [".concat(t.join("+"), "]"));
|
|
791
791
|
var r = this.schema.idxByName, i = this.db._deps.indexedDB;
|
|
792
|
-
function a(h,
|
|
793
|
-
return i.cmp(h,
|
|
792
|
+
function a(h, f) {
|
|
793
|
+
return i.cmp(h, f) === 0;
|
|
794
794
|
}
|
|
795
|
-
var u = t.reduce(function(
|
|
796
|
-
var b =
|
|
797
|
-
return [b ||
|
|
798
|
-
return
|
|
795
|
+
var u = t.reduce(function(d, f) {
|
|
796
|
+
var b = d[0], c = d[1], d = r[f], p = e[f];
|
|
797
|
+
return [b || d, b || !d ? Fe(c, d && d.multi ? function(m) {
|
|
798
|
+
return m = ve(m, f), N(m) && m.some(function(w) {
|
|
799
799
|
return a(p, w);
|
|
800
800
|
});
|
|
801
|
-
} : function(
|
|
802
|
-
return a(p, ve(
|
|
801
|
+
} : function(m) {
|
|
802
|
+
return a(p, ve(m, f));
|
|
803
803
|
}) : c];
|
|
804
804
|
}, [null, null]), s = u[0], u = u[1];
|
|
805
805
|
return s ? this.where(s.name).equals(e[s.keyPath]).filter(u) : n ? this.filter(u) : this.where(t).equals("");
|
|
@@ -826,13 +826,13 @@ var Rr = { exports: {} };
|
|
|
826
826
|
function i() {
|
|
827
827
|
return t !== null && t.apply(this, arguments) || this;
|
|
828
828
|
}
|
|
829
|
-
(this.schema.mappedClass = e).prototype instanceof sr && (function(h,
|
|
830
|
-
if (typeof
|
|
831
|
-
throw new TypeError("Class extends value " + String(
|
|
829
|
+
(this.schema.mappedClass = e).prototype instanceof sr && (function(h, f) {
|
|
830
|
+
if (typeof f != "function" && f !== null)
|
|
831
|
+
throw new TypeError("Class extends value " + String(f) + " is not a constructor or null");
|
|
832
832
|
function b() {
|
|
833
833
|
this.constructor = h;
|
|
834
834
|
}
|
|
835
|
-
|
|
835
|
+
l(h, f), h.prototype = f === null ? Object.create(f) : (b.prototype = f.prototype, new b());
|
|
836
836
|
}(i, t = e), Object.defineProperty(i.prototype, "db", { get: function() {
|
|
837
837
|
return n;
|
|
838
838
|
}, enumerable: !1, configurable: !0 }), i.prototype.table = function() {
|
|
@@ -845,11 +845,11 @@ var Rr = { exports: {} };
|
|
|
845
845
|
function u(h) {
|
|
846
846
|
if (!h)
|
|
847
847
|
return h;
|
|
848
|
-
var
|
|
849
|
-
for (
|
|
850
|
-
if (!a.has(
|
|
848
|
+
var f, b = Object.create(e.prototype);
|
|
849
|
+
for (f in h)
|
|
850
|
+
if (!a.has(f))
|
|
851
851
|
try {
|
|
852
|
-
b[
|
|
852
|
+
b[f] = h[f];
|
|
853
853
|
} catch {
|
|
854
854
|
}
|
|
855
855
|
return b;
|
|
@@ -915,33 +915,33 @@ var Rr = { exports: {} };
|
|
|
915
915
|
}, V.prototype.bulkAdd = function(e, t, n) {
|
|
916
916
|
var r = this, i = Array.isArray(t) ? t : void 0, a = (n = n || (i ? void 0 : t)) ? n.allKeys : void 0;
|
|
917
917
|
return this._trans("readwrite", function(s) {
|
|
918
|
-
var
|
|
919
|
-
if (
|
|
918
|
+
var f = r.schema.primKey, u = f.auto, f = f.keyPath;
|
|
919
|
+
if (f && i)
|
|
920
920
|
throw new L.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
921
921
|
if (i && i.length !== e.length)
|
|
922
922
|
throw new L.InvalidArgument("Arguments objects and keys must have the same length");
|
|
923
|
-
var h = e.length,
|
|
924
|
-
return r.core.mutate({ trans: s, type: "add", keys: i, values:
|
|
925
|
-
var c =
|
|
923
|
+
var h = e.length, f = f && u ? e.map(Rt(f)) : e;
|
|
924
|
+
return r.core.mutate({ trans: s, type: "add", keys: i, values: f, wantResults: a }).then(function(m) {
|
|
925
|
+
var c = m.numFailures, d = m.results, p = m.lastResult, m = m.failures;
|
|
926
926
|
if (c === 0)
|
|
927
|
-
return a ?
|
|
928
|
-
throw new Qe("".concat(r.name, ".bulkAdd(): ").concat(c, " of ").concat(h, " operations failed"),
|
|
927
|
+
return a ? d : p;
|
|
928
|
+
throw new Qe("".concat(r.name, ".bulkAdd(): ").concat(c, " of ").concat(h, " operations failed"), m);
|
|
929
929
|
});
|
|
930
930
|
});
|
|
931
931
|
}, V.prototype.bulkPut = function(e, t, n) {
|
|
932
932
|
var r = this, i = Array.isArray(t) ? t : void 0, a = (n = n || (i ? void 0 : t)) ? n.allKeys : void 0;
|
|
933
933
|
return this._trans("readwrite", function(s) {
|
|
934
|
-
var
|
|
935
|
-
if (
|
|
934
|
+
var f = r.schema.primKey, u = f.auto, f = f.keyPath;
|
|
935
|
+
if (f && i)
|
|
936
936
|
throw new L.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
937
937
|
if (i && i.length !== e.length)
|
|
938
938
|
throw new L.InvalidArgument("Arguments objects and keys must have the same length");
|
|
939
|
-
var h = e.length,
|
|
940
|
-
return r.core.mutate({ trans: s, type: "put", keys: i, values:
|
|
941
|
-
var c =
|
|
939
|
+
var h = e.length, f = f && u ? e.map(Rt(f)) : e;
|
|
940
|
+
return r.core.mutate({ trans: s, type: "put", keys: i, values: f, wantResults: a }).then(function(m) {
|
|
941
|
+
var c = m.numFailures, d = m.results, p = m.lastResult, m = m.failures;
|
|
942
942
|
if (c === 0)
|
|
943
|
-
return a ?
|
|
944
|
-
throw new Qe("".concat(r.name, ".bulkPut(): ").concat(c, " of ").concat(h, " operations failed"),
|
|
943
|
+
return a ? d : p;
|
|
944
|
+
throw new Qe("".concat(r.name, ".bulkPut(): ").concat(c, " of ").concat(h, " operations failed"), m);
|
|
945
945
|
});
|
|
946
946
|
});
|
|
947
947
|
}, V.prototype.bulkUpdate = function(e) {
|
|
@@ -952,31 +952,31 @@ var Rr = { exports: {} };
|
|
|
952
952
|
}), a = [];
|
|
953
953
|
return this._trans("readwrite", function(s) {
|
|
954
954
|
return n.getMany({ trans: s, keys: r, cache: "clone" }).then(function(u) {
|
|
955
|
-
var h = [],
|
|
956
|
-
e.forEach(function(c,
|
|
957
|
-
var p = c.key,
|
|
955
|
+
var h = [], f = [];
|
|
956
|
+
e.forEach(function(c, d) {
|
|
957
|
+
var p = c.key, m = c.changes, w = u[d];
|
|
958
958
|
if (w) {
|
|
959
|
-
for (var g = 0, _ = Object.keys(
|
|
960
|
-
var S = _[g], E =
|
|
959
|
+
for (var g = 0, _ = Object.keys(m); g < _.length; g++) {
|
|
960
|
+
var S = _[g], E = m[S];
|
|
961
961
|
if (S === t.schema.primKey.keyPath) {
|
|
962
962
|
if ($(E, p) !== 0)
|
|
963
963
|
throw new L.Constraint("Cannot update primary key in bulkUpdate()");
|
|
964
964
|
} else
|
|
965
965
|
fe(w, S, E);
|
|
966
966
|
}
|
|
967
|
-
a.push(
|
|
967
|
+
a.push(d), h.push(p), f.push(w);
|
|
968
968
|
}
|
|
969
969
|
});
|
|
970
970
|
var b = h.length;
|
|
971
|
-
return n.mutate({ trans: s, type: "put", keys: h, values:
|
|
972
|
-
var
|
|
973
|
-
if (
|
|
971
|
+
return n.mutate({ trans: s, type: "put", keys: h, values: f, updates: { keys: r, changeSpecs: i } }).then(function(c) {
|
|
972
|
+
var d = c.numFailures, p = c.failures;
|
|
973
|
+
if (d === 0)
|
|
974
974
|
return b;
|
|
975
|
-
for (var
|
|
976
|
-
var g, _ = w[
|
|
975
|
+
for (var m = 0, w = Object.keys(p); m < w.length; m++) {
|
|
976
|
+
var g, _ = w[m], S = a[Number(_)];
|
|
977
977
|
S != null && (g = p[_], delete p[_], p[S] = g);
|
|
978
978
|
}
|
|
979
|
-
throw new Qe("".concat(t.name, ".bulkUpdate(): ").concat(
|
|
979
|
+
throw new Qe("".concat(t.name, ".bulkUpdate(): ").concat(d, " of ").concat(b, " operations failed"), p);
|
|
980
980
|
});
|
|
981
981
|
});
|
|
982
982
|
});
|
|
@@ -996,9 +996,9 @@ var Rr = { exports: {} };
|
|
|
996
996
|
function ft(e) {
|
|
997
997
|
function t(s, u) {
|
|
998
998
|
if (u) {
|
|
999
|
-
for (var h = arguments.length,
|
|
1000
|
-
|
|
1001
|
-
return n[s].subscribe.apply(null,
|
|
999
|
+
for (var h = arguments.length, f = new Array(h - 1); --h; )
|
|
1000
|
+
f[h - 1] = arguments[h];
|
|
1001
|
+
return n[s].subscribe.apply(null, f), e;
|
|
1002
1002
|
}
|
|
1003
1003
|
if (typeof s == "string")
|
|
1004
1004
|
return n[s];
|
|
@@ -1010,27 +1010,27 @@ var Rr = { exports: {} };
|
|
|
1010
1010
|
return t;
|
|
1011
1011
|
function a(s, u, h) {
|
|
1012
1012
|
if (typeof s != "object") {
|
|
1013
|
-
var
|
|
1013
|
+
var f;
|
|
1014
1014
|
u = u || Jr;
|
|
1015
1015
|
var b = { subscribers: [], fire: h = h || H, subscribe: function(c) {
|
|
1016
1016
|
b.subscribers.indexOf(c) === -1 && (b.subscribers.push(c), b.fire = u(b.fire, c));
|
|
1017
1017
|
}, unsubscribe: function(c) {
|
|
1018
|
-
b.subscribers = b.subscribers.filter(function(
|
|
1019
|
-
return
|
|
1018
|
+
b.subscribers = b.subscribers.filter(function(d) {
|
|
1019
|
+
return d !== c;
|
|
1020
1020
|
}), b.fire = b.subscribers.reduce(u, h);
|
|
1021
1021
|
} };
|
|
1022
1022
|
return n[s] = t[s] = b;
|
|
1023
1023
|
}
|
|
1024
|
-
j(
|
|
1025
|
-
var
|
|
1026
|
-
if (N(
|
|
1027
|
-
a(c,
|
|
1024
|
+
j(f = s).forEach(function(c) {
|
|
1025
|
+
var d = f[c];
|
|
1026
|
+
if (N(d))
|
|
1027
|
+
a(c, f[c][0], f[c][1]);
|
|
1028
1028
|
else {
|
|
1029
|
-
if (
|
|
1029
|
+
if (d !== "asap")
|
|
1030
1030
|
throw new L.InvalidArgument("Invalid event config");
|
|
1031
1031
|
var p = a(c, ot, function() {
|
|
1032
|
-
for (var
|
|
1033
|
-
w[
|
|
1032
|
+
for (var m = arguments.length, w = new Array(m); m--; )
|
|
1033
|
+
w[m] = arguments[m];
|
|
1034
1034
|
p.subscribers.forEach(function(g) {
|
|
1035
1035
|
Hn(function() {
|
|
1036
1036
|
g.apply(null, w);
|
|
@@ -1071,13 +1071,13 @@ var Rr = { exports: {} };
|
|
|
1071
1071
|
function jt(e, t, n, r) {
|
|
1072
1072
|
var i = e.replayFilter ? Fe(e.filter, e.replayFilter()) : e.filter;
|
|
1073
1073
|
if (e.or) {
|
|
1074
|
-
var a = {}, s = function(u, h,
|
|
1074
|
+
var a = {}, s = function(u, h, f) {
|
|
1075
1075
|
var b, c;
|
|
1076
|
-
i && !i(h,
|
|
1077
|
-
return h.stop(
|
|
1078
|
-
}, function(
|
|
1079
|
-
return h.fail(
|
|
1080
|
-
}) || ((c = "" + (b = h.primaryKey)) == "[object ArrayBuffer]" && (c = "" + new Uint8Array(b)), ie(a, c) || (a[c] = !0, t(u, h,
|
|
1076
|
+
i && !i(h, f, function(d) {
|
|
1077
|
+
return h.stop(d);
|
|
1078
|
+
}, function(d) {
|
|
1079
|
+
return h.fail(d);
|
|
1080
|
+
}) || ((c = "" + (b = h.primaryKey)) == "[object ArrayBuffer]" && (c = "" + new Uint8Array(b)), ie(a, c) || (a[c] = !0, t(u, h, f)));
|
|
1081
1081
|
};
|
|
1082
1082
|
return Promise.all([e.or._iterate(s, n), dr(fr(e, r, n), e.algorithm, s, !e.keysOnly && e.valueMapper)]);
|
|
1083
1083
|
}
|
|
@@ -1143,12 +1143,12 @@ var Rr = { exports: {} };
|
|
|
1143
1143
|
}).then(e);
|
|
1144
1144
|
}, z.prototype.sortBy = function(e, t) {
|
|
1145
1145
|
var n = e.split(".").reverse(), r = n[0], i = n.length - 1;
|
|
1146
|
-
function a(h,
|
|
1147
|
-
return
|
|
1146
|
+
function a(h, f) {
|
|
1147
|
+
return f ? a(h[n[f]], f - 1) : h[r];
|
|
1148
1148
|
}
|
|
1149
1149
|
var s = this._ctx.dir === "next" ? 1 : -1;
|
|
1150
|
-
function u(h,
|
|
1151
|
-
return h = a(h, i),
|
|
1150
|
+
function u(h, f) {
|
|
1151
|
+
return h = a(h, i), f = a(f, i), h < f ? -s : f < h ? s : 0;
|
|
1152
1152
|
}
|
|
1153
1153
|
return this.toArray(function(h) {
|
|
1154
1154
|
return h.sort(u);
|
|
@@ -1282,16 +1282,16 @@ var Rr = { exports: {} };
|
|
|
1282
1282
|
});
|
|
1283
1283
|
function u(g, E) {
|
|
1284
1284
|
var S = E.failures, E = E.numFailures;
|
|
1285
|
-
|
|
1285
|
+
m += g - E;
|
|
1286
1286
|
for (var O = 0, k = j(S); O < k.length; O++) {
|
|
1287
1287
|
var C = k[O];
|
|
1288
1288
|
p.push(S[C]);
|
|
1289
1289
|
}
|
|
1290
1290
|
}
|
|
1291
|
-
var h = n.table.core,
|
|
1291
|
+
var h = n.table.core, f = h.schema.primaryKey, b = f.outbound, c = f.extractKey, d = t.db._options.modifyChunkSize || 200, p = [], m = 0, w = [];
|
|
1292
1292
|
return t.clone().primaryKeys().then(function(g) {
|
|
1293
1293
|
function _(S) {
|
|
1294
|
-
var E = Math.min(
|
|
1294
|
+
var E = Math.min(d, g.length - S);
|
|
1295
1295
|
return h.getMany({ trans: r, keys: g.slice(S, S + E), cache: "immutable" }).then(function(O) {
|
|
1296
1296
|
for (var k = [], C = [], A = b ? [] : null, R = [], D = 0; D < E; ++D) {
|
|
1297
1297
|
var G = O[D], F = { value: Ae(G), primKey: g[S + D] };
|
|
@@ -1311,13 +1311,13 @@ var Rr = { exports: {} };
|
|
|
1311
1311
|
return u(R.length, W);
|
|
1312
1312
|
});
|
|
1313
1313
|
}).then(function() {
|
|
1314
|
-
return g.length > S + E && _(S +
|
|
1314
|
+
return g.length > S + E && _(S + d);
|
|
1315
1315
|
});
|
|
1316
1316
|
});
|
|
1317
1317
|
}
|
|
1318
1318
|
return _(0).then(function() {
|
|
1319
1319
|
if (0 < p.length)
|
|
1320
|
-
throw new _t("Error modifying one or more objects", p,
|
|
1320
|
+
throw new _t("Error modifying one or more objects", p, m, w);
|
|
1321
1321
|
return g.length;
|
|
1322
1322
|
});
|
|
1323
1323
|
});
|
|
@@ -1358,21 +1358,21 @@ var Rr = { exports: {} };
|
|
|
1358
1358
|
}).limit(0);
|
|
1359
1359
|
}
|
|
1360
1360
|
function Mt(e, t, n, r) {
|
|
1361
|
-
var i, a, s, u, h,
|
|
1362
|
-
if (!n.every(function(
|
|
1363
|
-
return typeof
|
|
1361
|
+
var i, a, s, u, h, f, b, c = n.length;
|
|
1362
|
+
if (!n.every(function(m) {
|
|
1363
|
+
return typeof m == "string";
|
|
1364
1364
|
}))
|
|
1365
1365
|
return ce(e, or);
|
|
1366
|
-
function
|
|
1367
|
-
i =
|
|
1366
|
+
function d(m) {
|
|
1367
|
+
i = m === "next" ? function(g) {
|
|
1368
1368
|
return g.toUpperCase();
|
|
1369
1369
|
} : function(g) {
|
|
1370
1370
|
return g.toLowerCase();
|
|
1371
|
-
}, a =
|
|
1371
|
+
}, a = m === "next" ? function(g) {
|
|
1372
1372
|
return g.toLowerCase();
|
|
1373
1373
|
} : function(g) {
|
|
1374
1374
|
return g.toUpperCase();
|
|
1375
|
-
}, s =
|
|
1375
|
+
}, s = m === "next" ? ii : oi;
|
|
1376
1376
|
var w = n.map(function(g) {
|
|
1377
1377
|
return { lower: a(g), upper: i(g) };
|
|
1378
1378
|
}).sort(function(g, _) {
|
|
@@ -1382,16 +1382,16 @@ var Rr = { exports: {} };
|
|
|
1382
1382
|
return g.upper;
|
|
1383
1383
|
}), h = w.map(function(g) {
|
|
1384
1384
|
return g.lower;
|
|
1385
|
-
}), b = (
|
|
1385
|
+
}), b = (f = m) === "next" ? "" : r;
|
|
1386
1386
|
}
|
|
1387
|
-
|
|
1387
|
+
d("next"), e = new e.Collection(e, function() {
|
|
1388
1388
|
return Re(u[0], h[c - 1] + r);
|
|
1389
|
-
}), e._ondirectionchange = function(
|
|
1390
|
-
|
|
1389
|
+
}), e._ondirectionchange = function(m) {
|
|
1390
|
+
d(m);
|
|
1391
1391
|
};
|
|
1392
1392
|
var p = 0;
|
|
1393
|
-
return e._addAlgorithm(function(
|
|
1394
|
-
var _ =
|
|
1393
|
+
return e._addAlgorithm(function(m, w, g) {
|
|
1394
|
+
var _ = m.key;
|
|
1395
1395
|
if (typeof _ != "string")
|
|
1396
1396
|
return !1;
|
|
1397
1397
|
var S = a(_);
|
|
@@ -1406,11 +1406,11 @@ var Rr = { exports: {} };
|
|
|
1406
1406
|
G(C[Q], le) < 0 && (W = Q);
|
|
1407
1407
|
}
|
|
1408
1408
|
return Y < D.length && F === "next" ? C + R.substr(C.length) : Y < C.length && F === "prev" ? C.substr(0, R.length) : W < 0 ? null : C.substr(0, W) + D[W] + R.substr(W + 1);
|
|
1409
|
-
}(_, S, u[O], h[O], s,
|
|
1409
|
+
}(_, S, u[O], h[O], s, f);
|
|
1410
1410
|
k === null && E === null ? p = O + 1 : (E === null || 0 < s(E, k)) && (E = k);
|
|
1411
1411
|
}
|
|
1412
1412
|
return w(E !== null ? function() {
|
|
1413
|
-
|
|
1413
|
+
m.continue(E + b);
|
|
1414
1414
|
} : g), !1;
|
|
1415
1415
|
}), e;
|
|
1416
1416
|
}
|
|
@@ -1520,8 +1520,8 @@ var Rr = { exports: {} };
|
|
|
1520
1520
|
return S[0] !== void 0 && S[1] !== void 0 && i(S[0], S[1]) <= 0;
|
|
1521
1521
|
}))
|
|
1522
1522
|
return ce(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", L.InvalidArgument);
|
|
1523
|
-
var h = !t || t.includeLowers !== !1,
|
|
1524
|
-
function
|
|
1523
|
+
var h = !t || t.includeLowers !== !1, f = t && t.includeUppers === !0, b, c = i;
|
|
1524
|
+
function d(S, E) {
|
|
1525
1525
|
return c(S[0], E[0]);
|
|
1526
1526
|
}
|
|
1527
1527
|
try {
|
|
@@ -1534,11 +1534,11 @@ var Rr = { exports: {} };
|
|
|
1534
1534
|
}
|
|
1535
1535
|
}
|
|
1536
1536
|
return O === k && S.push(E), S;
|
|
1537
|
-
}, [])).sort(
|
|
1537
|
+
}, [])).sort(d);
|
|
1538
1538
|
} catch {
|
|
1539
1539
|
return ce(this, _e);
|
|
1540
1540
|
}
|
|
1541
|
-
var p = 0,
|
|
1541
|
+
var p = 0, m = f ? function(S) {
|
|
1542
1542
|
return 0 < i(S, b[p][1]);
|
|
1543
1543
|
} : function(S) {
|
|
1544
1544
|
return 0 <= i(S, b[p][1]);
|
|
@@ -1546,16 +1546,16 @@ var Rr = { exports: {} };
|
|
|
1546
1546
|
return 0 < a(S, b[p][0]);
|
|
1547
1547
|
} : function(S) {
|
|
1548
1548
|
return 0 <= a(S, b[p][0]);
|
|
1549
|
-
}, g =
|
|
1550
|
-
return Re(b[0][0], b[b.length - 1][1], !h, !
|
|
1549
|
+
}, g = m, _ = new this.Collection(this, function() {
|
|
1550
|
+
return Re(b[0][0], b[b.length - 1][1], !h, !f);
|
|
1551
1551
|
});
|
|
1552
1552
|
return _._ondirectionchange = function(S) {
|
|
1553
|
-
c = S === "next" ? (g =
|
|
1553
|
+
c = S === "next" ? (g = m, i) : (g = w, a), b.sort(d);
|
|
1554
1554
|
}, _._addAlgorithm(function(S, E, O) {
|
|
1555
1555
|
for (var k, C = S.key; g(C); )
|
|
1556
1556
|
if (++p === b.length)
|
|
1557
1557
|
return E(O), !1;
|
|
1558
|
-
return !
|
|
1558
|
+
return !m(k = C) && !w(k) || (n._cmp(C, b[p][1]) === 0 || n._cmp(C, b[p][0]) === 0 || E(function() {
|
|
1559
1559
|
c === i ? S.continue(b[p][0]) : S.continue(b[p][1]);
|
|
1560
1560
|
}), !1);
|
|
1561
1561
|
}), _;
|
|
@@ -1578,10 +1578,10 @@ var Rr = { exports: {} };
|
|
|
1578
1578
|
e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
|
|
1579
1579
|
}
|
|
1580
1580
|
var pt = "storagemutated", yn = "x-storagemutated-1", Te = ft(null, pt), ai = (me.prototype._lock = function() {
|
|
1581
|
-
return rt(!
|
|
1581
|
+
return rt(!B.global), ++this._reculock, this._reculock !== 1 || B.global || (B.lockOwnerFor = this), this;
|
|
1582
1582
|
}, me.prototype._unlock = function() {
|
|
1583
|
-
if (rt(!
|
|
1584
|
-
for (
|
|
1583
|
+
if (rt(!B.global), --this._reculock == 0)
|
|
1584
|
+
for (B.global || (B.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked(); ) {
|
|
1585
1585
|
var e = this._blockedFuncs.shift();
|
|
1586
1586
|
try {
|
|
1587
1587
|
Ge(e[1], e[0]);
|
|
@@ -1590,7 +1590,7 @@ var Rr = { exports: {} };
|
|
|
1590
1590
|
}
|
|
1591
1591
|
return this;
|
|
1592
1592
|
}, me.prototype._locked = function() {
|
|
1593
|
-
return this._reculock &&
|
|
1593
|
+
return this._reculock && B.lockOwnerFor !== this;
|
|
1594
1594
|
}, me.prototype.create = function(e) {
|
|
1595
1595
|
var t = this;
|
|
1596
1596
|
if (!this.mode)
|
|
@@ -1624,7 +1624,7 @@ var Rr = { exports: {} };
|
|
|
1624
1624
|
return new T(function(a, s) {
|
|
1625
1625
|
r._blockedFuncs.push([function() {
|
|
1626
1626
|
r._promise(e, t, n).then(a, s);
|
|
1627
|
-
},
|
|
1627
|
+
}, B]);
|
|
1628
1628
|
});
|
|
1629
1629
|
if (n)
|
|
1630
1630
|
return Pe(function() {
|
|
@@ -1725,16 +1725,16 @@ var Rr = { exports: {} };
|
|
|
1725
1725
|
return null;
|
|
1726
1726
|
if (g.type === 4)
|
|
1727
1727
|
throw new Error("Cannot convert never type to IDBKeyRange");
|
|
1728
|
-
var p = g.lower,
|
|
1729
|
-
return p === void 0 ?
|
|
1728
|
+
var p = g.lower, m = g.upper, w = g.lowerOpen, g = g.upperOpen;
|
|
1729
|
+
return p === void 0 ? m === void 0 ? null : t.upperBound(m, !!g) : m === void 0 ? t.lowerBound(p, !!w) : t.bound(p, m, !!w, !!g);
|
|
1730
1730
|
}
|
|
1731
|
-
function i(
|
|
1732
|
-
var p,
|
|
1733
|
-
return { name:
|
|
1731
|
+
function i(d) {
|
|
1732
|
+
var p, m = d.name;
|
|
1733
|
+
return { name: m, schema: d, mutate: function(w) {
|
|
1734
1734
|
var g = w.trans, _ = w.type, S = w.keys, E = w.values, O = w.range;
|
|
1735
1735
|
return new Promise(function(k, C) {
|
|
1736
1736
|
k = J(k);
|
|
1737
|
-
var A = g.objectStore(
|
|
1737
|
+
var A = g.objectStore(m), R = A.keyPath == null, D = _ === "put" || _ === "add";
|
|
1738
1738
|
if (!D && _ !== "delete" && _ !== "deleteRange")
|
|
1739
1739
|
throw new Error("Invalid operation type: " + _);
|
|
1740
1740
|
var G, F = (S || E || { length: 1 }).length;
|
|
@@ -1774,7 +1774,7 @@ var Rr = { exports: {} };
|
|
|
1774
1774
|
var g = w.trans, _ = w.keys;
|
|
1775
1775
|
return new Promise(function(S, E) {
|
|
1776
1776
|
S = J(S);
|
|
1777
|
-
for (var O, k = g.objectStore(
|
|
1777
|
+
for (var O, k = g.objectStore(m), C = _.length, A = new Array(C), R = 0, D = 0, G = function(W) {
|
|
1778
1778
|
W = W.target, A[W._pos] = W.result, ++D === R && S(A);
|
|
1779
1779
|
}, F = ye(E), Y = 0; Y < C; ++Y)
|
|
1780
1780
|
_[Y] != null && ((O = k.get(_[Y]))._pos = Y, O.onsuccess = G, O.onerror = F, ++R);
|
|
@@ -1784,15 +1784,15 @@ var Rr = { exports: {} };
|
|
|
1784
1784
|
var g = w.trans, _ = w.key;
|
|
1785
1785
|
return new Promise(function(S, E) {
|
|
1786
1786
|
S = J(S);
|
|
1787
|
-
var O = g.objectStore(
|
|
1787
|
+
var O = g.objectStore(m).get(_);
|
|
1788
1788
|
O.onsuccess = function(k) {
|
|
1789
1789
|
return S(k.target.result);
|
|
1790
1790
|
}, O.onerror = ye(E);
|
|
1791
1791
|
});
|
|
1792
|
-
}, query: (p =
|
|
1792
|
+
}, query: (p = f, function(w) {
|
|
1793
1793
|
return new Promise(function(g, _) {
|
|
1794
1794
|
g = J(g);
|
|
1795
|
-
var S, E, O, R = w.trans, k = w.values, C = w.limit, G = w.query, A = C === 1 / 0 ? void 0 : C, D = G.index, G = G.range, R = R.objectStore(
|
|
1795
|
+
var S, E, O, R = w.trans, k = w.values, C = w.limit, G = w.query, A = C === 1 / 0 ? void 0 : C, D = G.index, G = G.range, R = R.objectStore(m), D = D.isPrimaryKey ? R : R.index(D.name), G = r(G);
|
|
1796
1796
|
if (C === 0)
|
|
1797
1797
|
return g({ result: [] });
|
|
1798
1798
|
p ? ((A = k ? D.getAll(G, A) : D.getAllKeys(G, A)).onsuccess = function(F) {
|
|
@@ -1806,7 +1806,7 @@ var Rr = { exports: {} };
|
|
|
1806
1806
|
var g = w.trans, _ = w.values, S = w.query, E = w.reverse, O = w.unique;
|
|
1807
1807
|
return new Promise(function(k, C) {
|
|
1808
1808
|
k = J(k);
|
|
1809
|
-
var D = S.index, A = S.range, R = g.objectStore(
|
|
1809
|
+
var D = S.index, A = S.range, R = g.objectStore(m), R = D.isPrimaryKey ? R : R.index(D.name), D = E ? O ? "prevunique" : "prev" : O ? "nextunique" : "next", G = !_ && "openKeyCursor" in R ? R.openKeyCursor(r(A), D) : R.openCursor(r(A), D);
|
|
1810
1810
|
G.onerror = ye(C), G.onsuccess = J(function(F) {
|
|
1811
1811
|
var Y, W, Q, le, U = G.result;
|
|
1812
1812
|
U ? (U.___id = ++si, U.done = !1, Y = U.continue.bind(U), W = (W = U.continuePrimaryKey) && W.bind(U), Q = U.advance.bind(U), le = function() {
|
|
@@ -1847,18 +1847,18 @@ var Rr = { exports: {} };
|
|
|
1847
1847
|
}, count: function(w) {
|
|
1848
1848
|
var g = w.query, _ = w.trans, S = g.index, E = g.range;
|
|
1849
1849
|
return new Promise(function(O, k) {
|
|
1850
|
-
var C = _.objectStore(
|
|
1850
|
+
var C = _.objectStore(m), A = S.isPrimaryKey ? C : C.index(S.name), C = r(E), A = C ? A.count(C) : A.count();
|
|
1851
1851
|
A.onsuccess = J(function(R) {
|
|
1852
1852
|
return O(R.target.result);
|
|
1853
1853
|
}), A.onerror = ye(k);
|
|
1854
1854
|
});
|
|
1855
1855
|
} };
|
|
1856
1856
|
}
|
|
1857
|
-
var a, s, u, b = (s = h, u = yr((a = e).objectStoreNames), { schema: { name: a.name, tables: u.map(function(
|
|
1858
|
-
return s.objectStore(
|
|
1859
|
-
}).map(function(
|
|
1860
|
-
var p =
|
|
1861
|
-
return
|
|
1857
|
+
var a, s, u, b = (s = h, u = yr((a = e).objectStoreNames), { schema: { name: a.name, tables: u.map(function(d) {
|
|
1858
|
+
return s.objectStore(d);
|
|
1859
|
+
}).map(function(d) {
|
|
1860
|
+
var p = d.keyPath, g = d.autoIncrement, m = N(p), w = {}, g = { name: d.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: p == null, compound: m, keyPath: p, autoIncrement: g, unique: !0, extractKey: vn(p) }, indexes: yr(d.indexNames).map(function(_) {
|
|
1861
|
+
return d.index(_);
|
|
1862
1862
|
}).map(function(O) {
|
|
1863
1863
|
var S = O.name, E = O.unique, k = O.multiEntry, O = O.keyPath, k = { name: S, compound: N(O), keyPath: O, unique: E, multiEntry: k, extractKey: vn(O) };
|
|
1864
1864
|
return w[yt(O)] = k;
|
|
@@ -1866,19 +1866,19 @@ var Rr = { exports: {} };
|
|
|
1866
1866
|
return w[yt(_)];
|
|
1867
1867
|
} };
|
|
1868
1868
|
return w[":id"] = g.primaryKey, p != null && (w[yt(p)] = g.primaryKey), g;
|
|
1869
|
-
}) }, hasGetAll: 0 < u.length && "getAll" in s.objectStore(u[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), h = b.schema,
|
|
1870
|
-
return b.forEach(function(
|
|
1871
|
-
return c[
|
|
1872
|
-
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(
|
|
1873
|
-
if (!c[
|
|
1874
|
-
throw new Error("Table '".concat(
|
|
1875
|
-
return c[
|
|
1869
|
+
}) }, hasGetAll: 0 < u.length && "getAll" in s.objectStore(u[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), h = b.schema, f = b.hasGetAll, b = h.tables.map(i), c = {};
|
|
1870
|
+
return b.forEach(function(d) {
|
|
1871
|
+
return c[d.name] = d;
|
|
1872
|
+
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(d) {
|
|
1873
|
+
if (!c[d])
|
|
1874
|
+
throw new Error("Table '".concat(d, "' not found"));
|
|
1875
|
+
return c[d];
|
|
1876
1876
|
}, MIN_KEY: -1 / 0, MAX_KEY: gt(t), schema: h };
|
|
1877
1877
|
}
|
|
1878
1878
|
function ci(e, t, n, r) {
|
|
1879
1879
|
var i = n.IDBKeyRange;
|
|
1880
1880
|
return n.indexedDB, { dbcore: (r = ui(t, i, r), e.dbcore.reduce(function(a, s) {
|
|
1881
|
-
return s = s.create,
|
|
1881
|
+
return s = s.create, y(y({}, a), s(a));
|
|
1882
1882
|
}, r)) };
|
|
1883
1883
|
}
|
|
1884
1884
|
function Kt(e, r) {
|
|
@@ -1894,8 +1894,8 @@ var Rr = { exports: {} };
|
|
|
1894
1894
|
n.forEach(function(i) {
|
|
1895
1895
|
var a = r[i];
|
|
1896
1896
|
t.forEach(function(s) {
|
|
1897
|
-
var u = function h(
|
|
1898
|
-
return Lr(
|
|
1897
|
+
var u = function h(f, b) {
|
|
1898
|
+
return Lr(f, b) || (f = te(f)) && h(f, b);
|
|
1899
1899
|
}(s, i);
|
|
1900
1900
|
(!u || "value" in u && u.value === void 0) && (s === e.Transaction.prototype || s instanceof e.Transaction ? ke(s, i, { get: function() {
|
|
1901
1901
|
return this.table(i);
|
|
@@ -1919,24 +1919,24 @@ var Rr = { exports: {} };
|
|
|
1919
1919
|
n.objectStoreNames.contains("$meta") && !i.$meta && (i.$meta = bn("$meta", br("")[0], []), e._storeNames.push("$meta"));
|
|
1920
1920
|
var a = e._createTransaction("readwrite", e._storeNames, i);
|
|
1921
1921
|
a.create(n), a._completion.catch(r);
|
|
1922
|
-
var s = a._reject.bind(a), u =
|
|
1922
|
+
var s = a._reject.bind(a), u = B.transless || B;
|
|
1923
1923
|
Pe(function() {
|
|
1924
|
-
return
|
|
1925
|
-
return b ??
|
|
1926
|
-
}) : T.resolve(
|
|
1927
|
-
return
|
|
1928
|
-
return _._cfg.version >=
|
|
1924
|
+
return B.trans = a, B.transless = u, t !== 0 ? (Kt(e, n), f = t, ((h = a).storeNames.includes("$meta") ? h.table("$meta").get("version").then(function(b) {
|
|
1925
|
+
return b ?? f;
|
|
1926
|
+
}) : T.resolve(f)).then(function(b) {
|
|
1927
|
+
return d = b, p = a, m = n, w = [], b = (c = e)._versions, g = c._dbSchema = Gt(0, c.idbdb, m), (b = b.filter(function(_) {
|
|
1928
|
+
return _._cfg.version >= d;
|
|
1929
1929
|
})).length !== 0 ? (b.forEach(function(_) {
|
|
1930
1930
|
w.push(function() {
|
|
1931
1931
|
var S = g, E = _._cfg.dbschema;
|
|
1932
|
-
Lt(c, S,
|
|
1932
|
+
Lt(c, S, m), Lt(c, E, m), g = c._dbSchema = E;
|
|
1933
1933
|
var O = _n(S, E);
|
|
1934
1934
|
O.add.forEach(function(D) {
|
|
1935
|
-
Sn(
|
|
1935
|
+
Sn(m, D[0], D[1].primKey, D[1].indexes);
|
|
1936
1936
|
}), O.change.forEach(function(D) {
|
|
1937
1937
|
if (D.recreate)
|
|
1938
1938
|
throw new L.Upgrade("Not yet support for changing primary key");
|
|
1939
|
-
var G =
|
|
1939
|
+
var G = m.objectStore(D.name);
|
|
1940
1940
|
D.add.forEach(function(F) {
|
|
1941
1941
|
return Nt(G, F);
|
|
1942
1942
|
}), D.change.forEach(function(F) {
|
|
@@ -1946,8 +1946,8 @@ var Rr = { exports: {} };
|
|
|
1946
1946
|
});
|
|
1947
1947
|
});
|
|
1948
1948
|
var k = _._cfg.contentUpgrade;
|
|
1949
|
-
if (k && _._cfg.version >
|
|
1950
|
-
Kt(c,
|
|
1949
|
+
if (k && _._cfg.version > d) {
|
|
1950
|
+
Kt(c, m), p._memoizedTables = {};
|
|
1951
1951
|
var C = Qn(E);
|
|
1952
1952
|
O.del.forEach(function(D) {
|
|
1953
1953
|
C[D] = S[D];
|
|
@@ -1973,15 +1973,15 @@ var Rr = { exports: {} };
|
|
|
1973
1973
|
}), function _() {
|
|
1974
1974
|
return w.length ? T.resolve(w.shift()(p.idbtrans)).then(_) : T.resolve();
|
|
1975
1975
|
}().then(function() {
|
|
1976
|
-
mr(g,
|
|
1976
|
+
mr(g, m);
|
|
1977
1977
|
})) : T.resolve();
|
|
1978
|
-
var c,
|
|
1978
|
+
var c, d, p, m, w, g;
|
|
1979
1979
|
}).catch(s)) : (j(i).forEach(function(b) {
|
|
1980
1980
|
Sn(n, b, i[b].primKey, i[b].indexes);
|
|
1981
1981
|
}), Kt(e, n), void T.follow(function() {
|
|
1982
1982
|
return e.on.populate.fire(a);
|
|
1983
1983
|
}).catch(s));
|
|
1984
|
-
var h,
|
|
1984
|
+
var h, f;
|
|
1985
1985
|
});
|
|
1986
1986
|
}
|
|
1987
1987
|
function di(e, t) {
|
|
@@ -2012,11 +2012,11 @@ var Rr = { exports: {} };
|
|
|
2012
2012
|
if ("" + (i.primKey.keyPath || "") != "" + (a.primKey.keyPath || "") || i.primKey.auto !== a.primKey.auto)
|
|
2013
2013
|
s.recreate = !0, r.change.push(s);
|
|
2014
2014
|
else {
|
|
2015
|
-
var u = i.idxByName, h = a.idxByName,
|
|
2016
|
-
for (
|
|
2017
|
-
h[
|
|
2018
|
-
for (
|
|
2019
|
-
var b = u[
|
|
2015
|
+
var u = i.idxByName, h = a.idxByName, f = void 0;
|
|
2016
|
+
for (f in u)
|
|
2017
|
+
h[f] || s.del.push(f);
|
|
2018
|
+
for (f in h) {
|
|
2019
|
+
var b = u[f], c = h[f];
|
|
2020
2020
|
b ? b.src !== c.src && s.change.push(c) : s.add.push(c);
|
|
2021
2021
|
}
|
|
2022
2022
|
(0 < s.del.length || 0 < s.add.length || 0 < s.change.length) && r.change.push(s);
|
|
@@ -2043,8 +2043,8 @@ var Rr = { exports: {} };
|
|
|
2043
2043
|
function Gt(e, t, n) {
|
|
2044
2044
|
var r = {};
|
|
2045
2045
|
return wt(t.objectStoreNames, 0).forEach(function(i) {
|
|
2046
|
-
for (var a = n.objectStore(i), s = mn(gr(
|
|
2047
|
-
var b = a.index(a.indexNames[h]),
|
|
2046
|
+
for (var a = n.objectStore(i), s = mn(gr(f = a.keyPath), f || "", !0, !1, !!a.autoIncrement, f && typeof f != "string", !0), u = [], h = 0; h < a.indexNames.length; ++h) {
|
|
2047
|
+
var b = a.index(a.indexNames[h]), f = b.keyPath, b = mn(b.name, f, !!b.unique, !!b.multiEntry, !1, f && typeof f != "string", !1);
|
|
2048
2048
|
u.push(b);
|
|
2049
2049
|
}
|
|
2050
2050
|
r[i] = bn(i, s, u);
|
|
@@ -2055,11 +2055,11 @@ var Rr = { exports: {} };
|
|
|
2055
2055
|
var a = r[i], s = n.objectStore(a);
|
|
2056
2056
|
e._hasGetAll = "getAll" in s;
|
|
2057
2057
|
for (var u = 0; u < s.indexNames.length; ++u) {
|
|
2058
|
-
var h = s.indexNames[u],
|
|
2059
|
-
!t[a] || (
|
|
2058
|
+
var h = s.indexNames[u], f = s.index(h).keyPath, b = typeof f == "string" ? f : "[" + wt(f).join("+") + "]";
|
|
2059
|
+
!t[a] || (f = t[a].idxByName[b]) && (f.name = h, delete t[a].idxByName[b], t[a].idxByName[h] = f);
|
|
2060
2060
|
}
|
|
2061
2061
|
}
|
|
2062
|
-
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) &&
|
|
2062
|
+
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && M.WorkerGlobalScope && M instanceof M.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
|
|
2063
2063
|
}
|
|
2064
2064
|
function br(e) {
|
|
2065
2065
|
return e.split(",").map(function(t, n) {
|
|
@@ -2102,7 +2102,7 @@ var Rr = { exports: {} };
|
|
|
2102
2102
|
}
|
|
2103
2103
|
function xn(e) {
|
|
2104
2104
|
return Pe(function() {
|
|
2105
|
-
return
|
|
2105
|
+
return B.letThrough = !0, e();
|
|
2106
2106
|
});
|
|
2107
2107
|
}
|
|
2108
2108
|
function kn(e) {
|
|
@@ -2175,7 +2175,7 @@ var Rr = { exports: {} };
|
|
|
2175
2175
|
}
|
|
2176
2176
|
function vr(e) {
|
|
2177
2177
|
var t, n, r = (((t = e.r) === null || t === void 0 ? void 0 : t.d) || 0) - (((n = e.l) === null || n === void 0 ? void 0 : n.d) || 0), i = 1 < r ? "r" : r < -1 ? "l" : "";
|
|
2178
|
-
i && (t = i == "r" ? "l" : "r", n =
|
|
2178
|
+
i && (t = i == "r" ? "l" : "r", n = y({}, e), r = e[i], e.from = r.from, e.to = r.to, e[i] = r[i], n[i] = r[t], (e[t] = n).d = wr(n)), e.d = wr(e);
|
|
2179
2179
|
}
|
|
2180
2180
|
function wr(n) {
|
|
2181
2181
|
var t = n.r, n = n.l;
|
|
@@ -2231,18 +2231,18 @@ var Rr = { exports: {} };
|
|
|
2231
2231
|
}
|
|
2232
2232
|
function _r(e, t, n, r) {
|
|
2233
2233
|
for (var i = [], a = 0, s = Object.entries(e.queries.query); a < s.length; a++) {
|
|
2234
|
-
for (var u = s[a], h = u[0],
|
|
2235
|
-
var
|
|
2236
|
-
Dn(t,
|
|
2234
|
+
for (var u = s[a], h = u[0], f = [], b = 0, c = u[1]; b < c.length; b++) {
|
|
2235
|
+
var d = c[b];
|
|
2236
|
+
Dn(t, d.obsSet) ? d.subscribers.forEach(function(g) {
|
|
2237
2237
|
return n.add(g);
|
|
2238
|
-
}) : r &&
|
|
2238
|
+
}) : r && f.push(d);
|
|
2239
2239
|
}
|
|
2240
|
-
r && i.push([h,
|
|
2240
|
+
r && i.push([h, f]);
|
|
2241
2241
|
}
|
|
2242
2242
|
if (r)
|
|
2243
|
-
for (var p = 0,
|
|
2244
|
-
var w =
|
|
2245
|
-
e.queries.query[h] =
|
|
2243
|
+
for (var p = 0, m = i; p < m.length; p++) {
|
|
2244
|
+
var w = m[p], h = w[0], f = w[1];
|
|
2245
|
+
e.queries.query[h] = f;
|
|
2246
2246
|
}
|
|
2247
2247
|
}
|
|
2248
2248
|
function pi(e) {
|
|
@@ -2258,16 +2258,16 @@ var Rr = { exports: {} };
|
|
|
2258
2258
|
throw new L.DatabaseClosed("db.open() was cancelled");
|
|
2259
2259
|
}
|
|
2260
2260
|
function u() {
|
|
2261
|
-
return new T(function(
|
|
2261
|
+
return new T(function(d, p) {
|
|
2262
2262
|
if (s(), !n)
|
|
2263
2263
|
throw new L.MissingAPI();
|
|
2264
|
-
var
|
|
2264
|
+
var m = e.name, w = t.autoSchema || !i ? n.open(m) : n.open(m, i);
|
|
2265
2265
|
if (!w)
|
|
2266
2266
|
throw new L.MissingAPI();
|
|
2267
2267
|
w.onerror = ye(p), w.onblocked = J(e._fireOnBlocked), w.onupgradeneeded = J(function(g) {
|
|
2268
2268
|
var _;
|
|
2269
|
-
b = w.transaction, t.autoSchema && !e._options.allowEmptyDB ? (w.onerror = ht, b.abort(), w.result.close(), (_ = n.deleteDatabase(
|
|
2270
|
-
p(new L.NoSuchDatabase("Database ".concat(
|
|
2269
|
+
b = w.transaction, t.autoSchema && !e._options.allowEmptyDB ? (w.onerror = ht, b.abort(), w.result.close(), (_ = n.deleteDatabase(m)).onsuccess = _.onerror = J(function() {
|
|
2270
|
+
p(new L.NoSuchDatabase("Database ".concat(m, " doesnt exist")));
|
|
2271
2271
|
})) : (b.onerror = ye(p), g = g.oldVersion > Math.pow(2, 62) ? 0 : g.oldVersion, c = g < 1, e.idbdb = w.result, a && di(e, b), fi(e, g / 10, b, p));
|
|
2272
2272
|
}, p), w.onsuccess = J(function() {
|
|
2273
2273
|
b = null;
|
|
@@ -2280,7 +2280,7 @@ var Rr = { exports: {} };
|
|
|
2280
2280
|
else if (Lt(e, e._dbSchema, A), ((O = _n(Gt(0, (O = e).idbdb, A), O._dbSchema)).add.length || O.change.some(function(R) {
|
|
2281
2281
|
return R.add.length || R.change.length;
|
|
2282
2282
|
})) && !a)
|
|
2283
|
-
return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), k.close(), i = k.version + 1, a = !0,
|
|
2283
|
+
return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), k.close(), i = k.version + 1, a = !0, d(u());
|
|
2284
2284
|
Kt(e, A);
|
|
2285
2285
|
} catch {
|
|
2286
2286
|
}
|
|
@@ -2288,10 +2288,10 @@ var Rr = { exports: {} };
|
|
|
2288
2288
|
t.vcFired = !0, e.on("versionchange").fire(R);
|
|
2289
2289
|
}), k.onclose = J(function(R) {
|
|
2290
2290
|
e.on("close").fire(R);
|
|
2291
|
-
}), c && (O = e._deps, A =
|
|
2291
|
+
}), c && (O = e._deps, A = m, k = O.indexedDB, O = O.IDBKeyRange, On(k) || A === Ct || En(k, O).put({ name: A }).catch(H)), d();
|
|
2292
2292
|
}, p);
|
|
2293
|
-
}).catch(function(
|
|
2294
|
-
switch (
|
|
2293
|
+
}).catch(function(d) {
|
|
2294
|
+
switch (d == null ? void 0 : d.name) {
|
|
2295
2295
|
case "UnknownError":
|
|
2296
2296
|
if (0 < t.PR1398_maxLoop)
|
|
2297
2297
|
return t.PR1398_maxLoop--, console.warn("Dexie: Workaround for Chrome UnknownError on open()"), u();
|
|
@@ -2300,13 +2300,13 @@ var Rr = { exports: {} };
|
|
|
2300
2300
|
if (0 < i)
|
|
2301
2301
|
return i = 0, u();
|
|
2302
2302
|
}
|
|
2303
|
-
return T.reject(
|
|
2303
|
+
return T.reject(d);
|
|
2304
2304
|
});
|
|
2305
2305
|
}
|
|
2306
|
-
var h,
|
|
2307
|
-
return T.race([r, (typeof navigator > "u" ? T.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(
|
|
2306
|
+
var h, f = t.dbReadyResolve, b = null, c = !1;
|
|
2307
|
+
return T.race([r, (typeof navigator > "u" ? T.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(d) {
|
|
2308
2308
|
function p() {
|
|
2309
|
-
return indexedDB.databases().finally(
|
|
2309
|
+
return indexedDB.databases().finally(d);
|
|
2310
2310
|
}
|
|
2311
2311
|
h = setInterval(p, 100), p();
|
|
2312
2312
|
}).finally(function() {
|
|
@@ -2314,32 +2314,32 @@ var Rr = { exports: {} };
|
|
|
2314
2314
|
}) : Promise.resolve()).then(u)]).then(function() {
|
|
2315
2315
|
return s(), t.onReadyBeingFired = [], T.resolve(xn(function() {
|
|
2316
2316
|
return e.on.ready.fire(e.vip);
|
|
2317
|
-
})).then(function
|
|
2317
|
+
})).then(function d() {
|
|
2318
2318
|
if (0 < t.onReadyBeingFired.length) {
|
|
2319
2319
|
var p = t.onReadyBeingFired.reduce(tn, H);
|
|
2320
2320
|
return t.onReadyBeingFired = [], T.resolve(xn(function() {
|
|
2321
2321
|
return p(e.vip);
|
|
2322
|
-
})).then(
|
|
2322
|
+
})).then(d);
|
|
2323
2323
|
}
|
|
2324
2324
|
});
|
|
2325
2325
|
}).finally(function() {
|
|
2326
2326
|
t.openCanceller === r && (t.onReadyBeingFired = null, t.isBeingOpened = !1);
|
|
2327
|
-
}).catch(function(
|
|
2328
|
-
t.dbOpenError =
|
|
2327
|
+
}).catch(function(d) {
|
|
2328
|
+
t.dbOpenError = d;
|
|
2329
2329
|
try {
|
|
2330
2330
|
b && b.abort();
|
|
2331
2331
|
} catch {
|
|
2332
2332
|
}
|
|
2333
|
-
return r === t.openCanceller && e._close(), q(
|
|
2333
|
+
return r === t.openCanceller && e._close(), q(d);
|
|
2334
2334
|
}).finally(function() {
|
|
2335
|
-
t.openComplete = !0,
|
|
2335
|
+
t.openComplete = !0, f();
|
|
2336
2336
|
}).then(function() {
|
|
2337
|
-
var
|
|
2338
|
-
return c && (
|
|
2339
|
-
p.schema.indexes.forEach(function(
|
|
2340
|
-
|
|
2341
|
-
}),
|
|
2342
|
-
}), Te(pt).fire(
|
|
2337
|
+
var d;
|
|
2338
|
+
return c && (d = {}, e.tables.forEach(function(p) {
|
|
2339
|
+
p.schema.indexes.forEach(function(m) {
|
|
2340
|
+
m.name && (d["idb://".concat(e.name, "/").concat(p.name, "/").concat(m.name)] = new oe(-1 / 0, [[[]]]));
|
|
2341
|
+
}), d["idb://".concat(e.name, "/").concat(p.name, "/")] = d["idb://".concat(e.name, "/").concat(p.name, "/:dels")] = new oe(-1 / 0, [[[]]]);
|
|
2342
|
+
}), Te(pt).fire(d), Cn(d, !0)), e;
|
|
2343
2343
|
});
|
|
2344
2344
|
}
|
|
2345
2345
|
function Rn(e) {
|
|
@@ -2363,32 +2363,32 @@ var Rr = { exports: {} };
|
|
|
2363
2363
|
return r;
|
|
2364
2364
|
}
|
|
2365
2365
|
var gi = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2366
|
-
return
|
|
2366
|
+
return y(y({}, e), { table: function(t) {
|
|
2367
2367
|
var n = e.table(t), r = n.schema, i = {}, a = [];
|
|
2368
|
-
function s(c,
|
|
2369
|
-
var
|
|
2370
|
-
return w.push(_), _.isPrimaryKey || a.push(_), 1 < g && s(g === 2 ? c[0] : c.slice(0, g - 1),
|
|
2368
|
+
function s(c, d, p) {
|
|
2369
|
+
var m = yt(c), w = i[m] = i[m] || [], g = c == null ? 0 : typeof c == "string" ? 1 : c.length, _ = 0 < d, _ = y(y({}, p), { name: _ ? "".concat(m, "(virtual-from:").concat(p.name, ")") : p.name, lowLevelIndex: p, isVirtual: _, keyTail: d, keyLength: g, extractKey: vn(c), unique: !_ && p.unique });
|
|
2370
|
+
return w.push(_), _.isPrimaryKey || a.push(_), 1 < g && s(g === 2 ? c[0] : c.slice(0, g - 1), d + 1, p), w.sort(function(S, E) {
|
|
2371
2371
|
return S.keyTail - E.keyTail;
|
|
2372
2372
|
}), _;
|
|
2373
2373
|
}
|
|
2374
2374
|
t = s(r.primaryKey.keyPath, 0, r.primaryKey), i[":id"] = [t];
|
|
2375
2375
|
for (var u = 0, h = r.indexes; u < h.length; u++) {
|
|
2376
|
-
var
|
|
2377
|
-
s(
|
|
2376
|
+
var f = h[u];
|
|
2377
|
+
s(f.keyPath, 0, f);
|
|
2378
2378
|
}
|
|
2379
2379
|
function b(c) {
|
|
2380
|
-
var
|
|
2381
|
-
return p.isVirtual ?
|
|
2380
|
+
var d, p = c.query.index;
|
|
2381
|
+
return p.isVirtual ? y(y({}, c), { query: { index: p.lowLevelIndex, range: (d = c.query.range, p = p.keyTail, { type: d.type === 1 ? 2 : d.type, lower: $t(d.lower, d.lowerOpen ? e.MAX_KEY : e.MIN_KEY, p), lowerOpen: !0, upper: $t(d.upper, d.upperOpen ? e.MIN_KEY : e.MAX_KEY, p), upperOpen: !0 }) } }) : c;
|
|
2382
2382
|
}
|
|
2383
|
-
return
|
|
2383
|
+
return y(y({}, n), { schema: y(y({}, r), { primaryKey: t, indexes: a, getIndexByKeyPath: function(c) {
|
|
2384
2384
|
return (c = i[yt(c)]) && c[0];
|
|
2385
2385
|
} }), count: function(c) {
|
|
2386
2386
|
return n.count(b(c));
|
|
2387
2387
|
}, query: function(c) {
|
|
2388
2388
|
return n.query(b(c));
|
|
2389
2389
|
}, openCursor: function(c) {
|
|
2390
|
-
var
|
|
2391
|
-
return
|
|
2390
|
+
var d = c.query.index, p = d.keyTail, m = d.isVirtual, w = d.keyLength;
|
|
2391
|
+
return m ? n.openCursor(b(c)).then(function(_) {
|
|
2392
2392
|
return _ && g(_);
|
|
2393
2393
|
}) : n.openCursor(c);
|
|
2394
2394
|
function g(_) {
|
|
@@ -2420,10 +2420,10 @@ var Rr = { exports: {} };
|
|
|
2420
2420
|
return t.type === "delete" ? t.keys : t.keys || t.values.map(e.extractKey);
|
|
2421
2421
|
}
|
|
2422
2422
|
var yi = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
2423
|
-
return
|
|
2423
|
+
return y(y({}, e), { table: function(t) {
|
|
2424
2424
|
var n = e.table(t), r = n.schema.primaryKey;
|
|
2425
|
-
return
|
|
2426
|
-
var a =
|
|
2425
|
+
return y(y({}, n), { mutate: function(i) {
|
|
2426
|
+
var a = B.trans, s = a.table(t).hook, u = s.deleting, h = s.creating, f = s.updating;
|
|
2427
2427
|
switch (i.type) {
|
|
2428
2428
|
case "add":
|
|
2429
2429
|
if (h.fire === H)
|
|
@@ -2432,7 +2432,7 @@ var Rr = { exports: {} };
|
|
|
2432
2432
|
return b(i);
|
|
2433
2433
|
}, !0);
|
|
2434
2434
|
case "put":
|
|
2435
|
-
if (h.fire === H &&
|
|
2435
|
+
if (h.fire === H && f.fire === H)
|
|
2436
2436
|
break;
|
|
2437
2437
|
return a._promise("readwrite", function() {
|
|
2438
2438
|
return b(i);
|
|
@@ -2447,11 +2447,11 @@ var Rr = { exports: {} };
|
|
|
2447
2447
|
if (u.fire === H)
|
|
2448
2448
|
break;
|
|
2449
2449
|
return a._promise("readwrite", function() {
|
|
2450
|
-
return function c(
|
|
2451
|
-
return n.query({ trans:
|
|
2450
|
+
return function c(d, p, m) {
|
|
2451
|
+
return n.query({ trans: d, values: !1, query: { index: r, range: p }, limit: m }).then(function(w) {
|
|
2452
2452
|
var g = w.result;
|
|
2453
|
-
return b({ type: "delete", keys: g, trans:
|
|
2454
|
-
return 0 < _.numFailures ? Promise.reject(_.failures[0]) : g.length <
|
|
2453
|
+
return b({ type: "delete", keys: g, trans: d }).then(function(_) {
|
|
2454
|
+
return 0 < _.numFailures ? Promise.reject(_.failures[0]) : g.length < m ? { failures: [], numFailures: 0, lastResult: void 0 } : c(d, y(y({}, p), { lower: g[g.length - 1], lowerOpen: !0 }), m);
|
|
2455
2455
|
});
|
|
2456
2456
|
});
|
|
2457
2457
|
}(i.trans, i.range, 1e4);
|
|
@@ -2459,13 +2459,13 @@ var Rr = { exports: {} };
|
|
|
2459
2459
|
}
|
|
2460
2460
|
return n.mutate(i);
|
|
2461
2461
|
function b(c) {
|
|
2462
|
-
var
|
|
2462
|
+
var d, p, m, w = B.trans, g = c.keys || jn(r, c);
|
|
2463
2463
|
if (!g)
|
|
2464
2464
|
throw new Error("Keys missing");
|
|
2465
|
-
return (c = c.type === "add" || c.type === "put" ?
|
|
2465
|
+
return (c = c.type === "add" || c.type === "put" ? y(y({}, c), { keys: g }) : y({}, c)).type !== "delete" && (c.values = P([], c.values, !0)), c.keys && (c.keys = P([], c.keys, !0)), d = n, m = g, ((p = c).type === "add" ? Promise.resolve([]) : d.getMany({ trans: p.trans, keys: m, cache: "immutable" })).then(function(_) {
|
|
2466
2466
|
var S = g.map(function(E, O) {
|
|
2467
2467
|
var k, C, A, R = _[O], D = { onerror: null, onsuccess: null };
|
|
2468
|
-
return c.type === "delete" ? u.fire.call(D, E, R, w) : c.type === "add" || R === void 0 ? (k = h.fire.call(D, E, c.values[O], w), E == null && k != null && (c.keys[O] = E = k, r.outbound || fe(c.values[O], r.keyPath, E))) : (k = Tn(R, c.values[O]), (C =
|
|
2468
|
+
return c.type === "delete" ? u.fire.call(D, E, R, w) : c.type === "add" || R === void 0 ? (k = h.fire.call(D, E, c.values[O], w), E == null && k != null && (c.keys[O] = E = k, r.outbound || fe(c.values[O], r.keyPath, E))) : (k = Tn(R, c.values[O]), (C = f.fire.call(D, k, E, R, w)) && (A = c.values[O], Object.keys(C).forEach(function(G) {
|
|
2469
2469
|
ie(A, G) ? A[G] = C[G] : fe(A, G, C[G]);
|
|
2470
2470
|
}))), D;
|
|
2471
2471
|
});
|
|
@@ -2499,7 +2499,7 @@ var Rr = { exports: {} };
|
|
|
2499
2499
|
var mi = { stack: "dbcore", level: -1, create: function(e) {
|
|
2500
2500
|
return { table: function(t) {
|
|
2501
2501
|
var n = e.table(t);
|
|
2502
|
-
return
|
|
2502
|
+
return y(y({}, n), { getMany: function(r) {
|
|
2503
2503
|
if (!r.cache)
|
|
2504
2504
|
return n.getMany(r);
|
|
2505
2505
|
var i = Sr(r.keys, r.trans._cache, r.cache === "clone");
|
|
@@ -2527,24 +2527,24 @@ var Rr = { exports: {} };
|
|
|
2527
2527
|
}
|
|
2528
2528
|
var bi = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2529
2529
|
var t = e.schema.name, n = new oe(e.MIN_KEY, e.MAX_KEY);
|
|
2530
|
-
return
|
|
2531
|
-
if (
|
|
2532
|
-
throw new L.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(
|
|
2530
|
+
return y(y({}, e), { transaction: function(r, i, a) {
|
|
2531
|
+
if (B.subscr && i !== "readonly")
|
|
2532
|
+
throw new L.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(B.querier));
|
|
2533
2533
|
return e.transaction(r, i, a);
|
|
2534
2534
|
}, table: function(r) {
|
|
2535
2535
|
function i(p) {
|
|
2536
|
-
var p = (
|
|
2537
|
-
return [p, new oe((p =
|
|
2536
|
+
var p = (m = p.query).index, m = m.range;
|
|
2537
|
+
return [p, new oe((p = m.lower) !== null && p !== void 0 ? p : e.MIN_KEY, (m = m.upper) !== null && m !== void 0 ? m : e.MAX_KEY)];
|
|
2538
2538
|
}
|
|
2539
|
-
var a = e.table(r), s = a.schema, u = s.primaryKey, h = u.extractKey,
|
|
2539
|
+
var a = e.table(r), s = a.schema, u = s.primaryKey, h = u.extractKey, f = u.outbound, b = y(y({}, a), { mutate: function(d) {
|
|
2540
2540
|
function p(D) {
|
|
2541
2541
|
return D = "idb://".concat(t, "/").concat(r, "/").concat(D), S[D] || (S[D] = new oe());
|
|
2542
2542
|
}
|
|
2543
|
-
var
|
|
2543
|
+
var m, w, g, _ = d.trans, S = d.mutatedParts || (d.mutatedParts = {}), E = p(""), O = p(":dels"), k = d.type, R = d.type === "deleteRange" ? [d.range] : d.type === "delete" ? [d.keys] : d.values.length < 50 ? [jn(u, d).filter(function(D) {
|
|
2544
2544
|
return D;
|
|
2545
|
-
}),
|
|
2546
|
-
return N(C) ? (E.addKeys(C), (R = k === "delete" || C.length === A.length ? Sr(C, R) : null) || O.addKeys(C), (R || A) && (
|
|
2547
|
-
var G =
|
|
2545
|
+
}), d.values] : [], C = R[0], A = R[1], R = d.trans._cache;
|
|
2546
|
+
return N(C) ? (E.addKeys(C), (R = k === "delete" || C.length === A.length ? Sr(C, R) : null) || O.addKeys(C), (R || A) && (m = p, w = R, g = A, s.indexes.forEach(function(D) {
|
|
2547
|
+
var G = m(D.name || "");
|
|
2548
2548
|
function F(W) {
|
|
2549
2549
|
return W != null ? D.extractKey(W) : null;
|
|
2550
2550
|
}
|
|
@@ -2559,33 +2559,33 @@ var Rr = { exports: {} };
|
|
|
2559
2559
|
});
|
|
2560
2560
|
}))) : C ? (A = { from: C.lower, to: C.upper }, O.add(A), E.add(A)) : (E.add(n), O.add(n), s.indexes.forEach(function(D) {
|
|
2561
2561
|
return p(D.name).add(n);
|
|
2562
|
-
})), a.mutate(
|
|
2563
|
-
return !C ||
|
|
2562
|
+
})), a.mutate(d).then(function(D) {
|
|
2563
|
+
return !C || d.type !== "add" && d.type !== "put" || E.addKeys(D.results), _.mutatedParts = Wt(_.mutatedParts || {}, S), D;
|
|
2564
2564
|
});
|
|
2565
|
-
} }), c = { get: function(
|
|
2566
|
-
return [u, new oe(
|
|
2567
|
-
}, getMany: function(
|
|
2568
|
-
return [u, new oe().addKeys(
|
|
2565
|
+
} }), c = { get: function(d) {
|
|
2566
|
+
return [u, new oe(d.key)];
|
|
2567
|
+
}, getMany: function(d) {
|
|
2568
|
+
return [u, new oe().addKeys(d.keys)];
|
|
2569
2569
|
}, count: i, query: i, openCursor: i };
|
|
2570
|
-
return j(c).forEach(function(
|
|
2571
|
-
b[
|
|
2572
|
-
var
|
|
2570
|
+
return j(c).forEach(function(d) {
|
|
2571
|
+
b[d] = function(p) {
|
|
2572
|
+
var m = B.subscr, w = !!m, g = Er(B, a) && Or(d, p) ? p.obsSet = {} : m;
|
|
2573
2573
|
if (w) {
|
|
2574
2574
|
var _ = function(A) {
|
|
2575
2575
|
return A = "idb://".concat(t, "/").concat(r, "/").concat(A), g[A] || (g[A] = new oe());
|
|
2576
|
-
}, S = _(""), E = _(":dels"),
|
|
2577
|
-
if ((
|
|
2578
|
-
if (
|
|
2579
|
-
var O =
|
|
2580
|
-
return a[
|
|
2581
|
-
if (
|
|
2582
|
-
if (
|
|
2576
|
+
}, S = _(""), E = _(":dels"), m = c[d](p), w = m[0], m = m[1];
|
|
2577
|
+
if ((d === "query" && w.isPrimaryKey && !p.values ? E : _(w.name || "")).add(m), !w.isPrimaryKey) {
|
|
2578
|
+
if (d !== "count") {
|
|
2579
|
+
var O = d === "query" && f && p.values && a.query(y(y({}, p), { values: !1 }));
|
|
2580
|
+
return a[d].apply(this, arguments).then(function(A) {
|
|
2581
|
+
if (d === "query") {
|
|
2582
|
+
if (f && p.values)
|
|
2583
2583
|
return O.then(function(F) {
|
|
2584
2584
|
return F = F.result, S.addKeys(F), A;
|
|
2585
2585
|
});
|
|
2586
2586
|
var R = p.values ? A.result.map(h) : A.result;
|
|
2587
2587
|
(p.values ? S : E).addKeys(R);
|
|
2588
|
-
} else if (
|
|
2588
|
+
} else if (d === "openCursor") {
|
|
2589
2589
|
var D = A, G = p.values;
|
|
2590
2590
|
return D && Object.create(D, { key: { get: function() {
|
|
2591
2591
|
return E.addKey(D.primaryKey), D.key;
|
|
@@ -2602,7 +2602,7 @@ var Rr = { exports: {} };
|
|
|
2602
2602
|
E.add(n);
|
|
2603
2603
|
}
|
|
2604
2604
|
}
|
|
2605
|
-
return a[
|
|
2605
|
+
return a[d].apply(this, arguments);
|
|
2606
2606
|
};
|
|
2607
2607
|
}), b;
|
|
2608
2608
|
} });
|
|
@@ -2613,7 +2613,7 @@ var Rr = { exports: {} };
|
|
|
2613
2613
|
if (t.type === "deleteRange")
|
|
2614
2614
|
return null;
|
|
2615
2615
|
var r = t.keys ? t.keys.length : "values" in t && t.values ? t.values.length : 1;
|
|
2616
|
-
return n.numFailures === r ? null : (t =
|
|
2616
|
+
return n.numFailures === r ? null : (t = y({}, t), N(t.keys) && (t.keys = t.keys.filter(function(i, a) {
|
|
2617
2617
|
return !(a in n.failures);
|
|
2618
2618
|
})), "values" in t && N(t.values) && (t.values = t.values.filter(function(i, a) {
|
|
2619
2619
|
return !(a in n.failures);
|
|
@@ -2623,49 +2623,49 @@ var Rr = { exports: {} };
|
|
|
2623
2623
|
return n = e, ((r = t).lower === void 0 || (r.lowerOpen ? 0 < $(n, r.lower) : 0 <= $(n, r.lower))) && (e = e, (t = t).upper === void 0 || (t.upperOpen ? $(e, t.upper) < 0 : $(e, t.upper) <= 0));
|
|
2624
2624
|
var n, r;
|
|
2625
2625
|
}
|
|
2626
|
-
function kr(e, t,
|
|
2627
|
-
if (!
|
|
2626
|
+
function kr(e, t, d, r, i, a) {
|
|
2627
|
+
if (!d || d.length === 0)
|
|
2628
2628
|
return e;
|
|
2629
|
-
var s = t.query.index, u = s.multiEntry, h = t.query.range,
|
|
2630
|
-
var w = p, g =
|
|
2629
|
+
var s = t.query.index, u = s.multiEntry, h = t.query.range, f = r.schema.primaryKey.extractKey, b = s.extractKey, c = (s.lowLevelIndex || s).extractKey, d = d.reduce(function(p, m) {
|
|
2630
|
+
var w = p, g = m.type === "add" || m.type === "put" ? m.values.filter(function(O) {
|
|
2631
2631
|
return O = b(O), u && N(O) ? O.some(function(k) {
|
|
2632
2632
|
return Mn(k, h);
|
|
2633
2633
|
}) : Mn(O, h);
|
|
2634
2634
|
}).map(function(O) {
|
|
2635
2635
|
return O = Ae(O), a && Object.freeze(O), O;
|
|
2636
2636
|
}) : [];
|
|
2637
|
-
switch (
|
|
2637
|
+
switch (m.type) {
|
|
2638
2638
|
case "add":
|
|
2639
2639
|
w = p.concat(t.values ? g : g.map(function(k) {
|
|
2640
|
-
return
|
|
2640
|
+
return f(k);
|
|
2641
2641
|
}));
|
|
2642
2642
|
break;
|
|
2643
2643
|
case "put":
|
|
2644
|
-
var _ = new oe().addKeys(
|
|
2645
|
-
return
|
|
2644
|
+
var _ = new oe().addKeys(m.values.map(function(k) {
|
|
2645
|
+
return f(k);
|
|
2646
2646
|
})), w = p.filter(function(k) {
|
|
2647
|
-
return k = t.values ?
|
|
2647
|
+
return k = t.values ? f(k) : k, !Ut(new oe(k), _);
|
|
2648
2648
|
}).concat(t.values ? g : g.map(function(k) {
|
|
2649
|
-
return
|
|
2649
|
+
return f(k);
|
|
2650
2650
|
}));
|
|
2651
2651
|
break;
|
|
2652
2652
|
case "delete":
|
|
2653
|
-
var S = new oe().addKeys(
|
|
2653
|
+
var S = new oe().addKeys(m.keys);
|
|
2654
2654
|
w = p.filter(function(k) {
|
|
2655
|
-
return k = t.values ?
|
|
2655
|
+
return k = t.values ? f(k) : k, !Ut(new oe(k), S);
|
|
2656
2656
|
});
|
|
2657
2657
|
break;
|
|
2658
2658
|
case "deleteRange":
|
|
2659
|
-
var E =
|
|
2659
|
+
var E = m.range;
|
|
2660
2660
|
w = p.filter(function(k) {
|
|
2661
|
-
return !Mn(
|
|
2661
|
+
return !Mn(f(k), E);
|
|
2662
2662
|
});
|
|
2663
2663
|
}
|
|
2664
2664
|
return w;
|
|
2665
2665
|
}, e);
|
|
2666
|
-
return
|
|
2667
|
-
return $(c(p), c(
|
|
2668
|
-
}), t.limit && t.limit < 1 / 0 && (
|
|
2666
|
+
return d === e ? e : (d.sort(function(p, m) {
|
|
2667
|
+
return $(c(p), c(m)) || $(f(p), f(m));
|
|
2668
|
+
}), t.limit && t.limit < 1 / 0 && (d.length > t.limit ? d.length = t.limit : e.length === t.limit && d.length < t.limit && (i.dirty = !0)), a ? Object.freeze(d) : d);
|
|
2669
2669
|
}
|
|
2670
2670
|
function Ar(e, t) {
|
|
2671
2671
|
return $(e.lower, t.lower) === 0 && $(e.upper, t.upper) === 0 && !!e.lowerOpen == !!t.lowerOpen && !!e.upperOpen == !!t.upperOpen;
|
|
@@ -2711,22 +2711,22 @@ var Rr = { exports: {} };
|
|
|
2711
2711
|
}
|
|
2712
2712
|
var _i = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
|
|
2713
2713
|
var t = e.schema.name;
|
|
2714
|
-
return
|
|
2714
|
+
return y(y({}, e), { transaction: function(n, r, i) {
|
|
2715
2715
|
var a, s, u = e.transaction(n, r, i);
|
|
2716
2716
|
return r === "readwrite" && (s = (a = new AbortController()).signal, i = function(h) {
|
|
2717
2717
|
return function() {
|
|
2718
2718
|
if (a.abort(), r === "readwrite") {
|
|
2719
|
-
for (var
|
|
2720
|
-
var
|
|
2719
|
+
for (var f = /* @__PURE__ */ new Set(), b = 0, c = n; b < c.length; b++) {
|
|
2720
|
+
var d = c[b], p = Ue["idb://".concat(t, "/").concat(d)];
|
|
2721
2721
|
if (p) {
|
|
2722
|
-
var
|
|
2722
|
+
var m = e.table(d), w = p.optimisticOps.filter(function(F) {
|
|
2723
2723
|
return F.trans === u;
|
|
2724
2724
|
});
|
|
2725
2725
|
if (u._explicit && h && u.mutatedParts)
|
|
2726
2726
|
for (var g = 0, _ = Object.values(p.queries.query); g < _.length; g++)
|
|
2727
2727
|
for (var S = 0, E = (C = _[g]).slice(); S < E.length; S++)
|
|
2728
2728
|
Dn((A = E[S]).obsSet, u.mutatedParts) && (Me(C, A), A.subscribers.forEach(function(F) {
|
|
2729
|
-
return
|
|
2729
|
+
return f.add(F);
|
|
2730
2730
|
}));
|
|
2731
2731
|
else if (0 < w.length) {
|
|
2732
2732
|
p.optimisticOps = p.optimisticOps.filter(function(F) {
|
|
@@ -2734,15 +2734,15 @@ var Rr = { exports: {} };
|
|
|
2734
2734
|
});
|
|
2735
2735
|
for (var O = 0, k = Object.values(p.queries.query); O < k.length; O++)
|
|
2736
2736
|
for (var C, A, R, D = 0, G = (C = k[O]).slice(); D < G.length; D++)
|
|
2737
|
-
(A = G[D]).res != null && u.mutatedParts && (h && !A.dirty ? (R = Object.isFrozen(A.res), R = kr(A.res, A.req, w,
|
|
2738
|
-
return
|
|
2737
|
+
(A = G[D]).res != null && u.mutatedParts && (h && !A.dirty ? (R = Object.isFrozen(A.res), R = kr(A.res, A.req, w, m, A, R), A.dirty ? (Me(C, A), A.subscribers.forEach(function(F) {
|
|
2738
|
+
return f.add(F);
|
|
2739
2739
|
})) : R !== A.res && (A.res = R, A.promise = T.resolve({ result: R }))) : (A.dirty && Me(C, A), A.subscribers.forEach(function(F) {
|
|
2740
|
-
return
|
|
2740
|
+
return f.add(F);
|
|
2741
2741
|
})));
|
|
2742
2742
|
}
|
|
2743
2743
|
}
|
|
2744
2744
|
}
|
|
2745
|
-
|
|
2745
|
+
f.forEach(function(F) {
|
|
2746
2746
|
return F();
|
|
2747
2747
|
});
|
|
2748
2748
|
}
|
|
@@ -2750,8 +2750,8 @@ var Rr = { exports: {} };
|
|
|
2750
2750
|
}, u.addEventListener("abort", i(!1), { signal: s }), u.addEventListener("error", i(!1), { signal: s }), u.addEventListener("complete", i(!0), { signal: s })), u;
|
|
2751
2751
|
}, table: function(n) {
|
|
2752
2752
|
var r = e.table(n), i = r.schema.primaryKey;
|
|
2753
|
-
return
|
|
2754
|
-
var s =
|
|
2753
|
+
return y(y({}, r), { mutate: function(a) {
|
|
2754
|
+
var s = B.trans;
|
|
2755
2755
|
if (i.outbound || s.db._options.cache === "disabled" || s.explicit)
|
|
2756
2756
|
return r.mutate(a);
|
|
2757
2757
|
var u = Ue["idb://".concat(t, "/").concat(n)];
|
|
@@ -2762,19 +2762,19 @@ var Rr = { exports: {} };
|
|
|
2762
2762
|
}), s.catch(function() {
|
|
2763
2763
|
Me(u.optimisticOps, a), a.mutatedParts && zt(a.mutatedParts);
|
|
2764
2764
|
})) : s.then(function(h) {
|
|
2765
|
-
var
|
|
2766
|
-
var
|
|
2765
|
+
var f = xr(0, y(y({}, a), { values: a.values.map(function(p, c) {
|
|
2766
|
+
var d, p = (d = i.keyPath) !== null && d !== void 0 && d.includes(".") ? Ae(p) : y({}, p);
|
|
2767
2767
|
return fe(p, i.keyPath, h.results[c]), p;
|
|
2768
2768
|
}) }), h);
|
|
2769
|
-
u.optimisticOps.push(
|
|
2769
|
+
u.optimisticOps.push(f), queueMicrotask(function() {
|
|
2770
2770
|
return a.mutatedParts && zt(a.mutatedParts);
|
|
2771
2771
|
});
|
|
2772
2772
|
}), s) : r.mutate(a);
|
|
2773
2773
|
}, query: function(a) {
|
|
2774
|
-
if (!Er(
|
|
2774
|
+
if (!Er(B, r) || !Or("query", a))
|
|
2775
2775
|
return r.query(a);
|
|
2776
|
-
var s = ((
|
|
2777
|
-
var S = Ue["idb://".concat(
|
|
2776
|
+
var s = ((f = B.trans) === null || f === void 0 ? void 0 : f.db._options.cache) === "immutable", c = B, u = c.requery, h = c.signal, f = function(m, w, g, _) {
|
|
2777
|
+
var S = Ue["idb://".concat(m, "/").concat(w)];
|
|
2778
2778
|
if (!S)
|
|
2779
2779
|
return [];
|
|
2780
2780
|
if (!(w = S.queries[g]))
|
|
@@ -2795,20 +2795,20 @@ var Rr = { exports: {} };
|
|
|
2795
2795
|
return Ar(k.req.query.range, _.query.range);
|
|
2796
2796
|
}), [O, !!O, S, E];
|
|
2797
2797
|
}
|
|
2798
|
-
}(t, n, "query", a), b =
|
|
2799
|
-
return b && c ? b.obsSet = a.obsSet : (c = r.query(a).then(function(
|
|
2800
|
-
var w =
|
|
2798
|
+
}(t, n, "query", a), b = f[0], c = f[1], d = f[2], p = f[3];
|
|
2799
|
+
return b && c ? b.obsSet = a.obsSet : (c = r.query(a).then(function(m) {
|
|
2800
|
+
var w = m.result;
|
|
2801
2801
|
if (b && (b.res = w), s) {
|
|
2802
2802
|
for (var g = 0, _ = w.length; g < _; ++g)
|
|
2803
2803
|
Object.freeze(w[g]);
|
|
2804
2804
|
Object.freeze(w);
|
|
2805
2805
|
} else
|
|
2806
|
-
|
|
2807
|
-
return
|
|
2808
|
-
}).catch(function(
|
|
2809
|
-
return p && b && Me(p, b), Promise.reject(
|
|
2810
|
-
}), b = { obsSet: a.obsSet, promise: c, subscribers: /* @__PURE__ */ new Set(), type: "query", req: a, dirty: !1 }, p ? p.push(b) : (p = [b], (
|
|
2811
|
-
return { result: kr(
|
|
2806
|
+
m.result = Ae(w);
|
|
2807
|
+
return m;
|
|
2808
|
+
}).catch(function(m) {
|
|
2809
|
+
return p && b && Me(p, b), Promise.reject(m);
|
|
2810
|
+
}), b = { obsSet: a.obsSet, promise: c, subscribers: /* @__PURE__ */ new Set(), type: "query", req: a, dirty: !1 }, p ? p.push(b) : (p = [b], (d = d || (Ue["idb://".concat(t, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[a.query.index.name || ""] = p)), wi(b, p, u, h), b.promise.then(function(m) {
|
|
2811
|
+
return { result: kr(m.result, a, d == null ? void 0 : d.optimisticOps, r, b, s) };
|
|
2812
2812
|
});
|
|
2813
2813
|
} });
|
|
2814
2814
|
} });
|
|
@@ -2830,7 +2830,7 @@ var Rr = { exports: {} };
|
|
|
2830
2830
|
return n || (n = new this.Version(e), t.push(n), t.sort(li), n.stores({}), this._state.autoSchema = !1, n);
|
|
2831
2831
|
}, ee.prototype._whenReady = function(e) {
|
|
2832
2832
|
var t = this;
|
|
2833
|
-
return this.idbdb && (this._state.openComplete ||
|
|
2833
|
+
return this.idbdb && (this._state.openComplete || B.letThrough || this._vip) ? e() : new T(function(n, r) {
|
|
2834
2834
|
if (t._state.openComplete)
|
|
2835
2835
|
return r(new L.DatabaseClosed(t._state.dbOpenError));
|
|
2836
2836
|
if (!t._state.isBeingOpened) {
|
|
@@ -2881,8 +2881,8 @@ var Rr = { exports: {} };
|
|
|
2881
2881
|
t.close(e);
|
|
2882
2882
|
var u = t._deps.indexedDB.deleteDatabase(t.name);
|
|
2883
2883
|
u.onsuccess = J(function() {
|
|
2884
|
-
var h,
|
|
2885
|
-
h = t._deps,
|
|
2884
|
+
var h, f, b;
|
|
2885
|
+
h = t._deps, f = t.name, b = h.indexedDB, h = h.IDBKeyRange, On(b) || f === Ct || En(b, h).delete(f).catch(H), i();
|
|
2886
2886
|
}), u.onerror = ye(a), u.onblocked = t._fireOnBlocked;
|
|
2887
2887
|
}
|
|
2888
2888
|
if (n)
|
|
@@ -2916,15 +2916,15 @@ var Rr = { exports: {} };
|
|
|
2916
2916
|
}).apply(this, arguments);
|
|
2917
2917
|
return this._transaction.apply(this, e);
|
|
2918
2918
|
}, ee.prototype._transaction = function(e, t, n) {
|
|
2919
|
-
var r = this, i =
|
|
2919
|
+
var r = this, i = B.trans;
|
|
2920
2920
|
i && i.db === this && e.indexOf("!") === -1 || (i = null);
|
|
2921
2921
|
var a, s, u = e.indexOf("?") !== -1;
|
|
2922
2922
|
e = e.replace("!", "").replace("?", "");
|
|
2923
2923
|
try {
|
|
2924
|
-
if (s = t.map(function(
|
|
2925
|
-
if (
|
|
2924
|
+
if (s = t.map(function(f) {
|
|
2925
|
+
if (f = f instanceof r.Table ? f.name : f, typeof f != "string")
|
|
2926
2926
|
throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
|
|
2927
|
-
return
|
|
2927
|
+
return f;
|
|
2928
2928
|
}), e == "r" || e === fn)
|
|
2929
2929
|
a = fn;
|
|
2930
2930
|
else {
|
|
@@ -2938,22 +2938,22 @@ var Rr = { exports: {} };
|
|
|
2938
2938
|
throw new L.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
2939
2939
|
i = null;
|
|
2940
2940
|
}
|
|
2941
|
-
i && s.forEach(function(
|
|
2942
|
-
if (i && i.storeNames.indexOf(
|
|
2941
|
+
i && s.forEach(function(f) {
|
|
2942
|
+
if (i && i.storeNames.indexOf(f) === -1) {
|
|
2943
2943
|
if (!u)
|
|
2944
|
-
throw new L.SubTransaction("Table " +
|
|
2944
|
+
throw new L.SubTransaction("Table " + f + " not included in parent transaction.");
|
|
2945
2945
|
i = null;
|
|
2946
2946
|
}
|
|
2947
2947
|
}), u && i && !i.active && (i = null);
|
|
2948
2948
|
}
|
|
2949
|
-
} catch (
|
|
2949
|
+
} catch (f) {
|
|
2950
2950
|
return i ? i._promise(null, function(b, c) {
|
|
2951
|
-
c(
|
|
2952
|
-
}) : q(
|
|
2951
|
+
c(f);
|
|
2952
|
+
}) : q(f);
|
|
2953
2953
|
}
|
|
2954
|
-
var h = (function
|
|
2954
|
+
var h = (function f(b, c, d, p, m) {
|
|
2955
2955
|
return T.resolve().then(function() {
|
|
2956
|
-
var w =
|
|
2956
|
+
var w = B.transless || B, g = b._createTransaction(c, d, b._dbSchema, p);
|
|
2957
2957
|
if (g.explicit = !0, w = { trans: g, transless: w }, p)
|
|
2958
2958
|
g.idbtrans = p.idbtrans;
|
|
2959
2959
|
else
|
|
@@ -2961,13 +2961,13 @@ var Rr = { exports: {} };
|
|
|
2961
2961
|
g.create(), g.idbtrans._explicit = !0, b._state.PR1398_maxLoop = 3;
|
|
2962
2962
|
} catch (E) {
|
|
2963
2963
|
return E.name === en.InvalidState && b.isOpen() && 0 < --b._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), b.close({ disableAutoOpen: !1 }), b.open().then(function() {
|
|
2964
|
-
return
|
|
2964
|
+
return f(b, c, d, null, m);
|
|
2965
2965
|
})) : q(E);
|
|
2966
2966
|
}
|
|
2967
|
-
var _, S = qt(
|
|
2967
|
+
var _, S = qt(m);
|
|
2968
2968
|
return S && Je(), w = T.follow(function() {
|
|
2969
2969
|
var E;
|
|
2970
|
-
(_ =
|
|
2970
|
+
(_ = m.call(g, g)) && (S ? (E = Ie.bind(null, null), _.then(E, E)) : typeof _.next == "function" && typeof _.throw == "function" && (_ = Rn(_)));
|
|
2971
2971
|
}, w), (_ && typeof _.then == "function" ? T.resolve(_).then(function(E) {
|
|
2972
2972
|
return g.active ? E : q(new L.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
2973
2973
|
}) : w.then(function() {
|
|
@@ -2981,7 +2981,7 @@ var Rr = { exports: {} };
|
|
|
2981
2981
|
});
|
|
2982
2982
|
});
|
|
2983
2983
|
}).bind(null, this, a, s, i, n);
|
|
2984
|
-
return i ? i._promise(a, h, "lock") :
|
|
2984
|
+
return i ? i._promise(a, h, "lock") : B.trans ? Ge(B.transless, function() {
|
|
2985
2985
|
return r._whenReady(h);
|
|
2986
2986
|
}) : this._whenReady(h);
|
|
2987
2987
|
}, ee.prototype.table = function(e) {
|
|
@@ -2993,37 +2993,37 @@ var Rr = { exports: {} };
|
|
|
2993
2993
|
var n = this;
|
|
2994
2994
|
this._middlewares = {}, this.verno = 0;
|
|
2995
2995
|
var r = ee.dependencies;
|
|
2996
|
-
this._options = t =
|
|
2997
|
-
var i, a, s, u, h,
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
}),
|
|
3001
|
-
|
|
3002
|
-
}), this._state =
|
|
3003
|
-
return function(
|
|
2996
|
+
this._options = t = y({ addons: ee.addons, autoOpen: !0, indexedDB: r.indexedDB, IDBKeyRange: r.IDBKeyRange, cache: "cloned" }, t), this._deps = { indexedDB: t.indexedDB, IDBKeyRange: t.IDBKeyRange }, r = t.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
2997
|
+
var i, a, s, u, h, f = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: H, dbReadyPromise: null, cancelOpen: H, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
|
|
2998
|
+
f.dbReadyPromise = new T(function(c) {
|
|
2999
|
+
f.dbReadyResolve = c;
|
|
3000
|
+
}), f.openCanceller = new T(function(c, d) {
|
|
3001
|
+
f.cancelOpen = d;
|
|
3002
|
+
}), this._state = f, this.name = e, this.on = ft(this, "populate", "blocked", "versionchange", "close", { ready: [tn, H] }), this.on.ready.subscribe = Yn(this.on.ready.subscribe, function(c) {
|
|
3003
|
+
return function(d, p) {
|
|
3004
3004
|
ee.vip(function() {
|
|
3005
|
-
var
|
|
3006
|
-
w.openComplete ? (w.dbOpenError || T.resolve().then(
|
|
3007
|
-
|
|
3005
|
+
var m, w = n._state;
|
|
3006
|
+
w.openComplete ? (w.dbOpenError || T.resolve().then(d), p && c(d)) : w.onReadyBeingFired ? (w.onReadyBeingFired.push(d), p && c(d)) : (c(d), m = n, p || c(function g() {
|
|
3007
|
+
m.on.ready.unsubscribe(d), m.on.ready.unsubscribe(g);
|
|
3008
3008
|
}));
|
|
3009
3009
|
});
|
|
3010
3010
|
};
|
|
3011
3011
|
}), this.Collection = (i = this, dt(ri.prototype, function(_, g) {
|
|
3012
3012
|
this.db = i;
|
|
3013
|
-
var p = ar,
|
|
3013
|
+
var p = ar, m = null;
|
|
3014
3014
|
if (g)
|
|
3015
3015
|
try {
|
|
3016
3016
|
p = g();
|
|
3017
3017
|
} catch (S) {
|
|
3018
|
-
|
|
3018
|
+
m = S;
|
|
3019
3019
|
}
|
|
3020
3020
|
var w = _._ctx, g = w.table, _ = g.hook.reading.fire;
|
|
3021
|
-
this._ctx = { table: g, index: w.index, isPrimKey: !w.index || g.schema.primKey.keyPath && w.index === g.schema.primKey.name, range: p, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error:
|
|
3022
|
-
})), this.Table = (a = this, dt(lr.prototype, function(c,
|
|
3023
|
-
this.db = a, this._tx = p, this.name = c, this.schema =
|
|
3024
|
-
})), this.Transaction = (s = this, dt(ai.prototype, function(c,
|
|
3021
|
+
this._ctx = { table: g, index: w.index, isPrimKey: !w.index || g.schema.primKey.keyPath && w.index === g.schema.primKey.name, range: p, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: m, or: w.or, valueMapper: _ !== ot ? _ : null };
|
|
3022
|
+
})), this.Table = (a = this, dt(lr.prototype, function(c, d, p) {
|
|
3023
|
+
this.db = a, this._tx = p, this.name = c, this.schema = d, this.hook = a._allTables[c] ? a._allTables[c].hook : ft(null, { creating: [Qr, H], reading: [Hr, ot], updating: [Xr, H], deleting: [Vr, H] });
|
|
3024
|
+
})), this.Transaction = (s = this, dt(ai.prototype, function(c, d, p, m, w) {
|
|
3025
3025
|
var g = this;
|
|
3026
|
-
this.db = s, this.mode = c, this.storeNames =
|
|
3026
|
+
this.db = s, this.mode = c, this.storeNames = d, this.schema = p, this.chromeTransactionDurability = m, this.idbtrans = null, this.on = ft(this, "complete", "error", "abort"), this.parent = w || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new T(function(_, S) {
|
|
3027
3027
|
g._resolve = _, g._reject = S;
|
|
3028
3028
|
}), this._completion.then(function() {
|
|
3029
3029
|
g.active = !1, g.on.complete.fire();
|
|
@@ -3033,41 +3033,41 @@ var Rr = { exports: {} };
|
|
|
3033
3033
|
});
|
|
3034
3034
|
})), this.Version = (u = this, dt(hi.prototype, function(c) {
|
|
3035
3035
|
this.db = u, this._cfg = { version: c, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
3036
|
-
})), this.WhereClause = (h = this, dt(pr.prototype, function(c,
|
|
3037
|
-
if (this.db = h, this._ctx = { table: c, index:
|
|
3038
|
-
return $(w,
|
|
3039
|
-
}, this._max = function(
|
|
3040
|
-
return 0 < $(
|
|
3041
|
-
}, this._min = function(
|
|
3042
|
-
return $(
|
|
3036
|
+
})), this.WhereClause = (h = this, dt(pr.prototype, function(c, d, p) {
|
|
3037
|
+
if (this.db = h, this._ctx = { table: c, index: d === ":id" ? null : d, or: p }, this._cmp = this._ascending = $, this._descending = function(m, w) {
|
|
3038
|
+
return $(w, m);
|
|
3039
|
+
}, this._max = function(m, w) {
|
|
3040
|
+
return 0 < $(m, w) ? m : w;
|
|
3041
|
+
}, this._min = function(m, w) {
|
|
3042
|
+
return $(m, w) < 0 ? m : w;
|
|
3043
3043
|
}, this._IDBKeyRange = h._deps.IDBKeyRange, !this._IDBKeyRange)
|
|
3044
3044
|
throw new L.MissingAPI();
|
|
3045
3045
|
})), this.on("versionchange", function(c) {
|
|
3046
3046
|
0 < c.newVersion ? console.warn("Another connection wants to upgrade database '".concat(n.name, "'. Closing db now to resume the upgrade.")) : console.warn("Another connection wants to delete database '".concat(n.name, "'. Closing db now to resume the delete request.")), n.close({ disableAutoOpen: !1 });
|
|
3047
3047
|
}), this.on("blocked", function(c) {
|
|
3048
3048
|
!c.newVersion || c.newVersion < c.oldVersion ? console.warn("Dexie.delete('".concat(n.name, "') was blocked")) : console.warn("Upgrade '".concat(n.name, "' blocked by other connection holding version ").concat(c.oldVersion / 10));
|
|
3049
|
-
}), this._maxKey = gt(t.IDBKeyRange), this._createTransaction = function(c,
|
|
3050
|
-
return new n.Transaction(c,
|
|
3049
|
+
}), this._maxKey = gt(t.IDBKeyRange), this._createTransaction = function(c, d, p, m) {
|
|
3050
|
+
return new n.Transaction(c, d, p, n._options.chromeTransactionDurability, m);
|
|
3051
3051
|
}, this._fireOnBlocked = function(c) {
|
|
3052
|
-
n.on("blocked").fire(c), Ze.filter(function(
|
|
3053
|
-
return
|
|
3054
|
-
}).map(function(
|
|
3055
|
-
return
|
|
3052
|
+
n.on("blocked").fire(c), Ze.filter(function(d) {
|
|
3053
|
+
return d.name === n.name && d !== n && !d._state.vcFired;
|
|
3054
|
+
}).map(function(d) {
|
|
3055
|
+
return d.on("versionchange").fire(c);
|
|
3056
3056
|
});
|
|
3057
3057
|
}, this.use(mi), this.use(_i), this.use(bi), this.use(gi), this.use(yi);
|
|
3058
|
-
var b = new Proxy(this, { get: function(c,
|
|
3059
|
-
if (
|
|
3058
|
+
var b = new Proxy(this, { get: function(c, d, p) {
|
|
3059
|
+
if (d === "_vip")
|
|
3060
3060
|
return !0;
|
|
3061
|
-
if (
|
|
3061
|
+
if (d === "table")
|
|
3062
3062
|
return function(w) {
|
|
3063
3063
|
return Yt(n.table(w), b);
|
|
3064
3064
|
};
|
|
3065
|
-
var
|
|
3066
|
-
return
|
|
3065
|
+
var m = Reflect.get(c, d, p);
|
|
3066
|
+
return m instanceof lr ? Yt(m, b) : d === "tables" ? m.map(function(w) {
|
|
3067
3067
|
return Yt(w, b);
|
|
3068
|
-
}) :
|
|
3069
|
-
return Yt(
|
|
3070
|
-
} :
|
|
3068
|
+
}) : d === "_createTransaction" ? function() {
|
|
3069
|
+
return Yt(m.apply(this, arguments), b);
|
|
3070
|
+
} : m;
|
|
3071
3071
|
} });
|
|
3072
3072
|
this.vip = b, r.forEach(function(c) {
|
|
3073
3073
|
return c(n);
|
|
@@ -3082,23 +3082,23 @@ var Rr = { exports: {} };
|
|
|
3082
3082
|
this._subscribe = e;
|
|
3083
3083
|
}
|
|
3084
3084
|
try {
|
|
3085
|
-
Ht = { indexedDB:
|
|
3085
|
+
Ht = { indexedDB: M.indexedDB || M.mozIndexedDB || M.webkitIndexedDB || M.msIndexedDB, IDBKeyRange: M.IDBKeyRange || M.webkitIDBKeyRange };
|
|
3086
3086
|
} catch {
|
|
3087
3087
|
Ht = { indexedDB: null, IDBKeyRange: null };
|
|
3088
3088
|
}
|
|
3089
3089
|
function Dr(e) {
|
|
3090
3090
|
var t, n = !1, r = new Si(function(i) {
|
|
3091
|
-
var a = qt(e), s, u = !1, h = {},
|
|
3091
|
+
var a = qt(e), s, u = !1, h = {}, f = {}, b = { get closed() {
|
|
3092
3092
|
return u;
|
|
3093
3093
|
}, unsubscribe: function() {
|
|
3094
3094
|
u || (u = !0, s && s.abort(), c && Te.storagemutated.unsubscribe(p));
|
|
3095
3095
|
} };
|
|
3096
3096
|
i.start && i.start(b);
|
|
3097
|
-
var c = !1,
|
|
3098
|
-
return ln(
|
|
3097
|
+
var c = !1, d = function() {
|
|
3098
|
+
return ln(m);
|
|
3099
3099
|
}, p = function(w) {
|
|
3100
|
-
Wt(h, w), Dn(
|
|
3101
|
-
},
|
|
3100
|
+
Wt(h, w), Dn(f, h) && d();
|
|
3101
|
+
}, m = function() {
|
|
3102
3102
|
var w, g, _;
|
|
3103
3103
|
!u && Ht.indexedDB && (h = {}, w = {}, s && s.abort(), s = new AbortController(), _ = function(S) {
|
|
3104
3104
|
var E = Ve();
|
|
@@ -3109,13 +3109,13 @@ var Rr = { exports: {} };
|
|
|
3109
3109
|
} finally {
|
|
3110
3110
|
E && Xe();
|
|
3111
3111
|
}
|
|
3112
|
-
}(g = { subscr: w, signal: s.signal, requery:
|
|
3112
|
+
}(g = { subscr: w, signal: s.signal, requery: d, querier: e, trans: null }), Promise.resolve(_).then(function(S) {
|
|
3113
3113
|
n = !0, t = S, u || g.signal.aborted || (h = {}, function(E) {
|
|
3114
3114
|
for (var O in E)
|
|
3115
3115
|
if (ie(E, O))
|
|
3116
3116
|
return;
|
|
3117
3117
|
return 1;
|
|
3118
|
-
}(
|
|
3118
|
+
}(f = w) || c || (Te(pt, p), c = !0), ln(function() {
|
|
3119
3119
|
return !u && i.next && i.next(S);
|
|
3120
3120
|
}));
|
|
3121
3121
|
}, function(S) {
|
|
@@ -3124,7 +3124,7 @@ var Rr = { exports: {} };
|
|
|
3124
3124
|
});
|
|
3125
3125
|
}));
|
|
3126
3126
|
};
|
|
3127
|
-
return setTimeout(
|
|
3127
|
+
return setTimeout(d, 0), b;
|
|
3128
3128
|
});
|
|
3129
3129
|
return r.hasValue = function() {
|
|
3130
3130
|
return n;
|
|
@@ -3141,7 +3141,7 @@ var Rr = { exports: {} };
|
|
|
3141
3141
|
je = t;
|
|
3142
3142
|
}
|
|
3143
3143
|
}
|
|
3144
|
-
xe(We,
|
|
3144
|
+
xe(We, y(y({}, St), { delete: function(e) {
|
|
3145
3145
|
return new We(e, { addons: [] }).delete();
|
|
3146
3146
|
}, exists: function(e) {
|
|
3147
3147
|
return new We(e, { addons: [] }).open().then(function(t) {
|
|
@@ -3167,7 +3167,7 @@ var Rr = { exports: {} };
|
|
|
3167
3167
|
Z(this, e);
|
|
3168
3168
|
};
|
|
3169
3169
|
}, ignoreTransaction: function(e) {
|
|
3170
|
-
return
|
|
3170
|
+
return B.trans ? Ge(B.transless, e) : e();
|
|
3171
3171
|
}, vip: xn, async: function(e) {
|
|
3172
3172
|
return function() {
|
|
3173
3173
|
try {
|
|
@@ -3185,9 +3185,9 @@ var Rr = { exports: {} };
|
|
|
3185
3185
|
return q(i);
|
|
3186
3186
|
}
|
|
3187
3187
|
}, currentTransaction: { get: function() {
|
|
3188
|
-
return
|
|
3188
|
+
return B.trans || null;
|
|
3189
3189
|
} }, waitFor: function(e, t) {
|
|
3190
|
-
return t = T.resolve(typeof e == "function" ? We.ignoreTransaction(e) : e).timeout(t || 6e4),
|
|
3190
|
+
return t = T.resolve(typeof e == "function" ? We.ignoreTransaction(e) : e).timeout(t || 6e4), B.trans ? B.trans.waitFor(t) : t;
|
|
3191
3191
|
}, Promise: T, debug: { get: function() {
|
|
3192
3192
|
return pe;
|
|
3193
3193
|
}, set: function(e) {
|
|
@@ -3225,7 +3225,7 @@ var Rr = { exports: {} };
|
|
|
3225
3225
|
return !e || e instanceof He || e instanceof TypeError || e instanceof SyntaxError || !e.name || !Zn[e.name] ? e : (t = new Zn[e.name](t || e.message, e), "stack" in e && ke(t, "stack", { get: function() {
|
|
3226
3226
|
return this.inner.stack;
|
|
3227
3227
|
} }), t);
|
|
3228
|
-
}, qn(pe),
|
|
3228
|
+
}, qn(pe), y(Se, Object.freeze({ __proto__: null, Dexie: Se, liveQuery: Dr, Entity: sr, cmp: $, default: Se, RangeSet: oe, mergeRanges: bt, rangesOverlap: Ut }), { default: Se }), Se;
|
|
3229
3229
|
});
|
|
3230
3230
|
})(Rr);
|
|
3231
3231
|
var Di = Rr.exports;
|
|
@@ -3239,17 +3239,17 @@ function X(v) {
|
|
|
3239
3239
|
function nt(v) {
|
|
3240
3240
|
var o;
|
|
3241
3241
|
if (v.widget === void 0) {
|
|
3242
|
-
const
|
|
3243
|
-
|
|
3242
|
+
const l = (o = v.topics) == null ? void 0 : o.split("-");
|
|
3243
|
+
l && l.length > 1 ? (v.dashboard = l ? l[0] : "", v.widget = l ? l[1] : "") : (v.widget = v.topics, v.dashboard = v.slide);
|
|
3244
3244
|
}
|
|
3245
3245
|
return v.topics === void 0 && (v.topics = `${v.dashboard}-${v.widget}`), v;
|
|
3246
3246
|
}
|
|
3247
3247
|
function vt(v, o) {
|
|
3248
3248
|
var N;
|
|
3249
|
-
let
|
|
3249
|
+
let l, y, P, M, j;
|
|
3250
3250
|
switch (v.moderation) {
|
|
3251
3251
|
case Xt.BEFORE:
|
|
3252
|
-
|
|
3252
|
+
l = /* @__PURE__ */ new Date(), y = (N = v.beforeTime) == null ? void 0 : N.split(":"), P = Number.parseInt(y ? y[0] : "00"), M = Number.parseInt(y ? y[1] : "00"), j = Number.parseInt(y ? y[2] : "00"), o.before = l.setHours(P, M, j, 0) / 1e3, o.period || (o.period = l.getDay() === 1 ? 72 : 24);
|
|
3253
3253
|
break;
|
|
3254
3254
|
case Xt.DELAYED:
|
|
3255
3255
|
v.delay && v.delay > 0 && (o.delay = `${v.delay}`);
|
|
@@ -3264,16 +3264,16 @@ function vt(v, o) {
|
|
|
3264
3264
|
}
|
|
3265
3265
|
class Tr {
|
|
3266
3266
|
constructor(o) {
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3267
|
+
I(this, "db");
|
|
3268
|
+
I(this, "subscribers", []);
|
|
3269
|
+
I(this, "options");
|
|
3270
3270
|
/**
|
|
3271
3271
|
* Retrieve Cloud Data
|
|
3272
3272
|
* @param query IQuery
|
|
3273
3273
|
* @returns IResponse
|
|
3274
3274
|
*/
|
|
3275
|
-
|
|
3276
|
-
const
|
|
3275
|
+
I(this, "getCloud", async (o) => {
|
|
3276
|
+
const l = await this.db.table(K.CLOUD).where({ id: o.widget }).last().catch(() => (console.warn(
|
|
3277
3277
|
"%capi%C %ccloud",
|
|
3278
3278
|
x.API,
|
|
3279
3279
|
x.NONE,
|
|
@@ -3281,15 +3281,15 @@ class Tr {
|
|
|
3281
3281
|
o.slide,
|
|
3282
3282
|
o.widget
|
|
3283
3283
|
), { data: null, message: "Series Data error", success: !1 }));
|
|
3284
|
-
return
|
|
3284
|
+
return l.data.presentation = (o == null ? void 0 : o.presentation) || "not set", l.data.slide = (o == null ? void 0 : o.slide) || "not set", l.message = "Messages retrieved successfully", l.success = !0, l;
|
|
3285
3285
|
});
|
|
3286
3286
|
/**
|
|
3287
3287
|
* Retrieve Cloud Data
|
|
3288
3288
|
* @param query IQuery
|
|
3289
3289
|
* @returns IResponse
|
|
3290
3290
|
*/
|
|
3291
|
-
|
|
3292
|
-
const
|
|
3291
|
+
I(this, "getSeries", async (o) => {
|
|
3292
|
+
const l = await this.db.table(K.SERIES).where({ id: o.widget }).last().catch(() => (console.warn(
|
|
3293
3293
|
"%capi%c %cseries",
|
|
3294
3294
|
x.API,
|
|
3295
3295
|
x.NONE,
|
|
@@ -3297,26 +3297,26 @@ class Tr {
|
|
|
3297
3297
|
o.slide,
|
|
3298
3298
|
o.widget
|
|
3299
3299
|
), { data: null, message: "Series Data error", success: !1 }));
|
|
3300
|
-
return
|
|
3300
|
+
return l.data.presentation = (o == null ? void 0 : o.presentation) || "not set", l.data.slide = (o == null ? void 0 : o.slide) || "not set", l.message = "Messages retrieved successfully", l.success = !0, l;
|
|
3301
3301
|
});
|
|
3302
3302
|
/**
|
|
3303
3303
|
* Retrieve Cloud Data
|
|
3304
3304
|
* @param query IQuery
|
|
3305
3305
|
* @returns IResponse
|
|
3306
3306
|
*/
|
|
3307
|
-
|
|
3308
|
-
const
|
|
3307
|
+
I(this, "getMessages", async (o) => {
|
|
3308
|
+
const l = (M) => M.widget_id === o.widget, y = (M) => M.utc > ((o == null ? void 0 : o.since) || 0), P = (M) => (M == null ? void 0 : M.visible) !== 0;
|
|
3309
3309
|
try {
|
|
3310
|
-
const
|
|
3310
|
+
const M = await this.db.table(K.TOPICS).orderBy("utc").reverse().filter(l).filter(y).filter(P).limit((o == null ? void 0 : o.limit) ?? 25).toArray().catch(() => (console.warn(
|
|
3311
3311
|
"%capi%c %cmessages",
|
|
3312
3312
|
x.API,
|
|
3313
3313
|
x.NONE,
|
|
3314
3314
|
x.MESSAGES,
|
|
3315
3315
|
o.slide,
|
|
3316
3316
|
o.widget
|
|
3317
|
-
), { data: null, message: "Messages Data error", success: !1 })), j =
|
|
3317
|
+
), { data: null, message: "Messages Data error", success: !1 })), j = M[0] ? M[0].title : "No title", N = M.map(
|
|
3318
3318
|
(be) => be.message_id
|
|
3319
|
-
), te = (await this.db.table(
|
|
3319
|
+
), te = (await this.db.table(K.MESSAGES).where("id").anyOf(N).toArray().then((be) => be.sort((ie, xe) => xe.utc - ie.utc))).map(
|
|
3320
3320
|
(be) => be.data
|
|
3321
3321
|
);
|
|
3322
3322
|
return {
|
|
@@ -3341,22 +3341,22 @@ class Tr {
|
|
|
3341
3341
|
* @param data
|
|
3342
3342
|
* @returns number
|
|
3343
3343
|
*/
|
|
3344
|
-
|
|
3344
|
+
I(this, "setCloud", async (o, l) => o.type === K.CLOUD && l !== "" ? await this.db.table(K.CLOUD).put({
|
|
3345
3345
|
id: o.widget,
|
|
3346
3346
|
dashboard_id: o.dashboard,
|
|
3347
|
-
data:
|
|
3348
|
-
}).then(() => 201).catch((
|
|
3347
|
+
data: l.data
|
|
3348
|
+
}).then(() => 201).catch((y) => (console.error("%cstorage", x.STORAGE, "set", o, y), 400)) : 400);
|
|
3349
3349
|
/**
|
|
3350
3350
|
* Update Series
|
|
3351
3351
|
* @param query IQuery
|
|
3352
3352
|
* @param data
|
|
3353
3353
|
* @returns number
|
|
3354
3354
|
*/
|
|
3355
|
-
|
|
3355
|
+
I(this, "setSeries", async (o, l) => o.type === K.SERIES && l !== "" ? await this.db.table(K.SERIES).put({
|
|
3356
3356
|
id: o.widget,
|
|
3357
3357
|
dashboard_id: o.dashboard,
|
|
3358
|
-
data:
|
|
3359
|
-
}).then(() => 201).catch((
|
|
3358
|
+
data: l.data
|
|
3359
|
+
}).then(() => 201).catch((y) => (console.error("%cstorage", x.STORAGE, "set", o, y), 400)) : 400);
|
|
3360
3360
|
/**
|
|
3361
3361
|
* Update Messages
|
|
3362
3362
|
* @param query IQuery
|
|
@@ -3366,37 +3366,37 @@ class Tr {
|
|
|
3366
3366
|
* @param data.data.messages IMessages
|
|
3367
3367
|
* @returns number
|
|
3368
3368
|
*/
|
|
3369
|
-
|
|
3370
|
-
if (o.type !==
|
|
3369
|
+
I(this, "setMessages", async (o, l) => {
|
|
3370
|
+
if (o.type !== K.MESSAGES)
|
|
3371
3371
|
return 400;
|
|
3372
|
-
const
|
|
3372
|
+
const y = l.title;
|
|
3373
3373
|
try {
|
|
3374
|
-
return
|
|
3375
|
-
var
|
|
3376
|
-
await this.db.table(
|
|
3374
|
+
return l.data.messages.forEach(async (P) => {
|
|
3375
|
+
var M, j, N;
|
|
3376
|
+
await this.db.table(K.MESSAGES).put({ id: P.id, utc: P.utc, data: P }), await this.db.table(K.TOPICS).put({
|
|
3377
3377
|
widget_id: o.widget,
|
|
3378
|
-
message_id:
|
|
3378
|
+
message_id: P.id,
|
|
3379
3379
|
dashboard_id: o.dashboard,
|
|
3380
|
-
title:
|
|
3381
|
-
engagement: (
|
|
3382
|
-
impressions: (j =
|
|
3383
|
-
reach: (N =
|
|
3384
|
-
sentiment:
|
|
3385
|
-
utc:
|
|
3380
|
+
title: y,
|
|
3381
|
+
engagement: (M = P.dynamics) == null ? void 0 : M.engagement,
|
|
3382
|
+
impressions: (j = P.dynamics) == null ? void 0 : j.semrush_visits,
|
|
3383
|
+
reach: (N = P.dynamics) == null ? void 0 : N.potential_reach,
|
|
3384
|
+
sentiment: P.topics[0].sentiment,
|
|
3385
|
+
utc: P.utc
|
|
3386
3386
|
});
|
|
3387
3387
|
}), 201;
|
|
3388
|
-
} catch (
|
|
3389
|
-
return console.error("%cstorage", x.STORAGE, "set", o,
|
|
3388
|
+
} catch (P) {
|
|
3389
|
+
return console.error("%cstorage", x.STORAGE, "set", o, P), 400;
|
|
3390
3390
|
}
|
|
3391
3391
|
});
|
|
3392
3392
|
/**
|
|
3393
3393
|
* Wipe Message data after number of seconds
|
|
3394
3394
|
* @param retentionDuration
|
|
3395
3395
|
*/
|
|
3396
|
-
|
|
3397
|
-
const
|
|
3398
|
-
await this.db.table("topics").orderBy("utc").filter(
|
|
3399
|
-
delete
|
|
3396
|
+
I(this, "cleanMessages", async (o) => {
|
|
3397
|
+
const l = Date.now() / 1e3, y = (P) => P.utc < o - l;
|
|
3398
|
+
await this.db.table("topics").orderBy("utc").filter(y).modify((P, M) => {
|
|
3399
|
+
delete M.value;
|
|
3400
3400
|
});
|
|
3401
3401
|
});
|
|
3402
3402
|
/**
|
|
@@ -3404,19 +3404,19 @@ class Tr {
|
|
|
3404
3404
|
* @param query IQuery
|
|
3405
3405
|
* @returns number
|
|
3406
3406
|
*/
|
|
3407
|
-
|
|
3407
|
+
I(this, "setWidget", async (o) => await this.db.table(K.WIDGETS).put({
|
|
3408
3408
|
id: o.widget,
|
|
3409
3409
|
dashboard_id: o.dashboard,
|
|
3410
3410
|
type: o.type
|
|
3411
|
-
}).then(() => 201).catch((
|
|
3411
|
+
}).then(() => 201).catch((l) => (console.error("%cstorage", x.STORAGE, K.WIDGET, o, l), 400)));
|
|
3412
3412
|
/**
|
|
3413
3413
|
* Add component subscriber
|
|
3414
3414
|
* @param query IQuery
|
|
3415
3415
|
* @returns null
|
|
3416
3416
|
*/
|
|
3417
|
-
|
|
3418
|
-
(
|
|
3419
|
-
).length > 0 || (o.type ===
|
|
3417
|
+
I(this, "subscribe", (o) => (o = nt(o), this.subscribers.filter(
|
|
3418
|
+
(y) => y.widget === o.widget
|
|
3419
|
+
).length > 0 || (o.type === K.MESSAGES && (o = vt(this.options, o)), console.debug(
|
|
3420
3420
|
"%cstorage%c %csubscribe",
|
|
3421
3421
|
x.STORAGE,
|
|
3422
3422
|
x.NONE,
|
|
@@ -3428,7 +3428,7 @@ class Tr {
|
|
|
3428
3428
|
* Get current subscribers
|
|
3429
3429
|
* @returns IQuery[]
|
|
3430
3430
|
*/
|
|
3431
|
-
|
|
3431
|
+
I(this, "getSubscribers", async () => await new Promise((o) => o(this.subscribers)));
|
|
3432
3432
|
this.options = o, this.db = new Wn(o.app), this.db.version(2).stores({
|
|
3433
3433
|
player: "id,title,name,location",
|
|
3434
3434
|
monitor: "id,player_id,cols,rows,order,width,height,physicalwidth,physicalheight,devicePixelRatio,screenLeft,screenTop,orientation,monitor",
|
|
@@ -3444,41 +3444,41 @@ class Tr {
|
|
|
3444
3444
|
}
|
|
3445
3445
|
}
|
|
3446
3446
|
function zn(v) {
|
|
3447
|
-
return new Promise((o,
|
|
3448
|
-
v.oncomplete = v.onsuccess = () => o(v.result), v.onabort = v.onerror = () =>
|
|
3447
|
+
return new Promise((o, l) => {
|
|
3448
|
+
v.oncomplete = v.onsuccess = () => o(v.result), v.onabort = v.onerror = () => l(v.error);
|
|
3449
3449
|
});
|
|
3450
3450
|
}
|
|
3451
3451
|
function Pi(v, o) {
|
|
3452
|
-
const
|
|
3453
|
-
|
|
3454
|
-
const
|
|
3455
|
-
return (
|
|
3452
|
+
const l = indexedDB.open(v);
|
|
3453
|
+
l.onupgradeneeded = () => l.result.createObjectStore(o);
|
|
3454
|
+
const y = zn(l);
|
|
3455
|
+
return (P, M) => y.then((j) => M(j.transaction(o, P).objectStore(o)));
|
|
3456
3456
|
}
|
|
3457
3457
|
let Gn;
|
|
3458
3458
|
function jr() {
|
|
3459
3459
|
return Gn || (Gn = Pi("keyval-store", "keyval")), Gn;
|
|
3460
3460
|
}
|
|
3461
3461
|
function Ln(v, o = jr()) {
|
|
3462
|
-
return o("readonly", (
|
|
3462
|
+
return o("readonly", (l) => zn(l.get(v)));
|
|
3463
3463
|
}
|
|
3464
|
-
function Vt(v, o,
|
|
3465
|
-
return
|
|
3464
|
+
function Vt(v, o, l = jr()) {
|
|
3465
|
+
return l("readwrite", (y) => (y.put(o, v), zn(y.transaction)));
|
|
3466
3466
|
}
|
|
3467
3467
|
class Mr {
|
|
3468
3468
|
constructor(o) {
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
const
|
|
3473
|
-
return await Ln(
|
|
3469
|
+
I(this, "subscribers", []);
|
|
3470
|
+
I(this, "options");
|
|
3471
|
+
I(this, "getCloud", async (o) => {
|
|
3472
|
+
const l = X(o);
|
|
3473
|
+
return await Ln(l).then((y) => y).catch(() => (console.warn("%capi", x.API, K.CLOUD, o.slide, o.widget), { data: null, message: "Cloud Data error", success: !1 }));
|
|
3474
3474
|
});
|
|
3475
|
-
|
|
3476
|
-
const
|
|
3477
|
-
return await Ln(
|
|
3475
|
+
I(this, "getSeries", async (o) => {
|
|
3476
|
+
const l = X(o);
|
|
3477
|
+
return await Ln(l).then((y) => y).catch(() => (console.warn("%capi", x.API, K.SERIES, o.slide, o.widget), { data: null, message: "Series Data error", success: !1 }));
|
|
3478
3478
|
});
|
|
3479
|
-
|
|
3480
|
-
const
|
|
3481
|
-
return await Ln(
|
|
3479
|
+
I(this, "getMessages", async (o) => {
|
|
3480
|
+
const l = X(o);
|
|
3481
|
+
return await Ln(l).then((y) => y).catch(() => (console.warn("%capi", x.API, K.MESSAGES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 }));
|
|
3482
3482
|
});
|
|
3483
3483
|
/**
|
|
3484
3484
|
* Update Cloud
|
|
@@ -3486,11 +3486,11 @@ class Mr {
|
|
|
3486
3486
|
* @param data
|
|
3487
3487
|
* @returns number
|
|
3488
3488
|
*/
|
|
3489
|
-
|
|
3490
|
-
if (!
|
|
3489
|
+
I(this, "setCloud", async (o, l) => {
|
|
3490
|
+
if (!l.success)
|
|
3491
3491
|
return 400;
|
|
3492
|
-
const
|
|
3493
|
-
return delete
|
|
3492
|
+
const y = X(o);
|
|
3493
|
+
return delete l.success, delete l.message, await Vt(y, l).then(() => 201).catch((P) => (console.error("%cstorage", x.STORAGE, K.CLOUD, o, P), 400));
|
|
3494
3494
|
});
|
|
3495
3495
|
/**
|
|
3496
3496
|
* Update Series
|
|
@@ -3498,11 +3498,11 @@ class Mr {
|
|
|
3498
3498
|
* @param data
|
|
3499
3499
|
* @returns bumber
|
|
3500
3500
|
*/
|
|
3501
|
-
|
|
3502
|
-
if (!
|
|
3501
|
+
I(this, "setSeries", async (o, l) => {
|
|
3502
|
+
if (!l.success)
|
|
3503
3503
|
return 400;
|
|
3504
|
-
const
|
|
3505
|
-
return delete
|
|
3504
|
+
const y = X(o);
|
|
3505
|
+
return delete l.success, delete l.message, await Vt(y, l).then(() => 201).catch((P) => (console.error("%cstorage", x.STORAGE, K.SERIES, o, P), 400));
|
|
3506
3506
|
});
|
|
3507
3507
|
/**
|
|
3508
3508
|
* Update Messages
|
|
@@ -3510,33 +3510,33 @@ class Mr {
|
|
|
3510
3510
|
* @param data
|
|
3511
3511
|
* @returns number
|
|
3512
3512
|
*/
|
|
3513
|
-
|
|
3514
|
-
if (!
|
|
3513
|
+
I(this, "setMessages", async (o, l) => {
|
|
3514
|
+
if (!l.success)
|
|
3515
3515
|
return 400;
|
|
3516
|
-
const
|
|
3517
|
-
return delete
|
|
3516
|
+
const y = X(o);
|
|
3517
|
+
return delete l.success, delete l.message, await Vt(y, l).then(() => 201).catch((P) => (console.error("%cstorage", x.STORAGE, K.MESSAGES, o, P), 400));
|
|
3518
3518
|
});
|
|
3519
|
-
|
|
3519
|
+
I(this, "cleanMessages", async (o) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((l) => l())));
|
|
3520
3520
|
/**
|
|
3521
3521
|
* Update Cloud
|
|
3522
3522
|
* @param query IQuery
|
|
3523
3523
|
* @returns number
|
|
3524
3524
|
*/
|
|
3525
|
-
|
|
3526
|
-
const
|
|
3525
|
+
I(this, "setWidget", async (o) => {
|
|
3526
|
+
const l = X(o), y = {
|
|
3527
3527
|
id: o.widget,
|
|
3528
3528
|
dashboard_id: o.dashboard,
|
|
3529
3529
|
type: o.type
|
|
3530
3530
|
};
|
|
3531
|
-
return await Vt(
|
|
3531
|
+
return await Vt(l, y).then(() => 201).catch((P) => (console.error("%cstorage", x.STORAGE, K.WIDGET, o, P), 400));
|
|
3532
3532
|
});
|
|
3533
3533
|
/**
|
|
3534
3534
|
* Add component subscriber
|
|
3535
3535
|
* @param query IQuery
|
|
3536
3536
|
* @returns null
|
|
3537
3537
|
*/
|
|
3538
|
-
|
|
3539
|
-
(
|
|
3538
|
+
I(this, "subscribe", (o) => (o = nt(o), o.type === K.MESSAGES && (o = vt(this.options, o)), this.subscribers.filter(
|
|
3539
|
+
(y) => y.widget === o.widget
|
|
3540
3540
|
).length > 0 || (console.debug(
|
|
3541
3541
|
"%cstorage%c %csubscribe",
|
|
3542
3542
|
x.STORAGE,
|
|
@@ -3549,36 +3549,36 @@ class Mr {
|
|
|
3549
3549
|
* Get current subscribers
|
|
3550
3550
|
* @returns IQuery[]
|
|
3551
3551
|
*/
|
|
3552
|
-
|
|
3552
|
+
I(this, "getSubscribers", async () => await new Promise((o) => o(this.subscribers)));
|
|
3553
3553
|
this.options = o;
|
|
3554
3554
|
}
|
|
3555
3555
|
}
|
|
3556
3556
|
class Kr {
|
|
3557
3557
|
constructor(o) {
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
const
|
|
3558
|
+
I(this, "subscribers", []);
|
|
3559
|
+
I(this, "options");
|
|
3560
|
+
I(this, "getCloud", async (o) => {
|
|
3561
|
+
const l = X(o);
|
|
3562
3562
|
try {
|
|
3563
|
-
return localStorage.getObject(
|
|
3563
|
+
return localStorage.getObject(l);
|
|
3564
3564
|
} catch {
|
|
3565
|
-
return console.warn("%capi", x.API,
|
|
3565
|
+
return console.warn("%capi", x.API, K.CLOUD, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3566
3566
|
}
|
|
3567
3567
|
});
|
|
3568
|
-
|
|
3569
|
-
const
|
|
3568
|
+
I(this, "getSeries", async (o) => {
|
|
3569
|
+
const l = X(o);
|
|
3570
3570
|
try {
|
|
3571
|
-
return localStorage.getObject(
|
|
3571
|
+
return localStorage.getObject(l);
|
|
3572
3572
|
} catch {
|
|
3573
|
-
return console.warn("%capi", x.API,
|
|
3573
|
+
return console.warn("%capi", x.API, K.SERIES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3574
3574
|
}
|
|
3575
3575
|
});
|
|
3576
|
-
|
|
3577
|
-
const
|
|
3576
|
+
I(this, "getMessages", async (o) => {
|
|
3577
|
+
const l = X(o);
|
|
3578
3578
|
try {
|
|
3579
|
-
return localStorage.getObject(
|
|
3579
|
+
return localStorage.getObject(l);
|
|
3580
3580
|
} catch {
|
|
3581
|
-
return console.warn("%capi", x.API,
|
|
3581
|
+
return console.warn("%capi", x.API, K.MESSAGES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3582
3582
|
}
|
|
3583
3583
|
});
|
|
3584
3584
|
/**
|
|
@@ -3587,12 +3587,12 @@ class Kr {
|
|
|
3587
3587
|
* @param data
|
|
3588
3588
|
* @returns number
|
|
3589
3589
|
*/
|
|
3590
|
-
|
|
3591
|
-
const
|
|
3590
|
+
I(this, "setCloud", async (o, l) => {
|
|
3591
|
+
const y = X(o);
|
|
3592
3592
|
try {
|
|
3593
|
-
return localStorage.setObject(
|
|
3594
|
-
} catch (
|
|
3595
|
-
return console.error("%cstorage", x.STORAGE,
|
|
3593
|
+
return localStorage.setObject(y, l), 201;
|
|
3594
|
+
} catch (P) {
|
|
3595
|
+
return console.error("%cstorage", x.STORAGE, K.CLOUD, o, P), 400;
|
|
3596
3596
|
}
|
|
3597
3597
|
});
|
|
3598
3598
|
/**
|
|
@@ -3601,12 +3601,12 @@ class Kr {
|
|
|
3601
3601
|
* @param data
|
|
3602
3602
|
* @returns number
|
|
3603
3603
|
*/
|
|
3604
|
-
|
|
3605
|
-
const
|
|
3604
|
+
I(this, "setSeries", async (o, l) => {
|
|
3605
|
+
const y = X(o);
|
|
3606
3606
|
try {
|
|
3607
|
-
return localStorage.setObject(
|
|
3608
|
-
} catch (
|
|
3609
|
-
return console.error("%cstorage", x.STORAGE,
|
|
3607
|
+
return localStorage.setObject(y, l), 201;
|
|
3608
|
+
} catch (P) {
|
|
3609
|
+
return console.error("%cstorage", x.STORAGE, K.SERIES, o, P), 400;
|
|
3610
3610
|
}
|
|
3611
3611
|
});
|
|
3612
3612
|
/**
|
|
@@ -3615,23 +3615,23 @@ class Kr {
|
|
|
3615
3615
|
* @param data
|
|
3616
3616
|
* @returns number
|
|
3617
3617
|
*/
|
|
3618
|
-
|
|
3619
|
-
const
|
|
3618
|
+
I(this, "setMessages", async (o, l) => {
|
|
3619
|
+
const y = X(o);
|
|
3620
3620
|
try {
|
|
3621
|
-
return localStorage.setObject(
|
|
3622
|
-
} catch (
|
|
3623
|
-
return console.error("%cstorage", x.STORAGE,
|
|
3621
|
+
return localStorage.setObject(y, l), 200;
|
|
3622
|
+
} catch (P) {
|
|
3623
|
+
return console.error("%cstorage", x.STORAGE, K.MESSAGES, o, P), 400;
|
|
3624
3624
|
}
|
|
3625
3625
|
});
|
|
3626
|
-
|
|
3626
|
+
I(this, "cleanMessages", async (o) => {
|
|
3627
3627
|
console.log("cleanMessages not implemented for ", this.options.storage);
|
|
3628
3628
|
});
|
|
3629
|
-
|
|
3630
|
-
const
|
|
3629
|
+
I(this, "setWidget", async (o) => {
|
|
3630
|
+
const l = `widget.${o.widget}`;
|
|
3631
3631
|
try {
|
|
3632
|
-
return localStorage.setObject(
|
|
3633
|
-
} catch (
|
|
3634
|
-
return console.error("%cstorage", x.STORAGE,
|
|
3632
|
+
return localStorage.setObject(l, o), 201;
|
|
3633
|
+
} catch (y) {
|
|
3634
|
+
return console.error("%cstorage", x.STORAGE, K.WIDGET, o, y), 400;
|
|
3635
3635
|
}
|
|
3636
3636
|
});
|
|
3637
3637
|
/**
|
|
@@ -3639,8 +3639,8 @@ class Kr {
|
|
|
3639
3639
|
* @param query IQuery
|
|
3640
3640
|
* @returns null
|
|
3641
3641
|
*/
|
|
3642
|
-
|
|
3643
|
-
(
|
|
3642
|
+
I(this, "subscribe", (o) => (o = nt(o), o.type === K.MESSAGES && (o = vt(this.options, o)), this.subscribers.filter(
|
|
3643
|
+
(y) => y.widget === o.widget
|
|
3644
3644
|
).length || (console.debug(
|
|
3645
3645
|
"%cstorage%c %csubscribe",
|
|
3646
3646
|
x.STORAGE,
|
|
@@ -3653,41 +3653,41 @@ class Kr {
|
|
|
3653
3653
|
* Get current subscribers
|
|
3654
3654
|
* @returns IQuery[]
|
|
3655
3655
|
*/
|
|
3656
|
-
|
|
3657
|
-
this.options = o, Storage.prototype.setObject = function(
|
|
3658
|
-
this.setObject(
|
|
3659
|
-
}, Storage.prototype.getObject = function(
|
|
3660
|
-
const
|
|
3661
|
-
return
|
|
3656
|
+
I(this, "getSubscribers", async () => await new Promise((o) => o(this.subscribers)));
|
|
3657
|
+
this.options = o, Storage.prototype.setObject = function(l, y) {
|
|
3658
|
+
this.setObject(l, JSON.stringify(y));
|
|
3659
|
+
}, Storage.prototype.getObject = function(l) {
|
|
3660
|
+
const y = this.getObject(l);
|
|
3661
|
+
return y && JSON.parse(y);
|
|
3662
3662
|
};
|
|
3663
3663
|
}
|
|
3664
3664
|
}
|
|
3665
3665
|
class Br {
|
|
3666
3666
|
constructor(o) {
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
const
|
|
3667
|
+
I(this, "subscribers", []);
|
|
3668
|
+
I(this, "options");
|
|
3669
|
+
I(this, "getCloud", async (o) => {
|
|
3670
|
+
const l = X(o);
|
|
3671
3671
|
try {
|
|
3672
|
-
return sessionStorage.getObject(
|
|
3672
|
+
return sessionStorage.getObject(l);
|
|
3673
3673
|
} catch {
|
|
3674
|
-
return console.warn("%capi", x.API,
|
|
3674
|
+
return console.warn("%capi", x.API, K.CLOUD, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3675
3675
|
}
|
|
3676
3676
|
});
|
|
3677
|
-
|
|
3678
|
-
const
|
|
3677
|
+
I(this, "getSeries", async (o) => {
|
|
3678
|
+
const l = X(o);
|
|
3679
3679
|
try {
|
|
3680
|
-
return sessionStorage.getObject(
|
|
3680
|
+
return sessionStorage.getObject(l);
|
|
3681
3681
|
} catch {
|
|
3682
|
-
return console.warn("%capi", x.API,
|
|
3682
|
+
return console.warn("%capi", x.API, K.SERIES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3683
3683
|
}
|
|
3684
3684
|
});
|
|
3685
|
-
|
|
3686
|
-
const
|
|
3685
|
+
I(this, "getMessages", async (o) => {
|
|
3686
|
+
const l = X(o);
|
|
3687
3687
|
try {
|
|
3688
|
-
return sessionStorage.getObject(
|
|
3688
|
+
return sessionStorage.getObject(l);
|
|
3689
3689
|
} catch {
|
|
3690
|
-
return console.warn("%capi", x.API,
|
|
3690
|
+
return console.warn("%capi", x.API, K.MESSAGES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3691
3691
|
}
|
|
3692
3692
|
});
|
|
3693
3693
|
/**
|
|
@@ -3696,12 +3696,12 @@ class Br {
|
|
|
3696
3696
|
* @param data
|
|
3697
3697
|
* @returns number
|
|
3698
3698
|
*/
|
|
3699
|
-
|
|
3700
|
-
const
|
|
3699
|
+
I(this, "setCloud", async (o, l) => {
|
|
3700
|
+
const y = X(o);
|
|
3701
3701
|
try {
|
|
3702
|
-
return sessionStorage.setObject(
|
|
3703
|
-
} catch (
|
|
3704
|
-
return console.error("%cstorage", x.STORAGE,
|
|
3702
|
+
return sessionStorage.setObject(y, l), 201;
|
|
3703
|
+
} catch (P) {
|
|
3704
|
+
return console.error("%cstorage", x.STORAGE, K.CLOUD, o, P), 400;
|
|
3705
3705
|
}
|
|
3706
3706
|
});
|
|
3707
3707
|
/**
|
|
@@ -3710,12 +3710,12 @@ class Br {
|
|
|
3710
3710
|
* @param data
|
|
3711
3711
|
* @returns number
|
|
3712
3712
|
*/
|
|
3713
|
-
|
|
3714
|
-
const
|
|
3713
|
+
I(this, "setSeries", async (o, l) => {
|
|
3714
|
+
const y = X(o);
|
|
3715
3715
|
try {
|
|
3716
|
-
return sessionStorage.setObject(
|
|
3717
|
-
} catch (
|
|
3718
|
-
return console.error("%cstorage", x.STORAGE,
|
|
3716
|
+
return sessionStorage.setObject(y, l), 201;
|
|
3717
|
+
} catch (P) {
|
|
3718
|
+
return console.error("%cstorage", x.STORAGE, K.SERIES, o, P), 400;
|
|
3719
3719
|
}
|
|
3720
3720
|
});
|
|
3721
3721
|
/**
|
|
@@ -3724,23 +3724,23 @@ class Br {
|
|
|
3724
3724
|
* @param data
|
|
3725
3725
|
* @returns number
|
|
3726
3726
|
*/
|
|
3727
|
-
|
|
3728
|
-
const
|
|
3727
|
+
I(this, "setMessages", async (o, l) => {
|
|
3728
|
+
const y = X(o);
|
|
3729
3729
|
try {
|
|
3730
|
-
return sessionStorage.setObject(
|
|
3731
|
-
} catch (
|
|
3732
|
-
return console.error("%cstorage", x.STORAGE,
|
|
3730
|
+
return sessionStorage.setObject(y, l), 200;
|
|
3731
|
+
} catch (P) {
|
|
3732
|
+
return console.error("%cstorage", x.STORAGE, K.MESSAGES, o, P), 400;
|
|
3733
3733
|
}
|
|
3734
3734
|
});
|
|
3735
|
-
|
|
3735
|
+
I(this, "cleanMessages", async (o) => {
|
|
3736
3736
|
console.log("cleanMessages not implemented for ", this.options.storage);
|
|
3737
3737
|
});
|
|
3738
|
-
|
|
3739
|
-
const
|
|
3738
|
+
I(this, "setWidget", async (o) => {
|
|
3739
|
+
const l = `widget.${o.widget}`;
|
|
3740
3740
|
try {
|
|
3741
|
-
return sessionStorage.setObject(
|
|
3742
|
-
} catch (
|
|
3743
|
-
return console.error("%cstorage", x.STORAGE,
|
|
3741
|
+
return sessionStorage.setObject(l, o), 201;
|
|
3742
|
+
} catch (y) {
|
|
3743
|
+
return console.error("%cstorage", x.STORAGE, K.WIDGET, o, y), 400;
|
|
3744
3744
|
}
|
|
3745
3745
|
});
|
|
3746
3746
|
/**
|
|
@@ -3748,8 +3748,8 @@ class Br {
|
|
|
3748
3748
|
* @param query IQuery
|
|
3749
3749
|
* @returns null
|
|
3750
3750
|
*/
|
|
3751
|
-
|
|
3752
|
-
(
|
|
3751
|
+
I(this, "subscribe", (o) => (o = nt(o), o.type === K.MESSAGES && (o = vt(this.options, o)), this.subscribers.filter(
|
|
3752
|
+
(y) => y.widget === o.widget
|
|
3753
3753
|
).length || (console.debug(
|
|
3754
3754
|
"%cstorage%c %csubscribe",
|
|
3755
3755
|
x.STORAGE,
|
|
@@ -3762,41 +3762,41 @@ class Br {
|
|
|
3762
3762
|
* Get current subscribers
|
|
3763
3763
|
* @returns IQuery[]
|
|
3764
3764
|
*/
|
|
3765
|
-
|
|
3766
|
-
this.options = o, Storage.prototype.setObject = function(
|
|
3767
|
-
this.setItem(
|
|
3768
|
-
}, Storage.prototype.getObject = function(
|
|
3769
|
-
const
|
|
3770
|
-
return
|
|
3765
|
+
I(this, "getSubscribers", async () => await new Promise((o) => o(this.subscribers)));
|
|
3766
|
+
this.options = o, Storage.prototype.setObject = function(l, y) {
|
|
3767
|
+
this.setItem(l, JSON.stringify(y));
|
|
3768
|
+
}, Storage.prototype.getObject = function(l) {
|
|
3769
|
+
const y = this.getItem(l);
|
|
3770
|
+
return y && JSON.parse(y);
|
|
3771
3771
|
};
|
|
3772
3772
|
}
|
|
3773
3773
|
}
|
|
3774
3774
|
class Nr {
|
|
3775
3775
|
constructor(o) {
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
const
|
|
3776
|
+
I(this, "subscribers", []);
|
|
3777
|
+
I(this, "options");
|
|
3778
|
+
I(this, "getCloud", async (o) => {
|
|
3779
|
+
const l = X(o);
|
|
3780
3780
|
try {
|
|
3781
|
-
return window.BuzzCasting.WidgetData[
|
|
3781
|
+
return window.BuzzCasting.WidgetData[l];
|
|
3782
3782
|
} catch {
|
|
3783
|
-
return console.warn("%capi", x.API,
|
|
3783
|
+
return console.warn("%capi", x.API, K.CLOUD, o.slide, o.widget), { data: null, message: "Cloud Data error", success: !1 };
|
|
3784
3784
|
}
|
|
3785
3785
|
});
|
|
3786
|
-
|
|
3787
|
-
const
|
|
3786
|
+
I(this, "getSeries", async (o) => {
|
|
3787
|
+
const l = X(o);
|
|
3788
3788
|
try {
|
|
3789
|
-
return window.BuzzCasting.WidgetData[
|
|
3789
|
+
return window.BuzzCasting.WidgetData[l];
|
|
3790
3790
|
} catch {
|
|
3791
|
-
return console.warn("%capi", x.API,
|
|
3791
|
+
return console.warn("%capi", x.API, K.SERIES, o.slide, o.widget), { data: null, message: "Series Data error", success: !1 };
|
|
3792
3792
|
}
|
|
3793
3793
|
});
|
|
3794
|
-
|
|
3795
|
-
const
|
|
3794
|
+
I(this, "getMessages", async (o) => {
|
|
3795
|
+
const l = X(o);
|
|
3796
3796
|
try {
|
|
3797
|
-
return window.BuzzCasting.WidgetData[
|
|
3797
|
+
return window.BuzzCasting.WidgetData[l];
|
|
3798
3798
|
} catch {
|
|
3799
|
-
return console.warn("%capi", x.API,
|
|
3799
|
+
return console.warn("%capi", x.API, K.MESSAGES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3800
3800
|
}
|
|
3801
3801
|
});
|
|
3802
3802
|
/**
|
|
@@ -3805,12 +3805,12 @@ class Nr {
|
|
|
3805
3805
|
* @param data
|
|
3806
3806
|
* @returns number
|
|
3807
3807
|
*/
|
|
3808
|
-
|
|
3809
|
-
const
|
|
3808
|
+
I(this, "setCloud", async (o, l) => {
|
|
3809
|
+
const y = X(o);
|
|
3810
3810
|
try {
|
|
3811
|
-
return window.BuzzCasting.WidgetData[
|
|
3812
|
-
} catch (
|
|
3813
|
-
return console.error("%cstorage", x.STORAGE, "set", o,
|
|
3811
|
+
return window.BuzzCasting.WidgetData[y] = l, 201;
|
|
3812
|
+
} catch (P) {
|
|
3813
|
+
return console.error("%cstorage", x.STORAGE, "set", o, P), 400;
|
|
3814
3814
|
}
|
|
3815
3815
|
});
|
|
3816
3816
|
/**
|
|
@@ -3819,12 +3819,12 @@ class Nr {
|
|
|
3819
3819
|
* @param data
|
|
3820
3820
|
* @returns number
|
|
3821
3821
|
*/
|
|
3822
|
-
|
|
3823
|
-
const
|
|
3822
|
+
I(this, "setSeries", async (o, l) => {
|
|
3823
|
+
const y = X(o);
|
|
3824
3824
|
try {
|
|
3825
|
-
return window.BuzzCasting.WidgetData[
|
|
3826
|
-
} catch (
|
|
3827
|
-
return console.error("%cstorage", x.STORAGE, "set", o,
|
|
3825
|
+
return window.BuzzCasting.WidgetData[y] = l, 201;
|
|
3826
|
+
} catch (P) {
|
|
3827
|
+
return console.error("%cstorage", x.STORAGE, "set", o, P), 400;
|
|
3828
3828
|
}
|
|
3829
3829
|
});
|
|
3830
3830
|
/**
|
|
@@ -3833,23 +3833,23 @@ class Nr {
|
|
|
3833
3833
|
* @param data
|
|
3834
3834
|
* @returns number
|
|
3835
3835
|
*/
|
|
3836
|
-
|
|
3837
|
-
const
|
|
3836
|
+
I(this, "setMessages", async (o, l) => {
|
|
3837
|
+
const y = X(o);
|
|
3838
3838
|
try {
|
|
3839
|
-
return window.BuzzCasting.WidgetData[
|
|
3840
|
-
} catch (
|
|
3841
|
-
return console.error("%cstorage", x.STORAGE, "set", o,
|
|
3839
|
+
return window.BuzzCasting.WidgetData[y] = l, 201;
|
|
3840
|
+
} catch (P) {
|
|
3841
|
+
return console.error("%cstorage", x.STORAGE, "set", o, P), 400;
|
|
3842
3842
|
}
|
|
3843
3843
|
});
|
|
3844
|
-
|
|
3844
|
+
I(this, "cleanMessages", async (o) => {
|
|
3845
3845
|
console.log("cleanMessages not implemented for ", this.options.storage);
|
|
3846
3846
|
});
|
|
3847
|
-
|
|
3848
|
-
const
|
|
3847
|
+
I(this, "setWidget", async (o) => {
|
|
3848
|
+
const l = `widget.${o.widget}`;
|
|
3849
3849
|
try {
|
|
3850
|
-
return window.BuzzCasting.WidgetData[
|
|
3851
|
-
} catch (
|
|
3852
|
-
return console.error("%cstorage", x.STORAGE,
|
|
3850
|
+
return window.BuzzCasting.WidgetData[l] = o, 201;
|
|
3851
|
+
} catch (y) {
|
|
3852
|
+
return console.error("%cstorage", x.STORAGE, K.WIDGET, o, y), 400;
|
|
3853
3853
|
}
|
|
3854
3854
|
});
|
|
3855
3855
|
/**
|
|
@@ -3857,8 +3857,8 @@ class Nr {
|
|
|
3857
3857
|
* @param query IQuery
|
|
3858
3858
|
* @returns null
|
|
3859
3859
|
*/
|
|
3860
|
-
|
|
3861
|
-
(
|
|
3860
|
+
I(this, "subscribe", (o) => (o = nt(o), o.type === K.MESSAGES && (o = vt(this.options, o)), this.subscribers.filter(
|
|
3861
|
+
(y) => y.widget === o.widget
|
|
3862
3862
|
).length || (console.debug(
|
|
3863
3863
|
"%cstorage%c %csubscribe",
|
|
3864
3864
|
x.STORAGE,
|
|
@@ -3871,98 +3871,101 @@ class Nr {
|
|
|
3871
3871
|
* Get current subscribers
|
|
3872
3872
|
* @returns IQuery[]
|
|
3873
3873
|
*/
|
|
3874
|
-
|
|
3874
|
+
I(this, "getSubscribers", async () => await new Promise((o) => o(this.subscribers)));
|
|
3875
3875
|
this.options = o, window.BuzzCasting.WidgetData = /* @__PURE__ */ new Set();
|
|
3876
3876
|
}
|
|
3877
3877
|
}
|
|
3878
|
-
function
|
|
3879
|
-
const o =
|
|
3880
|
-
for (let
|
|
3881
|
-
const
|
|
3882
|
-
|
|
3878
|
+
function Ii(v) {
|
|
3879
|
+
const o = [];
|
|
3880
|
+
for (let l = 0; l < v.length; l++) {
|
|
3881
|
+
const y = v.item(l);
|
|
3882
|
+
if (y != null && y.name) {
|
|
3883
|
+
const P = {};
|
|
3884
|
+
P[y.name] = y.value, o.push(P);
|
|
3885
|
+
}
|
|
3883
3886
|
}
|
|
3884
3887
|
return o;
|
|
3885
3888
|
}
|
|
3886
|
-
function
|
|
3889
|
+
function Ki(v) {
|
|
3887
3890
|
const o = {};
|
|
3888
|
-
for (let
|
|
3889
|
-
const
|
|
3890
|
-
|
|
3891
|
+
for (let l = 0; l < v.length; l++) {
|
|
3892
|
+
const y = v[l];
|
|
3893
|
+
y.name !== "class" && !y.name.includes("data") && (o[y.name] = y.value);
|
|
3891
3894
|
}
|
|
3892
3895
|
return o;
|
|
3893
3896
|
}
|
|
3894
|
-
function
|
|
3895
|
-
return v.replace(/(?:^\w|[A-Z]|\b\w)/g, (o,
|
|
3897
|
+
function Bi(v) {
|
|
3898
|
+
return v.replace(/(?:^\w|[A-Z]|\b\w)/g, (o, l) => l === 0 ? o.toLowerCase() : o.toUpperCase()).replace(/\s+/g, "");
|
|
3896
3899
|
}
|
|
3897
|
-
function
|
|
3898
|
-
return v.toLowerCase().split("-").reduce((o,
|
|
3900
|
+
function Ni(v) {
|
|
3901
|
+
return v.toLowerCase().split("-").reduce((o, l) => o + (l.charAt(0).toUpperCase() + l.slice(1)));
|
|
3899
3902
|
}
|
|
3900
|
-
function
|
|
3903
|
+
function Ci(v, o) {
|
|
3901
3904
|
for (; v.length < o; )
|
|
3902
3905
|
v = `0${v}`;
|
|
3903
3906
|
return v;
|
|
3904
3907
|
}
|
|
3905
3908
|
function Oe(v, o) {
|
|
3906
|
-
let
|
|
3909
|
+
let l, y, P;
|
|
3907
3910
|
if (o.length === 0)
|
|
3908
3911
|
return v;
|
|
3909
|
-
for (
|
|
3910
|
-
|
|
3912
|
+
for (l = 0, P = o.length; l < P; l++)
|
|
3913
|
+
y = o.charCodeAt(l), v = (v << 5) - v + y, v |= 0;
|
|
3911
3914
|
return v < 0 ? v * -2 : v;
|
|
3912
3915
|
}
|
|
3913
|
-
function
|
|
3914
|
-
return Object.keys(o).sort().reduce(
|
|
3915
|
-
function
|
|
3916
|
-
return Gr(
|
|
3916
|
+
function Ri(v, o, l) {
|
|
3917
|
+
return Object.keys(o).sort().reduce(y, v);
|
|
3918
|
+
function y(P, M) {
|
|
3919
|
+
return Gr(P, o[M], M, l);
|
|
3917
3920
|
}
|
|
3918
3921
|
}
|
|
3919
|
-
function Gr(v, o,
|
|
3920
|
-
const
|
|
3922
|
+
function Gr(v, o, l, y) {
|
|
3923
|
+
const P = Oe(Oe(Oe(v, l), Ti(o)), typeof o);
|
|
3921
3924
|
if (o === null)
|
|
3922
|
-
return Oe(
|
|
3925
|
+
return Oe(P, "null");
|
|
3923
3926
|
if (o === void 0)
|
|
3924
|
-
return Oe(
|
|
3927
|
+
return Oe(P, "undefined");
|
|
3925
3928
|
if (typeof o == "object" || typeof o == "function") {
|
|
3926
|
-
if (
|
|
3927
|
-
return Oe(
|
|
3928
|
-
|
|
3929
|
-
const
|
|
3929
|
+
if (y.includes(o))
|
|
3930
|
+
return Oe(P, `[Circular]${l}`);
|
|
3931
|
+
y.push(o);
|
|
3932
|
+
const M = Ri(P, o, y);
|
|
3930
3933
|
if (!("valueOf" in o) || typeof o.valueOf != "function")
|
|
3931
|
-
return
|
|
3934
|
+
return M;
|
|
3932
3935
|
try {
|
|
3933
|
-
return Oe(
|
|
3936
|
+
return Oe(M, String(o.valueOf()));
|
|
3934
3937
|
} catch (j) {
|
|
3935
|
-
return Oe(
|
|
3938
|
+
return Oe(M, `[valueOf exception]${j.stack || j.message}`);
|
|
3936
3939
|
}
|
|
3937
3940
|
}
|
|
3938
|
-
return Oe(
|
|
3941
|
+
return Oe(P, o.toString());
|
|
3939
3942
|
}
|
|
3940
|
-
function
|
|
3943
|
+
function Ti(v) {
|
|
3941
3944
|
return Object.prototype.toString.call(v);
|
|
3942
3945
|
}
|
|
3943
3946
|
function Fn(v) {
|
|
3944
|
-
return
|
|
3947
|
+
return Ci(Gr(0, v, "", []).toString(16), 8);
|
|
3945
3948
|
}
|
|
3946
3949
|
class Gi {
|
|
3947
3950
|
constructor(o) {
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3951
|
+
I(this, "sm");
|
|
3952
|
+
I(this, "api");
|
|
3953
|
+
I(this, "bc");
|
|
3954
|
+
I(this, "options");
|
|
3955
|
+
I(this, "update", async (o) => {
|
|
3953
3956
|
if (this.sm === null)
|
|
3954
3957
|
return;
|
|
3955
|
-
const
|
|
3956
|
-
if (
|
|
3958
|
+
const l = await this.sm.getSubscribers();
|
|
3959
|
+
if (l.length === 0)
|
|
3957
3960
|
return;
|
|
3958
|
-
const
|
|
3959
|
-
o ?
|
|
3960
|
-
|
|
3961
|
-
}), await Promise.allSettled(
|
|
3962
|
-
(
|
|
3961
|
+
const y = [];
|
|
3962
|
+
o ? y.push(this.api.get(o)) : l == null || l.forEach((P) => {
|
|
3963
|
+
y.push(this.api.get(P));
|
|
3964
|
+
}), await Promise.allSettled(y).then(
|
|
3965
|
+
(P) => P.forEach(async (M) => {
|
|
3963
3966
|
let j = 400;
|
|
3964
|
-
if (
|
|
3965
|
-
const N =
|
|
3967
|
+
if (M.status === "fulfilled") {
|
|
3968
|
+
const N = M.value;
|
|
3966
3969
|
if (this.sm === null)
|
|
3967
3970
|
return 400;
|
|
3968
3971
|
if (N.success === !0) {
|
|
@@ -3971,37 +3974,37 @@ class Gi {
|
|
|
3971
3974
|
)[0];
|
|
3972
3975
|
let te = "";
|
|
3973
3976
|
switch (N.query.type) {
|
|
3974
|
-
case
|
|
3977
|
+
case K.MESSAGES:
|
|
3975
3978
|
if (te = Fn(N.data.messages), Z.hash === te)
|
|
3976
3979
|
return console.debug(
|
|
3977
3980
|
"%capi%c %cno updates",
|
|
3978
3981
|
x.API,
|
|
3979
3982
|
x.NONE,
|
|
3980
3983
|
x.NO_UPDATES,
|
|
3981
|
-
|
|
3984
|
+
K.MESSAGES,
|
|
3982
3985
|
N.query.slide,
|
|
3983
3986
|
N.query.widget
|
|
3984
3987
|
), 204;
|
|
3985
3988
|
Z.hash = te, j = await this.sm.setMessages(N.query, N);
|
|
3986
3989
|
break;
|
|
3987
|
-
case
|
|
3990
|
+
case K.CLOUD:
|
|
3988
3991
|
te = Fn(N.data), Z.hash === te ? (console.debug(
|
|
3989
3992
|
"%capi%c %cno updates",
|
|
3990
3993
|
x.API,
|
|
3991
3994
|
x.NONE,
|
|
3992
3995
|
x.NO_UPDATES,
|
|
3993
|
-
|
|
3996
|
+
K.CLOUD,
|
|
3994
3997
|
N.query.slide,
|
|
3995
3998
|
N.query.widget
|
|
3996
3999
|
), j = 204) : (Z.hash = te, j = await this.sm.setCloud(N.query, N));
|
|
3997
4000
|
break;
|
|
3998
|
-
case
|
|
4001
|
+
case K.SERIES:
|
|
3999
4002
|
te = Fn(N.data), Z.hash === te ? (console.debug(
|
|
4000
4003
|
"%capi%c %cno updates",
|
|
4001
4004
|
x.API,
|
|
4002
4005
|
x.NONE,
|
|
4003
4006
|
x.NO_UPDATES,
|
|
4004
|
-
|
|
4007
|
+
K.SERIES,
|
|
4005
4008
|
N.query.slide,
|
|
4006
4009
|
N.query.widget
|
|
4007
4010
|
), j = 204) : (Z.hash = te, j = await this.sm.setSeries(N.query, N));
|
|
@@ -4052,14 +4055,14 @@ class Gi {
|
|
|
4052
4055
|
})
|
|
4053
4056
|
);
|
|
4054
4057
|
});
|
|
4055
|
-
|
|
4058
|
+
I(this, "hide", (o) => {
|
|
4056
4059
|
this.api.hideMessage(o);
|
|
4057
4060
|
});
|
|
4058
|
-
|
|
4059
|
-
var
|
|
4061
|
+
I(this, "actions", async (o) => {
|
|
4062
|
+
var l;
|
|
4060
4063
|
switch (o.data.event) {
|
|
4061
4064
|
case ue.SUBSCRIBE:
|
|
4062
|
-
(
|
|
4065
|
+
(l = this.sm) == null || l.subscribe(o.data.data);
|
|
4063
4066
|
break;
|
|
4064
4067
|
case ue.UPDATE:
|
|
4065
4068
|
console.debug(
|
|
@@ -4073,15 +4076,15 @@ class Gi {
|
|
|
4073
4076
|
break;
|
|
4074
4077
|
}
|
|
4075
4078
|
});
|
|
4076
|
-
|
|
4077
|
-
var
|
|
4078
|
-
const o = ((
|
|
4079
|
-
return await ((
|
|
4079
|
+
I(this, "cleanMessages", async () => {
|
|
4080
|
+
var l, y;
|
|
4081
|
+
const o = ((l = this.options) == null ? void 0 : l.retention) || 345600;
|
|
4082
|
+
return await ((y = this.sm) == null ? void 0 : y.cleanMessages(o));
|
|
4080
4083
|
});
|
|
4081
4084
|
// TODO: add checksum to avoid broadcasting update
|
|
4082
4085
|
// private setHash(widget: string) {
|
|
4083
4086
|
// }
|
|
4084
|
-
|
|
4087
|
+
I(this, "getSubscribers", async () => {
|
|
4085
4088
|
var o;
|
|
4086
4089
|
return await ((o = this.sm) == null ? void 0 : o.getSubscribers());
|
|
4087
4090
|
});
|
|
@@ -4094,16 +4097,16 @@ class Gi {
|
|
|
4094
4097
|
ue.VERSION,
|
|
4095
4098
|
xi
|
|
4096
4099
|
), this.options = o, this.sm = null;
|
|
4097
|
-
const
|
|
4098
|
-
switch (this.bc = new BroadcastChannel(
|
|
4100
|
+
const l = (o == null ? void 0 : o.slide) || o.app;
|
|
4101
|
+
switch (this.bc = new BroadcastChannel(l), console.info(
|
|
4099
4102
|
"%capi%c %cbroadcast",
|
|
4100
4103
|
x.API,
|
|
4101
4104
|
x.NONE,
|
|
4102
4105
|
x.BROADCAST,
|
|
4103
4106
|
ue.CHANNEL,
|
|
4104
|
-
|
|
4105
|
-
), this.bc.onmessage = (
|
|
4106
|
-
this.actions(
|
|
4107
|
+
l
|
|
4108
|
+
), this.bc.onmessage = (y) => {
|
|
4109
|
+
this.actions(y);
|
|
4107
4110
|
}, this.bc.postMessage({ event: ue.STORAGE_INIT, data: {} }), this.api = new ki(o), o.storage) {
|
|
4108
4111
|
case he.DEXIE:
|
|
4109
4112
|
this.sm = new Tr(o);
|
|
@@ -4123,17 +4126,17 @@ class Gi {
|
|
|
4123
4126
|
}
|
|
4124
4127
|
}
|
|
4125
4128
|
}
|
|
4126
|
-
class
|
|
4129
|
+
class ji {
|
|
4127
4130
|
constructor(o) {
|
|
4128
|
-
|
|
4131
|
+
I(this, "sm");
|
|
4129
4132
|
/**
|
|
4130
4133
|
* Retieve Cloud Data
|
|
4131
4134
|
* @param query Widgets parameters, type "cloud"
|
|
4132
4135
|
* @returns IResponse
|
|
4133
4136
|
*/
|
|
4134
|
-
|
|
4135
|
-
var
|
|
4136
|
-
return o.type !==
|
|
4137
|
+
I(this, "getCloud", async (o) => {
|
|
4138
|
+
var l;
|
|
4139
|
+
return o.type !== K.CLOUD ? (console.warn(
|
|
4137
4140
|
"%capp%c %get",
|
|
4138
4141
|
x.APP,
|
|
4139
4142
|
x.NONE,
|
|
@@ -4145,16 +4148,16 @@ class Mi {
|
|
|
4145
4148
|
data: null,
|
|
4146
4149
|
message: `'wrong method call for getMessages, type used is ${o.type}`,
|
|
4147
4150
|
success: !1
|
|
4148
|
-
}) : await ((
|
|
4151
|
+
}) : await ((l = this.sm) == null ? void 0 : l.getCloud(o));
|
|
4149
4152
|
});
|
|
4150
4153
|
/**
|
|
4151
4154
|
* Retieve Message Data
|
|
4152
4155
|
* @param query Widgets parameters, type "messages"
|
|
4153
4156
|
* @returns IResponse
|
|
4154
4157
|
*/
|
|
4155
|
-
|
|
4156
|
-
var
|
|
4157
|
-
return o.type !==
|
|
4158
|
+
I(this, "getMessages", async (o) => {
|
|
4159
|
+
var l;
|
|
4160
|
+
return o.type !== K.MESSAGES ? (console.warn(
|
|
4158
4161
|
"%capp%c %get",
|
|
4159
4162
|
x.APP,
|
|
4160
4163
|
x.NONE,
|
|
@@ -4166,16 +4169,16 @@ class Mi {
|
|
|
4166
4169
|
data: null,
|
|
4167
4170
|
message: `'wrong method call for getMessages, type used is ${o.type}`,
|
|
4168
4171
|
success: !1
|
|
4169
|
-
}) : await ((
|
|
4172
|
+
}) : await ((l = this.sm) == null ? void 0 : l.getMessages(o));
|
|
4170
4173
|
});
|
|
4171
4174
|
/**
|
|
4172
4175
|
* Retrieve Series Data
|
|
4173
4176
|
* @param query Widgets parameters, type "series"
|
|
4174
4177
|
* @returns IResponse
|
|
4175
4178
|
*/
|
|
4176
|
-
|
|
4177
|
-
var
|
|
4178
|
-
return o.type !==
|
|
4179
|
+
I(this, "getSeries", async (o) => {
|
|
4180
|
+
var l;
|
|
4181
|
+
return o.type !== K.SERIES ? (console.warn(
|
|
4179
4182
|
"%capp%c %get",
|
|
4180
4183
|
x.APP,
|
|
4181
4184
|
x.NONE,
|
|
@@ -4187,7 +4190,7 @@ class Mi {
|
|
|
4187
4190
|
data: null,
|
|
4188
4191
|
message: `'wrong method call for getSeries, type used is ${o.type}`,
|
|
4189
4192
|
success: !1
|
|
4190
|
-
}) : await ((
|
|
4193
|
+
}) : await ((l = this.sm) == null ? void 0 : l.getSeries(o));
|
|
4191
4194
|
});
|
|
4192
4195
|
switch (this.sm = null, o.storage) {
|
|
4193
4196
|
case he.DEXIE:
|
|
@@ -4208,7 +4211,7 @@ class Mi {
|
|
|
4208
4211
|
}
|
|
4209
4212
|
}
|
|
4210
4213
|
}
|
|
4211
|
-
var
|
|
4214
|
+
var K = /* @__PURE__ */ ((v) => (v.MESSAGES = "messages", v.CLOUD = "cloud", v.SERIES = "series", v.TOPICS = "topics", v.WIDGET = "widget", v.WIDGETS = "widgets", v))(K || {}), x = /* @__PURE__ */ ((v) => (v.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", v.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", v.BROADCAST = "color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", v.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", v.CLOUD = "color:grey;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", v.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", v.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", v.MESSAGES = "color:grey;background-color:tan;padding:0 4px 0 4px;border-radius:5px;", v.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", v.NONE = "color:transparent;background-color:transparent;", v.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", v.SERIES = "color:grey;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", v.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", v.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", v.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", v.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", v.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", v))(x || {}), ue = /* @__PURE__ */ ((v) => (v.ADD_SLIDE = "addSlide", v.APP_READY = "appReady", v.API_UPDATE = "apiUpdate", v.APPROVE_MESSAGE = "approveMessage", v.CHANNEL = "channel", v.ERROR = "error", v.GOTO_SLIDE = "gotoSlide", v.HIDE_MESSAGE = "hideMessage", v.NEXT_SLIDE = "nextSlide", v.PAUSE_PRESENTATION = "pausePresentation", v.PRESENTATION_READY = "presentationReady", v.PREV_SLIDE = "prevSlide", v.RELOAD_PRESENTATION = "reloadPresentation", v.SHOW_MODAL = "showModal", v.STAR_MESSAGE = "starMessage", v.SLIDE_DID_LOAD = "slideDidLoad", v.SLIDE_GOTO = "slideGoto", v.SLIDE_READY = "slideReady", v.SLIDE_TRANSITIONER = "slideTransitioner", v.START_TRANSITIONER = "startTransitioner", v.STORAGE_INIT = "stroageInit", v.SUBSCRIBE = "subscribe", v.UPDATE = "update", v.VERSION = "version", v.WIDGET_UPDATE = "widgetUpdate", v))(ue || {}), Xt = /* @__PURE__ */ ((v) => (v.APPROVED = "approved", v.BEFORE = "before", v.DELAYED = "delayed", v.NONE = "none", v.REALTIME = "realtime", v))(Xt || {}), he = /* @__PURE__ */ ((v) => (v.KEYVAL = "keyval", v.LOCAL = "local", v.SESSION = "session", v.DEXIE = "dexie", v.WINDOW = "window", v))(he || {});
|
|
4212
4215
|
class Li {
|
|
4213
4216
|
/**
|
|
4214
4217
|
* Main container for managing widgets and data updates
|
|
@@ -4217,24 +4220,24 @@ class Li {
|
|
|
4217
4220
|
* @param callbacks functions in the widget that will receive the update
|
|
4218
4221
|
* @param selector container for the element - by default buzzcasting-slide (optional)
|
|
4219
4222
|
*/
|
|
4220
|
-
constructor(o,
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4223
|
+
constructor(o, l, y) {
|
|
4224
|
+
I(this, "storageReader");
|
|
4225
|
+
I(this, "broadcastChannel");
|
|
4226
|
+
I(this, "element");
|
|
4227
|
+
I(this, "query");
|
|
4228
|
+
I(this, "listeners");
|
|
4226
4229
|
/**
|
|
4227
4230
|
* Generic call to any query type
|
|
4228
4231
|
*
|
|
4229
4232
|
* @returns IResponse
|
|
4230
4233
|
*/
|
|
4231
|
-
|
|
4234
|
+
I(this, "getData", async () => {
|
|
4232
4235
|
switch (this.query.type) {
|
|
4233
|
-
case
|
|
4236
|
+
case K.CLOUD:
|
|
4234
4237
|
return await this.getCloud();
|
|
4235
|
-
case
|
|
4238
|
+
case K.MESSAGES:
|
|
4236
4239
|
return await this.getMessages();
|
|
4237
|
-
case
|
|
4240
|
+
case K.SERIES:
|
|
4238
4241
|
return await this.getSeries();
|
|
4239
4242
|
}
|
|
4240
4243
|
return {
|
|
@@ -4248,7 +4251,7 @@ class Li {
|
|
|
4248
4251
|
*
|
|
4249
4252
|
* @returns IResponse
|
|
4250
4253
|
*/
|
|
4251
|
-
|
|
4254
|
+
I(this, "getCloud", async () => this.query.type !== K.CLOUD ? (console.warn(
|
|
4252
4255
|
"%cstorage%c %cwidget",
|
|
4253
4256
|
x.STORAGE,
|
|
4254
4257
|
x.NONE,
|
|
@@ -4266,7 +4269,7 @@ class Li {
|
|
|
4266
4269
|
*
|
|
4267
4270
|
* @returns IResponse
|
|
4268
4271
|
*/
|
|
4269
|
-
|
|
4272
|
+
I(this, "getMessages", async () => this.query.type !== K.MESSAGES ? (console.warn(
|
|
4270
4273
|
"%cstorage%c %cwidget",
|
|
4271
4274
|
x.STORAGE,
|
|
4272
4275
|
x.NONE,
|
|
@@ -4284,7 +4287,7 @@ class Li {
|
|
|
4284
4287
|
*
|
|
4285
4288
|
* @returns IResponse
|
|
4286
4289
|
*/
|
|
4287
|
-
|
|
4290
|
+
I(this, "getSeries", async () => this.query.type !== K.SERIES ? (console.warn(
|
|
4288
4291
|
"%cstorage%c %cwidget",
|
|
4289
4292
|
x.STORAGE,
|
|
4290
4293
|
x.NONE,
|
|
@@ -4303,32 +4306,38 @@ class Li {
|
|
|
4303
4306
|
*
|
|
4304
4307
|
* @param modal IModal
|
|
4305
4308
|
*/
|
|
4306
|
-
|
|
4307
|
-
const
|
|
4309
|
+
I(this, "showModal", (o) => {
|
|
4310
|
+
const l = Ii(this.element.attributes);
|
|
4311
|
+
if (l.includes("data-topics")) {
|
|
4312
|
+
const M = l["data-topics"].split("-");
|
|
4313
|
+
l["data-widget"] = M[1], l["data-dashboard"] = M[0];
|
|
4314
|
+
}
|
|
4315
|
+
const y = { ...o.props, ...l };
|
|
4308
4316
|
console.debug(
|
|
4309
4317
|
"%cwidget",
|
|
4310
4318
|
x.WIDGET,
|
|
4311
4319
|
ue.SHOW_MODAL,
|
|
4312
4320
|
o.showComponent,
|
|
4313
|
-
|
|
4321
|
+
// @ts-expect-error cannot get string type out of IFilteredAttributes props
|
|
4322
|
+
l["data-widget"]
|
|
4314
4323
|
);
|
|
4315
|
-
const
|
|
4324
|
+
const P = new CustomEvent(ue.SHOW_MODAL, {
|
|
4316
4325
|
detail: {
|
|
4317
4326
|
component: o.showComponent,
|
|
4318
|
-
props:
|
|
4327
|
+
props: y
|
|
4319
4328
|
},
|
|
4320
4329
|
bubbles: !0,
|
|
4321
4330
|
cancelable: !0,
|
|
4322
4331
|
composed: !0
|
|
4323
4332
|
});
|
|
4324
|
-
window.dispatchEvent(
|
|
4333
|
+
window.dispatchEvent(P);
|
|
4325
4334
|
});
|
|
4326
4335
|
var j;
|
|
4327
|
-
this.element = o, this.listeners =
|
|
4328
|
-
let
|
|
4329
|
-
|
|
4330
|
-
const
|
|
4331
|
-
this.storageReader = new
|
|
4336
|
+
this.element = o, this.listeners = l, y = typeof y < "u" ? y : "buzzcasting-slide";
|
|
4337
|
+
let P;
|
|
4338
|
+
P = { ...o.dataset }, delete P.hmr, P.slide = ((j = o.closest(y.toUpperCase())) == null ? void 0 : j.id) ?? `${y} not found`, P = nt(P), this.query = P;
|
|
4339
|
+
const M = window.BuzzCasting.getOptions();
|
|
4340
|
+
this.storageReader = new ji(M), this.broadcastChannel = new BroadcastChannel(P.slide), this.startListener();
|
|
4332
4341
|
}
|
|
4333
4342
|
addListener(o) {
|
|
4334
4343
|
this.listeners.push(o);
|
|
@@ -4338,12 +4347,12 @@ class Li {
|
|
|
4338
4347
|
*/
|
|
4339
4348
|
startListener() {
|
|
4340
4349
|
const o = this.query;
|
|
4341
|
-
this.broadcastChannel.onmessage = async (
|
|
4342
|
-
const
|
|
4343
|
-
switch (
|
|
4350
|
+
this.broadcastChannel.onmessage = async (l) => {
|
|
4351
|
+
const y = l.data.data;
|
|
4352
|
+
switch (l.data.event) {
|
|
4344
4353
|
case ue.WIDGET_UPDATE:
|
|
4345
|
-
|
|
4346
|
-
|
|
4354
|
+
y.query.slide === o.slide && y.query.widget === o.widget && this.listeners.forEach((P) => {
|
|
4355
|
+
P(l.data.data);
|
|
4347
4356
|
});
|
|
4348
4357
|
break;
|
|
4349
4358
|
case ue.SLIDE_READY:
|
|
@@ -4374,16 +4383,16 @@ class Li {
|
|
|
4374
4383
|
}
|
|
4375
4384
|
}
|
|
4376
4385
|
export {
|
|
4377
|
-
|
|
4386
|
+
K as API,
|
|
4378
4387
|
Gi as BuzzcastingStorageManager,
|
|
4379
|
-
|
|
4388
|
+
ji as BuzzcastingStorageReader,
|
|
4380
4389
|
x as CSS,
|
|
4381
4390
|
ue as EVENTS,
|
|
4382
4391
|
Xt as MODERATION,
|
|
4383
4392
|
he as STORAGE,
|
|
4384
4393
|
Li as Widget,
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4394
|
+
Ni as camelCase,
|
|
4395
|
+
Bi as camelize,
|
|
4396
|
+
Ki as filterAttributes,
|
|
4388
4397
|
nt as widgetParams
|
|
4389
4398
|
};
|