buzzcasting-storage 2.12.6 → 2.12.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/buzzcasting-storage.esm.js +287 -277
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var Ei = Object.defineProperty;
|
|
2
2
|
var Oi = (p, i, u) => i in p ? Ei(p, i, { enumerable: !0, configurable: !0, writable: !0, value: u }) : p[i] = u;
|
|
3
|
-
var
|
|
4
|
-
const xi = "2.12.
|
|
3
|
+
var D = (p, i, u) => (Oi(p, typeof i != "symbol" ? i + "" : i, u), u);
|
|
4
|
+
const xi = "2.12.6";
|
|
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({
|
|
@@ -16,6 +16,16 @@ class ki {
|
|
|
16
16
|
})
|
|
17
17
|
};
|
|
18
18
|
});
|
|
19
|
+
D(this, "formHeaders", () => {
|
|
20
|
+
const i = `Bearer ${this.options.bearer}`;
|
|
21
|
+
return {
|
|
22
|
+
headers: new Headers({
|
|
23
|
+
Authorization: i,
|
|
24
|
+
Accept: "application/x-www-form-urlencoded"
|
|
25
|
+
// 'X-Session-Key': localStorage.getItem('guid') || 'invalid',
|
|
26
|
+
})
|
|
27
|
+
};
|
|
28
|
+
});
|
|
19
29
|
this.options = i, this.url = `https://${i.app}.buzzcasting.net`;
|
|
20
30
|
}
|
|
21
31
|
async get(i) {
|
|
@@ -58,7 +68,7 @@ class ki {
|
|
|
58
68
|
}).then((C) => C.json()).catch((C) => ({ succes: !1, message: C, data: [] }));
|
|
59
69
|
}
|
|
60
70
|
async hideLabels(i) {
|
|
61
|
-
const { version: u } = this.options, f = this.
|
|
71
|
+
const { version: u } = this.options, f = this.formHeaders(), k = JSON.stringify(i.labels);
|
|
62
72
|
return console.info(
|
|
63
73
|
"%capi%c %cput",
|
|
64
74
|
E.API,
|
|
@@ -107,7 +117,7 @@ var Rr = { exports: {} };
|
|
|
107
117
|
!r && o in t || ((r = r || Array.prototype.slice.call(t, 0, o))[o] = t[o]);
|
|
108
118
|
return e.concat(r || Array.prototype.slice.call(t));
|
|
109
119
|
}
|
|
110
|
-
var C = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Ir, K = Object.keys,
|
|
120
|
+
var C = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Ir, K = Object.keys, N = Array.isArray;
|
|
111
121
|
function Z(e, t) {
|
|
112
122
|
return typeof t != "object" || K(t).forEach(function(n) {
|
|
113
123
|
e[n] = t[n];
|
|
@@ -172,7 +182,7 @@ var Rr = { exports: {} };
|
|
|
172
182
|
fe(e, t[r], n[r]);
|
|
173
183
|
} else {
|
|
174
184
|
var a, s, c = t.indexOf(".");
|
|
175
|
-
c !== -1 ? (a = t.substr(0, c), (s = t.substr(c + 1)) === "" ? n === void 0 ?
|
|
185
|
+
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
186
|
}
|
|
177
187
|
}
|
|
178
188
|
function Qn(e) {
|
|
@@ -201,7 +211,7 @@ var Rr = { exports: {} };
|
|
|
201
211
|
var r = it.get(n);
|
|
202
212
|
if (r)
|
|
203
213
|
return r;
|
|
204
|
-
if (
|
|
214
|
+
if (N(n)) {
|
|
205
215
|
r = [], it.set(n, r);
|
|
206
216
|
for (var o = 0, a = n.length; o < a; ++o)
|
|
207
217
|
r.push(t(n[o]));
|
|
@@ -232,7 +242,7 @@ var Rr = { exports: {} };
|
|
|
232
242
|
function we(e) {
|
|
233
243
|
var t, n, r, o;
|
|
234
244
|
if (arguments.length === 1) {
|
|
235
|
-
if (
|
|
245
|
+
if (N(e))
|
|
236
246
|
return e.slice();
|
|
237
247
|
if (this === He && typeof e == "string")
|
|
238
248
|
return [e];
|
|
@@ -367,12 +377,12 @@ var Rr = { exports: {} };
|
|
|
367
377
|
return [t, te(t), e];
|
|
368
378
|
}(), st = ge[0], de = ge[1], ge = ge[2], de = de && de.then, ut = st && st.constructor, nn = !!ge, ct = function(e, t) {
|
|
369
379
|
lt.push([e, t]), Et && (queueMicrotask(qr), Et = !1);
|
|
370
|
-
}, rn = !0, Et = !0,
|
|
380
|
+
}, rn = !0, Et = !0, Be = [], Ot = [], on = ot, De = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: Y, pgp: !1, env: {}, finalize: Y }, B = De, lt = [], Ne = 0, xt = [];
|
|
371
381
|
function M(e) {
|
|
372
382
|
if (typeof this != "object")
|
|
373
383
|
throw new TypeError("Promises must be constructed via new");
|
|
374
384
|
this._listeners = [], this._lib = !1;
|
|
375
|
-
var t = this._PSD =
|
|
385
|
+
var t = this._PSD = B;
|
|
376
386
|
if (typeof e != "function") {
|
|
377
387
|
if (e !== at)
|
|
378
388
|
throw new TypeError("Not a function");
|
|
@@ -396,9 +406,9 @@ var Rr = { exports: {} };
|
|
|
396
406
|
}(this, e);
|
|
397
407
|
}
|
|
398
408
|
var an = { get: function() {
|
|
399
|
-
var e =
|
|
409
|
+
var e = B, t = Pt;
|
|
400
410
|
function n(r, o) {
|
|
401
|
-
var a = this, s = !e.global && (e !==
|
|
411
|
+
var a = this, s = !e.global && (e !== B || t !== Pt), c = s && !Ie(), g = new M(function(d, v) {
|
|
402
412
|
un(a, new tr(ir(r, e, s, c), ir(o, e, s, c), d, v, e));
|
|
403
413
|
});
|
|
404
414
|
return this._consoleTask && (g._consoleTask = this._consoleTask), g;
|
|
@@ -414,9 +424,9 @@ var Rr = { exports: {} };
|
|
|
414
424
|
}
|
|
415
425
|
function sn(e, t) {
|
|
416
426
|
var n, r;
|
|
417
|
-
Ot.push(t), e._state === null && (n = e._lib && Xe(), t = on(t), e._state = !1, e._value = t, r = e,
|
|
427
|
+
Ot.push(t), e._state === null && (n = e._lib && Xe(), t = on(t), e._state = !1, e._value = t, r = e, Be.some(function(o) {
|
|
418
428
|
return o._value === r._value;
|
|
419
|
-
}) ||
|
|
429
|
+
}) || Be.push(r), nr(e), n && Ve());
|
|
420
430
|
}
|
|
421
431
|
function nr(e) {
|
|
422
432
|
var t = e._listeners;
|
|
@@ -424,8 +434,8 @@ var Rr = { exports: {} };
|
|
|
424
434
|
for (var n = 0, r = t.length; n < r; ++n)
|
|
425
435
|
un(e, t[n]);
|
|
426
436
|
var o = e._PSD;
|
|
427
|
-
--o.ref || o.finalize(),
|
|
428
|
-
--
|
|
437
|
+
--o.ref || o.finalize(), Ne === 0 && (++Ne, ct(function() {
|
|
438
|
+
--Ne == 0 && cn();
|
|
429
439
|
}, []));
|
|
430
440
|
}
|
|
431
441
|
function un(e, t) {
|
|
@@ -433,7 +443,7 @@ var Rr = { exports: {} };
|
|
|
433
443
|
var n = e._state ? t.onFulfilled : t.onRejected;
|
|
434
444
|
if (n === null)
|
|
435
445
|
return (e._state ? t.resolve : t.reject)(e._value);
|
|
436
|
-
++t.psd.ref, ++
|
|
446
|
+
++t.psd.ref, ++Ne, ct(Zr, [n, e, t]);
|
|
437
447
|
} else
|
|
438
448
|
e._listeners.push(t);
|
|
439
449
|
}
|
|
@@ -443,14 +453,14 @@ var Rr = { exports: {} };
|
|
|
443
453
|
!t._state && Ot.length && (Ot = []), r = pe && t._consoleTask ? t._consoleTask.run(function() {
|
|
444
454
|
return e(o);
|
|
445
455
|
}) : e(o), t._state || Ot.indexOf(o) !== -1 || function(a) {
|
|
446
|
-
for (var s =
|
|
447
|
-
if (
|
|
448
|
-
return
|
|
456
|
+
for (var s = Be.length; s; )
|
|
457
|
+
if (Be[--s]._value === a._value)
|
|
458
|
+
return Be.splice(s, 1);
|
|
449
459
|
}(t), n.resolve(r);
|
|
450
460
|
} catch (a) {
|
|
451
461
|
n.reject(a);
|
|
452
462
|
} finally {
|
|
453
|
-
--
|
|
463
|
+
--Ne == 0 && cn(), --n.psd.ref || n.psd.finalize();
|
|
454
464
|
}
|
|
455
465
|
}
|
|
456
466
|
function qr() {
|
|
@@ -474,8 +484,8 @@ var Rr = { exports: {} };
|
|
|
474
484
|
Et = rn = !0;
|
|
475
485
|
}
|
|
476
486
|
function cn() {
|
|
477
|
-
var e =
|
|
478
|
-
|
|
487
|
+
var e = Be;
|
|
488
|
+
Be = [], e.forEach(function(r) {
|
|
479
489
|
r._PSD.onunhandled.call(null, r._value, r);
|
|
480
490
|
});
|
|
481
491
|
for (var t = xt.slice(0), n = t.length; n; )
|
|
@@ -485,9 +495,9 @@ var Rr = { exports: {} };
|
|
|
485
495
|
return new M(at, !1, e);
|
|
486
496
|
}
|
|
487
497
|
function J(e, t) {
|
|
488
|
-
var n =
|
|
498
|
+
var n = B;
|
|
489
499
|
return function() {
|
|
490
|
-
var r = Xe(), o =
|
|
500
|
+
var r = Xe(), o = B;
|
|
491
501
|
try {
|
|
492
502
|
return Ce(n, !0), e.apply(this, arguments);
|
|
493
503
|
} catch (a) {
|
|
@@ -498,7 +508,7 @@ var Rr = { exports: {} };
|
|
|
498
508
|
};
|
|
499
509
|
}
|
|
500
510
|
xe(M.prototype, { then: an, _then: function(e, t) {
|
|
501
|
-
un(this, new tr(null, null, e, t,
|
|
511
|
+
un(this, new tr(null, null, e, t, B));
|
|
502
512
|
}, catch: function(e) {
|
|
503
513
|
if (arguments.length === 1)
|
|
504
514
|
return this.then(null, e);
|
|
@@ -549,9 +559,9 @@ var Rr = { exports: {} };
|
|
|
549
559
|
});
|
|
550
560
|
});
|
|
551
561
|
}, PSD: { get: function() {
|
|
552
|
-
return
|
|
562
|
+
return B;
|
|
553
563
|
}, set: function(e) {
|
|
554
|
-
return
|
|
564
|
+
return B = e;
|
|
555
565
|
} }, totalEchoes: { get: function() {
|
|
556
566
|
return Pt;
|
|
557
567
|
} }, newPSD: Pe, usePSD: Ge, scheduler: { get: function() {
|
|
@@ -565,15 +575,15 @@ var Rr = { exports: {} };
|
|
|
565
575
|
} }, follow: function(e, t) {
|
|
566
576
|
return new M(function(n, r) {
|
|
567
577
|
return Pe(function(o, a) {
|
|
568
|
-
var s =
|
|
578
|
+
var s = B;
|
|
569
579
|
s.unhandleds = [], s.onunhandled = a, s.finalize = Ke(function() {
|
|
570
580
|
var c, g = this;
|
|
571
581
|
c = function() {
|
|
572
582
|
g.unhandleds.length === 0 ? o() : a(g.unhandleds[0]);
|
|
573
583
|
}, xt.push(function d() {
|
|
574
584
|
c(), xt.splice(xt.indexOf(d), 1);
|
|
575
|
-
}), ++
|
|
576
|
-
--
|
|
585
|
+
}), ++Ne, ct(function() {
|
|
586
|
+
--Ne == 0 && cn();
|
|
577
587
|
}, []);
|
|
578
588
|
}, s.finalize), e();
|
|
579
589
|
}, t, n, r);
|
|
@@ -609,7 +619,7 @@ var Rr = { exports: {} };
|
|
|
609
619
|
}));
|
|
610
620
|
var ne = { awaits: 0, echoes: 0, id: 0 }, ei = 0, At = [], Dt = 0, Pt = 0, ti = 0;
|
|
611
621
|
function Pe(e, t, n, r) {
|
|
612
|
-
var o =
|
|
622
|
+
var o = B, a = Object.create(o);
|
|
613
623
|
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
624
|
--this.parent.ref || this.parent.finalize();
|
|
615
625
|
}, r = Ge(a, e, n, r), a.ref === 0 && a.finalize(), r;
|
|
@@ -632,17 +642,17 @@ var Rr = { exports: {} };
|
|
|
632
642
|
At.pop(), Ce(e, !1);
|
|
633
643
|
}
|
|
634
644
|
function Ce(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 !==
|
|
645
|
+
var n, r = B;
|
|
646
|
+
(t ? !ne.echoes || Dt++ && e === B : !Dt || --Dt && e === B) || queueMicrotask(t ? (function(o) {
|
|
647
|
+
++Pt, ne.echoes && --ne.echoes != 0 || (ne.echoes = ne.awaits = ne.id = 0), At.push(B), Ce(o, !0);
|
|
648
|
+
}).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(C, "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
649
|
}
|
|
640
650
|
function rr() {
|
|
641
651
|
var e = C.Promise;
|
|
642
652
|
return nn ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(C, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
|
|
643
653
|
}
|
|
644
654
|
function Ge(e, t, n, r, o) {
|
|
645
|
-
var a =
|
|
655
|
+
var a = B;
|
|
646
656
|
try {
|
|
647
657
|
return Ce(e, !0), t(n, r, o);
|
|
648
658
|
} finally {
|
|
@@ -651,7 +661,7 @@ var Rr = { exports: {} };
|
|
|
651
661
|
}
|
|
652
662
|
function ir(e, t, n, r) {
|
|
653
663
|
return typeof e != "function" ? e : function() {
|
|
654
|
-
var o =
|
|
664
|
+
var o = B;
|
|
655
665
|
n && Je(), Ce(t, !0);
|
|
656
666
|
try {
|
|
657
667
|
return e.apply(this, arguments);
|
|
@@ -720,7 +730,7 @@ var Rr = { exports: {} };
|
|
|
720
730
|
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
721
731
|
}
|
|
722
732
|
var lr = (X.prototype._trans = function(e, t, n) {
|
|
723
|
-
var r = this._tx ||
|
|
733
|
+
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
734
|
function s(d, v, l) {
|
|
725
735
|
if (!l.schema[o])
|
|
726
736
|
throw new L.NotFound("Table " + o + " not part of transaction");
|
|
@@ -728,10 +738,10 @@ var Rr = { exports: {} };
|
|
|
728
738
|
}
|
|
729
739
|
var c = Xe();
|
|
730
740
|
try {
|
|
731
|
-
var g = r && r.db._novip === this.db._novip ? r ===
|
|
741
|
+
var g = r && r.db._novip === this.db._novip ? r === B.trans ? r._promise(e, s, n) : Pe(function() {
|
|
732
742
|
return r._promise(e, s, n);
|
|
733
|
-
}, { trans: r, transless:
|
|
734
|
-
if (v.idbdb && (v._state.openComplete ||
|
|
743
|
+
}, { trans: r, transless: B.transless || B }) : function d(v, l, h, y) {
|
|
744
|
+
if (v.idbdb && (v._state.openComplete || B.letThrough || v._vip)) {
|
|
735
745
|
var b = v._createTransaction(l, h, v._dbSchema);
|
|
736
746
|
try {
|
|
737
747
|
b.create(), v._state.PR1398_maxLoop = 3;
|
|
@@ -742,7 +752,7 @@ var Rr = { exports: {} };
|
|
|
742
752
|
}
|
|
743
753
|
return b._promise(l, function(w, m) {
|
|
744
754
|
return Pe(function() {
|
|
745
|
-
return
|
|
755
|
+
return B.trans = b, y(w, m, b);
|
|
746
756
|
});
|
|
747
757
|
}).then(function(w) {
|
|
748
758
|
if (l === "readwrite")
|
|
@@ -782,7 +792,7 @@ var Rr = { exports: {} };
|
|
|
782
792
|
}, X.prototype.where = function(e) {
|
|
783
793
|
if (typeof e == "string")
|
|
784
794
|
return new this.db.WhereClause(this, e);
|
|
785
|
-
if (
|
|
795
|
+
if (N(e))
|
|
786
796
|
return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
787
797
|
var t = K(e);
|
|
788
798
|
if (t.length === 1)
|
|
@@ -814,7 +824,7 @@ var Rr = { exports: {} };
|
|
|
814
824
|
var c = t.reduce(function(h, d) {
|
|
815
825
|
var v = h[0], l = h[1], h = r[d], y = e[d];
|
|
816
826
|
return [v || h, v || !h ? Fe(l, h && h.multi ? function(b) {
|
|
817
|
-
return b = ve(b, d),
|
|
827
|
+
return b = ve(b, d), N(b) && b.some(function(w) {
|
|
818
828
|
return a(y, w);
|
|
819
829
|
});
|
|
820
830
|
} : function(b) {
|
|
@@ -837,7 +847,7 @@ var Rr = { exports: {} };
|
|
|
837
847
|
}, X.prototype.toCollection = function() {
|
|
838
848
|
return new this.db.Collection(new this.db.WhereClause(this));
|
|
839
849
|
}, X.prototype.orderBy = function(e) {
|
|
840
|
-
return new this.db.Collection(new this.db.WhereClause(this,
|
|
850
|
+
return new this.db.Collection(new this.db.WhereClause(this, N(e) ? "[".concat(e.join("+"), "]") : e));
|
|
841
851
|
}, X.prototype.reverse = function() {
|
|
842
852
|
return this.toCollection().reverse();
|
|
843
853
|
}, X.prototype.mapToClass = function(e) {
|
|
@@ -893,7 +903,7 @@ var Rr = { exports: {} };
|
|
|
893
903
|
return c;
|
|
894
904
|
});
|
|
895
905
|
}, X.prototype.update = function(e, t) {
|
|
896
|
-
return typeof e != "object" ||
|
|
906
|
+
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 L.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t));
|
|
897
907
|
}, X.prototype.put = function(e, t) {
|
|
898
908
|
var n = this, r = this.schema.primKey, o = r.auto, a = r.keyPath, s = e;
|
|
899
909
|
return a && o && (s = Rt(a)(e)), this._trans("readwrite", function(c) {
|
|
@@ -1042,7 +1052,7 @@ var Rr = { exports: {} };
|
|
|
1042
1052
|
}
|
|
1043
1053
|
K(d = s).forEach(function(l) {
|
|
1044
1054
|
var h = d[l];
|
|
1045
|
-
if (
|
|
1055
|
+
if (N(h))
|
|
1046
1056
|
a(l, d[l][0], d[l][1]);
|
|
1047
1057
|
else {
|
|
1048
1058
|
if (h !== "asap")
|
|
@@ -1312,9 +1322,9 @@ var Rr = { exports: {} };
|
|
|
1312
1322
|
function _(S) {
|
|
1313
1323
|
var O = Math.min(h, m.length - S);
|
|
1314
1324
|
return g.getMany({ trans: r, keys: m.slice(S, S + O), cache: "immutable" }).then(function(x) {
|
|
1315
|
-
for (var A = [], R = [],
|
|
1325
|
+
for (var A = [], R = [], P = v ? [] : null, T = [], I = 0; I < O; ++I) {
|
|
1316
1326
|
var G = x[I], F = { value: Ae(G), primKey: m[S + I] };
|
|
1317
|
-
s.call(F, F.value, F) !== !1 && (F.value == null ? T.push(m[S + I]) : v || z(l(G), l(F.value)) === 0 ? (R.push(F.value), v &&
|
|
1327
|
+
s.call(F, F.value, F) !== !1 && (F.value == null ? T.push(m[S + I]) : v || z(l(G), l(F.value)) === 0 ? (R.push(F.value), v && P.push(m[S + I])) : (T.push(m[S + I]), A.push(F.value)));
|
|
1318
1328
|
}
|
|
1319
1329
|
var H = qe(n) && n.limit === 1 / 0 && (typeof e != "function" || e === gn) && { index: n.index, range: n.range };
|
|
1320
1330
|
return Promise.resolve(0 < A.length && g.mutate({ trans: r, type: "add", values: A }).then(function(U) {
|
|
@@ -1322,7 +1332,7 @@ var Rr = { exports: {} };
|
|
|
1322
1332
|
T.splice(parseInt(Q), 1);
|
|
1323
1333
|
c(A.length, U);
|
|
1324
1334
|
})).then(function() {
|
|
1325
|
-
return (0 < R.length || H && typeof e == "object") && g.mutate({ trans: r, type: "put", keys:
|
|
1335
|
+
return (0 < R.length || H && typeof e == "object") && g.mutate({ trans: r, type: "put", keys: P, values: R, criteria: H, changeSpec: typeof e != "function" && e }).then(function(U) {
|
|
1326
1336
|
return c(R.length, U);
|
|
1327
1337
|
});
|
|
1328
1338
|
}).then(function() {
|
|
@@ -1417,11 +1427,11 @@ var Rr = { exports: {} };
|
|
|
1417
1427
|
if (t(S, g, y))
|
|
1418
1428
|
return !0;
|
|
1419
1429
|
for (var O = null, x = y; x < l; ++x) {
|
|
1420
|
-
var A = function(R,
|
|
1430
|
+
var A = function(R, P, T, I, G, F) {
|
|
1421
1431
|
for (var H = Math.min(R.length, I.length), U = -1, Q = 0; Q < H; ++Q) {
|
|
1422
|
-
var le =
|
|
1432
|
+
var le = P[Q];
|
|
1423
1433
|
if (le !== I[Q])
|
|
1424
|
-
return G(R[Q], T[Q]) < 0 ? R.substr(0, Q) + T[Q] + T.substr(Q + 1) : G(R[Q], I[Q]) < 0 ? R.substr(0, Q) + I[Q] + T.substr(Q + 1) : 0 <= U ? R.substr(0, U) +
|
|
1434
|
+
return G(R[Q], T[Q]) < 0 ? R.substr(0, Q) + T[Q] + T.substr(Q + 1) : G(R[Q], I[Q]) < 0 ? R.substr(0, Q) + I[Q] + T.substr(Q + 1) : 0 <= U ? R.substr(0, U) + P[U] + T.substr(U + 1) : null;
|
|
1425
1435
|
G(R[Q], le) < 0 && (U = Q);
|
|
1426
1436
|
}
|
|
1427
1437
|
return H < I.length && F === "next" ? R + T.substr(R.length) : H < R.length && F === "prev" ? R.substr(0, T.length) : U < 0 ? null : R.substr(0, U) + I[U] + T.substr(U + 1);
|
|
@@ -1597,10 +1607,10 @@ var Rr = { exports: {} };
|
|
|
1597
1607
|
e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
|
|
1598
1608
|
}
|
|
1599
1609
|
var pt = "storagemutated", yn = "x-storagemutated-1", Te = ft(null, pt), ai = (me.prototype._lock = function() {
|
|
1600
|
-
return rt(!
|
|
1610
|
+
return rt(!B.global), ++this._reculock, this._reculock !== 1 || B.global || (B.lockOwnerFor = this), this;
|
|
1601
1611
|
}, me.prototype._unlock = function() {
|
|
1602
|
-
if (rt(!
|
|
1603
|
-
for (
|
|
1612
|
+
if (rt(!B.global), --this._reculock == 0)
|
|
1613
|
+
for (B.global || (B.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked(); ) {
|
|
1604
1614
|
var e = this._blockedFuncs.shift();
|
|
1605
1615
|
try {
|
|
1606
1616
|
Ge(e[1], e[0]);
|
|
@@ -1609,7 +1619,7 @@ var Rr = { exports: {} };
|
|
|
1609
1619
|
}
|
|
1610
1620
|
return this;
|
|
1611
1621
|
}, me.prototype._locked = function() {
|
|
1612
|
-
return this._reculock &&
|
|
1622
|
+
return this._reculock && B.lockOwnerFor !== this;
|
|
1613
1623
|
}, me.prototype.create = function(e) {
|
|
1614
1624
|
var t = this;
|
|
1615
1625
|
if (!this.mode)
|
|
@@ -1643,7 +1653,7 @@ var Rr = { exports: {} };
|
|
|
1643
1653
|
return new M(function(a, s) {
|
|
1644
1654
|
r._blockedFuncs.push([function() {
|
|
1645
1655
|
r._promise(e, t, n).then(a, s);
|
|
1646
|
-
},
|
|
1656
|
+
}, B]);
|
|
1647
1657
|
});
|
|
1648
1658
|
if (n)
|
|
1649
1659
|
return Pe(function() {
|
|
@@ -1753,7 +1763,7 @@ var Rr = { exports: {} };
|
|
|
1753
1763
|
var m = w.trans, _ = w.type, S = w.keys, O = w.values, x = w.range;
|
|
1754
1764
|
return new Promise(function(A, R) {
|
|
1755
1765
|
A = J(A);
|
|
1756
|
-
var
|
|
1766
|
+
var P = m.objectStore(b), T = P.keyPath == null, I = _ === "put" || _ === "add";
|
|
1757
1767
|
if (!I && _ !== "delete" && _ !== "deleteRange")
|
|
1758
1768
|
throw new Error("Invalid operation type: " + _);
|
|
1759
1769
|
var G, F = (S || O || { length: 1 }).length;
|
|
@@ -1768,19 +1778,19 @@ var Rr = { exports: {} };
|
|
|
1768
1778
|
if (_ === "deleteRange") {
|
|
1769
1779
|
if (x.type === 4)
|
|
1770
1780
|
return A({ numFailures: le, failures: Q, results: [], lastResult: void 0 });
|
|
1771
|
-
x.type === 3 ? U.push(G =
|
|
1781
|
+
x.type === 3 ? U.push(G = P.clear()) : U.push(G = P.delete(r(x)));
|
|
1772
1782
|
} else {
|
|
1773
1783
|
var T = I ? T ? [O, S] : [O, null] : [S, null], $ = T[0], Ee = T[1];
|
|
1774
1784
|
if (I)
|
|
1775
1785
|
for (var ae = 0; ae < F; ++ae)
|
|
1776
|
-
U.push(G = Ee && Ee[ae] !== void 0 ?
|
|
1786
|
+
U.push(G = Ee && Ee[ae] !== void 0 ? P[_]($[ae], Ee[ae]) : P[_]($[ae])), G.onerror = H;
|
|
1777
1787
|
else
|
|
1778
1788
|
for (ae = 0; ae < F; ++ae)
|
|
1779
|
-
U.push(G =
|
|
1789
|
+
U.push(G = P[_]($[ae])), G.onerror = H;
|
|
1780
1790
|
}
|
|
1781
1791
|
function Qt(ue) {
|
|
1782
|
-
ue = ue.target.result, U.forEach(function(We,
|
|
1783
|
-
return We.error != null && (Q[
|
|
1792
|
+
ue = ue.target.result, U.forEach(function(We, Nn) {
|
|
1793
|
+
return We.error != null && (Q[Nn] = We.error);
|
|
1784
1794
|
}), A({ numFailures: le, failures: Q, results: _ === "delete" ? S : U.map(function(We) {
|
|
1785
1795
|
return We.result;
|
|
1786
1796
|
}), lastResult: ue });
|
|
@@ -1793,11 +1803,11 @@ var Rr = { exports: {} };
|
|
|
1793
1803
|
var m = w.trans, _ = w.keys;
|
|
1794
1804
|
return new Promise(function(S, O) {
|
|
1795
1805
|
S = J(S);
|
|
1796
|
-
for (var x, A = m.objectStore(b), R = _.length,
|
|
1797
|
-
U = U.target,
|
|
1806
|
+
for (var x, A = m.objectStore(b), R = _.length, P = new Array(R), T = 0, I = 0, G = function(U) {
|
|
1807
|
+
U = U.target, P[U._pos] = U.result, ++I === T && S(P);
|
|
1798
1808
|
}, F = ye(O), H = 0; H < R; ++H)
|
|
1799
1809
|
_[H] != null && ((x = A.get(_[H]))._pos = H, x.onsuccess = G, x.onerror = F, ++T);
|
|
1800
|
-
T === 0 && S(
|
|
1810
|
+
T === 0 && S(P);
|
|
1801
1811
|
});
|
|
1802
1812
|
}, get: function(w) {
|
|
1803
1813
|
var m = w.trans, _ = w.key;
|
|
@@ -1811,12 +1821,12 @@ var Rr = { exports: {} };
|
|
|
1811
1821
|
}, query: (y = d, function(w) {
|
|
1812
1822
|
return new Promise(function(m, _) {
|
|
1813
1823
|
m = J(m);
|
|
1814
|
-
var S, O, x, T = w.trans, A = w.values, R = w.limit, G = w.query,
|
|
1824
|
+
var S, O, x, T = w.trans, A = w.values, R = w.limit, G = w.query, P = R === 1 / 0 ? void 0 : R, I = G.index, G = G.range, T = T.objectStore(b), I = I.isPrimaryKey ? T : T.index(I.name), G = r(G);
|
|
1815
1825
|
if (R === 0)
|
|
1816
1826
|
return m({ result: [] });
|
|
1817
|
-
y ? ((
|
|
1827
|
+
y ? ((P = A ? I.getAll(G, P) : I.getAllKeys(G, P)).onsuccess = function(F) {
|
|
1818
1828
|
return m({ result: F.target.result });
|
|
1819
|
-
},
|
|
1829
|
+
}, P.onerror = ye(_)) : (S = 0, O = !A && "openKeyCursor" in I ? I.openKeyCursor(G) : I.openCursor(G), x = [], O.onsuccess = function(F) {
|
|
1820
1830
|
var H = O.result;
|
|
1821
1831
|
return H ? (x.push(A ? H.value : H.primaryKey), ++S === R ? m({ result: x }) : void H.continue()) : m({ result: x });
|
|
1822
1832
|
}, O.onerror = ye(_));
|
|
@@ -1825,7 +1835,7 @@ var Rr = { exports: {} };
|
|
|
1825
1835
|
var m = w.trans, _ = w.values, S = w.query, O = w.reverse, x = w.unique;
|
|
1826
1836
|
return new Promise(function(A, R) {
|
|
1827
1837
|
A = J(A);
|
|
1828
|
-
var I = S.index,
|
|
1838
|
+
var I = S.index, P = S.range, T = m.objectStore(b), T = I.isPrimaryKey ? T : T.index(I.name), I = O ? x ? "prevunique" : "prev" : x ? "nextunique" : "next", G = !_ && "openKeyCursor" in T ? T.openKeyCursor(r(P), I) : T.openCursor(r(P), I);
|
|
1829
1839
|
G.onerror = ye(R), G.onsuccess = J(function(F) {
|
|
1830
1840
|
var H, U, Q, le, $ = G.result;
|
|
1831
1841
|
$ ? ($.___id = ++si, $.done = !1, H = $.continue.bind($), U = (U = $.continuePrimaryKey) && U.bind($), Q = $.advance.bind($), le = function() {
|
|
@@ -1853,8 +1863,8 @@ var Rr = { exports: {} };
|
|
|
1853
1863
|
}, $.stop();
|
|
1854
1864
|
}
|
|
1855
1865
|
var Qt = new Promise(function(ue, We) {
|
|
1856
|
-
ue = J(ue), G.onerror = ye(We), $.fail = We, $.stop = function(
|
|
1857
|
-
$.stop = $.continue = $.continuePrimaryKey = $.advance = le, ue(
|
|
1866
|
+
ue = J(ue), G.onerror = ye(We), $.fail = We, $.stop = function(Nn) {
|
|
1867
|
+
$.stop = $.continue = $.continuePrimaryKey = $.advance = le, ue(Nn);
|
|
1858
1868
|
};
|
|
1859
1869
|
});
|
|
1860
1870
|
return G.onsuccess = J(function(ue) {
|
|
@@ -1866,20 +1876,20 @@ var Rr = { exports: {} };
|
|
|
1866
1876
|
}, count: function(w) {
|
|
1867
1877
|
var m = w.query, _ = w.trans, S = m.index, O = m.range;
|
|
1868
1878
|
return new Promise(function(x, A) {
|
|
1869
|
-
var R = _.objectStore(b),
|
|
1870
|
-
|
|
1879
|
+
var R = _.objectStore(b), P = S.isPrimaryKey ? R : R.index(S.name), R = r(O), P = R ? P.count(R) : P.count();
|
|
1880
|
+
P.onsuccess = J(function(T) {
|
|
1871
1881
|
return x(T.target.result);
|
|
1872
|
-
}),
|
|
1882
|
+
}), P.onerror = ye(A);
|
|
1873
1883
|
});
|
|
1874
1884
|
} };
|
|
1875
1885
|
}
|
|
1876
1886
|
var a, s, c, v = (s = g, c = yr((a = e).objectStoreNames), { schema: { name: a.name, tables: c.map(function(h) {
|
|
1877
1887
|
return s.objectStore(h);
|
|
1878
1888
|
}).map(function(h) {
|
|
1879
|
-
var y = h.keyPath, m = h.autoIncrement, b =
|
|
1889
|
+
var y = h.keyPath, m = h.autoIncrement, b = N(y), w = {}, m = { name: h.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: y == null, compound: b, keyPath: y, autoIncrement: m, unique: !0, extractKey: vn(y) }, indexes: yr(h.indexNames).map(function(_) {
|
|
1880
1890
|
return h.index(_);
|
|
1881
1891
|
}).map(function(x) {
|
|
1882
|
-
var S = x.name, O = x.unique, A = x.multiEntry, x = x.keyPath, A = { name: S, compound:
|
|
1892
|
+
var S = x.name, O = x.unique, A = x.multiEntry, x = x.keyPath, A = { name: S, compound: N(x), keyPath: x, unique: O, multiEntry: A, extractKey: vn(x) };
|
|
1883
1893
|
return w[yt(x)] = A;
|
|
1884
1894
|
}), getIndexByKeyPath: function(_) {
|
|
1885
1895
|
return w[yt(_)];
|
|
@@ -1909,7 +1919,7 @@ var Rr = { exports: {} };
|
|
|
1909
1919
|
}) && (o.core = e.core.table(a), e[a] instanceof e.Table && (e[a].core = o.core));
|
|
1910
1920
|
});
|
|
1911
1921
|
}
|
|
1912
|
-
function
|
|
1922
|
+
function Bt(e, t, n, r) {
|
|
1913
1923
|
n.forEach(function(o) {
|
|
1914
1924
|
var a = r[o];
|
|
1915
1925
|
t.forEach(function(s) {
|
|
@@ -1938,9 +1948,9 @@ var Rr = { exports: {} };
|
|
|
1938
1948
|
n.objectStoreNames.contains("$meta") && !o.$meta && (o.$meta = bn("$meta", br("")[0], []), e._storeNames.push("$meta"));
|
|
1939
1949
|
var a = e._createTransaction("readwrite", e._storeNames, o);
|
|
1940
1950
|
a.create(n), a._completion.catch(r);
|
|
1941
|
-
var s = a._reject.bind(a), c =
|
|
1951
|
+
var s = a._reject.bind(a), c = B.transless || B;
|
|
1942
1952
|
Pe(function() {
|
|
1943
|
-
return
|
|
1953
|
+
return B.trans = a, B.transless = c, t !== 0 ? (Kt(e, n), d = t, ((g = a).storeNames.includes("$meta") ? g.table("$meta").get("version").then(function(v) {
|
|
1944
1954
|
return v ?? d;
|
|
1945
1955
|
}) : M.resolve(d)).then(function(v) {
|
|
1946
1956
|
return h = v, y = a, b = n, w = [], v = (l = e)._versions, m = l._dbSchema = Gt(0, l.idbdb, b), (v = v.filter(function(_) {
|
|
@@ -1957,9 +1967,9 @@ var Rr = { exports: {} };
|
|
|
1957
1967
|
throw new L.Upgrade("Not yet support for changing primary key");
|
|
1958
1968
|
var G = b.objectStore(I.name);
|
|
1959
1969
|
I.add.forEach(function(F) {
|
|
1960
|
-
return
|
|
1970
|
+
return Nt(G, F);
|
|
1961
1971
|
}), I.change.forEach(function(F) {
|
|
1962
|
-
G.deleteIndex(F.name),
|
|
1972
|
+
G.deleteIndex(F.name), Nt(G, F);
|
|
1963
1973
|
}), I.del.forEach(function(F) {
|
|
1964
1974
|
return G.deleteIndex(F);
|
|
1965
1975
|
});
|
|
@@ -1970,20 +1980,20 @@ var Rr = { exports: {} };
|
|
|
1970
1980
|
var R = Qn(O);
|
|
1971
1981
|
x.del.forEach(function(I) {
|
|
1972
1982
|
R[I] = S[I];
|
|
1973
|
-
}), wn(l, [l.Transaction.prototype]),
|
|
1974
|
-
var
|
|
1983
|
+
}), wn(l, [l.Transaction.prototype]), Bt(l, [l.Transaction.prototype], K(R), R), y.schema = R;
|
|
1984
|
+
var P, T = qt(A);
|
|
1975
1985
|
return T && Je(), x = M.follow(function() {
|
|
1976
1986
|
var I;
|
|
1977
|
-
(
|
|
1978
|
-
}),
|
|
1979
|
-
return
|
|
1987
|
+
(P = A(y)) && T && (I = Ie.bind(null, null), P.then(I, I));
|
|
1988
|
+
}), P && typeof P.then == "function" ? M.resolve(P) : x.then(function() {
|
|
1989
|
+
return P;
|
|
1980
1990
|
});
|
|
1981
1991
|
}
|
|
1982
1992
|
}), w.push(function(S) {
|
|
1983
1993
|
var O, x, A = _._cfg.dbschema;
|
|
1984
1994
|
O = A, x = S, [].slice.call(x.db.objectStoreNames).forEach(function(R) {
|
|
1985
1995
|
return O[R] == null && x.db.deleteObjectStore(R);
|
|
1986
|
-
}), wn(l, [l.Transaction.prototype]),
|
|
1996
|
+
}), wn(l, [l.Transaction.prototype]), Bt(l, [l.Transaction.prototype], l._storeNames, l._dbSchema), y.schema = l._dbSchema;
|
|
1987
1997
|
}), w.push(function(S) {
|
|
1988
1998
|
l.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(l.idbdb.version / 10) === _._cfg.version ? (l.idbdb.deleteObjectStore("$meta"), delete l._dbSchema.$meta, l._storeNames = l._storeNames.filter(function(O) {
|
|
1989
1999
|
return O !== "$meta";
|
|
@@ -2013,7 +2023,7 @@ var Rr = { exports: {} };
|
|
|
2013
2023
|
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
2024
|
var c = t.objectStore(s.name);
|
|
2015
2025
|
s.add.forEach(function(g) {
|
|
2016
|
-
pe && console.debug("Dexie upgrade patch: Creating missing index ".concat(s.name, ".").concat(g.src)),
|
|
2026
|
+
pe && console.debug("Dexie upgrade patch: Creating missing index ".concat(s.name, ".").concat(g.src)), Nt(c, g);
|
|
2017
2027
|
});
|
|
2018
2028
|
}(o[r]);
|
|
2019
2029
|
if (typeof a == "object")
|
|
@@ -2048,7 +2058,7 @@ var Rr = { exports: {} };
|
|
|
2048
2058
|
function Sn(e, t, n, r) {
|
|
2049
2059
|
var o = e.db.createObjectStore(t, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
|
|
2050
2060
|
return r.forEach(function(a) {
|
|
2051
|
-
return
|
|
2061
|
+
return Nt(o, a);
|
|
2052
2062
|
}), o;
|
|
2053
2063
|
}
|
|
2054
2064
|
function mr(e, t) {
|
|
@@ -2056,7 +2066,7 @@ var Rr = { exports: {} };
|
|
|
2056
2066
|
t.db.objectStoreNames.contains(n) || (pe && console.debug("Dexie: Creating missing table", n), Sn(t, n, e[n].primKey, e[n].indexes));
|
|
2057
2067
|
});
|
|
2058
2068
|
}
|
|
2059
|
-
function
|
|
2069
|
+
function Nt(e, t) {
|
|
2060
2070
|
e.createIndex(t.name, t.keyPath, { unique: t.unique, multiEntry: t.multi });
|
|
2061
2071
|
}
|
|
2062
2072
|
function Gt(e, t, n) {
|
|
@@ -2083,7 +2093,7 @@ var Rr = { exports: {} };
|
|
|
2083
2093
|
function br(e) {
|
|
2084
2094
|
return e.split(",").map(function(t, n) {
|
|
2085
2095
|
var r = (t = t.trim()).replace(/([&*]|\+\+)/g, ""), o = /^\[/.test(r) ? r.match(/^\[(.*)\]$/)[1].split("+") : r;
|
|
2086
|
-
return mn(r, o || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t),
|
|
2096
|
+
return mn(r, o || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t), N(o), n === 0);
|
|
2087
2097
|
});
|
|
2088
2098
|
}
|
|
2089
2099
|
var hi = (Ft.prototype._parseStoresSpec = function(e, t) {
|
|
@@ -2106,7 +2116,7 @@ var Rr = { exports: {} };
|
|
|
2106
2116
|
var n = t._versions, r = {}, o = {};
|
|
2107
2117
|
return n.forEach(function(a) {
|
|
2108
2118
|
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]),
|
|
2119
|
+
}), 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
2120
|
}, Ft.prototype.upgrade = function(e) {
|
|
2111
2121
|
return this._cfg.contentUpgrade = tn(this._cfg.contentUpgrade || Y, e), this;
|
|
2112
2122
|
}, Ft);
|
|
@@ -2121,7 +2131,7 @@ var Rr = { exports: {} };
|
|
|
2121
2131
|
}
|
|
2122
2132
|
function xn(e) {
|
|
2123
2133
|
return Pe(function() {
|
|
2124
|
-
return
|
|
2134
|
+
return B.letThrough = !0, e();
|
|
2125
2135
|
});
|
|
2126
2136
|
}
|
|
2127
2137
|
function kn(e) {
|
|
@@ -2293,21 +2303,21 @@ var Rr = { exports: {} };
|
|
|
2293
2303
|
var m, _, S, O, x, A = e.idbdb = w.result, R = wt(A.objectStoreNames);
|
|
2294
2304
|
if (0 < R.length)
|
|
2295
2305
|
try {
|
|
2296
|
-
var
|
|
2306
|
+
var P = A.transaction((O = R).length === 1 ? O[0] : O, "readonly");
|
|
2297
2307
|
if (t.autoSchema)
|
|
2298
|
-
_ = A, S =
|
|
2299
|
-
else if (Lt(e, e._dbSchema,
|
|
2308
|
+
_ = A, S = P, (m = e).verno = _.version / 10, S = m._dbSchema = Gt(0, _, S), m._storeNames = wt(_.objectStoreNames, 0), Bt(m, [m._allTables], K(S), S);
|
|
2309
|
+
else if (Lt(e, e._dbSchema, P), ((x = _n(Gt(0, (x = e).idbdb, P), x._dbSchema)).add.length || x.change.some(function(T) {
|
|
2300
2310
|
return T.add.length || T.change.length;
|
|
2301
2311
|
})) && !a)
|
|
2302
2312
|
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."), A.close(), o = A.version + 1, a = !0, h(c());
|
|
2303
|
-
Kt(e,
|
|
2313
|
+
Kt(e, P);
|
|
2304
2314
|
} catch {
|
|
2305
2315
|
}
|
|
2306
2316
|
Ze.push(e), A.onversionchange = J(function(T) {
|
|
2307
2317
|
t.vcFired = !0, e.on("versionchange").fire(T);
|
|
2308
2318
|
}), A.onclose = J(function(T) {
|
|
2309
2319
|
e.on("close").fire(T);
|
|
2310
|
-
}), l && (x = e._deps,
|
|
2320
|
+
}), l && (x = e._deps, P = b, A = x.indexedDB, x = x.IDBKeyRange, On(A) || P === Ct || En(A, x).put({ name: P }).catch(Y)), h();
|
|
2311
2321
|
}, y);
|
|
2312
2322
|
}).catch(function(h) {
|
|
2313
2323
|
switch (h == null ? void 0 : h.name) {
|
|
@@ -2371,13 +2381,13 @@ var Rr = { exports: {} };
|
|
|
2371
2381
|
function o(a) {
|
|
2372
2382
|
return function(g) {
|
|
2373
2383
|
var c = a(g), g = c.value;
|
|
2374
|
-
return c.done ? g : g && typeof g.then == "function" ? g.then(n, r) :
|
|
2384
|
+
return c.done ? g : g && typeof g.then == "function" ? g.then(n, r) : N(g) ? Promise.all(g).then(n, r) : n(g);
|
|
2375
2385
|
};
|
|
2376
2386
|
}
|
|
2377
2387
|
return o(t)();
|
|
2378
2388
|
}
|
|
2379
2389
|
function zt(e, t, n) {
|
|
2380
|
-
for (var r =
|
|
2390
|
+
for (var r = N(e) ? e.slice() : [e], o = 0; o < n; ++o)
|
|
2381
2391
|
r.push(t);
|
|
2382
2392
|
return r;
|
|
2383
2393
|
}
|
|
@@ -2442,7 +2452,7 @@ var Rr = { exports: {} };
|
|
|
2442
2452
|
return f(f({}, e), { table: function(t) {
|
|
2443
2453
|
var n = e.table(t), r = n.schema.primaryKey;
|
|
2444
2454
|
return f(f({}, n), { mutate: function(o) {
|
|
2445
|
-
var a =
|
|
2455
|
+
var a = B.trans, s = a.table(t).hook, c = s.deleting, g = s.creating, d = s.updating;
|
|
2446
2456
|
switch (o.type) {
|
|
2447
2457
|
case "add":
|
|
2448
2458
|
if (g.fire === Y)
|
|
@@ -2478,20 +2488,20 @@ var Rr = { exports: {} };
|
|
|
2478
2488
|
}
|
|
2479
2489
|
return n.mutate(o);
|
|
2480
2490
|
function v(l) {
|
|
2481
|
-
var h, y, b, w =
|
|
2491
|
+
var h, y, b, w = B.trans, m = l.keys || Mn(r, l);
|
|
2482
2492
|
if (!m)
|
|
2483
2493
|
throw new Error("Keys missing");
|
|
2484
2494
|
return (l = l.type === "add" || l.type === "put" ? f(f({}, l), { keys: m }) : f({}, l)).type !== "delete" && (l.values = k([], l.values, !0)), l.keys && (l.keys = k([], l.keys, !0)), h = n, b = m, ((y = l).type === "add" ? Promise.resolve([]) : h.getMany({ trans: y.trans, keys: b, cache: "immutable" })).then(function(_) {
|
|
2485
2495
|
var S = m.map(function(O, x) {
|
|
2486
|
-
var A, R,
|
|
2487
|
-
return l.type === "delete" ? c.fire.call(I, O, T, w) : l.type === "add" || T === void 0 ? (A = g.fire.call(I, O, l.values[x], w), O == null && A != null && (l.keys[x] = O = A, r.outbound || fe(l.values[x], r.keyPath, O))) : (A = Tn(T, l.values[x]), (R = d.fire.call(I, A, O, T, w)) && (
|
|
2488
|
-
ie(
|
|
2496
|
+
var A, R, P, T = _[x], I = { onerror: null, onsuccess: null };
|
|
2497
|
+
return l.type === "delete" ? c.fire.call(I, O, T, w) : l.type === "add" || T === void 0 ? (A = g.fire.call(I, O, l.values[x], w), O == null && A != null && (l.keys[x] = O = A, r.outbound || fe(l.values[x], r.keyPath, O))) : (A = Tn(T, l.values[x]), (R = d.fire.call(I, A, O, T, w)) && (P = l.values[x], Object.keys(R).forEach(function(G) {
|
|
2498
|
+
ie(P, G) ? P[G] = R[G] : fe(P, G, R[G]);
|
|
2489
2499
|
}))), I;
|
|
2490
2500
|
});
|
|
2491
2501
|
return n.mutate(l).then(function(O) {
|
|
2492
|
-
for (var x = O.failures, A = O.results, R = O.numFailures, O = O.lastResult,
|
|
2493
|
-
var T = (A || m)[
|
|
2494
|
-
T == null ? I.onerror && I.onerror(x[
|
|
2502
|
+
for (var x = O.failures, A = O.results, R = O.numFailures, O = O.lastResult, P = 0; P < m.length; ++P) {
|
|
2503
|
+
var T = (A || m)[P], I = S[P];
|
|
2504
|
+
T == null ? I.onerror && I.onerror(x[P]) : I.onsuccess && I.onsuccess(l.type === "put" && _[P] ? l.values[P] : T);
|
|
2495
2505
|
}
|
|
2496
2506
|
return { failures: x, results: A, numFailures: R, lastResult: O };
|
|
2497
2507
|
}).catch(function(O) {
|
|
@@ -2547,8 +2557,8 @@ var Rr = { exports: {} };
|
|
|
2547
2557
|
var bi = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2548
2558
|
var t = e.schema.name, n = new oe(e.MIN_KEY, e.MAX_KEY);
|
|
2549
2559
|
return f(f({}, e), { transaction: function(r, o, a) {
|
|
2550
|
-
if (
|
|
2551
|
-
throw new L.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(
|
|
2560
|
+
if (B.subscr && o !== "readonly")
|
|
2561
|
+
throw new L.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(B.querier));
|
|
2552
2562
|
return e.transaction(r, o, a);
|
|
2553
2563
|
}, table: function(r) {
|
|
2554
2564
|
function o(y) {
|
|
@@ -2561,14 +2571,14 @@ var Rr = { exports: {} };
|
|
|
2561
2571
|
}
|
|
2562
2572
|
var b, w, m, _ = h.trans, S = h.mutatedParts || (h.mutatedParts = {}), O = y(""), x = y(":dels"), A = h.type, T = h.type === "deleteRange" ? [h.range] : h.type === "delete" ? [h.keys] : h.values.length < 50 ? [Mn(c, h).filter(function(I) {
|
|
2563
2573
|
return I;
|
|
2564
|
-
}), h.values] : [], R = T[0],
|
|
2565
|
-
return
|
|
2574
|
+
}), h.values] : [], R = T[0], P = T[1], T = h.trans._cache;
|
|
2575
|
+
return N(R) ? (O.addKeys(R), (T = A === "delete" || R.length === P.length ? Sr(R, T) : null) || x.addKeys(R), (T || P) && (b = y, w = T, m = P, s.indexes.forEach(function(I) {
|
|
2566
2576
|
var G = b(I.name || "");
|
|
2567
2577
|
function F(U) {
|
|
2568
2578
|
return U != null ? I.extractKey(U) : null;
|
|
2569
2579
|
}
|
|
2570
2580
|
function H(U) {
|
|
2571
|
-
return I.multiEntry &&
|
|
2581
|
+
return I.multiEntry && N(U) ? U.forEach(function(Q) {
|
|
2572
2582
|
return G.addKey(Q);
|
|
2573
2583
|
}) : G.addKey(U);
|
|
2574
2584
|
}
|
|
@@ -2576,7 +2586,7 @@ var Rr = { exports: {} };
|
|
|
2576
2586
|
var le = w && F(w[$]), $ = m && F(m[$]);
|
|
2577
2587
|
z(le, $) !== 0 && (le != null && H(le), $ != null && H($));
|
|
2578
2588
|
});
|
|
2579
|
-
}))) : R ? (
|
|
2589
|
+
}))) : R ? (P = { from: R.lower, to: R.upper }, x.add(P), O.add(P)) : (O.add(n), x.add(n), s.indexes.forEach(function(I) {
|
|
2580
2590
|
return y(I.name).add(n);
|
|
2581
2591
|
})), a.mutate(h).then(function(I) {
|
|
2582
2592
|
return !R || h.type !== "add" && h.type !== "put" || O.addKeys(I.results), _.mutatedParts = Ut(_.mutatedParts || {}, S), I;
|
|
@@ -2588,24 +2598,24 @@ var Rr = { exports: {} };
|
|
|
2588
2598
|
}, count: o, query: o, openCursor: o };
|
|
2589
2599
|
return K(l).forEach(function(h) {
|
|
2590
2600
|
v[h] = function(y) {
|
|
2591
|
-
var b =
|
|
2601
|
+
var b = B.subscr, w = !!b, m = Er(B, a) && Or(h, y) ? y.obsSet = {} : b;
|
|
2592
2602
|
if (w) {
|
|
2593
|
-
var _ = function(
|
|
2594
|
-
return
|
|
2603
|
+
var _ = function(P) {
|
|
2604
|
+
return P = "idb://".concat(t, "/").concat(r, "/").concat(P), m[P] || (m[P] = new oe());
|
|
2595
2605
|
}, S = _(""), O = _(":dels"), b = l[h](y), w = b[0], b = b[1];
|
|
2596
2606
|
if ((h === "query" && w.isPrimaryKey && !y.values ? O : _(w.name || "")).add(b), !w.isPrimaryKey) {
|
|
2597
2607
|
if (h !== "count") {
|
|
2598
2608
|
var x = h === "query" && d && y.values && a.query(f(f({}, y), { values: !1 }));
|
|
2599
|
-
return a[h].apply(this, arguments).then(function(
|
|
2609
|
+
return a[h].apply(this, arguments).then(function(P) {
|
|
2600
2610
|
if (h === "query") {
|
|
2601
2611
|
if (d && y.values)
|
|
2602
2612
|
return x.then(function(F) {
|
|
2603
|
-
return F = F.result, S.addKeys(F),
|
|
2613
|
+
return F = F.result, S.addKeys(F), P;
|
|
2604
2614
|
});
|
|
2605
|
-
var T = y.values ?
|
|
2615
|
+
var T = y.values ? P.result.map(g) : P.result;
|
|
2606
2616
|
(y.values ? S : O).addKeys(T);
|
|
2607
2617
|
} else if (h === "openCursor") {
|
|
2608
|
-
var I =
|
|
2618
|
+
var I = P, G = y.values;
|
|
2609
2619
|
return I && Object.create(I, { key: { get: function() {
|
|
2610
2620
|
return O.addKey(I.primaryKey), I.key;
|
|
2611
2621
|
} }, primaryKey: { get: function() {
|
|
@@ -2615,7 +2625,7 @@ var Rr = { exports: {} };
|
|
|
2615
2625
|
return G && S.addKey(I.primaryKey), I.value;
|
|
2616
2626
|
} } });
|
|
2617
2627
|
}
|
|
2618
|
-
return
|
|
2628
|
+
return P;
|
|
2619
2629
|
});
|
|
2620
2630
|
}
|
|
2621
2631
|
O.add(n);
|
|
@@ -2632,9 +2642,9 @@ var Rr = { exports: {} };
|
|
|
2632
2642
|
if (t.type === "deleteRange")
|
|
2633
2643
|
return null;
|
|
2634
2644
|
var r = t.keys ? t.keys.length : "values" in t && t.values ? t.values.length : 1;
|
|
2635
|
-
return n.numFailures === r ? null : (t = f({}, t),
|
|
2645
|
+
return n.numFailures === r ? null : (t = f({}, t), N(t.keys) && (t.keys = t.keys.filter(function(o, a) {
|
|
2636
2646
|
return !(a in n.failures);
|
|
2637
|
-
})), "values" in t &&
|
|
2647
|
+
})), "values" in t && N(t.values) && (t.values = t.values.filter(function(o, a) {
|
|
2638
2648
|
return !(a in n.failures);
|
|
2639
2649
|
})), t);
|
|
2640
2650
|
}
|
|
@@ -2647,7 +2657,7 @@ var Rr = { exports: {} };
|
|
|
2647
2657
|
return e;
|
|
2648
2658
|
var s = t.query.index, c = s.multiEntry, g = t.query.range, d = r.schema.primaryKey.extractKey, v = s.extractKey, l = (s.lowLevelIndex || s).extractKey, h = h.reduce(function(y, b) {
|
|
2649
2659
|
var w = y, m = b.type === "add" || b.type === "put" ? b.values.filter(function(x) {
|
|
2650
|
-
return x = v(x), c &&
|
|
2660
|
+
return x = v(x), c && N(x) ? x.some(function(A) {
|
|
2651
2661
|
return jn(A, g);
|
|
2652
2662
|
}) : jn(x, g);
|
|
2653
2663
|
}).map(function(x) {
|
|
@@ -2744,7 +2754,7 @@ var Rr = { exports: {} };
|
|
|
2744
2754
|
if (c._explicit && g && c.mutatedParts)
|
|
2745
2755
|
for (var m = 0, _ = Object.values(y.queries.query); m < _.length; m++)
|
|
2746
2756
|
for (var S = 0, O = (R = _[m]).slice(); S < O.length; S++)
|
|
2747
|
-
Dn((
|
|
2757
|
+
Dn((P = O[S]).obsSet, c.mutatedParts) && (je(R, P), P.subscribers.forEach(function(F) {
|
|
2748
2758
|
return d.add(F);
|
|
2749
2759
|
}));
|
|
2750
2760
|
else if (0 < w.length) {
|
|
@@ -2752,10 +2762,10 @@ var Rr = { exports: {} };
|
|
|
2752
2762
|
return F.trans !== c;
|
|
2753
2763
|
});
|
|
2754
2764
|
for (var x = 0, A = Object.values(y.queries.query); x < A.length; x++)
|
|
2755
|
-
for (var R,
|
|
2756
|
-
(
|
|
2765
|
+
for (var R, P, T, I = 0, G = (R = A[x]).slice(); I < G.length; I++)
|
|
2766
|
+
(P = G[I]).res != null && c.mutatedParts && (g && !P.dirty ? (T = Object.isFrozen(P.res), T = kr(P.res, P.req, w, b, P, T), P.dirty ? (je(R, P), P.subscribers.forEach(function(F) {
|
|
2757
2767
|
return d.add(F);
|
|
2758
|
-
})) : T !==
|
|
2768
|
+
})) : T !== P.res && (P.res = T, P.promise = M.resolve({ result: T }))) : (P.dirty && je(R, P), P.subscribers.forEach(function(F) {
|
|
2759
2769
|
return d.add(F);
|
|
2760
2770
|
})));
|
|
2761
2771
|
}
|
|
@@ -2770,7 +2780,7 @@ var Rr = { exports: {} };
|
|
|
2770
2780
|
}, table: function(n) {
|
|
2771
2781
|
var r = e.table(n), o = r.schema.primaryKey;
|
|
2772
2782
|
return f(f({}, r), { mutate: function(a) {
|
|
2773
|
-
var s =
|
|
2783
|
+
var s = B.trans;
|
|
2774
2784
|
if (o.outbound || s.db._options.cache === "disabled" || s.explicit)
|
|
2775
2785
|
return r.mutate(a);
|
|
2776
2786
|
var c = $e["idb://".concat(t, "/").concat(n)];
|
|
@@ -2790,9 +2800,9 @@ var Rr = { exports: {} };
|
|
|
2790
2800
|
});
|
|
2791
2801
|
}), s) : r.mutate(a);
|
|
2792
2802
|
}, query: function(a) {
|
|
2793
|
-
if (!Er(
|
|
2803
|
+
if (!Er(B, r) || !Or("query", a))
|
|
2794
2804
|
return r.query(a);
|
|
2795
|
-
var s = ((d =
|
|
2805
|
+
var s = ((d = B.trans) === null || d === void 0 ? void 0 : d.db._options.cache) === "immutable", l = B, c = l.requery, g = l.signal, d = function(b, w, m, _) {
|
|
2796
2806
|
var S = $e["idb://".concat(b, "/").concat(w)];
|
|
2797
2807
|
if (!S)
|
|
2798
2808
|
return [];
|
|
@@ -2849,7 +2859,7 @@ var Rr = { exports: {} };
|
|
|
2849
2859
|
return n || (n = new this.Version(e), t.push(n), t.sort(li), n.stores({}), this._state.autoSchema = !1, n);
|
|
2850
2860
|
}, ee.prototype._whenReady = function(e) {
|
|
2851
2861
|
var t = this;
|
|
2852
|
-
return this.idbdb && (this._state.openComplete ||
|
|
2862
|
+
return this.idbdb && (this._state.openComplete || B.letThrough || this._vip) ? e() : new M(function(n, r) {
|
|
2853
2863
|
if (t._state.openComplete)
|
|
2854
2864
|
return r(new L.DatabaseClosed(t._state.dbOpenError));
|
|
2855
2865
|
if (!t._state.isBeingOpened) {
|
|
@@ -2935,7 +2945,7 @@ var Rr = { exports: {} };
|
|
|
2935
2945
|
}).apply(this, arguments);
|
|
2936
2946
|
return this._transaction.apply(this, e);
|
|
2937
2947
|
}, ee.prototype._transaction = function(e, t, n) {
|
|
2938
|
-
var r = this, o =
|
|
2948
|
+
var r = this, o = B.trans;
|
|
2939
2949
|
o && o.db === this && e.indexOf("!") === -1 || (o = null);
|
|
2940
2950
|
var a, s, c = e.indexOf("?") !== -1;
|
|
2941
2951
|
e = e.replace("!", "").replace("?", "");
|
|
@@ -2972,7 +2982,7 @@ var Rr = { exports: {} };
|
|
|
2972
2982
|
}
|
|
2973
2983
|
var g = (function d(v, l, h, y, b) {
|
|
2974
2984
|
return M.resolve().then(function() {
|
|
2975
|
-
var w =
|
|
2985
|
+
var w = B.transless || B, m = v._createTransaction(l, h, v._dbSchema, y);
|
|
2976
2986
|
if (m.explicit = !0, w = { trans: m, transless: w }, y)
|
|
2977
2987
|
m.idbtrans = y.idbtrans;
|
|
2978
2988
|
else
|
|
@@ -3000,7 +3010,7 @@ var Rr = { exports: {} };
|
|
|
3000
3010
|
});
|
|
3001
3011
|
});
|
|
3002
3012
|
}).bind(null, this, a, s, o, n);
|
|
3003
|
-
return o ? o._promise(a, g, "lock") :
|
|
3013
|
+
return o ? o._promise(a, g, "lock") : B.trans ? Ge(B.transless, function() {
|
|
3004
3014
|
return r._whenReady(g);
|
|
3005
3015
|
}) : this._whenReady(g);
|
|
3006
3016
|
}, ee.prototype.table = function(e) {
|
|
@@ -3152,7 +3162,7 @@ var Rr = { exports: {} };
|
|
|
3152
3162
|
}, r;
|
|
3153
3163
|
}
|
|
3154
3164
|
var Ue = Se;
|
|
3155
|
-
function
|
|
3165
|
+
function Bn(e) {
|
|
3156
3166
|
var t = Me;
|
|
3157
3167
|
try {
|
|
3158
3168
|
Me = !0, Te.storagemutated.fire(e), Cn(e, !0);
|
|
@@ -3186,7 +3196,7 @@ var Rr = { exports: {} };
|
|
|
3186
3196
|
Z(this, e);
|
|
3187
3197
|
};
|
|
3188
3198
|
}, ignoreTransaction: function(e) {
|
|
3189
|
-
return
|
|
3199
|
+
return B.trans ? Ge(B.transless, e) : e();
|
|
3190
3200
|
}, vip: xn, async: function(e) {
|
|
3191
3201
|
return function() {
|
|
3192
3202
|
try {
|
|
@@ -3204,9 +3214,9 @@ var Rr = { exports: {} };
|
|
|
3204
3214
|
return q(o);
|
|
3205
3215
|
}
|
|
3206
3216
|
}, currentTransaction: { get: function() {
|
|
3207
|
-
return
|
|
3217
|
+
return B.trans || null;
|
|
3208
3218
|
} }, waitFor: function(e, t) {
|
|
3209
|
-
return t = M.resolve(typeof e == "function" ? Ue.ignoreTransaction(e) : e).timeout(t || 6e4),
|
|
3219
|
+
return t = M.resolve(typeof e == "function" ? Ue.ignoreTransaction(e) : e).timeout(t || 6e4), B.trans ? B.trans.waitFor(t) : t;
|
|
3210
3220
|
}, Promise: M, debug: { get: function() {
|
|
3211
3221
|
return pe;
|
|
3212
3222
|
}, set: function(e) {
|
|
@@ -3222,13 +3232,13 @@ var Rr = { exports: {} };
|
|
|
3222
3232
|
}) })), Ue.maxKey = gt(Ue.dependencies.IDBKeyRange), typeof dispatchEvent < "u" && typeof addEventListener < "u" && (Te(pt, function(e) {
|
|
3223
3233
|
Me || (e = new CustomEvent(yn, { detail: e }), Me = !0, dispatchEvent(e), Me = !1);
|
|
3224
3234
|
}), addEventListener(yn, function(e) {
|
|
3225
|
-
e = e.detail, Me ||
|
|
3235
|
+
e = e.detail, Me || Bn(e);
|
|
3226
3236
|
}));
|
|
3227
3237
|
var tt, Me = !1, Pr = function() {
|
|
3228
3238
|
};
|
|
3229
3239
|
return typeof BroadcastChannel < "u" && ((Pr = function() {
|
|
3230
3240
|
(tt = new BroadcastChannel(yn)).onmessage = function(e) {
|
|
3231
|
-
return e.data &&
|
|
3241
|
+
return e.data && Bn(e.data);
|
|
3232
3242
|
};
|
|
3233
3243
|
})(), typeof tt.unref == "function" && tt.unref(), Te(pt, function(e) {
|
|
3234
3244
|
Me || tt.postMessage(e);
|
|
@@ -3239,7 +3249,7 @@ var Rr = { exports: {} };
|
|
|
3239
3249
|
n[t].close({ disableAutoOpen: !1 });
|
|
3240
3250
|
}
|
|
3241
3251
|
}), addEventListener("pageshow", function(e) {
|
|
3242
|
-
!Se.disableBfCache && e.persisted && (pe && console.debug("Dexie: handling persisted pageshow"), Pr(),
|
|
3252
|
+
!Se.disableBfCache && e.persisted && (pe && console.debug("Dexie: handling persisted pageshow"), Pr(), Bn({ all: new oe(-1 / 0, [[]]) }));
|
|
3243
3253
|
})), M.rejectionMapper = function(e, t) {
|
|
3244
3254
|
return !e || e instanceof Ye || 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
3255
|
return this.inner.stack;
|
|
@@ -3265,11 +3275,11 @@ function nt(p) {
|
|
|
3265
3275
|
return p.topics === void 0 && (p.topics = `${p.dashboard}-${p.widget}`), p;
|
|
3266
3276
|
}
|
|
3267
3277
|
function vt(p, i) {
|
|
3268
|
-
var
|
|
3278
|
+
var N;
|
|
3269
3279
|
let u, f, k, C, K;
|
|
3270
3280
|
switch (p.moderation) {
|
|
3271
3281
|
case Vt.BEFORE:
|
|
3272
|
-
u = /* @__PURE__ */ new Date(), f = (
|
|
3282
|
+
u = /* @__PURE__ */ new Date(), f = (N = p.beforeTime) == null ? void 0 : N.split(":"), k = Number.parseInt(f ? f[0] : "00"), C = Number.parseInt(f ? f[1] : "00"), K = Number.parseInt(f ? f[2] : "00"), i.before = u.setHours(k, C, K, 0) / 1e3, i.period || (i.period = u.getDay() === 1 ? 72 : 24);
|
|
3273
3283
|
break;
|
|
3274
3284
|
case Vt.DELAYED:
|
|
3275
3285
|
p.delay && p.delay > 0 && (i.delay = `${p.delay}`);
|
|
@@ -3284,15 +3294,15 @@ function vt(p, i) {
|
|
|
3284
3294
|
}
|
|
3285
3295
|
class Tr {
|
|
3286
3296
|
constructor(i) {
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3297
|
+
D(this, "db");
|
|
3298
|
+
D(this, "subscribers", []);
|
|
3299
|
+
D(this, "options");
|
|
3290
3300
|
/**
|
|
3291
3301
|
* Retrieve Cloud Data
|
|
3292
3302
|
* @param query IQuery
|
|
3293
3303
|
* @returns IResponse
|
|
3294
3304
|
*/
|
|
3295
|
-
|
|
3305
|
+
D(this, "getCloud", async (i) => {
|
|
3296
3306
|
const u = await this.db.table(j.CLOUD).where({ id: i.widget }).last().catch(() => {
|
|
3297
3307
|
console.warn(
|
|
3298
3308
|
"%capi%C %ccloud",
|
|
@@ -3310,7 +3320,7 @@ class Tr {
|
|
|
3310
3320
|
* @param query IQuery
|
|
3311
3321
|
* @returns IResponse
|
|
3312
3322
|
*/
|
|
3313
|
-
|
|
3323
|
+
D(this, "getSeries", async (i) => {
|
|
3314
3324
|
const u = await this.db.table(j.SERIES).where({ id: i.widget }).last().catch(() => {
|
|
3315
3325
|
console.warn(
|
|
3316
3326
|
"%capi%c %cseries",
|
|
@@ -3328,7 +3338,7 @@ class Tr {
|
|
|
3328
3338
|
* @param query IQuery
|
|
3329
3339
|
* @returns IResponse
|
|
3330
3340
|
*/
|
|
3331
|
-
|
|
3341
|
+
D(this, "getMessages", async (i) => {
|
|
3332
3342
|
const u = (C) => C.widget_id === i.widget, f = (C) => C.utc > ((i == null ? void 0 : i.since) || 0), k = (C) => (C == null ? void 0 : C.visible) !== 0;
|
|
3333
3343
|
try {
|
|
3334
3344
|
const C = await this.db.table(j.TOPICS).orderBy("utc").reverse().filter(u).filter(f).filter(k).limit((i == null ? void 0 : i.limit) ?? 25).toArray().catch(() => {
|
|
@@ -3343,9 +3353,9 @@ class Tr {
|
|
|
3343
3353
|
});
|
|
3344
3354
|
if (C.length === 0)
|
|
3345
3355
|
return { data: null, message: "No Messages error", success: !1 };
|
|
3346
|
-
const K = C[0] ? C[0].title : "No title",
|
|
3356
|
+
const K = C[0] ? C[0].title : "No title", N = C.map(
|
|
3347
3357
|
(be) => be.message_id
|
|
3348
|
-
), te = (await this.db.table(j.MESSAGES).where("id").anyOf(
|
|
3358
|
+
), te = (await this.db.table(j.MESSAGES).where("id").anyOf(N).toArray().then((be) => be.sort((ie, xe) => xe.utc - ie.utc))).map(
|
|
3349
3359
|
(be) => be.data
|
|
3350
3360
|
);
|
|
3351
3361
|
return {
|
|
@@ -3370,7 +3380,7 @@ class Tr {
|
|
|
3370
3380
|
* @param data
|
|
3371
3381
|
* @returns number
|
|
3372
3382
|
*/
|
|
3373
|
-
|
|
3383
|
+
D(this, "setCloud", async (i, u) => i.type === j.CLOUD && u !== "" ? await this.db.table(j.CLOUD).put({
|
|
3374
3384
|
id: i.widget,
|
|
3375
3385
|
dashboard_id: i.dashboard,
|
|
3376
3386
|
data: u.data
|
|
@@ -3381,7 +3391,7 @@ class Tr {
|
|
|
3381
3391
|
* @param data
|
|
3382
3392
|
* @returns number
|
|
3383
3393
|
*/
|
|
3384
|
-
|
|
3394
|
+
D(this, "setSeries", async (i, u) => i.type === j.SERIES && u !== "" ? await this.db.table(j.SERIES).put({
|
|
3385
3395
|
id: i.widget,
|
|
3386
3396
|
dashboard_id: i.dashboard,
|
|
3387
3397
|
data: u.data
|
|
@@ -3395,13 +3405,13 @@ class Tr {
|
|
|
3395
3405
|
* @param data.data.messages IMessages
|
|
3396
3406
|
* @returns number
|
|
3397
3407
|
*/
|
|
3398
|
-
|
|
3408
|
+
D(this, "setMessages", async (i, u) => {
|
|
3399
3409
|
if (i.type !== j.MESSAGES)
|
|
3400
3410
|
return 400;
|
|
3401
3411
|
const f = u.title;
|
|
3402
3412
|
try {
|
|
3403
3413
|
return u.data.messages.forEach(async (k) => {
|
|
3404
|
-
var C, K,
|
|
3414
|
+
var C, K, N;
|
|
3405
3415
|
await this.db.table(j.MESSAGES).put({ id: k.id, utc: k.utc, data: k }), await this.db.table(j.TOPICS).put({
|
|
3406
3416
|
widget_id: i.widget,
|
|
3407
3417
|
message_id: k.id,
|
|
@@ -3409,7 +3419,7 @@ class Tr {
|
|
|
3409
3419
|
title: f,
|
|
3410
3420
|
engagement: (C = k.dynamics) == null ? void 0 : C.engagement,
|
|
3411
3421
|
impressions: (K = k.dynamics) == null ? void 0 : K.semrush_visits,
|
|
3412
|
-
reach: (
|
|
3422
|
+
reach: (N = k.dynamics) == null ? void 0 : N.potential_reach,
|
|
3413
3423
|
sentiment: k.topics[0].sentiment,
|
|
3414
3424
|
utc: k.utc
|
|
3415
3425
|
});
|
|
@@ -3422,7 +3432,7 @@ class Tr {
|
|
|
3422
3432
|
* Wipe Message data after number of seconds
|
|
3423
3433
|
* @param retentionDuration
|
|
3424
3434
|
*/
|
|
3425
|
-
|
|
3435
|
+
D(this, "cleanMessages", async (i) => {
|
|
3426
3436
|
const u = Date.now() / 1e3, f = (C) => C.utc < u - i, k = (C) => C.utc < u - i;
|
|
3427
3437
|
return await this.db.table(j.TOPICS).orderBy("utc").filter(f).modify((C, K) => {
|
|
3428
3438
|
delete K.value;
|
|
@@ -3442,7 +3452,7 @@ class Tr {
|
|
|
3442
3452
|
C
|
|
3443
3453
|
), 0));
|
|
3444
3454
|
});
|
|
3445
|
-
|
|
3455
|
+
D(this, "hideMessage", async (i, u) => {
|
|
3446
3456
|
await this.db.table(j.TOPICS).where("message_id").equals(i).modify({ visible: u }).catch((f) => (console.error(
|
|
3447
3457
|
"%cstorage%c %chide",
|
|
3448
3458
|
E.STORAGE,
|
|
@@ -3456,7 +3466,7 @@ class Tr {
|
|
|
3456
3466
|
* @param query IQuery
|
|
3457
3467
|
* @returns number
|
|
3458
3468
|
*/
|
|
3459
|
-
|
|
3469
|
+
D(this, "setWidget", async (i) => await this.db.table(j.WIDGETS).put({
|
|
3460
3470
|
id: i.widget,
|
|
3461
3471
|
dashboard_id: i.dashboard,
|
|
3462
3472
|
type: i.type
|
|
@@ -3466,7 +3476,7 @@ class Tr {
|
|
|
3466
3476
|
* @param query IQuery
|
|
3467
3477
|
* @returns null
|
|
3468
3478
|
*/
|
|
3469
|
-
|
|
3479
|
+
D(this, "subscribe", (i) => (i = nt(i), this.subscribers.filter(
|
|
3470
3480
|
(f) => f.widget === i.widget
|
|
3471
3481
|
).length > 0 || (i.type === j.MESSAGES && (i = vt(this.options, i)), console.debug(
|
|
3472
3482
|
"%cstorage%c %csubscribe",
|
|
@@ -3480,7 +3490,7 @@ class Tr {
|
|
|
3480
3490
|
* Get current subscribers
|
|
3481
3491
|
* @returns IQuery[]
|
|
3482
3492
|
*/
|
|
3483
|
-
|
|
3493
|
+
D(this, "getSubscribers", async () => await new Promise((i) => i(this.subscribers)));
|
|
3484
3494
|
this.options = i, this.db = new Un(i.app), this.db.version(2).stores({
|
|
3485
3495
|
player: "id,title,name,location",
|
|
3486
3496
|
monitor: "id,player_id,cols,rows,order,width,height,physicalwidth,physicalheight,devicePixelRatio,screenLeft,screenTop,orientation,monitor",
|
|
@@ -3518,17 +3528,17 @@ function Xt(p, i, u = Mr()) {
|
|
|
3518
3528
|
}
|
|
3519
3529
|
class jr {
|
|
3520
3530
|
constructor(i) {
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3531
|
+
D(this, "subscribers", []);
|
|
3532
|
+
D(this, "options");
|
|
3533
|
+
D(this, "getCloud", async (i) => {
|
|
3524
3534
|
const u = V(i);
|
|
3525
3535
|
return await Ln(u).then((f) => f).catch(() => (console.warn("%capi", E.API, j.CLOUD, i.slide, i.widget), { data: null, message: "Cloud Data error", success: !1 }));
|
|
3526
3536
|
});
|
|
3527
|
-
|
|
3537
|
+
D(this, "getSeries", async (i) => {
|
|
3528
3538
|
const u = V(i);
|
|
3529
3539
|
return await Ln(u).then((f) => f).catch(() => (console.warn("%capi", E.API, j.SERIES, i.slide, i.widget), { data: null, message: "Series Data error", success: !1 }));
|
|
3530
3540
|
});
|
|
3531
|
-
|
|
3541
|
+
D(this, "getMessages", async (i) => {
|
|
3532
3542
|
const u = V(i);
|
|
3533
3543
|
return await Ln(u).then((f) => f).catch(() => (console.warn("%capi", E.API, j.MESSAGES, i.slide, i.widget), { data: null, message: "Messages Data error", success: !1 }));
|
|
3534
3544
|
});
|
|
@@ -3538,7 +3548,7 @@ class jr {
|
|
|
3538
3548
|
* @param data
|
|
3539
3549
|
* @returns number
|
|
3540
3550
|
*/
|
|
3541
|
-
|
|
3551
|
+
D(this, "setCloud", async (i, u) => {
|
|
3542
3552
|
if (!u.success)
|
|
3543
3553
|
return 400;
|
|
3544
3554
|
const f = V(i);
|
|
@@ -3550,7 +3560,7 @@ class jr {
|
|
|
3550
3560
|
* @param data
|
|
3551
3561
|
* @returns bumber
|
|
3552
3562
|
*/
|
|
3553
|
-
|
|
3563
|
+
D(this, "setSeries", async (i, u) => {
|
|
3554
3564
|
if (!u.success)
|
|
3555
3565
|
return 400;
|
|
3556
3566
|
const f = V(i);
|
|
@@ -3562,14 +3572,14 @@ class jr {
|
|
|
3562
3572
|
* @param data
|
|
3563
3573
|
* @returns number
|
|
3564
3574
|
*/
|
|
3565
|
-
|
|
3575
|
+
D(this, "setMessages", async (i, u) => {
|
|
3566
3576
|
if (!u.success)
|
|
3567
3577
|
return 400;
|
|
3568
3578
|
const f = V(i);
|
|
3569
3579
|
return delete u.success, delete u.message, await Xt(f, u).then(() => 201).catch((k) => (console.error("%cstorage", E.STORAGE, j.MESSAGES, i, k), 400));
|
|
3570
3580
|
});
|
|
3571
|
-
|
|
3572
|
-
|
|
3581
|
+
D(this, "cleanMessages", async (i) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((u) => u(0))));
|
|
3582
|
+
D(this, "hideMessage", async (i, u) => {
|
|
3573
3583
|
console.debug(`hideMessage ${i} ${u} not implemented for ${this.options.storage}`);
|
|
3574
3584
|
});
|
|
3575
3585
|
/**
|
|
@@ -3577,7 +3587,7 @@ class jr {
|
|
|
3577
3587
|
* @param query IQuery
|
|
3578
3588
|
* @returns number
|
|
3579
3589
|
*/
|
|
3580
|
-
|
|
3590
|
+
D(this, "setWidget", async (i) => {
|
|
3581
3591
|
const u = V(i), f = {
|
|
3582
3592
|
id: i.widget,
|
|
3583
3593
|
dashboard_id: i.dashboard,
|
|
@@ -3590,7 +3600,7 @@ class jr {
|
|
|
3590
3600
|
* @param query IQuery
|
|
3591
3601
|
* @returns null
|
|
3592
3602
|
*/
|
|
3593
|
-
|
|
3603
|
+
D(this, "subscribe", (i) => (i = nt(i), i.type === j.MESSAGES && (i = vt(this.options, i)), this.subscribers.filter(
|
|
3594
3604
|
(f) => f.widget === i.widget
|
|
3595
3605
|
).length > 0 || (console.debug(
|
|
3596
3606
|
"%cstorage%c %csubscribe",
|
|
@@ -3604,15 +3614,15 @@ class jr {
|
|
|
3604
3614
|
* Get current subscribers
|
|
3605
3615
|
* @returns IQuery[]
|
|
3606
3616
|
*/
|
|
3607
|
-
|
|
3617
|
+
D(this, "getSubscribers", async () => await new Promise((i) => i(this.subscribers)));
|
|
3608
3618
|
this.options = i;
|
|
3609
3619
|
}
|
|
3610
3620
|
}
|
|
3611
3621
|
class Kr {
|
|
3612
3622
|
constructor(i) {
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3623
|
+
D(this, "subscribers", []);
|
|
3624
|
+
D(this, "options");
|
|
3625
|
+
D(this, "getCloud", async (i) => {
|
|
3616
3626
|
const u = V(i);
|
|
3617
3627
|
try {
|
|
3618
3628
|
return localStorage.getObject(u);
|
|
@@ -3620,7 +3630,7 @@ class Kr {
|
|
|
3620
3630
|
return console.warn("%capi", E.API, j.CLOUD, i.slide, i.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3621
3631
|
}
|
|
3622
3632
|
});
|
|
3623
|
-
|
|
3633
|
+
D(this, "getSeries", async (i) => {
|
|
3624
3634
|
const u = V(i);
|
|
3625
3635
|
try {
|
|
3626
3636
|
return localStorage.getObject(u);
|
|
@@ -3628,7 +3638,7 @@ class Kr {
|
|
|
3628
3638
|
return console.warn("%capi", E.API, j.SERIES, i.slide, i.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3629
3639
|
}
|
|
3630
3640
|
});
|
|
3631
|
-
|
|
3641
|
+
D(this, "getMessages", async (i) => {
|
|
3632
3642
|
const u = V(i);
|
|
3633
3643
|
try {
|
|
3634
3644
|
return localStorage.getObject(u);
|
|
@@ -3642,7 +3652,7 @@ class Kr {
|
|
|
3642
3652
|
* @param data
|
|
3643
3653
|
* @returns number
|
|
3644
3654
|
*/
|
|
3645
|
-
|
|
3655
|
+
D(this, "setCloud", async (i, u) => {
|
|
3646
3656
|
const f = V(i);
|
|
3647
3657
|
try {
|
|
3648
3658
|
return localStorage.setObject(f, u), 201;
|
|
@@ -3656,7 +3666,7 @@ class Kr {
|
|
|
3656
3666
|
* @param data
|
|
3657
3667
|
* @returns number
|
|
3658
3668
|
*/
|
|
3659
|
-
|
|
3669
|
+
D(this, "setSeries", async (i, u) => {
|
|
3660
3670
|
const f = V(i);
|
|
3661
3671
|
try {
|
|
3662
3672
|
return localStorage.setObject(f, u), 201;
|
|
@@ -3670,7 +3680,7 @@ class Kr {
|
|
|
3670
3680
|
* @param data
|
|
3671
3681
|
* @returns number
|
|
3672
3682
|
*/
|
|
3673
|
-
|
|
3683
|
+
D(this, "setMessages", async (i, u) => {
|
|
3674
3684
|
const f = V(i);
|
|
3675
3685
|
try {
|
|
3676
3686
|
return localStorage.setObject(f, u), 200;
|
|
@@ -3678,11 +3688,11 @@ class Kr {
|
|
|
3678
3688
|
return console.error("%cstorage", E.STORAGE, j.MESSAGES, i, k), 400;
|
|
3679
3689
|
}
|
|
3680
3690
|
});
|
|
3681
|
-
|
|
3682
|
-
|
|
3691
|
+
D(this, "cleanMessages", async (i) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((u) => u(0))));
|
|
3692
|
+
D(this, "hideMessage", async (i, u) => {
|
|
3683
3693
|
console.debug(`hideMessage ${i} ${u} not implemented for ${this.options.storage}`);
|
|
3684
3694
|
});
|
|
3685
|
-
|
|
3695
|
+
D(this, "setWidget", async (i) => {
|
|
3686
3696
|
const u = `widget.${i.widget}`;
|
|
3687
3697
|
try {
|
|
3688
3698
|
return localStorage.setObject(u, i), 201;
|
|
@@ -3695,7 +3705,7 @@ class Kr {
|
|
|
3695
3705
|
* @param query IQuery
|
|
3696
3706
|
* @returns null
|
|
3697
3707
|
*/
|
|
3698
|
-
|
|
3708
|
+
D(this, "subscribe", (i) => (i = nt(i), i.type === j.MESSAGES && (i = vt(this.options, i)), this.subscribers.filter(
|
|
3699
3709
|
(f) => f.widget === i.widget
|
|
3700
3710
|
).length || (console.debug(
|
|
3701
3711
|
"%cstorage%c %csubscribe",
|
|
@@ -3709,7 +3719,7 @@ class Kr {
|
|
|
3709
3719
|
* Get current subscribers
|
|
3710
3720
|
* @returns IQuery[]
|
|
3711
3721
|
*/
|
|
3712
|
-
|
|
3722
|
+
D(this, "getSubscribers", async () => await new Promise((i) => i(this.subscribers)));
|
|
3713
3723
|
this.options = i, Storage.prototype.setObject = function(u, f) {
|
|
3714
3724
|
this.setObject(u, JSON.stringify(f));
|
|
3715
3725
|
}, Storage.prototype.getObject = function(u) {
|
|
@@ -3718,11 +3728,11 @@ class Kr {
|
|
|
3718
3728
|
};
|
|
3719
3729
|
}
|
|
3720
3730
|
}
|
|
3721
|
-
class
|
|
3731
|
+
class Br {
|
|
3722
3732
|
constructor(i) {
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3733
|
+
D(this, "subscribers", []);
|
|
3734
|
+
D(this, "options");
|
|
3735
|
+
D(this, "getCloud", async (i) => {
|
|
3726
3736
|
const u = V(i);
|
|
3727
3737
|
try {
|
|
3728
3738
|
return sessionStorage.getObject(u);
|
|
@@ -3730,7 +3740,7 @@ class Nr {
|
|
|
3730
3740
|
return console.warn("%capi", E.API, j.CLOUD, i.slide, i.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3731
3741
|
}
|
|
3732
3742
|
});
|
|
3733
|
-
|
|
3743
|
+
D(this, "getSeries", async (i) => {
|
|
3734
3744
|
const u = V(i);
|
|
3735
3745
|
try {
|
|
3736
3746
|
return sessionStorage.getObject(u);
|
|
@@ -3738,7 +3748,7 @@ class Nr {
|
|
|
3738
3748
|
return console.warn("%capi", E.API, j.SERIES, i.slide, i.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3739
3749
|
}
|
|
3740
3750
|
});
|
|
3741
|
-
|
|
3751
|
+
D(this, "getMessages", async (i) => {
|
|
3742
3752
|
const u = V(i);
|
|
3743
3753
|
try {
|
|
3744
3754
|
return sessionStorage.getObject(u);
|
|
@@ -3752,7 +3762,7 @@ class Nr {
|
|
|
3752
3762
|
* @param data
|
|
3753
3763
|
* @returns number
|
|
3754
3764
|
*/
|
|
3755
|
-
|
|
3765
|
+
D(this, "setCloud", async (i, u) => {
|
|
3756
3766
|
const f = V(i);
|
|
3757
3767
|
try {
|
|
3758
3768
|
return sessionStorage.setObject(f, u), 201;
|
|
@@ -3766,7 +3776,7 @@ class Nr {
|
|
|
3766
3776
|
* @param data
|
|
3767
3777
|
* @returns number
|
|
3768
3778
|
*/
|
|
3769
|
-
|
|
3779
|
+
D(this, "setSeries", async (i, u) => {
|
|
3770
3780
|
const f = V(i);
|
|
3771
3781
|
try {
|
|
3772
3782
|
return sessionStorage.setObject(f, u), 201;
|
|
@@ -3780,7 +3790,7 @@ class Nr {
|
|
|
3780
3790
|
* @param data
|
|
3781
3791
|
* @returns number
|
|
3782
3792
|
*/
|
|
3783
|
-
|
|
3793
|
+
D(this, "setMessages", async (i, u) => {
|
|
3784
3794
|
const f = V(i);
|
|
3785
3795
|
try {
|
|
3786
3796
|
return sessionStorage.setObject(f, u), 200;
|
|
@@ -3788,11 +3798,11 @@ class Nr {
|
|
|
3788
3798
|
return console.error("%cstorage", E.STORAGE, j.MESSAGES, i, k), 400;
|
|
3789
3799
|
}
|
|
3790
3800
|
});
|
|
3791
|
-
|
|
3792
|
-
|
|
3801
|
+
D(this, "cleanMessages", async (i) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((u) => u(0))));
|
|
3802
|
+
D(this, "hideMessage", async (i, u) => {
|
|
3793
3803
|
console.debug(`hideMessage ${i} ${u} not implemented for ${this.options.storage}`);
|
|
3794
3804
|
});
|
|
3795
|
-
|
|
3805
|
+
D(this, "setWidget", async (i) => {
|
|
3796
3806
|
const u = `widget.${i.widget}`;
|
|
3797
3807
|
try {
|
|
3798
3808
|
return sessionStorage.setObject(u, i), 201;
|
|
@@ -3805,7 +3815,7 @@ class Nr {
|
|
|
3805
3815
|
* @param query IQuery
|
|
3806
3816
|
* @returns null
|
|
3807
3817
|
*/
|
|
3808
|
-
|
|
3818
|
+
D(this, "subscribe", (i) => (i = nt(i), i.type === j.MESSAGES && (i = vt(this.options, i)), this.subscribers.filter(
|
|
3809
3819
|
(f) => f.widget === i.widget
|
|
3810
3820
|
).length || (console.debug(
|
|
3811
3821
|
"%cstorage%c %csubscribe",
|
|
@@ -3819,7 +3829,7 @@ class Nr {
|
|
|
3819
3829
|
* Get current subscribers
|
|
3820
3830
|
* @returns IQuery[]
|
|
3821
3831
|
*/
|
|
3822
|
-
|
|
3832
|
+
D(this, "getSubscribers", async () => await new Promise((i) => i(this.subscribers)));
|
|
3823
3833
|
this.options = i, Storage.prototype.setObject = function(u, f) {
|
|
3824
3834
|
this.setItem(u, JSON.stringify(f));
|
|
3825
3835
|
}, Storage.prototype.getObject = function(u) {
|
|
@@ -3828,11 +3838,11 @@ class Nr {
|
|
|
3828
3838
|
};
|
|
3829
3839
|
}
|
|
3830
3840
|
}
|
|
3831
|
-
class
|
|
3841
|
+
class Nr {
|
|
3832
3842
|
constructor(i) {
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3843
|
+
D(this, "subscribers", []);
|
|
3844
|
+
D(this, "options");
|
|
3845
|
+
D(this, "getCloud", async (i) => {
|
|
3836
3846
|
const u = V(i);
|
|
3837
3847
|
try {
|
|
3838
3848
|
return window.BuzzCasting.WidgetData[u];
|
|
@@ -3840,7 +3850,7 @@ class Br {
|
|
|
3840
3850
|
return console.warn("%capi", E.API, j.CLOUD, i.slide, i.widget), { data: null, message: "Cloud Data error", success: !1 };
|
|
3841
3851
|
}
|
|
3842
3852
|
});
|
|
3843
|
-
|
|
3853
|
+
D(this, "getSeries", async (i) => {
|
|
3844
3854
|
const u = V(i);
|
|
3845
3855
|
try {
|
|
3846
3856
|
return window.BuzzCasting.WidgetData[u];
|
|
@@ -3848,7 +3858,7 @@ class Br {
|
|
|
3848
3858
|
return console.warn("%capi", E.API, j.SERIES, i.slide, i.widget), { data: null, message: "Series Data error", success: !1 };
|
|
3849
3859
|
}
|
|
3850
3860
|
});
|
|
3851
|
-
|
|
3861
|
+
D(this, "getMessages", async (i) => {
|
|
3852
3862
|
const u = V(i);
|
|
3853
3863
|
try {
|
|
3854
3864
|
return window.BuzzCasting.WidgetData[u];
|
|
@@ -3862,7 +3872,7 @@ class Br {
|
|
|
3862
3872
|
* @param data
|
|
3863
3873
|
* @returns number
|
|
3864
3874
|
*/
|
|
3865
|
-
|
|
3875
|
+
D(this, "setCloud", async (i, u) => {
|
|
3866
3876
|
const f = V(i);
|
|
3867
3877
|
try {
|
|
3868
3878
|
return window.BuzzCasting.WidgetData[f] = u, 201;
|
|
@@ -3876,7 +3886,7 @@ class Br {
|
|
|
3876
3886
|
* @param data
|
|
3877
3887
|
* @returns number
|
|
3878
3888
|
*/
|
|
3879
|
-
|
|
3889
|
+
D(this, "setSeries", async (i, u) => {
|
|
3880
3890
|
const f = V(i);
|
|
3881
3891
|
try {
|
|
3882
3892
|
return window.BuzzCasting.WidgetData[f] = u, 201;
|
|
@@ -3890,7 +3900,7 @@ class Br {
|
|
|
3890
3900
|
* @param data
|
|
3891
3901
|
* @returns number
|
|
3892
3902
|
*/
|
|
3893
|
-
|
|
3903
|
+
D(this, "setMessages", async (i, u) => {
|
|
3894
3904
|
const f = V(i);
|
|
3895
3905
|
try {
|
|
3896
3906
|
return window.BuzzCasting.WidgetData[f] = u, 201;
|
|
@@ -3898,11 +3908,11 @@ class Br {
|
|
|
3898
3908
|
return console.error("%cstorage", E.STORAGE, "set", i, k), 400;
|
|
3899
3909
|
}
|
|
3900
3910
|
});
|
|
3901
|
-
|
|
3902
|
-
|
|
3911
|
+
D(this, "cleanMessages", async (i) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((u) => u(0))));
|
|
3912
|
+
D(this, "hideMessage", async (i, u) => {
|
|
3903
3913
|
console.debug(`hideMessage ${i} ${u} not implemented for ${this.options.storage}`);
|
|
3904
3914
|
});
|
|
3905
|
-
|
|
3915
|
+
D(this, "setWidget", async (i) => {
|
|
3906
3916
|
const u = `widget.${i.widget}`;
|
|
3907
3917
|
try {
|
|
3908
3918
|
return window.BuzzCasting.WidgetData[u] = i, 201;
|
|
@@ -3915,7 +3925,7 @@ class Br {
|
|
|
3915
3925
|
* @param query IQuery
|
|
3916
3926
|
* @returns null
|
|
3917
3927
|
*/
|
|
3918
|
-
|
|
3928
|
+
D(this, "subscribe", (i) => (i = nt(i), i.type === j.MESSAGES && (i = vt(this.options, i)), this.subscribers.filter(
|
|
3919
3929
|
(f) => f.widget === i.widget
|
|
3920
3930
|
).length || (console.debug(
|
|
3921
3931
|
"%cstorage%c %csubscribe",
|
|
@@ -3929,17 +3939,17 @@ class Br {
|
|
|
3929
3939
|
* Get current subscribers
|
|
3930
3940
|
* @returns IQuery[]
|
|
3931
3941
|
*/
|
|
3932
|
-
|
|
3942
|
+
D(this, "getSubscribers", async () => await new Promise((i) => i(this.subscribers)));
|
|
3933
3943
|
this.options = i, window.BuzzCasting.WidgetData = /* @__PURE__ */ new Set();
|
|
3934
3944
|
}
|
|
3935
3945
|
}
|
|
3936
|
-
function
|
|
3946
|
+
function Bi(p) {
|
|
3937
3947
|
const i = p.toUpperCase().split(/[\s_-]+/);
|
|
3938
3948
|
return i.length > 0 ? (i.forEach((u, f) => {
|
|
3939
3949
|
i[f] = `${u.charAt(0)}.`;
|
|
3940
3950
|
}), i.join(" ")) : "";
|
|
3941
3951
|
}
|
|
3942
|
-
function
|
|
3952
|
+
function Ni(p) {
|
|
3943
3953
|
let i = "", u = "", f = {
|
|
3944
3954
|
backgroundImage: ""
|
|
3945
3955
|
};
|
|
@@ -4132,11 +4142,11 @@ function Qi(p) {
|
|
|
4132
4142
|
}
|
|
4133
4143
|
class Xi {
|
|
4134
4144
|
constructor(i) {
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4145
|
+
D(this, "sm");
|
|
4146
|
+
D(this, "api");
|
|
4147
|
+
D(this, "bc");
|
|
4148
|
+
D(this, "options");
|
|
4149
|
+
D(this, "update", async (i) => {
|
|
4140
4150
|
if (this.sm === null)
|
|
4141
4151
|
return;
|
|
4142
4152
|
const u = await this.sm.getSubscribers();
|
|
@@ -4149,49 +4159,49 @@ class Xi {
|
|
|
4149
4159
|
(k) => k.forEach(async (C) => {
|
|
4150
4160
|
let K = 400;
|
|
4151
4161
|
if (C.status === "fulfilled") {
|
|
4152
|
-
const
|
|
4162
|
+
const N = C.value;
|
|
4153
4163
|
if (this.sm === null)
|
|
4154
4164
|
return 400;
|
|
4155
|
-
if (
|
|
4165
|
+
if (N.success === !0) {
|
|
4156
4166
|
const Z = this.sm.subscribers.filter(
|
|
4157
|
-
(be) => be.widget ===
|
|
4167
|
+
(be) => be.widget === N.query.widget
|
|
4158
4168
|
)[0];
|
|
4159
4169
|
let te = "";
|
|
4160
|
-
switch (
|
|
4170
|
+
switch (N.query.type) {
|
|
4161
4171
|
case j.MESSAGES:
|
|
4162
|
-
if (te = Fn(
|
|
4172
|
+
if (te = Fn(N.data.messages), Z.hash === te)
|
|
4163
4173
|
return console.debug(
|
|
4164
4174
|
"%capi%c %cno updates",
|
|
4165
4175
|
E.API,
|
|
4166
4176
|
E.NONE,
|
|
4167
4177
|
E.NO_UPDATES,
|
|
4168
4178
|
j.MESSAGES,
|
|
4169
|
-
|
|
4170
|
-
|
|
4179
|
+
N.query.slide,
|
|
4180
|
+
N.query.widget
|
|
4171
4181
|
), 204;
|
|
4172
|
-
Z.hash = te, K = await this.sm.setMessages(
|
|
4182
|
+
Z.hash = te, K = await this.sm.setMessages(N.query, N);
|
|
4173
4183
|
break;
|
|
4174
4184
|
case j.CLOUD:
|
|
4175
|
-
te = Fn(
|
|
4185
|
+
te = Fn(N.data), Z.hash === te ? (console.debug(
|
|
4176
4186
|
"%capi%c %cno updates",
|
|
4177
4187
|
E.API,
|
|
4178
4188
|
E.NONE,
|
|
4179
4189
|
E.NO_UPDATES,
|
|
4180
4190
|
j.CLOUD,
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
), K = 204) : (Z.hash = te, K = await this.sm.setCloud(
|
|
4191
|
+
N.query.slide,
|
|
4192
|
+
N.query.widget
|
|
4193
|
+
), K = 204) : (Z.hash = te, K = await this.sm.setCloud(N.query, N));
|
|
4184
4194
|
break;
|
|
4185
4195
|
case j.SERIES:
|
|
4186
|
-
te = Fn(
|
|
4196
|
+
te = Fn(N.data), Z.hash === te ? (console.debug(
|
|
4187
4197
|
"%capi%c %cno updates",
|
|
4188
4198
|
E.API,
|
|
4189
4199
|
E.NONE,
|
|
4190
4200
|
E.NO_UPDATES,
|
|
4191
4201
|
j.SERIES,
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
), K = 204) : (Z.hash = te, K = await this.sm.setSeries(
|
|
4202
|
+
N.query.slide,
|
|
4203
|
+
N.query.widget
|
|
4204
|
+
), K = 204) : (Z.hash = te, K = await this.sm.setSeries(N.query, N));
|
|
4195
4205
|
break;
|
|
4196
4206
|
default:
|
|
4197
4207
|
console.warn(
|
|
@@ -4200,7 +4210,7 @@ class Xi {
|
|
|
4200
4210
|
E.NONE,
|
|
4201
4211
|
E.STORAGE,
|
|
4202
4212
|
"error",
|
|
4203
|
-
`data type ${
|
|
4213
|
+
`data type ${N.query.type} unknown`
|
|
4204
4214
|
);
|
|
4205
4215
|
}
|
|
4206
4216
|
} else
|
|
@@ -4212,9 +4222,9 @@ class Xi {
|
|
|
4212
4222
|
E.API,
|
|
4213
4223
|
E.NONE,
|
|
4214
4224
|
E.BROADCAST,
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
), this.bc.postMessage({ event: se.WIDGET_UPDATE, data:
|
|
4225
|
+
N.query.slide,
|
|
4226
|
+
N.data.title ?? N.query.widget
|
|
4227
|
+
), this.bc.postMessage({ event: se.WIDGET_UPDATE, data: N });
|
|
4218
4228
|
break;
|
|
4219
4229
|
case 400:
|
|
4220
4230
|
console.warn(
|
|
@@ -4222,8 +4232,8 @@ class Xi {
|
|
|
4222
4232
|
E.API,
|
|
4223
4233
|
E.NONE,
|
|
4224
4234
|
E.BROADCAST,
|
|
4225
|
-
|
|
4226
|
-
|
|
4235
|
+
N.query.slide,
|
|
4236
|
+
N.data.title ?? N.query.widget
|
|
4227
4237
|
);
|
|
4228
4238
|
break;
|
|
4229
4239
|
}
|
|
@@ -4239,10 +4249,10 @@ class Xi {
|
|
|
4239
4249
|
})
|
|
4240
4250
|
);
|
|
4241
4251
|
});
|
|
4242
|
-
|
|
4252
|
+
D(this, "hide", (i) => {
|
|
4243
4253
|
this.api.hideMessage(i);
|
|
4244
4254
|
});
|
|
4245
|
-
|
|
4255
|
+
D(this, "actions", async (i) => {
|
|
4246
4256
|
var u;
|
|
4247
4257
|
switch (i.data.event) {
|
|
4248
4258
|
case se.SUBSCRIBE:
|
|
@@ -4260,7 +4270,7 @@ class Xi {
|
|
|
4260
4270
|
break;
|
|
4261
4271
|
}
|
|
4262
4272
|
});
|
|
4263
|
-
|
|
4273
|
+
D(this, "cleanMessages", async () => {
|
|
4264
4274
|
var f, k;
|
|
4265
4275
|
const i = ((f = this.options) == null ? void 0 : f.retention) || 345600, u = await ((k = this.sm) == null ? void 0 : k.cleanMessages(i));
|
|
4266
4276
|
console.info(
|
|
@@ -4271,7 +4281,7 @@ class Xi {
|
|
|
4271
4281
|
`${u} messages deleted`
|
|
4272
4282
|
);
|
|
4273
4283
|
});
|
|
4274
|
-
|
|
4284
|
+
D(this, "hideMessage", async (i) => {
|
|
4275
4285
|
var f;
|
|
4276
4286
|
const u = await ((f = this.sm) == null ? void 0 : f.hideMessage(i.id, 0));
|
|
4277
4287
|
return console.info(
|
|
@@ -4282,8 +4292,8 @@ class Xi {
|
|
|
4282
4292
|
`${u} messages hidden`
|
|
4283
4293
|
), await this.api.hideMessage(i);
|
|
4284
4294
|
});
|
|
4285
|
-
|
|
4286
|
-
|
|
4295
|
+
D(this, "hideLabels", async (i) => await this.api.hideLabels(i));
|
|
4296
|
+
D(this, "getSubscribers", async () => {
|
|
4287
4297
|
var i;
|
|
4288
4298
|
return await ((i = this.sm) == null ? void 0 : i.getSubscribers());
|
|
4289
4299
|
});
|
|
@@ -4311,7 +4321,7 @@ class Xi {
|
|
|
4311
4321
|
this.sm = new Tr(i);
|
|
4312
4322
|
break;
|
|
4313
4323
|
case he.LOCAL:
|
|
4314
|
-
this.sm = new
|
|
4324
|
+
this.sm = new Br(i);
|
|
4315
4325
|
break;
|
|
4316
4326
|
case he.SESSION:
|
|
4317
4327
|
this.sm = new Kr(i);
|
|
@@ -4320,20 +4330,20 @@ class Xi {
|
|
|
4320
4330
|
this.sm = new jr(i);
|
|
4321
4331
|
break;
|
|
4322
4332
|
case he.WINDOW:
|
|
4323
|
-
this.sm = new
|
|
4333
|
+
this.sm = new Nr(i);
|
|
4324
4334
|
break;
|
|
4325
4335
|
}
|
|
4326
4336
|
}
|
|
4327
4337
|
}
|
|
4328
4338
|
class ji {
|
|
4329
4339
|
constructor(i) {
|
|
4330
|
-
|
|
4340
|
+
D(this, "sm");
|
|
4331
4341
|
/**
|
|
4332
4342
|
* Retieve Cloud Data
|
|
4333
4343
|
* @param query Widgets parameters, type "cloud"
|
|
4334
4344
|
* @returns IResponse
|
|
4335
4345
|
*/
|
|
4336
|
-
|
|
4346
|
+
D(this, "getCloud", async (i) => {
|
|
4337
4347
|
var u;
|
|
4338
4348
|
return i.type !== j.CLOUD ? (console.warn(
|
|
4339
4349
|
"%capp%c %get",
|
|
@@ -4354,7 +4364,7 @@ class ji {
|
|
|
4354
4364
|
* @param query Widgets parameters, type "messages"
|
|
4355
4365
|
* @returns IResponse
|
|
4356
4366
|
*/
|
|
4357
|
-
|
|
4367
|
+
D(this, "getMessages", async (i) => {
|
|
4358
4368
|
var u;
|
|
4359
4369
|
return i.type !== j.MESSAGES ? (console.warn(
|
|
4360
4370
|
"%capp%c %get",
|
|
@@ -4375,7 +4385,7 @@ class ji {
|
|
|
4375
4385
|
* @param query Widgets parameters, type "series"
|
|
4376
4386
|
* @returns IResponse
|
|
4377
4387
|
*/
|
|
4378
|
-
|
|
4388
|
+
D(this, "getSeries", async (i) => {
|
|
4379
4389
|
var u;
|
|
4380
4390
|
return i.type !== j.SERIES ? (console.warn(
|
|
4381
4391
|
"%capp%c %get",
|
|
@@ -4396,7 +4406,7 @@ class ji {
|
|
|
4396
4406
|
this.sm = new Tr(i);
|
|
4397
4407
|
break;
|
|
4398
4408
|
case he.LOCAL:
|
|
4399
|
-
this.sm = new
|
|
4409
|
+
this.sm = new Br(i);
|
|
4400
4410
|
break;
|
|
4401
4411
|
case he.SESSION:
|
|
4402
4412
|
this.sm = new Kr(i);
|
|
@@ -4405,7 +4415,7 @@ class ji {
|
|
|
4405
4415
|
this.sm = new jr(i);
|
|
4406
4416
|
break;
|
|
4407
4417
|
case he.WINDOW:
|
|
4408
|
-
this.sm = new
|
|
4418
|
+
this.sm = new Nr(i);
|
|
4409
4419
|
break;
|
|
4410
4420
|
}
|
|
4411
4421
|
}
|
|
@@ -4419,17 +4429,17 @@ class Vi {
|
|
|
4419
4429
|
* @param selector container for the element - by default buzzcasting-slide (optional)
|
|
4420
4430
|
*/
|
|
4421
4431
|
constructor(i, u, f) {
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4432
|
+
D(this, "storageReader");
|
|
4433
|
+
D(this, "broadcastChannel");
|
|
4434
|
+
D(this, "element");
|
|
4435
|
+
D(this, "query");
|
|
4436
|
+
D(this, "listeners");
|
|
4427
4437
|
/**
|
|
4428
4438
|
* Generic call to any query type
|
|
4429
4439
|
*
|
|
4430
4440
|
* @returns IResponse
|
|
4431
4441
|
*/
|
|
4432
|
-
|
|
4442
|
+
D(this, "getData", async () => {
|
|
4433
4443
|
switch (this.query.type) {
|
|
4434
4444
|
case j.CLOUD:
|
|
4435
4445
|
return await this.getCloud();
|
|
@@ -4449,7 +4459,7 @@ class Vi {
|
|
|
4449
4459
|
*
|
|
4450
4460
|
* @returns IResponse
|
|
4451
4461
|
*/
|
|
4452
|
-
|
|
4462
|
+
D(this, "getCloud", async () => this.query.type !== j.CLOUD ? (console.warn(
|
|
4453
4463
|
"%cstorage%c %cwidget",
|
|
4454
4464
|
E.STORAGE,
|
|
4455
4465
|
E.NONE,
|
|
@@ -4467,7 +4477,7 @@ class Vi {
|
|
|
4467
4477
|
*
|
|
4468
4478
|
* @returns IResponse
|
|
4469
4479
|
*/
|
|
4470
|
-
|
|
4480
|
+
D(this, "getMessages", async () => this.query.type !== j.MESSAGES ? (console.warn(
|
|
4471
4481
|
"%cstorage%c %cwidget",
|
|
4472
4482
|
E.STORAGE,
|
|
4473
4483
|
E.NONE,
|
|
@@ -4485,7 +4495,7 @@ class Vi {
|
|
|
4485
4495
|
*
|
|
4486
4496
|
* @returns IResponse
|
|
4487
4497
|
*/
|
|
4488
|
-
|
|
4498
|
+
D(this, "getSeries", async () => this.query.type !== j.SERIES ? (console.warn(
|
|
4489
4499
|
"%cstorage%c %cwidget",
|
|
4490
4500
|
E.STORAGE,
|
|
4491
4501
|
E.NONE,
|
|
@@ -4504,7 +4514,7 @@ class Vi {
|
|
|
4504
4514
|
*
|
|
4505
4515
|
* @param modal IModal
|
|
4506
4516
|
*/
|
|
4507
|
-
|
|
4517
|
+
D(this, "showModal", (i) => {
|
|
4508
4518
|
const u = Ii(this.element.attributes);
|
|
4509
4519
|
if (Object.prototype.hasOwnProperty.call(u, "data-topics")) {
|
|
4510
4520
|
const C = u["data-topics"].split("-");
|
|
@@ -4590,8 +4600,8 @@ export {
|
|
|
4590
4600
|
Vt as MODERATION,
|
|
4591
4601
|
he as STORAGE,
|
|
4592
4602
|
Vi as Widget,
|
|
4593
|
-
|
|
4594
|
-
|
|
4603
|
+
Bi as anonymize,
|
|
4604
|
+
Ni as attachedMedia,
|
|
4595
4605
|
Ii as attrs,
|
|
4596
4606
|
Li as brandLogo,
|
|
4597
4607
|
$i as camelCase,
|