buzzcasting-storage 2.0.5 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/buzzcasting-storage.esm.js +547 -552
- package/package.json +1 -1
|
@@ -1,74 +1,74 @@
|
|
|
1
1
|
var yi = Object.defineProperty;
|
|
2
|
-
var mi = (M,
|
|
3
|
-
var A = (M,
|
|
2
|
+
var mi = (M, a, v) => a in M ? yi(M, a, { enumerable: !0, configurable: !0, writable: !0, value: v }) : M[a] = v;
|
|
3
|
+
var A = (M, a, v) => (mi(M, typeof a != "symbol" ? a + "" : a, v), v);
|
|
4
4
|
const Ne = "messages", Cr = "cloud", Fn = "series", gi = "topics", vi = "keyval", bi = "local", wi = "session", _i = "dexie", ki = "window", pt = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", Bn = "color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", yt = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;";
|
|
5
5
|
class xi {
|
|
6
|
-
constructor(
|
|
6
|
+
constructor(a) {
|
|
7
7
|
A(this, "options");
|
|
8
8
|
A(this, "url");
|
|
9
9
|
A(this, "headers", () => {
|
|
10
|
-
const
|
|
10
|
+
const a = `Bearer ${this.options.bearer}`;
|
|
11
11
|
return {
|
|
12
12
|
headers: new Headers({
|
|
13
|
-
Authorization:
|
|
13
|
+
Authorization: a,
|
|
14
14
|
Accept: "application/json"
|
|
15
15
|
// 'X-Session-Key': localStorage.getItem('guid') || 'invalid',
|
|
16
16
|
})
|
|
17
17
|
};
|
|
18
18
|
});
|
|
19
|
-
this.options =
|
|
19
|
+
this.options = a, this.url = `https://${a.app}.buzzcasting.net`;
|
|
20
20
|
}
|
|
21
21
|
auth() {
|
|
22
22
|
var v;
|
|
23
23
|
if (!((v = this.options) != null && v.token))
|
|
24
24
|
return;
|
|
25
|
-
let
|
|
25
|
+
let a = "";
|
|
26
26
|
switch (this.options.token) {
|
|
27
27
|
case "meta":
|
|
28
|
-
|
|
28
|
+
a = `Bearer ${this.options.bearer}`;
|
|
29
29
|
break;
|
|
30
30
|
}
|
|
31
31
|
return {
|
|
32
32
|
headers: new Headers({
|
|
33
|
-
Authorization:
|
|
33
|
+
Authorization: a
|
|
34
34
|
// 'X-Session-Key': localStorage.getItem('guid') || 'invalid',
|
|
35
35
|
})
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
async get(
|
|
39
|
-
const { version: v } = this.options, _ = this.headers(), j = Object.assign({},
|
|
38
|
+
async get(a) {
|
|
39
|
+
const { version: v } = this.options, _ = this.headers(), j = Object.assign({}, a);
|
|
40
40
|
delete j.slide, delete j.type;
|
|
41
41
|
const F = Object.keys(j).length > 0 ? `?${new URLSearchParams(j).toString()}` : "";
|
|
42
42
|
return console.debug(
|
|
43
43
|
"%capi",
|
|
44
44
|
yt,
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
a.slide,
|
|
46
|
+
a.widget
|
|
47
47
|
), await fetch(
|
|
48
|
-
[this.url, "api", v,
|
|
48
|
+
[this.url, "api", v, a.type].join("/") + F,
|
|
49
49
|
{ ..._, method: "get" }
|
|
50
|
-
).then(async (
|
|
51
|
-
if (!
|
|
52
|
-
throw new Error(`${
|
|
53
|
-
return
|
|
54
|
-
}).then((
|
|
50
|
+
).then(async (B) => {
|
|
51
|
+
if (!B.ok)
|
|
52
|
+
throw new Error(`${B.status}`);
|
|
53
|
+
return B;
|
|
54
|
+
}).then((B) => B.json()).then((B) => (B.query = a, B)).catch((B) => ({ succes: !1, status: parseInt(B), data: [] }));
|
|
55
55
|
}
|
|
56
|
-
async hideMessage(
|
|
56
|
+
async hideMessage(a) {
|
|
57
57
|
const { app: v, version: _ } = this.options, j = this.auth(), F = "?action=visible";
|
|
58
58
|
return console.info(
|
|
59
59
|
"%capi",
|
|
60
60
|
yt,
|
|
61
61
|
"hide",
|
|
62
|
-
[v, "api", _,
|
|
62
|
+
[v, "api", _, a.type, a.id].join("/") + F,
|
|
63
63
|
{ ...j, method: "put" }
|
|
64
64
|
), await fetch(
|
|
65
|
-
[v, "api", _,
|
|
65
|
+
[v, "api", _, a.type, a.id].join("/") + F,
|
|
66
66
|
{ ...j, method: "put" }
|
|
67
|
-
).then((
|
|
68
|
-
if (!
|
|
69
|
-
throw new Error(
|
|
70
|
-
return
|
|
71
|
-
}).then((
|
|
67
|
+
).then((B) => {
|
|
68
|
+
if (!B.ok)
|
|
69
|
+
throw new Error(B.statusText);
|
|
70
|
+
return B;
|
|
71
|
+
}).then((B) => B.json()).catch((B) => ({ succes: !1, message: B, data: [] }));
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
var Pr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
@@ -76,7 +76,7 @@ function Oi(M) {
|
|
|
76
76
|
return M && M.__esModule && Object.prototype.hasOwnProperty.call(M, "default") ? M.default : M;
|
|
77
77
|
}
|
|
78
78
|
var Kr = { exports: {} };
|
|
79
|
-
(function(M,
|
|
79
|
+
(function(M, a) {
|
|
80
80
|
(function(v, _) {
|
|
81
81
|
M.exports = _();
|
|
82
82
|
})(Pr, function() {
|
|
@@ -101,19 +101,19 @@ var Kr = { exports: {} };
|
|
|
101
101
|
!r && i in t || ((r = r || Array.prototype.slice.call(t, 0, i))[i] = t[i]);
|
|
102
102
|
return e.concat(r || Array.prototype.slice.call(t));
|
|
103
103
|
}
|
|
104
|
-
var F = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Pr,
|
|
104
|
+
var F = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Pr, B = Object.keys, W = Array.isArray;
|
|
105
105
|
function q(e, t) {
|
|
106
|
-
return typeof t != "object" ||
|
|
106
|
+
return typeof t != "object" || B(t).forEach(function(n) {
|
|
107
107
|
e[n] = t[n];
|
|
108
108
|
}), e;
|
|
109
109
|
}
|
|
110
110
|
typeof Promise > "u" || F.Promise || (F.Promise = Promise);
|
|
111
|
-
var oe = Object.getPrototypeOf,
|
|
111
|
+
var oe = Object.getPrototypeOf, Z = {}.hasOwnProperty;
|
|
112
112
|
function ne(e, t) {
|
|
113
|
-
return
|
|
113
|
+
return Z.call(e, t);
|
|
114
114
|
}
|
|
115
115
|
function ze(e, t) {
|
|
116
|
-
typeof t == "function" && (t = t(oe(e))), (typeof Reflect > "u" ?
|
|
116
|
+
typeof t == "function" && (t = t(oe(e))), (typeof Reflect > "u" ? B : Reflect.ownKeys)(t).forEach(function(n) {
|
|
117
117
|
we(e, n, t[n]);
|
|
118
118
|
});
|
|
119
119
|
}
|
|
@@ -152,10 +152,10 @@ var Kr = { exports: {} };
|
|
|
152
152
|
}
|
|
153
153
|
return n;
|
|
154
154
|
}
|
|
155
|
-
var
|
|
156
|
-
if (
|
|
157
|
-
var u = e[t.substr(0,
|
|
158
|
-
return u == null ? void 0 : ye(u, t.substr(
|
|
155
|
+
var s = t.indexOf(".");
|
|
156
|
+
if (s !== -1) {
|
|
157
|
+
var u = e[t.substr(0, s)];
|
|
158
|
+
return u == null ? void 0 : ye(u, t.substr(s + 1));
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
function ce(e, t, n) {
|
|
@@ -165,8 +165,8 @@ var Kr = { exports: {} };
|
|
|
165
165
|
for (var r = 0, i = t.length; r < i; ++r)
|
|
166
166
|
ce(e, t[r], n[r]);
|
|
167
167
|
} else {
|
|
168
|
-
var o,
|
|
169
|
-
u !== -1 ? (o = t.substr(0, u), (
|
|
168
|
+
var o, s, u = t.indexOf(".");
|
|
169
|
+
u !== -1 ? (o = t.substr(0, u), (s = t.substr(u + 1)) === "" ? n === void 0 ? W(e) && !isNaN(parseInt(o)) ? e.splice(o, 1) : delete e[o] : e[o] = n : ce(u = !(u = e[o]) || !ne(e, o) ? e[o] = {} : u, s, n)) : n === void 0 ? W(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n;
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
function Vn(e) {
|
|
@@ -202,9 +202,9 @@ var Kr = { exports: {} };
|
|
|
202
202
|
} else if (Yn.has(n.constructor))
|
|
203
203
|
r = n;
|
|
204
204
|
else {
|
|
205
|
-
var
|
|
206
|
-
for (
|
|
207
|
-
ne(n,
|
|
205
|
+
var s, u = oe(n);
|
|
206
|
+
for (s in r = u === Object.prototype ? {} : Object.create(u), qe.set(n, r), n)
|
|
207
|
+
ne(n, s) && (r[s] = t(n[s]));
|
|
208
208
|
}
|
|
209
209
|
return r;
|
|
210
210
|
}(e), qe = null, e;
|
|
@@ -378,10 +378,10 @@ var Kr = { exports: {} };
|
|
|
378
378
|
if (r._state === null) {
|
|
379
379
|
if (o === r)
|
|
380
380
|
throw new TypeError("A promise cannot be resolved with itself.");
|
|
381
|
-
var
|
|
381
|
+
var s = r._lib && Ve();
|
|
382
382
|
o && typeof o.then == "function" ? n(r, function(u, h) {
|
|
383
383
|
o instanceof K ? o._then(u, h) : o.then(u, h);
|
|
384
|
-
}) : (r._state = !0, r._value = o, qn(r)),
|
|
384
|
+
}) : (r._state = !0, r._value = o, qn(r)), s && Ge();
|
|
385
385
|
}
|
|
386
386
|
}, tn.bind(null, r));
|
|
387
387
|
} catch (o) {
|
|
@@ -392,8 +392,8 @@ var Kr = { exports: {} };
|
|
|
392
392
|
var en = { get: function() {
|
|
393
393
|
var e = D, t = Et;
|
|
394
394
|
function n(r, i) {
|
|
395
|
-
var o = this,
|
|
396
|
-
nn(o, new Zn(tr(r, e,
|
|
395
|
+
var o = this, s = !e.global && (e !== D || t !== Et), u = s && !Oe(), h = new K(function(l, m) {
|
|
396
|
+
nn(o, new Zn(tr(r, e, s, u), tr(i, e, s, u), l, m, e));
|
|
397
397
|
});
|
|
398
398
|
return this._consoleTask && (h._consoleTask = this._consoleTask), h;
|
|
399
399
|
}
|
|
@@ -437,9 +437,9 @@ var Kr = { exports: {} };
|
|
|
437
437
|
!t._state && _t.length && (_t = []), r = fe && t._consoleTask ? t._consoleTask.run(function() {
|
|
438
438
|
return e(i);
|
|
439
439
|
}) : e(i), t._state || _t.indexOf(i) !== -1 || function(o) {
|
|
440
|
-
for (var
|
|
441
|
-
if (Ae[--
|
|
442
|
-
return Ae.splice(
|
|
440
|
+
for (var s = Ae.length; s; )
|
|
441
|
+
if (Ae[--s]._value === o._value)
|
|
442
|
+
return Ae.splice(s, 1);
|
|
443
443
|
}(t), n.resolve(r);
|
|
444
444
|
} catch (o) {
|
|
445
445
|
n.reject(o);
|
|
@@ -526,8 +526,8 @@ var Kr = { exports: {} };
|
|
|
526
526
|
e.length === 0 && t([]);
|
|
527
527
|
var r = e.length;
|
|
528
528
|
e.forEach(function(i, o) {
|
|
529
|
-
return K.resolve(i).then(function(
|
|
530
|
-
e[o] =
|
|
529
|
+
return K.resolve(i).then(function(s) {
|
|
530
|
+
e[o] = s, --r || t(e);
|
|
531
531
|
}, n);
|
|
532
532
|
});
|
|
533
533
|
});
|
|
@@ -559,8 +559,8 @@ var Kr = { exports: {} };
|
|
|
559
559
|
} }, follow: function(e, t) {
|
|
560
560
|
return new K(function(n, r) {
|
|
561
561
|
return xe(function(i, o) {
|
|
562
|
-
var
|
|
563
|
-
|
|
562
|
+
var s = D;
|
|
563
|
+
s.unhandleds = [], s.onunhandled = o, s.finalize = Ke(function() {
|
|
564
564
|
var u, h = this;
|
|
565
565
|
u = function() {
|
|
566
566
|
h.unhandleds.length === 0 ? i() : o(h.unhandleds[0]);
|
|
@@ -569,7 +569,7 @@ var Kr = { exports: {} };
|
|
|
569
569
|
}), ++De, it(function() {
|
|
570
570
|
--De == 0 && rn();
|
|
571
571
|
}, []);
|
|
572
|
-
},
|
|
572
|
+
}, s.finalize), e();
|
|
573
573
|
}, t, n, r);
|
|
574
574
|
});
|
|
575
575
|
} }), rt && (rt.allSettled && we(K, "allSettled", function() {
|
|
@@ -578,10 +578,10 @@ var Kr = { exports: {} };
|
|
|
578
578
|
e.length === 0 && t([]);
|
|
579
579
|
var n = e.length, r = new Array(n);
|
|
580
580
|
e.forEach(function(i, o) {
|
|
581
|
-
return K.resolve(i).then(function(
|
|
582
|
-
return r[o] = { status: "fulfilled", value:
|
|
583
|
-
}, function(
|
|
584
|
-
return r[o] = { status: "rejected", reason:
|
|
581
|
+
return K.resolve(i).then(function(s) {
|
|
582
|
+
return r[o] = { status: "fulfilled", value: s };
|
|
583
|
+
}, function(s) {
|
|
584
|
+
return r[o] = { status: "rejected", reason: s };
|
|
585
585
|
}).then(function() {
|
|
586
586
|
return --n || t(r);
|
|
587
587
|
});
|
|
@@ -592,11 +592,11 @@ var Kr = { exports: {} };
|
|
|
592
592
|
return new K(function(t, n) {
|
|
593
593
|
e.length === 0 && n(new AggregateError([]));
|
|
594
594
|
var r = e.length, i = new Array(r);
|
|
595
|
-
e.forEach(function(o,
|
|
595
|
+
e.forEach(function(o, s) {
|
|
596
596
|
return K.resolve(o).then(function(u) {
|
|
597
597
|
return t(u);
|
|
598
598
|
}, function(u) {
|
|
599
|
-
i[
|
|
599
|
+
i[s] = u, --r || n(new AggregateError(i));
|
|
600
600
|
});
|
|
601
601
|
});
|
|
602
602
|
});
|
|
@@ -618,7 +618,7 @@ var Kr = { exports: {} };
|
|
|
618
618
|
return ee.echoes && e && e.constructor === rt ? (Ye(), e.then(function(t) {
|
|
619
619
|
return Oe(), t;
|
|
620
620
|
}, function(t) {
|
|
621
|
-
return Oe(),
|
|
621
|
+
return Oe(), X(t);
|
|
622
622
|
})) : e;
|
|
623
623
|
}
|
|
624
624
|
function Hr() {
|
|
@@ -658,7 +658,7 @@ var Kr = { exports: {} };
|
|
|
658
658
|
Promise === rt && ee.echoes === 0 ? St === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
659
659
|
}
|
|
660
660
|
("" + le).indexOf("[native code]") === -1 && (Ye = Oe = V);
|
|
661
|
-
var
|
|
661
|
+
var X = K.reject, he = "4.0.1-beta.10", Be = "", ge = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", nr = "String expected.", He = [], jt = "__dbnames", an = "readonly", sn = "readwrite";
|
|
662
662
|
function Ie(e, t) {
|
|
663
663
|
return e ? t ? function() {
|
|
664
664
|
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
@@ -687,19 +687,19 @@ var Kr = { exports: {} };
|
|
|
687
687
|
return t < e ? 1 : e < t ? -1 : 0;
|
|
688
688
|
case "binary":
|
|
689
689
|
return function(i, o) {
|
|
690
|
-
for (var
|
|
690
|
+
for (var s = i.length, u = o.length, h = s < u ? s : u, l = 0; l < h; ++l)
|
|
691
691
|
if (i[l] !== o[l])
|
|
692
692
|
return i[l] < o[l] ? -1 : 1;
|
|
693
|
-
return
|
|
693
|
+
return s === u ? 0 : s < u ? -1 : 1;
|
|
694
694
|
}(ar(e), ar(t));
|
|
695
695
|
case "Array":
|
|
696
696
|
return function(i, o) {
|
|
697
|
-
for (var
|
|
697
|
+
for (var s = i.length, u = o.length, h = s < u ? s : u, l = 0; l < h; ++l) {
|
|
698
698
|
var m = U(i[l], o[l]);
|
|
699
699
|
if (m !== 0)
|
|
700
700
|
return m;
|
|
701
701
|
}
|
|
702
|
-
return
|
|
702
|
+
return s === u ? 0 : s < u ? -1 : 1;
|
|
703
703
|
}(e, t);
|
|
704
704
|
}
|
|
705
705
|
} catch {
|
|
@@ -715,15 +715,15 @@ var Kr = { exports: {} };
|
|
|
715
715
|
}
|
|
716
716
|
var sr = (Y.prototype._trans = function(e, t, n) {
|
|
717
717
|
var r = this._tx || D.trans, i = this.name, o = fe && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
718
|
-
function
|
|
718
|
+
function s(l, m, c) {
|
|
719
719
|
if (!c.schema[i])
|
|
720
720
|
throw new I.NotFound("Table " + i + " not part of transaction");
|
|
721
721
|
return t(c.idbtrans, c);
|
|
722
722
|
}
|
|
723
723
|
var u = Ve();
|
|
724
724
|
try {
|
|
725
|
-
var h = r && r.db._novip === this.db._novip ? r === D.trans ? r._promise(e,
|
|
726
|
-
return r._promise(e,
|
|
725
|
+
var h = r && r.db._novip === this.db._novip ? r === D.trans ? r._promise(e, s, n) : xe(function() {
|
|
726
|
+
return r._promise(e, s, n);
|
|
727
727
|
}, { trans: r, transless: D.transless || D }) : function l(m, c, f, d) {
|
|
728
728
|
if (m.idbdb && (m._state.openComplete || D.letThrough || m._vip)) {
|
|
729
729
|
var y = m._createTransaction(c, f, m._dbSchema);
|
|
@@ -732,7 +732,7 @@ var Kr = { exports: {} };
|
|
|
732
732
|
} catch (g) {
|
|
733
733
|
return g.name === Qt.InvalidState && m.isOpen() && 0 < --m._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), m.close({ disableAutoOpen: !1 }), m.open().then(function() {
|
|
734
734
|
return l(m, c, f, d);
|
|
735
|
-
})) :
|
|
735
|
+
})) : X(g);
|
|
736
736
|
}
|
|
737
737
|
return y._promise(c, function(g, p) {
|
|
738
738
|
return xe(function() {
|
|
@@ -750,25 +750,25 @@ var Kr = { exports: {} };
|
|
|
750
750
|
});
|
|
751
751
|
}
|
|
752
752
|
if (m._state.openComplete)
|
|
753
|
-
return
|
|
753
|
+
return X(new I.DatabaseClosed(m._state.dbOpenError));
|
|
754
754
|
if (!m._state.isBeingOpened) {
|
|
755
755
|
if (!m._state.autoOpen)
|
|
756
|
-
return
|
|
756
|
+
return X(new I.DatabaseClosed());
|
|
757
757
|
m.open().catch(V);
|
|
758
758
|
}
|
|
759
759
|
return m._state.dbReadyPromise.then(function() {
|
|
760
760
|
return l(m, c, f, d);
|
|
761
761
|
});
|
|
762
|
-
}(this.db, e, [this.name],
|
|
762
|
+
}(this.db, e, [this.name], s);
|
|
763
763
|
return o && (h._consoleTask = o, h = h.catch(function(l) {
|
|
764
|
-
return console.trace(l),
|
|
764
|
+
return console.trace(l), X(l);
|
|
765
765
|
})), h;
|
|
766
766
|
} finally {
|
|
767
767
|
u && Ge();
|
|
768
768
|
}
|
|
769
769
|
}, Y.prototype.get = function(e, t) {
|
|
770
770
|
var n = this;
|
|
771
|
-
return e && e.constructor === Object ? this.where(e).first(t) : e == null ?
|
|
771
|
+
return e && e.constructor === Object ? this.where(e).first(t) : e == null ? X(new I.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(r) {
|
|
772
772
|
return n.core.get({ trans: r, key: e }).then(function(i) {
|
|
773
773
|
return n.hook.reading.fire(i);
|
|
774
774
|
});
|
|
@@ -778,7 +778,7 @@ var Kr = { exports: {} };
|
|
|
778
778
|
return new this.db.WhereClause(this, e);
|
|
779
779
|
if (W(e))
|
|
780
780
|
return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
781
|
-
var t =
|
|
781
|
+
var t = B(e);
|
|
782
782
|
if (t.length === 1)
|
|
783
783
|
return this.where(t[0]).equals(e[t[0]]);
|
|
784
784
|
var n = this.schema.indexes.concat(this.schema.primKey).filter(function(h) {
|
|
@@ -795,8 +795,8 @@ var Kr = { exports: {} };
|
|
|
795
795
|
return h.keyPath.length - l.keyPath.length;
|
|
796
796
|
})[0];
|
|
797
797
|
if (n && this.db._maxKey !== Be) {
|
|
798
|
-
var
|
|
799
|
-
return this.where(
|
|
798
|
+
var s = n.keyPath.slice(0, t.length);
|
|
799
|
+
return this.where(s).equals(s.map(function(l) {
|
|
800
800
|
return e[l];
|
|
801
801
|
}));
|
|
802
802
|
}
|
|
@@ -814,8 +814,8 @@ var Kr = { exports: {} };
|
|
|
814
814
|
} : function(y) {
|
|
815
815
|
return o(d, ye(y, l));
|
|
816
816
|
}) : c];
|
|
817
|
-
}, [null, null]),
|
|
818
|
-
return
|
|
817
|
+
}, [null, null]), s = u[0], u = u[1];
|
|
818
|
+
return s ? this.where(s.name).equals(e[s.keyPath]).filter(u) : n ? this.filter(u) : this.where(t).equals("");
|
|
819
819
|
}, Y.prototype.filter = function(e) {
|
|
820
820
|
return this.toCollection().and(e);
|
|
821
821
|
}, Y.prototype.count = function(e) {
|
|
@@ -851,8 +851,8 @@ var Kr = { exports: {} };
|
|
|
851
851
|
}, enumerable: !1, configurable: !0 }), i.prototype.table = function() {
|
|
852
852
|
return r;
|
|
853
853
|
}, e = i);
|
|
854
|
-
for (var o = /* @__PURE__ */ new Set(),
|
|
855
|
-
Object.getOwnPropertyNames(
|
|
854
|
+
for (var o = /* @__PURE__ */ new Set(), s = e.prototype; s; s = oe(s))
|
|
855
|
+
Object.getOwnPropertyNames(s).forEach(function(h) {
|
|
856
856
|
return o.add(h);
|
|
857
857
|
});
|
|
858
858
|
function u(h) {
|
|
@@ -873,9 +873,9 @@ var Kr = { exports: {} };
|
|
|
873
873
|
q(this, e);
|
|
874
874
|
});
|
|
875
875
|
}, Y.prototype.add = function(e, t) {
|
|
876
|
-
var n = this, r = this.schema.primKey, i = r.auto, o = r.keyPath,
|
|
877
|
-
return o && i && (
|
|
878
|
-
return n.core.mutate({ trans: u, type: "add", keys: t != null ? [t] : null, values: [
|
|
876
|
+
var n = this, r = this.schema.primKey, i = r.auto, o = r.keyPath, s = e;
|
|
877
|
+
return o && i && (s = Ct(o)(e)), this._trans("readwrite", function(u) {
|
|
878
|
+
return n.core.mutate({ trans: u, type: "add", keys: t != null ? [t] : null, values: [s] });
|
|
879
879
|
}).then(function(u) {
|
|
880
880
|
return u.numFailures ? K.reject(u.failures[0]) : u.lastResult;
|
|
881
881
|
}).then(function(u) {
|
|
@@ -887,11 +887,11 @@ var Kr = { exports: {} };
|
|
|
887
887
|
return u;
|
|
888
888
|
});
|
|
889
889
|
}, Y.prototype.update = function(e, t) {
|
|
890
|
-
return typeof e != "object" || W(e) ? this.where(":id").equals(e).modify(t) : (e = ye(e, this.schema.primKey.keyPath), e === void 0 ?
|
|
890
|
+
return typeof e != "object" || W(e) ? this.where(":id").equals(e).modify(t) : (e = ye(e, this.schema.primKey.keyPath), e === void 0 ? X(new I.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t));
|
|
891
891
|
}, Y.prototype.put = function(e, t) {
|
|
892
|
-
var n = this, r = this.schema.primKey, i = r.auto, o = r.keyPath,
|
|
893
|
-
return o && i && (
|
|
894
|
-
return n.core.mutate({ trans: u, type: "put", values: [
|
|
892
|
+
var n = this, r = this.schema.primKey, i = r.auto, o = r.keyPath, s = e;
|
|
893
|
+
return o && i && (s = Ct(o)(e)), this._trans("readwrite", function(u) {
|
|
894
|
+
return n.core.mutate({ trans: u, type: "put", values: [s], keys: t != null ? [t] : null });
|
|
895
895
|
}).then(function(u) {
|
|
896
896
|
return u.numFailures ? K.reject(u.failures[0]) : u.lastResult;
|
|
897
897
|
}).then(function(u) {
|
|
@@ -927,14 +927,14 @@ var Kr = { exports: {} };
|
|
|
927
927
|
});
|
|
928
928
|
}, Y.prototype.bulkAdd = function(e, t, n) {
|
|
929
929
|
var r = this, i = Array.isArray(t) ? t : void 0, o = (n = n || (i ? void 0 : t)) ? n.allKeys : void 0;
|
|
930
|
-
return this._trans("readwrite", function(
|
|
930
|
+
return this._trans("readwrite", function(s) {
|
|
931
931
|
var l = r.schema.primKey, u = l.auto, l = l.keyPath;
|
|
932
932
|
if (l && i)
|
|
933
933
|
throw new I.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
934
934
|
if (i && i.length !== e.length)
|
|
935
935
|
throw new I.InvalidArgument("Arguments objects and keys must have the same length");
|
|
936
936
|
var h = e.length, l = l && u ? e.map(Ct(l)) : e;
|
|
937
|
-
return r.core.mutate({ trans:
|
|
937
|
+
return r.core.mutate({ trans: s, type: "add", keys: i, values: l, wantResults: o }).then(function(y) {
|
|
938
938
|
var c = y.numFailures, f = y.results, d = y.lastResult, y = y.failures;
|
|
939
939
|
if (c === 0)
|
|
940
940
|
return o ? f : d;
|
|
@@ -943,14 +943,14 @@ var Kr = { exports: {} };
|
|
|
943
943
|
});
|
|
944
944
|
}, Y.prototype.bulkPut = function(e, t, n) {
|
|
945
945
|
var r = this, i = Array.isArray(t) ? t : void 0, o = (n = n || (i ? void 0 : t)) ? n.allKeys : void 0;
|
|
946
|
-
return this._trans("readwrite", function(
|
|
946
|
+
return this._trans("readwrite", function(s) {
|
|
947
947
|
var l = r.schema.primKey, u = l.auto, l = l.keyPath;
|
|
948
948
|
if (l && i)
|
|
949
949
|
throw new I.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
950
950
|
if (i && i.length !== e.length)
|
|
951
951
|
throw new I.InvalidArgument("Arguments objects and keys must have the same length");
|
|
952
952
|
var h = e.length, l = l && u ? e.map(Ct(l)) : e;
|
|
953
|
-
return r.core.mutate({ trans:
|
|
953
|
+
return r.core.mutate({ trans: s, type: "put", keys: i, values: l, wantResults: o }).then(function(y) {
|
|
954
954
|
var c = y.numFailures, f = y.results, d = y.lastResult, y = y.failures;
|
|
955
955
|
if (c === 0)
|
|
956
956
|
return o ? f : d;
|
|
@@ -958,13 +958,13 @@ var Kr = { exports: {} };
|
|
|
958
958
|
});
|
|
959
959
|
});
|
|
960
960
|
}, Y.prototype.bulkUpdate = function(e) {
|
|
961
|
-
var t = this, n = this.core, r = e.map(function(
|
|
962
|
-
return
|
|
963
|
-
}), i = e.map(function(
|
|
964
|
-
return
|
|
961
|
+
var t = this, n = this.core, r = e.map(function(s) {
|
|
962
|
+
return s.key;
|
|
963
|
+
}), i = e.map(function(s) {
|
|
964
|
+
return s.changes;
|
|
965
965
|
}), o = [];
|
|
966
|
-
return this._trans("readwrite", function(
|
|
967
|
-
return n.getMany({ trans:
|
|
966
|
+
return this._trans("readwrite", function(s) {
|
|
967
|
+
return n.getMany({ trans: s, keys: r, cache: "clone" }).then(function(u) {
|
|
968
968
|
var h = [], l = [];
|
|
969
969
|
e.forEach(function(c, f) {
|
|
970
970
|
var d = c.key, y = c.changes, g = u[f];
|
|
@@ -981,7 +981,7 @@ var Kr = { exports: {} };
|
|
|
981
981
|
}
|
|
982
982
|
});
|
|
983
983
|
var m = h.length;
|
|
984
|
-
return n.mutate({ trans:
|
|
984
|
+
return n.mutate({ trans: s, type: "put", keys: h, values: l, updates: { keys: r, changeSpecs: i } }).then(function(c) {
|
|
985
985
|
var f = c.numFailures, d = c.failures;
|
|
986
986
|
if (f === 0)
|
|
987
987
|
return m;
|
|
@@ -997,32 +997,32 @@ var Kr = { exports: {} };
|
|
|
997
997
|
var t = this, n = e.length;
|
|
998
998
|
return this._trans("readwrite", function(r) {
|
|
999
999
|
return t.core.mutate({ trans: r, type: "delete", keys: e });
|
|
1000
|
-
}).then(function(
|
|
1001
|
-
var i =
|
|
1000
|
+
}).then(function(s) {
|
|
1001
|
+
var i = s.numFailures, o = s.lastResult, s = s.failures;
|
|
1002
1002
|
if (i === 0)
|
|
1003
1003
|
return o;
|
|
1004
|
-
throw new $e("".concat(t.name, ".bulkDelete(): ").concat(i, " of ").concat(n, " operations failed"),
|
|
1004
|
+
throw new $e("".concat(t.name, ".bulkDelete(): ").concat(i, " of ").concat(n, " operations failed"), s);
|
|
1005
1005
|
});
|
|
1006
1006
|
}, Y);
|
|
1007
1007
|
function Y() {
|
|
1008
1008
|
}
|
|
1009
1009
|
function at(e) {
|
|
1010
|
-
function t(
|
|
1010
|
+
function t(s, u) {
|
|
1011
1011
|
if (u) {
|
|
1012
1012
|
for (var h = arguments.length, l = new Array(h - 1); --h; )
|
|
1013
1013
|
l[h - 1] = arguments[h];
|
|
1014
|
-
return n[
|
|
1014
|
+
return n[s].subscribe.apply(null, l), e;
|
|
1015
1015
|
}
|
|
1016
|
-
if (typeof
|
|
1017
|
-
return n[
|
|
1016
|
+
if (typeof s == "string")
|
|
1017
|
+
return n[s];
|
|
1018
1018
|
}
|
|
1019
1019
|
var n = {};
|
|
1020
1020
|
t.addEventType = o;
|
|
1021
1021
|
for (var r = 1, i = arguments.length; r < i; ++r)
|
|
1022
1022
|
o(arguments[r]);
|
|
1023
1023
|
return t;
|
|
1024
|
-
function o(
|
|
1025
|
-
if (typeof
|
|
1024
|
+
function o(s, u, h) {
|
|
1025
|
+
if (typeof s != "object") {
|
|
1026
1026
|
var l;
|
|
1027
1027
|
u = u || Wr;
|
|
1028
1028
|
var m = { subscribers: [], fire: h = h || V, subscribe: function(c) {
|
|
@@ -1032,9 +1032,9 @@ var Kr = { exports: {} };
|
|
|
1032
1032
|
return f !== c;
|
|
1033
1033
|
}), m.fire = m.subscribers.reduce(u, h);
|
|
1034
1034
|
} };
|
|
1035
|
-
return n[
|
|
1035
|
+
return n[s] = t[s] = m;
|
|
1036
1036
|
}
|
|
1037
|
-
|
|
1037
|
+
B(l = s).forEach(function(c) {
|
|
1038
1038
|
var f = l[c];
|
|
1039
1039
|
if (W(f))
|
|
1040
1040
|
o(c, l[c][0], l[c][1]);
|
|
@@ -1084,7 +1084,7 @@ var Kr = { exports: {} };
|
|
|
1084
1084
|
function At(e, t, n, r) {
|
|
1085
1085
|
var i = e.replayFilter ? Ie(e.filter, e.replayFilter()) : e.filter;
|
|
1086
1086
|
if (e.or) {
|
|
1087
|
-
var o = {},
|
|
1087
|
+
var o = {}, s = function(u, h, l) {
|
|
1088
1088
|
var m, c;
|
|
1089
1089
|
i && !i(h, l, function(f) {
|
|
1090
1090
|
return h.stop(f);
|
|
@@ -1092,38 +1092,38 @@ var Kr = { exports: {} };
|
|
|
1092
1092
|
return h.fail(f);
|
|
1093
1093
|
}) || ((c = "" + (m = h.primaryKey)) == "[object ArrayBuffer]" && (c = "" + new Uint8Array(m)), ne(o, c) || (o[c] = !0, t(u, h, l)));
|
|
1094
1094
|
};
|
|
1095
|
-
return Promise.all([e.or._iterate(
|
|
1095
|
+
return Promise.all([e.or._iterate(s, n), cr(ur(e, r, n), e.algorithm, s, !e.keysOnly && e.valueMapper)]);
|
|
1096
1096
|
}
|
|
1097
1097
|
return cr(ur(e, r, n), Ie(e.algorithm, i), t, !e.keysOnly && e.valueMapper);
|
|
1098
1098
|
}
|
|
1099
1099
|
function cr(e, t, n, r) {
|
|
1100
|
-
var i = H(r ? function(o,
|
|
1101
|
-
return n(r(o),
|
|
1100
|
+
var i = H(r ? function(o, s, u) {
|
|
1101
|
+
return n(r(o), s, u);
|
|
1102
1102
|
} : n);
|
|
1103
1103
|
return e.then(function(o) {
|
|
1104
1104
|
if (o)
|
|
1105
1105
|
return o.start(function() {
|
|
1106
|
-
var
|
|
1106
|
+
var s = function() {
|
|
1107
1107
|
return o.continue();
|
|
1108
1108
|
};
|
|
1109
1109
|
t && !t(o, function(u) {
|
|
1110
|
-
return
|
|
1110
|
+
return s = u;
|
|
1111
1111
|
}, function(u) {
|
|
1112
|
-
o.stop(u),
|
|
1112
|
+
o.stop(u), s = V;
|
|
1113
1113
|
}, function(u) {
|
|
1114
|
-
o.fail(u),
|
|
1114
|
+
o.fail(u), s = V;
|
|
1115
1115
|
}) || i(o.value, o, function(u) {
|
|
1116
|
-
return
|
|
1117
|
-
}),
|
|
1116
|
+
return s = u;
|
|
1117
|
+
}), s();
|
|
1118
1118
|
});
|
|
1119
1119
|
});
|
|
1120
1120
|
}
|
|
1121
1121
|
var Qr = (L.prototype._read = function(e, t) {
|
|
1122
1122
|
var n = this._ctx;
|
|
1123
|
-
return n.error ? n.table._trans(null,
|
|
1123
|
+
return n.error ? n.table._trans(null, X.bind(null, n.error)) : n.table._trans("readonly", e).then(t);
|
|
1124
1124
|
}, L.prototype._write = function(e) {
|
|
1125
1125
|
var t = this._ctx;
|
|
1126
|
-
return t.error ? t.table._trans(null,
|
|
1126
|
+
return t.error ? t.table._trans(null, X.bind(null, t.error)) : t.table._trans("readwrite", e, "locked");
|
|
1127
1127
|
}, L.prototype._addAlgorithm = function(e) {
|
|
1128
1128
|
var t = this._ctx;
|
|
1129
1129
|
t.algorithm = Ie(t.algorithm, e);
|
|
@@ -1144,8 +1144,8 @@ var Kr = { exports: {} };
|
|
|
1144
1144
|
return this._read(function(n) {
|
|
1145
1145
|
var r = t._ctx, i = r.table.core;
|
|
1146
1146
|
if (Qe(r, !0))
|
|
1147
|
-
return i.count({ trans: n, query: { index: Kt(r, i.schema), range: r.range } }).then(function(
|
|
1148
|
-
return Math.min(
|
|
1147
|
+
return i.count({ trans: n, query: { index: Kt(r, i.schema), range: r.range } }).then(function(s) {
|
|
1148
|
+
return Math.min(s, r.limit);
|
|
1149
1149
|
});
|
|
1150
1150
|
var o = 0;
|
|
1151
1151
|
return At(r, function() {
|
|
@@ -1159,9 +1159,9 @@ var Kr = { exports: {} };
|
|
|
1159
1159
|
function o(h, l) {
|
|
1160
1160
|
return l ? o(h[n[l]], l - 1) : h[r];
|
|
1161
1161
|
}
|
|
1162
|
-
var
|
|
1162
|
+
var s = this._ctx.dir === "next" ? 1 : -1;
|
|
1163
1163
|
function u(h, l) {
|
|
1164
|
-
return h = o(h, i), l = o(l, i), h < l ? -
|
|
1164
|
+
return h = o(h, i), l = o(l, i), h < l ? -s : l < h ? s : 0;
|
|
1165
1165
|
}
|
|
1166
1166
|
return this.toArray(function(h) {
|
|
1167
1167
|
return h.sort(u);
|
|
@@ -1176,11 +1176,11 @@ var Kr = { exports: {} };
|
|
|
1176
1176
|
return u = u.result, i ? u.map(i) : u;
|
|
1177
1177
|
});
|
|
1178
1178
|
}
|
|
1179
|
-
var
|
|
1179
|
+
var s = [];
|
|
1180
1180
|
return At(r, function(u) {
|
|
1181
|
-
return
|
|
1181
|
+
return s.push(u);
|
|
1182
1182
|
}, n, r.table.core).then(function() {
|
|
1183
|
-
return
|
|
1183
|
+
return s;
|
|
1184
1184
|
});
|
|
1185
1185
|
}, e);
|
|
1186
1186
|
}, L.prototype.offset = function(e) {
|
|
@@ -1285,8 +1285,8 @@ var Kr = { exports: {} };
|
|
|
1285
1285
|
}, L.prototype.modify = function(e) {
|
|
1286
1286
|
var t = this, n = this._ctx;
|
|
1287
1287
|
return this._write(function(r) {
|
|
1288
|
-
var i, o,
|
|
1289
|
-
|
|
1288
|
+
var i, o, s;
|
|
1289
|
+
s = typeof e == "function" ? e : (i = B(e), o = i.length, function(p) {
|
|
1290
1290
|
for (var b = !1, w = 0; w < o; ++w) {
|
|
1291
1291
|
var k = i[w], x = e[k];
|
|
1292
1292
|
ye(p, k) !== x && (ce(p, k, x), b = !0);
|
|
@@ -1296,7 +1296,7 @@ var Kr = { exports: {} };
|
|
|
1296
1296
|
function u(p, k) {
|
|
1297
1297
|
var w = k.failures, k = k.numFailures;
|
|
1298
1298
|
y += p - k;
|
|
1299
|
-
for (var x = 0, O =
|
|
1299
|
+
for (var x = 0, O = B(w); x < O.length; x++) {
|
|
1300
1300
|
var P = O[x];
|
|
1301
1301
|
d.push(w[P]);
|
|
1302
1302
|
}
|
|
@@ -1307,8 +1307,8 @@ var Kr = { exports: {} };
|
|
|
1307
1307
|
var k = Math.min(f, p.length - w);
|
|
1308
1308
|
return h.getMany({ trans: r, keys: p.slice(w, w + k), cache: "immutable" }).then(function(x) {
|
|
1309
1309
|
for (var O = [], P = [], S = m ? [] : null, C = [], E = 0; E < k; ++E) {
|
|
1310
|
-
var
|
|
1311
|
-
|
|
1310
|
+
var T = x[E], R = { value: _e(T), primKey: p[w + E] };
|
|
1311
|
+
s.call(R, R.value, R) !== !1 && (R.value == null ? C.push(p[w + E]) : m || U(c(T), c(R.value)) === 0 ? (P.push(R.value), m && S.push(p[w + E])) : (C.push(p[w + E]), O.push(R.value)));
|
|
1312
1312
|
}
|
|
1313
1313
|
var $ = Qe(n) && n.limit === 1 / 0 && (typeof e != "function" || e === ln) && { index: n.index, range: n.range };
|
|
1314
1314
|
return Promise.resolve(0 < O.length && h.mutate({ trans: r, type: "add", values: O }).then(function(z) {
|
|
@@ -1340,13 +1340,13 @@ var Kr = { exports: {} };
|
|
|
1340
1340
|
return Qe(e) && (e.isPrimKey || t.type === 3) ? this._write(function(n) {
|
|
1341
1341
|
var r = e.table.core.schema.primaryKey, i = t;
|
|
1342
1342
|
return e.table.core.count({ trans: n, query: { index: r, range: i } }).then(function(o) {
|
|
1343
|
-
return e.table.core.mutate({ trans: n, type: "deleteRange", range: i }).then(function(
|
|
1344
|
-
var u =
|
|
1345
|
-
if (
|
|
1343
|
+
return e.table.core.mutate({ trans: n, type: "deleteRange", range: i }).then(function(s) {
|
|
1344
|
+
var u = s.failures;
|
|
1345
|
+
if (s.lastResult, s.results, s = s.numFailures, s)
|
|
1346
1346
|
throw new vt("Could not delete some values", Object.keys(u).map(function(h) {
|
|
1347
1347
|
return u[h];
|
|
1348
|
-
}), o -
|
|
1349
|
-
return o -
|
|
1348
|
+
}), o - s);
|
|
1349
|
+
return o - s;
|
|
1350
1350
|
});
|
|
1351
1351
|
});
|
|
1352
1352
|
}) : this.modify(ln);
|
|
@@ -1371,7 +1371,7 @@ var Kr = { exports: {} };
|
|
|
1371
1371
|
}).limit(0);
|
|
1372
1372
|
}
|
|
1373
1373
|
function Dt(e, t, n, r) {
|
|
1374
|
-
var i, o,
|
|
1374
|
+
var i, o, s, u, h, l, m, c = n.length;
|
|
1375
1375
|
if (!n.every(function(y) {
|
|
1376
1376
|
return typeof y == "string";
|
|
1377
1377
|
}))
|
|
@@ -1385,11 +1385,11 @@ var Kr = { exports: {} };
|
|
|
1385
1385
|
return p.toLowerCase();
|
|
1386
1386
|
} : function(p) {
|
|
1387
1387
|
return p.toUpperCase();
|
|
1388
|
-
},
|
|
1388
|
+
}, s = y === "next" ? Xr : Jr;
|
|
1389
1389
|
var g = n.map(function(p) {
|
|
1390
1390
|
return { lower: o(p), upper: i(p) };
|
|
1391
1391
|
}).sort(function(p, b) {
|
|
1392
|
-
return
|
|
1392
|
+
return s(p.lower, b.lower);
|
|
1393
1393
|
});
|
|
1394
1394
|
u = g.map(function(p) {
|
|
1395
1395
|
return p.upper;
|
|
@@ -1411,16 +1411,16 @@ var Kr = { exports: {} };
|
|
|
1411
1411
|
if (t(w, h, d))
|
|
1412
1412
|
return !0;
|
|
1413
1413
|
for (var k = null, x = d; x < c; ++x) {
|
|
1414
|
-
var O = function(P, S, C, E,
|
|
1414
|
+
var O = function(P, S, C, E, T, R) {
|
|
1415
1415
|
for (var $ = Math.min(P.length, E.length), z = -1, G = 0; G < $; ++G) {
|
|
1416
1416
|
var ue = S[G];
|
|
1417
1417
|
if (ue !== E[G])
|
|
1418
|
-
return
|
|
1419
|
-
|
|
1418
|
+
return T(P[G], C[G]) < 0 ? P.substr(0, G) + C[G] + C.substr(G + 1) : T(P[G], E[G]) < 0 ? P.substr(0, G) + E[G] + C.substr(G + 1) : 0 <= z ? P.substr(0, z) + S[z] + C.substr(z + 1) : null;
|
|
1419
|
+
T(P[G], ue) < 0 && (z = G);
|
|
1420
1420
|
}
|
|
1421
1421
|
return $ < E.length && R === "next" ? P + C.substr(P.length) : $ < P.length && R === "prev" ? P.substr(0, C.length) : z < 0 ? null : P.substr(0, z) + E[z] + C.substr(z + 1);
|
|
1422
|
-
}(b, w, u[x], h[x],
|
|
1423
|
-
O === null && k === null ? d = x + 1 : (k === null || 0 <
|
|
1422
|
+
}(b, w, u[x], h[x], s, l);
|
|
1423
|
+
O === null && k === null ? d = x + 1 : (k === null || 0 < s(k, O)) && (k = O);
|
|
1424
1424
|
}
|
|
1425
1425
|
return g(k !== null ? function() {
|
|
1426
1426
|
y.continue(k + m);
|
|
@@ -1502,11 +1502,11 @@ var Kr = { exports: {} };
|
|
|
1502
1502
|
n = o === "next" ? e._ascending : e._descending, t.sort(n);
|
|
1503
1503
|
};
|
|
1504
1504
|
var i = 0;
|
|
1505
|
-
return r._addAlgorithm(function(o,
|
|
1505
|
+
return r._addAlgorithm(function(o, s, u) {
|
|
1506
1506
|
for (var h = o.key; 0 < n(h, t[i]); )
|
|
1507
1507
|
if (++i === t.length)
|
|
1508
|
-
return
|
|
1509
|
-
return n(h, t[i]) === 0 || (
|
|
1508
|
+
return s(u), !1;
|
|
1509
|
+
return n(h, t[i]) === 0 || (s(function() {
|
|
1510
1510
|
o.continue(t[i]);
|
|
1511
1511
|
}), !1);
|
|
1512
1512
|
}), r;
|
|
@@ -1526,7 +1526,7 @@ var Kr = { exports: {} };
|
|
|
1526
1526
|
}, null);
|
|
1527
1527
|
return t.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(t, { includeLowers: !1, includeUppers: !1 });
|
|
1528
1528
|
}, te.prototype.inAnyRange = function(b, t) {
|
|
1529
|
-
var n = this, r = this._cmp, i = this._ascending, o = this._descending,
|
|
1529
|
+
var n = this, r = this._cmp, i = this._ascending, o = this._descending, s = this._min, u = this._max;
|
|
1530
1530
|
if (b.length === 0)
|
|
1531
1531
|
return Xe(this);
|
|
1532
1532
|
if (!b.every(function(w) {
|
|
@@ -1542,7 +1542,7 @@ var Kr = { exports: {} };
|
|
|
1542
1542
|
for (var x = 0, O = w.length; x < O; ++x) {
|
|
1543
1543
|
var P = w[x];
|
|
1544
1544
|
if (r(k[0], P[1]) < 0 && 0 < r(k[1], P[0])) {
|
|
1545
|
-
P[0] =
|
|
1545
|
+
P[0] = s(P[0], k[0]), P[1] = u(P[1], k[1]);
|
|
1546
1546
|
break;
|
|
1547
1547
|
}
|
|
1548
1548
|
}
|
|
@@ -1630,29 +1630,29 @@ var Kr = { exports: {} };
|
|
|
1630
1630
|
}, pe.prototype._promise = function(e, t, n) {
|
|
1631
1631
|
var r = this;
|
|
1632
1632
|
if (e === "readwrite" && this.mode !== "readwrite")
|
|
1633
|
-
return
|
|
1633
|
+
return X(new I.ReadOnly("Transaction is readonly"));
|
|
1634
1634
|
if (!this.active)
|
|
1635
|
-
return
|
|
1635
|
+
return X(new I.TransactionInactive());
|
|
1636
1636
|
if (this._locked())
|
|
1637
|
-
return new K(function(o,
|
|
1637
|
+
return new K(function(o, s) {
|
|
1638
1638
|
r._blockedFuncs.push([function() {
|
|
1639
|
-
r._promise(e, t, n).then(o,
|
|
1639
|
+
r._promise(e, t, n).then(o, s);
|
|
1640
1640
|
}, D]);
|
|
1641
1641
|
});
|
|
1642
1642
|
if (n)
|
|
1643
1643
|
return xe(function() {
|
|
1644
|
-
var o = new K(function(
|
|
1644
|
+
var o = new K(function(s, u) {
|
|
1645
1645
|
r._lock();
|
|
1646
|
-
var h = t(
|
|
1647
|
-
h && h.then && h.then(
|
|
1646
|
+
var h = t(s, u, r);
|
|
1647
|
+
h && h.then && h.then(s, u);
|
|
1648
1648
|
});
|
|
1649
1649
|
return o.finally(function() {
|
|
1650
1650
|
return r._unlock();
|
|
1651
1651
|
}), o._lib = !0, o;
|
|
1652
1652
|
});
|
|
1653
|
-
var i = new K(function(o,
|
|
1654
|
-
var u = t(o,
|
|
1655
|
-
u && u.then && u.then(o,
|
|
1653
|
+
var i = new K(function(o, s) {
|
|
1654
|
+
var u = t(o, s, r);
|
|
1655
|
+
u && u.then && u.then(o, s);
|
|
1656
1656
|
});
|
|
1657
1657
|
return i._lib = !0, i;
|
|
1658
1658
|
}, pe.prototype._root = function() {
|
|
@@ -1667,11 +1667,11 @@ var Kr = { exports: {} };
|
|
|
1667
1667
|
n._waitingFor && (t.get(-1 / 0).onsuccess = o);
|
|
1668
1668
|
}());
|
|
1669
1669
|
var i = n._waitingFor;
|
|
1670
|
-
return new K(function(o,
|
|
1670
|
+
return new K(function(o, s) {
|
|
1671
1671
|
r.then(function(u) {
|
|
1672
1672
|
return n._waitingQueue.push(H(o.bind(null, u)));
|
|
1673
1673
|
}, function(u) {
|
|
1674
|
-
return n._waitingQueue.push(H(
|
|
1674
|
+
return n._waitingQueue.push(H(s.bind(null, u)));
|
|
1675
1675
|
}).finally(function() {
|
|
1676
1676
|
n._waitingFor === i && (n._waitingFor = null);
|
|
1677
1677
|
});
|
|
@@ -1689,8 +1689,8 @@ var Kr = { exports: {} };
|
|
|
1689
1689
|
}, pe);
|
|
1690
1690
|
function pe() {
|
|
1691
1691
|
}
|
|
1692
|
-
function hn(e, t, n, r, i, o,
|
|
1693
|
-
return { name: e, keyPath: t, unique: n, multi: r, auto: i, compound: o, src: (n && !
|
|
1692
|
+
function hn(e, t, n, r, i, o, s) {
|
|
1693
|
+
return { name: e, keyPath: t, unique: n, multi: r, auto: i, compound: o, src: (n && !s ? "&" : "") + (r ? "*" : "") + (i ? "++" : "") + hr(t) };
|
|
1694
1694
|
}
|
|
1695
1695
|
function hr(e) {
|
|
1696
1696
|
return typeof e == "string" ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
|
|
@@ -1698,8 +1698,8 @@ var Kr = { exports: {} };
|
|
|
1698
1698
|
function dn(e, t, n) {
|
|
1699
1699
|
return { name: e, primKey: t, indexes: n, mappedClass: null, idxByName: (r = function(i) {
|
|
1700
1700
|
return [i.name, i];
|
|
1701
|
-
}, n.reduce(function(i, o,
|
|
1702
|
-
return
|
|
1701
|
+
}, n.reduce(function(i, o, s) {
|
|
1702
|
+
return s = r(o, s), s && (i[s[0]] = s[1]), i;
|
|
1703
1703
|
}, {})) };
|
|
1704
1704
|
var r;
|
|
1705
1705
|
}
|
|
@@ -1750,7 +1750,7 @@ var Kr = { exports: {} };
|
|
|
1750
1750
|
var S = p.objectStore(y), C = S.keyPath == null, E = b === "put" || b === "add";
|
|
1751
1751
|
if (!E && b !== "delete" && b !== "deleteRange")
|
|
1752
1752
|
throw new Error("Invalid operation type: " + b);
|
|
1753
|
-
var
|
|
1753
|
+
var T, R = (w || k || { length: 1 }).length;
|
|
1754
1754
|
if (w && k && w.length !== k.length)
|
|
1755
1755
|
throw new Error("Given keys array must have same length as given values array.");
|
|
1756
1756
|
if (R === 0)
|
|
@@ -1762,15 +1762,15 @@ var Kr = { exports: {} };
|
|
|
1762
1762
|
if (b === "deleteRange") {
|
|
1763
1763
|
if (x.type === 4)
|
|
1764
1764
|
return O({ numFailures: ue, failures: G, results: [], lastResult: void 0 });
|
|
1765
|
-
x.type === 3 ? z.push(
|
|
1765
|
+
x.type === 3 ? z.push(T = S.clear()) : z.push(T = S.delete(r(x)));
|
|
1766
1766
|
} else {
|
|
1767
1767
|
var C = E ? C ? [k, w] : [k, null] : [w, null], N = C[0], be = C[1];
|
|
1768
1768
|
if (E)
|
|
1769
1769
|
for (var ie = 0; ie < R; ++ie)
|
|
1770
|
-
z.push(
|
|
1770
|
+
z.push(T = be && be[ie] !== void 0 ? S[b](N[ie], be[ie]) : S[b](N[ie])), T.onerror = $;
|
|
1771
1771
|
else
|
|
1772
1772
|
for (ie = 0; ie < R; ++ie)
|
|
1773
|
-
z.push(
|
|
1773
|
+
z.push(T = S[b](N[ie])), T.onerror = $;
|
|
1774
1774
|
}
|
|
1775
1775
|
function Vt(ae) {
|
|
1776
1776
|
ae = ae.target.result, z.forEach(function(Fe, Tn) {
|
|
@@ -1779,18 +1779,18 @@ var Kr = { exports: {} };
|
|
|
1779
1779
|
return Fe.result;
|
|
1780
1780
|
}), lastResult: ae });
|
|
1781
1781
|
}
|
|
1782
|
-
|
|
1782
|
+
T.onerror = function(ae) {
|
|
1783
1783
|
$(ae), Vt(ae);
|
|
1784
|
-
},
|
|
1784
|
+
}, T.onsuccess = Vt;
|
|
1785
1785
|
});
|
|
1786
1786
|
}, getMany: function(g) {
|
|
1787
1787
|
var p = g.trans, b = g.keys;
|
|
1788
1788
|
return new Promise(function(w, k) {
|
|
1789
1789
|
w = H(w);
|
|
1790
|
-
for (var x, O = p.objectStore(y), P = b.length, S = new Array(P), C = 0, E = 0,
|
|
1790
|
+
for (var x, O = p.objectStore(y), P = b.length, S = new Array(P), C = 0, E = 0, T = function(z) {
|
|
1791
1791
|
z = z.target, S[z._pos] = z.result, ++E === C && w(S);
|
|
1792
1792
|
}, R = de(k), $ = 0; $ < P; ++$)
|
|
1793
|
-
b[$] != null && ((x = O.get(b[$]))._pos = $, x.onsuccess =
|
|
1793
|
+
b[$] != null && ((x = O.get(b[$]))._pos = $, x.onsuccess = T, x.onerror = R, ++C);
|
|
1794
1794
|
C === 0 && w(S);
|
|
1795
1795
|
});
|
|
1796
1796
|
}, get: function(g) {
|
|
@@ -1805,12 +1805,12 @@ var Kr = { exports: {} };
|
|
|
1805
1805
|
}, query: (d = l, function(g) {
|
|
1806
1806
|
return new Promise(function(p, b) {
|
|
1807
1807
|
p = H(p);
|
|
1808
|
-
var w, k, x, C = g.trans, O = g.values, P = g.limit,
|
|
1808
|
+
var w, k, x, C = g.trans, O = g.values, P = g.limit, T = g.query, S = P === 1 / 0 ? void 0 : P, E = T.index, T = T.range, C = C.objectStore(y), E = E.isPrimaryKey ? C : C.index(E.name), T = r(T);
|
|
1809
1809
|
if (P === 0)
|
|
1810
1810
|
return p({ result: [] });
|
|
1811
|
-
d ? ((S = O ? E.getAll(
|
|
1811
|
+
d ? ((S = O ? E.getAll(T, S) : E.getAllKeys(T, S)).onsuccess = function(R) {
|
|
1812
1812
|
return p({ result: R.target.result });
|
|
1813
|
-
}, S.onerror = de(b)) : (w = 0, k = !O && "openKeyCursor" in E ? E.openKeyCursor(
|
|
1813
|
+
}, S.onerror = de(b)) : (w = 0, k = !O && "openKeyCursor" in E ? E.openKeyCursor(T) : E.openCursor(T), x = [], k.onsuccess = function(R) {
|
|
1814
1814
|
var $ = k.result;
|
|
1815
1815
|
return $ ? (x.push(O ? $.value : $.primaryKey), ++w === P ? p({ result: x }) : void $.continue()) : p({ result: x });
|
|
1816
1816
|
}, k.onerror = de(b));
|
|
@@ -1819,9 +1819,9 @@ var Kr = { exports: {} };
|
|
|
1819
1819
|
var p = g.trans, b = g.values, w = g.query, k = g.reverse, x = g.unique;
|
|
1820
1820
|
return new Promise(function(O, P) {
|
|
1821
1821
|
O = H(O);
|
|
1822
|
-
var E = w.index, S = w.range, C = p.objectStore(y), C = E.isPrimaryKey ? C : C.index(E.name), E = k ? x ? "prevunique" : "prev" : x ? "nextunique" : "next",
|
|
1823
|
-
|
|
1824
|
-
var $, z, G, ue, N =
|
|
1822
|
+
var E = w.index, S = w.range, C = p.objectStore(y), C = E.isPrimaryKey ? C : C.index(E.name), E = k ? x ? "prevunique" : "prev" : x ? "nextunique" : "next", T = !b && "openKeyCursor" in C ? C.openKeyCursor(r(S), E) : C.openCursor(r(S), E);
|
|
1823
|
+
T.onerror = de(P), T.onsuccess = H(function(R) {
|
|
1824
|
+
var $, z, G, ue, N = T.result;
|
|
1825
1825
|
N ? (N.___id = ++qr, N.done = !1, $ = N.continue.bind(N), z = (z = N.continuePrimaryKey) && z.bind(N), G = N.advance.bind(N), ue = function() {
|
|
1826
1826
|
throw new Error("Cursor not stopped");
|
|
1827
1827
|
}, N.trans = p, N.stop = N.continue = N.continuePrimaryKey = N.advance = function() {
|
|
@@ -1835,7 +1835,7 @@ var Kr = { exports: {} };
|
|
|
1835
1835
|
});
|
|
1836
1836
|
}, N.start = function(be) {
|
|
1837
1837
|
function ie() {
|
|
1838
|
-
if (
|
|
1838
|
+
if (T.result)
|
|
1839
1839
|
try {
|
|
1840
1840
|
be();
|
|
1841
1841
|
} catch (ae) {
|
|
@@ -1847,12 +1847,12 @@ var Kr = { exports: {} };
|
|
|
1847
1847
|
}, N.stop();
|
|
1848
1848
|
}
|
|
1849
1849
|
var Vt = new Promise(function(ae, Fe) {
|
|
1850
|
-
ae = H(ae),
|
|
1850
|
+
ae = H(ae), T.onerror = de(Fe), N.fail = Fe, N.stop = function(Tn) {
|
|
1851
1851
|
N.stop = N.continue = N.continuePrimaryKey = N.advance = ue, ae(Tn);
|
|
1852
1852
|
};
|
|
1853
1853
|
});
|
|
1854
|
-
return
|
|
1855
|
-
|
|
1854
|
+
return T.onsuccess = H(function(ae) {
|
|
1855
|
+
T.onsuccess = ie, ie();
|
|
1856
1856
|
}), N.continue = $, N.continuePrimaryKey = z, N.advance = G, ie(), Vt;
|
|
1857
1857
|
}, O(N)) : O(null);
|
|
1858
1858
|
}, P);
|
|
@@ -1867,8 +1867,8 @@ var Kr = { exports: {} };
|
|
|
1867
1867
|
});
|
|
1868
1868
|
} };
|
|
1869
1869
|
}
|
|
1870
|
-
var o,
|
|
1871
|
-
return
|
|
1870
|
+
var o, s, u, m = (s = h, u = dr((o = e).objectStoreNames), { schema: { name: o.name, tables: u.map(function(f) {
|
|
1871
|
+
return s.objectStore(f);
|
|
1872
1872
|
}).map(function(f) {
|
|
1873
1873
|
var d = f.keyPath, p = f.autoIncrement, y = W(d), g = {}, p = { name: f.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: d == null, compound: y, keyPath: d, autoIncrement: p, unique: !0, extractKey: pn(d) }, indexes: dr(f.indexNames).map(function(b) {
|
|
1874
1874
|
return f.index(b);
|
|
@@ -1879,7 +1879,7 @@ var Kr = { exports: {} };
|
|
|
1879
1879
|
return g[ft(b)];
|
|
1880
1880
|
} };
|
|
1881
1881
|
return g[":id"] = p.primaryKey, d != null && (g[ft(d)] = p.primaryKey), p;
|
|
1882
|
-
}) }, hasGetAll: 0 < u.length && "getAll" in
|
|
1882
|
+
}) }, 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 = m.schema, l = m.hasGetAll, m = h.tables.map(i), c = {};
|
|
1883
1883
|
return m.forEach(function(f) {
|
|
1884
1884
|
return c[f.name] = f;
|
|
1885
1885
|
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(f) {
|
|
@@ -1890,31 +1890,31 @@ var Kr = { exports: {} };
|
|
|
1890
1890
|
}
|
|
1891
1891
|
function ti(e, t, n, r) {
|
|
1892
1892
|
var i = n.IDBKeyRange;
|
|
1893
|
-
return n.indexedDB, { dbcore: (r = ei(t, i, r), e.dbcore.reduce(function(o,
|
|
1894
|
-
return
|
|
1893
|
+
return n.indexedDB, { dbcore: (r = ei(t, i, r), e.dbcore.reduce(function(o, s) {
|
|
1894
|
+
return s = s.create, _(_({}, o), s(o));
|
|
1895
1895
|
}, r)) };
|
|
1896
1896
|
}
|
|
1897
1897
|
function Tt(e, r) {
|
|
1898
1898
|
var n = r.db, r = ti(e._middlewares, n, e._deps, r);
|
|
1899
1899
|
e.core = r.dbcore, e.tables.forEach(function(i) {
|
|
1900
1900
|
var o = i.name;
|
|
1901
|
-
e.core.schema.tables.some(function(
|
|
1902
|
-
return
|
|
1901
|
+
e.core.schema.tables.some(function(s) {
|
|
1902
|
+
return s.name === o;
|
|
1903
1903
|
}) && (i.core = e.core.table(o), e[o] instanceof e.Table && (e[o].core = i.core));
|
|
1904
1904
|
});
|
|
1905
1905
|
}
|
|
1906
1906
|
function Bt(e, t, n, r) {
|
|
1907
1907
|
n.forEach(function(i) {
|
|
1908
1908
|
var o = r[i];
|
|
1909
|
-
t.forEach(function(
|
|
1909
|
+
t.forEach(function(s) {
|
|
1910
1910
|
var u = function h(l, m) {
|
|
1911
1911
|
return Dr(l, m) || (l = oe(l)) && h(l, m);
|
|
1912
|
-
}(
|
|
1913
|
-
(!u || "value" in u && u.value === void 0) && (
|
|
1912
|
+
}(s, i);
|
|
1913
|
+
(!u || "value" in u && u.value === void 0) && (s === e.Transaction.prototype || s instanceof e.Transaction ? we(s, i, { get: function() {
|
|
1914
1914
|
return this.table(i);
|
|
1915
1915
|
}, set: function(h) {
|
|
1916
1916
|
Un(this, i, { value: h, writable: !0, configurable: !0, enumerable: !0 });
|
|
1917
|
-
} }) :
|
|
1917
|
+
} }) : s[i] = new e.Table(i, o));
|
|
1918
1918
|
});
|
|
1919
1919
|
});
|
|
1920
1920
|
}
|
|
@@ -1932,7 +1932,7 @@ var Kr = { exports: {} };
|
|
|
1932
1932
|
n.objectStoreNames.contains("$meta") && !i.$meta && (i.$meta = dn("$meta", yr("")[0], []), e._storeNames.push("$meta"));
|
|
1933
1933
|
var o = e._createTransaction("readwrite", e._storeNames, i);
|
|
1934
1934
|
o.create(n), o._completion.catch(r);
|
|
1935
|
-
var
|
|
1935
|
+
var s = o._reject.bind(o), u = D.transless || D;
|
|
1936
1936
|
xe(function() {
|
|
1937
1937
|
return D.trans = o, D.transless = u, t !== 0 ? (Tt(e, n), l = t, ((h = o).storeNames.includes("$meta") ? h.table("$meta").get("version").then(function(m) {
|
|
1938
1938
|
return m ?? l;
|
|
@@ -1949,13 +1949,13 @@ var Kr = { exports: {} };
|
|
|
1949
1949
|
}), x.change.forEach(function(E) {
|
|
1950
1950
|
if (E.recreate)
|
|
1951
1951
|
throw new I.Upgrade("Not yet support for changing primary key");
|
|
1952
|
-
var
|
|
1952
|
+
var T = y.objectStore(E.name);
|
|
1953
1953
|
E.add.forEach(function(R) {
|
|
1954
|
-
return It(
|
|
1954
|
+
return It(T, R);
|
|
1955
1955
|
}), E.change.forEach(function(R) {
|
|
1956
|
-
|
|
1956
|
+
T.deleteIndex(R.name), It(T, R);
|
|
1957
1957
|
}), E.del.forEach(function(R) {
|
|
1958
|
-
return
|
|
1958
|
+
return T.deleteIndex(R);
|
|
1959
1959
|
});
|
|
1960
1960
|
});
|
|
1961
1961
|
var O = b._cfg.contentUpgrade;
|
|
@@ -1964,7 +1964,7 @@ var Kr = { exports: {} };
|
|
|
1964
1964
|
var P = Vn(k);
|
|
1965
1965
|
x.del.forEach(function(E) {
|
|
1966
1966
|
P[E] = w[E];
|
|
1967
|
-
}), yn(c, [c.Transaction.prototype]), Bt(c, [c.Transaction.prototype],
|
|
1967
|
+
}), yn(c, [c.Transaction.prototype]), Bt(c, [c.Transaction.prototype], B(P), P), d.schema = P;
|
|
1968
1968
|
var S, C = Ht(O);
|
|
1969
1969
|
return C && Ye(), x = K.follow(function() {
|
|
1970
1970
|
var E;
|
|
@@ -1989,11 +1989,11 @@ var Kr = { exports: {} };
|
|
|
1989
1989
|
pr(p, y);
|
|
1990
1990
|
})) : K.resolve();
|
|
1991
1991
|
var c, f, d, y, g, p;
|
|
1992
|
-
}).catch(
|
|
1992
|
+
}).catch(s)) : (B(i).forEach(function(m) {
|
|
1993
1993
|
gn(n, m, i[m].primKey, i[m].indexes);
|
|
1994
1994
|
}), Tt(e, n), void K.follow(function() {
|
|
1995
1995
|
return e.on.populate.fire(o);
|
|
1996
|
-
}).catch(
|
|
1996
|
+
}).catch(s));
|
|
1997
1997
|
var h, l;
|
|
1998
1998
|
});
|
|
1999
1999
|
}
|
|
@@ -2002,12 +2002,12 @@ var Kr = { exports: {} };
|
|
|
2002
2002
|
var n = Rt(0, e.idbdb, t);
|
|
2003
2003
|
Mt(e, e._dbSchema, t);
|
|
2004
2004
|
for (var r = 0, i = mn(n, e._dbSchema).change; r < i.length; r++) {
|
|
2005
|
-
var o = function(
|
|
2006
|
-
if (
|
|
2007
|
-
return console.warn("Unable to patch indexes of table ".concat(
|
|
2008
|
-
var u = t.objectStore(
|
|
2009
|
-
|
|
2010
|
-
fe && console.debug("Dexie upgrade patch: Creating missing index ".concat(
|
|
2005
|
+
var o = function(s) {
|
|
2006
|
+
if (s.change.length || s.recreate)
|
|
2007
|
+
return console.warn("Unable to patch indexes of table ".concat(s.name, " because it has changes on the type of index or primary key.")), { value: void 0 };
|
|
2008
|
+
var u = t.objectStore(s.name);
|
|
2009
|
+
s.add.forEach(function(h) {
|
|
2010
|
+
fe && console.debug("Dexie upgrade patch: Creating missing index ".concat(s.name, ".").concat(h.src)), It(u, h);
|
|
2011
2011
|
});
|
|
2012
2012
|
}(i[r]);
|
|
2013
2013
|
if (typeof o == "object")
|
|
@@ -2021,18 +2021,18 @@ var Kr = { exports: {} };
|
|
|
2021
2021
|
for (n in t) {
|
|
2022
2022
|
var i = e[n], o = t[n];
|
|
2023
2023
|
if (i) {
|
|
2024
|
-
var
|
|
2024
|
+
var s = { name: n, def: o, recreate: !1, del: [], add: [], change: [] };
|
|
2025
2025
|
if ("" + (i.primKey.keyPath || "") != "" + (o.primKey.keyPath || "") || i.primKey.auto !== o.primKey.auto)
|
|
2026
|
-
|
|
2026
|
+
s.recreate = !0, r.change.push(s);
|
|
2027
2027
|
else {
|
|
2028
2028
|
var u = i.idxByName, h = o.idxByName, l = void 0;
|
|
2029
2029
|
for (l in u)
|
|
2030
|
-
h[l] ||
|
|
2030
|
+
h[l] || s.del.push(l);
|
|
2031
2031
|
for (l in h) {
|
|
2032
2032
|
var m = u[l], c = h[l];
|
|
2033
|
-
m ? m.src !== c.src &&
|
|
2033
|
+
m ? m.src !== c.src && s.change.push(c) : s.add.push(c);
|
|
2034
2034
|
}
|
|
2035
|
-
(0 <
|
|
2035
|
+
(0 < s.del.length || 0 < s.add.length || 0 < s.change.length) && r.change.push(s);
|
|
2036
2036
|
}
|
|
2037
2037
|
} else
|
|
2038
2038
|
r.add.push([n, o]);
|
|
@@ -2046,7 +2046,7 @@ var Kr = { exports: {} };
|
|
|
2046
2046
|
}), i;
|
|
2047
2047
|
}
|
|
2048
2048
|
function pr(e, t) {
|
|
2049
|
-
|
|
2049
|
+
B(e).forEach(function(n) {
|
|
2050
2050
|
t.db.objectStoreNames.contains(n) || (fe && console.debug("Dexie: Creating missing table", n), gn(t, n, e[n].primKey, e[n].indexes));
|
|
2051
2051
|
});
|
|
2052
2052
|
}
|
|
@@ -2056,19 +2056,19 @@ var Kr = { exports: {} };
|
|
|
2056
2056
|
function Rt(e, t, n) {
|
|
2057
2057
|
var r = {};
|
|
2058
2058
|
return gt(t.objectStoreNames, 0).forEach(function(i) {
|
|
2059
|
-
for (var o = n.objectStore(i),
|
|
2059
|
+
for (var o = n.objectStore(i), s = hn(hr(l = o.keyPath), l || "", !0, !1, !!o.autoIncrement, l && typeof l != "string", !0), u = [], h = 0; h < o.indexNames.length; ++h) {
|
|
2060
2060
|
var m = o.index(o.indexNames[h]), l = m.keyPath, m = hn(m.name, l, !!m.unique, !!m.multiEntry, !1, l && typeof l != "string", !1);
|
|
2061
2061
|
u.push(m);
|
|
2062
2062
|
}
|
|
2063
|
-
r[i] = dn(i,
|
|
2063
|
+
r[i] = dn(i, s, u);
|
|
2064
2064
|
}), r;
|
|
2065
2065
|
}
|
|
2066
2066
|
function Mt(e, t, n) {
|
|
2067
2067
|
for (var r = n.db.objectStoreNames, i = 0; i < r.length; ++i) {
|
|
2068
|
-
var o = r[i],
|
|
2069
|
-
e._hasGetAll = "getAll" in
|
|
2070
|
-
for (var u = 0; u <
|
|
2071
|
-
var h =
|
|
2068
|
+
var o = r[i], s = n.objectStore(o);
|
|
2069
|
+
e._hasGetAll = "getAll" in s;
|
|
2070
|
+
for (var u = 0; u < s.indexNames.length; ++u) {
|
|
2071
|
+
var h = s.indexNames[u], l = s.index(h).keyPath, m = typeof l == "string" ? l : "[" + gt(l).join("+") + "]";
|
|
2072
2072
|
!t[o] || (l = t[o].idxByName[m]) && (l.name = h, delete t[o].idxByName[m], t[o].idxByName[h] = l);
|
|
2073
2073
|
}
|
|
2074
2074
|
}
|
|
@@ -2081,7 +2081,7 @@ var Kr = { exports: {} };
|
|
|
2081
2081
|
});
|
|
2082
2082
|
}
|
|
2083
2083
|
var oi = (Ft.prototype._parseStoresSpec = function(e, t) {
|
|
2084
|
-
|
|
2084
|
+
B(e).forEach(function(n) {
|
|
2085
2085
|
if (e[n] !== null) {
|
|
2086
2086
|
var r = yr(e[n]), i = r.shift();
|
|
2087
2087
|
if (i.unique = !0, i.multi)
|
|
@@ -2100,7 +2100,7 @@ var Kr = { exports: {} };
|
|
|
2100
2100
|
var n = t._versions, r = {}, i = {};
|
|
2101
2101
|
return n.forEach(function(o) {
|
|
2102
2102
|
q(r, o._cfg.storesSource), i = o._cfg.dbschema = {}, o._parseStoresSpec(r, i);
|
|
2103
|
-
}), t._dbSchema = i, yn(t, [t._allTables, t, t.Transaction.prototype]), Bt(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables],
|
|
2103
|
+
}), t._dbSchema = i, yn(t, [t._allTables, t, t.Transaction.prototype]), Bt(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], B(i), i), t._storeNames = B(i), this;
|
|
2104
2104
|
}, Ft.prototype.upgrade = function(e) {
|
|
2105
2105
|
return this._cfg.contentUpgrade = Xt(this._cfg.contentUpgrade || V, e), this;
|
|
2106
2106
|
}, Ft);
|
|
@@ -2145,18 +2145,18 @@ var Kr = { exports: {} };
|
|
|
2145
2145
|
}
|
|
2146
2146
|
function dt(e, t) {
|
|
2147
2147
|
_n(t) || function n(r, h) {
|
|
2148
|
-
var o = h.from,
|
|
2149
|
-
ht(r, o,
|
|
2148
|
+
var o = h.from, s = h.to, u = h.l, h = h.r;
|
|
2149
|
+
ht(r, o, s), u && n(r, u), h && n(r, h);
|
|
2150
2150
|
}(e, t);
|
|
2151
2151
|
}
|
|
2152
2152
|
function Nt(e, t) {
|
|
2153
2153
|
var n = kn(t), r = n.next();
|
|
2154
2154
|
if (r.done)
|
|
2155
2155
|
return !1;
|
|
2156
|
-
for (var i = r.value, o = kn(e),
|
|
2156
|
+
for (var i = r.value, o = kn(e), s = o.next(i.from), u = s.value; !r.done && !s.done; ) {
|
|
2157
2157
|
if (U(u.from, i.to) <= 0 && 0 <= U(u.to, i.from))
|
|
2158
2158
|
return !0;
|
|
2159
|
-
U(i.from, u.from) < 0 ? i = (r = n.next(u.from)).value : u = (
|
|
2159
|
+
U(i.from, u.from) < 0 ? i = (r = n.next(u.from)).value : u = (s = o.next(i.from)).value;
|
|
2160
2160
|
}
|
|
2161
2161
|
return !1;
|
|
2162
2162
|
}
|
|
@@ -2195,11 +2195,11 @@ var Kr = { exports: {} };
|
|
|
2195
2195
|
return (t ? n ? Math.max(t.d, n.d) : t.d : n ? n.d : 0) + 1;
|
|
2196
2196
|
}
|
|
2197
2197
|
function zt(e, t) {
|
|
2198
|
-
return
|
|
2198
|
+
return B(t).forEach(function(n) {
|
|
2199
2199
|
e[n] ? dt(e[n], t[n]) : e[n] = function r(i) {
|
|
2200
|
-
var o,
|
|
2200
|
+
var o, s, u = {};
|
|
2201
2201
|
for (o in i)
|
|
2202
|
-
ne(i, o) && (
|
|
2202
|
+
ne(i, o) && (s = i[o], u[o] = !s || typeof s != "object" || Yn.has(s.constructor) ? s : r(s));
|
|
2203
2203
|
return u;
|
|
2204
2204
|
}(t[n]);
|
|
2205
2205
|
}), e;
|
|
@@ -2232,19 +2232,19 @@ var Kr = { exports: {} };
|
|
|
2232
2232
|
var n = /* @__PURE__ */ new Set();
|
|
2233
2233
|
if (e.all)
|
|
2234
2234
|
for (var r = 0, i = Object.values(Re); r < i.length; r++)
|
|
2235
|
-
vr(
|
|
2235
|
+
vr(s = i[r], e, n, t);
|
|
2236
2236
|
else
|
|
2237
2237
|
for (var o in e) {
|
|
2238
|
-
var
|
|
2239
|
-
u && (o = u[1], u = u[2], (
|
|
2238
|
+
var s, u = /^idb\:\/\/(.*)\/(.*)\//.exec(o);
|
|
2239
|
+
u && (o = u[1], u = u[2], (s = Re["idb://".concat(o, "/").concat(u)]) && vr(s, e, n, t));
|
|
2240
2240
|
}
|
|
2241
2241
|
n.forEach(function(h) {
|
|
2242
2242
|
return h();
|
|
2243
2243
|
});
|
|
2244
2244
|
}
|
|
2245
2245
|
function vr(e, t, n, r) {
|
|
2246
|
-
for (var i = [], o = 0,
|
|
2247
|
-
for (var u =
|
|
2246
|
+
for (var i = [], o = 0, s = Object.entries(e.queries.query); o < s.length; o++) {
|
|
2247
|
+
for (var u = s[o], h = u[0], l = [], m = 0, c = u[1]; m < c.length; m++) {
|
|
2248
2248
|
var f = c[m];
|
|
2249
2249
|
xn(t, f.obsSet) ? f.subscribers.forEach(function(p) {
|
|
2250
2250
|
return n.add(p);
|
|
@@ -2262,17 +2262,17 @@ var Kr = { exports: {} };
|
|
|
2262
2262
|
var t = e._state, n = e._deps.indexedDB;
|
|
2263
2263
|
if (t.isBeingOpened || e.idbdb)
|
|
2264
2264
|
return t.dbReadyPromise.then(function() {
|
|
2265
|
-
return t.dbOpenError ?
|
|
2265
|
+
return t.dbOpenError ? X(t.dbOpenError) : e;
|
|
2266
2266
|
});
|
|
2267
2267
|
t.isBeingOpened = !0, t.dbOpenError = null, t.openComplete = !1;
|
|
2268
2268
|
var r = t.openCanceller, i = Math.round(10 * e.verno), o = !1;
|
|
2269
|
-
function
|
|
2269
|
+
function s() {
|
|
2270
2270
|
if (t.openCanceller !== r)
|
|
2271
2271
|
throw new I.DatabaseClosed("db.open() was cancelled");
|
|
2272
2272
|
}
|
|
2273
2273
|
function u() {
|
|
2274
2274
|
return new K(function(f, d) {
|
|
2275
|
-
if (
|
|
2275
|
+
if (s(), !n)
|
|
2276
2276
|
throw new I.MissingAPI();
|
|
2277
2277
|
var y = e.name, g = t.autoSchema || !i ? n.open(y) : n.open(y, i);
|
|
2278
2278
|
if (!g)
|
|
@@ -2289,7 +2289,7 @@ var Kr = { exports: {} };
|
|
|
2289
2289
|
try {
|
|
2290
2290
|
var S = O.transaction((k = P).length === 1 ? k[0] : k, "readonly");
|
|
2291
2291
|
if (t.autoSchema)
|
|
2292
|
-
b = O, w = S, (p = e).verno = b.version / 10, w = p._dbSchema = Rt(0, b, w), p._storeNames = gt(b.objectStoreNames, 0), Bt(p, [p._allTables],
|
|
2292
|
+
b = O, w = S, (p = e).verno = b.version / 10, w = p._dbSchema = Rt(0, b, w), p._storeNames = gt(b.objectStoreNames, 0), Bt(p, [p._allTables], B(w), w);
|
|
2293
2293
|
else if (Mt(e, e._dbSchema, S), ((x = mn(Rt(0, (x = e).idbdb, S), x._dbSchema)).add.length || x.change.some(function(C) {
|
|
2294
2294
|
return C.add.length || C.change.length;
|
|
2295
2295
|
})) && !o)
|
|
@@ -2325,7 +2325,7 @@ var Kr = { exports: {} };
|
|
|
2325
2325
|
}).finally(function() {
|
|
2326
2326
|
return clearInterval(h);
|
|
2327
2327
|
}) : Promise.resolve()).then(u)]).then(function() {
|
|
2328
|
-
return
|
|
2328
|
+
return s(), t.onReadyBeingFired = [], K.resolve(wn(function() {
|
|
2329
2329
|
return e.on.ready.fire(e.vip);
|
|
2330
2330
|
})).then(function f() {
|
|
2331
2331
|
if (0 < t.onReadyBeingFired.length) {
|
|
@@ -2343,7 +2343,7 @@ var Kr = { exports: {} };
|
|
|
2343
2343
|
m && m.abort();
|
|
2344
2344
|
} catch {
|
|
2345
2345
|
}
|
|
2346
|
-
return r === t.openCanceller && e._close(),
|
|
2346
|
+
return r === t.openCanceller && e._close(), X(f);
|
|
2347
2347
|
}).finally(function() {
|
|
2348
2348
|
t.openComplete = !0, l();
|
|
2349
2349
|
}).then(function() {
|
|
@@ -2378,16 +2378,16 @@ var Kr = { exports: {} };
|
|
|
2378
2378
|
var si = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2379
2379
|
return _(_({}, e), { table: function(t) {
|
|
2380
2380
|
var n = e.table(t), r = n.schema, i = {}, o = [];
|
|
2381
|
-
function
|
|
2381
|
+
function s(c, f, d) {
|
|
2382
2382
|
var y = ft(c), g = i[y] = i[y] || [], p = c == null ? 0 : typeof c == "string" ? 1 : c.length, b = 0 < f, b = _(_({}, d), { name: b ? "".concat(y, "(virtual-from:").concat(d.name, ")") : d.name, lowLevelIndex: d, isVirtual: b, keyTail: f, keyLength: p, extractKey: pn(c), unique: !b && d.unique });
|
|
2383
|
-
return g.push(b), b.isPrimaryKey || o.push(b), 1 < p &&
|
|
2383
|
+
return g.push(b), b.isPrimaryKey || o.push(b), 1 < p && s(p === 2 ? c[0] : c.slice(0, p - 1), f + 1, d), g.sort(function(w, k) {
|
|
2384
2384
|
return w.keyTail - k.keyTail;
|
|
2385
2385
|
}), b;
|
|
2386
2386
|
}
|
|
2387
|
-
t =
|
|
2387
|
+
t = s(r.primaryKey.keyPath, 0, r.primaryKey), i[":id"] = [t];
|
|
2388
2388
|
for (var u = 0, h = r.indexes; u < h.length; u++) {
|
|
2389
2389
|
var l = h[u];
|
|
2390
|
-
|
|
2390
|
+
s(l.keyPath, 0, l);
|
|
2391
2391
|
}
|
|
2392
2392
|
function m(c) {
|
|
2393
2393
|
var f, d = c.query.index;
|
|
@@ -2422,10 +2422,10 @@ var Kr = { exports: {} };
|
|
|
2422
2422
|
} });
|
|
2423
2423
|
} };
|
|
2424
2424
|
function jn(e, t, n, r) {
|
|
2425
|
-
return n = n || {}, r = r || "",
|
|
2426
|
-
var o,
|
|
2427
|
-
ne(t, i) ? (o = e[i],
|
|
2428
|
-
}),
|
|
2425
|
+
return n = n || {}, r = r || "", B(e).forEach(function(i) {
|
|
2426
|
+
var o, s, u;
|
|
2427
|
+
ne(t, i) ? (o = e[i], s = t[i], typeof o == "object" && typeof s == "object" && o && s ? (u = Gt(o)) !== Gt(s) ? n[r + i] = t[i] : u === "Object" ? jn(o, s, n, r + i + ".") : o !== s && (n[r + i] = t[i]) : o !== s && (n[r + i] = t[i])) : n[r + i] = void 0;
|
|
2428
|
+
}), B(t).forEach(function(i) {
|
|
2429
2429
|
ne(e, i) || (n[r + i] = t[i]);
|
|
2430
2430
|
}), n;
|
|
2431
2431
|
}
|
|
@@ -2436,7 +2436,7 @@ var Kr = { exports: {} };
|
|
|
2436
2436
|
return _(_({}, e), { table: function(t) {
|
|
2437
2437
|
var n = e.table(t), r = n.schema.primaryKey;
|
|
2438
2438
|
return _(_({}, n), { mutate: function(i) {
|
|
2439
|
-
var o = D.trans,
|
|
2439
|
+
var o = D.trans, s = o.table(t).hook, u = s.deleting, h = s.creating, l = s.updating;
|
|
2440
2440
|
switch (i.type) {
|
|
2441
2441
|
case "add":
|
|
2442
2442
|
if (h.fire === V)
|
|
@@ -2478,8 +2478,8 @@ var Kr = { exports: {} };
|
|
|
2478
2478
|
return (c = c.type === "add" || c.type === "put" ? _(_({}, c), { keys: p }) : _({}, c)).type !== "delete" && (c.values = j([], c.values, !0)), c.keys && (c.keys = j([], c.keys, !0)), f = n, y = p, ((d = c).type === "add" ? Promise.resolve([]) : f.getMany({ trans: d.trans, keys: y, cache: "immutable" })).then(function(b) {
|
|
2479
2479
|
var w = p.map(function(k, x) {
|
|
2480
2480
|
var O, P, S, C = b[x], E = { onerror: null, onsuccess: null };
|
|
2481
|
-
return c.type === "delete" ? u.fire.call(E, k, C, g) : c.type === "add" || C === void 0 ? (O = h.fire.call(E, k, c.values[x], g), k == null && O != null && (c.keys[x] = k = O, r.outbound || ce(c.values[x], r.keyPath, k))) : (O = jn(C, c.values[x]), (P = l.fire.call(E, O, k, C, g)) && (S = c.values[x], Object.keys(P).forEach(function(
|
|
2482
|
-
ne(S,
|
|
2481
|
+
return c.type === "delete" ? u.fire.call(E, k, C, g) : c.type === "add" || C === void 0 ? (O = h.fire.call(E, k, c.values[x], g), k == null && O != null && (c.keys[x] = k = O, r.outbound || ce(c.values[x], r.keyPath, k))) : (O = jn(C, c.values[x]), (P = l.fire.call(E, O, k, C, g)) && (S = c.values[x], Object.keys(P).forEach(function(T) {
|
|
2482
|
+
ne(S, T) ? S[T] = P[T] : ce(S, T, P[T]);
|
|
2483
2483
|
}))), E;
|
|
2484
2484
|
});
|
|
2485
2485
|
return n.mutate(c).then(function(k) {
|
|
@@ -2549,28 +2549,28 @@ var Kr = { exports: {} };
|
|
|
2549
2549
|
var d = (y = d.query).index, y = y.range;
|
|
2550
2550
|
return [d, new re((d = y.lower) !== null && d !== void 0 ? d : e.MIN_KEY, (y = y.upper) !== null && y !== void 0 ? y : e.MAX_KEY)];
|
|
2551
2551
|
}
|
|
2552
|
-
var o = e.table(r),
|
|
2552
|
+
var o = e.table(r), s = o.schema, u = s.primaryKey, h = u.extractKey, l = u.outbound, m = _(_({}, o), { mutate: function(f) {
|
|
2553
2553
|
function d(E) {
|
|
2554
2554
|
return E = "idb://".concat(t, "/").concat(r, "/").concat(E), w[E] || (w[E] = new re());
|
|
2555
2555
|
}
|
|
2556
2556
|
var y, g, p, b = f.trans, w = f.mutatedParts || (f.mutatedParts = {}), k = d(""), x = d(":dels"), O = f.type, C = f.type === "deleteRange" ? [f.range] : f.type === "delete" ? [f.keys] : f.values.length < 50 ? [Cn(u, f).filter(function(E) {
|
|
2557
2557
|
return E;
|
|
2558
2558
|
}), f.values] : [], P = C[0], S = C[1], C = f.trans._cache;
|
|
2559
|
-
return W(P) ? (k.addKeys(P), (C = O === "delete" || P.length === S.length ? br(P, C) : null) || x.addKeys(P), (C || S) && (y = d, g = C, p = S,
|
|
2560
|
-
var
|
|
2559
|
+
return W(P) ? (k.addKeys(P), (C = O === "delete" || P.length === S.length ? br(P, C) : null) || x.addKeys(P), (C || S) && (y = d, g = C, p = S, s.indexes.forEach(function(E) {
|
|
2560
|
+
var T = y(E.name || "");
|
|
2561
2561
|
function R(z) {
|
|
2562
2562
|
return z != null ? E.extractKey(z) : null;
|
|
2563
2563
|
}
|
|
2564
2564
|
function $(z) {
|
|
2565
2565
|
return E.multiEntry && W(z) ? z.forEach(function(G) {
|
|
2566
|
-
return
|
|
2567
|
-
}) :
|
|
2566
|
+
return T.addKey(G);
|
|
2567
|
+
}) : T.addKey(z);
|
|
2568
2568
|
}
|
|
2569
2569
|
(g || p).forEach(function(z, N) {
|
|
2570
2570
|
var ue = g && R(g[N]), N = p && R(p[N]);
|
|
2571
2571
|
U(ue, N) !== 0 && (ue != null && $(ue), N != null && $(N));
|
|
2572
2572
|
});
|
|
2573
|
-
}))) : P ? (S = { from: P.lower, to: P.upper }, x.add(S), k.add(S)) : (k.add(n), x.add(n),
|
|
2573
|
+
}))) : P ? (S = { from: P.lower, to: P.upper }, x.add(S), k.add(S)) : (k.add(n), x.add(n), s.indexes.forEach(function(E) {
|
|
2574
2574
|
return d(E.name).add(n);
|
|
2575
2575
|
})), o.mutate(f).then(function(E) {
|
|
2576
2576
|
return !P || f.type !== "add" && f.type !== "put" || k.addKeys(E.results), b.mutatedParts = zt(b.mutatedParts || {}, w), E;
|
|
@@ -2580,7 +2580,7 @@ var Kr = { exports: {} };
|
|
|
2580
2580
|
}, getMany: function(f) {
|
|
2581
2581
|
return [u, new re().addKeys(f.keys)];
|
|
2582
2582
|
}, count: i, query: i, openCursor: i };
|
|
2583
|
-
return
|
|
2583
|
+
return B(c).forEach(function(f) {
|
|
2584
2584
|
m[f] = function(d) {
|
|
2585
2585
|
var y = D.subscr, g = !!y, p = wr(D, o) && _r(f, d) ? d.obsSet = {} : y;
|
|
2586
2586
|
if (g) {
|
|
@@ -2599,14 +2599,14 @@ var Kr = { exports: {} };
|
|
|
2599
2599
|
var C = d.values ? S.result.map(h) : S.result;
|
|
2600
2600
|
(d.values ? w : k).addKeys(C);
|
|
2601
2601
|
} else if (f === "openCursor") {
|
|
2602
|
-
var E = S,
|
|
2602
|
+
var E = S, T = d.values;
|
|
2603
2603
|
return E && Object.create(E, { key: { get: function() {
|
|
2604
2604
|
return k.addKey(E.primaryKey), E.key;
|
|
2605
2605
|
} }, primaryKey: { get: function() {
|
|
2606
2606
|
var R = E.primaryKey;
|
|
2607
2607
|
return k.addKey(R), R;
|
|
2608
2608
|
} }, value: { get: function() {
|
|
2609
|
-
return
|
|
2609
|
+
return T && w.addKey(E.primaryKey), E.value;
|
|
2610
2610
|
} } });
|
|
2611
2611
|
}
|
|
2612
2612
|
return S;
|
|
@@ -2639,7 +2639,7 @@ var Kr = { exports: {} };
|
|
|
2639
2639
|
function xr(e, t, f, r, i, o) {
|
|
2640
2640
|
if (!f || f.length === 0)
|
|
2641
2641
|
return e;
|
|
2642
|
-
var
|
|
2642
|
+
var s = t.query.index, u = s.multiEntry, h = t.query.range, l = r.schema.primaryKey.extractKey, m = s.extractKey, c = (s.lowLevelIndex || s).extractKey, f = f.reduce(function(d, y) {
|
|
2643
2643
|
var g = d, p = y.type === "add" || y.type === "put" ? y.values.filter(function(x) {
|
|
2644
2644
|
return x = m(x), u && W(x) ? x.some(function(O) {
|
|
2645
2645
|
return Kn(O, h);
|
|
@@ -2725,8 +2725,8 @@ var Kr = { exports: {} };
|
|
|
2725
2725
|
var di = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
|
|
2726
2726
|
var t = e.schema.name;
|
|
2727
2727
|
return _(_({}, e), { transaction: function(n, r, i) {
|
|
2728
|
-
var o,
|
|
2729
|
-
return r === "readwrite" && (
|
|
2728
|
+
var o, s, u = e.transaction(n, r, i);
|
|
2729
|
+
return r === "readwrite" && (s = (o = new AbortController()).signal, i = function(h) {
|
|
2730
2730
|
return function() {
|
|
2731
2731
|
if (o.abort(), r === "readwrite") {
|
|
2732
2732
|
for (var l = /* @__PURE__ */ new Set(), m = 0, c = n; m < c.length; m++) {
|
|
@@ -2746,8 +2746,8 @@ var Kr = { exports: {} };
|
|
|
2746
2746
|
return R.trans !== u;
|
|
2747
2747
|
});
|
|
2748
2748
|
for (var x = 0, O = Object.values(d.queries.query); x < O.length; x++)
|
|
2749
|
-
for (var P, S, C, E = 0,
|
|
2750
|
-
(S =
|
|
2749
|
+
for (var P, S, C, E = 0, T = (P = O[x]).slice(); E < T.length; E++)
|
|
2750
|
+
(S = T[E]).res != null && u.mutatedParts && (h && !S.dirty ? (C = Object.isFrozen(S.res), C = xr(S.res, S.req, g, y, S, C), S.dirty ? (Ce(P, S), S.subscribers.forEach(function(R) {
|
|
2751
2751
|
return l.add(R);
|
|
2752
2752
|
})) : C !== S.res && (S.res = C, S.promise = K.resolve({ result: C }))) : (S.dirty && Ce(P, S), S.subscribers.forEach(function(R) {
|
|
2753
2753
|
return l.add(R);
|
|
@@ -2760,21 +2760,21 @@ var Kr = { exports: {} };
|
|
|
2760
2760
|
});
|
|
2761
2761
|
}
|
|
2762
2762
|
};
|
|
2763
|
-
}, u.addEventListener("abort", i(!1), { signal:
|
|
2763
|
+
}, u.addEventListener("abort", i(!1), { signal: s }), u.addEventListener("error", i(!1), { signal: s }), u.addEventListener("complete", i(!0), { signal: s })), u;
|
|
2764
2764
|
}, table: function(n) {
|
|
2765
2765
|
var r = e.table(n), i = r.schema.primaryKey;
|
|
2766
2766
|
return _(_({}, r), { mutate: function(o) {
|
|
2767
|
-
var
|
|
2768
|
-
if (i.outbound ||
|
|
2767
|
+
var s = D.trans;
|
|
2768
|
+
if (i.outbound || s.db._options.cache === "disabled" || s.explicit)
|
|
2769
2769
|
return r.mutate(o);
|
|
2770
2770
|
var u = Re["idb://".concat(t, "/").concat(n)];
|
|
2771
|
-
return u ? (
|
|
2771
|
+
return u ? (s = r.mutate(o), o.type !== "add" && o.type !== "put" || !(50 <= o.values.length || Cn(i, o).some(function(h) {
|
|
2772
2772
|
return h == null;
|
|
2773
|
-
})) ? (u.optimisticOps.push(o), o.mutatedParts && Lt(o.mutatedParts),
|
|
2773
|
+
})) ? (u.optimisticOps.push(o), o.mutatedParts && Lt(o.mutatedParts), s.then(function(h) {
|
|
2774
2774
|
0 < h.numFailures && (Ce(u.optimisticOps, o), (h = kr(0, o, h)) && u.optimisticOps.push(h), o.mutatedParts && Lt(o.mutatedParts));
|
|
2775
|
-
}),
|
|
2775
|
+
}), s.catch(function() {
|
|
2776
2776
|
Ce(u.optimisticOps, o), o.mutatedParts && Lt(o.mutatedParts);
|
|
2777
|
-
})) :
|
|
2777
|
+
})) : s.then(function(h) {
|
|
2778
2778
|
var l = kr(0, _(_({}, o), { values: o.values.map(function(d, c) {
|
|
2779
2779
|
var f, d = (f = i.keyPath) !== null && f !== void 0 && f.includes(".") ? _e(d) : _({}, d);
|
|
2780
2780
|
return ce(d, i.keyPath, h.results[c]), d;
|
|
@@ -2782,11 +2782,11 @@ var Kr = { exports: {} };
|
|
|
2782
2782
|
u.optimisticOps.push(l), queueMicrotask(function() {
|
|
2783
2783
|
return o.mutatedParts && Lt(o.mutatedParts);
|
|
2784
2784
|
});
|
|
2785
|
-
}),
|
|
2785
|
+
}), s) : r.mutate(o);
|
|
2786
2786
|
}, query: function(o) {
|
|
2787
2787
|
if (!wr(D, r) || !_r("query", o))
|
|
2788
2788
|
return r.query(o);
|
|
2789
|
-
var
|
|
2789
|
+
var s = ((l = D.trans) === null || l === void 0 ? void 0 : l.db._options.cache) === "immutable", c = D, u = c.requery, h = c.signal, l = function(y, g, p, b) {
|
|
2790
2790
|
var w = Re["idb://".concat(y, "/").concat(g)];
|
|
2791
2791
|
if (!w)
|
|
2792
2792
|
return [];
|
|
@@ -2811,7 +2811,7 @@ var Kr = { exports: {} };
|
|
|
2811
2811
|
}(t, n, "query", o), m = l[0], c = l[1], f = l[2], d = l[3];
|
|
2812
2812
|
return m && c ? m.obsSet = o.obsSet : (c = r.query(o).then(function(y) {
|
|
2813
2813
|
var g = y.result;
|
|
2814
|
-
if (m && (m.res = g),
|
|
2814
|
+
if (m && (m.res = g), s) {
|
|
2815
2815
|
for (var p = 0, b = g.length; p < b; ++p)
|
|
2816
2816
|
Object.freeze(g[p]);
|
|
2817
2817
|
Object.freeze(g);
|
|
@@ -2821,7 +2821,7 @@ var Kr = { exports: {} };
|
|
|
2821
2821
|
}).catch(function(y) {
|
|
2822
2822
|
return d && m && Ce(d, m), Promise.reject(y);
|
|
2823
2823
|
}), m = { obsSet: o.obsSet, promise: c, subscribers: /* @__PURE__ */ new Set(), type: "query", req: o, dirty: !1 }, d ? d.push(m) : (d = [m], (f = f || (Re["idb://".concat(t, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[o.query.index.name || ""] = d)), hi(m, d, u, h), m.promise.then(function(y) {
|
|
2824
|
-
return { result: xr(y.result, o, f == null ? void 0 : f.optimisticOps, r, m,
|
|
2824
|
+
return { result: xr(y.result, o, f == null ? void 0 : f.optimisticOps, r, m, s) };
|
|
2825
2825
|
});
|
|
2826
2826
|
} });
|
|
2827
2827
|
} });
|
|
@@ -2831,7 +2831,7 @@ var Kr = { exports: {} };
|
|
|
2831
2831
|
return r === "db" ? t : Reflect.get(n, r, i);
|
|
2832
2832
|
} });
|
|
2833
2833
|
}
|
|
2834
|
-
var ve = (
|
|
2834
|
+
var ve = (J.prototype.version = function(e) {
|
|
2835
2835
|
if (isNaN(e) || e < 0.1)
|
|
2836
2836
|
throw new I.Type("Given version is not a positive number");
|
|
2837
2837
|
if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened)
|
|
@@ -2841,7 +2841,7 @@ var Kr = { exports: {} };
|
|
|
2841
2841
|
return r._cfg.version === e;
|
|
2842
2842
|
})[0];
|
|
2843
2843
|
return n || (n = new this.Version(e), t.push(n), t.sort(ni), n.stores({}), this._state.autoSchema = !1, n);
|
|
2844
|
-
},
|
|
2844
|
+
}, J.prototype._whenReady = function(e) {
|
|
2845
2845
|
var t = this;
|
|
2846
2846
|
return this.idbdb && (this._state.openComplete || D.letThrough || this._vip) ? e() : new K(function(n, r) {
|
|
2847
2847
|
if (t._state.openComplete)
|
|
@@ -2853,22 +2853,22 @@ var Kr = { exports: {} };
|
|
|
2853
2853
|
}
|
|
2854
2854
|
t._state.dbReadyPromise.then(n, r);
|
|
2855
2855
|
}).then(e);
|
|
2856
|
-
},
|
|
2856
|
+
}, J.prototype.use = function(e) {
|
|
2857
2857
|
var t = e.stack, n = e.create, r = e.level, i = e.name;
|
|
2858
|
-
return i && this.unuse({ stack: t, name: i }), e = this._middlewares[t] || (this._middlewares[t] = []), e.push({ stack: t, create: n, level: r ?? 10, name: i }), e.sort(function(o,
|
|
2859
|
-
return o.level -
|
|
2858
|
+
return i && this.unuse({ stack: t, name: i }), e = this._middlewares[t] || (this._middlewares[t] = []), e.push({ stack: t, create: n, level: r ?? 10, name: i }), e.sort(function(o, s) {
|
|
2859
|
+
return o.level - s.level;
|
|
2860
2860
|
}), this;
|
|
2861
|
-
},
|
|
2861
|
+
}, J.prototype.unuse = function(e) {
|
|
2862
2862
|
var t = e.stack, n = e.name, r = e.create;
|
|
2863
2863
|
return t && this._middlewares[t] && (this._middlewares[t] = this._middlewares[t].filter(function(i) {
|
|
2864
2864
|
return r ? i.create !== r : !!n && i.name !== n;
|
|
2865
2865
|
})), this;
|
|
2866
|
-
},
|
|
2866
|
+
}, J.prototype.open = function() {
|
|
2867
2867
|
var e = this;
|
|
2868
2868
|
return Te(ke, function() {
|
|
2869
2869
|
return ai(e);
|
|
2870
2870
|
});
|
|
2871
|
-
},
|
|
2871
|
+
}, J.prototype._close = function() {
|
|
2872
2872
|
var e = this._state, t = He.indexOf(this);
|
|
2873
2873
|
if (0 <= t && He.splice(t, 1), this.idbdb) {
|
|
2874
2874
|
try {
|
|
@@ -2882,15 +2882,15 @@ var Kr = { exports: {} };
|
|
|
2882
2882
|
}), e.openCanceller = new K(function(n, r) {
|
|
2883
2883
|
e.cancelOpen = r;
|
|
2884
2884
|
}));
|
|
2885
|
-
},
|
|
2885
|
+
}, J.prototype.close = function(n) {
|
|
2886
2886
|
var t = (n === void 0 ? { disableAutoOpen: !0 } : n).disableAutoOpen, n = this._state;
|
|
2887
2887
|
t ? (n.isBeingOpened && n.cancelOpen(new I.DatabaseClosed()), this._close(), n.autoOpen = !1, n.dbOpenError = new I.DatabaseClosed()) : (this._close(), n.autoOpen = this._options.autoOpen || n.isBeingOpened, n.openComplete = !1, n.dbOpenError = null);
|
|
2888
|
-
},
|
|
2888
|
+
}, J.prototype.delete = function(e) {
|
|
2889
2889
|
var t = this;
|
|
2890
2890
|
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
2891
2891
|
var n = 0 < arguments.length, r = this._state;
|
|
2892
2892
|
return new K(function(i, o) {
|
|
2893
|
-
function
|
|
2893
|
+
function s() {
|
|
2894
2894
|
t.close(e);
|
|
2895
2895
|
var u = t._deps.indexedDB.deleteDatabase(t.name);
|
|
2896
2896
|
u.onsuccess = H(function() {
|
|
@@ -2900,25 +2900,25 @@ var Kr = { exports: {} };
|
|
|
2900
2900
|
}
|
|
2901
2901
|
if (n)
|
|
2902
2902
|
throw new I.InvalidArgument("Arguments not allowed in db.delete()");
|
|
2903
|
-
r.isBeingOpened ? r.dbReadyPromise.then(
|
|
2903
|
+
r.isBeingOpened ? r.dbReadyPromise.then(s) : s();
|
|
2904
2904
|
});
|
|
2905
|
-
},
|
|
2905
|
+
}, J.prototype.backendDB = function() {
|
|
2906
2906
|
return this.idbdb;
|
|
2907
|
-
},
|
|
2907
|
+
}, J.prototype.isOpen = function() {
|
|
2908
2908
|
return this.idbdb !== null;
|
|
2909
|
-
},
|
|
2909
|
+
}, J.prototype.hasBeenClosed = function() {
|
|
2910
2910
|
var e = this._state.dbOpenError;
|
|
2911
2911
|
return e && e.name === "DatabaseClosed";
|
|
2912
|
-
},
|
|
2912
|
+
}, J.prototype.hasFailed = function() {
|
|
2913
2913
|
return this._state.dbOpenError !== null;
|
|
2914
|
-
},
|
|
2914
|
+
}, J.prototype.dynamicallyOpened = function() {
|
|
2915
2915
|
return this._state.autoSchema;
|
|
2916
|
-
}, Object.defineProperty(
|
|
2916
|
+
}, Object.defineProperty(J.prototype, "tables", { get: function() {
|
|
2917
2917
|
var e = this;
|
|
2918
|
-
return
|
|
2918
|
+
return B(this._allTables).map(function(t) {
|
|
2919
2919
|
return e._allTables[t];
|
|
2920
2920
|
});
|
|
2921
|
-
}, enumerable: !1, configurable: !0 }),
|
|
2921
|
+
}, enumerable: !1, configurable: !0 }), J.prototype.transaction = function() {
|
|
2922
2922
|
var e = (function(t, n, r) {
|
|
2923
2923
|
var i = arguments.length;
|
|
2924
2924
|
if (i < 2)
|
|
@@ -2928,13 +2928,13 @@ var Kr = { exports: {} };
|
|
|
2928
2928
|
return r = o.pop(), [t, Gn(o), r];
|
|
2929
2929
|
}).apply(this, arguments);
|
|
2930
2930
|
return this._transaction.apply(this, e);
|
|
2931
|
-
},
|
|
2931
|
+
}, J.prototype._transaction = function(e, t, n) {
|
|
2932
2932
|
var r = this, i = D.trans;
|
|
2933
2933
|
i && i.db === this && e.indexOf("!") === -1 || (i = null);
|
|
2934
|
-
var o,
|
|
2934
|
+
var o, s, u = e.indexOf("?") !== -1;
|
|
2935
2935
|
e = e.replace("!", "").replace("?", "");
|
|
2936
2936
|
try {
|
|
2937
|
-
if (
|
|
2937
|
+
if (s = t.map(function(l) {
|
|
2938
2938
|
if (l = l instanceof r.Table ? l.name : l, typeof l != "string")
|
|
2939
2939
|
throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
|
|
2940
2940
|
return l;
|
|
@@ -2951,7 +2951,7 @@ var Kr = { exports: {} };
|
|
|
2951
2951
|
throw new I.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
2952
2952
|
i = null;
|
|
2953
2953
|
}
|
|
2954
|
-
i &&
|
|
2954
|
+
i && s.forEach(function(l) {
|
|
2955
2955
|
if (i && i.storeNames.indexOf(l) === -1) {
|
|
2956
2956
|
if (!u)
|
|
2957
2957
|
throw new I.SubTransaction("Table " + l + " not included in parent transaction.");
|
|
@@ -2962,7 +2962,7 @@ var Kr = { exports: {} };
|
|
|
2962
2962
|
} catch (l) {
|
|
2963
2963
|
return i ? i._promise(null, function(m, c) {
|
|
2964
2964
|
c(l);
|
|
2965
|
-
}) :
|
|
2965
|
+
}) : X(l);
|
|
2966
2966
|
}
|
|
2967
2967
|
var h = (function l(m, c, f, d, y) {
|
|
2968
2968
|
return K.resolve().then(function() {
|
|
@@ -2975,14 +2975,14 @@ var Kr = { exports: {} };
|
|
|
2975
2975
|
} catch (k) {
|
|
2976
2976
|
return k.name === Qt.InvalidState && m.isOpen() && 0 < --m._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), m.close({ disableAutoOpen: !1 }), m.open().then(function() {
|
|
2977
2977
|
return l(m, c, f, null, y);
|
|
2978
|
-
})) :
|
|
2978
|
+
})) : X(k);
|
|
2979
2979
|
}
|
|
2980
2980
|
var b, w = Ht(y);
|
|
2981
2981
|
return w && Ye(), g = K.follow(function() {
|
|
2982
2982
|
var k;
|
|
2983
2983
|
(b = y.call(p, p)) && (w ? (k = Oe.bind(null, null), b.then(k, k)) : typeof b.next == "function" && typeof b.throw == "function" && (b = Pn(b)));
|
|
2984
2984
|
}, g), (b && typeof b.then == "function" ? K.resolve(b).then(function(k) {
|
|
2985
|
-
return p.active ? k :
|
|
2985
|
+
return p.active ? k : X(new I.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
2986
2986
|
}) : g.then(function() {
|
|
2987
2987
|
return b;
|
|
2988
2988
|
})).then(function(k) {
|
|
@@ -2990,31 +2990,31 @@ var Kr = { exports: {} };
|
|
|
2990
2990
|
return k;
|
|
2991
2991
|
});
|
|
2992
2992
|
}).catch(function(k) {
|
|
2993
|
-
return p._reject(k),
|
|
2993
|
+
return p._reject(k), X(k);
|
|
2994
2994
|
});
|
|
2995
2995
|
});
|
|
2996
|
-
}).bind(null, this, o,
|
|
2996
|
+
}).bind(null, this, o, s, i, n);
|
|
2997
2997
|
return i ? i._promise(o, h, "lock") : D.trans ? Te(D.transless, function() {
|
|
2998
2998
|
return r._whenReady(h);
|
|
2999
2999
|
}) : this._whenReady(h);
|
|
3000
|
-
},
|
|
3000
|
+
}, J.prototype.table = function(e) {
|
|
3001
3001
|
if (!ne(this._allTables, e))
|
|
3002
3002
|
throw new I.InvalidTable("Table ".concat(e, " does not exist"));
|
|
3003
3003
|
return this._allTables[e];
|
|
3004
|
-
},
|
|
3005
|
-
function
|
|
3004
|
+
}, J);
|
|
3005
|
+
function J(e, t) {
|
|
3006
3006
|
var n = this;
|
|
3007
3007
|
this._middlewares = {}, this.verno = 0;
|
|
3008
|
-
var r =
|
|
3009
|
-
this._options = t = _({ addons:
|
|
3010
|
-
var i, o,
|
|
3008
|
+
var r = J.dependencies;
|
|
3009
|
+
this._options = t = _({ addons: J.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;
|
|
3010
|
+
var i, o, s, u, h, l = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: V, dbReadyPromise: null, cancelOpen: V, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
|
|
3011
3011
|
l.dbReadyPromise = new K(function(c) {
|
|
3012
3012
|
l.dbReadyResolve = c;
|
|
3013
3013
|
}), l.openCanceller = new K(function(c, f) {
|
|
3014
3014
|
l.cancelOpen = f;
|
|
3015
3015
|
}), this._state = l, this.name = e, this.on = at(this, "populate", "blocked", "versionchange", "close", { ready: [Xt, V] }), this.on.ready.subscribe = Wn(this.on.ready.subscribe, function(c) {
|
|
3016
3016
|
return function(f, d) {
|
|
3017
|
-
|
|
3017
|
+
J.vip(function() {
|
|
3018
3018
|
var y, g = n._state;
|
|
3019
3019
|
g.openComplete ? (g.dbOpenError || K.resolve().then(f), d && c(f)) : g.onReadyBeingFired ? (g.onReadyBeingFired.push(f), d && c(f)) : (c(f), y = n, d || c(function p() {
|
|
3020
3020
|
y.on.ready.unsubscribe(f), y.on.ready.unsubscribe(p);
|
|
@@ -3034,15 +3034,15 @@ var Kr = { exports: {} };
|
|
|
3034
3034
|
this._ctx = { table: p, index: g.index, isPrimKey: !g.index || p.schema.primKey.keyPath && g.index === p.schema.primKey.name, range: d, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: y, or: g.or, valueMapper: b !== et ? b : null };
|
|
3035
3035
|
})), this.Table = (o = this, st(sr.prototype, function(c, f, d) {
|
|
3036
3036
|
this.db = o, this._tx = d, this.name = c, this.schema = f, this.hook = o._allTables[c] ? o._allTables[c].hook : at(null, { creating: [zr, V], reading: [Nr, et], updating: [Ur, V], deleting: [Lr, V] });
|
|
3037
|
-
})), this.Transaction = (
|
|
3037
|
+
})), this.Transaction = (s = this, st(Zr.prototype, function(c, f, d, y, g) {
|
|
3038
3038
|
var p = this;
|
|
3039
|
-
this.db =
|
|
3039
|
+
this.db = s, this.mode = c, this.storeNames = f, this.schema = d, this.chromeTransactionDurability = y, this.idbtrans = null, this.on = at(this, "complete", "error", "abort"), this.parent = g || 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 K(function(b, w) {
|
|
3040
3040
|
p._resolve = b, p._reject = w;
|
|
3041
3041
|
}), this._completion.then(function() {
|
|
3042
3042
|
p.active = !1, p.on.complete.fire();
|
|
3043
3043
|
}, function(b) {
|
|
3044
3044
|
var w = p.active;
|
|
3045
|
-
return p.active = !1, p.on.error.fire(b), p.parent ? p.parent._reject(b) : w && p.idbtrans && p.idbtrans.abort(),
|
|
3045
|
+
return p.active = !1, p.on.error.fire(b), p.parent ? p.parent._reject(b) : w && p.idbtrans && p.idbtrans.abort(), X(b);
|
|
3046
3046
|
});
|
|
3047
3047
|
})), this.Version = (u = this, st(oi.prototype, function(c) {
|
|
3048
3048
|
this.db = u, this._cfg = { version: c, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
@@ -3101,10 +3101,10 @@ var Kr = { exports: {} };
|
|
|
3101
3101
|
}
|
|
3102
3102
|
function Sr(e) {
|
|
3103
3103
|
var t, n = !1, r = new pi(function(i) {
|
|
3104
|
-
var o = Ht(e),
|
|
3104
|
+
var o = Ht(e), s, u = !1, h = {}, l = {}, m = { get closed() {
|
|
3105
3105
|
return u;
|
|
3106
3106
|
}, unsubscribe: function() {
|
|
3107
|
-
u || (u = !0,
|
|
3107
|
+
u || (u = !0, s && s.abort(), c && Pe.storagemutated.unsubscribe(d));
|
|
3108
3108
|
} };
|
|
3109
3109
|
i.start && i.start(m);
|
|
3110
3110
|
var c = !1, f = function() {
|
|
@@ -3113,7 +3113,7 @@ var Kr = { exports: {} };
|
|
|
3113
3113
|
zt(h, g), xn(l, h) && f();
|
|
3114
3114
|
}, y = function() {
|
|
3115
3115
|
var g, p, b;
|
|
3116
|
-
!u && $t.indexedDB && (h = {}, g = {},
|
|
3116
|
+
!u && $t.indexedDB && (h = {}, g = {}, s && s.abort(), s = new AbortController(), b = function(w) {
|
|
3117
3117
|
var k = Ve();
|
|
3118
3118
|
try {
|
|
3119
3119
|
o && Ye();
|
|
@@ -3122,7 +3122,7 @@ var Kr = { exports: {} };
|
|
|
3122
3122
|
} finally {
|
|
3123
3123
|
k && Ge();
|
|
3124
3124
|
}
|
|
3125
|
-
}(p = { subscr: g, signal:
|
|
3125
|
+
}(p = { subscr: g, signal: s.signal, requery: f, querier: e, trans: null }), Promise.resolve(b).then(function(w) {
|
|
3126
3126
|
n = !0, t = w, u || p.signal.aborted || (h = {}, function(k) {
|
|
3127
3127
|
for (var x in k)
|
|
3128
3128
|
if (ne(k, x))
|
|
@@ -3172,7 +3172,7 @@ var Kr = { exports: {} };
|
|
|
3172
3172
|
});
|
|
3173
3173
|
}) : vn(n, t).toCollection().primaryKeys()).then(e);
|
|
3174
3174
|
} catch {
|
|
3175
|
-
return
|
|
3175
|
+
return X(new I.MissingAPI());
|
|
3176
3176
|
}
|
|
3177
3177
|
var t, n;
|
|
3178
3178
|
}, defineClass: function() {
|
|
@@ -3187,7 +3187,7 @@ var Kr = { exports: {} };
|
|
|
3187
3187
|
var t = Pn(e.apply(this, arguments));
|
|
3188
3188
|
return t && typeof t.then == "function" ? t : K.resolve(t);
|
|
3189
3189
|
} catch (n) {
|
|
3190
|
-
return
|
|
3190
|
+
return X(n);
|
|
3191
3191
|
}
|
|
3192
3192
|
};
|
|
3193
3193
|
}, spawn: function(e, t, n) {
|
|
@@ -3195,7 +3195,7 @@ var Kr = { exports: {} };
|
|
|
3195
3195
|
var r = Pn(e.apply(n, t || []));
|
|
3196
3196
|
return r && typeof r.then == "function" ? r : K.resolve(r);
|
|
3197
3197
|
} catch (i) {
|
|
3198
|
-
return
|
|
3198
|
+
return X(i);
|
|
3199
3199
|
}
|
|
3200
3200
|
}, currentTransaction: { get: function() {
|
|
3201
3201
|
return D.trans || null;
|
|
@@ -3246,62 +3246,62 @@ const Nn = /* @__PURE__ */ Oi(Si), jr = Symbol.for("Dexie"), zn = globalThis[jr]
|
|
|
3246
3246
|
if (Nn.semVer !== zn.semVer)
|
|
3247
3247
|
throw new Error(`Two different versions of Dexie loaded in the same app: ${Nn.semVer} and ${zn.semVer}`);
|
|
3248
3248
|
function Q(M) {
|
|
3249
|
-
let
|
|
3250
|
-
return M.order && (
|
|
3249
|
+
let a = `${M.type}.${M.topics}`;
|
|
3250
|
+
return M.order && (a += `.${M.order}`), M.period && (a += `.${M.period}`), a;
|
|
3251
3251
|
}
|
|
3252
|
-
function mt(M,
|
|
3252
|
+
function mt(M, a) {
|
|
3253
3253
|
var W;
|
|
3254
|
-
let v, _, j, F,
|
|
3254
|
+
let v, _, j, F, B;
|
|
3255
3255
|
switch (M.moderation) {
|
|
3256
3256
|
case "before":
|
|
3257
|
-
v = /* @__PURE__ */ new Date(), _ = (W = M.beforeTime) == null ? void 0 : W.split(":"), j = Number.parseInt(_ ? _[0] : "00"), F = Number.parseInt(_ ? _[1] : "00"),
|
|
3257
|
+
v = /* @__PURE__ */ new Date(), _ = (W = M.beforeTime) == null ? void 0 : W.split(":"), j = Number.parseInt(_ ? _[0] : "00"), F = Number.parseInt(_ ? _[1] : "00"), B = Number.parseInt(_ ? _[2] : "00"), a.before = v.setHours(j, F, B, 0) / 1e3, a.period || (a.period = v.getDay() === 1 ? 72 : 24);
|
|
3258
3258
|
break;
|
|
3259
3259
|
case "delayed":
|
|
3260
|
-
M.delay && M.delay > 0 && (
|
|
3260
|
+
M.delay && M.delay > 0 && (a.delay = `${M.delay}`);
|
|
3261
3261
|
break;
|
|
3262
3262
|
case "approved":
|
|
3263
|
-
|
|
3263
|
+
a.approved = "1";
|
|
3264
3264
|
break;
|
|
3265
3265
|
default:
|
|
3266
|
-
M.period !== 0 && (
|
|
3266
|
+
M.period !== 0 && (a.period = M.period);
|
|
3267
3267
|
}
|
|
3268
|
-
return
|
|
3268
|
+
return a;
|
|
3269
3269
|
}
|
|
3270
3270
|
class Ei {
|
|
3271
|
-
constructor(
|
|
3271
|
+
constructor(a) {
|
|
3272
3272
|
A(this, "db");
|
|
3273
3273
|
A(this, "subscribers", []);
|
|
3274
3274
|
A(this, "options");
|
|
3275
|
-
A(this, "setCloud", async (
|
|
3276
|
-
id:
|
|
3277
|
-
dashboard_id:
|
|
3275
|
+
A(this, "setCloud", async (a, v) => v !== "" ? await this.db.table("cloud").put({
|
|
3276
|
+
id: a.widget,
|
|
3277
|
+
dashboard_id: a.dashboard,
|
|
3278
3278
|
data: v.data
|
|
3279
3279
|
}).then(() => 201).catch(() => 400) : 400);
|
|
3280
|
-
A(this, "getCloud", async (
|
|
3281
|
-
const v = await this.db.table(Cr).where({ id:
|
|
3282
|
-
return v ? (v.presentation = (
|
|
3280
|
+
A(this, "getCloud", async (a) => {
|
|
3281
|
+
const v = await this.db.table(Cr).where({ id: a.widget }).last();
|
|
3282
|
+
return v ? (v.presentation = (a == null ? void 0 : a.presentation) || "not set", v.slide = (a == null ? void 0 : a.slide) || "not set", v) : { data: null };
|
|
3283
3283
|
});
|
|
3284
|
-
A(this, "setSeries", async (
|
|
3285
|
-
id:
|
|
3286
|
-
dashboard_id:
|
|
3284
|
+
A(this, "setSeries", async (a, v) => v !== "" ? await this.db.table(Fn).put({
|
|
3285
|
+
id: a.widget,
|
|
3286
|
+
dashboard_id: a.dashboard,
|
|
3287
3287
|
data: v.data
|
|
3288
3288
|
}).then(() => 201).catch(() => 400) : 400);
|
|
3289
|
-
A(this, "getSeries", async (
|
|
3290
|
-
const v = await this.db.table(Fn).where({ id:
|
|
3291
|
-
return v.presentation = (
|
|
3289
|
+
A(this, "getSeries", async (a) => {
|
|
3290
|
+
const v = await this.db.table(Fn).where({ id: a.widget }).last();
|
|
3291
|
+
return v.presentation = (a == null ? void 0 : a.presentation) || "not set", v.slide = (a == null ? void 0 : a.slide) || "not set", v ?? { data: null };
|
|
3292
3292
|
});
|
|
3293
|
-
A(this, "setMessages", async (
|
|
3293
|
+
A(this, "setMessages", async (a, v) => {
|
|
3294
3294
|
const _ = v.title;
|
|
3295
3295
|
try {
|
|
3296
3296
|
return v.data.messages.forEach(async (j) => {
|
|
3297
|
-
var F,
|
|
3297
|
+
var F, B, W;
|
|
3298
3298
|
await this.db.table(Ne).put({ id: j.id, utc: j.utc, data: j }), await this.db.table(gi).put({
|
|
3299
|
-
widget_id:
|
|
3299
|
+
widget_id: a.widget,
|
|
3300
3300
|
message_id: j.id,
|
|
3301
|
-
dashboard_id:
|
|
3301
|
+
dashboard_id: a.dashboard,
|
|
3302
3302
|
title: _,
|
|
3303
3303
|
engagement: (F = j.dynamics) == null ? void 0 : F.engagement,
|
|
3304
|
-
impressions: (
|
|
3304
|
+
impressions: (B = j.dynamics) == null ? void 0 : B.semrush_visits,
|
|
3305
3305
|
reach: (W = j.dynamics) == null ? void 0 : W.potential_reach,
|
|
3306
3306
|
sentiment: j.topics[0].sentiment,
|
|
3307
3307
|
utc: j.utc
|
|
@@ -3311,48 +3311,48 @@ class Ei {
|
|
|
3311
3311
|
return 400;
|
|
3312
3312
|
}
|
|
3313
3313
|
});
|
|
3314
|
-
A(this, "getMessages", async (
|
|
3315
|
-
const v = (F) => F.widget_id ===
|
|
3314
|
+
A(this, "getMessages", async (a) => {
|
|
3315
|
+
const v = (F) => F.widget_id === a.widget, _ = (F) => F.utc > ((a == null ? void 0 : a.since) || 0), j = (F) => (F == null ? void 0 : F.visible) !== 0;
|
|
3316
3316
|
try {
|
|
3317
|
-
const F = await this.db.table("topics").orderBy("utc").reverse().filter(v).filter(_).filter(j).limit((
|
|
3317
|
+
const F = await this.db.table("topics").orderBy("utc").reverse().filter(v).filter(_).filter(j).limit((a == null ? void 0 : a.limit) ?? 25).toArray(), B = F[0] ? F[0].title : "No results", W = F.map(
|
|
3318
3318
|
(oe) => oe.message_id
|
|
3319
|
-
), q = await this.db.table("messages").where("id").anyOf(W).toArray().then((oe) => oe.sort((
|
|
3319
|
+
), q = await this.db.table("messages").where("id").anyOf(W).toArray().then((oe) => oe.sort((Z, ne) => ne.utc - Z.utc));
|
|
3320
3320
|
return {
|
|
3321
3321
|
data: {
|
|
3322
|
-
presentation: (
|
|
3323
|
-
slide: (
|
|
3322
|
+
presentation: (a == null ? void 0 : a.presentation) || "not set",
|
|
3323
|
+
slide: (a == null ? void 0 : a.slide) || "not set",
|
|
3324
3324
|
messages: q.map((oe) => oe.data),
|
|
3325
|
-
title:
|
|
3326
|
-
topics: [
|
|
3327
|
-
query:
|
|
3325
|
+
title: B,
|
|
3326
|
+
topics: [a.dashboard, a.widget].join("-"),
|
|
3327
|
+
query: a
|
|
3328
3328
|
}
|
|
3329
3329
|
};
|
|
3330
3330
|
} catch {
|
|
3331
3331
|
return { data: null };
|
|
3332
3332
|
}
|
|
3333
3333
|
});
|
|
3334
|
-
A(this, "cleanMessages", async (
|
|
3335
|
-
const v = Date.now() / 1e3, _ = (j) => j.utc <
|
|
3334
|
+
A(this, "cleanMessages", async (a) => {
|
|
3335
|
+
const v = Date.now() / 1e3, _ = (j) => j.utc < a - v;
|
|
3336
3336
|
await this.db.table("topics").orderBy("utc").filter(_).modify((j, F) => {
|
|
3337
3337
|
delete F.value;
|
|
3338
3338
|
});
|
|
3339
3339
|
});
|
|
3340
|
-
A(this, "subscribe", (
|
|
3340
|
+
A(this, "subscribe", (a) => {
|
|
3341
3341
|
var _;
|
|
3342
|
-
if (
|
|
3343
|
-
const j = (_ =
|
|
3344
|
-
|
|
3342
|
+
if (a.widget === void 0) {
|
|
3343
|
+
const j = (_ = a.topics) == null ? void 0 : _.split("-");
|
|
3344
|
+
a.dashboard = j ? j[0] : "", a.widget = j ? j[1] : "";
|
|
3345
3345
|
}
|
|
3346
3346
|
this.subscribers.filter(
|
|
3347
|
-
(j) => j.widget ===
|
|
3348
|
-
).length > 0 || (
|
|
3347
|
+
(j) => j.widget === a.widget
|
|
3348
|
+
).length > 0 || (a.type === Ne && (a = mt(this.options, a)), console.info(
|
|
3349
3349
|
"%cstorage",
|
|
3350
3350
|
pt,
|
|
3351
3351
|
"subscribe",
|
|
3352
|
-
|
|
3353
|
-
), this.subscribers.push(
|
|
3352
|
+
a
|
|
3353
|
+
), this.subscribers.push(a));
|
|
3354
3354
|
});
|
|
3355
|
-
this.options =
|
|
3355
|
+
this.options = a, this.db = new zn(a.app), this.db.version(2).stores({
|
|
3356
3356
|
player: "id,title,name,location",
|
|
3357
3357
|
monitor: "id,player_id,cols,rows,order,width,height,physicalwidth,physicalheight,devicePixelRatio,screenLeft,screenTop,orientation,monitor",
|
|
3358
3358
|
display: "id,monitor_id,presentation_id,colstart,colend,rowstart,rowend",
|
|
@@ -3370,161 +3370,161 @@ class Ei {
|
|
|
3370
3370
|
}
|
|
3371
3371
|
}
|
|
3372
3372
|
function Ln(M) {
|
|
3373
|
-
return new Promise((
|
|
3374
|
-
M.oncomplete = M.onsuccess = () =>
|
|
3373
|
+
return new Promise((a, v) => {
|
|
3374
|
+
M.oncomplete = M.onsuccess = () => a(M.result), M.onabort = M.onerror = () => v(M.error);
|
|
3375
3375
|
});
|
|
3376
3376
|
}
|
|
3377
|
-
function Pi(M,
|
|
3377
|
+
function Pi(M, a) {
|
|
3378
3378
|
const v = indexedDB.open(M);
|
|
3379
|
-
v.onupgradeneeded = () => v.result.createObjectStore(
|
|
3379
|
+
v.onupgradeneeded = () => v.result.createObjectStore(a);
|
|
3380
3380
|
const _ = Ln(v);
|
|
3381
|
-
return (j, F) => _.then((
|
|
3381
|
+
return (j, F) => _.then((B) => F(B.transaction(a, j).objectStore(a)));
|
|
3382
3382
|
}
|
|
3383
3383
|
let In;
|
|
3384
3384
|
function Ar() {
|
|
3385
3385
|
return In || (In = Pi("keyval-store", "keyval")), In;
|
|
3386
3386
|
}
|
|
3387
|
-
function Rn(M,
|
|
3388
|
-
return
|
|
3387
|
+
function Rn(M, a = Ar()) {
|
|
3388
|
+
return a("readonly", (v) => Ln(v.get(M)));
|
|
3389
3389
|
}
|
|
3390
|
-
function Mn(M,
|
|
3391
|
-
return v("readwrite", (_) => (_.put(
|
|
3390
|
+
function Mn(M, a, v = Ar()) {
|
|
3391
|
+
return v("readwrite", (_) => (_.put(a, M), Ln(_.transaction)));
|
|
3392
3392
|
}
|
|
3393
3393
|
class ji {
|
|
3394
|
-
constructor(
|
|
3394
|
+
constructor(a) {
|
|
3395
3395
|
A(this, "subscribers", []);
|
|
3396
3396
|
A(this, "options");
|
|
3397
|
-
A(this, "setCloud", async (
|
|
3397
|
+
A(this, "setCloud", async (a, v) => {
|
|
3398
3398
|
if (!v.success)
|
|
3399
3399
|
return 400;
|
|
3400
|
-
const _ = Q(
|
|
3400
|
+
const _ = Q(a);
|
|
3401
3401
|
return delete v.success, delete v.message, await Mn(_, v).then(() => 201).catch(() => 400);
|
|
3402
3402
|
});
|
|
3403
|
-
A(this, "getCloud", async (
|
|
3404
|
-
const v = Q(
|
|
3403
|
+
A(this, "getCloud", async (a) => {
|
|
3404
|
+
const v = Q(a);
|
|
3405
3405
|
return await Rn(v);
|
|
3406
3406
|
});
|
|
3407
|
-
A(this, "setSeries", async (
|
|
3407
|
+
A(this, "setSeries", async (a, v) => {
|
|
3408
3408
|
if (!v.success)
|
|
3409
3409
|
return 400;
|
|
3410
|
-
const _ = Q(
|
|
3410
|
+
const _ = Q(a);
|
|
3411
3411
|
return delete v.success, delete v.message, await Mn(_, v).then(() => 201).catch(() => 400);
|
|
3412
3412
|
});
|
|
3413
|
-
A(this, "getSeries", async (
|
|
3414
|
-
const v = Q(
|
|
3413
|
+
A(this, "getSeries", async (a) => {
|
|
3414
|
+
const v = Q(a);
|
|
3415
3415
|
return await Rn(v);
|
|
3416
3416
|
});
|
|
3417
|
-
A(this, "setMessages", async (
|
|
3417
|
+
A(this, "setMessages", async (a, v) => {
|
|
3418
3418
|
if (!v.success)
|
|
3419
3419
|
return 400;
|
|
3420
|
-
const _ = Q(
|
|
3420
|
+
const _ = Q(a);
|
|
3421
3421
|
return delete v.success, delete v.message, await Mn(_, v).then(() => 201).catch(() => 400);
|
|
3422
3422
|
});
|
|
3423
|
-
A(this, "getMessages", async (
|
|
3424
|
-
const v = Q(
|
|
3423
|
+
A(this, "getMessages", async (a) => {
|
|
3424
|
+
const v = Q(a);
|
|
3425
3425
|
return await Rn(v).then((_) => _).catch(() => 400);
|
|
3426
3426
|
});
|
|
3427
|
-
A(this, "cleanMessages", async (
|
|
3428
|
-
A(this, "subscribe", (
|
|
3427
|
+
A(this, "cleanMessages", async (a) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((v) => v())));
|
|
3428
|
+
A(this, "subscribe", (a) => {
|
|
3429
3429
|
var _;
|
|
3430
|
-
if (
|
|
3431
|
-
const j = (_ =
|
|
3432
|
-
|
|
3430
|
+
if (a.widget === void 0) {
|
|
3431
|
+
const j = (_ = a.topics) == null ? void 0 : _.split("-");
|
|
3432
|
+
a.dashboard = j ? j[0] : "", a.widget = j ? j[1] : "";
|
|
3433
3433
|
}
|
|
3434
|
-
|
|
3435
|
-
(j) => j.widget ===
|
|
3434
|
+
a.type === Ne && (a = mt(this.options, a)), !(this.subscribers.filter(
|
|
3435
|
+
(j) => j.widget === a.widget
|
|
3436
3436
|
).length > 0) && (console.info(
|
|
3437
3437
|
"%cstorage",
|
|
3438
3438
|
pt,
|
|
3439
3439
|
"subscribe",
|
|
3440
|
-
|
|
3441
|
-
), this.subscribers.push(
|
|
3440
|
+
a
|
|
3441
|
+
), this.subscribers.push(a));
|
|
3442
3442
|
});
|
|
3443
|
-
this.options =
|
|
3443
|
+
this.options = a;
|
|
3444
3444
|
}
|
|
3445
3445
|
getSubscribers() {
|
|
3446
3446
|
return this.subscribers;
|
|
3447
3447
|
}
|
|
3448
3448
|
}
|
|
3449
3449
|
class Ci {
|
|
3450
|
-
constructor(
|
|
3450
|
+
constructor(a) {
|
|
3451
3451
|
A(this, "subscribers", []);
|
|
3452
3452
|
A(this, "options");
|
|
3453
|
-
A(this, "setCloud", async (
|
|
3454
|
-
const _ = Q(
|
|
3453
|
+
A(this, "setCloud", async (a, v) => {
|
|
3454
|
+
const _ = Q(a);
|
|
3455
3455
|
try {
|
|
3456
3456
|
return localStorage.setObject(_, v), 201;
|
|
3457
3457
|
} catch {
|
|
3458
|
-
return console.debug("[storage] error",
|
|
3458
|
+
return console.debug("[storage] error", a), 400;
|
|
3459
3459
|
}
|
|
3460
3460
|
});
|
|
3461
|
-
A(this, "getCloud", async (
|
|
3462
|
-
const v = Q(
|
|
3461
|
+
A(this, "getCloud", async (a) => {
|
|
3462
|
+
const v = Q(a);
|
|
3463
3463
|
try {
|
|
3464
3464
|
return localStorage.getObject(v);
|
|
3465
3465
|
} catch {
|
|
3466
|
-
return console.debug("[storage] error",
|
|
3466
|
+
return console.debug("[storage] error", a), 400;
|
|
3467
3467
|
}
|
|
3468
3468
|
});
|
|
3469
|
-
A(this, "setSeries", async (
|
|
3470
|
-
const _ = Q(
|
|
3469
|
+
A(this, "setSeries", async (a, v) => {
|
|
3470
|
+
const _ = Q(a);
|
|
3471
3471
|
try {
|
|
3472
3472
|
return localStorage.setObject(_, v), 201;
|
|
3473
3473
|
} catch {
|
|
3474
|
-
return console.debug("[storage] error",
|
|
3474
|
+
return console.debug("[storage] error", a), 400;
|
|
3475
3475
|
}
|
|
3476
3476
|
});
|
|
3477
|
-
A(this, "getSeries", async (
|
|
3478
|
-
const v = Q(
|
|
3477
|
+
A(this, "getSeries", async (a) => {
|
|
3478
|
+
const v = Q(a);
|
|
3479
3479
|
try {
|
|
3480
3480
|
return localStorage.getObject(v);
|
|
3481
3481
|
} catch {
|
|
3482
|
-
return console.debug("[storage] error",
|
|
3482
|
+
return console.debug("[storage] error", a), 400;
|
|
3483
3483
|
}
|
|
3484
3484
|
});
|
|
3485
|
-
A(this, "setMessages", async (
|
|
3486
|
-
const _ = Q(
|
|
3485
|
+
A(this, "setMessages", async (a, v) => {
|
|
3486
|
+
const _ = Q(a);
|
|
3487
3487
|
try {
|
|
3488
3488
|
return localStorage.setObject(_, v), 200;
|
|
3489
3489
|
} catch {
|
|
3490
|
-
return console.debug("[storage] error",
|
|
3490
|
+
return console.debug("[storage] error", a), 400;
|
|
3491
3491
|
}
|
|
3492
3492
|
});
|
|
3493
|
-
A(this, "getMessages", async (
|
|
3494
|
-
const v = Q(
|
|
3493
|
+
A(this, "getMessages", async (a) => {
|
|
3494
|
+
const v = Q(a);
|
|
3495
3495
|
try {
|
|
3496
3496
|
return localStorage.getObject(v);
|
|
3497
3497
|
} catch {
|
|
3498
|
-
return console.debug("[storage] error",
|
|
3498
|
+
return console.debug("[storage] error", a), 400;
|
|
3499
3499
|
}
|
|
3500
3500
|
});
|
|
3501
|
-
A(this, "cleanMessages", async (
|
|
3501
|
+
A(this, "cleanMessages", async (a) => {
|
|
3502
3502
|
console.log("cleanMessages not implemented for ", this.options.storage);
|
|
3503
3503
|
});
|
|
3504
|
-
A(this, "setWidget", async (
|
|
3505
|
-
const v = `widget.${
|
|
3504
|
+
A(this, "setWidget", async (a) => {
|
|
3505
|
+
const v = `widget.${a.widget}`;
|
|
3506
3506
|
try {
|
|
3507
|
-
return localStorage.setObject(v,
|
|
3507
|
+
return localStorage.setObject(v, a), 201;
|
|
3508
3508
|
} catch {
|
|
3509
|
-
return console.debug("[storage] error",
|
|
3509
|
+
return console.debug("[storage] error", a), 400;
|
|
3510
3510
|
}
|
|
3511
3511
|
});
|
|
3512
|
-
A(this, "subscribe", (
|
|
3512
|
+
A(this, "subscribe", (a) => {
|
|
3513
3513
|
var _;
|
|
3514
|
-
if (
|
|
3515
|
-
const j = (_ =
|
|
3516
|
-
|
|
3514
|
+
if (a.widget === void 0) {
|
|
3515
|
+
const j = (_ = a.topics) == null ? void 0 : _.split("-");
|
|
3516
|
+
a.dashboard = j ? j[0] : "", a.widget = j ? j[1] : "";
|
|
3517
3517
|
}
|
|
3518
|
-
|
|
3519
|
-
(j) => j.widget ===
|
|
3518
|
+
a.type === Ne && (a = mt(this.options, a)), !this.subscribers.filter(
|
|
3519
|
+
(j) => j.widget === a.widget
|
|
3520
3520
|
).length && (console.info(
|
|
3521
3521
|
"%cstorage",
|
|
3522
3522
|
yt,
|
|
3523
3523
|
"subscribe",
|
|
3524
|
-
|
|
3525
|
-
), this.subscribers.push(
|
|
3524
|
+
a
|
|
3525
|
+
), this.subscribers.push(a));
|
|
3526
3526
|
});
|
|
3527
|
-
this.options =
|
|
3527
|
+
this.options = a, Storage.prototype.setObject = function(v, _) {
|
|
3528
3528
|
this.setObject(v, JSON.stringify(_));
|
|
3529
3529
|
}, Storage.prototype.getObject = function(v) {
|
|
3530
3530
|
const _ = this.getObject(v);
|
|
@@ -3536,84 +3536,84 @@ class Ci {
|
|
|
3536
3536
|
}
|
|
3537
3537
|
}
|
|
3538
3538
|
class Ki {
|
|
3539
|
-
constructor(
|
|
3539
|
+
constructor(a) {
|
|
3540
3540
|
A(this, "subscribers", []);
|
|
3541
3541
|
A(this, "options");
|
|
3542
|
-
A(this, "setCloud", async (
|
|
3543
|
-
const _ = Q(
|
|
3542
|
+
A(this, "setCloud", async (a, v) => {
|
|
3543
|
+
const _ = Q(a);
|
|
3544
3544
|
try {
|
|
3545
3545
|
return sessionStorage.setObject(_, v), 201;
|
|
3546
3546
|
} catch {
|
|
3547
|
-
return console.debug("[storage] error",
|
|
3547
|
+
return console.debug("[storage] error", a), 400;
|
|
3548
3548
|
}
|
|
3549
3549
|
});
|
|
3550
|
-
A(this, "getCloud", async (
|
|
3551
|
-
const v = Q(
|
|
3550
|
+
A(this, "getCloud", async (a) => {
|
|
3551
|
+
const v = Q(a);
|
|
3552
3552
|
try {
|
|
3553
3553
|
return sessionStorage.getObject(v);
|
|
3554
3554
|
} catch {
|
|
3555
|
-
return console.debug("[storage] error",
|
|
3555
|
+
return console.debug("[storage] error", a), 400;
|
|
3556
3556
|
}
|
|
3557
3557
|
});
|
|
3558
|
-
A(this, "setSeries", async (
|
|
3559
|
-
const _ = Q(
|
|
3558
|
+
A(this, "setSeries", async (a, v) => {
|
|
3559
|
+
const _ = Q(a);
|
|
3560
3560
|
try {
|
|
3561
3561
|
return sessionStorage.setObject(_, v), 201;
|
|
3562
3562
|
} catch {
|
|
3563
|
-
return console.debug("[storage] error",
|
|
3563
|
+
return console.debug("[storage] error", a), 400;
|
|
3564
3564
|
}
|
|
3565
3565
|
});
|
|
3566
|
-
A(this, "getSeries", async (
|
|
3567
|
-
const v = Q(
|
|
3566
|
+
A(this, "getSeries", async (a) => {
|
|
3567
|
+
const v = Q(a);
|
|
3568
3568
|
try {
|
|
3569
3569
|
return sessionStorage.getObject(v);
|
|
3570
3570
|
} catch {
|
|
3571
|
-
return console.debug("[storage] error",
|
|
3571
|
+
return console.debug("[storage] error", a), 400;
|
|
3572
3572
|
}
|
|
3573
3573
|
});
|
|
3574
|
-
A(this, "setMessages", async (
|
|
3575
|
-
const _ = Q(
|
|
3574
|
+
A(this, "setMessages", async (a, v) => {
|
|
3575
|
+
const _ = Q(a);
|
|
3576
3576
|
try {
|
|
3577
3577
|
return sessionStorage.setObject(_, v), 201;
|
|
3578
3578
|
} catch {
|
|
3579
|
-
return console.debug("[storage] error",
|
|
3579
|
+
return console.debug("[storage] error", a), 400;
|
|
3580
3580
|
}
|
|
3581
3581
|
});
|
|
3582
|
-
A(this, "getMessages", async (
|
|
3583
|
-
const v = Q(
|
|
3582
|
+
A(this, "getMessages", async (a) => {
|
|
3583
|
+
const v = Q(a);
|
|
3584
3584
|
try {
|
|
3585
3585
|
return sessionStorage.getObject(v);
|
|
3586
3586
|
} catch {
|
|
3587
|
-
console.debug("[storage] error",
|
|
3587
|
+
console.debug("[storage] error", a);
|
|
3588
3588
|
}
|
|
3589
3589
|
});
|
|
3590
|
-
A(this, "cleanMessages", async (
|
|
3590
|
+
A(this, "cleanMessages", async (a) => {
|
|
3591
3591
|
console.log("cleanMessages not implemented for ", this.options.storage);
|
|
3592
3592
|
});
|
|
3593
|
-
A(this, "setWidget", async (
|
|
3594
|
-
const v = `widget.${
|
|
3593
|
+
A(this, "setWidget", async (a) => {
|
|
3594
|
+
const v = `widget.${a.widget}`;
|
|
3595
3595
|
try {
|
|
3596
|
-
return sessionStorage.setObject(v,
|
|
3596
|
+
return sessionStorage.setObject(v, a), 201;
|
|
3597
3597
|
} catch {
|
|
3598
|
-
return console.debug("[storage] error",
|
|
3598
|
+
return console.debug("[storage] error", a), 400;
|
|
3599
3599
|
}
|
|
3600
3600
|
});
|
|
3601
|
-
A(this, "subscribe", (
|
|
3601
|
+
A(this, "subscribe", (a) => {
|
|
3602
3602
|
var _;
|
|
3603
|
-
if (
|
|
3604
|
-
const j = (_ =
|
|
3605
|
-
|
|
3603
|
+
if (a.widget === void 0) {
|
|
3604
|
+
const j = (_ = a.topics) == null ? void 0 : _.split("-");
|
|
3605
|
+
a.dashboard = j ? j[0] : "", a.widget = j ? j[1] : "";
|
|
3606
3606
|
}
|
|
3607
|
-
|
|
3608
|
-
(j) => j.widget ===
|
|
3607
|
+
a.type === Ne && (a = mt(this.options, a)), !this.subscribers.filter(
|
|
3608
|
+
(j) => j.widget === a.widget
|
|
3609
3609
|
).length && (console.info(
|
|
3610
3610
|
"%cstorage",
|
|
3611
3611
|
yt,
|
|
3612
3612
|
"subscribe",
|
|
3613
|
-
|
|
3614
|
-
), this.subscribers.push(
|
|
3613
|
+
a
|
|
3614
|
+
), this.subscribers.push(a));
|
|
3615
3615
|
});
|
|
3616
|
-
this.options =
|
|
3616
|
+
this.options = a, Storage.prototype.setObject = function(v, _) {
|
|
3617
3617
|
this.setItem(v, JSON.stringify(_));
|
|
3618
3618
|
}, Storage.prototype.getObject = function(v) {
|
|
3619
3619
|
const _ = this.getItem(v);
|
|
@@ -3625,150 +3625,145 @@ class Ki {
|
|
|
3625
3625
|
}
|
|
3626
3626
|
}
|
|
3627
3627
|
class Ai {
|
|
3628
|
-
constructor(
|
|
3628
|
+
constructor(a) {
|
|
3629
3629
|
A(this, "subscribers", []);
|
|
3630
3630
|
A(this, "options");
|
|
3631
|
-
A(this, "setCloud", async (
|
|
3632
|
-
const _ = Q(
|
|
3631
|
+
A(this, "setCloud", async (a, v) => {
|
|
3632
|
+
const _ = Q(a);
|
|
3633
3633
|
try {
|
|
3634
3634
|
return window.BuzzCasting.WidgetData[_] = v, 201;
|
|
3635
3635
|
} catch {
|
|
3636
|
-
return console.debug("[storage] error",
|
|
3636
|
+
return console.debug("[storage] error", a), 400;
|
|
3637
3637
|
}
|
|
3638
3638
|
});
|
|
3639
|
-
A(this, "getCloud", async (
|
|
3640
|
-
const v = Q(
|
|
3639
|
+
A(this, "getCloud", async (a) => {
|
|
3640
|
+
const v = Q(a);
|
|
3641
3641
|
try {
|
|
3642
3642
|
return window.BuzzCasting.WidgetData[v];
|
|
3643
3643
|
} catch {
|
|
3644
|
-
return console.debug("[storage] error",
|
|
3644
|
+
return console.debug("[storage] error", a), 400;
|
|
3645
3645
|
}
|
|
3646
3646
|
});
|
|
3647
|
-
A(this, "setSeries", async (
|
|
3648
|
-
const _ = Q(
|
|
3647
|
+
A(this, "setSeries", async (a, v) => {
|
|
3648
|
+
const _ = Q(a);
|
|
3649
3649
|
try {
|
|
3650
3650
|
return window.BuzzCasting.WidgetData[_] = v, 201;
|
|
3651
3651
|
} catch {
|
|
3652
|
-
return console.debug("[storage] error",
|
|
3652
|
+
return console.debug("[storage] error", a), 400;
|
|
3653
3653
|
}
|
|
3654
3654
|
});
|
|
3655
|
-
A(this, "getSeries", async (
|
|
3656
|
-
const v = Q(
|
|
3655
|
+
A(this, "getSeries", async (a) => {
|
|
3656
|
+
const v = Q(a);
|
|
3657
3657
|
try {
|
|
3658
3658
|
return window.BuzzCasting.WidgetData[v];
|
|
3659
3659
|
} catch {
|
|
3660
|
-
return console.debug("[storage] error",
|
|
3660
|
+
return console.debug("[storage] error", a), 400;
|
|
3661
3661
|
}
|
|
3662
3662
|
});
|
|
3663
|
-
A(this, "setMessages", async (
|
|
3664
|
-
const _ = Q(
|
|
3663
|
+
A(this, "setMessages", async (a, v) => {
|
|
3664
|
+
const _ = Q(a);
|
|
3665
3665
|
try {
|
|
3666
3666
|
return window.BuzzCasting.WidgetData[_] = v, 201;
|
|
3667
3667
|
} catch {
|
|
3668
|
-
return console.debug("[storage] error",
|
|
3668
|
+
return console.debug("[storage] error", a), 400;
|
|
3669
3669
|
}
|
|
3670
3670
|
});
|
|
3671
|
-
A(this, "getMessages", async (
|
|
3672
|
-
const v = Q(
|
|
3671
|
+
A(this, "getMessages", async (a) => {
|
|
3672
|
+
const v = Q(a);
|
|
3673
3673
|
try {
|
|
3674
3674
|
return window.BuzzCasting.WidgetData[v];
|
|
3675
3675
|
} catch {
|
|
3676
|
-
return console.debug("[storage] error",
|
|
3676
|
+
return console.debug("[storage] error", a), 400;
|
|
3677
3677
|
}
|
|
3678
3678
|
});
|
|
3679
|
-
A(this, "cleanMessages", async (
|
|
3679
|
+
A(this, "cleanMessages", async (a) => {
|
|
3680
3680
|
console.log("cleanMessages not implemented for ", this.options.storage);
|
|
3681
3681
|
});
|
|
3682
|
-
A(this, "setWidget", async (
|
|
3683
|
-
const v = `widget.${
|
|
3682
|
+
A(this, "setWidget", async (a) => {
|
|
3683
|
+
const v = `widget.${a.widget}`;
|
|
3684
3684
|
try {
|
|
3685
|
-
return window.BuzzCasting.WidgetData[v] =
|
|
3685
|
+
return window.BuzzCasting.WidgetData[v] = a, 201;
|
|
3686
3686
|
} catch {
|
|
3687
|
-
return console.debug("[storage] error",
|
|
3687
|
+
return console.debug("[storage] error", a), 400;
|
|
3688
3688
|
}
|
|
3689
3689
|
});
|
|
3690
|
-
A(this, "subscribe", (
|
|
3690
|
+
A(this, "subscribe", (a) => {
|
|
3691
3691
|
var _;
|
|
3692
|
-
if (
|
|
3693
|
-
const j = (_ =
|
|
3694
|
-
|
|
3692
|
+
if (a.widget === void 0) {
|
|
3693
|
+
const j = (_ = a.topics) == null ? void 0 : _.split("-");
|
|
3694
|
+
a.dashboard = j ? j[0] : "", a.widget = j ? j[1] : "";
|
|
3695
3695
|
}
|
|
3696
|
-
|
|
3697
|
-
(j) => j.widget ===
|
|
3696
|
+
a.type === Ne && (a = mt(this.options, a)), !this.subscribers.filter(
|
|
3697
|
+
(j) => j.widget === a.widget
|
|
3698
3698
|
).length && (console.info(
|
|
3699
3699
|
"%cstorage",
|
|
3700
3700
|
yt,
|
|
3701
3701
|
"subscribe",
|
|
3702
|
-
|
|
3703
|
-
), this.subscribers.push(
|
|
3702
|
+
a
|
|
3703
|
+
), this.subscribers.push(a));
|
|
3704
3704
|
});
|
|
3705
|
-
this.options =
|
|
3705
|
+
this.options = a, window.BuzzCasting.WidgetData = /* @__PURE__ */ new Set();
|
|
3706
3706
|
}
|
|
3707
3707
|
getSubscribers() {
|
|
3708
3708
|
return this.subscribers;
|
|
3709
3709
|
}
|
|
3710
3710
|
}
|
|
3711
3711
|
class Ti {
|
|
3712
|
-
constructor(
|
|
3712
|
+
constructor(a) {
|
|
3713
3713
|
A(this, "sm");
|
|
3714
3714
|
A(this, "api");
|
|
3715
3715
|
A(this, "bc");
|
|
3716
3716
|
A(this, "options");
|
|
3717
3717
|
A(this, "update", async () => {
|
|
3718
3718
|
var _;
|
|
3719
|
-
const
|
|
3720
|
-
if ((
|
|
3719
|
+
const a = (_ = this.sm) == null ? void 0 : _.getSubscribers();
|
|
3720
|
+
if ((a == null ? void 0 : a.length) === 0)
|
|
3721
3721
|
return;
|
|
3722
3722
|
const v = [];
|
|
3723
|
-
|
|
3723
|
+
a == null || a.forEach((j) => {
|
|
3724
3724
|
v.push(this.api.get(j));
|
|
3725
3725
|
}), await Promise.allSettled(v).then(
|
|
3726
3726
|
(j) => j.forEach(async (F) => {
|
|
3727
3727
|
var W, q, oe;
|
|
3728
|
-
let
|
|
3728
|
+
let B = 400;
|
|
3729
3729
|
if (F.status === "fulfilled") {
|
|
3730
|
-
const
|
|
3731
|
-
if (
|
|
3732
|
-
switch (
|
|
3730
|
+
const Z = F.value;
|
|
3731
|
+
if (Z.success === !0)
|
|
3732
|
+
switch (Z.query.type) {
|
|
3733
3733
|
case Ne:
|
|
3734
|
-
|
|
3734
|
+
B = await ((W = this.sm) == null ? void 0 : W.setMessages(Z.query, Z));
|
|
3735
3735
|
break;
|
|
3736
3736
|
case Cr:
|
|
3737
|
-
|
|
3737
|
+
B = await ((q = this.sm) == null ? void 0 : q.setCloud(Z.query, Z));
|
|
3738
3738
|
break;
|
|
3739
3739
|
case Fn:
|
|
3740
|
-
|
|
3740
|
+
B = await ((oe = this.sm) == null ? void 0 : oe.setSeries(Z.query, Z));
|
|
3741
3741
|
break;
|
|
3742
3742
|
default:
|
|
3743
3743
|
console.warn(
|
|
3744
3744
|
"%cstorage",
|
|
3745
3745
|
pt,
|
|
3746
3746
|
"error",
|
|
3747
|
-
`data type ${
|
|
3747
|
+
`data type ${Z.query.type} unknown`
|
|
3748
3748
|
);
|
|
3749
3749
|
}
|
|
3750
3750
|
else
|
|
3751
|
-
|
|
3752
|
-
switch (
|
|
3751
|
+
B = 401;
|
|
3752
|
+
switch (B) {
|
|
3753
3753
|
case 201:
|
|
3754
3754
|
console.info(
|
|
3755
3755
|
"%cbroadcast",
|
|
3756
3756
|
Bn,
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
X.query,
|
|
3761
|
-
T
|
|
3762
|
-
), this.bc.postMessage({ event: "widget-update", data: X.query });
|
|
3757
|
+
Z.query.slide,
|
|
3758
|
+
Z.data.title ?? Z.query.widget
|
|
3759
|
+
), this.bc.postMessage({ event: "widget-update", data: Z.query });
|
|
3763
3760
|
break;
|
|
3764
3761
|
case 400:
|
|
3765
3762
|
console.warn(
|
|
3766
3763
|
"%cbroadcast",
|
|
3767
3764
|
Bn,
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
X.query,
|
|
3771
|
-
T
|
|
3765
|
+
Z.query.slide,
|
|
3766
|
+
Z.data.title ?? Z.query.widget
|
|
3772
3767
|
);
|
|
3773
3768
|
break;
|
|
3774
3769
|
}
|
|
@@ -3781,48 +3776,48 @@ class Ti {
|
|
|
3781
3776
|
})
|
|
3782
3777
|
);
|
|
3783
3778
|
});
|
|
3784
|
-
A(this, "hide", (
|
|
3785
|
-
this.api.hideMessage(
|
|
3779
|
+
A(this, "hide", (a) => {
|
|
3780
|
+
this.api.hideMessage(a);
|
|
3786
3781
|
});
|
|
3787
|
-
A(this, "actions", async (
|
|
3782
|
+
A(this, "actions", async (a) => {
|
|
3788
3783
|
var v;
|
|
3789
|
-
switch (
|
|
3784
|
+
switch (a.data.event) {
|
|
3790
3785
|
case "subscribe":
|
|
3791
|
-
(v = this.sm) == null || v.subscribe(
|
|
3786
|
+
(v = this.sm) == null || v.subscribe(a.data.data);
|
|
3792
3787
|
break;
|
|
3793
3788
|
case "update":
|
|
3794
3789
|
console.debug(
|
|
3795
3790
|
"%cstorage",
|
|
3796
3791
|
pt,
|
|
3797
3792
|
"update",
|
|
3798
|
-
|
|
3793
|
+
a.data
|
|
3799
3794
|
), await this.update();
|
|
3800
3795
|
break;
|
|
3801
3796
|
}
|
|
3802
3797
|
});
|
|
3803
|
-
A(this, "getCloud", async (
|
|
3798
|
+
A(this, "getCloud", async (a) => {
|
|
3804
3799
|
var v;
|
|
3805
|
-
return await ((v = this.sm) == null ? void 0 : v.getCloud(
|
|
3800
|
+
return await ((v = this.sm) == null ? void 0 : v.getCloud(a));
|
|
3806
3801
|
});
|
|
3807
|
-
A(this, "getSeries", async (
|
|
3802
|
+
A(this, "getSeries", async (a) => {
|
|
3808
3803
|
var v;
|
|
3809
|
-
return await ((v = this.sm) == null ? void 0 : v.getSeries(
|
|
3804
|
+
return await ((v = this.sm) == null ? void 0 : v.getSeries(a));
|
|
3810
3805
|
});
|
|
3811
|
-
A(this, "getMessages", async (
|
|
3806
|
+
A(this, "getMessages", async (a) => {
|
|
3812
3807
|
var v;
|
|
3813
|
-
return await ((v = this.sm) == null ? void 0 : v.getMessages(
|
|
3808
|
+
return await ((v = this.sm) == null ? void 0 : v.getMessages(a));
|
|
3814
3809
|
});
|
|
3815
3810
|
A(this, "cleanMessages", async () => {
|
|
3816
3811
|
var v, _;
|
|
3817
|
-
const
|
|
3818
|
-
return await ((_ = this.sm) == null ? void 0 : _.cleanMessages(
|
|
3812
|
+
const a = ((v = this.options) == null ? void 0 : v.retention) || 345600;
|
|
3813
|
+
return await ((_ = this.sm) == null ? void 0 : _.cleanMessages(a));
|
|
3819
3814
|
});
|
|
3820
3815
|
A(this, "getSubscribers", async () => {
|
|
3821
|
-
var
|
|
3822
|
-
return await ((
|
|
3816
|
+
var a;
|
|
3817
|
+
return await ((a = this.sm) == null ? void 0 : a.getSubscribers());
|
|
3823
3818
|
});
|
|
3824
|
-
this.options =
|
|
3825
|
-
const v = (
|
|
3819
|
+
this.options = a;
|
|
3820
|
+
const v = (a == null ? void 0 : a.slide) || a.app;
|
|
3826
3821
|
switch (this.bc = new BroadcastChannel(v), console.info(
|
|
3827
3822
|
"%cbroadcast",
|
|
3828
3823
|
Bn,
|
|
@@ -3830,21 +3825,21 @@ class Ti {
|
|
|
3830
3825
|
v
|
|
3831
3826
|
), this.bc.onmessage = (_) => {
|
|
3832
3827
|
this.actions(_);
|
|
3833
|
-
}, this.bc.postMessage({ event: "sm-init", data: {} }), this.api = new xi(
|
|
3828
|
+
}, this.bc.postMessage({ event: "sm-init", data: {} }), this.api = new xi(a), a.storage) {
|
|
3834
3829
|
case _i:
|
|
3835
|
-
this.sm = new Ei(
|
|
3830
|
+
this.sm = new Ei(a);
|
|
3836
3831
|
break;
|
|
3837
3832
|
case bi:
|
|
3838
|
-
this.sm = new Ki(
|
|
3833
|
+
this.sm = new Ki(a);
|
|
3839
3834
|
break;
|
|
3840
3835
|
case wi:
|
|
3841
|
-
this.sm = new Ci(
|
|
3836
|
+
this.sm = new Ci(a);
|
|
3842
3837
|
break;
|
|
3843
3838
|
case vi:
|
|
3844
|
-
this.sm = new ji(
|
|
3839
|
+
this.sm = new ji(a);
|
|
3845
3840
|
break;
|
|
3846
3841
|
case ki:
|
|
3847
|
-
this.sm = new Ai(
|
|
3842
|
+
this.sm = new Ai(a);
|
|
3848
3843
|
break;
|
|
3849
3844
|
default:
|
|
3850
3845
|
this.sm = null;
|