buzzcasting-storage 2.11.7 → 2.12.1
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 +805 -785
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var Ei = Object.defineProperty;
|
|
2
|
-
var Oi = (g, i,
|
|
3
|
-
var
|
|
4
|
-
const xi = "2.
|
|
2
|
+
var Oi = (g, i, u) => i in g ? Ei(g, i, { enumerable: !0, configurable: !0, writable: !0, value: u }) : g[i] = u;
|
|
3
|
+
var D = (g, i, u) => (Oi(g, typeof i != "symbol" ? i + "" : i, u), u);
|
|
4
|
+
const xi = "2.12.0";
|
|
5
5
|
class ki {
|
|
6
6
|
constructor(i) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
D(this, "options");
|
|
8
|
+
D(this, "url");
|
|
9
|
+
D(this, "headers", () => {
|
|
10
10
|
const i = `Bearer ${this.options.bearer}`;
|
|
11
11
|
return {
|
|
12
12
|
headers: new Headers({
|
|
@@ -19,9 +19,9 @@ class ki {
|
|
|
19
19
|
this.options = i, this.url = `https://${i.app}.buzzcasting.net`;
|
|
20
20
|
}
|
|
21
21
|
async get(i) {
|
|
22
|
-
const { version:
|
|
23
|
-
delete
|
|
24
|
-
const R = Object.keys(
|
|
22
|
+
const { version: u } = this.options, h = this.headers(), P = Object.assign({}, i);
|
|
23
|
+
delete P.slide, delete P.type, delete P.hash;
|
|
24
|
+
const R = Object.keys(P).length > 0 ? `?${new URLSearchParams(P).toString()}` : "";
|
|
25
25
|
return console.debug(
|
|
26
26
|
"%capi%c %cget",
|
|
27
27
|
x.API,
|
|
@@ -30,16 +30,16 @@ class ki {
|
|
|
30
30
|
i.slide,
|
|
31
31
|
i.widget
|
|
32
32
|
), await fetch(
|
|
33
|
-
[this.url, "api",
|
|
33
|
+
[this.url, "api", u, i.type].join("/") + R,
|
|
34
34
|
{ ...h, method: "get" }
|
|
35
|
-
).then(async (
|
|
36
|
-
if (!
|
|
37
|
-
throw new Error(`${
|
|
38
|
-
return
|
|
39
|
-
}).then((
|
|
35
|
+
).then(async (K) => {
|
|
36
|
+
if (!K.ok)
|
|
37
|
+
throw new Error(`${K.status}`);
|
|
38
|
+
return K;
|
|
39
|
+
}).then((K) => K.json()).then((K) => (K.query = i, K)).catch((K) => ({ success: !1, message: `${K}`, data: null }));
|
|
40
40
|
}
|
|
41
41
|
async hideMessage(i) {
|
|
42
|
-
const { version:
|
|
42
|
+
const { version: u } = this.options, h = this.headers(), P = "?action=visible";
|
|
43
43
|
return console.info(
|
|
44
44
|
"%capi%c %cput",
|
|
45
45
|
x.API,
|
|
@@ -49,7 +49,7 @@ class ki {
|
|
|
49
49
|
i.widget,
|
|
50
50
|
i.id
|
|
51
51
|
), await fetch(
|
|
52
|
-
[this.url, "api",
|
|
52
|
+
[this.url, "api", u, i.type, i.id].join("/") + P,
|
|
53
53
|
{ ...h, method: "put" }
|
|
54
54
|
).then((R) => {
|
|
55
55
|
if (!R.ok)
|
|
@@ -58,7 +58,7 @@ class ki {
|
|
|
58
58
|
}).then((R) => R.json()).catch((R) => ({ succes: !1, message: R, data: [] }));
|
|
59
59
|
}
|
|
60
60
|
async hideLabels(i) {
|
|
61
|
-
const { version:
|
|
61
|
+
const { version: u } = this.options, h = this.headers(), P = JSON.stringify(i.labels);
|
|
62
62
|
return console.info(
|
|
63
63
|
"%capi%c %cput",
|
|
64
64
|
x.API,
|
|
@@ -66,10 +66,10 @@ class ki {
|
|
|
66
66
|
x.GET_DATA,
|
|
67
67
|
se.HIDE_LABELS,
|
|
68
68
|
i.widget,
|
|
69
|
-
|
|
69
|
+
P
|
|
70
70
|
), await fetch(
|
|
71
|
-
[this.url, "api",
|
|
72
|
-
{ ...h, body:
|
|
71
|
+
[this.url, "api", u, i.type, i.widget].join("/"),
|
|
72
|
+
{ ...h, body: P, method: "put" }
|
|
73
73
|
).then((R) => {
|
|
74
74
|
if (!R.ok)
|
|
75
75
|
throw new Error(R.statusText);
|
|
@@ -83,11 +83,11 @@ function Ai(g) {
|
|
|
83
83
|
}
|
|
84
84
|
var Rr = { exports: {} };
|
|
85
85
|
(function(g, i) {
|
|
86
|
-
(function(
|
|
86
|
+
(function(u, h) {
|
|
87
87
|
g.exports = h();
|
|
88
88
|
})(Cr, function() {
|
|
89
|
-
var
|
|
90
|
-
return (
|
|
89
|
+
var u = function(e, t) {
|
|
90
|
+
return (u = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) {
|
|
91
91
|
n.__proto__ = r;
|
|
92
92
|
} || function(n, r) {
|
|
93
93
|
for (var o in r)
|
|
@@ -101,15 +101,15 @@ var Rr = { exports: {} };
|
|
|
101
101
|
return e;
|
|
102
102
|
}).apply(this, arguments);
|
|
103
103
|
};
|
|
104
|
-
function
|
|
104
|
+
function P(e, t, n) {
|
|
105
105
|
if (n || arguments.length === 2)
|
|
106
106
|
for (var r, o = 0, a = t.length; o < a; o++)
|
|
107
107
|
!r && o in t || ((r = r || Array.prototype.slice.call(t, 0, o))[o] = t[o]);
|
|
108
108
|
return e.concat(r || Array.prototype.slice.call(t));
|
|
109
109
|
}
|
|
110
|
-
var R = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Cr,
|
|
110
|
+
var R = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Cr, K = Object.keys, N = Array.isArray;
|
|
111
111
|
function Z(e, t) {
|
|
112
|
-
return typeof t != "object" ||
|
|
112
|
+
return typeof t != "object" || K(t).forEach(function(n) {
|
|
113
113
|
e[n] = t[n];
|
|
114
114
|
}), e;
|
|
115
115
|
}
|
|
@@ -119,7 +119,7 @@ var Rr = { exports: {} };
|
|
|
119
119
|
return be.call(e, t);
|
|
120
120
|
}
|
|
121
121
|
function xe(e, t) {
|
|
122
|
-
typeof t == "function" && (t = t(te(e))), (typeof Reflect > "u" ?
|
|
122
|
+
typeof t == "function" && (t = t(te(e))), (typeof Reflect > "u" ? K : Reflect.ownKeys)(t).forEach(function(n) {
|
|
123
123
|
ke(e, n, t[n]);
|
|
124
124
|
});
|
|
125
125
|
}
|
|
@@ -160,8 +160,8 @@ var Rr = { exports: {} };
|
|
|
160
160
|
}
|
|
161
161
|
var s = t.indexOf(".");
|
|
162
162
|
if (s !== -1) {
|
|
163
|
-
var
|
|
164
|
-
return
|
|
163
|
+
var c = e[t.substr(0, s)];
|
|
164
|
+
return c == null ? void 0 : ve(c, t.substr(s + 1));
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
function fe(e, t, n) {
|
|
@@ -171,8 +171,8 @@ var Rr = { exports: {} };
|
|
|
171
171
|
for (var r = 0, o = t.length; r < o; ++r)
|
|
172
172
|
fe(e, t[r], n[r]);
|
|
173
173
|
} else {
|
|
174
|
-
var a, s,
|
|
175
|
-
|
|
174
|
+
var a, s, c = t.indexOf(".");
|
|
175
|
+
c !== -1 ? (a = t.substr(0, c), (s = t.substr(c + 1)) === "" ? n === void 0 ? N(e) && !isNaN(parseInt(a)) ? e.splice(a, 1) : delete e[a] : e[a] = n : fe(c = !(c = e[a]) || !ie(e, a) ? e[a] = {} : c, s, n)) : n === void 0 ? N(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n;
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
function Qn(e) {
|
|
@@ -181,9 +181,9 @@ var Rr = { exports: {} };
|
|
|
181
181
|
ie(e, t) && (n[t] = e[t]);
|
|
182
182
|
return n;
|
|
183
183
|
}
|
|
184
|
-
var
|
|
184
|
+
var $r = [].concat;
|
|
185
185
|
function Xn(e) {
|
|
186
|
-
return
|
|
186
|
+
return $r.apply([], e);
|
|
187
187
|
}
|
|
188
188
|
var ge = "BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Xn([8, 16, 32, 64].map(function(e) {
|
|
189
189
|
return ["Int", "Uint", "Float"].map(function(t) {
|
|
@@ -208,16 +208,16 @@ var Rr = { exports: {} };
|
|
|
208
208
|
} else if (Vn.has(n.constructor))
|
|
209
209
|
r = n;
|
|
210
210
|
else {
|
|
211
|
-
var s,
|
|
212
|
-
for (s in r =
|
|
211
|
+
var s, c = te(n);
|
|
212
|
+
for (s in r = c === Object.prototype ? {} : Object.create(c), it.set(n, r), n)
|
|
213
213
|
ie(n, s) && (r[s] = t(n[s]));
|
|
214
214
|
}
|
|
215
215
|
return r;
|
|
216
216
|
}(e), it = null, e;
|
|
217
217
|
}
|
|
218
|
-
var
|
|
218
|
+
var Ur = {}.toString;
|
|
219
219
|
function Jt(e) {
|
|
220
|
-
return
|
|
220
|
+
return Ur.call(e).slice(8, -1);
|
|
221
221
|
}
|
|
222
222
|
var Zt = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", Wr = typeof Zt == "symbol" ? function(e) {
|
|
223
223
|
var t;
|
|
@@ -225,7 +225,7 @@ var Rr = { exports: {} };
|
|
|
225
225
|
} : function() {
|
|
226
226
|
return null;
|
|
227
227
|
};
|
|
228
|
-
function
|
|
228
|
+
function je(e, t) {
|
|
229
229
|
return t = e.indexOf(t), 0 <= t && e.splice(t, 1), 0 <= t;
|
|
230
230
|
}
|
|
231
231
|
var Ye = {};
|
|
@@ -367,12 +367,12 @@ var Rr = { exports: {} };
|
|
|
367
367
|
return [t, te(t), e];
|
|
368
368
|
}(), st = ge[0], de = ge[1], ge = ge[2], de = de && de.then, ut = st && st.constructor, nn = !!ge, ct = function(e, t) {
|
|
369
369
|
lt.push([e, t]), Et && (queueMicrotask(qr), Et = !1);
|
|
370
|
-
}, rn = !0, Et = !0, Be = [], Ot = [], on = ot, De = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: H, pgp: !1, env: {}, finalize: H },
|
|
371
|
-
function
|
|
370
|
+
}, rn = !0, Et = !0, Be = [], Ot = [], on = ot, De = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: H, pgp: !1, env: {}, finalize: H }, B = De, lt = [], Ne = 0, xt = [];
|
|
371
|
+
function M(e) {
|
|
372
372
|
if (typeof this != "object")
|
|
373
373
|
throw new TypeError("Promises must be constructed via new");
|
|
374
374
|
this._listeners = [], this._lib = !1;
|
|
375
|
-
var t = this._PSD =
|
|
375
|
+
var t = this._PSD = B;
|
|
376
376
|
if (typeof e != "function") {
|
|
377
377
|
if (e !== at)
|
|
378
378
|
throw new TypeError("Not a function");
|
|
@@ -385,8 +385,8 @@ var Rr = { exports: {} };
|
|
|
385
385
|
if (a === r)
|
|
386
386
|
throw new TypeError("A promise cannot be resolved with itself.");
|
|
387
387
|
var s = r._lib && Xe();
|
|
388
|
-
a && typeof a.then == "function" ? n(r, function(
|
|
389
|
-
a instanceof
|
|
388
|
+
a && typeof a.then == "function" ? n(r, function(c, p) {
|
|
389
|
+
a instanceof M ? a._then(c, p) : a.then(c, p);
|
|
390
390
|
}) : (r._state = !0, r._value = a, nr(r)), s && Ve();
|
|
391
391
|
}
|
|
392
392
|
}, sn.bind(null, r));
|
|
@@ -396,10 +396,10 @@ var Rr = { exports: {} };
|
|
|
396
396
|
}(this, e);
|
|
397
397
|
}
|
|
398
398
|
var an = { get: function() {
|
|
399
|
-
var e =
|
|
399
|
+
var e = B, t = Pt;
|
|
400
400
|
function n(r, o) {
|
|
401
|
-
var a = this, s = !e.global && (e !==
|
|
402
|
-
un(a, new tr(ir(r, e, s,
|
|
401
|
+
var a = this, s = !e.global && (e !== B || t !== Pt), c = s && !Ce(), p = new M(function(f, v) {
|
|
402
|
+
un(a, new tr(ir(r, e, s, c), ir(o, e, s, c), f, v, e));
|
|
403
403
|
});
|
|
404
404
|
return this._consoleTask && (p._consoleTask = this._consoleTask), p;
|
|
405
405
|
}
|
|
@@ -482,12 +482,12 @@ var Rr = { exports: {} };
|
|
|
482
482
|
t[--n]();
|
|
483
483
|
}
|
|
484
484
|
function kt(e) {
|
|
485
|
-
return new
|
|
485
|
+
return new M(at, !1, e);
|
|
486
486
|
}
|
|
487
487
|
function J(e, t) {
|
|
488
|
-
var n =
|
|
488
|
+
var n = B;
|
|
489
489
|
return function() {
|
|
490
|
-
var r = Xe(), o =
|
|
490
|
+
var r = Xe(), o = B;
|
|
491
491
|
try {
|
|
492
492
|
return Ie(n, !0), e.apply(this, arguments);
|
|
493
493
|
} catch (a) {
|
|
@@ -497,8 +497,8 @@ var Rr = { exports: {} };
|
|
|
497
497
|
}
|
|
498
498
|
};
|
|
499
499
|
}
|
|
500
|
-
xe(
|
|
501
|
-
un(this, new tr(null, null, e, t,
|
|
500
|
+
xe(M.prototype, { then: an, _then: function(e, t) {
|
|
501
|
+
un(this, new tr(null, null, e, t, B));
|
|
502
502
|
}, catch: function(e) {
|
|
503
503
|
if (arguments.length === 1)
|
|
504
504
|
return this.then(null, e);
|
|
@@ -510,48 +510,48 @@ var Rr = { exports: {} };
|
|
|
510
510
|
});
|
|
511
511
|
}, finally: function(e) {
|
|
512
512
|
return this.then(function(t) {
|
|
513
|
-
return
|
|
513
|
+
return M.resolve(e()).then(function() {
|
|
514
514
|
return t;
|
|
515
515
|
});
|
|
516
516
|
}, function(t) {
|
|
517
|
-
return
|
|
517
|
+
return M.resolve(e()).then(function() {
|
|
518
518
|
return kt(t);
|
|
519
519
|
});
|
|
520
520
|
});
|
|
521
521
|
}, timeout: function(e, t) {
|
|
522
522
|
var n = this;
|
|
523
|
-
return e < 1 / 0 ? new
|
|
523
|
+
return e < 1 / 0 ? new M(function(r, o) {
|
|
524
524
|
var a = setTimeout(function() {
|
|
525
525
|
return o(new G.Timeout(t));
|
|
526
526
|
}, e);
|
|
527
527
|
n.then(r, o).finally(clearTimeout.bind(null, a));
|
|
528
528
|
}) : this;
|
|
529
|
-
} }), typeof Symbol < "u" && Symbol.toStringTag && ke(
|
|
529
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && ke(M.prototype, Symbol.toStringTag, "Dexie.Promise"), De.env = rr(), xe(M, { all: function() {
|
|
530
530
|
var e = we.apply(null, arguments).map(Ct);
|
|
531
|
-
return new
|
|
531
|
+
return new M(function(t, n) {
|
|
532
532
|
e.length === 0 && t([]);
|
|
533
533
|
var r = e.length;
|
|
534
534
|
e.forEach(function(o, a) {
|
|
535
|
-
return
|
|
535
|
+
return M.resolve(o).then(function(s) {
|
|
536
536
|
e[a] = s, --r || t(e);
|
|
537
537
|
}, n);
|
|
538
538
|
});
|
|
539
539
|
});
|
|
540
540
|
}, resolve: function(e) {
|
|
541
|
-
return e instanceof
|
|
541
|
+
return e instanceof M ? e : e && typeof e.then == "function" ? new M(function(t, n) {
|
|
542
542
|
e.then(t, n);
|
|
543
|
-
}) : new
|
|
543
|
+
}) : new M(at, !0, e);
|
|
544
544
|
}, reject: kt, race: function() {
|
|
545
545
|
var e = we.apply(null, arguments).map(Ct);
|
|
546
|
-
return new
|
|
546
|
+
return new M(function(t, n) {
|
|
547
547
|
e.map(function(r) {
|
|
548
|
-
return
|
|
548
|
+
return M.resolve(r).then(t, n);
|
|
549
549
|
});
|
|
550
550
|
});
|
|
551
551
|
}, PSD: { get: function() {
|
|
552
|
-
return
|
|
552
|
+
return B;
|
|
553
553
|
}, set: function(e) {
|
|
554
|
-
return
|
|
554
|
+
return B = e;
|
|
555
555
|
} }, totalEchoes: { get: function() {
|
|
556
556
|
return Pt;
|
|
557
557
|
} }, newPSD: Pe, usePSD: Le, scheduler: { get: function() {
|
|
@@ -563,28 +563,28 @@ var Rr = { exports: {} };
|
|
|
563
563
|
}, set: function(e) {
|
|
564
564
|
on = e;
|
|
565
565
|
} }, follow: function(e, t) {
|
|
566
|
-
return new
|
|
566
|
+
return new M(function(n, r) {
|
|
567
567
|
return Pe(function(o, a) {
|
|
568
|
-
var s =
|
|
568
|
+
var s = B;
|
|
569
569
|
s.unhandleds = [], s.onunhandled = a, s.finalize = Ke(function() {
|
|
570
|
-
var
|
|
571
|
-
|
|
570
|
+
var c, p = this;
|
|
571
|
+
c = function() {
|
|
572
572
|
p.unhandleds.length === 0 ? o() : a(p.unhandleds[0]);
|
|
573
573
|
}, xt.push(function f() {
|
|
574
|
-
|
|
574
|
+
c(), xt.splice(xt.indexOf(f), 1);
|
|
575
575
|
}), ++Ne, ct(function() {
|
|
576
576
|
--Ne == 0 && cn();
|
|
577
577
|
}, []);
|
|
578
578
|
}, s.finalize), e();
|
|
579
579
|
}, t, n, r);
|
|
580
580
|
});
|
|
581
|
-
} }), ut && (ut.allSettled && ke(
|
|
581
|
+
} }), ut && (ut.allSettled && ke(M, "allSettled", function() {
|
|
582
582
|
var e = we.apply(null, arguments).map(Ct);
|
|
583
|
-
return new
|
|
583
|
+
return new M(function(t) {
|
|
584
584
|
e.length === 0 && t([]);
|
|
585
585
|
var n = e.length, r = new Array(n);
|
|
586
586
|
e.forEach(function(o, a) {
|
|
587
|
-
return
|
|
587
|
+
return M.resolve(o).then(function(s) {
|
|
588
588
|
return r[a] = { status: "fulfilled", value: s };
|
|
589
589
|
}, function(s) {
|
|
590
590
|
return r[a] = { status: "rejected", reason: s };
|
|
@@ -593,24 +593,24 @@ var Rr = { exports: {} };
|
|
|
593
593
|
});
|
|
594
594
|
});
|
|
595
595
|
});
|
|
596
|
-
}), ut.any && typeof AggregateError < "u" && ke(
|
|
596
|
+
}), ut.any && typeof AggregateError < "u" && ke(M, "any", function() {
|
|
597
597
|
var e = we.apply(null, arguments).map(Ct);
|
|
598
|
-
return new
|
|
598
|
+
return new M(function(t, n) {
|
|
599
599
|
e.length === 0 && n(new AggregateError([]));
|
|
600
600
|
var r = e.length, o = new Array(r);
|
|
601
601
|
e.forEach(function(a, s) {
|
|
602
|
-
return
|
|
603
|
-
return t(
|
|
604
|
-
}, function(
|
|
605
|
-
o[s] =
|
|
602
|
+
return M.resolve(a).then(function(c) {
|
|
603
|
+
return t(c);
|
|
604
|
+
}, function(c) {
|
|
605
|
+
o[s] = c, --r || n(new AggregateError(o));
|
|
606
606
|
});
|
|
607
607
|
});
|
|
608
608
|
});
|
|
609
609
|
}));
|
|
610
610
|
var ne = { awaits: 0, echoes: 0, id: 0 }, ei = 0, At = [], Dt = 0, Pt = 0, ti = 0;
|
|
611
611
|
function Pe(e, t, n, r) {
|
|
612
|
-
var o =
|
|
613
|
-
return a.parent = o, a.ref = 0, a.global = !1, a.id = ++ti, De.env, a.env = nn ? { Promise:
|
|
612
|
+
var o = B, a = Object.create(o);
|
|
613
|
+
return a.parent = o, a.ref = 0, a.global = !1, a.id = ++ti, De.env, a.env = nn ? { Promise: M, PromiseProp: { value: M, configurable: !0, writable: !0 }, all: M.all, race: M.race, allSettled: M.allSettled, any: M.any, resolve: M.resolve, reject: M.reject } : {}, t && Z(a, t), ++o.ref, a.finalize = function() {
|
|
614
614
|
--this.parent.ref || this.parent.finalize();
|
|
615
615
|
}, r = Le(a, e, n, r), a.ref === 0 && a.finalize(), r;
|
|
616
616
|
}
|
|
@@ -632,17 +632,17 @@ var Rr = { exports: {} };
|
|
|
632
632
|
At.pop(), Ie(e, !1);
|
|
633
633
|
}
|
|
634
634
|
function Ie(e, t) {
|
|
635
|
-
var n, r =
|
|
636
|
-
(t ? !ne.echoes || Dt++ && e ===
|
|
637
|
-
++Pt, ne.echoes && --ne.echoes != 0 || (ne.echoes = ne.awaits = ne.id = 0), At.push(
|
|
638
|
-
}).bind(null, e) : ni), e !==
|
|
635
|
+
var n, r = B;
|
|
636
|
+
(t ? !ne.echoes || Dt++ && e === B : !Dt || --Dt && e === B) || queueMicrotask(t ? (function(o) {
|
|
637
|
+
++Pt, ne.echoes && --ne.echoes != 0 || (ne.echoes = ne.awaits = ne.id = 0), At.push(B), Ie(o, !0);
|
|
638
|
+
}).bind(null, e) : ni), e !== B && (B = e, r === De && (De.env = rr()), nn && (n = De.env.Promise, t = e.env, (r.global || e.global) && (Object.defineProperty(R, "Promise", t.PromiseProp), n.all = t.all, n.race = t.race, n.resolve = t.resolve, n.reject = t.reject, t.allSettled && (n.allSettled = t.allSettled), t.any && (n.any = t.any))));
|
|
639
639
|
}
|
|
640
640
|
function rr() {
|
|
641
641
|
var e = R.Promise;
|
|
642
642
|
return nn ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(R, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
|
|
643
643
|
}
|
|
644
644
|
function Le(e, t, n, r, o) {
|
|
645
|
-
var a =
|
|
645
|
+
var a = B;
|
|
646
646
|
try {
|
|
647
647
|
return Ie(e, !0), t(n, r, o);
|
|
648
648
|
} finally {
|
|
@@ -651,7 +651,7 @@ var Rr = { exports: {} };
|
|
|
651
651
|
}
|
|
652
652
|
function ir(e, t, n, r) {
|
|
653
653
|
return typeof e != "function" ? e : function() {
|
|
654
|
-
var o =
|
|
654
|
+
var o = B;
|
|
655
655
|
n && Je(), Ie(t, !0);
|
|
656
656
|
try {
|
|
657
657
|
return e.apply(this, arguments);
|
|
@@ -664,7 +664,7 @@ var Rr = { exports: {} };
|
|
|
664
664
|
Promise === ut && ne.echoes === 0 ? Dt === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
665
665
|
}
|
|
666
666
|
("" + de).indexOf("[native code]") === -1 && (Je = Ce = H);
|
|
667
|
-
var q =
|
|
667
|
+
var q = M.reject, ge = "4.0.1-beta.10", Ge = "", _e = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", or = "String expected.", Ze = [], It = "__dbnames", fn = "readonly", dn = "readwrite";
|
|
668
668
|
function Fe(e, t) {
|
|
669
669
|
return e ? t ? function() {
|
|
670
670
|
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
@@ -693,19 +693,19 @@ var Rr = { exports: {} };
|
|
|
693
693
|
return t < e ? 1 : e < t ? -1 : 0;
|
|
694
694
|
case "binary":
|
|
695
695
|
return function(o, a) {
|
|
696
|
-
for (var s = o.length,
|
|
696
|
+
for (var s = o.length, c = a.length, p = s < c ? s : c, f = 0; f < p; ++f)
|
|
697
697
|
if (o[f] !== a[f])
|
|
698
698
|
return o[f] < a[f] ? -1 : 1;
|
|
699
|
-
return s ===
|
|
699
|
+
return s === c ? 0 : s < c ? -1 : 1;
|
|
700
700
|
}(cr(e), cr(t));
|
|
701
701
|
case "Array":
|
|
702
702
|
return function(o, a) {
|
|
703
|
-
for (var s = o.length,
|
|
703
|
+
for (var s = o.length, c = a.length, p = s < c ? s : c, f = 0; f < p; ++f) {
|
|
704
704
|
var v = z(o[f], a[f]);
|
|
705
705
|
if (v !== 0)
|
|
706
706
|
return v;
|
|
707
707
|
}
|
|
708
|
-
return s ===
|
|
708
|
+
return s === c ? 0 : s < c ? -1 : 1;
|
|
709
709
|
}(e, t);
|
|
710
710
|
}
|
|
711
711
|
} catch {
|
|
@@ -720,18 +720,18 @@ var Rr = { exports: {} };
|
|
|
720
720
|
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
721
721
|
}
|
|
722
722
|
var lr = (X.prototype._trans = function(e, t, n) {
|
|
723
|
-
var r = this._tx ||
|
|
723
|
+
var r = this._tx || B.trans, o = this.name, a = pe && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
724
724
|
function s(f, v, l) {
|
|
725
725
|
if (!l.schema[o])
|
|
726
726
|
throw new G.NotFound("Table " + o + " not part of transaction");
|
|
727
727
|
return t(l.idbtrans, l);
|
|
728
728
|
}
|
|
729
|
-
var
|
|
729
|
+
var c = Xe();
|
|
730
730
|
try {
|
|
731
|
-
var p = r && r.db._novip === this.db._novip ? r ===
|
|
731
|
+
var p = r && r.db._novip === this.db._novip ? r === B.trans ? r._promise(e, s, n) : Pe(function() {
|
|
732
732
|
return r._promise(e, s, n);
|
|
733
|
-
}, { trans: r, transless:
|
|
734
|
-
if (v.idbdb && (v._state.openComplete ||
|
|
733
|
+
}, { trans: r, transless: B.transless || B }) : function f(v, l, d, y) {
|
|
734
|
+
if (v.idbdb && (v._state.openComplete || B.letThrough || v._vip)) {
|
|
735
735
|
var b = v._createTransaction(l, d, v._dbSchema);
|
|
736
736
|
try {
|
|
737
737
|
b.create(), v._state.PR1398_maxLoop = 3;
|
|
@@ -742,7 +742,7 @@ var Rr = { exports: {} };
|
|
|
742
742
|
}
|
|
743
743
|
return b._promise(l, function(w, m) {
|
|
744
744
|
return Pe(function() {
|
|
745
|
-
return
|
|
745
|
+
return B.trans = b, y(w, m, b);
|
|
746
746
|
});
|
|
747
747
|
}).then(function(w) {
|
|
748
748
|
if (l === "readwrite")
|
|
@@ -770,7 +770,7 @@ var Rr = { exports: {} };
|
|
|
770
770
|
return console.trace(f), q(f);
|
|
771
771
|
})), p;
|
|
772
772
|
} finally {
|
|
773
|
-
|
|
773
|
+
c && Ve();
|
|
774
774
|
}
|
|
775
775
|
}, X.prototype.get = function(e, t) {
|
|
776
776
|
var n = this;
|
|
@@ -784,7 +784,7 @@ var Rr = { exports: {} };
|
|
|
784
784
|
return new this.db.WhereClause(this, e);
|
|
785
785
|
if (N(e))
|
|
786
786
|
return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
787
|
-
var t =
|
|
787
|
+
var t = K(e);
|
|
788
788
|
if (t.length === 1)
|
|
789
789
|
return this.where(t[0]).equals(e[t[0]]);
|
|
790
790
|
var n = this.schema.indexes.concat(this.schema.primKey).filter(function(p) {
|
|
@@ -811,7 +811,7 @@ var Rr = { exports: {} };
|
|
|
811
811
|
function a(p, f) {
|
|
812
812
|
return o.cmp(p, f) === 0;
|
|
813
813
|
}
|
|
814
|
-
var
|
|
814
|
+
var c = t.reduce(function(d, f) {
|
|
815
815
|
var v = d[0], l = d[1], d = r[f], y = e[f];
|
|
816
816
|
return [v || d, v || !d ? Fe(l, d && d.multi ? function(b) {
|
|
817
817
|
return b = ve(b, f), N(b) && b.some(function(w) {
|
|
@@ -820,8 +820,8 @@ var Rr = { exports: {} };
|
|
|
820
820
|
} : function(b) {
|
|
821
821
|
return a(y, ve(b, f));
|
|
822
822
|
}) : l];
|
|
823
|
-
}, [null, null]), s =
|
|
824
|
-
return s ? this.where(s.name).equals(e[s.keyPath]).filter(
|
|
823
|
+
}, [null, null]), s = c[0], c = c[1];
|
|
824
|
+
return s ? this.where(s.name).equals(e[s.keyPath]).filter(c) : n ? this.filter(c) : this.where(t).equals("");
|
|
825
825
|
}, X.prototype.filter = function(e) {
|
|
826
826
|
return this.toCollection().and(e);
|
|
827
827
|
}, X.prototype.count = function(e) {
|
|
@@ -851,7 +851,7 @@ var Rr = { exports: {} };
|
|
|
851
851
|
function v() {
|
|
852
852
|
this.constructor = p;
|
|
853
853
|
}
|
|
854
|
-
|
|
854
|
+
u(p, f), p.prototype = f === null ? Object.create(f) : (v.prototype = f.prototype, new v());
|
|
855
855
|
}(o, t = e), Object.defineProperty(o.prototype, "db", { get: function() {
|
|
856
856
|
return n;
|
|
857
857
|
}, enumerable: !1, configurable: !0 }), o.prototype.table = function() {
|
|
@@ -861,7 +861,7 @@ var Rr = { exports: {} };
|
|
|
861
861
|
Object.getOwnPropertyNames(s).forEach(function(p) {
|
|
862
862
|
return a.add(p);
|
|
863
863
|
});
|
|
864
|
-
function
|
|
864
|
+
function c(p) {
|
|
865
865
|
if (!p)
|
|
866
866
|
return p;
|
|
867
867
|
var f, v = Object.create(e.prototype);
|
|
@@ -873,54 +873,54 @@ var Rr = { exports: {} };
|
|
|
873
873
|
}
|
|
874
874
|
return v;
|
|
875
875
|
}
|
|
876
|
-
return this.schema.readHook && this.hook.reading.unsubscribe(this.schema.readHook), this.schema.readHook =
|
|
876
|
+
return this.schema.readHook && this.hook.reading.unsubscribe(this.schema.readHook), this.schema.readHook = c, this.hook("reading", c), e;
|
|
877
877
|
}, X.prototype.defineClass = function() {
|
|
878
878
|
return this.mapToClass(function(e) {
|
|
879
879
|
Z(this, e);
|
|
880
880
|
});
|
|
881
881
|
}, X.prototype.add = function(e, t) {
|
|
882
882
|
var n = this, r = this.schema.primKey, o = r.auto, a = r.keyPath, s = e;
|
|
883
|
-
return a && o && (s = Rt(a)(e)), this._trans("readwrite", function(
|
|
884
|
-
return n.core.mutate({ trans:
|
|
885
|
-
}).then(function(
|
|
886
|
-
return
|
|
887
|
-
}).then(function(
|
|
883
|
+
return a && o && (s = Rt(a)(e)), this._trans("readwrite", function(c) {
|
|
884
|
+
return n.core.mutate({ trans: c, type: "add", keys: t != null ? [t] : null, values: [s] });
|
|
885
|
+
}).then(function(c) {
|
|
886
|
+
return c.numFailures ? M.reject(c.failures[0]) : c.lastResult;
|
|
887
|
+
}).then(function(c) {
|
|
888
888
|
if (a)
|
|
889
889
|
try {
|
|
890
|
-
fe(e, a,
|
|
890
|
+
fe(e, a, c);
|
|
891
891
|
} catch {
|
|
892
892
|
}
|
|
893
|
-
return
|
|
893
|
+
return c;
|
|
894
894
|
});
|
|
895
895
|
}, X.prototype.update = function(e, t) {
|
|
896
896
|
return typeof e != "object" || N(e) ? this.where(":id").equals(e).modify(t) : (e = ve(e, this.schema.primKey.keyPath), e === void 0 ? q(new G.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t));
|
|
897
897
|
}, X.prototype.put = function(e, t) {
|
|
898
898
|
var n = this, r = this.schema.primKey, o = r.auto, a = r.keyPath, s = e;
|
|
899
|
-
return a && o && (s = Rt(a)(e)), this._trans("readwrite", function(
|
|
900
|
-
return n.core.mutate({ trans:
|
|
901
|
-
}).then(function(
|
|
902
|
-
return
|
|
903
|
-
}).then(function(
|
|
899
|
+
return a && o && (s = Rt(a)(e)), this._trans("readwrite", function(c) {
|
|
900
|
+
return n.core.mutate({ trans: c, type: "put", values: [s], keys: t != null ? [t] : null });
|
|
901
|
+
}).then(function(c) {
|
|
902
|
+
return c.numFailures ? M.reject(c.failures[0]) : c.lastResult;
|
|
903
|
+
}).then(function(c) {
|
|
904
904
|
if (a)
|
|
905
905
|
try {
|
|
906
|
-
fe(e, a,
|
|
906
|
+
fe(e, a, c);
|
|
907
907
|
} catch {
|
|
908
908
|
}
|
|
909
|
-
return
|
|
909
|
+
return c;
|
|
910
910
|
});
|
|
911
911
|
}, X.prototype.delete = function(e) {
|
|
912
912
|
var t = this;
|
|
913
913
|
return this._trans("readwrite", function(n) {
|
|
914
914
|
return t.core.mutate({ trans: n, type: "delete", keys: [e] });
|
|
915
915
|
}).then(function(n) {
|
|
916
|
-
return n.numFailures ?
|
|
916
|
+
return n.numFailures ? M.reject(n.failures[0]) : void 0;
|
|
917
917
|
});
|
|
918
918
|
}, X.prototype.clear = function() {
|
|
919
919
|
var e = this;
|
|
920
920
|
return this._trans("readwrite", function(t) {
|
|
921
921
|
return e.core.mutate({ trans: t, type: "deleteRange", range: ar });
|
|
922
922
|
}).then(function(t) {
|
|
923
|
-
return t.numFailures ?
|
|
923
|
+
return t.numFailures ? M.reject(t.failures[0]) : void 0;
|
|
924
924
|
});
|
|
925
925
|
}, X.prototype.bulkGet = function(e) {
|
|
926
926
|
var t = this;
|
|
@@ -934,12 +934,12 @@ var Rr = { exports: {} };
|
|
|
934
934
|
}, X.prototype.bulkAdd = function(e, t, n) {
|
|
935
935
|
var r = this, o = Array.isArray(t) ? t : void 0, a = (n = n || (o ? void 0 : t)) ? n.allKeys : void 0;
|
|
936
936
|
return this._trans("readwrite", function(s) {
|
|
937
|
-
var f = r.schema.primKey,
|
|
937
|
+
var f = r.schema.primKey, c = f.auto, f = f.keyPath;
|
|
938
938
|
if (f && o)
|
|
939
939
|
throw new G.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
940
940
|
if (o && o.length !== e.length)
|
|
941
941
|
throw new G.InvalidArgument("Arguments objects and keys must have the same length");
|
|
942
|
-
var p = e.length, f = f &&
|
|
942
|
+
var p = e.length, f = f && c ? e.map(Rt(f)) : e;
|
|
943
943
|
return r.core.mutate({ trans: s, type: "add", keys: o, values: f, wantResults: a }).then(function(b) {
|
|
944
944
|
var l = b.numFailures, d = b.results, y = b.lastResult, b = b.failures;
|
|
945
945
|
if (l === 0)
|
|
@@ -950,12 +950,12 @@ var Rr = { exports: {} };
|
|
|
950
950
|
}, X.prototype.bulkPut = function(e, t, n) {
|
|
951
951
|
var r = this, o = Array.isArray(t) ? t : void 0, a = (n = n || (o ? void 0 : t)) ? n.allKeys : void 0;
|
|
952
952
|
return this._trans("readwrite", function(s) {
|
|
953
|
-
var f = r.schema.primKey,
|
|
953
|
+
var f = r.schema.primKey, c = f.auto, f = f.keyPath;
|
|
954
954
|
if (f && o)
|
|
955
955
|
throw new G.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
956
956
|
if (o && o.length !== e.length)
|
|
957
957
|
throw new G.InvalidArgument("Arguments objects and keys must have the same length");
|
|
958
|
-
var p = e.length, f = f &&
|
|
958
|
+
var p = e.length, f = f && c ? e.map(Rt(f)) : e;
|
|
959
959
|
return r.core.mutate({ trans: s, type: "put", keys: o, values: f, wantResults: a }).then(function(b) {
|
|
960
960
|
var l = b.numFailures, d = b.results, y = b.lastResult, b = b.failures;
|
|
961
961
|
if (l === 0)
|
|
@@ -970,10 +970,10 @@ var Rr = { exports: {} };
|
|
|
970
970
|
return s.changes;
|
|
971
971
|
}), a = [];
|
|
972
972
|
return this._trans("readwrite", function(s) {
|
|
973
|
-
return n.getMany({ trans: s, keys: r, cache: "clone" }).then(function(
|
|
973
|
+
return n.getMany({ trans: s, keys: r, cache: "clone" }).then(function(c) {
|
|
974
974
|
var p = [], f = [];
|
|
975
975
|
e.forEach(function(l, d) {
|
|
976
|
-
var y = l.key, b = l.changes, w =
|
|
976
|
+
var y = l.key, b = l.changes, w = c[d];
|
|
977
977
|
if (w) {
|
|
978
978
|
for (var m = 0, _ = Object.keys(b); m < _.length; m++) {
|
|
979
979
|
var S = _[m], E = b[S];
|
|
@@ -1013,8 +1013,8 @@ var Rr = { exports: {} };
|
|
|
1013
1013
|
function X() {
|
|
1014
1014
|
}
|
|
1015
1015
|
function ft(e) {
|
|
1016
|
-
function t(s,
|
|
1017
|
-
if (
|
|
1016
|
+
function t(s, c) {
|
|
1017
|
+
if (c) {
|
|
1018
1018
|
for (var p = arguments.length, f = new Array(p - 1); --p; )
|
|
1019
1019
|
f[p - 1] = arguments[p];
|
|
1020
1020
|
return n[s].subscribe.apply(null, f), e;
|
|
@@ -1027,20 +1027,20 @@ var Rr = { exports: {} };
|
|
|
1027
1027
|
for (var r = 1, o = arguments.length; r < o; ++r)
|
|
1028
1028
|
a(arguments[r]);
|
|
1029
1029
|
return t;
|
|
1030
|
-
function a(s,
|
|
1030
|
+
function a(s, c, p) {
|
|
1031
1031
|
if (typeof s != "object") {
|
|
1032
1032
|
var f;
|
|
1033
|
-
|
|
1033
|
+
c = c || Jr;
|
|
1034
1034
|
var v = { subscribers: [], fire: p = p || H, subscribe: function(l) {
|
|
1035
|
-
v.subscribers.indexOf(l) === -1 && (v.subscribers.push(l), v.fire =
|
|
1035
|
+
v.subscribers.indexOf(l) === -1 && (v.subscribers.push(l), v.fire = c(v.fire, l));
|
|
1036
1036
|
}, unsubscribe: function(l) {
|
|
1037
1037
|
v.subscribers = v.subscribers.filter(function(d) {
|
|
1038
1038
|
return d !== l;
|
|
1039
|
-
}), v.fire = v.subscribers.reduce(
|
|
1039
|
+
}), v.fire = v.subscribers.reduce(c, p);
|
|
1040
1040
|
} };
|
|
1041
1041
|
return n[s] = t[s] = v;
|
|
1042
1042
|
}
|
|
1043
|
-
|
|
1043
|
+
K(f = s).forEach(function(l) {
|
|
1044
1044
|
var d = f[l];
|
|
1045
1045
|
if (N(d))
|
|
1046
1046
|
a(l, f[l][0], f[l][1]);
|
|
@@ -1087,24 +1087,24 @@ var Rr = { exports: {} };
|
|
|
1087
1087
|
var r = Tt(e, t.schema);
|
|
1088
1088
|
return t.openCursor({ trans: n, values: !e.keysOnly, reverse: e.dir === "prev", unique: !!e.unique, query: { index: r, range: e.range } });
|
|
1089
1089
|
}
|
|
1090
|
-
function
|
|
1090
|
+
function Mt(e, t, n, r) {
|
|
1091
1091
|
var o = e.replayFilter ? Fe(e.filter, e.replayFilter()) : e.filter;
|
|
1092
1092
|
if (e.or) {
|
|
1093
|
-
var a = {}, s = function(
|
|
1093
|
+
var a = {}, s = function(c, p, f) {
|
|
1094
1094
|
var v, l;
|
|
1095
1095
|
o && !o(p, f, function(d) {
|
|
1096
1096
|
return p.stop(d);
|
|
1097
1097
|
}, function(d) {
|
|
1098
1098
|
return p.fail(d);
|
|
1099
|
-
}) || ((l = "" + (v = p.primaryKey)) == "[object ArrayBuffer]" && (l = "" + new Uint8Array(v)), ie(a, l) || (a[l] = !0, t(
|
|
1099
|
+
}) || ((l = "" + (v = p.primaryKey)) == "[object ArrayBuffer]" && (l = "" + new Uint8Array(v)), ie(a, l) || (a[l] = !0, t(c, p, f)));
|
|
1100
1100
|
};
|
|
1101
1101
|
return Promise.all([e.or._iterate(s, n), dr(fr(e, r, n), e.algorithm, s, !e.keysOnly && e.valueMapper)]);
|
|
1102
1102
|
}
|
|
1103
1103
|
return dr(fr(e, r, n), Fe(e.algorithm, o), t, !e.keysOnly && e.valueMapper);
|
|
1104
1104
|
}
|
|
1105
1105
|
function dr(e, t, n, r) {
|
|
1106
|
-
var o = J(r ? function(a, s,
|
|
1107
|
-
return n(r(a), s,
|
|
1106
|
+
var o = J(r ? function(a, s, c) {
|
|
1107
|
+
return n(r(a), s, c);
|
|
1108
1108
|
} : n);
|
|
1109
1109
|
return e.then(function(a) {
|
|
1110
1110
|
if (a)
|
|
@@ -1112,14 +1112,14 @@ var Rr = { exports: {} };
|
|
|
1112
1112
|
var s = function() {
|
|
1113
1113
|
return a.continue();
|
|
1114
1114
|
};
|
|
1115
|
-
t && !t(a, function(
|
|
1116
|
-
return s =
|
|
1117
|
-
}, function(
|
|
1118
|
-
a.stop(
|
|
1119
|
-
}, function(
|
|
1120
|
-
a.fail(
|
|
1121
|
-
}) || o(a.value, a, function(
|
|
1122
|
-
return s =
|
|
1115
|
+
t && !t(a, function(c) {
|
|
1116
|
+
return s = c;
|
|
1117
|
+
}, function(c) {
|
|
1118
|
+
a.stop(c), s = H;
|
|
1119
|
+
}, function(c) {
|
|
1120
|
+
a.fail(c), s = H;
|
|
1121
|
+
}) || o(a.value, a, function(c) {
|
|
1122
|
+
return s = c;
|
|
1123
1123
|
}), s();
|
|
1124
1124
|
});
|
|
1125
1125
|
});
|
|
@@ -1134,7 +1134,7 @@ var Rr = { exports: {} };
|
|
|
1134
1134
|
var t = this._ctx;
|
|
1135
1135
|
t.algorithm = Fe(t.algorithm, e);
|
|
1136
1136
|
}, W.prototype._iterate = function(e, t) {
|
|
1137
|
-
return
|
|
1137
|
+
return Mt(this._ctx, e, t, this._ctx.table.core);
|
|
1138
1138
|
}, W.prototype.clone = function(e) {
|
|
1139
1139
|
var t = Object.create(this.constructor.prototype), n = Object.create(this._ctx);
|
|
1140
1140
|
return e && Z(n, e), t._ctx = n, t;
|
|
@@ -1143,7 +1143,7 @@ var Rr = { exports: {} };
|
|
|
1143
1143
|
}, W.prototype.each = function(e) {
|
|
1144
1144
|
var t = this._ctx;
|
|
1145
1145
|
return this._read(function(n) {
|
|
1146
|
-
return
|
|
1146
|
+
return Mt(t, e, n, t.table.core);
|
|
1147
1147
|
});
|
|
1148
1148
|
}, W.prototype.count = function(e) {
|
|
1149
1149
|
var t = this;
|
|
@@ -1154,7 +1154,7 @@ var Rr = { exports: {} };
|
|
|
1154
1154
|
return Math.min(s, r.limit);
|
|
1155
1155
|
});
|
|
1156
1156
|
var a = 0;
|
|
1157
|
-
return
|
|
1157
|
+
return Mt(r, function() {
|
|
1158
1158
|
return ++a, !1;
|
|
1159
1159
|
}, n, o).then(function() {
|
|
1160
1160
|
return a;
|
|
@@ -1166,11 +1166,11 @@ var Rr = { exports: {} };
|
|
|
1166
1166
|
return f ? a(p[n[f]], f - 1) : p[r];
|
|
1167
1167
|
}
|
|
1168
1168
|
var s = this._ctx.dir === "next" ? 1 : -1;
|
|
1169
|
-
function
|
|
1169
|
+
function c(p, f) {
|
|
1170
1170
|
return p = a(p, o), f = a(f, o), p < f ? -s : f < p ? s : 0;
|
|
1171
1171
|
}
|
|
1172
1172
|
return this.toArray(function(p) {
|
|
1173
|
-
return p.sort(
|
|
1173
|
+
return p.sort(c);
|
|
1174
1174
|
}).then(t);
|
|
1175
1175
|
}, W.prototype.toArray = function(e) {
|
|
1176
1176
|
var t = this;
|
|
@@ -1178,13 +1178,13 @@ var Rr = { exports: {} };
|
|
|
1178
1178
|
var r = t._ctx;
|
|
1179
1179
|
if (r.dir === "next" && qe(r, !0) && 0 < r.limit) {
|
|
1180
1180
|
var o = r.valueMapper, a = Tt(r, r.table.core.schema);
|
|
1181
|
-
return r.table.core.query({ trans: n, limit: r.limit, values: !0, query: { index: a, range: r.range } }).then(function(
|
|
1182
|
-
return
|
|
1181
|
+
return r.table.core.query({ trans: n, limit: r.limit, values: !0, query: { index: a, range: r.range } }).then(function(c) {
|
|
1182
|
+
return c = c.result, o ? c.map(o) : c;
|
|
1183
1183
|
});
|
|
1184
1184
|
}
|
|
1185
1185
|
var s = [];
|
|
1186
|
-
return
|
|
1187
|
-
return s.push(
|
|
1186
|
+
return Mt(r, function(c) {
|
|
1187
|
+
return s.push(c);
|
|
1188
1188
|
}, n, r.table.core).then(function() {
|
|
1189
1189
|
return s;
|
|
1190
1190
|
});
|
|
@@ -1292,17 +1292,17 @@ var Rr = { exports: {} };
|
|
|
1292
1292
|
var t = this, n = this._ctx;
|
|
1293
1293
|
return this._write(function(r) {
|
|
1294
1294
|
var o, a, s;
|
|
1295
|
-
s = typeof e == "function" ? e : (o =
|
|
1295
|
+
s = typeof e == "function" ? e : (o = K(e), a = o.length, function(m) {
|
|
1296
1296
|
for (var _ = !1, S = 0; S < a; ++S) {
|
|
1297
1297
|
var E = o[S], O = e[E];
|
|
1298
1298
|
ve(m, E) !== O && (fe(m, E, O), _ = !0);
|
|
1299
1299
|
}
|
|
1300
1300
|
return _;
|
|
1301
1301
|
});
|
|
1302
|
-
function
|
|
1302
|
+
function c(m, E) {
|
|
1303
1303
|
var S = E.failures, E = E.numFailures;
|
|
1304
1304
|
b += m - E;
|
|
1305
|
-
for (var O = 0, k =
|
|
1305
|
+
for (var O = 0, k = K(S); O < k.length; O++) {
|
|
1306
1306
|
var I = k[O];
|
|
1307
1307
|
y.push(S[I]);
|
|
1308
1308
|
}
|
|
@@ -1312,22 +1312,22 @@ var Rr = { exports: {} };
|
|
|
1312
1312
|
function _(S) {
|
|
1313
1313
|
var E = Math.min(d, m.length - S);
|
|
1314
1314
|
return p.getMany({ trans: r, keys: m.slice(S, S + E), cache: "immutable" }).then(function(O) {
|
|
1315
|
-
for (var k = [], I = [],
|
|
1316
|
-
var L = O[
|
|
1317
|
-
s.call(F, F.value, F) !== !1 && (F.value == null ? T.push(m[S +
|
|
1315
|
+
for (var k = [], I = [], A = v ? [] : null, T = [], C = 0; C < E; ++C) {
|
|
1316
|
+
var L = O[C], F = { value: Ae(L), primKey: m[S + C] };
|
|
1317
|
+
s.call(F, F.value, F) !== !1 && (F.value == null ? T.push(m[S + C]) : v || z(l(L), l(F.value)) === 0 ? (I.push(F.value), v && A.push(m[S + C])) : (T.push(m[S + C]), k.push(F.value)));
|
|
1318
1318
|
}
|
|
1319
1319
|
var Y = qe(n) && n.limit === 1 / 0 && (typeof e != "function" || e === gn) && { index: n.index, range: n.range };
|
|
1320
|
-
return Promise.resolve(0 < k.length && p.mutate({ trans: r, type: "add", values: k }).then(function(
|
|
1321
|
-
for (var Q in
|
|
1320
|
+
return Promise.resolve(0 < k.length && p.mutate({ trans: r, type: "add", values: k }).then(function(U) {
|
|
1321
|
+
for (var Q in U.failures)
|
|
1322
1322
|
T.splice(parseInt(Q), 1);
|
|
1323
|
-
|
|
1323
|
+
c(k.length, U);
|
|
1324
1324
|
})).then(function() {
|
|
1325
|
-
return (0 < I.length || Y && typeof e == "object") && p.mutate({ trans: r, type: "put", keys:
|
|
1326
|
-
return
|
|
1325
|
+
return (0 < I.length || Y && typeof e == "object") && p.mutate({ trans: r, type: "put", keys: A, values: I, criteria: Y, changeSpec: typeof e != "function" && e }).then(function(U) {
|
|
1326
|
+
return c(I.length, U);
|
|
1327
1327
|
});
|
|
1328
1328
|
}).then(function() {
|
|
1329
|
-
return (0 < T.length || Y && e === gn) && p.mutate({ trans: r, type: "delete", keys: T, criteria: Y }).then(function(
|
|
1330
|
-
return
|
|
1329
|
+
return (0 < T.length || Y && e === gn) && p.mutate({ trans: r, type: "delete", keys: T, criteria: Y }).then(function(U) {
|
|
1330
|
+
return c(T.length, U);
|
|
1331
1331
|
});
|
|
1332
1332
|
}).then(function() {
|
|
1333
1333
|
return m.length > S + E && _(S + d);
|
|
@@ -1347,10 +1347,10 @@ var Rr = { exports: {} };
|
|
|
1347
1347
|
var r = e.table.core.schema.primaryKey, o = t;
|
|
1348
1348
|
return e.table.core.count({ trans: n, query: { index: r, range: o } }).then(function(a) {
|
|
1349
1349
|
return e.table.core.mutate({ trans: n, type: "deleteRange", range: o }).then(function(s) {
|
|
1350
|
-
var
|
|
1350
|
+
var c = s.failures;
|
|
1351
1351
|
if (s.lastResult, s.results, s = s.numFailures, s)
|
|
1352
|
-
throw new _t("Could not delete some values", Object.keys(
|
|
1353
|
-
return
|
|
1352
|
+
throw new _t("Could not delete some values", Object.keys(c).map(function(p) {
|
|
1353
|
+
return c[p];
|
|
1354
1354
|
}), a - s);
|
|
1355
1355
|
return a - s;
|
|
1356
1356
|
});
|
|
@@ -1376,8 +1376,8 @@ var Rr = { exports: {} };
|
|
|
1376
1376
|
return hr("");
|
|
1377
1377
|
}).limit(0);
|
|
1378
1378
|
}
|
|
1379
|
-
function
|
|
1380
|
-
var o, a, s,
|
|
1379
|
+
function jt(e, t, n, r) {
|
|
1380
|
+
var o, a, s, c, p, f, v, l = n.length;
|
|
1381
1381
|
if (!n.every(function(b) {
|
|
1382
1382
|
return typeof b == "string";
|
|
1383
1383
|
}))
|
|
@@ -1397,14 +1397,14 @@ var Rr = { exports: {} };
|
|
|
1397
1397
|
}).sort(function(m, _) {
|
|
1398
1398
|
return s(m.lower, _.lower);
|
|
1399
1399
|
});
|
|
1400
|
-
|
|
1400
|
+
c = w.map(function(m) {
|
|
1401
1401
|
return m.upper;
|
|
1402
1402
|
}), p = w.map(function(m) {
|
|
1403
1403
|
return m.lower;
|
|
1404
1404
|
}), v = (f = b) === "next" ? "" : r;
|
|
1405
1405
|
}
|
|
1406
1406
|
d("next"), e = new e.Collection(e, function() {
|
|
1407
|
-
return Re(
|
|
1407
|
+
return Re(c[0], p[l - 1] + r);
|
|
1408
1408
|
}), e._ondirectionchange = function(b) {
|
|
1409
1409
|
d(b);
|
|
1410
1410
|
};
|
|
@@ -1417,15 +1417,15 @@ var Rr = { exports: {} };
|
|
|
1417
1417
|
if (t(S, p, y))
|
|
1418
1418
|
return !0;
|
|
1419
1419
|
for (var E = null, O = y; O < l; ++O) {
|
|
1420
|
-
var k = function(I,
|
|
1421
|
-
for (var Y = Math.min(I.length,
|
|
1422
|
-
var le =
|
|
1423
|
-
if (le !==
|
|
1424
|
-
return L(I[Q], T[Q]) < 0 ? I.substr(0, Q) + T[Q] + T.substr(Q + 1) : L(I[Q],
|
|
1425
|
-
L(I[Q], le) < 0 && (
|
|
1420
|
+
var k = function(I, A, T, C, L, F) {
|
|
1421
|
+
for (var Y = Math.min(I.length, C.length), U = -1, Q = 0; Q < Y; ++Q) {
|
|
1422
|
+
var le = A[Q];
|
|
1423
|
+
if (le !== C[Q])
|
|
1424
|
+
return L(I[Q], T[Q]) < 0 ? I.substr(0, Q) + T[Q] + T.substr(Q + 1) : L(I[Q], C[Q]) < 0 ? I.substr(0, Q) + C[Q] + T.substr(Q + 1) : 0 <= U ? I.substr(0, U) + A[U] + T.substr(U + 1) : null;
|
|
1425
|
+
L(I[Q], le) < 0 && (U = Q);
|
|
1426
1426
|
}
|
|
1427
|
-
return Y <
|
|
1428
|
-
}(_, S,
|
|
1427
|
+
return Y < C.length && F === "next" ? I + T.substr(I.length) : Y < I.length && F === "prev" ? I.substr(0, T.length) : U < 0 ? null : I.substr(0, U) + C[U] + T.substr(U + 1);
|
|
1428
|
+
}(_, S, c[O], p[O], s, f);
|
|
1429
1429
|
k === null && E === null ? y = O + 1 : (E === null || 0 < s(E, k)) && (E = k);
|
|
1430
1430
|
}
|
|
1431
1431
|
return w(E !== null ? function() {
|
|
@@ -1473,21 +1473,21 @@ var Rr = { exports: {} };
|
|
|
1473
1473
|
}, re.prototype.startsWith = function(e) {
|
|
1474
1474
|
return typeof e != "string" ? ce(this, or) : this.between(e, e + Ge, !0, !0);
|
|
1475
1475
|
}, re.prototype.startsWithIgnoreCase = function(e) {
|
|
1476
|
-
return e === "" ? this.startsWith(e) :
|
|
1476
|
+
return e === "" ? this.startsWith(e) : jt(this, function(t, n) {
|
|
1477
1477
|
return t.indexOf(n[0]) === 0;
|
|
1478
1478
|
}, [e], Ge);
|
|
1479
1479
|
}, re.prototype.equalsIgnoreCase = function(e) {
|
|
1480
|
-
return
|
|
1480
|
+
return jt(this, function(t, n) {
|
|
1481
1481
|
return t === n[0];
|
|
1482
1482
|
}, [e], "");
|
|
1483
1483
|
}, re.prototype.anyOfIgnoreCase = function() {
|
|
1484
1484
|
var e = we.apply(Ye, arguments);
|
|
1485
|
-
return e.length === 0 ? et(this) :
|
|
1485
|
+
return e.length === 0 ? et(this) : jt(this, function(t, n) {
|
|
1486
1486
|
return n.indexOf(t) !== -1;
|
|
1487
1487
|
}, e, "");
|
|
1488
1488
|
}, re.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
1489
1489
|
var e = we.apply(Ye, arguments);
|
|
1490
|
-
return e.length === 0 ? et(this) :
|
|
1490
|
+
return e.length === 0 ? et(this) : jt(this, function(t, n) {
|
|
1491
1491
|
return n.some(function(r) {
|
|
1492
1492
|
return t.indexOf(r) === 0;
|
|
1493
1493
|
});
|
|
@@ -1508,10 +1508,10 @@ var Rr = { exports: {} };
|
|
|
1508
1508
|
n = a === "next" ? e._ascending : e._descending, t.sort(n);
|
|
1509
1509
|
};
|
|
1510
1510
|
var o = 0;
|
|
1511
|
-
return r._addAlgorithm(function(a, s,
|
|
1511
|
+
return r._addAlgorithm(function(a, s, c) {
|
|
1512
1512
|
for (var p = a.key; 0 < n(p, t[o]); )
|
|
1513
1513
|
if (++o === t.length)
|
|
1514
|
-
return s(
|
|
1514
|
+
return s(c), !1;
|
|
1515
1515
|
return n(p, t[o]) === 0 || (s(function() {
|
|
1516
1516
|
a.continue(t[o]);
|
|
1517
1517
|
}), !1);
|
|
@@ -1532,7 +1532,7 @@ var Rr = { exports: {} };
|
|
|
1532
1532
|
}, null);
|
|
1533
1533
|
return t.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(t, { includeLowers: !1, includeUppers: !1 });
|
|
1534
1534
|
}, re.prototype.inAnyRange = function(_, t) {
|
|
1535
|
-
var n = this, r = this._cmp, o = this._ascending, a = this._descending, s = this._min,
|
|
1535
|
+
var n = this, r = this._cmp, o = this._ascending, a = this._descending, s = this._min, c = this._max;
|
|
1536
1536
|
if (_.length === 0)
|
|
1537
1537
|
return et(this);
|
|
1538
1538
|
if (!_.every(function(S) {
|
|
@@ -1548,7 +1548,7 @@ var Rr = { exports: {} };
|
|
|
1548
1548
|
for (var O = 0, k = S.length; O < k; ++O) {
|
|
1549
1549
|
var I = S[O];
|
|
1550
1550
|
if (r(E[0], I[1]) < 0 && 0 < r(E[1], I[0])) {
|
|
1551
|
-
I[0] = s(I[0], E[0]), I[1] =
|
|
1551
|
+
I[0] = s(I[0], E[0]), I[1] = c(I[1], E[1]);
|
|
1552
1552
|
break;
|
|
1553
1553
|
}
|
|
1554
1554
|
}
|
|
@@ -1597,10 +1597,10 @@ var Rr = { exports: {} };
|
|
|
1597
1597
|
e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
|
|
1598
1598
|
}
|
|
1599
1599
|
var pt = "storagemutated", yn = "x-storagemutated-1", Te = ft(null, pt), ai = (me.prototype._lock = function() {
|
|
1600
|
-
return rt(!
|
|
1600
|
+
return rt(!B.global), ++this._reculock, this._reculock !== 1 || B.global || (B.lockOwnerFor = this), this;
|
|
1601
1601
|
}, me.prototype._unlock = function() {
|
|
1602
|
-
if (rt(!
|
|
1603
|
-
for (
|
|
1602
|
+
if (rt(!B.global), --this._reculock == 0)
|
|
1603
|
+
for (B.global || (B.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked(); ) {
|
|
1604
1604
|
var e = this._blockedFuncs.shift();
|
|
1605
1605
|
try {
|
|
1606
1606
|
Le(e[1], e[0]);
|
|
@@ -1609,7 +1609,7 @@ var Rr = { exports: {} };
|
|
|
1609
1609
|
}
|
|
1610
1610
|
return this;
|
|
1611
1611
|
}, me.prototype._locked = function() {
|
|
1612
|
-
return this._reculock &&
|
|
1612
|
+
return this._reculock && B.lockOwnerFor !== this;
|
|
1613
1613
|
}, me.prototype.create = function(e) {
|
|
1614
1614
|
var t = this;
|
|
1615
1615
|
if (!this.mode)
|
|
@@ -1640,31 +1640,31 @@ var Rr = { exports: {} };
|
|
|
1640
1640
|
if (!this.active)
|
|
1641
1641
|
return q(new G.TransactionInactive());
|
|
1642
1642
|
if (this._locked())
|
|
1643
|
-
return new
|
|
1643
|
+
return new M(function(a, s) {
|
|
1644
1644
|
r._blockedFuncs.push([function() {
|
|
1645
1645
|
r._promise(e, t, n).then(a, s);
|
|
1646
|
-
},
|
|
1646
|
+
}, B]);
|
|
1647
1647
|
});
|
|
1648
1648
|
if (n)
|
|
1649
1649
|
return Pe(function() {
|
|
1650
|
-
var a = new
|
|
1650
|
+
var a = new M(function(s, c) {
|
|
1651
1651
|
r._lock();
|
|
1652
|
-
var p = t(s,
|
|
1653
|
-
p && p.then && p.then(s,
|
|
1652
|
+
var p = t(s, c, r);
|
|
1653
|
+
p && p.then && p.then(s, c);
|
|
1654
1654
|
});
|
|
1655
1655
|
return a.finally(function() {
|
|
1656
1656
|
return r._unlock();
|
|
1657
1657
|
}), a._lib = !0, a;
|
|
1658
1658
|
});
|
|
1659
|
-
var o = new
|
|
1660
|
-
var
|
|
1661
|
-
|
|
1659
|
+
var o = new M(function(a, s) {
|
|
1660
|
+
var c = t(a, s, r);
|
|
1661
|
+
c && c.then && c.then(a, s);
|
|
1662
1662
|
});
|
|
1663
1663
|
return o._lib = !0, o;
|
|
1664
1664
|
}, me.prototype._root = function() {
|
|
1665
1665
|
return this.parent ? this.parent._root() : this;
|
|
1666
1666
|
}, me.prototype.waitFor = function(e) {
|
|
1667
|
-
var t, n = this._root(), r =
|
|
1667
|
+
var t, n = this._root(), r = M.resolve(e);
|
|
1668
1668
|
n._waitingFor ? n._waitingFor = n._waitingFor.then(function() {
|
|
1669
1669
|
return r;
|
|
1670
1670
|
}) : (n._waitingFor = r, n._waitingQueue = [], t = n.idbtrans.objectStore(n.storeNames[0]), function a() {
|
|
@@ -1673,11 +1673,11 @@ var Rr = { exports: {} };
|
|
|
1673
1673
|
n._waitingFor && (t.get(-1 / 0).onsuccess = a);
|
|
1674
1674
|
}());
|
|
1675
1675
|
var o = n._waitingFor;
|
|
1676
|
-
return new
|
|
1677
|
-
r.then(function(
|
|
1678
|
-
return n._waitingQueue.push(J(a.bind(null,
|
|
1679
|
-
}, function(
|
|
1680
|
-
return n._waitingQueue.push(J(s.bind(null,
|
|
1676
|
+
return new M(function(a, s) {
|
|
1677
|
+
r.then(function(c) {
|
|
1678
|
+
return n._waitingQueue.push(J(a.bind(null, c)));
|
|
1679
|
+
}, function(c) {
|
|
1680
|
+
return n._waitingQueue.push(J(s.bind(null, c)));
|
|
1681
1681
|
}).finally(function() {
|
|
1682
1682
|
n._waitingFor === o && (n._waitingFor = null);
|
|
1683
1683
|
});
|
|
@@ -1753,8 +1753,8 @@ var Rr = { exports: {} };
|
|
|
1753
1753
|
var m = w.trans, _ = w.type, S = w.keys, E = w.values, O = w.range;
|
|
1754
1754
|
return new Promise(function(k, I) {
|
|
1755
1755
|
k = J(k);
|
|
1756
|
-
var
|
|
1757
|
-
if (!
|
|
1756
|
+
var A = m.objectStore(b), T = A.keyPath == null, C = _ === "put" || _ === "add";
|
|
1757
|
+
if (!C && _ !== "delete" && _ !== "deleteRange")
|
|
1758
1758
|
throw new Error("Invalid operation type: " + _);
|
|
1759
1759
|
var L, F = (S || E || { length: 1 }).length;
|
|
1760
1760
|
if (S && E && S.length !== E.length)
|
|
@@ -1764,24 +1764,24 @@ var Rr = { exports: {} };
|
|
|
1764
1764
|
function Y(ue) {
|
|
1765
1765
|
++le, ht(ue);
|
|
1766
1766
|
}
|
|
1767
|
-
var
|
|
1767
|
+
var U = [], Q = [], le = 0;
|
|
1768
1768
|
if (_ === "deleteRange") {
|
|
1769
1769
|
if (O.type === 4)
|
|
1770
1770
|
return k({ numFailures: le, failures: Q, results: [], lastResult: void 0 });
|
|
1771
|
-
O.type === 3 ?
|
|
1771
|
+
O.type === 3 ? U.push(L = A.clear()) : U.push(L = A.delete(r(O)));
|
|
1772
1772
|
} else {
|
|
1773
|
-
var T =
|
|
1774
|
-
if (
|
|
1773
|
+
var T = C ? T ? [E, S] : [E, null] : [S, null], $ = T[0], Ee = T[1];
|
|
1774
|
+
if (C)
|
|
1775
1775
|
for (var ae = 0; ae < F; ++ae)
|
|
1776
|
-
|
|
1776
|
+
U.push(L = Ee && Ee[ae] !== void 0 ? A[_]($[ae], Ee[ae]) : A[_]($[ae])), L.onerror = Y;
|
|
1777
1777
|
else
|
|
1778
1778
|
for (ae = 0; ae < F; ++ae)
|
|
1779
|
-
|
|
1779
|
+
U.push(L = A[_]($[ae])), L.onerror = Y;
|
|
1780
1780
|
}
|
|
1781
1781
|
function Qt(ue) {
|
|
1782
|
-
ue = ue.target.result,
|
|
1782
|
+
ue = ue.target.result, U.forEach(function(We, Nn) {
|
|
1783
1783
|
return We.error != null && (Q[Nn] = We.error);
|
|
1784
|
-
}), k({ numFailures: le, failures: Q, results: _ === "delete" ? S :
|
|
1784
|
+
}), k({ numFailures: le, failures: Q, results: _ === "delete" ? S : U.map(function(We) {
|
|
1785
1785
|
return We.result;
|
|
1786
1786
|
}), lastResult: ue });
|
|
1787
1787
|
}
|
|
@@ -1793,11 +1793,11 @@ var Rr = { exports: {} };
|
|
|
1793
1793
|
var m = w.trans, _ = w.keys;
|
|
1794
1794
|
return new Promise(function(S, E) {
|
|
1795
1795
|
S = J(S);
|
|
1796
|
-
for (var O, k = m.objectStore(b), I = _.length,
|
|
1797
|
-
|
|
1796
|
+
for (var O, k = m.objectStore(b), I = _.length, A = new Array(I), T = 0, C = 0, L = function(U) {
|
|
1797
|
+
U = U.target, A[U._pos] = U.result, ++C === T && S(A);
|
|
1798
1798
|
}, F = ye(E), Y = 0; Y < I; ++Y)
|
|
1799
1799
|
_[Y] != null && ((O = k.get(_[Y]))._pos = Y, O.onsuccess = L, O.onerror = F, ++T);
|
|
1800
|
-
T === 0 && S(
|
|
1800
|
+
T === 0 && S(A);
|
|
1801
1801
|
});
|
|
1802
1802
|
}, get: function(w) {
|
|
1803
1803
|
var m = w.trans, _ = w.key;
|
|
@@ -1811,12 +1811,12 @@ var Rr = { exports: {} };
|
|
|
1811
1811
|
}, query: (y = f, function(w) {
|
|
1812
1812
|
return new Promise(function(m, _) {
|
|
1813
1813
|
m = J(m);
|
|
1814
|
-
var S, E, O, T = w.trans, k = w.values, I = w.limit, L = w.query,
|
|
1814
|
+
var S, E, O, T = w.trans, k = w.values, I = w.limit, L = w.query, A = I === 1 / 0 ? void 0 : I, C = L.index, L = L.range, T = T.objectStore(b), C = C.isPrimaryKey ? T : T.index(C.name), L = r(L);
|
|
1815
1815
|
if (I === 0)
|
|
1816
1816
|
return m({ result: [] });
|
|
1817
|
-
y ? ((
|
|
1817
|
+
y ? ((A = k ? C.getAll(L, A) : C.getAllKeys(L, A)).onsuccess = function(F) {
|
|
1818
1818
|
return m({ result: F.target.result });
|
|
1819
|
-
},
|
|
1819
|
+
}, A.onerror = ye(_)) : (S = 0, E = !k && "openKeyCursor" in C ? C.openKeyCursor(L) : C.openCursor(L), O = [], E.onsuccess = function(F) {
|
|
1820
1820
|
var Y = E.result;
|
|
1821
1821
|
return Y ? (O.push(k ? Y.value : Y.primaryKey), ++S === I ? m({ result: O }) : void Y.continue()) : m({ result: O });
|
|
1822
1822
|
}, E.onerror = ye(_));
|
|
@@ -1825,55 +1825,55 @@ var Rr = { exports: {} };
|
|
|
1825
1825
|
var m = w.trans, _ = w.values, S = w.query, E = w.reverse, O = w.unique;
|
|
1826
1826
|
return new Promise(function(k, I) {
|
|
1827
1827
|
k = J(k);
|
|
1828
|
-
var
|
|
1828
|
+
var C = S.index, A = S.range, T = m.objectStore(b), T = C.isPrimaryKey ? T : T.index(C.name), C = E ? O ? "prevunique" : "prev" : O ? "nextunique" : "next", L = !_ && "openKeyCursor" in T ? T.openKeyCursor(r(A), C) : T.openCursor(r(A), C);
|
|
1829
1829
|
L.onerror = ye(I), L.onsuccess = J(function(F) {
|
|
1830
|
-
var Y,
|
|
1831
|
-
|
|
1830
|
+
var Y, U, Q, le, $ = L.result;
|
|
1831
|
+
$ ? ($.___id = ++si, $.done = !1, Y = $.continue.bind($), U = (U = $.continuePrimaryKey) && U.bind($), Q = $.advance.bind($), le = function() {
|
|
1832
1832
|
throw new Error("Cursor not stopped");
|
|
1833
|
-
},
|
|
1833
|
+
}, $.trans = m, $.stop = $.continue = $.continuePrimaryKey = $.advance = function() {
|
|
1834
1834
|
throw new Error("Cursor not started");
|
|
1835
|
-
},
|
|
1835
|
+
}, $.fail = J(I), $.next = function() {
|
|
1836
1836
|
var Ee = this, ae = 1;
|
|
1837
1837
|
return this.start(function() {
|
|
1838
1838
|
return ae-- ? Ee.continue() : Ee.stop();
|
|
1839
1839
|
}).then(function() {
|
|
1840
1840
|
return Ee;
|
|
1841
1841
|
});
|
|
1842
|
-
},
|
|
1842
|
+
}, $.start = function(Ee) {
|
|
1843
1843
|
function ae() {
|
|
1844
1844
|
if (L.result)
|
|
1845
1845
|
try {
|
|
1846
1846
|
Ee();
|
|
1847
1847
|
} catch (ue) {
|
|
1848
|
-
|
|
1848
|
+
$.fail(ue);
|
|
1849
1849
|
}
|
|
1850
1850
|
else
|
|
1851
|
-
|
|
1851
|
+
$.done = !0, $.start = function() {
|
|
1852
1852
|
throw new Error("Cursor behind last entry");
|
|
1853
|
-
},
|
|
1853
|
+
}, $.stop();
|
|
1854
1854
|
}
|
|
1855
1855
|
var Qt = new Promise(function(ue, We) {
|
|
1856
|
-
ue = J(ue), L.onerror = ye(We),
|
|
1857
|
-
|
|
1856
|
+
ue = J(ue), L.onerror = ye(We), $.fail = We, $.stop = function(Nn) {
|
|
1857
|
+
$.stop = $.continue = $.continuePrimaryKey = $.advance = le, ue(Nn);
|
|
1858
1858
|
};
|
|
1859
1859
|
});
|
|
1860
1860
|
return L.onsuccess = J(function(ue) {
|
|
1861
1861
|
L.onsuccess = ae, ae();
|
|
1862
|
-
}),
|
|
1863
|
-
}, k(
|
|
1862
|
+
}), $.continue = Y, $.continuePrimaryKey = U, $.advance = Q, ae(), Qt;
|
|
1863
|
+
}, k($)) : k(null);
|
|
1864
1864
|
}, I);
|
|
1865
1865
|
});
|
|
1866
1866
|
}, count: function(w) {
|
|
1867
1867
|
var m = w.query, _ = w.trans, S = m.index, E = m.range;
|
|
1868
1868
|
return new Promise(function(O, k) {
|
|
1869
|
-
var I = _.objectStore(b),
|
|
1870
|
-
|
|
1869
|
+
var I = _.objectStore(b), A = S.isPrimaryKey ? I : I.index(S.name), I = r(E), A = I ? A.count(I) : A.count();
|
|
1870
|
+
A.onsuccess = J(function(T) {
|
|
1871
1871
|
return O(T.target.result);
|
|
1872
|
-
}),
|
|
1872
|
+
}), A.onerror = ye(k);
|
|
1873
1873
|
});
|
|
1874
1874
|
} };
|
|
1875
1875
|
}
|
|
1876
|
-
var a, s,
|
|
1876
|
+
var a, s, c, v = (s = p, c = yr((a = e).objectStoreNames), { schema: { name: a.name, tables: c.map(function(d) {
|
|
1877
1877
|
return s.objectStore(d);
|
|
1878
1878
|
}).map(function(d) {
|
|
1879
1879
|
var y = d.keyPath, m = d.autoIncrement, b = N(y), w = {}, m = { name: d.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: y == null, compound: b, keyPath: y, autoIncrement: m, unique: !0, extractKey: vn(y) }, indexes: yr(d.indexNames).map(function(_) {
|
|
@@ -1885,7 +1885,7 @@ var Rr = { exports: {} };
|
|
|
1885
1885
|
return w[yt(_)];
|
|
1886
1886
|
} };
|
|
1887
1887
|
return w[":id"] = m.primaryKey, y != null && (w[yt(y)] = m.primaryKey), m;
|
|
1888
|
-
}) }, hasGetAll: 0 <
|
|
1888
|
+
}) }, hasGetAll: 0 < c.length && "getAll" in s.objectStore(c[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), p = v.schema, f = v.hasGetAll, v = p.tables.map(o), l = {};
|
|
1889
1889
|
return v.forEach(function(d) {
|
|
1890
1890
|
return l[d.name] = d;
|
|
1891
1891
|
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(d) {
|
|
@@ -1913,10 +1913,10 @@ var Rr = { exports: {} };
|
|
|
1913
1913
|
n.forEach(function(o) {
|
|
1914
1914
|
var a = r[o];
|
|
1915
1915
|
t.forEach(function(s) {
|
|
1916
|
-
var
|
|
1916
|
+
var c = function p(f, v) {
|
|
1917
1917
|
return Gr(f, v) || (f = te(f)) && p(f, v);
|
|
1918
1918
|
}(s, o);
|
|
1919
|
-
(!
|
|
1919
|
+
(!c || "value" in c && c.value === void 0) && (s === e.Transaction.prototype || s instanceof e.Transaction ? ke(s, o, { get: function() {
|
|
1920
1920
|
return this.table(o);
|
|
1921
1921
|
}, set: function(p) {
|
|
1922
1922
|
zn(this, o, { value: p, writable: !0, configurable: !0, enumerable: !0 });
|
|
@@ -1938,11 +1938,11 @@ var Rr = { exports: {} };
|
|
|
1938
1938
|
n.objectStoreNames.contains("$meta") && !o.$meta && (o.$meta = bn("$meta", br("")[0], []), e._storeNames.push("$meta"));
|
|
1939
1939
|
var a = e._createTransaction("readwrite", e._storeNames, o);
|
|
1940
1940
|
a.create(n), a._completion.catch(r);
|
|
1941
|
-
var s = a._reject.bind(a),
|
|
1941
|
+
var s = a._reject.bind(a), c = B.transless || B;
|
|
1942
1942
|
Pe(function() {
|
|
1943
|
-
return
|
|
1943
|
+
return B.trans = a, B.transless = c, t !== 0 ? (Kt(e, n), f = t, ((p = a).storeNames.includes("$meta") ? p.table("$meta").get("version").then(function(v) {
|
|
1944
1944
|
return v ?? f;
|
|
1945
|
-
}) :
|
|
1945
|
+
}) : M.resolve(f)).then(function(v) {
|
|
1946
1946
|
return d = v, y = a, b = n, w = [], v = (l = e)._versions, m = l._dbSchema = Lt(0, l.idbdb, b), (v = v.filter(function(_) {
|
|
1947
1947
|
return _._cfg.version >= d;
|
|
1948
1948
|
})).length !== 0 ? (v.forEach(function(_) {
|
|
@@ -1950,17 +1950,17 @@ var Rr = { exports: {} };
|
|
|
1950
1950
|
var S = m, E = _._cfg.dbschema;
|
|
1951
1951
|
Gt(l, S, b), Gt(l, E, b), m = l._dbSchema = E;
|
|
1952
1952
|
var O = _n(S, E);
|
|
1953
|
-
O.add.forEach(function(
|
|
1954
|
-
Sn(b,
|
|
1955
|
-
}), O.change.forEach(function(
|
|
1956
|
-
if (
|
|
1953
|
+
O.add.forEach(function(C) {
|
|
1954
|
+
Sn(b, C[0], C[1].primKey, C[1].indexes);
|
|
1955
|
+
}), O.change.forEach(function(C) {
|
|
1956
|
+
if (C.recreate)
|
|
1957
1957
|
throw new G.Upgrade("Not yet support for changing primary key");
|
|
1958
|
-
var L = b.objectStore(
|
|
1959
|
-
|
|
1958
|
+
var L = b.objectStore(C.name);
|
|
1959
|
+
C.add.forEach(function(F) {
|
|
1960
1960
|
return Nt(L, F);
|
|
1961
|
-
}),
|
|
1961
|
+
}), C.change.forEach(function(F) {
|
|
1962
1962
|
L.deleteIndex(F.name), Nt(L, F);
|
|
1963
|
-
}),
|
|
1963
|
+
}), C.del.forEach(function(F) {
|
|
1964
1964
|
return L.deleteIndex(F);
|
|
1965
1965
|
});
|
|
1966
1966
|
});
|
|
@@ -1968,15 +1968,15 @@ var Rr = { exports: {} };
|
|
|
1968
1968
|
if (k && _._cfg.version > d) {
|
|
1969
1969
|
Kt(l, b), y._memoizedTables = {};
|
|
1970
1970
|
var I = Qn(E);
|
|
1971
|
-
O.del.forEach(function(
|
|
1972
|
-
I[
|
|
1973
|
-
}), wn(l, [l.Transaction.prototype]), Bt(l, [l.Transaction.prototype],
|
|
1974
|
-
var
|
|
1975
|
-
return T && Je(), O =
|
|
1976
|
-
var
|
|
1977
|
-
(
|
|
1978
|
-
}),
|
|
1979
|
-
return
|
|
1971
|
+
O.del.forEach(function(C) {
|
|
1972
|
+
I[C] = S[C];
|
|
1973
|
+
}), wn(l, [l.Transaction.prototype]), Bt(l, [l.Transaction.prototype], K(I), I), y.schema = I;
|
|
1974
|
+
var A, T = qt(k);
|
|
1975
|
+
return T && Je(), O = M.follow(function() {
|
|
1976
|
+
var C;
|
|
1977
|
+
(A = k(y)) && T && (C = Ce.bind(null, null), A.then(C, C));
|
|
1978
|
+
}), A && typeof A.then == "function" ? M.resolve(A) : O.then(function() {
|
|
1979
|
+
return A;
|
|
1980
1980
|
});
|
|
1981
1981
|
}
|
|
1982
1982
|
}), w.push(function(S) {
|
|
@@ -1990,14 +1990,14 @@ var Rr = { exports: {} };
|
|
|
1990
1990
|
})) : S.objectStore("$meta").put(_._cfg.version, "version"));
|
|
1991
1991
|
});
|
|
1992
1992
|
}), function _() {
|
|
1993
|
-
return w.length ?
|
|
1993
|
+
return w.length ? M.resolve(w.shift()(y.idbtrans)).then(_) : M.resolve();
|
|
1994
1994
|
}().then(function() {
|
|
1995
1995
|
mr(m, b);
|
|
1996
|
-
})) :
|
|
1996
|
+
})) : M.resolve();
|
|
1997
1997
|
var l, d, y, b, w, m;
|
|
1998
|
-
}).catch(s)) : (
|
|
1998
|
+
}).catch(s)) : (K(o).forEach(function(v) {
|
|
1999
1999
|
Sn(n, v, o[v].primKey, o[v].indexes);
|
|
2000
|
-
}), Kt(e, n), void
|
|
2000
|
+
}), Kt(e, n), void M.follow(function() {
|
|
2001
2001
|
return e.on.populate.fire(a);
|
|
2002
2002
|
}).catch(s));
|
|
2003
2003
|
var p, f;
|
|
@@ -2011,9 +2011,9 @@ var Rr = { exports: {} };
|
|
|
2011
2011
|
var a = function(s) {
|
|
2012
2012
|
if (s.change.length || s.recreate)
|
|
2013
2013
|
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 };
|
|
2014
|
-
var
|
|
2014
|
+
var c = t.objectStore(s.name);
|
|
2015
2015
|
s.add.forEach(function(p) {
|
|
2016
|
-
pe && console.debug("Dexie upgrade patch: Creating missing index ".concat(s.name, ".").concat(p.src)), Nt(
|
|
2016
|
+
pe && console.debug("Dexie upgrade patch: Creating missing index ".concat(s.name, ".").concat(p.src)), Nt(c, p);
|
|
2017
2017
|
});
|
|
2018
2018
|
}(o[r]);
|
|
2019
2019
|
if (typeof a == "object")
|
|
@@ -2031,11 +2031,11 @@ var Rr = { exports: {} };
|
|
|
2031
2031
|
if ("" + (o.primKey.keyPath || "") != "" + (a.primKey.keyPath || "") || o.primKey.auto !== a.primKey.auto)
|
|
2032
2032
|
s.recreate = !0, r.change.push(s);
|
|
2033
2033
|
else {
|
|
2034
|
-
var
|
|
2035
|
-
for (f in
|
|
2034
|
+
var c = o.idxByName, p = a.idxByName, f = void 0;
|
|
2035
|
+
for (f in c)
|
|
2036
2036
|
p[f] || s.del.push(f);
|
|
2037
2037
|
for (f in p) {
|
|
2038
|
-
var v =
|
|
2038
|
+
var v = c[f], l = p[f];
|
|
2039
2039
|
v ? v.src !== l.src && s.change.push(l) : s.add.push(l);
|
|
2040
2040
|
}
|
|
2041
2041
|
(0 < s.del.length || 0 < s.add.length || 0 < s.change.length) && r.change.push(s);
|
|
@@ -2052,7 +2052,7 @@ var Rr = { exports: {} };
|
|
|
2052
2052
|
}), o;
|
|
2053
2053
|
}
|
|
2054
2054
|
function mr(e, t) {
|
|
2055
|
-
|
|
2055
|
+
K(e).forEach(function(n) {
|
|
2056
2056
|
t.db.objectStoreNames.contains(n) || (pe && console.debug("Dexie: Creating missing table", n), Sn(t, n, e[n].primKey, e[n].indexes));
|
|
2057
2057
|
});
|
|
2058
2058
|
}
|
|
@@ -2062,19 +2062,19 @@ var Rr = { exports: {} };
|
|
|
2062
2062
|
function Lt(e, t, n) {
|
|
2063
2063
|
var r = {};
|
|
2064
2064
|
return wt(t.objectStoreNames, 0).forEach(function(o) {
|
|
2065
|
-
for (var a = n.objectStore(o), s = mn(gr(f = a.keyPath), f || "", !0, !1, !!a.autoIncrement, f && typeof f != "string", !0),
|
|
2065
|
+
for (var a = n.objectStore(o), s = mn(gr(f = a.keyPath), f || "", !0, !1, !!a.autoIncrement, f && typeof f != "string", !0), c = [], p = 0; p < a.indexNames.length; ++p) {
|
|
2066
2066
|
var v = a.index(a.indexNames[p]), f = v.keyPath, v = mn(v.name, f, !!v.unique, !!v.multiEntry, !1, f && typeof f != "string", !1);
|
|
2067
|
-
|
|
2067
|
+
c.push(v);
|
|
2068
2068
|
}
|
|
2069
|
-
r[o] = bn(o, s,
|
|
2069
|
+
r[o] = bn(o, s, c);
|
|
2070
2070
|
}), r;
|
|
2071
2071
|
}
|
|
2072
2072
|
function Gt(e, t, n) {
|
|
2073
2073
|
for (var r = n.db.objectStoreNames, o = 0; o < r.length; ++o) {
|
|
2074
2074
|
var a = r[o], s = n.objectStore(a);
|
|
2075
2075
|
e._hasGetAll = "getAll" in s;
|
|
2076
|
-
for (var
|
|
2077
|
-
var p = s.indexNames[
|
|
2076
|
+
for (var c = 0; c < s.indexNames.length; ++c) {
|
|
2077
|
+
var p = s.indexNames[c], f = s.index(p).keyPath, v = typeof f == "string" ? f : "[" + wt(f).join("+") + "]";
|
|
2078
2078
|
!t[a] || (f = t[a].idxByName[v]) && (f.name = p, delete t[a].idxByName[v], t[a].idxByName[p] = f);
|
|
2079
2079
|
}
|
|
2080
2080
|
}
|
|
@@ -2087,7 +2087,7 @@ var Rr = { exports: {} };
|
|
|
2087
2087
|
});
|
|
2088
2088
|
}
|
|
2089
2089
|
var hi = (Ft.prototype._parseStoresSpec = function(e, t) {
|
|
2090
|
-
|
|
2090
|
+
K(e).forEach(function(n) {
|
|
2091
2091
|
if (e[n] !== null) {
|
|
2092
2092
|
var r = br(e[n]), o = r.shift();
|
|
2093
2093
|
if (o.unique = !0, o.multi)
|
|
@@ -2106,7 +2106,7 @@ var Rr = { exports: {} };
|
|
|
2106
2106
|
var n = t._versions, r = {}, o = {};
|
|
2107
2107
|
return n.forEach(function(a) {
|
|
2108
2108
|
Z(r, a._cfg.storesSource), o = a._cfg.dbschema = {}, a._parseStoresSpec(r, o);
|
|
2109
|
-
}), t._dbSchema = o, wn(t, [t._allTables, t, t.Transaction.prototype]), Bt(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables],
|
|
2109
|
+
}), t._dbSchema = o, wn(t, [t._allTables, t, t.Transaction.prototype]), Bt(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], K(o), o), t._storeNames = K(o), this;
|
|
2110
2110
|
}, Ft.prototype.upgrade = function(e) {
|
|
2111
2111
|
return this._cfg.contentUpgrade = tn(this._cfg.contentUpgrade || H, e), this;
|
|
2112
2112
|
}, Ft);
|
|
@@ -2121,7 +2121,7 @@ var Rr = { exports: {} };
|
|
|
2121
2121
|
}
|
|
2122
2122
|
function xn(e) {
|
|
2123
2123
|
return Pe(function() {
|
|
2124
|
-
return
|
|
2124
|
+
return B.letThrough = !0, e();
|
|
2125
2125
|
});
|
|
2126
2126
|
}
|
|
2127
2127
|
function kn(e) {
|
|
@@ -2151,18 +2151,18 @@ var Rr = { exports: {} };
|
|
|
2151
2151
|
}
|
|
2152
2152
|
function bt(e, t) {
|
|
2153
2153
|
kn(t) || function n(r, p) {
|
|
2154
|
-
var a = p.from, s = p.to,
|
|
2155
|
-
mt(r, a, s),
|
|
2154
|
+
var a = p.from, s = p.to, c = p.l, p = p.r;
|
|
2155
|
+
mt(r, a, s), c && n(r, c), p && n(r, p);
|
|
2156
2156
|
}(e, t);
|
|
2157
2157
|
}
|
|
2158
|
-
function
|
|
2158
|
+
function $t(e, t) {
|
|
2159
2159
|
var n = An(t), r = n.next();
|
|
2160
2160
|
if (r.done)
|
|
2161
2161
|
return !1;
|
|
2162
|
-
for (var o = r.value, a = An(e), s = a.next(o.from),
|
|
2163
|
-
if (z(
|
|
2162
|
+
for (var o = r.value, a = An(e), s = a.next(o.from), c = s.value; !r.done && !s.done; ) {
|
|
2163
|
+
if (z(c.from, o.to) <= 0 && 0 <= z(c.to, o.from))
|
|
2164
2164
|
return !0;
|
|
2165
|
-
z(o.from,
|
|
2165
|
+
z(o.from, c.from) < 0 ? o = (r = n.next(c.from)).value : c = (s = a.next(o.from)).value;
|
|
2166
2166
|
}
|
|
2167
2167
|
return !1;
|
|
2168
2168
|
}
|
|
@@ -2200,19 +2200,19 @@ var Rr = { exports: {} };
|
|
|
2200
2200
|
var t = n.r, n = n.l;
|
|
2201
2201
|
return (t ? n ? Math.max(t.d, n.d) : t.d : n ? n.d : 0) + 1;
|
|
2202
2202
|
}
|
|
2203
|
-
function
|
|
2204
|
-
return
|
|
2203
|
+
function Ut(e, t) {
|
|
2204
|
+
return K(t).forEach(function(n) {
|
|
2205
2205
|
e[n] ? bt(e[n], t[n]) : e[n] = function r(o) {
|
|
2206
|
-
var a, s,
|
|
2206
|
+
var a, s, c = {};
|
|
2207
2207
|
for (a in o)
|
|
2208
|
-
ie(o, a) && (s = o[a],
|
|
2209
|
-
return
|
|
2208
|
+
ie(o, a) && (s = o[a], c[a] = !s || typeof s != "object" || Vn.has(s.constructor) ? s : r(s));
|
|
2209
|
+
return c;
|
|
2210
2210
|
}(t[n]);
|
|
2211
2211
|
}), e;
|
|
2212
2212
|
}
|
|
2213
2213
|
function Dn(e, t) {
|
|
2214
2214
|
return e.all || t.all || Object.keys(e).some(function(n) {
|
|
2215
|
-
return t[n] &&
|
|
2215
|
+
return t[n] && $t(t[n], e[n]);
|
|
2216
2216
|
});
|
|
2217
2217
|
}
|
|
2218
2218
|
xe(oe.prototype, ((de = { add: function(e) {
|
|
@@ -2227,9 +2227,9 @@ var Rr = { exports: {} };
|
|
|
2227
2227
|
} })[Zt] = function() {
|
|
2228
2228
|
return An(this);
|
|
2229
2229
|
}, de));
|
|
2230
|
-
var
|
|
2230
|
+
var $e = {}, Pn = {}, Cn = !1;
|
|
2231
2231
|
function Wt(e) {
|
|
2232
|
-
|
|
2232
|
+
Ut(Pn, e), Cn || (Cn = !0, setTimeout(function() {
|
|
2233
2233
|
Cn = !1, In(Pn, !(Pn = {}));
|
|
2234
2234
|
}, 0));
|
|
2235
2235
|
}
|
|
@@ -2237,12 +2237,12 @@ var Rr = { exports: {} };
|
|
|
2237
2237
|
t === void 0 && (t = !1);
|
|
2238
2238
|
var n = /* @__PURE__ */ new Set();
|
|
2239
2239
|
if (e.all)
|
|
2240
|
-
for (var r = 0, o = Object.values(
|
|
2240
|
+
for (var r = 0, o = Object.values($e); r < o.length; r++)
|
|
2241
2241
|
_r(s = o[r], e, n, t);
|
|
2242
2242
|
else
|
|
2243
2243
|
for (var a in e) {
|
|
2244
|
-
var s,
|
|
2245
|
-
|
|
2244
|
+
var s, c = /^idb\:\/\/(.*)\/(.*)\//.exec(a);
|
|
2245
|
+
c && (a = c[1], c = c[2], (s = $e["idb://".concat(a, "/").concat(c)]) && _r(s, e, n, t));
|
|
2246
2246
|
}
|
|
2247
2247
|
n.forEach(function(p) {
|
|
2248
2248
|
return p();
|
|
@@ -2250,7 +2250,7 @@ var Rr = { exports: {} };
|
|
|
2250
2250
|
}
|
|
2251
2251
|
function _r(e, t, n, r) {
|
|
2252
2252
|
for (var o = [], a = 0, s = Object.entries(e.queries.query); a < s.length; a++) {
|
|
2253
|
-
for (var
|
|
2253
|
+
for (var c = s[a], p = c[0], f = [], v = 0, l = c[1]; v < l.length; v++) {
|
|
2254
2254
|
var d = l[v];
|
|
2255
2255
|
Dn(t, d.obsSet) ? d.subscribers.forEach(function(m) {
|
|
2256
2256
|
return n.add(m);
|
|
@@ -2276,8 +2276,8 @@ var Rr = { exports: {} };
|
|
|
2276
2276
|
if (t.openCanceller !== r)
|
|
2277
2277
|
throw new G.DatabaseClosed("db.open() was cancelled");
|
|
2278
2278
|
}
|
|
2279
|
-
function
|
|
2280
|
-
return new
|
|
2279
|
+
function c() {
|
|
2280
|
+
return new M(function(d, y) {
|
|
2281
2281
|
if (s(), !n)
|
|
2282
2282
|
throw new G.MissingAPI();
|
|
2283
2283
|
var b = e.name, w = t.autoSchema || !o ? n.open(b) : n.open(b, o);
|
|
@@ -2293,50 +2293,50 @@ var Rr = { exports: {} };
|
|
|
2293
2293
|
var m, _, S, E, O, k = e.idbdb = w.result, I = wt(k.objectStoreNames);
|
|
2294
2294
|
if (0 < I.length)
|
|
2295
2295
|
try {
|
|
2296
|
-
var
|
|
2296
|
+
var A = k.transaction((E = I).length === 1 ? E[0] : E, "readonly");
|
|
2297
2297
|
if (t.autoSchema)
|
|
2298
|
-
_ = k, S =
|
|
2299
|
-
else if (Gt(e, e._dbSchema,
|
|
2298
|
+
_ = k, S = A, (m = e).verno = _.version / 10, S = m._dbSchema = Lt(0, _, S), m._storeNames = wt(_.objectStoreNames, 0), Bt(m, [m._allTables], K(S), S);
|
|
2299
|
+
else if (Gt(e, e._dbSchema, A), ((O = _n(Lt(0, (O = e).idbdb, A), O._dbSchema)).add.length || O.change.some(function(T) {
|
|
2300
2300
|
return T.add.length || T.change.length;
|
|
2301
2301
|
})) && !a)
|
|
2302
|
-
return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), k.close(), o = k.version + 1, a = !0, d(
|
|
2303
|
-
Kt(e,
|
|
2302
|
+
return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), k.close(), o = k.version + 1, a = !0, d(c());
|
|
2303
|
+
Kt(e, A);
|
|
2304
2304
|
} catch {
|
|
2305
2305
|
}
|
|
2306
2306
|
Ze.push(e), k.onversionchange = J(function(T) {
|
|
2307
2307
|
t.vcFired = !0, e.on("versionchange").fire(T);
|
|
2308
2308
|
}), k.onclose = J(function(T) {
|
|
2309
2309
|
e.on("close").fire(T);
|
|
2310
|
-
}), l && (O = e._deps,
|
|
2310
|
+
}), l && (O = e._deps, A = b, k = O.indexedDB, O = O.IDBKeyRange, On(k) || A === It || En(k, O).put({ name: A }).catch(H)), d();
|
|
2311
2311
|
}, y);
|
|
2312
2312
|
}).catch(function(d) {
|
|
2313
2313
|
switch (d == null ? void 0 : d.name) {
|
|
2314
2314
|
case "UnknownError":
|
|
2315
2315
|
if (0 < t.PR1398_maxLoop)
|
|
2316
|
-
return t.PR1398_maxLoop--, console.warn("Dexie: Workaround for Chrome UnknownError on open()"),
|
|
2316
|
+
return t.PR1398_maxLoop--, console.warn("Dexie: Workaround for Chrome UnknownError on open()"), c();
|
|
2317
2317
|
break;
|
|
2318
2318
|
case "VersionError":
|
|
2319
2319
|
if (0 < o)
|
|
2320
|
-
return o = 0,
|
|
2320
|
+
return o = 0, c();
|
|
2321
2321
|
}
|
|
2322
|
-
return
|
|
2322
|
+
return M.reject(d);
|
|
2323
2323
|
});
|
|
2324
2324
|
}
|
|
2325
2325
|
var p, f = t.dbReadyResolve, v = null, l = !1;
|
|
2326
|
-
return
|
|
2326
|
+
return M.race([r, (typeof navigator > "u" ? M.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(d) {
|
|
2327
2327
|
function y() {
|
|
2328
2328
|
return indexedDB.databases().finally(d);
|
|
2329
2329
|
}
|
|
2330
2330
|
p = setInterval(y, 100), y();
|
|
2331
2331
|
}).finally(function() {
|
|
2332
2332
|
return clearInterval(p);
|
|
2333
|
-
}) : Promise.resolve()).then(
|
|
2334
|
-
return s(), t.onReadyBeingFired = [],
|
|
2333
|
+
}) : Promise.resolve()).then(c)]).then(function() {
|
|
2334
|
+
return s(), t.onReadyBeingFired = [], M.resolve(xn(function() {
|
|
2335
2335
|
return e.on.ready.fire(e.vip);
|
|
2336
2336
|
})).then(function d() {
|
|
2337
2337
|
if (0 < t.onReadyBeingFired.length) {
|
|
2338
2338
|
var y = t.onReadyBeingFired.reduce(tn, H);
|
|
2339
|
-
return t.onReadyBeingFired = [],
|
|
2339
|
+
return t.onReadyBeingFired = [], M.resolve(xn(function() {
|
|
2340
2340
|
return y(e.vip);
|
|
2341
2341
|
})).then(d);
|
|
2342
2342
|
}
|
|
@@ -2370,8 +2370,8 @@ var Rr = { exports: {} };
|
|
|
2370
2370
|
});
|
|
2371
2371
|
function o(a) {
|
|
2372
2372
|
return function(p) {
|
|
2373
|
-
var
|
|
2374
|
-
return
|
|
2373
|
+
var c = a(p), p = c.value;
|
|
2374
|
+
return c.done ? p : p && typeof p.then == "function" ? p.then(n, r) : N(p) ? Promise.all(p).then(n, r) : n(p);
|
|
2375
2375
|
};
|
|
2376
2376
|
}
|
|
2377
2377
|
return o(t)();
|
|
@@ -2391,8 +2391,8 @@ var Rr = { exports: {} };
|
|
|
2391
2391
|
}), _;
|
|
2392
2392
|
}
|
|
2393
2393
|
t = s(r.primaryKey.keyPath, 0, r.primaryKey), o[":id"] = [t];
|
|
2394
|
-
for (var
|
|
2395
|
-
var f = p[
|
|
2394
|
+
for (var c = 0, p = r.indexes; c < p.length; c++) {
|
|
2395
|
+
var f = p[c];
|
|
2396
2396
|
s(f.keyPath, 0, f);
|
|
2397
2397
|
}
|
|
2398
2398
|
function v(l) {
|
|
@@ -2428,21 +2428,21 @@ var Rr = { exports: {} };
|
|
|
2428
2428
|
} });
|
|
2429
2429
|
} };
|
|
2430
2430
|
function Tn(e, t, n, r) {
|
|
2431
|
-
return n = n || {}, r = r || "",
|
|
2432
|
-
var a, s,
|
|
2433
|
-
ie(t, o) ? (a = e[o], s = t[o], typeof a == "object" && typeof s == "object" && a && s ? (
|
|
2434
|
-
}),
|
|
2431
|
+
return n = n || {}, r = r || "", K(e).forEach(function(o) {
|
|
2432
|
+
var a, s, c;
|
|
2433
|
+
ie(t, o) ? (a = e[o], s = t[o], typeof a == "object" && typeof s == "object" && a && s ? (c = Jt(a)) !== Jt(s) ? n[r + o] = t[o] : c === "Object" ? Tn(a, s, n, r + o + ".") : a !== s && (n[r + o] = t[o]) : a !== s && (n[r + o] = t[o])) : n[r + o] = void 0;
|
|
2434
|
+
}), K(t).forEach(function(o) {
|
|
2435
2435
|
ie(e, o) || (n[r + o] = t[o]);
|
|
2436
2436
|
}), n;
|
|
2437
2437
|
}
|
|
2438
|
-
function
|
|
2438
|
+
function Mn(e, t) {
|
|
2439
2439
|
return t.type === "delete" ? t.keys : t.keys || t.values.map(e.extractKey);
|
|
2440
2440
|
}
|
|
2441
2441
|
var yi = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
2442
2442
|
return h(h({}, e), { table: function(t) {
|
|
2443
2443
|
var n = e.table(t), r = n.schema.primaryKey;
|
|
2444
2444
|
return h(h({}, n), { mutate: function(o) {
|
|
2445
|
-
var a =
|
|
2445
|
+
var a = B.trans, s = a.table(t).hook, c = s.deleting, p = s.creating, f = s.updating;
|
|
2446
2446
|
switch (o.type) {
|
|
2447
2447
|
case "add":
|
|
2448
2448
|
if (p.fire === H)
|
|
@@ -2457,13 +2457,13 @@ var Rr = { exports: {} };
|
|
|
2457
2457
|
return v(o);
|
|
2458
2458
|
}, !0);
|
|
2459
2459
|
case "delete":
|
|
2460
|
-
if (
|
|
2460
|
+
if (c.fire === H)
|
|
2461
2461
|
break;
|
|
2462
2462
|
return a._promise("readwrite", function() {
|
|
2463
2463
|
return v(o);
|
|
2464
2464
|
}, !0);
|
|
2465
2465
|
case "deleteRange":
|
|
2466
|
-
if (
|
|
2466
|
+
if (c.fire === H)
|
|
2467
2467
|
break;
|
|
2468
2468
|
return a._promise("readwrite", function() {
|
|
2469
2469
|
return function l(d, y, b) {
|
|
@@ -2478,20 +2478,20 @@ var Rr = { exports: {} };
|
|
|
2478
2478
|
}
|
|
2479
2479
|
return n.mutate(o);
|
|
2480
2480
|
function v(l) {
|
|
2481
|
-
var d, y, b, w =
|
|
2481
|
+
var d, y, b, w = B.trans, m = l.keys || Mn(r, l);
|
|
2482
2482
|
if (!m)
|
|
2483
2483
|
throw new Error("Keys missing");
|
|
2484
|
-
return (l = l.type === "add" || l.type === "put" ? h(h({}, l), { keys: m }) : h({}, l)).type !== "delete" && (l.values =
|
|
2484
|
+
return (l = l.type === "add" || l.type === "put" ? h(h({}, l), { keys: m }) : h({}, l)).type !== "delete" && (l.values = P([], l.values, !0)), l.keys && (l.keys = P([], l.keys, !0)), d = n, b = m, ((y = l).type === "add" ? Promise.resolve([]) : d.getMany({ trans: y.trans, keys: b, cache: "immutable" })).then(function(_) {
|
|
2485
2485
|
var S = m.map(function(E, O) {
|
|
2486
|
-
var k, I,
|
|
2487
|
-
return l.type === "delete" ?
|
|
2488
|
-
ie(
|
|
2489
|
-
}))),
|
|
2486
|
+
var k, I, A, T = _[O], C = { onerror: null, onsuccess: null };
|
|
2487
|
+
return l.type === "delete" ? c.fire.call(C, E, T, w) : l.type === "add" || T === void 0 ? (k = p.fire.call(C, E, l.values[O], w), E == null && k != null && (l.keys[O] = E = k, r.outbound || fe(l.values[O], r.keyPath, E))) : (k = Tn(T, l.values[O]), (I = f.fire.call(C, k, E, T, w)) && (A = l.values[O], Object.keys(I).forEach(function(L) {
|
|
2488
|
+
ie(A, L) ? A[L] = I[L] : fe(A, L, I[L]);
|
|
2489
|
+
}))), C;
|
|
2490
2490
|
});
|
|
2491
2491
|
return n.mutate(l).then(function(E) {
|
|
2492
|
-
for (var O = E.failures, k = E.results, I = E.numFailures, E = E.lastResult,
|
|
2493
|
-
var T = (k || m)[
|
|
2494
|
-
T == null ?
|
|
2492
|
+
for (var O = E.failures, k = E.results, I = E.numFailures, E = E.lastResult, A = 0; A < m.length; ++A) {
|
|
2493
|
+
var T = (k || m)[A], C = S[A];
|
|
2494
|
+
T == null ? C.onerror && C.onerror(O[A]) : C.onsuccess && C.onsuccess(l.type === "put" && _[A] ? l.values[A] : T);
|
|
2495
2495
|
}
|
|
2496
2496
|
return { failures: O, results: k, numFailures: I, lastResult: E };
|
|
2497
2497
|
}).catch(function(E) {
|
|
@@ -2522,7 +2522,7 @@ var Rr = { exports: {} };
|
|
|
2522
2522
|
if (!r.cache)
|
|
2523
2523
|
return n.getMany(r);
|
|
2524
2524
|
var o = Sr(r.keys, r.trans._cache, r.cache === "clone");
|
|
2525
|
-
return o ?
|
|
2525
|
+
return o ? M.resolve(o) : n.getMany(r).then(function(a) {
|
|
2526
2526
|
return r.trans._cache = { keys: r.keys, values: r.cache === "clone" ? Ae(a) : a }, a;
|
|
2527
2527
|
});
|
|
2528
2528
|
}, mutate: function(r) {
|
|
@@ -2547,75 +2547,75 @@ var Rr = { exports: {} };
|
|
|
2547
2547
|
var bi = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2548
2548
|
var t = e.schema.name, n = new oe(e.MIN_KEY, e.MAX_KEY);
|
|
2549
2549
|
return h(h({}, e), { transaction: function(r, o, a) {
|
|
2550
|
-
if (
|
|
2551
|
-
throw new G.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(
|
|
2550
|
+
if (B.subscr && o !== "readonly")
|
|
2551
|
+
throw new G.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(B.querier));
|
|
2552
2552
|
return e.transaction(r, o, a);
|
|
2553
2553
|
}, table: function(r) {
|
|
2554
2554
|
function o(y) {
|
|
2555
2555
|
var y = (b = y.query).index, b = b.range;
|
|
2556
2556
|
return [y, new oe((y = b.lower) !== null && y !== void 0 ? y : e.MIN_KEY, (b = b.upper) !== null && b !== void 0 ? b : e.MAX_KEY)];
|
|
2557
2557
|
}
|
|
2558
|
-
var a = e.table(r), s = a.schema,
|
|
2559
|
-
function y(
|
|
2560
|
-
return
|
|
2558
|
+
var a = e.table(r), s = a.schema, c = s.primaryKey, p = c.extractKey, f = c.outbound, v = h(h({}, a), { mutate: function(d) {
|
|
2559
|
+
function y(C) {
|
|
2560
|
+
return C = "idb://".concat(t, "/").concat(r, "/").concat(C), S[C] || (S[C] = new oe());
|
|
2561
2561
|
}
|
|
2562
|
-
var b, w, m, _ = d.trans, S = d.mutatedParts || (d.mutatedParts = {}), E = y(""), O = y(":dels"), k = d.type, T = d.type === "deleteRange" ? [d.range] : d.type === "delete" ? [d.keys] : d.values.length < 50 ? [
|
|
2563
|
-
return
|
|
2564
|
-
}), d.values] : [], I = T[0],
|
|
2565
|
-
return N(I) ? (E.addKeys(I), (T = k === "delete" || I.length ===
|
|
2566
|
-
var L = b(
|
|
2567
|
-
function F(
|
|
2568
|
-
return
|
|
2562
|
+
var b, w, m, _ = d.trans, S = d.mutatedParts || (d.mutatedParts = {}), E = y(""), O = y(":dels"), k = d.type, T = d.type === "deleteRange" ? [d.range] : d.type === "delete" ? [d.keys] : d.values.length < 50 ? [Mn(c, d).filter(function(C) {
|
|
2563
|
+
return C;
|
|
2564
|
+
}), d.values] : [], I = T[0], A = T[1], T = d.trans._cache;
|
|
2565
|
+
return N(I) ? (E.addKeys(I), (T = k === "delete" || I.length === A.length ? Sr(I, T) : null) || O.addKeys(I), (T || A) && (b = y, w = T, m = A, s.indexes.forEach(function(C) {
|
|
2566
|
+
var L = b(C.name || "");
|
|
2567
|
+
function F(U) {
|
|
2568
|
+
return U != null ? C.extractKey(U) : null;
|
|
2569
2569
|
}
|
|
2570
|
-
function Y(
|
|
2571
|
-
return
|
|
2570
|
+
function Y(U) {
|
|
2571
|
+
return C.multiEntry && N(U) ? U.forEach(function(Q) {
|
|
2572
2572
|
return L.addKey(Q);
|
|
2573
|
-
}) : L.addKey(
|
|
2573
|
+
}) : L.addKey(U);
|
|
2574
2574
|
}
|
|
2575
|
-
(w || m).forEach(function(
|
|
2576
|
-
var le = w && F(w[
|
|
2577
|
-
z(le,
|
|
2575
|
+
(w || m).forEach(function(U, $) {
|
|
2576
|
+
var le = w && F(w[$]), $ = m && F(m[$]);
|
|
2577
|
+
z(le, $) !== 0 && (le != null && Y(le), $ != null && Y($));
|
|
2578
2578
|
});
|
|
2579
|
-
}))) : I ? (
|
|
2580
|
-
return y(
|
|
2581
|
-
})), a.mutate(d).then(function(
|
|
2582
|
-
return !I || d.type !== "add" && d.type !== "put" || E.addKeys(
|
|
2579
|
+
}))) : I ? (A = { from: I.lower, to: I.upper }, O.add(A), E.add(A)) : (E.add(n), O.add(n), s.indexes.forEach(function(C) {
|
|
2580
|
+
return y(C.name).add(n);
|
|
2581
|
+
})), a.mutate(d).then(function(C) {
|
|
2582
|
+
return !I || d.type !== "add" && d.type !== "put" || E.addKeys(C.results), _.mutatedParts = Ut(_.mutatedParts || {}, S), C;
|
|
2583
2583
|
});
|
|
2584
2584
|
} }), l = { get: function(d) {
|
|
2585
|
-
return [
|
|
2585
|
+
return [c, new oe(d.key)];
|
|
2586
2586
|
}, getMany: function(d) {
|
|
2587
|
-
return [
|
|
2587
|
+
return [c, new oe().addKeys(d.keys)];
|
|
2588
2588
|
}, count: o, query: o, openCursor: o };
|
|
2589
|
-
return
|
|
2589
|
+
return K(l).forEach(function(d) {
|
|
2590
2590
|
v[d] = function(y) {
|
|
2591
|
-
var b =
|
|
2591
|
+
var b = B.subscr, w = !!b, m = Er(B, a) && Or(d, y) ? y.obsSet = {} : b;
|
|
2592
2592
|
if (w) {
|
|
2593
|
-
var _ = function(
|
|
2594
|
-
return
|
|
2593
|
+
var _ = function(A) {
|
|
2594
|
+
return A = "idb://".concat(t, "/").concat(r, "/").concat(A), m[A] || (m[A] = new oe());
|
|
2595
2595
|
}, S = _(""), E = _(":dels"), b = l[d](y), w = b[0], b = b[1];
|
|
2596
2596
|
if ((d === "query" && w.isPrimaryKey && !y.values ? E : _(w.name || "")).add(b), !w.isPrimaryKey) {
|
|
2597
2597
|
if (d !== "count") {
|
|
2598
2598
|
var O = d === "query" && f && y.values && a.query(h(h({}, y), { values: !1 }));
|
|
2599
|
-
return a[d].apply(this, arguments).then(function(
|
|
2599
|
+
return a[d].apply(this, arguments).then(function(A) {
|
|
2600
2600
|
if (d === "query") {
|
|
2601
2601
|
if (f && y.values)
|
|
2602
2602
|
return O.then(function(F) {
|
|
2603
|
-
return F = F.result, S.addKeys(F),
|
|
2603
|
+
return F = F.result, S.addKeys(F), A;
|
|
2604
2604
|
});
|
|
2605
|
-
var T = y.values ?
|
|
2605
|
+
var T = y.values ? A.result.map(p) : A.result;
|
|
2606
2606
|
(y.values ? S : E).addKeys(T);
|
|
2607
2607
|
} else if (d === "openCursor") {
|
|
2608
|
-
var
|
|
2609
|
-
return
|
|
2610
|
-
return E.addKey(
|
|
2608
|
+
var C = A, L = y.values;
|
|
2609
|
+
return C && Object.create(C, { key: { get: function() {
|
|
2610
|
+
return E.addKey(C.primaryKey), C.key;
|
|
2611
2611
|
} }, primaryKey: { get: function() {
|
|
2612
|
-
var F =
|
|
2612
|
+
var F = C.primaryKey;
|
|
2613
2613
|
return E.addKey(F), F;
|
|
2614
2614
|
} }, value: { get: function() {
|
|
2615
|
-
return L && S.addKey(
|
|
2615
|
+
return L && S.addKey(C.primaryKey), C.value;
|
|
2616
2616
|
} } });
|
|
2617
2617
|
}
|
|
2618
|
-
return
|
|
2618
|
+
return A;
|
|
2619
2619
|
});
|
|
2620
2620
|
}
|
|
2621
2621
|
E.add(n);
|
|
@@ -2638,18 +2638,18 @@ var Rr = { exports: {} };
|
|
|
2638
2638
|
return !(a in n.failures);
|
|
2639
2639
|
})), t);
|
|
2640
2640
|
}
|
|
2641
|
-
function
|
|
2641
|
+
function jn(e, t) {
|
|
2642
2642
|
return n = e, ((r = t).lower === void 0 || (r.lowerOpen ? 0 < z(n, r.lower) : 0 <= z(n, r.lower))) && (e = e, (t = t).upper === void 0 || (t.upperOpen ? z(e, t.upper) < 0 : z(e, t.upper) <= 0));
|
|
2643
2643
|
var n, r;
|
|
2644
2644
|
}
|
|
2645
2645
|
function kr(e, t, d, r, o, a) {
|
|
2646
2646
|
if (!d || d.length === 0)
|
|
2647
2647
|
return e;
|
|
2648
|
-
var s = t.query.index,
|
|
2648
|
+
var s = t.query.index, c = s.multiEntry, p = t.query.range, f = r.schema.primaryKey.extractKey, v = s.extractKey, l = (s.lowLevelIndex || s).extractKey, d = d.reduce(function(y, b) {
|
|
2649
2649
|
var w = y, m = b.type === "add" || b.type === "put" ? b.values.filter(function(O) {
|
|
2650
|
-
return O = v(O),
|
|
2651
|
-
return
|
|
2652
|
-
}) :
|
|
2650
|
+
return O = v(O), c && N(O) ? O.some(function(k) {
|
|
2651
|
+
return jn(k, p);
|
|
2652
|
+
}) : jn(O, p);
|
|
2653
2653
|
}).map(function(O) {
|
|
2654
2654
|
return O = Ae(O), a && Object.freeze(O), O;
|
|
2655
2655
|
}) : [];
|
|
@@ -2663,7 +2663,7 @@ var Rr = { exports: {} };
|
|
|
2663
2663
|
var _ = new oe().addKeys(b.values.map(function(k) {
|
|
2664
2664
|
return f(k);
|
|
2665
2665
|
})), w = y.filter(function(k) {
|
|
2666
|
-
return k = t.values ? f(k) : k,
|
|
2666
|
+
return k = t.values ? f(k) : k, !$t(new oe(k), _);
|
|
2667
2667
|
}).concat(t.values ? m : m.map(function(k) {
|
|
2668
2668
|
return f(k);
|
|
2669
2669
|
}));
|
|
@@ -2671,13 +2671,13 @@ var Rr = { exports: {} };
|
|
|
2671
2671
|
case "delete":
|
|
2672
2672
|
var S = new oe().addKeys(b.keys);
|
|
2673
2673
|
w = y.filter(function(k) {
|
|
2674
|
-
return k = t.values ? f(k) : k,
|
|
2674
|
+
return k = t.values ? f(k) : k, !$t(new oe(k), S);
|
|
2675
2675
|
});
|
|
2676
2676
|
break;
|
|
2677
2677
|
case "deleteRange":
|
|
2678
2678
|
var E = b.range;
|
|
2679
2679
|
w = y.filter(function(k) {
|
|
2680
|
-
return !
|
|
2680
|
+
return !jn(f(k), E);
|
|
2681
2681
|
});
|
|
2682
2682
|
}
|
|
2683
2683
|
return w;
|
|
@@ -2724,38 +2724,38 @@ var Rr = { exports: {} };
|
|
|
2724
2724
|
e.subscribers.add(n), r.addEventListener("abort", function() {
|
|
2725
2725
|
var o, a;
|
|
2726
2726
|
e.subscribers.delete(n), e.subscribers.size === 0 && (o = e, a = t, setTimeout(function() {
|
|
2727
|
-
o.subscribers.size === 0 &&
|
|
2727
|
+
o.subscribers.size === 0 && je(a, o);
|
|
2728
2728
|
}, 3e3));
|
|
2729
2729
|
});
|
|
2730
2730
|
}
|
|
2731
2731
|
var _i = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
|
|
2732
2732
|
var t = e.schema.name;
|
|
2733
2733
|
return h(h({}, e), { transaction: function(n, r, o) {
|
|
2734
|
-
var a, s,
|
|
2734
|
+
var a, s, c = e.transaction(n, r, o);
|
|
2735
2735
|
return r === "readwrite" && (s = (a = new AbortController()).signal, o = function(p) {
|
|
2736
2736
|
return function() {
|
|
2737
2737
|
if (a.abort(), r === "readwrite") {
|
|
2738
2738
|
for (var f = /* @__PURE__ */ new Set(), v = 0, l = n; v < l.length; v++) {
|
|
2739
|
-
var d = l[v], y =
|
|
2739
|
+
var d = l[v], y = $e["idb://".concat(t, "/").concat(d)];
|
|
2740
2740
|
if (y) {
|
|
2741
2741
|
var b = e.table(d), w = y.optimisticOps.filter(function(F) {
|
|
2742
|
-
return F.trans ===
|
|
2742
|
+
return F.trans === c;
|
|
2743
2743
|
});
|
|
2744
|
-
if (
|
|
2744
|
+
if (c._explicit && p && c.mutatedParts)
|
|
2745
2745
|
for (var m = 0, _ = Object.values(y.queries.query); m < _.length; m++)
|
|
2746
2746
|
for (var S = 0, E = (I = _[m]).slice(); S < E.length; S++)
|
|
2747
|
-
Dn((
|
|
2747
|
+
Dn((A = E[S]).obsSet, c.mutatedParts) && (je(I, A), A.subscribers.forEach(function(F) {
|
|
2748
2748
|
return f.add(F);
|
|
2749
2749
|
}));
|
|
2750
2750
|
else if (0 < w.length) {
|
|
2751
2751
|
y.optimisticOps = y.optimisticOps.filter(function(F) {
|
|
2752
|
-
return F.trans !==
|
|
2752
|
+
return F.trans !== c;
|
|
2753
2753
|
});
|
|
2754
2754
|
for (var O = 0, k = Object.values(y.queries.query); O < k.length; O++)
|
|
2755
|
-
for (var I,
|
|
2756
|
-
(
|
|
2755
|
+
for (var I, A, T, C = 0, L = (I = k[O]).slice(); C < L.length; C++)
|
|
2756
|
+
(A = L[C]).res != null && c.mutatedParts && (p && !A.dirty ? (T = Object.isFrozen(A.res), T = kr(A.res, A.req, w, b, A, T), A.dirty ? (je(I, A), A.subscribers.forEach(function(F) {
|
|
2757
2757
|
return f.add(F);
|
|
2758
|
-
})) : T !==
|
|
2758
|
+
})) : T !== A.res && (A.res = T, A.promise = M.resolve({ result: T }))) : (A.dirty && je(I, A), A.subscribers.forEach(function(F) {
|
|
2759
2759
|
return f.add(F);
|
|
2760
2760
|
})));
|
|
2761
2761
|
}
|
|
@@ -2766,34 +2766,34 @@ var Rr = { exports: {} };
|
|
|
2766
2766
|
});
|
|
2767
2767
|
}
|
|
2768
2768
|
};
|
|
2769
|
-
},
|
|
2769
|
+
}, c.addEventListener("abort", o(!1), { signal: s }), c.addEventListener("error", o(!1), { signal: s }), c.addEventListener("complete", o(!0), { signal: s })), c;
|
|
2770
2770
|
}, table: function(n) {
|
|
2771
2771
|
var r = e.table(n), o = r.schema.primaryKey;
|
|
2772
2772
|
return h(h({}, r), { mutate: function(a) {
|
|
2773
|
-
var s =
|
|
2773
|
+
var s = B.trans;
|
|
2774
2774
|
if (o.outbound || s.db._options.cache === "disabled" || s.explicit)
|
|
2775
2775
|
return r.mutate(a);
|
|
2776
|
-
var
|
|
2777
|
-
return
|
|
2776
|
+
var c = $e["idb://".concat(t, "/").concat(n)];
|
|
2777
|
+
return c ? (s = r.mutate(a), a.type !== "add" && a.type !== "put" || !(50 <= a.values.length || Mn(o, a).some(function(p) {
|
|
2778
2778
|
return p == null;
|
|
2779
|
-
})) ? (
|
|
2780
|
-
0 < p.numFailures && (
|
|
2779
|
+
})) ? (c.optimisticOps.push(a), a.mutatedParts && Wt(a.mutatedParts), s.then(function(p) {
|
|
2780
|
+
0 < p.numFailures && (je(c.optimisticOps, a), (p = xr(0, a, p)) && c.optimisticOps.push(p), a.mutatedParts && Wt(a.mutatedParts));
|
|
2781
2781
|
}), s.catch(function() {
|
|
2782
|
-
|
|
2782
|
+
je(c.optimisticOps, a), a.mutatedParts && Wt(a.mutatedParts);
|
|
2783
2783
|
})) : s.then(function(p) {
|
|
2784
2784
|
var f = xr(0, h(h({}, a), { values: a.values.map(function(y, l) {
|
|
2785
2785
|
var d, y = (d = o.keyPath) !== null && d !== void 0 && d.includes(".") ? Ae(y) : h({}, y);
|
|
2786
2786
|
return fe(y, o.keyPath, p.results[l]), y;
|
|
2787
2787
|
}) }), p);
|
|
2788
|
-
|
|
2788
|
+
c.optimisticOps.push(f), queueMicrotask(function() {
|
|
2789
2789
|
return a.mutatedParts && Wt(a.mutatedParts);
|
|
2790
2790
|
});
|
|
2791
2791
|
}), s) : r.mutate(a);
|
|
2792
2792
|
}, query: function(a) {
|
|
2793
|
-
if (!Er(
|
|
2793
|
+
if (!Er(B, r) || !Or("query", a))
|
|
2794
2794
|
return r.query(a);
|
|
2795
|
-
var s = ((f =
|
|
2796
|
-
var S =
|
|
2795
|
+
var s = ((f = B.trans) === null || f === void 0 ? void 0 : f.db._options.cache) === "immutable", l = B, c = l.requery, p = l.signal, f = function(b, w, m, _) {
|
|
2796
|
+
var S = $e["idb://".concat(b, "/").concat(w)];
|
|
2797
2797
|
if (!S)
|
|
2798
2798
|
return [];
|
|
2799
2799
|
if (!(w = S.queries[m]))
|
|
@@ -2825,8 +2825,8 @@ var Rr = { exports: {} };
|
|
|
2825
2825
|
b.result = Ae(w);
|
|
2826
2826
|
return b;
|
|
2827
2827
|
}).catch(function(b) {
|
|
2828
|
-
return y && v &&
|
|
2829
|
-
}), v = { obsSet: a.obsSet, promise: l, subscribers: /* @__PURE__ */ new Set(), type: "query", req: a, dirty: !1 }, y ? y.push(v) : (y = [v], (d = d || (
|
|
2828
|
+
return y && v && je(y, v), Promise.reject(b);
|
|
2829
|
+
}), v = { obsSet: a.obsSet, promise: l, subscribers: /* @__PURE__ */ new Set(), type: "query", req: a, dirty: !1 }, y ? y.push(v) : (y = [v], (d = d || ($e["idb://".concat(t, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[a.query.index.name || ""] = y)), wi(v, y, c, p), v.promise.then(function(b) {
|
|
2830
2830
|
return { result: kr(b.result, a, d == null ? void 0 : d.optimisticOps, r, v, s) };
|
|
2831
2831
|
});
|
|
2832
2832
|
} });
|
|
@@ -2849,7 +2849,7 @@ var Rr = { exports: {} };
|
|
|
2849
2849
|
return n || (n = new this.Version(e), t.push(n), t.sort(li), n.stores({}), this._state.autoSchema = !1, n);
|
|
2850
2850
|
}, ee.prototype._whenReady = function(e) {
|
|
2851
2851
|
var t = this;
|
|
2852
|
-
return this.idbdb && (this._state.openComplete ||
|
|
2852
|
+
return this.idbdb && (this._state.openComplete || B.letThrough || this._vip) ? e() : new M(function(n, r) {
|
|
2853
2853
|
if (t._state.openComplete)
|
|
2854
2854
|
return r(new G.DatabaseClosed(t._state.dbOpenError));
|
|
2855
2855
|
if (!t._state.isBeingOpened) {
|
|
@@ -2883,9 +2883,9 @@ var Rr = { exports: {} };
|
|
|
2883
2883
|
}
|
|
2884
2884
|
this.idbdb = null;
|
|
2885
2885
|
}
|
|
2886
|
-
e.isBeingOpened || (e.dbReadyPromise = new
|
|
2886
|
+
e.isBeingOpened || (e.dbReadyPromise = new M(function(n) {
|
|
2887
2887
|
e.dbReadyResolve = n;
|
|
2888
|
-
}), e.openCanceller = new
|
|
2888
|
+
}), e.openCanceller = new M(function(n, r) {
|
|
2889
2889
|
e.cancelOpen = r;
|
|
2890
2890
|
}));
|
|
2891
2891
|
}, ee.prototype.close = function(n) {
|
|
@@ -2895,14 +2895,14 @@ var Rr = { exports: {} };
|
|
|
2895
2895
|
var t = this;
|
|
2896
2896
|
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
2897
2897
|
var n = 0 < arguments.length, r = this._state;
|
|
2898
|
-
return new
|
|
2898
|
+
return new M(function(o, a) {
|
|
2899
2899
|
function s() {
|
|
2900
2900
|
t.close(e);
|
|
2901
|
-
var
|
|
2902
|
-
|
|
2901
|
+
var c = t._deps.indexedDB.deleteDatabase(t.name);
|
|
2902
|
+
c.onsuccess = J(function() {
|
|
2903
2903
|
var p, f, v;
|
|
2904
2904
|
p = t._deps, f = t.name, v = p.indexedDB, p = p.IDBKeyRange, On(v) || f === It || En(v, p).delete(f).catch(H), o();
|
|
2905
|
-
}),
|
|
2905
|
+
}), c.onerror = ye(a), c.onblocked = t._fireOnBlocked;
|
|
2906
2906
|
}
|
|
2907
2907
|
if (n)
|
|
2908
2908
|
throw new G.InvalidArgument("Arguments not allowed in db.delete()");
|
|
@@ -2921,7 +2921,7 @@ var Rr = { exports: {} };
|
|
|
2921
2921
|
return this._state.autoSchema;
|
|
2922
2922
|
}, Object.defineProperty(ee.prototype, "tables", { get: function() {
|
|
2923
2923
|
var e = this;
|
|
2924
|
-
return
|
|
2924
|
+
return K(this._allTables).map(function(t) {
|
|
2925
2925
|
return e._allTables[t];
|
|
2926
2926
|
});
|
|
2927
2927
|
}, enumerable: !1, configurable: !0 }), ee.prototype.transaction = function() {
|
|
@@ -2935,9 +2935,9 @@ var Rr = { exports: {} };
|
|
|
2935
2935
|
}).apply(this, arguments);
|
|
2936
2936
|
return this._transaction.apply(this, e);
|
|
2937
2937
|
}, ee.prototype._transaction = function(e, t, n) {
|
|
2938
|
-
var r = this, o =
|
|
2938
|
+
var r = this, o = B.trans;
|
|
2939
2939
|
o && o.db === this && e.indexOf("!") === -1 || (o = null);
|
|
2940
|
-
var a, s,
|
|
2940
|
+
var a, s, c = e.indexOf("?") !== -1;
|
|
2941
2941
|
e = e.replace("!", "").replace("?", "");
|
|
2942
2942
|
try {
|
|
2943
2943
|
if (s = t.map(function(f) {
|
|
@@ -2953,17 +2953,17 @@ var Rr = { exports: {} };
|
|
|
2953
2953
|
}
|
|
2954
2954
|
if (o) {
|
|
2955
2955
|
if (o.mode === fn && a === dn) {
|
|
2956
|
-
if (!
|
|
2956
|
+
if (!c)
|
|
2957
2957
|
throw new G.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
2958
2958
|
o = null;
|
|
2959
2959
|
}
|
|
2960
2960
|
o && s.forEach(function(f) {
|
|
2961
2961
|
if (o && o.storeNames.indexOf(f) === -1) {
|
|
2962
|
-
if (!
|
|
2962
|
+
if (!c)
|
|
2963
2963
|
throw new G.SubTransaction("Table " + f + " not included in parent transaction.");
|
|
2964
2964
|
o = null;
|
|
2965
2965
|
}
|
|
2966
|
-
}),
|
|
2966
|
+
}), c && o && !o.active && (o = null);
|
|
2967
2967
|
}
|
|
2968
2968
|
} catch (f) {
|
|
2969
2969
|
return o ? o._promise(null, function(v, l) {
|
|
@@ -2971,8 +2971,8 @@ var Rr = { exports: {} };
|
|
|
2971
2971
|
}) : q(f);
|
|
2972
2972
|
}
|
|
2973
2973
|
var p = (function f(v, l, d, y, b) {
|
|
2974
|
-
return
|
|
2975
|
-
var w =
|
|
2974
|
+
return M.resolve().then(function() {
|
|
2975
|
+
var w = B.transless || B, m = v._createTransaction(l, d, v._dbSchema, y);
|
|
2976
2976
|
if (m.explicit = !0, w = { trans: m, transless: w }, y)
|
|
2977
2977
|
m.idbtrans = y.idbtrans;
|
|
2978
2978
|
else
|
|
@@ -2984,10 +2984,10 @@ var Rr = { exports: {} };
|
|
|
2984
2984
|
})) : q(E);
|
|
2985
2985
|
}
|
|
2986
2986
|
var _, S = qt(b);
|
|
2987
|
-
return S && Je(), w =
|
|
2987
|
+
return S && Je(), w = M.follow(function() {
|
|
2988
2988
|
var E;
|
|
2989
2989
|
(_ = b.call(m, m)) && (S ? (E = Ce.bind(null, null), _.then(E, E)) : typeof _.next == "function" && typeof _.throw == "function" && (_ = Rn(_)));
|
|
2990
|
-
}, w), (_ && typeof _.then == "function" ?
|
|
2990
|
+
}, w), (_ && typeof _.then == "function" ? M.resolve(_).then(function(E) {
|
|
2991
2991
|
return m.active ? E : q(new G.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
2992
2992
|
}) : w.then(function() {
|
|
2993
2993
|
return _;
|
|
@@ -3000,7 +3000,7 @@ var Rr = { exports: {} };
|
|
|
3000
3000
|
});
|
|
3001
3001
|
});
|
|
3002
3002
|
}).bind(null, this, a, s, o, n);
|
|
3003
|
-
return o ? o._promise(a, p, "lock") :
|
|
3003
|
+
return o ? o._promise(a, p, "lock") : B.trans ? Le(B.transless, function() {
|
|
3004
3004
|
return r._whenReady(p);
|
|
3005
3005
|
}) : this._whenReady(p);
|
|
3006
3006
|
}, ee.prototype.table = function(e) {
|
|
@@ -3013,16 +3013,16 @@ var Rr = { exports: {} };
|
|
|
3013
3013
|
this._middlewares = {}, this.verno = 0;
|
|
3014
3014
|
var r = ee.dependencies;
|
|
3015
3015
|
this._options = t = h({ addons: ee.addons, autoOpen: !0, indexedDB: r.indexedDB, IDBKeyRange: r.IDBKeyRange, cache: "cloned" }, t), this._deps = { indexedDB: t.indexedDB, IDBKeyRange: t.IDBKeyRange }, r = t.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
3016
|
-
var o, a, s,
|
|
3017
|
-
f.dbReadyPromise = new
|
|
3016
|
+
var o, a, s, c, p, f = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: H, dbReadyPromise: null, cancelOpen: H, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
|
|
3017
|
+
f.dbReadyPromise = new M(function(l) {
|
|
3018
3018
|
f.dbReadyResolve = l;
|
|
3019
|
-
}), f.openCanceller = new
|
|
3019
|
+
}), f.openCanceller = new M(function(l, d) {
|
|
3020
3020
|
f.cancelOpen = d;
|
|
3021
3021
|
}), this._state = f, this.name = e, this.on = ft(this, "populate", "blocked", "versionchange", "close", { ready: [tn, H] }), this.on.ready.subscribe = Yn(this.on.ready.subscribe, function(l) {
|
|
3022
3022
|
return function(d, y) {
|
|
3023
3023
|
ee.vip(function() {
|
|
3024
3024
|
var b, w = n._state;
|
|
3025
|
-
w.openComplete ? (w.dbOpenError ||
|
|
3025
|
+
w.openComplete ? (w.dbOpenError || M.resolve().then(d), y && l(d)) : w.onReadyBeingFired ? (w.onReadyBeingFired.push(d), y && l(d)) : (l(d), b = n, y || l(function m() {
|
|
3026
3026
|
b.on.ready.unsubscribe(d), b.on.ready.unsubscribe(m);
|
|
3027
3027
|
}));
|
|
3028
3028
|
});
|
|
@@ -3042,7 +3042,7 @@ var Rr = { exports: {} };
|
|
|
3042
3042
|
this.db = a, this._tx = y, this.name = l, this.schema = d, this.hook = a._allTables[l] ? a._allTables[l].hook : ft(null, { creating: [Qr, H], reading: [Hr, ot], updating: [Vr, H], deleting: [Xr, H] });
|
|
3043
3043
|
})), this.Transaction = (s = this, dt(ai.prototype, function(l, d, y, b, w) {
|
|
3044
3044
|
var m = this;
|
|
3045
|
-
this.db = s, this.mode = l, this.storeNames = d, this.schema = y, this.chromeTransactionDurability = b, this.idbtrans = null, this.on = ft(this, "complete", "error", "abort"), this.parent = w || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new
|
|
3045
|
+
this.db = s, this.mode = l, this.storeNames = d, this.schema = y, this.chromeTransactionDurability = b, this.idbtrans = null, this.on = ft(this, "complete", "error", "abort"), this.parent = w || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new M(function(_, S) {
|
|
3046
3046
|
m._resolve = _, m._reject = S;
|
|
3047
3047
|
}), this._completion.then(function() {
|
|
3048
3048
|
m.active = !1, m.on.complete.fire();
|
|
@@ -3050,8 +3050,8 @@ var Rr = { exports: {} };
|
|
|
3050
3050
|
var S = m.active;
|
|
3051
3051
|
return m.active = !1, m.on.error.fire(_), m.parent ? m.parent._reject(_) : S && m.idbtrans && m.idbtrans.abort(), q(_);
|
|
3052
3052
|
});
|
|
3053
|
-
})), this.Version = (
|
|
3054
|
-
this.db =
|
|
3053
|
+
})), this.Version = (c = this, dt(hi.prototype, function(l) {
|
|
3054
|
+
this.db = c, this._cfg = { version: l, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
3055
3055
|
})), this.WhereClause = (p = this, dt(pr.prototype, function(l, d, y) {
|
|
3056
3056
|
if (this.db = p, this._ctx = { table: l, index: d === ":id" ? null : d, or: y }, this._cmp = this._ascending = z, this._descending = function(b, w) {
|
|
3057
3057
|
return z(w, b);
|
|
@@ -3107,19 +3107,19 @@ var Rr = { exports: {} };
|
|
|
3107
3107
|
}
|
|
3108
3108
|
function Dr(e) {
|
|
3109
3109
|
var t, n = !1, r = new Si(function(o) {
|
|
3110
|
-
var a = qt(e), s,
|
|
3111
|
-
return
|
|
3110
|
+
var a = qt(e), s, c = !1, p = {}, f = {}, v = { get closed() {
|
|
3111
|
+
return c;
|
|
3112
3112
|
}, unsubscribe: function() {
|
|
3113
|
-
|
|
3113
|
+
c || (c = !0, s && s.abort(), l && Te.storagemutated.unsubscribe(y));
|
|
3114
3114
|
} };
|
|
3115
3115
|
o.start && o.start(v);
|
|
3116
3116
|
var l = !1, d = function() {
|
|
3117
3117
|
return ln(b);
|
|
3118
3118
|
}, y = function(w) {
|
|
3119
|
-
|
|
3119
|
+
Ut(p, w), Dn(f, p) && d();
|
|
3120
3120
|
}, b = function() {
|
|
3121
3121
|
var w, m, _;
|
|
3122
|
-
!
|
|
3122
|
+
!c && Ht.indexedDB && (p = {}, w = {}, s && s.abort(), s = new AbortController(), _ = function(S) {
|
|
3123
3123
|
var E = Xe();
|
|
3124
3124
|
try {
|
|
3125
3125
|
a && Je();
|
|
@@ -3129,17 +3129,17 @@ var Rr = { exports: {} };
|
|
|
3129
3129
|
E && Ve();
|
|
3130
3130
|
}
|
|
3131
3131
|
}(m = { subscr: w, signal: s.signal, requery: d, querier: e, trans: null }), Promise.resolve(_).then(function(S) {
|
|
3132
|
-
n = !0, t = S,
|
|
3132
|
+
n = !0, t = S, c || m.signal.aborted || (p = {}, function(E) {
|
|
3133
3133
|
for (var O in E)
|
|
3134
3134
|
if (ie(E, O))
|
|
3135
3135
|
return;
|
|
3136
3136
|
return 1;
|
|
3137
3137
|
}(f = w) || l || (Te(pt, y), l = !0), ln(function() {
|
|
3138
|
-
return !
|
|
3138
|
+
return !c && o.next && o.next(S);
|
|
3139
3139
|
}));
|
|
3140
3140
|
}, function(S) {
|
|
3141
|
-
n = !1, ["DatabaseClosedError", "AbortError"].includes(S == null ? void 0 : S.name) ||
|
|
3142
|
-
|
|
3141
|
+
n = !1, ["DatabaseClosedError", "AbortError"].includes(S == null ? void 0 : S.name) || c || ln(function() {
|
|
3142
|
+
c || o.error && o.error(S);
|
|
3143
3143
|
});
|
|
3144
3144
|
}));
|
|
3145
3145
|
};
|
|
@@ -3151,26 +3151,26 @@ var Rr = { exports: {} };
|
|
|
3151
3151
|
return t;
|
|
3152
3152
|
}, r;
|
|
3153
3153
|
}
|
|
3154
|
-
var
|
|
3154
|
+
var Ue = Se;
|
|
3155
3155
|
function Bn(e) {
|
|
3156
|
-
var t =
|
|
3156
|
+
var t = Me;
|
|
3157
3157
|
try {
|
|
3158
|
-
|
|
3158
|
+
Me = !0, Te.storagemutated.fire(e), In(e, !0);
|
|
3159
3159
|
} finally {
|
|
3160
|
-
|
|
3160
|
+
Me = t;
|
|
3161
3161
|
}
|
|
3162
3162
|
}
|
|
3163
|
-
xe(
|
|
3164
|
-
return new
|
|
3163
|
+
xe(Ue, h(h({}, St), { delete: function(e) {
|
|
3164
|
+
return new Ue(e, { addons: [] }).delete();
|
|
3165
3165
|
}, exists: function(e) {
|
|
3166
|
-
return new
|
|
3166
|
+
return new Ue(e, { addons: [] }).open().then(function(t) {
|
|
3167
3167
|
return t.close(), !0;
|
|
3168
3168
|
}).catch("NoSuchDatabaseError", function() {
|
|
3169
3169
|
return !1;
|
|
3170
3170
|
});
|
|
3171
3171
|
}, getDatabaseNames: function(e) {
|
|
3172
3172
|
try {
|
|
3173
|
-
return t =
|
|
3173
|
+
return t = Ue.dependencies, n = t.indexedDB, t = t.IDBKeyRange, (On(n) ? Promise.resolve(n.databases()).then(function(r) {
|
|
3174
3174
|
return r.map(function(o) {
|
|
3175
3175
|
return o.name;
|
|
3176
3176
|
}).filter(function(o) {
|
|
@@ -3186,12 +3186,12 @@ var Rr = { exports: {} };
|
|
|
3186
3186
|
Z(this, e);
|
|
3187
3187
|
};
|
|
3188
3188
|
}, ignoreTransaction: function(e) {
|
|
3189
|
-
return
|
|
3189
|
+
return B.trans ? Le(B.transless, e) : e();
|
|
3190
3190
|
}, vip: xn, async: function(e) {
|
|
3191
3191
|
return function() {
|
|
3192
3192
|
try {
|
|
3193
3193
|
var t = Rn(e.apply(this, arguments));
|
|
3194
|
-
return t && typeof t.then == "function" ? t :
|
|
3194
|
+
return t && typeof t.then == "function" ? t : M.resolve(t);
|
|
3195
3195
|
} catch (n) {
|
|
3196
3196
|
return q(n);
|
|
3197
3197
|
}
|
|
@@ -3199,39 +3199,39 @@ var Rr = { exports: {} };
|
|
|
3199
3199
|
}, spawn: function(e, t, n) {
|
|
3200
3200
|
try {
|
|
3201
3201
|
var r = Rn(e.apply(n, t || []));
|
|
3202
|
-
return r && typeof r.then == "function" ? r :
|
|
3202
|
+
return r && typeof r.then == "function" ? r : M.resolve(r);
|
|
3203
3203
|
} catch (o) {
|
|
3204
3204
|
return q(o);
|
|
3205
3205
|
}
|
|
3206
3206
|
}, currentTransaction: { get: function() {
|
|
3207
|
-
return
|
|
3207
|
+
return B.trans || null;
|
|
3208
3208
|
} }, waitFor: function(e, t) {
|
|
3209
|
-
return t =
|
|
3210
|
-
}, Promise:
|
|
3209
|
+
return t = M.resolve(typeof e == "function" ? Ue.ignoreTransaction(e) : e).timeout(t || 6e4), B.trans ? B.trans.waitFor(t) : t;
|
|
3210
|
+
}, Promise: M, debug: { get: function() {
|
|
3211
3211
|
return pe;
|
|
3212
3212
|
}, set: function(e) {
|
|
3213
3213
|
qn(e);
|
|
3214
|
-
} }, derive: ze, extend: Z, props: xe, override: Yn, Events: ft, on: Te, liveQuery: Dr, extendObservabilitySet:
|
|
3214
|
+
} }, derive: ze, extend: Z, props: xe, override: Yn, Events: ft, on: Te, liveQuery: Dr, extendObservabilitySet: Ut, getByKeyPath: ve, setByKeyPath: fe, delByKeyPath: function(e, t) {
|
|
3215
3215
|
typeof t == "string" ? fe(e, t, void 0) : "length" in t && [].map.call(t, function(n) {
|
|
3216
3216
|
fe(e, n, void 0);
|
|
3217
3217
|
});
|
|
3218
|
-
}, shallowClone: Qn, deepClone: Ae, getObjectDiff: Tn, cmp: z, asap: Hn, minKey: -1 / 0, addons: [], connections: Ze, errnames: en, dependencies: Ht, cache:
|
|
3218
|
+
}, shallowClone: Qn, deepClone: Ae, getObjectDiff: Tn, cmp: z, asap: Hn, minKey: -1 / 0, addons: [], connections: Ze, errnames: en, dependencies: Ht, cache: $e, semVer: ge, version: ge.split(".").map(function(e) {
|
|
3219
3219
|
return parseInt(e);
|
|
3220
3220
|
}).reduce(function(e, t, n) {
|
|
3221
3221
|
return e + t / Math.pow(10, 2 * n);
|
|
3222
|
-
}) })),
|
|
3223
|
-
|
|
3222
|
+
}) })), Ue.maxKey = gt(Ue.dependencies.IDBKeyRange), typeof dispatchEvent < "u" && typeof addEventListener < "u" && (Te(pt, function(e) {
|
|
3223
|
+
Me || (e = new CustomEvent(yn, { detail: e }), Me = !0, dispatchEvent(e), Me = !1);
|
|
3224
3224
|
}), addEventListener(yn, function(e) {
|
|
3225
|
-
e = e.detail,
|
|
3225
|
+
e = e.detail, Me || Bn(e);
|
|
3226
3226
|
}));
|
|
3227
|
-
var tt,
|
|
3227
|
+
var tt, Me = !1, Pr = function() {
|
|
3228
3228
|
};
|
|
3229
3229
|
return typeof BroadcastChannel < "u" && ((Pr = function() {
|
|
3230
3230
|
(tt = new BroadcastChannel(yn)).onmessage = function(e) {
|
|
3231
3231
|
return e.data && Bn(e.data);
|
|
3232
3232
|
};
|
|
3233
3233
|
})(), typeof tt.unref == "function" && tt.unref(), Te(pt, function(e) {
|
|
3234
|
-
|
|
3234
|
+
Me || tt.postMessage(e);
|
|
3235
3235
|
})), typeof addEventListener < "u" && (addEventListener("pagehide", function(e) {
|
|
3236
3236
|
if (!Se.disableBfCache && e.persisted) {
|
|
3237
3237
|
pe && console.debug("Dexie: handling persisted pagehide"), tt != null && tt.close();
|
|
@@ -3240,18 +3240,18 @@ var Rr = { exports: {} };
|
|
|
3240
3240
|
}
|
|
3241
3241
|
}), addEventListener("pageshow", function(e) {
|
|
3242
3242
|
!Se.disableBfCache && e.persisted && (pe && console.debug("Dexie: handling persisted pageshow"), Pr(), Bn({ all: new oe(-1 / 0, [[]]) }));
|
|
3243
|
-
})),
|
|
3243
|
+
})), M.rejectionMapper = function(e, t) {
|
|
3244
3244
|
return !e || e instanceof He || e instanceof TypeError || e instanceof SyntaxError || !e.name || !Zn[e.name] ? e : (t = new Zn[e.name](t || e.message, e), "stack" in e && ke(t, "stack", { get: function() {
|
|
3245
3245
|
return this.inner.stack;
|
|
3246
3246
|
} }), t);
|
|
3247
|
-
}, qn(pe), h(Se, Object.freeze({ __proto__: null, Dexie: Se, liveQuery: Dr, Entity: sr, cmp: z, default: Se, RangeSet: oe, mergeRanges: bt, rangesOverlap:
|
|
3247
|
+
}, qn(pe), h(Se, Object.freeze({ __proto__: null, Dexie: Se, liveQuery: Dr, Entity: sr, cmp: z, default: Se, RangeSet: oe, mergeRanges: bt, rangesOverlap: $t }), { default: Se }), Se;
|
|
3248
3248
|
});
|
|
3249
3249
|
})(Rr);
|
|
3250
3250
|
var Di = Rr.exports;
|
|
3251
|
-
const
|
|
3252
|
-
if (
|
|
3253
|
-
throw new Error(`Two different versions of Dexie loaded in the same app: ${
|
|
3254
|
-
var
|
|
3251
|
+
const $n = /* @__PURE__ */ Ai(Di), Ir = Symbol.for("Dexie"), Un = globalThis[Ir] || (globalThis[Ir] = $n);
|
|
3252
|
+
if ($n.semVer !== Un.semVer)
|
|
3253
|
+
throw new Error(`Two different versions of Dexie loaded in the same app: ${$n.semVer} and ${Un.semVer}`);
|
|
3254
|
+
var j = /* @__PURE__ */ ((g) => (g.MESSAGES = "messages", g.CLOUD = "cloud", g.SERIES = "series", g.TOPICS = "topics", g.WIDGET = "widget", g.WIDGETS = "widgets", g))(j || {}), x = /* @__PURE__ */ ((g) => (g.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", g.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", g.BROADCAST = "color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", g.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", g.CLOUD = "color:grey;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", g.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", g.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", g.MESSAGES = "color:grey;background-color:tan;padding:0 4px 0 4px;border-radius:5px;", g.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", g.NONE = "color:transparent;background-color:transparent;", g.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", g.SERIES = "color:grey;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", g.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", g.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", g.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", g.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", g.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", g))(x || {}), se = /* @__PURE__ */ ((g) => (g.ADD_SLIDE = "addSlide", g.APP_READY = "appReady", g.API_UPDATE = "apiUpdate", g.APPROVE_MESSAGE = "approveMessage", g.CHANNEL = "channel", g.CLOSE_MODAL = "closeModal", g.ERROR = "error", g.GOTO_SLIDE = "gotoSlide", g.HIDE_MESSAGE = "hideMessage", g.HIDE_LABELS = "hideLabels", g.NEXT_SLIDE = "nextSlide", g.PAUSE_PRESENTATION = "pausePresentation", g.PRESENTATION_READY = "presentationReady", g.PREV_SLIDE = "prevSlide", g.RELOAD_PRESENTATION = "reloadPresentation", g.SHOW_MODAL = "showModal", g.STAR_MESSAGE = "starMessage", g.SLIDE_DID_LOAD = "slideDidLoad", g.SLIDE_GOTO = "slideGoto", g.SLIDE_READY = "slideReady", g.SLIDE_TRANSITIONER = "slideTransitioner", g.START_TRANSITIONER = "startTransitioner", g.STORAGE_INIT = "stroageInit", g.SUBSCRIBE = "subscribe", g.REMOVE_CLOUD = "removeCloud", g.UPDATE = "update", g.VERSION = "version", g.WIDGET_UPDATE = "widgetUpdate", g))(se || {}), Vt = /* @__PURE__ */ ((g) => (g.APPROVED = "approved", g.BEFORE = "before", g.DELAYED = "delayed", g.NONE = "none", g.REALTIME = "realtime", g))(Vt || {}), he = /* @__PURE__ */ ((g) => (g.KEYVAL = "keyval", g.LOCAL = "local", g.SESSION = "session", g.DEXIE = "dexie", g.WINDOW = "window", g))(he || {});
|
|
3255
3255
|
function V(g) {
|
|
3256
3256
|
let i = `${g.type}.${g.topics}`;
|
|
3257
3257
|
return g.order && (i += `.${g.order}`), g.period && (i += `.${g.period}`), i;
|
|
@@ -3259,17 +3259,17 @@ function V(g) {
|
|
|
3259
3259
|
function nt(g) {
|
|
3260
3260
|
var i;
|
|
3261
3261
|
if (g.widget === void 0) {
|
|
3262
|
-
const
|
|
3263
|
-
|
|
3262
|
+
const u = (i = g.topics) == null ? void 0 : i.split("-");
|
|
3263
|
+
u && u.length > 1 ? (g.dashboard = u ? u[0] : "", g.widget = u ? u[1] : "") : (g.widget = g.topics, g.dashboard = g.slide);
|
|
3264
3264
|
}
|
|
3265
3265
|
return g.topics === void 0 && (g.topics = `${g.dashboard}-${g.widget}`), g;
|
|
3266
3266
|
}
|
|
3267
3267
|
function vt(g, i) {
|
|
3268
3268
|
var N;
|
|
3269
|
-
let
|
|
3269
|
+
let u, h, P, R, K;
|
|
3270
3270
|
switch (g.moderation) {
|
|
3271
3271
|
case Vt.BEFORE:
|
|
3272
|
-
|
|
3272
|
+
u = /* @__PURE__ */ new Date(), h = (N = g.beforeTime) == null ? void 0 : N.split(":"), P = Number.parseInt(h ? h[0] : "00"), R = Number.parseInt(h ? h[1] : "00"), K = Number.parseInt(h ? h[2] : "00"), i.before = u.setHours(P, R, K, 0) / 1e3, i.period || (i.period = u.getDay() === 1 ? 72 : 24);
|
|
3273
3273
|
break;
|
|
3274
3274
|
case Vt.DELAYED:
|
|
3275
3275
|
g.delay && g.delay > 0 && (i.delay = `${g.delay}`);
|
|
@@ -3284,16 +3284,16 @@ function vt(g, i) {
|
|
|
3284
3284
|
}
|
|
3285
3285
|
class Tr {
|
|
3286
3286
|
constructor(i) {
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3287
|
+
D(this, "db");
|
|
3288
|
+
D(this, "subscribers", []);
|
|
3289
|
+
D(this, "options");
|
|
3290
3290
|
/**
|
|
3291
3291
|
* Retrieve Cloud Data
|
|
3292
3292
|
* @param query IQuery
|
|
3293
3293
|
* @returns IResponse
|
|
3294
3294
|
*/
|
|
3295
|
-
|
|
3296
|
-
const
|
|
3295
|
+
D(this, "getCloud", async (i) => {
|
|
3296
|
+
const u = await this.db.table(j.CLOUD).where({ id: i.widget }).last().catch(() => {
|
|
3297
3297
|
console.warn(
|
|
3298
3298
|
"%capi%C %ccloud",
|
|
3299
3299
|
x.API,
|
|
@@ -3303,15 +3303,15 @@ class Tr {
|
|
|
3303
3303
|
i.widget
|
|
3304
3304
|
);
|
|
3305
3305
|
});
|
|
3306
|
-
return
|
|
3306
|
+
return u === void 0 ? { data: null, message: "Cloud Data error", success: !1 } : (u.data.presentation = (i == null ? void 0 : i.presentation) || "not set", u.data.slide = (i == null ? void 0 : i.slide) || "not set", u.message = "Messages retrieved successfully", u.success = !0, u);
|
|
3307
3307
|
});
|
|
3308
3308
|
/**
|
|
3309
3309
|
* Retrieve Cloud Data
|
|
3310
3310
|
* @param query IQuery
|
|
3311
3311
|
* @returns IResponse
|
|
3312
3312
|
*/
|
|
3313
|
-
|
|
3314
|
-
const
|
|
3313
|
+
D(this, "getSeries", async (i) => {
|
|
3314
|
+
const u = await this.db.table(j.SERIES).where({ id: i.widget }).last().catch(() => {
|
|
3315
3315
|
console.warn(
|
|
3316
3316
|
"%capi%c %cseries",
|
|
3317
3317
|
x.API,
|
|
@@ -3321,17 +3321,17 @@ class Tr {
|
|
|
3321
3321
|
i.widget
|
|
3322
3322
|
);
|
|
3323
3323
|
});
|
|
3324
|
-
return
|
|
3324
|
+
return u === void 0 ? { data: null, message: "Series Data error", success: !1 } : (u.data.presentation = (i == null ? void 0 : i.presentation) || "not set", u.data.slide = (i == null ? void 0 : i.slide) || "not set", u.message = "Messages retrieved successfully", u.success = !0, u);
|
|
3325
3325
|
});
|
|
3326
3326
|
/**
|
|
3327
3327
|
* Retrieve Cloud Data
|
|
3328
3328
|
* @param query IQuery
|
|
3329
3329
|
* @returns IResponse
|
|
3330
3330
|
*/
|
|
3331
|
-
|
|
3332
|
-
const
|
|
3331
|
+
D(this, "getMessages", async (i) => {
|
|
3332
|
+
const u = (R) => R.widget_id === i.widget, h = (R) => R.utc > ((i == null ? void 0 : i.since) || 0), P = (R) => (R == null ? void 0 : R.visible) !== 0;
|
|
3333
3333
|
try {
|
|
3334
|
-
const R = await this.db.table(
|
|
3334
|
+
const R = await this.db.table(j.TOPICS).orderBy("utc").reverse().filter(u).filter(h).filter(P).limit((i == null ? void 0 : i.limit) ?? 25).toArray().catch(() => {
|
|
3335
3335
|
console.warn(
|
|
3336
3336
|
"%capi%c %cmessages",
|
|
3337
3337
|
x.API,
|
|
@@ -3343,9 +3343,9 @@ class Tr {
|
|
|
3343
3343
|
});
|
|
3344
3344
|
if (R.length === 0)
|
|
3345
3345
|
return { data: null, message: "No Messages error", success: !1 };
|
|
3346
|
-
const
|
|
3346
|
+
const K = R[0] ? R[0].title : "No title", N = R.map(
|
|
3347
3347
|
(be) => be.message_id
|
|
3348
|
-
), te = (await this.db.table(
|
|
3348
|
+
), te = (await this.db.table(j.MESSAGES).where("id").anyOf(N).toArray().then((be) => be.sort((ie, xe) => xe.utc - ie.utc))).map(
|
|
3349
3349
|
(be) => be.data
|
|
3350
3350
|
);
|
|
3351
3351
|
return {
|
|
@@ -3353,7 +3353,7 @@ class Tr {
|
|
|
3353
3353
|
presentation: (i == null ? void 0 : i.presentation) || "not set",
|
|
3354
3354
|
slide: (i == null ? void 0 : i.slide) || "not set",
|
|
3355
3355
|
messages: te,
|
|
3356
|
-
title:
|
|
3356
|
+
title: K,
|
|
3357
3357
|
topics: [i.dashboard, i.widget].join("-"),
|
|
3358
3358
|
query: i
|
|
3359
3359
|
},
|
|
@@ -3370,10 +3370,10 @@ class Tr {
|
|
|
3370
3370
|
* @param data
|
|
3371
3371
|
* @returns number
|
|
3372
3372
|
*/
|
|
3373
|
-
|
|
3373
|
+
D(this, "setCloud", async (i, u) => i.type === j.CLOUD && u !== "" ? await this.db.table(j.CLOUD).put({
|
|
3374
3374
|
id: i.widget,
|
|
3375
3375
|
dashboard_id: i.dashboard,
|
|
3376
|
-
data:
|
|
3376
|
+
data: u.data
|
|
3377
3377
|
}).then(() => 201).catch((h) => (console.error("%cstorage", x.STORAGE, "set", i, h), 400)) : 400);
|
|
3378
3378
|
/**
|
|
3379
3379
|
* Update Series
|
|
@@ -3381,10 +3381,10 @@ class Tr {
|
|
|
3381
3381
|
* @param data
|
|
3382
3382
|
* @returns number
|
|
3383
3383
|
*/
|
|
3384
|
-
|
|
3384
|
+
D(this, "setSeries", async (i, u) => i.type === j.SERIES && u !== "" ? await this.db.table(j.SERIES).put({
|
|
3385
3385
|
id: i.widget,
|
|
3386
3386
|
dashboard_id: i.dashboard,
|
|
3387
|
-
data:
|
|
3387
|
+
data: u.data
|
|
3388
3388
|
}).then(() => 201).catch((h) => (console.error("%cstorage", x.STORAGE, "set", i, h), 400)) : 400);
|
|
3389
3389
|
/**
|
|
3390
3390
|
* Update Messages
|
|
@@ -3395,57 +3395,62 @@ class Tr {
|
|
|
3395
3395
|
* @param data.data.messages IMessages
|
|
3396
3396
|
* @returns number
|
|
3397
3397
|
*/
|
|
3398
|
-
|
|
3399
|
-
if (i.type !==
|
|
3398
|
+
D(this, "setMessages", async (i, u) => {
|
|
3399
|
+
if (i.type !== j.MESSAGES)
|
|
3400
3400
|
return 400;
|
|
3401
|
-
const h =
|
|
3401
|
+
const h = u.title;
|
|
3402
3402
|
try {
|
|
3403
|
-
return
|
|
3404
|
-
var R,
|
|
3405
|
-
await this.db.table(
|
|
3403
|
+
return u.data.messages.forEach(async (P) => {
|
|
3404
|
+
var R, K, N;
|
|
3405
|
+
await this.db.table(j.MESSAGES).put({ id: P.id, utc: P.utc, data: P }), await this.db.table(j.TOPICS).put({
|
|
3406
3406
|
widget_id: i.widget,
|
|
3407
|
-
message_id:
|
|
3407
|
+
message_id: P.id,
|
|
3408
3408
|
dashboard_id: i.dashboard,
|
|
3409
3409
|
title: h,
|
|
3410
|
-
engagement: (R =
|
|
3411
|
-
impressions: (
|
|
3412
|
-
reach: (N =
|
|
3413
|
-
sentiment:
|
|
3414
|
-
utc:
|
|
3410
|
+
engagement: (R = P.dynamics) == null ? void 0 : R.engagement,
|
|
3411
|
+
impressions: (K = P.dynamics) == null ? void 0 : K.semrush_visits,
|
|
3412
|
+
reach: (N = P.dynamics) == null ? void 0 : N.potential_reach,
|
|
3413
|
+
sentiment: P.topics[0].sentiment,
|
|
3414
|
+
utc: P.utc
|
|
3415
3415
|
});
|
|
3416
3416
|
}), 201;
|
|
3417
|
-
} catch (
|
|
3418
|
-
return console.error("%cstorage", x.STORAGE, "set", i,
|
|
3417
|
+
} catch (P) {
|
|
3418
|
+
return console.error("%cstorage", x.STORAGE, "set", i, P), 400;
|
|
3419
3419
|
}
|
|
3420
3420
|
});
|
|
3421
3421
|
/**
|
|
3422
3422
|
* Wipe Message data after number of seconds
|
|
3423
3423
|
* @param retentionDuration
|
|
3424
3424
|
*/
|
|
3425
|
-
|
|
3426
|
-
const
|
|
3427
|
-
await this.db.table(
|
|
3428
|
-
delete
|
|
3425
|
+
D(this, "cleanMessages", async (i) => {
|
|
3426
|
+
const u = Date.now() / 1e3, h = (R) => R.utc < u - i, P = (R) => R.utc < u - i;
|
|
3427
|
+
await this.db.table(j.TOPICS).orderBy("utc").filter(h).modify((R, K) => {
|
|
3428
|
+
delete K.value;
|
|
3429
|
+
}), await this.db.table(j.MESSAGES).orderBy("utc").filter(P).modify((R, K) => {
|
|
3430
|
+
delete K.value;
|
|
3429
3431
|
});
|
|
3430
3432
|
});
|
|
3433
|
+
D(this, "hideMessage", async (i, u) => {
|
|
3434
|
+
await this.db.table(j.TOPICS).where("message_id").equals(i).modify({ visible: u });
|
|
3435
|
+
});
|
|
3431
3436
|
/**
|
|
3432
3437
|
* Update Cloud
|
|
3433
3438
|
* @param query IQuery
|
|
3434
3439
|
* @returns number
|
|
3435
3440
|
*/
|
|
3436
|
-
|
|
3441
|
+
D(this, "setWidget", async (i) => await this.db.table(j.WIDGETS).put({
|
|
3437
3442
|
id: i.widget,
|
|
3438
3443
|
dashboard_id: i.dashboard,
|
|
3439
3444
|
type: i.type
|
|
3440
|
-
}).then(() => 201).catch((
|
|
3445
|
+
}).then(() => 201).catch((u) => (console.error("%cstorage", x.STORAGE, j.WIDGET, i, u), 400)));
|
|
3441
3446
|
/**
|
|
3442
3447
|
* Add component subscriber
|
|
3443
3448
|
* @param query IQuery
|
|
3444
3449
|
* @returns null
|
|
3445
3450
|
*/
|
|
3446
|
-
|
|
3451
|
+
D(this, "subscribe", (i) => (i = nt(i), this.subscribers.filter(
|
|
3447
3452
|
(h) => h.widget === i.widget
|
|
3448
|
-
).length > 0 || (i.type ===
|
|
3453
|
+
).length > 0 || (i.type === j.MESSAGES && (i = vt(this.options, i)), console.debug(
|
|
3449
3454
|
"%cstorage%c %csubscribe",
|
|
3450
3455
|
x.STORAGE,
|
|
3451
3456
|
x.NONE,
|
|
@@ -3457,8 +3462,8 @@ class Tr {
|
|
|
3457
3462
|
* Get current subscribers
|
|
3458
3463
|
* @returns IQuery[]
|
|
3459
3464
|
*/
|
|
3460
|
-
|
|
3461
|
-
this.options = i, this.db = new
|
|
3465
|
+
D(this, "getSubscribers", async () => await new Promise((i) => i(this.subscribers)));
|
|
3466
|
+
this.options = i, this.db = new Un(i.app), this.db.version(2).stores({
|
|
3462
3467
|
player: "id,title,name,location",
|
|
3463
3468
|
monitor: "id,player_id,cols,rows,order,width,height,physicalwidth,physicalheight,devicePixelRatio,screenLeft,screenTop,orientation,monitor",
|
|
3464
3469
|
display: "id,monitor_id,presentation_id,colstart,colend,rowstart,rowend",
|
|
@@ -3473,41 +3478,41 @@ class Tr {
|
|
|
3473
3478
|
}
|
|
3474
3479
|
}
|
|
3475
3480
|
function Wn(g) {
|
|
3476
|
-
return new Promise((i,
|
|
3477
|
-
g.oncomplete = g.onsuccess = () => i(g.result), g.onabort = g.onerror = () =>
|
|
3481
|
+
return new Promise((i, u) => {
|
|
3482
|
+
g.oncomplete = g.onsuccess = () => i(g.result), g.onabort = g.onerror = () => u(g.error);
|
|
3478
3483
|
});
|
|
3479
3484
|
}
|
|
3480
3485
|
function Pi(g, i) {
|
|
3481
|
-
const
|
|
3482
|
-
|
|
3483
|
-
const h = Wn(
|
|
3484
|
-
return (
|
|
3486
|
+
const u = indexedDB.open(g);
|
|
3487
|
+
u.onupgradeneeded = () => u.result.createObjectStore(i);
|
|
3488
|
+
const h = Wn(u);
|
|
3489
|
+
return (P, R) => h.then((K) => R(K.transaction(i, P).objectStore(i)));
|
|
3485
3490
|
}
|
|
3486
3491
|
let Ln;
|
|
3487
|
-
function
|
|
3492
|
+
function Mr() {
|
|
3488
3493
|
return Ln || (Ln = Pi("keyval-store", "keyval")), Ln;
|
|
3489
3494
|
}
|
|
3490
|
-
function Gn(g, i =
|
|
3491
|
-
return i("readonly", (
|
|
3495
|
+
function Gn(g, i = Mr()) {
|
|
3496
|
+
return i("readonly", (u) => Wn(u.get(g)));
|
|
3492
3497
|
}
|
|
3493
|
-
function Xt(g, i,
|
|
3494
|
-
return
|
|
3498
|
+
function Xt(g, i, u = Mr()) {
|
|
3499
|
+
return u("readwrite", (h) => (h.put(i, g), Wn(h.transaction)));
|
|
3495
3500
|
}
|
|
3496
|
-
class
|
|
3501
|
+
class jr {
|
|
3497
3502
|
constructor(i) {
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
const
|
|
3502
|
-
return await Gn(
|
|
3503
|
+
D(this, "subscribers", []);
|
|
3504
|
+
D(this, "options");
|
|
3505
|
+
D(this, "getCloud", async (i) => {
|
|
3506
|
+
const u = V(i);
|
|
3507
|
+
return await Gn(u).then((h) => h).catch(() => (console.warn("%capi", x.API, j.CLOUD, i.slide, i.widget), { data: null, message: "Cloud Data error", success: !1 }));
|
|
3503
3508
|
});
|
|
3504
|
-
|
|
3505
|
-
const
|
|
3506
|
-
return await Gn(
|
|
3509
|
+
D(this, "getSeries", async (i) => {
|
|
3510
|
+
const u = V(i);
|
|
3511
|
+
return await Gn(u).then((h) => h).catch(() => (console.warn("%capi", x.API, j.SERIES, i.slide, i.widget), { data: null, message: "Series Data error", success: !1 }));
|
|
3507
3512
|
});
|
|
3508
|
-
|
|
3509
|
-
const
|
|
3510
|
-
return await Gn(
|
|
3513
|
+
D(this, "getMessages", async (i) => {
|
|
3514
|
+
const u = V(i);
|
|
3515
|
+
return await Gn(u).then((h) => h).catch(() => (console.warn("%capi", x.API, j.MESSAGES, i.slide, i.widget), { data: null, message: "Messages Data error", success: !1 }));
|
|
3511
3516
|
});
|
|
3512
3517
|
/**
|
|
3513
3518
|
* Update Cloud
|
|
@@ -3515,11 +3520,11 @@ class Mr {
|
|
|
3515
3520
|
* @param data
|
|
3516
3521
|
* @returns number
|
|
3517
3522
|
*/
|
|
3518
|
-
|
|
3519
|
-
if (!
|
|
3523
|
+
D(this, "setCloud", async (i, u) => {
|
|
3524
|
+
if (!u.success)
|
|
3520
3525
|
return 400;
|
|
3521
3526
|
const h = V(i);
|
|
3522
|
-
return delete
|
|
3527
|
+
return delete u.success, delete u.message, await Xt(h, u).then(() => 201).catch((P) => (console.error("%cstorage", x.STORAGE, j.CLOUD, i, P), 400));
|
|
3523
3528
|
});
|
|
3524
3529
|
/**
|
|
3525
3530
|
* Update Series
|
|
@@ -3527,11 +3532,11 @@ class Mr {
|
|
|
3527
3532
|
* @param data
|
|
3528
3533
|
* @returns bumber
|
|
3529
3534
|
*/
|
|
3530
|
-
|
|
3531
|
-
if (!
|
|
3535
|
+
D(this, "setSeries", async (i, u) => {
|
|
3536
|
+
if (!u.success)
|
|
3532
3537
|
return 400;
|
|
3533
3538
|
const h = V(i);
|
|
3534
|
-
return delete
|
|
3539
|
+
return delete u.success, delete u.message, await Xt(h, u).then(() => 201).catch((P) => (console.error("%cstorage", x.STORAGE, j.SERIES, i, P), 400));
|
|
3535
3540
|
});
|
|
3536
3541
|
/**
|
|
3537
3542
|
* Update Messages
|
|
@@ -3539,32 +3544,35 @@ class Mr {
|
|
|
3539
3544
|
* @param data
|
|
3540
3545
|
* @returns number
|
|
3541
3546
|
*/
|
|
3542
|
-
|
|
3543
|
-
if (!
|
|
3547
|
+
D(this, "setMessages", async (i, u) => {
|
|
3548
|
+
if (!u.success)
|
|
3544
3549
|
return 400;
|
|
3545
3550
|
const h = V(i);
|
|
3546
|
-
return delete
|
|
3551
|
+
return delete u.success, delete u.message, await Xt(h, u).then(() => 201).catch((P) => (console.error("%cstorage", x.STORAGE, j.MESSAGES, i, P), 400));
|
|
3552
|
+
});
|
|
3553
|
+
D(this, "cleanMessages", async (i) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((u) => u())));
|
|
3554
|
+
D(this, "hideMessage", async (i, u) => {
|
|
3555
|
+
console.debug(`hideMessage ${i} ${u} not implemented for ${this.options.storage}`);
|
|
3547
3556
|
});
|
|
3548
|
-
C(this, "cleanMessages", async (i) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((c) => c())));
|
|
3549
3557
|
/**
|
|
3550
3558
|
* Update Cloud
|
|
3551
3559
|
* @param query IQuery
|
|
3552
3560
|
* @returns number
|
|
3553
3561
|
*/
|
|
3554
|
-
|
|
3555
|
-
const
|
|
3562
|
+
D(this, "setWidget", async (i) => {
|
|
3563
|
+
const u = V(i), h = {
|
|
3556
3564
|
id: i.widget,
|
|
3557
3565
|
dashboard_id: i.dashboard,
|
|
3558
3566
|
type: i.type
|
|
3559
3567
|
};
|
|
3560
|
-
return await Xt(
|
|
3568
|
+
return await Xt(u, h).then(() => 201).catch((P) => (console.error("%cstorage", x.STORAGE, j.WIDGET, i, P), 400));
|
|
3561
3569
|
});
|
|
3562
3570
|
/**
|
|
3563
3571
|
* Add component subscriber
|
|
3564
3572
|
* @param query IQuery
|
|
3565
3573
|
* @returns null
|
|
3566
3574
|
*/
|
|
3567
|
-
|
|
3575
|
+
D(this, "subscribe", (i) => (i = nt(i), i.type === j.MESSAGES && (i = vt(this.options, i)), this.subscribers.filter(
|
|
3568
3576
|
(h) => h.widget === i.widget
|
|
3569
3577
|
).length > 0 || (console.debug(
|
|
3570
3578
|
"%cstorage%c %csubscribe",
|
|
@@ -3578,36 +3586,36 @@ class Mr {
|
|
|
3578
3586
|
* Get current subscribers
|
|
3579
3587
|
* @returns IQuery[]
|
|
3580
3588
|
*/
|
|
3581
|
-
|
|
3589
|
+
D(this, "getSubscribers", async () => await new Promise((i) => i(this.subscribers)));
|
|
3582
3590
|
this.options = i;
|
|
3583
3591
|
}
|
|
3584
3592
|
}
|
|
3585
3593
|
class Kr {
|
|
3586
3594
|
constructor(i) {
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
const
|
|
3595
|
+
D(this, "subscribers", []);
|
|
3596
|
+
D(this, "options");
|
|
3597
|
+
D(this, "getCloud", async (i) => {
|
|
3598
|
+
const u = V(i);
|
|
3591
3599
|
try {
|
|
3592
|
-
return localStorage.getObject(
|
|
3600
|
+
return localStorage.getObject(u);
|
|
3593
3601
|
} catch {
|
|
3594
|
-
return console.warn("%capi", x.API,
|
|
3602
|
+
return console.warn("%capi", x.API, j.CLOUD, i.slide, i.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3595
3603
|
}
|
|
3596
3604
|
});
|
|
3597
|
-
|
|
3598
|
-
const
|
|
3605
|
+
D(this, "getSeries", async (i) => {
|
|
3606
|
+
const u = V(i);
|
|
3599
3607
|
try {
|
|
3600
|
-
return localStorage.getObject(
|
|
3608
|
+
return localStorage.getObject(u);
|
|
3601
3609
|
} catch {
|
|
3602
|
-
return console.warn("%capi", x.API,
|
|
3610
|
+
return console.warn("%capi", x.API, j.SERIES, i.slide, i.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3603
3611
|
}
|
|
3604
3612
|
});
|
|
3605
|
-
|
|
3606
|
-
const
|
|
3613
|
+
D(this, "getMessages", async (i) => {
|
|
3614
|
+
const u = V(i);
|
|
3607
3615
|
try {
|
|
3608
|
-
return localStorage.getObject(
|
|
3616
|
+
return localStorage.getObject(u);
|
|
3609
3617
|
} catch {
|
|
3610
|
-
return console.warn("%capi", x.API,
|
|
3618
|
+
return console.warn("%capi", x.API, j.MESSAGES, i.slide, i.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3611
3619
|
}
|
|
3612
3620
|
});
|
|
3613
3621
|
/**
|
|
@@ -3616,12 +3624,12 @@ class Kr {
|
|
|
3616
3624
|
* @param data
|
|
3617
3625
|
* @returns number
|
|
3618
3626
|
*/
|
|
3619
|
-
|
|
3627
|
+
D(this, "setCloud", async (i, u) => {
|
|
3620
3628
|
const h = V(i);
|
|
3621
3629
|
try {
|
|
3622
|
-
return localStorage.setObject(h,
|
|
3623
|
-
} catch (
|
|
3624
|
-
return console.error("%cstorage", x.STORAGE,
|
|
3630
|
+
return localStorage.setObject(h, u), 201;
|
|
3631
|
+
} catch (P) {
|
|
3632
|
+
return console.error("%cstorage", x.STORAGE, j.CLOUD, i, P), 400;
|
|
3625
3633
|
}
|
|
3626
3634
|
});
|
|
3627
3635
|
/**
|
|
@@ -3630,12 +3638,12 @@ class Kr {
|
|
|
3630
3638
|
* @param data
|
|
3631
3639
|
* @returns number
|
|
3632
3640
|
*/
|
|
3633
|
-
|
|
3641
|
+
D(this, "setSeries", async (i, u) => {
|
|
3634
3642
|
const h = V(i);
|
|
3635
3643
|
try {
|
|
3636
|
-
return localStorage.setObject(h,
|
|
3637
|
-
} catch (
|
|
3638
|
-
return console.error("%cstorage", x.STORAGE,
|
|
3644
|
+
return localStorage.setObject(h, u), 201;
|
|
3645
|
+
} catch (P) {
|
|
3646
|
+
return console.error("%cstorage", x.STORAGE, j.SERIES, i, P), 400;
|
|
3639
3647
|
}
|
|
3640
3648
|
});
|
|
3641
3649
|
/**
|
|
@@ -3644,23 +3652,26 @@ class Kr {
|
|
|
3644
3652
|
* @param data
|
|
3645
3653
|
* @returns number
|
|
3646
3654
|
*/
|
|
3647
|
-
|
|
3655
|
+
D(this, "setMessages", async (i, u) => {
|
|
3648
3656
|
const h = V(i);
|
|
3649
3657
|
try {
|
|
3650
|
-
return localStorage.setObject(h,
|
|
3651
|
-
} catch (
|
|
3652
|
-
return console.error("%cstorage", x.STORAGE,
|
|
3658
|
+
return localStorage.setObject(h, u), 200;
|
|
3659
|
+
} catch (P) {
|
|
3660
|
+
return console.error("%cstorage", x.STORAGE, j.MESSAGES, i, P), 400;
|
|
3653
3661
|
}
|
|
3654
3662
|
});
|
|
3655
|
-
|
|
3663
|
+
D(this, "cleanMessages", async (i) => {
|
|
3656
3664
|
console.log("cleanMessages not implemented for ", this.options.storage);
|
|
3657
3665
|
});
|
|
3658
|
-
|
|
3659
|
-
|
|
3666
|
+
D(this, "hideMessage", async (i, u) => {
|
|
3667
|
+
console.debug(`hideMessage ${i} ${u} not implemented for ${this.options.storage}`);
|
|
3668
|
+
});
|
|
3669
|
+
D(this, "setWidget", async (i) => {
|
|
3670
|
+
const u = `widget.${i.widget}`;
|
|
3660
3671
|
try {
|
|
3661
|
-
return localStorage.setObject(
|
|
3672
|
+
return localStorage.setObject(u, i), 201;
|
|
3662
3673
|
} catch (h) {
|
|
3663
|
-
return console.error("%cstorage", x.STORAGE,
|
|
3674
|
+
return console.error("%cstorage", x.STORAGE, j.WIDGET, i, h), 400;
|
|
3664
3675
|
}
|
|
3665
3676
|
});
|
|
3666
3677
|
/**
|
|
@@ -3668,7 +3679,7 @@ class Kr {
|
|
|
3668
3679
|
* @param query IQuery
|
|
3669
3680
|
* @returns null
|
|
3670
3681
|
*/
|
|
3671
|
-
|
|
3682
|
+
D(this, "subscribe", (i) => (i = nt(i), i.type === j.MESSAGES && (i = vt(this.options, i)), this.subscribers.filter(
|
|
3672
3683
|
(h) => h.widget === i.widget
|
|
3673
3684
|
).length || (console.debug(
|
|
3674
3685
|
"%cstorage%c %csubscribe",
|
|
@@ -3682,41 +3693,41 @@ class Kr {
|
|
|
3682
3693
|
* Get current subscribers
|
|
3683
3694
|
* @returns IQuery[]
|
|
3684
3695
|
*/
|
|
3685
|
-
|
|
3686
|
-
this.options = i, Storage.prototype.setObject = function(
|
|
3687
|
-
this.setObject(
|
|
3688
|
-
}, Storage.prototype.getObject = function(
|
|
3689
|
-
const h = this.getObject(
|
|
3696
|
+
D(this, "getSubscribers", async () => await new Promise((i) => i(this.subscribers)));
|
|
3697
|
+
this.options = i, Storage.prototype.setObject = function(u, h) {
|
|
3698
|
+
this.setObject(u, JSON.stringify(h));
|
|
3699
|
+
}, Storage.prototype.getObject = function(u) {
|
|
3700
|
+
const h = this.getObject(u);
|
|
3690
3701
|
return h && JSON.parse(h);
|
|
3691
3702
|
};
|
|
3692
3703
|
}
|
|
3693
3704
|
}
|
|
3694
3705
|
class Br {
|
|
3695
3706
|
constructor(i) {
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
const
|
|
3707
|
+
D(this, "subscribers", []);
|
|
3708
|
+
D(this, "options");
|
|
3709
|
+
D(this, "getCloud", async (i) => {
|
|
3710
|
+
const u = V(i);
|
|
3700
3711
|
try {
|
|
3701
|
-
return sessionStorage.getObject(
|
|
3712
|
+
return sessionStorage.getObject(u);
|
|
3702
3713
|
} catch {
|
|
3703
|
-
return console.warn("%capi", x.API,
|
|
3714
|
+
return console.warn("%capi", x.API, j.CLOUD, i.slide, i.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3704
3715
|
}
|
|
3705
3716
|
});
|
|
3706
|
-
|
|
3707
|
-
const
|
|
3717
|
+
D(this, "getSeries", async (i) => {
|
|
3718
|
+
const u = V(i);
|
|
3708
3719
|
try {
|
|
3709
|
-
return sessionStorage.getObject(
|
|
3720
|
+
return sessionStorage.getObject(u);
|
|
3710
3721
|
} catch {
|
|
3711
|
-
return console.warn("%capi", x.API,
|
|
3722
|
+
return console.warn("%capi", x.API, j.SERIES, i.slide, i.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3712
3723
|
}
|
|
3713
3724
|
});
|
|
3714
|
-
|
|
3715
|
-
const
|
|
3725
|
+
D(this, "getMessages", async (i) => {
|
|
3726
|
+
const u = V(i);
|
|
3716
3727
|
try {
|
|
3717
|
-
return sessionStorage.getObject(
|
|
3728
|
+
return sessionStorage.getObject(u);
|
|
3718
3729
|
} catch {
|
|
3719
|
-
return console.warn("%capi", x.API,
|
|
3730
|
+
return console.warn("%capi", x.API, j.MESSAGES, i.slide, i.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3720
3731
|
}
|
|
3721
3732
|
});
|
|
3722
3733
|
/**
|
|
@@ -3725,12 +3736,12 @@ class Br {
|
|
|
3725
3736
|
* @param data
|
|
3726
3737
|
* @returns number
|
|
3727
3738
|
*/
|
|
3728
|
-
|
|
3739
|
+
D(this, "setCloud", async (i, u) => {
|
|
3729
3740
|
const h = V(i);
|
|
3730
3741
|
try {
|
|
3731
|
-
return sessionStorage.setObject(h,
|
|
3732
|
-
} catch (
|
|
3733
|
-
return console.error("%cstorage", x.STORAGE,
|
|
3742
|
+
return sessionStorage.setObject(h, u), 201;
|
|
3743
|
+
} catch (P) {
|
|
3744
|
+
return console.error("%cstorage", x.STORAGE, j.CLOUD, i, P), 400;
|
|
3734
3745
|
}
|
|
3735
3746
|
});
|
|
3736
3747
|
/**
|
|
@@ -3739,12 +3750,12 @@ class Br {
|
|
|
3739
3750
|
* @param data
|
|
3740
3751
|
* @returns number
|
|
3741
3752
|
*/
|
|
3742
|
-
|
|
3753
|
+
D(this, "setSeries", async (i, u) => {
|
|
3743
3754
|
const h = V(i);
|
|
3744
3755
|
try {
|
|
3745
|
-
return sessionStorage.setObject(h,
|
|
3746
|
-
} catch (
|
|
3747
|
-
return console.error("%cstorage", x.STORAGE,
|
|
3756
|
+
return sessionStorage.setObject(h, u), 201;
|
|
3757
|
+
} catch (P) {
|
|
3758
|
+
return console.error("%cstorage", x.STORAGE, j.SERIES, i, P), 400;
|
|
3748
3759
|
}
|
|
3749
3760
|
});
|
|
3750
3761
|
/**
|
|
@@ -3753,23 +3764,26 @@ class Br {
|
|
|
3753
3764
|
* @param data
|
|
3754
3765
|
* @returns number
|
|
3755
3766
|
*/
|
|
3756
|
-
|
|
3767
|
+
D(this, "setMessages", async (i, u) => {
|
|
3757
3768
|
const h = V(i);
|
|
3758
3769
|
try {
|
|
3759
|
-
return sessionStorage.setObject(h,
|
|
3760
|
-
} catch (
|
|
3761
|
-
return console.error("%cstorage", x.STORAGE,
|
|
3770
|
+
return sessionStorage.setObject(h, u), 200;
|
|
3771
|
+
} catch (P) {
|
|
3772
|
+
return console.error("%cstorage", x.STORAGE, j.MESSAGES, i, P), 400;
|
|
3762
3773
|
}
|
|
3763
3774
|
});
|
|
3764
|
-
|
|
3775
|
+
D(this, "cleanMessages", async (i) => {
|
|
3765
3776
|
console.log("cleanMessages not implemented for ", this.options.storage);
|
|
3766
3777
|
});
|
|
3767
|
-
|
|
3768
|
-
|
|
3778
|
+
D(this, "hideMessage", async (i, u) => {
|
|
3779
|
+
console.debug(`hideMessage ${i} ${u} not implemented for ${this.options.storage}`);
|
|
3780
|
+
});
|
|
3781
|
+
D(this, "setWidget", async (i) => {
|
|
3782
|
+
const u = `widget.${i.widget}`;
|
|
3769
3783
|
try {
|
|
3770
|
-
return sessionStorage.setObject(
|
|
3784
|
+
return sessionStorage.setObject(u, i), 201;
|
|
3771
3785
|
} catch (h) {
|
|
3772
|
-
return console.error("%cstorage", x.STORAGE,
|
|
3786
|
+
return console.error("%cstorage", x.STORAGE, j.WIDGET, i, h), 400;
|
|
3773
3787
|
}
|
|
3774
3788
|
});
|
|
3775
3789
|
/**
|
|
@@ -3777,7 +3791,7 @@ class Br {
|
|
|
3777
3791
|
* @param query IQuery
|
|
3778
3792
|
* @returns null
|
|
3779
3793
|
*/
|
|
3780
|
-
|
|
3794
|
+
D(this, "subscribe", (i) => (i = nt(i), i.type === j.MESSAGES && (i = vt(this.options, i)), this.subscribers.filter(
|
|
3781
3795
|
(h) => h.widget === i.widget
|
|
3782
3796
|
).length || (console.debug(
|
|
3783
3797
|
"%cstorage%c %csubscribe",
|
|
@@ -3791,41 +3805,41 @@ class Br {
|
|
|
3791
3805
|
* Get current subscribers
|
|
3792
3806
|
* @returns IQuery[]
|
|
3793
3807
|
*/
|
|
3794
|
-
|
|
3795
|
-
this.options = i, Storage.prototype.setObject = function(
|
|
3796
|
-
this.setItem(
|
|
3797
|
-
}, Storage.prototype.getObject = function(
|
|
3798
|
-
const h = this.getItem(
|
|
3808
|
+
D(this, "getSubscribers", async () => await new Promise((i) => i(this.subscribers)));
|
|
3809
|
+
this.options = i, Storage.prototype.setObject = function(u, h) {
|
|
3810
|
+
this.setItem(u, JSON.stringify(h));
|
|
3811
|
+
}, Storage.prototype.getObject = function(u) {
|
|
3812
|
+
const h = this.getItem(u);
|
|
3799
3813
|
return h && JSON.parse(h);
|
|
3800
3814
|
};
|
|
3801
3815
|
}
|
|
3802
3816
|
}
|
|
3803
3817
|
class Nr {
|
|
3804
3818
|
constructor(i) {
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
const
|
|
3819
|
+
D(this, "subscribers", []);
|
|
3820
|
+
D(this, "options");
|
|
3821
|
+
D(this, "getCloud", async (i) => {
|
|
3822
|
+
const u = V(i);
|
|
3809
3823
|
try {
|
|
3810
|
-
return window.BuzzCasting.WidgetData[
|
|
3824
|
+
return window.BuzzCasting.WidgetData[u];
|
|
3811
3825
|
} catch {
|
|
3812
|
-
return console.warn("%capi", x.API,
|
|
3826
|
+
return console.warn("%capi", x.API, j.CLOUD, i.slide, i.widget), { data: null, message: "Cloud Data error", success: !1 };
|
|
3813
3827
|
}
|
|
3814
3828
|
});
|
|
3815
|
-
|
|
3816
|
-
const
|
|
3829
|
+
D(this, "getSeries", async (i) => {
|
|
3830
|
+
const u = V(i);
|
|
3817
3831
|
try {
|
|
3818
|
-
return window.BuzzCasting.WidgetData[
|
|
3832
|
+
return window.BuzzCasting.WidgetData[u];
|
|
3819
3833
|
} catch {
|
|
3820
|
-
return console.warn("%capi", x.API,
|
|
3834
|
+
return console.warn("%capi", x.API, j.SERIES, i.slide, i.widget), { data: null, message: "Series Data error", success: !1 };
|
|
3821
3835
|
}
|
|
3822
3836
|
});
|
|
3823
|
-
|
|
3824
|
-
const
|
|
3837
|
+
D(this, "getMessages", async (i) => {
|
|
3838
|
+
const u = V(i);
|
|
3825
3839
|
try {
|
|
3826
|
-
return window.BuzzCasting.WidgetData[
|
|
3840
|
+
return window.BuzzCasting.WidgetData[u];
|
|
3827
3841
|
} catch {
|
|
3828
|
-
return console.warn("%capi", x.API,
|
|
3842
|
+
return console.warn("%capi", x.API, j.MESSAGES, i.slide, i.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3829
3843
|
}
|
|
3830
3844
|
});
|
|
3831
3845
|
/**
|
|
@@ -3834,12 +3848,12 @@ class Nr {
|
|
|
3834
3848
|
* @param data
|
|
3835
3849
|
* @returns number
|
|
3836
3850
|
*/
|
|
3837
|
-
|
|
3851
|
+
D(this, "setCloud", async (i, u) => {
|
|
3838
3852
|
const h = V(i);
|
|
3839
3853
|
try {
|
|
3840
|
-
return window.BuzzCasting.WidgetData[h] =
|
|
3841
|
-
} catch (
|
|
3842
|
-
return console.error("%cstorage", x.STORAGE, "set", i,
|
|
3854
|
+
return window.BuzzCasting.WidgetData[h] = u, 201;
|
|
3855
|
+
} catch (P) {
|
|
3856
|
+
return console.error("%cstorage", x.STORAGE, "set", i, P), 400;
|
|
3843
3857
|
}
|
|
3844
3858
|
});
|
|
3845
3859
|
/**
|
|
@@ -3848,12 +3862,12 @@ class Nr {
|
|
|
3848
3862
|
* @param data
|
|
3849
3863
|
* @returns number
|
|
3850
3864
|
*/
|
|
3851
|
-
|
|
3865
|
+
D(this, "setSeries", async (i, u) => {
|
|
3852
3866
|
const h = V(i);
|
|
3853
3867
|
try {
|
|
3854
|
-
return window.BuzzCasting.WidgetData[h] =
|
|
3855
|
-
} catch (
|
|
3856
|
-
return console.error("%cstorage", x.STORAGE, "set", i,
|
|
3868
|
+
return window.BuzzCasting.WidgetData[h] = u, 201;
|
|
3869
|
+
} catch (P) {
|
|
3870
|
+
return console.error("%cstorage", x.STORAGE, "set", i, P), 400;
|
|
3857
3871
|
}
|
|
3858
3872
|
});
|
|
3859
3873
|
/**
|
|
@@ -3862,23 +3876,26 @@ class Nr {
|
|
|
3862
3876
|
* @param data
|
|
3863
3877
|
* @returns number
|
|
3864
3878
|
*/
|
|
3865
|
-
|
|
3879
|
+
D(this, "setMessages", async (i, u) => {
|
|
3866
3880
|
const h = V(i);
|
|
3867
3881
|
try {
|
|
3868
|
-
return window.BuzzCasting.WidgetData[h] =
|
|
3869
|
-
} catch (
|
|
3870
|
-
return console.error("%cstorage", x.STORAGE, "set", i,
|
|
3882
|
+
return window.BuzzCasting.WidgetData[h] = u, 201;
|
|
3883
|
+
} catch (P) {
|
|
3884
|
+
return console.error("%cstorage", x.STORAGE, "set", i, P), 400;
|
|
3871
3885
|
}
|
|
3872
3886
|
});
|
|
3873
|
-
|
|
3887
|
+
D(this, "cleanMessages", async (i) => {
|
|
3874
3888
|
console.log("cleanMessages not implemented for ", this.options.storage);
|
|
3875
3889
|
});
|
|
3876
|
-
|
|
3877
|
-
|
|
3890
|
+
D(this, "hideMessage", async (i, u) => {
|
|
3891
|
+
console.debug(`hideMessage ${i} ${u} not implemented for ${this.options.storage}`);
|
|
3892
|
+
});
|
|
3893
|
+
D(this, "setWidget", async (i) => {
|
|
3894
|
+
const u = `widget.${i.widget}`;
|
|
3878
3895
|
try {
|
|
3879
|
-
return window.BuzzCasting.WidgetData[
|
|
3896
|
+
return window.BuzzCasting.WidgetData[u] = i, 201;
|
|
3880
3897
|
} catch (h) {
|
|
3881
|
-
return console.error("%cstorage", x.STORAGE,
|
|
3898
|
+
return console.error("%cstorage", x.STORAGE, j.WIDGET, i, h), 400;
|
|
3882
3899
|
}
|
|
3883
3900
|
});
|
|
3884
3901
|
/**
|
|
@@ -3886,7 +3903,7 @@ class Nr {
|
|
|
3886
3903
|
* @param query IQuery
|
|
3887
3904
|
* @returns null
|
|
3888
3905
|
*/
|
|
3889
|
-
|
|
3906
|
+
D(this, "subscribe", (i) => (i = nt(i), i.type === j.MESSAGES && (i = vt(this.options, i)), this.subscribers.filter(
|
|
3890
3907
|
(h) => h.widget === i.widget
|
|
3891
3908
|
).length || (console.debug(
|
|
3892
3909
|
"%cstorage%c %csubscribe",
|
|
@@ -3900,22 +3917,22 @@ class Nr {
|
|
|
3900
3917
|
* Get current subscribers
|
|
3901
3918
|
* @returns IQuery[]
|
|
3902
3919
|
*/
|
|
3903
|
-
|
|
3920
|
+
D(this, "getSubscribers", async () => await new Promise((i) => i(this.subscribers)));
|
|
3904
3921
|
this.options = i, window.BuzzCasting.WidgetData = /* @__PURE__ */ new Set();
|
|
3905
3922
|
}
|
|
3906
3923
|
}
|
|
3907
3924
|
function Ci(g) {
|
|
3908
3925
|
const i = {};
|
|
3909
|
-
for (let
|
|
3910
|
-
const h = g.item(
|
|
3926
|
+
for (let u = 0; u < g.length; u++) {
|
|
3927
|
+
const h = g.item(u);
|
|
3911
3928
|
h != null && h.name && (i[h.name] = h.value);
|
|
3912
3929
|
}
|
|
3913
3930
|
return i;
|
|
3914
3931
|
}
|
|
3915
3932
|
function Bi(g) {
|
|
3916
3933
|
const i = {};
|
|
3917
|
-
for (let
|
|
3918
|
-
const h = g[
|
|
3934
|
+
for (let u = 0; u < g.length; u++) {
|
|
3935
|
+
const h = g[u];
|
|
3919
3936
|
h.name !== "class" && !h.name.includes("data") && (i[h.name] = h.value);
|
|
3920
3937
|
}
|
|
3921
3938
|
return i;
|
|
@@ -3963,10 +3980,10 @@ function Ni(g, i) {
|
|
|
3963
3980
|
}
|
|
3964
3981
|
}
|
|
3965
3982
|
function Li(g) {
|
|
3966
|
-
return g.replace(/(?:^\w|[A-Z]|\b\w)/g, (i,
|
|
3983
|
+
return g.replace(/(?:^\w|[A-Z]|\b\w)/g, (i, u) => u === 0 ? i.toLowerCase() : i.toUpperCase()).replace(/\s+/g, "");
|
|
3967
3984
|
}
|
|
3968
3985
|
function Gi(g) {
|
|
3969
|
-
return g.toLowerCase().split("-").reduce((i,
|
|
3986
|
+
return g.toLowerCase().split("-").reduce((i, u) => i + (u.charAt(0).toUpperCase() + u.slice(1)));
|
|
3970
3987
|
}
|
|
3971
3988
|
function Ii(g, i) {
|
|
3972
3989
|
for (; g.length < i; )
|
|
@@ -3974,39 +3991,39 @@ function Ii(g, i) {
|
|
|
3974
3991
|
return g;
|
|
3975
3992
|
}
|
|
3976
3993
|
function Oe(g, i) {
|
|
3977
|
-
let
|
|
3994
|
+
let u, h, P;
|
|
3978
3995
|
if (i.length === 0)
|
|
3979
3996
|
return g;
|
|
3980
|
-
for (
|
|
3981
|
-
h = i.charCodeAt(
|
|
3997
|
+
for (u = 0, P = i.length; u < P; u++)
|
|
3998
|
+
h = i.charCodeAt(u), g = (g << 5) - g + h, g |= 0;
|
|
3982
3999
|
return g < 0 ? g * -2 : g;
|
|
3983
4000
|
}
|
|
3984
|
-
function Ri(g, i,
|
|
4001
|
+
function Ri(g, i, u) {
|
|
3985
4002
|
return Object.keys(i).sort().reduce(h, g);
|
|
3986
|
-
function h(
|
|
3987
|
-
return Lr(
|
|
4003
|
+
function h(P, R) {
|
|
4004
|
+
return Lr(P, i[R], R, u);
|
|
3988
4005
|
}
|
|
3989
4006
|
}
|
|
3990
|
-
function Lr(g, i,
|
|
3991
|
-
const
|
|
4007
|
+
function Lr(g, i, u, h) {
|
|
4008
|
+
const P = Oe(Oe(Oe(g, u), Ti(i)), typeof i);
|
|
3992
4009
|
if (i === null)
|
|
3993
|
-
return Oe(
|
|
4010
|
+
return Oe(P, "null");
|
|
3994
4011
|
if (i === void 0)
|
|
3995
|
-
return Oe(
|
|
4012
|
+
return Oe(P, "undefined");
|
|
3996
4013
|
if (typeof i == "object" || typeof i == "function") {
|
|
3997
4014
|
if (h.includes(i))
|
|
3998
|
-
return Oe(
|
|
4015
|
+
return Oe(P, `[Circular]${u}`);
|
|
3999
4016
|
h.push(i);
|
|
4000
|
-
const R = Ri(
|
|
4017
|
+
const R = Ri(P, i, h);
|
|
4001
4018
|
if (!("valueOf" in i) || typeof i.valueOf != "function")
|
|
4002
4019
|
return R;
|
|
4003
4020
|
try {
|
|
4004
4021
|
return Oe(R, String(i.valueOf()));
|
|
4005
|
-
} catch (
|
|
4006
|
-
return Oe(R, `[valueOf exception]${
|
|
4022
|
+
} catch (K) {
|
|
4023
|
+
return Oe(R, `[valueOf exception]${K.stack || K.message}`);
|
|
4007
4024
|
}
|
|
4008
4025
|
}
|
|
4009
|
-
return Oe(
|
|
4026
|
+
return Oe(P, i.toString());
|
|
4010
4027
|
}
|
|
4011
4028
|
function Ti(g) {
|
|
4012
4029
|
return Object.prototype.toString.call(g);
|
|
@@ -4016,28 +4033,28 @@ function Fn(g) {
|
|
|
4016
4033
|
}
|
|
4017
4034
|
function Fi(g) {
|
|
4018
4035
|
const i = [...g];
|
|
4019
|
-
for (let
|
|
4020
|
-
const h = Math.floor(Math.random() * (
|
|
4021
|
-
[i[
|
|
4036
|
+
for (let u = i.length - 1; u > 0; u--) {
|
|
4037
|
+
const h = Math.floor(Math.random() * (u + 1));
|
|
4038
|
+
[i[u], i[h]] = [i[h], i[u]];
|
|
4022
4039
|
}
|
|
4023
4040
|
return i;
|
|
4024
4041
|
}
|
|
4025
|
-
function
|
|
4042
|
+
function $i(g) {
|
|
4026
4043
|
const i = g.toUpperCase().split(/[\s_-]+/);
|
|
4027
|
-
return i.length > 0 ? (i.forEach((
|
|
4028
|
-
i[h] = `${
|
|
4044
|
+
return i.length > 0 ? (i.forEach((u, h) => {
|
|
4045
|
+
i[h] = `${u.charAt(0)}.`;
|
|
4029
4046
|
}), i.join(" ")) : "";
|
|
4030
4047
|
}
|
|
4031
|
-
function
|
|
4048
|
+
function Mi(g) {
|
|
4032
4049
|
const i = document.createRange();
|
|
4033
4050
|
i.selectNodeContents(g), i.deleteContents();
|
|
4034
4051
|
}
|
|
4035
|
-
function
|
|
4052
|
+
function Ui(g) {
|
|
4036
4053
|
return `${g.title.length > 0 ? `<strong>${g.title}</strong>` : ""}${g.content.replace(/\n\n/g, `
|
|
4037
4054
|
`).replace(/\n/g, "<br />")}`;
|
|
4038
4055
|
}
|
|
4039
4056
|
function Wi(g, i) {
|
|
4040
|
-
const
|
|
4057
|
+
const u = [
|
|
4041
4058
|
{ value: 1, symbol: "" },
|
|
4042
4059
|
{ value: 1e3, symbol: "K" },
|
|
4043
4060
|
{ value: 1e6, symbol: "M" },
|
|
@@ -4046,15 +4063,15 @@ function Wi(g, i) {
|
|
|
4046
4063
|
{ value: 1e15, symbol: "P" },
|
|
4047
4064
|
{ value: 1e18, symbol: "E" }
|
|
4048
4065
|
], h = /\.0+$|(\.[0-9]*[1-9])0+$/;
|
|
4049
|
-
let
|
|
4050
|
-
for (
|
|
4066
|
+
let P;
|
|
4067
|
+
for (P = u.length - 1; P > 0 && !(g >= u[P].value); P--)
|
|
4051
4068
|
;
|
|
4052
|
-
return (g /
|
|
4069
|
+
return (g / u[P].value).toFixed(i).replace(h, "$1") + u[P].symbol;
|
|
4053
4070
|
}
|
|
4054
4071
|
function zi(g, i) {
|
|
4055
4072
|
if (g = g.toString().replace(/[^0-9.]/g, ""), g < 1e3)
|
|
4056
4073
|
return g;
|
|
4057
|
-
const
|
|
4074
|
+
const u = [
|
|
4058
4075
|
{ v: 1e3, s: "K" },
|
|
4059
4076
|
{ v: 1e6, s: "M" },
|
|
4060
4077
|
{ v: 1e9, s: "B" },
|
|
@@ -4063,28 +4080,28 @@ function zi(g, i) {
|
|
|
4063
4080
|
{ v: 1e18, s: "E" }
|
|
4064
4081
|
];
|
|
4065
4082
|
let h;
|
|
4066
|
-
for (h =
|
|
4083
|
+
for (h = u.length - 1; h > 0 && !(g >= u[h].v); h--)
|
|
4067
4084
|
;
|
|
4068
|
-
return (g /
|
|
4085
|
+
return (g / u[h].v).toFixed(i).replace(/\.0+$|(\.[0-9]*[1-9])0+$/, "$1") + u[h].s;
|
|
4069
4086
|
}
|
|
4070
4087
|
class Yi {
|
|
4071
4088
|
constructor(i) {
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4089
|
+
D(this, "sm");
|
|
4090
|
+
D(this, "api");
|
|
4091
|
+
D(this, "bc");
|
|
4092
|
+
D(this, "options");
|
|
4093
|
+
D(this, "update", async (i) => {
|
|
4077
4094
|
if (this.sm === null)
|
|
4078
4095
|
return;
|
|
4079
|
-
const
|
|
4080
|
-
if (
|
|
4096
|
+
const u = await this.sm.getSubscribers();
|
|
4097
|
+
if (u.length === 0)
|
|
4081
4098
|
return;
|
|
4082
4099
|
const h = [];
|
|
4083
|
-
i ? h.push(this.api.get(i)) :
|
|
4084
|
-
h.push(this.api.get(
|
|
4100
|
+
i ? h.push(this.api.get(i)) : u == null || u.forEach((P) => {
|
|
4101
|
+
h.push(this.api.get(P));
|
|
4085
4102
|
}), await Promise.allSettled(h).then(
|
|
4086
|
-
(
|
|
4087
|
-
let
|
|
4103
|
+
(P) => P.forEach(async (R) => {
|
|
4104
|
+
let K = 400;
|
|
4088
4105
|
if (R.status === "fulfilled") {
|
|
4089
4106
|
const N = R.value;
|
|
4090
4107
|
if (this.sm === null)
|
|
@@ -4095,40 +4112,40 @@ class Yi {
|
|
|
4095
4112
|
)[0];
|
|
4096
4113
|
let te = "";
|
|
4097
4114
|
switch (N.query.type) {
|
|
4098
|
-
case
|
|
4115
|
+
case j.MESSAGES:
|
|
4099
4116
|
if (te = Fn(N.data.messages), Z.hash === te)
|
|
4100
4117
|
return console.debug(
|
|
4101
4118
|
"%capi%c %cno updates",
|
|
4102
4119
|
x.API,
|
|
4103
4120
|
x.NONE,
|
|
4104
4121
|
x.NO_UPDATES,
|
|
4105
|
-
|
|
4122
|
+
j.MESSAGES,
|
|
4106
4123
|
N.query.slide,
|
|
4107
4124
|
N.query.widget
|
|
4108
4125
|
), 204;
|
|
4109
|
-
Z.hash = te,
|
|
4126
|
+
Z.hash = te, K = await this.sm.setMessages(N.query, N);
|
|
4110
4127
|
break;
|
|
4111
|
-
case
|
|
4128
|
+
case j.CLOUD:
|
|
4112
4129
|
te = Fn(N.data), Z.hash === te ? (console.debug(
|
|
4113
4130
|
"%capi%c %cno updates",
|
|
4114
4131
|
x.API,
|
|
4115
4132
|
x.NONE,
|
|
4116
4133
|
x.NO_UPDATES,
|
|
4117
|
-
|
|
4134
|
+
j.CLOUD,
|
|
4118
4135
|
N.query.slide,
|
|
4119
4136
|
N.query.widget
|
|
4120
|
-
),
|
|
4137
|
+
), K = 204) : (Z.hash = te, K = await this.sm.setCloud(N.query, N));
|
|
4121
4138
|
break;
|
|
4122
|
-
case
|
|
4139
|
+
case j.SERIES:
|
|
4123
4140
|
te = Fn(N.data), Z.hash === te ? (console.debug(
|
|
4124
4141
|
"%capi%c %cno updates",
|
|
4125
4142
|
x.API,
|
|
4126
4143
|
x.NONE,
|
|
4127
4144
|
x.NO_UPDATES,
|
|
4128
|
-
|
|
4145
|
+
j.SERIES,
|
|
4129
4146
|
N.query.slide,
|
|
4130
4147
|
N.query.widget
|
|
4131
|
-
),
|
|
4148
|
+
), K = 204) : (Z.hash = te, K = await this.sm.setSeries(N.query, N));
|
|
4132
4149
|
break;
|
|
4133
4150
|
default:
|
|
4134
4151
|
console.warn(
|
|
@@ -4141,8 +4158,8 @@ class Yi {
|
|
|
4141
4158
|
);
|
|
4142
4159
|
}
|
|
4143
4160
|
} else
|
|
4144
|
-
|
|
4145
|
-
switch (
|
|
4161
|
+
K = 401;
|
|
4162
|
+
switch (K) {
|
|
4146
4163
|
case 201:
|
|
4147
4164
|
console.info(
|
|
4148
4165
|
"%capp%c %cbroadcast",
|
|
@@ -4164,7 +4181,7 @@ class Yi {
|
|
|
4164
4181
|
);
|
|
4165
4182
|
break;
|
|
4166
4183
|
}
|
|
4167
|
-
return
|
|
4184
|
+
return K;
|
|
4168
4185
|
} else
|
|
4169
4186
|
return console.warn(
|
|
4170
4187
|
"%capi%c %cstorage",
|
|
@@ -4176,14 +4193,14 @@ class Yi {
|
|
|
4176
4193
|
})
|
|
4177
4194
|
);
|
|
4178
4195
|
});
|
|
4179
|
-
|
|
4196
|
+
D(this, "hide", (i) => {
|
|
4180
4197
|
this.api.hideMessage(i);
|
|
4181
4198
|
});
|
|
4182
|
-
|
|
4183
|
-
var
|
|
4199
|
+
D(this, "actions", async (i) => {
|
|
4200
|
+
var u;
|
|
4184
4201
|
switch (i.data.event) {
|
|
4185
4202
|
case se.SUBSCRIBE:
|
|
4186
|
-
(
|
|
4203
|
+
(u = this.sm) == null || u.subscribe(i.data.data);
|
|
4187
4204
|
break;
|
|
4188
4205
|
case se.UPDATE:
|
|
4189
4206
|
console.debug(
|
|
@@ -4197,14 +4214,17 @@ class Yi {
|
|
|
4197
4214
|
break;
|
|
4198
4215
|
}
|
|
4199
4216
|
});
|
|
4200
|
-
|
|
4201
|
-
var
|
|
4202
|
-
const i = ((
|
|
4217
|
+
D(this, "cleanMessages", async () => {
|
|
4218
|
+
var u, h;
|
|
4219
|
+
const i = ((u = this.options) == null ? void 0 : u.retention) || 345600;
|
|
4203
4220
|
return await ((h = this.sm) == null ? void 0 : h.cleanMessages(i));
|
|
4204
4221
|
});
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4222
|
+
D(this, "hideMessage", async (i) => {
|
|
4223
|
+
var u;
|
|
4224
|
+
return await ((u = this.sm) == null ? void 0 : u.hideMessage(i.id, 0)), await this.api.hideMessage(i);
|
|
4225
|
+
});
|
|
4226
|
+
D(this, "hideLabels", async (i) => await this.api.hideLabels(i));
|
|
4227
|
+
D(this, "getSubscribers", async () => {
|
|
4208
4228
|
var i;
|
|
4209
4229
|
return await ((i = this.sm) == null ? void 0 : i.getSubscribers());
|
|
4210
4230
|
});
|
|
@@ -4217,14 +4237,14 @@ class Yi {
|
|
|
4217
4237
|
se.VERSION,
|
|
4218
4238
|
xi
|
|
4219
4239
|
), this.options = i, this.sm = null;
|
|
4220
|
-
const
|
|
4221
|
-
switch (this.bc = new BroadcastChannel(
|
|
4240
|
+
const u = (i == null ? void 0 : i.slide) || i.app;
|
|
4241
|
+
switch (this.bc = new BroadcastChannel(u), console.info(
|
|
4222
4242
|
"%capi%c %cbroadcast",
|
|
4223
4243
|
x.API,
|
|
4224
4244
|
x.NONE,
|
|
4225
4245
|
x.BROADCAST,
|
|
4226
4246
|
se.CHANNEL,
|
|
4227
|
-
|
|
4247
|
+
u
|
|
4228
4248
|
), this.bc.onmessage = (h) => {
|
|
4229
4249
|
this.actions(h);
|
|
4230
4250
|
}, this.bc.postMessage({ event: se.STORAGE_INIT, data: {} }), this.api = new ki(i), i.storage) {
|
|
@@ -4238,7 +4258,7 @@ class Yi {
|
|
|
4238
4258
|
this.sm = new Kr(i);
|
|
4239
4259
|
break;
|
|
4240
4260
|
case he.KEYVAL:
|
|
4241
|
-
this.sm = new
|
|
4261
|
+
this.sm = new jr(i);
|
|
4242
4262
|
break;
|
|
4243
4263
|
case he.WINDOW:
|
|
4244
4264
|
this.sm = new Nr(i);
|
|
@@ -4246,17 +4266,17 @@ class Yi {
|
|
|
4246
4266
|
}
|
|
4247
4267
|
}
|
|
4248
4268
|
}
|
|
4249
|
-
class
|
|
4269
|
+
class ji {
|
|
4250
4270
|
constructor(i) {
|
|
4251
|
-
|
|
4271
|
+
D(this, "sm");
|
|
4252
4272
|
/**
|
|
4253
4273
|
* Retieve Cloud Data
|
|
4254
4274
|
* @param query Widgets parameters, type "cloud"
|
|
4255
4275
|
* @returns IResponse
|
|
4256
4276
|
*/
|
|
4257
|
-
|
|
4258
|
-
var
|
|
4259
|
-
return i.type !==
|
|
4277
|
+
D(this, "getCloud", async (i) => {
|
|
4278
|
+
var u;
|
|
4279
|
+
return i.type !== j.CLOUD ? (console.warn(
|
|
4260
4280
|
"%capp%c %get",
|
|
4261
4281
|
x.APP,
|
|
4262
4282
|
x.NONE,
|
|
@@ -4268,16 +4288,16 @@ class Mi {
|
|
|
4268
4288
|
data: null,
|
|
4269
4289
|
message: `'wrong method call for getMessages, type used is ${i.type}`,
|
|
4270
4290
|
success: !1
|
|
4271
|
-
}) : await ((
|
|
4291
|
+
}) : await ((u = this.sm) == null ? void 0 : u.getCloud(i));
|
|
4272
4292
|
});
|
|
4273
4293
|
/**
|
|
4274
4294
|
* Retieve Message Data
|
|
4275
4295
|
* @param query Widgets parameters, type "messages"
|
|
4276
4296
|
* @returns IResponse
|
|
4277
4297
|
*/
|
|
4278
|
-
|
|
4279
|
-
var
|
|
4280
|
-
return i.type !==
|
|
4298
|
+
D(this, "getMessages", async (i) => {
|
|
4299
|
+
var u;
|
|
4300
|
+
return i.type !== j.MESSAGES ? (console.warn(
|
|
4281
4301
|
"%capp%c %get",
|
|
4282
4302
|
x.APP,
|
|
4283
4303
|
x.NONE,
|
|
@@ -4289,16 +4309,16 @@ class Mi {
|
|
|
4289
4309
|
data: null,
|
|
4290
4310
|
message: `'wrong method call for getMessages, type used is ${i.type}`,
|
|
4291
4311
|
success: !1
|
|
4292
|
-
}) : await ((
|
|
4312
|
+
}) : await ((u = this.sm) == null ? void 0 : u.getMessages(i));
|
|
4293
4313
|
});
|
|
4294
4314
|
/**
|
|
4295
4315
|
* Retrieve Series Data
|
|
4296
4316
|
* @param query Widgets parameters, type "series"
|
|
4297
4317
|
* @returns IResponse
|
|
4298
4318
|
*/
|
|
4299
|
-
|
|
4300
|
-
var
|
|
4301
|
-
return i.type !==
|
|
4319
|
+
D(this, "getSeries", async (i) => {
|
|
4320
|
+
var u;
|
|
4321
|
+
return i.type !== j.SERIES ? (console.warn(
|
|
4302
4322
|
"%capp%c %get",
|
|
4303
4323
|
x.APP,
|
|
4304
4324
|
x.NONE,
|
|
@@ -4310,7 +4330,7 @@ class Mi {
|
|
|
4310
4330
|
data: null,
|
|
4311
4331
|
message: `'wrong method call for getSeries, type used is ${i.type}`,
|
|
4312
4332
|
success: !1
|
|
4313
|
-
}) : await ((
|
|
4333
|
+
}) : await ((u = this.sm) == null ? void 0 : u.getSeries(i));
|
|
4314
4334
|
});
|
|
4315
4335
|
switch (this.sm = null, i.storage) {
|
|
4316
4336
|
case he.DEXIE:
|
|
@@ -4323,7 +4343,7 @@ class Mi {
|
|
|
4323
4343
|
this.sm = new Kr(i);
|
|
4324
4344
|
break;
|
|
4325
4345
|
case he.KEYVAL:
|
|
4326
|
-
this.sm = new
|
|
4346
|
+
this.sm = new jr(i);
|
|
4327
4347
|
break;
|
|
4328
4348
|
case he.WINDOW:
|
|
4329
4349
|
this.sm = new Nr(i);
|
|
@@ -4339,24 +4359,24 @@ class Hi {
|
|
|
4339
4359
|
* @param callbacks functions in the widget that will receive the update
|
|
4340
4360
|
* @param selector container for the element - by default buzzcasting-slide (optional)
|
|
4341
4361
|
*/
|
|
4342
|
-
constructor(i,
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4362
|
+
constructor(i, u, h) {
|
|
4363
|
+
D(this, "storageReader");
|
|
4364
|
+
D(this, "broadcastChannel");
|
|
4365
|
+
D(this, "element");
|
|
4366
|
+
D(this, "query");
|
|
4367
|
+
D(this, "listeners");
|
|
4348
4368
|
/**
|
|
4349
4369
|
* Generic call to any query type
|
|
4350
4370
|
*
|
|
4351
4371
|
* @returns IResponse
|
|
4352
4372
|
*/
|
|
4353
|
-
|
|
4373
|
+
D(this, "getData", async () => {
|
|
4354
4374
|
switch (this.query.type) {
|
|
4355
|
-
case
|
|
4375
|
+
case j.CLOUD:
|
|
4356
4376
|
return await this.getCloud();
|
|
4357
|
-
case
|
|
4377
|
+
case j.MESSAGES:
|
|
4358
4378
|
return await this.getMessages();
|
|
4359
|
-
case
|
|
4379
|
+
case j.SERIES:
|
|
4360
4380
|
return await this.getSeries();
|
|
4361
4381
|
}
|
|
4362
4382
|
return {
|
|
@@ -4370,7 +4390,7 @@ class Hi {
|
|
|
4370
4390
|
*
|
|
4371
4391
|
* @returns IResponse
|
|
4372
4392
|
*/
|
|
4373
|
-
|
|
4393
|
+
D(this, "getCloud", async () => this.query.type !== j.CLOUD ? (console.warn(
|
|
4374
4394
|
"%cstorage%c %cwidget",
|
|
4375
4395
|
x.STORAGE,
|
|
4376
4396
|
x.NONE,
|
|
@@ -4388,7 +4408,7 @@ class Hi {
|
|
|
4388
4408
|
*
|
|
4389
4409
|
* @returns IResponse
|
|
4390
4410
|
*/
|
|
4391
|
-
|
|
4411
|
+
D(this, "getMessages", async () => this.query.type !== j.MESSAGES ? (console.warn(
|
|
4392
4412
|
"%cstorage%c %cwidget",
|
|
4393
4413
|
x.STORAGE,
|
|
4394
4414
|
x.NONE,
|
|
@@ -4406,7 +4426,7 @@ class Hi {
|
|
|
4406
4426
|
*
|
|
4407
4427
|
* @returns IResponse
|
|
4408
4428
|
*/
|
|
4409
|
-
|
|
4429
|
+
D(this, "getSeries", async () => this.query.type !== j.SERIES ? (console.warn(
|
|
4410
4430
|
"%cstorage%c %cwidget",
|
|
4411
4431
|
x.STORAGE,
|
|
4412
4432
|
x.NONE,
|
|
@@ -4425,22 +4445,22 @@ class Hi {
|
|
|
4425
4445
|
*
|
|
4426
4446
|
* @param modal IModal
|
|
4427
4447
|
*/
|
|
4428
|
-
|
|
4429
|
-
const
|
|
4430
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
4431
|
-
const R =
|
|
4432
|
-
R.length > 1 ? (
|
|
4448
|
+
D(this, "showModal", (i) => {
|
|
4449
|
+
const u = Ci(this.element.attributes);
|
|
4450
|
+
if (Object.prototype.hasOwnProperty.call(u, "data-topics")) {
|
|
4451
|
+
const R = u["data-topics"].split("-");
|
|
4452
|
+
R.length > 1 ? (u["data-widget"] = R[1], u["data-dashboard"] = R[0]) : (u["data-widget"] = R[0], u["data-dashboard"] = this.query.slide);
|
|
4433
4453
|
}
|
|
4434
|
-
const h = { ...i.props, ...
|
|
4454
|
+
const h = { ...i.props, ...u };
|
|
4435
4455
|
console.debug(
|
|
4436
4456
|
"%cwidget",
|
|
4437
4457
|
x.WIDGET,
|
|
4438
4458
|
se.SHOW_MODAL,
|
|
4439
4459
|
i.showComponent,
|
|
4440
4460
|
// @ts-expect-error cannot get string type out of IFilteredAttributes props
|
|
4441
|
-
|
|
4461
|
+
u["data-widget"]
|
|
4442
4462
|
);
|
|
4443
|
-
const
|
|
4463
|
+
const P = new CustomEvent(se.SHOW_MODAL, {
|
|
4444
4464
|
detail: {
|
|
4445
4465
|
component: i.showComponent,
|
|
4446
4466
|
props: h,
|
|
@@ -4450,14 +4470,14 @@ class Hi {
|
|
|
4450
4470
|
cancelable: !0,
|
|
4451
4471
|
composed: !0
|
|
4452
4472
|
});
|
|
4453
|
-
window.dispatchEvent(
|
|
4473
|
+
window.dispatchEvent(P);
|
|
4454
4474
|
});
|
|
4455
|
-
var
|
|
4456
|
-
this.element = i, this.listeners =
|
|
4457
|
-
let
|
|
4458
|
-
|
|
4475
|
+
var K;
|
|
4476
|
+
this.element = i, this.listeners = u, h = typeof h < "u" ? h : "buzzcasting-slide";
|
|
4477
|
+
let P;
|
|
4478
|
+
P = { ...i.dataset }, delete P.hmr, P.slide = ((K = i.closest(h.toUpperCase())) == null ? void 0 : K.id) ?? `${h} not found`, P = nt(P), this.query = P, Mi(i);
|
|
4459
4479
|
const R = window.BuzzCasting.getOptions();
|
|
4460
|
-
this.storageReader = new
|
|
4480
|
+
this.storageReader = new ji(R), this.broadcastChannel = new BroadcastChannel(P.slide), this.startListener();
|
|
4461
4481
|
}
|
|
4462
4482
|
addListener(i) {
|
|
4463
4483
|
this.listeners.push(i);
|
|
@@ -4467,12 +4487,12 @@ class Hi {
|
|
|
4467
4487
|
*/
|
|
4468
4488
|
startListener() {
|
|
4469
4489
|
const i = this.query;
|
|
4470
|
-
this.broadcastChannel.onmessage = async (
|
|
4471
|
-
const h =
|
|
4472
|
-
switch (
|
|
4490
|
+
this.broadcastChannel.onmessage = async (u) => {
|
|
4491
|
+
const h = u.data.data;
|
|
4492
|
+
switch (u.data.event) {
|
|
4473
4493
|
case se.WIDGET_UPDATE:
|
|
4474
|
-
h.query.slide === i.slide && h.query.widget === i.widget && this.listeners.forEach((
|
|
4475
|
-
|
|
4494
|
+
h.query.slide === i.slide && h.query.widget === i.widget && this.listeners.forEach((P) => {
|
|
4495
|
+
P(u.data.data);
|
|
4476
4496
|
});
|
|
4477
4497
|
break;
|
|
4478
4498
|
case se.SLIDE_READY:
|
|
@@ -4503,22 +4523,22 @@ class Hi {
|
|
|
4503
4523
|
}
|
|
4504
4524
|
}
|
|
4505
4525
|
export {
|
|
4506
|
-
|
|
4526
|
+
j as API,
|
|
4507
4527
|
Yi as BuzzcastingStorageManager,
|
|
4508
|
-
|
|
4528
|
+
ji as BuzzcastingStorageReader,
|
|
4509
4529
|
x as CSS,
|
|
4510
4530
|
se as EVENTS,
|
|
4511
4531
|
Vt as MODERATION,
|
|
4512
4532
|
he as STORAGE,
|
|
4513
4533
|
Hi as Widget,
|
|
4514
|
-
|
|
4534
|
+
$i as anonymize,
|
|
4515
4535
|
Ci as attrs,
|
|
4516
4536
|
Ni as brandLogo,
|
|
4517
4537
|
Gi as camelCase,
|
|
4518
4538
|
Li as camelize,
|
|
4519
|
-
|
|
4539
|
+
Mi as clearContents,
|
|
4520
4540
|
Bi as filterAttributes,
|
|
4521
|
-
|
|
4541
|
+
Ui as formatContent,
|
|
4522
4542
|
zi as intToString,
|
|
4523
4543
|
Wi as numberFormatter,
|
|
4524
4544
|
Fi as shuffleMessages,
|