buzzcasting-storage 3.0.7 → 3.0.8
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 +263 -240
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var xi = Object.defineProperty;
|
|
2
2
|
var Ai = (d, r, s) => r in d ? xi(d, r, { enumerable: !0, configurable: !0, writable: !0, value: s }) : d[r] = s;
|
|
3
3
|
var k = (d, r, s) => Ai(d, typeof r != "symbol" ? r + "" : r, s);
|
|
4
|
-
var
|
|
5
|
-
const ki = "3.0.
|
|
4
|
+
var N = /* @__PURE__ */ ((d) => (d.MESSAGES = "messages", d.CLOUD = "cloud", d.SERIES = "series", d.TOPICS = "topics", d.WIDGET = "widget", d.WIDGETS = "widgets", d.SLIDE = "slide", d))(N || {}), _ = /* @__PURE__ */ ((d) => (d.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", d.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", d.BROADCAST = "color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", d.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", d.CLOUD = "color:grey;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", d.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", d.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", d.MESSAGES = "color:white;background-color:darkslateblue;padding:0 4px 0 4px;border-radius:5px;", d.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", d.NONE = "color:transparent;background-color:transparent;", d.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", d.SERIES = "color:grey;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", d.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", d.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", d.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", d.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", d.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", d))(_ || {}), re = /* @__PURE__ */ ((d) => (d.ADD_SLIDE = "addSlide", d.APP_READY = "appReady", d.API_UPDATE = "apiUpdate", d.APPROVE_MESSAGE = "approveMessage", d.CHANNEL = "channel", d.CLEAN_MESSAGES = "cleanMessages", d.CLOSE_MODAL = "closeModal", d.CLOSE_BUILDER_MODAL = "closeBuilderModal", d.ERROR = "error", d.HIDE_MESSAGE = "hideMessage", d.HIDE_LABELS = "hideLabels", d.PAUSE_PRESENTATION = "pausePresentation", d.PRESENTATION_READY = "presentationReady", d.PREV_SLIDE = "prevSlide", d.RELOAD_PRESENTATION = "reloadPresentation", d.SHOW_MODAL = "showModal", d.STAR_MESSAGE = "starMessage", d.GOTO_SLIDE = "gotoSlide", d.NEXT_SLIDE = "nextSlide", d.SHOW_BUILDER_MODAL = "showBuilderModal", d.SLIDE_DID_LOAD = "slideDidLoad", d.SLIDE_GOTO = "slideGoto", d.SLIDE_READY = "slideReady", d.SLIDE_LOAD = "loadSlide", d.SLIDE_STORE = "storeSlide", d.SLIDE_TRANSITIONER = "slideTransitioner", d.START_TRANSITIONER = "startTransitioner", d.STORAGE_INIT = "storageInit", d.SUBSCRIBE = "subscribe", d.SUSPEND_ACCOUNT = "suspendAccount", d.REMOVE_CLOUD = "removeCloud", d.UPDATE = "update", d.VERSION = "version", d.WIDGET_UPDATE = "widgetUpdate", d))(re || {}), Zt = /* @__PURE__ */ ((d) => (d.APPROVED = "approved", d.BEFORE = "before", d.DELAYED = "delayed", d.NONE = "none", d.REALTIME = "realtime", d))(Zt || {}), ge = /* @__PURE__ */ ((d) => (d.KEYVAL = "keyval", d.LOCAL = "local", d.SESSION = "session", d.DEXIE = "dexie", d.WINDOW = "window", d))(ge || {});
|
|
5
|
+
const ki = "3.0.7";
|
|
6
6
|
class Di {
|
|
7
7
|
constructor(r) {
|
|
8
8
|
k(this, "options");
|
|
@@ -35,15 +35,14 @@ class Di {
|
|
|
35
35
|
const { version: s } = this.options, l = this.headers(), x = Object.assign({}, r);
|
|
36
36
|
delete x.slide, delete x.type, delete x.hash, delete x.order, delete x.period;
|
|
37
37
|
const D = Object.keys(x).length > 0 ? `?${new URLSearchParams(x).toString()}` : "";
|
|
38
|
-
return console.
|
|
38
|
+
return console.info(
|
|
39
39
|
"%capi%c %cfetch",
|
|
40
40
|
_.API,
|
|
41
41
|
_.NONE,
|
|
42
42
|
_.GET_DATA,
|
|
43
43
|
r.slide,
|
|
44
|
-
r.widget
|
|
45
|
-
|
|
46
|
-
), await fetch(
|
|
44
|
+
r.widget
|
|
45
|
+
), console.debug(x), await fetch(
|
|
47
46
|
[this.url, "api", s, r.type].join("/") + D,
|
|
48
47
|
{ ...l, method: "get" }
|
|
49
48
|
).then(async (T) => {
|
|
@@ -73,8 +72,8 @@ class Di {
|
|
|
73
72
|
}
|
|
74
73
|
async hideLabels(r) {
|
|
75
74
|
const { version: s } = this.options, l = this.formHeaders(), x = new URLSearchParams(), D = r.labels || [];
|
|
76
|
-
for (const [T,
|
|
77
|
-
x.append(`custom_filters[${T}]`,
|
|
75
|
+
for (const [T, j] of D.entries())
|
|
76
|
+
x.append(`custom_filters[${T}]`, j);
|
|
78
77
|
return console.info(
|
|
79
78
|
"%capi%c %cput",
|
|
80
79
|
_.API,
|
|
@@ -95,7 +94,7 @@ class Di {
|
|
|
95
94
|
async loadSlide(r) {
|
|
96
95
|
const { version: s } = this.options, l = this.headers(), x = Object.assign({}, r);
|
|
97
96
|
return delete x.slide, delete x.type, delete x.hash, console.debug(
|
|
98
|
-
"%capi%c %
|
|
97
|
+
"%capi%c %cloadSlide",
|
|
99
98
|
_.API,
|
|
100
99
|
_.NONE,
|
|
101
100
|
_.SLIDE,
|
|
@@ -163,7 +162,7 @@ var Mr = { exports: {} };
|
|
|
163
162
|
for (var i, o = 0, a = t.length; o < a; o++) !i && o in t || ((i = i || Array.prototype.slice.call(t, 0, o))[o] = t[o]);
|
|
164
163
|
return e.concat(i || Array.prototype.slice.call(t));
|
|
165
164
|
}
|
|
166
|
-
var D = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Cr, T = Object.keys,
|
|
165
|
+
var D = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Cr, T = Object.keys, j = Array.isArray;
|
|
167
166
|
function Q(e, t) {
|
|
168
167
|
return typeof t != "object" || T(t).forEach(function(n) {
|
|
169
168
|
e[n] = t[n];
|
|
@@ -223,7 +222,7 @@ var Mr = { exports: {} };
|
|
|
223
222
|
for (var i = 0, o = t.length; i < o; ++i) le(e, t[i], n[i]);
|
|
224
223
|
} else {
|
|
225
224
|
var a, c, u = t.indexOf(".");
|
|
226
|
-
u !== -1 ? (a = t.substr(0, u), (c = t.substr(u + 1)) === "" ? n === void 0 ?
|
|
225
|
+
u !== -1 ? (a = t.substr(0, u), (c = t.substr(u + 1)) === "" ? n === void 0 ? j(e) && !isNaN(parseInt(a)) ? e.splice(a, 1) : delete e[a] : e[a] = n : le(u = !(u = e[a]) || !q(e, a) ? e[a] = {} : u, c, n)) : n === void 0 ? j(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n;
|
|
227
226
|
}
|
|
228
227
|
}
|
|
229
228
|
function Yn(e) {
|
|
@@ -249,7 +248,7 @@ var Mr = { exports: {} };
|
|
|
249
248
|
if (!n || typeof n != "object") return n;
|
|
250
249
|
var i = ot.get(n);
|
|
251
250
|
if (i) return i;
|
|
252
|
-
if (
|
|
251
|
+
if (j(n)) {
|
|
253
252
|
i = [], ot.set(n, i);
|
|
254
253
|
for (var o = 0, a = n.length; o < a; ++o) i.push(t(n[o]));
|
|
255
254
|
} else if (Xn.has(n.constructor)) i = n;
|
|
@@ -277,7 +276,7 @@ var Mr = { exports: {} };
|
|
|
277
276
|
function _e(e) {
|
|
278
277
|
var t, n, i, o;
|
|
279
278
|
if (arguments.length === 1) {
|
|
280
|
-
if (
|
|
279
|
+
if (j(e)) return e.slice();
|
|
281
280
|
if (this === Qe && typeof e == "string") return [e];
|
|
282
281
|
if (o = Hr(e)) {
|
|
283
282
|
for (n = []; !(i = o.next()).done; ) n.push(i.value);
|
|
@@ -404,7 +403,7 @@ var Mr = { exports: {} };
|
|
|
404
403
|
}(), ct = Ee[0], he = Ee[1], Ee = Ee[2], he = he && he.then, Ne = ct && ct.constructor, an = !!Ee, ut = function(e, t) {
|
|
405
404
|
lt.push([e, t]), xt && (queueMicrotask(ti), xt = !1);
|
|
406
405
|
}, sn = !0, xt = !0, Be = [], At = [], cn = at, ke = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: X, pgp: !1, env: {}, finalize: X }, G = ke, lt = [], Le = 0, kt = [];
|
|
407
|
-
function
|
|
406
|
+
function B(e) {
|
|
408
407
|
if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
|
|
409
408
|
this._listeners = [], this._lib = !1;
|
|
410
409
|
var t = this._PSD = G;
|
|
@@ -419,7 +418,7 @@ var Mr = { exports: {} };
|
|
|
419
418
|
if (a === i) throw new TypeError("A promise cannot be resolved with itself.");
|
|
420
419
|
var c = i._lib && Ve();
|
|
421
420
|
a && typeof a.then == "function" ? n(i, function(u, h) {
|
|
422
|
-
a instanceof
|
|
421
|
+
a instanceof B ? a._then(u, h) : a.then(u, h);
|
|
423
422
|
}) : (i._state = !0, i._value = a, tr(i)), c && Ze();
|
|
424
423
|
}
|
|
425
424
|
}, ln.bind(null, i));
|
|
@@ -431,7 +430,7 @@ var Mr = { exports: {} };
|
|
|
431
430
|
var un = { get: function() {
|
|
432
431
|
var e = G, t = Ct;
|
|
433
432
|
function n(i, o) {
|
|
434
|
-
var a = this, c = !e.global && (e !== G || t !== Ct), u = c && !Pe(), h = new
|
|
433
|
+
var a = this, c = !e.global && (e !== G || t !== Ct), u = c && !Pe(), h = new B(function(g, b) {
|
|
435
434
|
dn(a, new er(rr(i, e, c, u), rr(o, e, c, u), g, b, e));
|
|
436
435
|
});
|
|
437
436
|
return this._consoleTask && (h._consoleTask = this._consoleTask), h;
|
|
@@ -508,7 +507,7 @@ var Mr = { exports: {} };
|
|
|
508
507
|
for (var t = kt.slice(0), n = t.length; n; ) t[--n]();
|
|
509
508
|
}
|
|
510
509
|
function Dt(e) {
|
|
511
|
-
return new
|
|
510
|
+
return new B(st, !1, e);
|
|
512
511
|
}
|
|
513
512
|
function ee(e, t) {
|
|
514
513
|
var n = G;
|
|
@@ -523,7 +522,7 @@ var Mr = { exports: {} };
|
|
|
523
522
|
}
|
|
524
523
|
};
|
|
525
524
|
}
|
|
526
|
-
pe(
|
|
525
|
+
pe(B.prototype, { then: un, _then: function(e, t) {
|
|
527
526
|
dn(this, new er(null, null, e, t, G));
|
|
528
527
|
}, catch: function(e) {
|
|
529
528
|
if (arguments.length === 1) return this.then(null, e);
|
|
@@ -535,42 +534,42 @@ var Mr = { exports: {} };
|
|
|
535
534
|
});
|
|
536
535
|
}, finally: function(e) {
|
|
537
536
|
return this.then(function(t) {
|
|
538
|
-
return
|
|
537
|
+
return B.resolve(e()).then(function() {
|
|
539
538
|
return t;
|
|
540
539
|
});
|
|
541
540
|
}, function(t) {
|
|
542
|
-
return
|
|
541
|
+
return B.resolve(e()).then(function() {
|
|
543
542
|
return Dt(t);
|
|
544
543
|
});
|
|
545
544
|
});
|
|
546
545
|
}, timeout: function(e, t) {
|
|
547
546
|
var n = this;
|
|
548
|
-
return e < 1 / 0 ? new
|
|
547
|
+
return e < 1 / 0 ? new B(function(i, o) {
|
|
549
548
|
var a = setTimeout(function() {
|
|
550
549
|
return o(new $.Timeout(t));
|
|
551
550
|
}, e);
|
|
552
551
|
n.then(i, o).finally(clearTimeout.bind(null, a));
|
|
553
552
|
}) : this;
|
|
554
|
-
} }), typeof Symbol < "u" && Symbol.toStringTag && Ae(
|
|
553
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && Ae(B.prototype, Symbol.toStringTag, "Dexie.Promise"), ke.env = nr(), pe(B, { all: function() {
|
|
555
554
|
var e = _e.apply(null, arguments).map(Rt);
|
|
556
|
-
return new
|
|
555
|
+
return new B(function(t, n) {
|
|
557
556
|
e.length === 0 && t([]);
|
|
558
557
|
var i = e.length;
|
|
559
558
|
e.forEach(function(o, a) {
|
|
560
|
-
return
|
|
559
|
+
return B.resolve(o).then(function(c) {
|
|
561
560
|
e[a] = c, --i || t(e);
|
|
562
561
|
}, n);
|
|
563
562
|
});
|
|
564
563
|
});
|
|
565
564
|
}, resolve: function(e) {
|
|
566
|
-
return e instanceof
|
|
565
|
+
return e instanceof B ? e : e && typeof e.then == "function" ? new B(function(t, n) {
|
|
567
566
|
e.then(t, n);
|
|
568
|
-
}) : new
|
|
567
|
+
}) : new B(st, !0, e);
|
|
569
568
|
}, reject: Dt, race: function() {
|
|
570
569
|
var e = _e.apply(null, arguments).map(Rt);
|
|
571
|
-
return new
|
|
570
|
+
return new B(function(t, n) {
|
|
572
571
|
e.map(function(i) {
|
|
573
|
-
return
|
|
572
|
+
return B.resolve(i).then(t, n);
|
|
574
573
|
});
|
|
575
574
|
});
|
|
576
575
|
}, PSD: { get: function() {
|
|
@@ -588,7 +587,7 @@ var Mr = { exports: {} };
|
|
|
588
587
|
}, set: function(e) {
|
|
589
588
|
cn = e;
|
|
590
589
|
} }, follow: function(e, t) {
|
|
591
|
-
return new
|
|
590
|
+
return new B(function(n, i) {
|
|
592
591
|
return De(function(o, a) {
|
|
593
592
|
var c = G;
|
|
594
593
|
c.unhandleds = [], c.onunhandled = a, c.finalize = Ke(function() {
|
|
@@ -603,13 +602,13 @@ var Mr = { exports: {} };
|
|
|
603
602
|
}, c.finalize), e();
|
|
604
603
|
}, t, n, i);
|
|
605
604
|
});
|
|
606
|
-
} }), Ne && (Ne.allSettled && Ae(
|
|
605
|
+
} }), Ne && (Ne.allSettled && Ae(B, "allSettled", function() {
|
|
607
606
|
var e = _e.apply(null, arguments).map(Rt);
|
|
608
|
-
return new
|
|
607
|
+
return new B(function(t) {
|
|
609
608
|
e.length === 0 && t([]);
|
|
610
609
|
var n = e.length, i = new Array(n);
|
|
611
610
|
e.forEach(function(o, a) {
|
|
612
|
-
return
|
|
611
|
+
return B.resolve(o).then(function(c) {
|
|
613
612
|
return i[a] = { status: "fulfilled", value: c };
|
|
614
613
|
}, function(c) {
|
|
615
614
|
return i[a] = { status: "rejected", reason: c };
|
|
@@ -618,24 +617,24 @@ var Mr = { exports: {} };
|
|
|
618
617
|
});
|
|
619
618
|
});
|
|
620
619
|
});
|
|
621
|
-
}), Ne.any && typeof AggregateError < "u" && Ae(
|
|
620
|
+
}), Ne.any && typeof AggregateError < "u" && Ae(B, "any", function() {
|
|
622
621
|
var e = _e.apply(null, arguments).map(Rt);
|
|
623
|
-
return new
|
|
622
|
+
return new B(function(t, n) {
|
|
624
623
|
e.length === 0 && n(new AggregateError([]));
|
|
625
624
|
var i = e.length, o = new Array(i);
|
|
626
625
|
e.forEach(function(a, c) {
|
|
627
|
-
return
|
|
626
|
+
return B.resolve(a).then(function(u) {
|
|
628
627
|
return t(u);
|
|
629
628
|
}, function(u) {
|
|
630
629
|
o[c] = u, --i || n(new AggregateError(o));
|
|
631
630
|
});
|
|
632
631
|
});
|
|
633
632
|
});
|
|
634
|
-
}), Ne.withResolvers && (
|
|
633
|
+
}), Ne.withResolvers && (B.withResolvers = Ne.withResolvers));
|
|
635
634
|
var ie = { awaits: 0, echoes: 0, id: 0 }, ni = 0, Pt = [], It = 0, Ct = 0, ri = 0;
|
|
636
635
|
function De(e, t, n, i) {
|
|
637
636
|
var o = G, a = Object.create(o);
|
|
638
|
-
return a.parent = o, a.ref = 0, a.global = !1, a.id = ++ri, ke.env, a.env = an ? { Promise:
|
|
637
|
+
return a.parent = o, a.ref = 0, a.global = !1, a.id = ++ri, ke.env, a.env = an ? { Promise: B, PromiseProp: { value: B, configurable: !0, writable: !0 }, all: B.all, race: B.race, allSettled: B.allSettled, any: B.any, resolve: B.resolve, reject: B.reject } : {}, t && Q(a, t), ++o.ref, a.finalize = function() {
|
|
639
638
|
--this.parent.ref || this.parent.finalize();
|
|
640
639
|
}, i = Ge(a, e, n, i), a.ref === 0 && a.finalize(), i;
|
|
641
640
|
}
|
|
@@ -689,7 +688,7 @@ var Mr = { exports: {} };
|
|
|
689
688
|
Promise === Ne && ie.echoes === 0 ? It === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
690
689
|
}
|
|
691
690
|
("" + he).indexOf("[native code]") === -1 && (qe = Pe = X);
|
|
692
|
-
var te =
|
|
691
|
+
var te = B.reject, $e = "", Se = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", ir = "String expected.", et = [], Mt = "__dbnames", pn = "readonly", gn = "readwrite";
|
|
693
692
|
function Fe(e, t) {
|
|
694
693
|
return e ? t ? function() {
|
|
695
694
|
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
@@ -798,7 +797,7 @@ var Mr = { exports: {} };
|
|
|
798
797
|
}).then(t);
|
|
799
798
|
}, Z.prototype.where = function(e) {
|
|
800
799
|
if (typeof e == "string") return new this.db.WhereClause(this, e);
|
|
801
|
-
if (
|
|
800
|
+
if (j(e)) return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
802
801
|
var t = T(e);
|
|
803
802
|
if (t.length === 1) return this.where(t[0]).equals(e[t[0]]);
|
|
804
803
|
var n = this.schema.indexes.concat(this.schema.primKey).filter(function(u) {
|
|
@@ -826,7 +825,7 @@ var Mr = { exports: {} };
|
|
|
826
825
|
var c = t.reduce(function(f, h) {
|
|
827
826
|
var g = f[0], b = f[1], f = i[h], w = e[h];
|
|
828
827
|
return [g || f, g || !f ? Fe(b, f && f.multi ? function(p) {
|
|
829
|
-
return p = we(p, h),
|
|
828
|
+
return p = we(p, h), j(p) && p.some(function(m) {
|
|
830
829
|
return o(w, m);
|
|
831
830
|
});
|
|
832
831
|
} : function(p) {
|
|
@@ -849,7 +848,7 @@ var Mr = { exports: {} };
|
|
|
849
848
|
}, Z.prototype.toCollection = function() {
|
|
850
849
|
return new this.db.Collection(new this.db.WhereClause(this));
|
|
851
850
|
}, Z.prototype.orderBy = function(e) {
|
|
852
|
-
return new this.db.Collection(new this.db.WhereClause(this,
|
|
851
|
+
return new this.db.Collection(new this.db.WhereClause(this, j(e) ? "[".concat(e.join("+"), "]") : e));
|
|
853
852
|
}, Z.prototype.reverse = function() {
|
|
854
853
|
return this.toCollection().reverse();
|
|
855
854
|
}, Z.prototype.mapToClass = function(e) {
|
|
@@ -890,7 +889,7 @@ var Mr = { exports: {} };
|
|
|
890
889
|
return a && o && (c = Tt(a)(e)), this._trans("readwrite", function(u) {
|
|
891
890
|
return n.core.mutate({ trans: u, type: "add", keys: t != null ? [t] : null, values: [c] });
|
|
892
891
|
}).then(function(u) {
|
|
893
|
-
return u.numFailures ?
|
|
892
|
+
return u.numFailures ? B.reject(u.failures[0]) : u.lastResult;
|
|
894
893
|
}).then(function(u) {
|
|
895
894
|
if (a) try {
|
|
896
895
|
le(e, a, u);
|
|
@@ -899,13 +898,13 @@ var Mr = { exports: {} };
|
|
|
899
898
|
return u;
|
|
900
899
|
});
|
|
901
900
|
}, Z.prototype.update = function(e, t) {
|
|
902
|
-
return typeof e != "object" ||
|
|
901
|
+
return typeof e != "object" || j(e) ? this.where(":id").equals(e).modify(t) : (e = we(e, this.schema.primKey.keyPath), e === void 0 ? te(new $.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t));
|
|
903
902
|
}, Z.prototype.put = function(e, t) {
|
|
904
903
|
var n = this, i = this.schema.primKey, o = i.auto, a = i.keyPath, c = e;
|
|
905
904
|
return a && o && (c = Tt(a)(e)), this._trans("readwrite", function(u) {
|
|
906
905
|
return n.core.mutate({ trans: u, type: "put", values: [c], keys: t != null ? [t] : null });
|
|
907
906
|
}).then(function(u) {
|
|
908
|
-
return u.numFailures ?
|
|
907
|
+
return u.numFailures ? B.reject(u.failures[0]) : u.lastResult;
|
|
909
908
|
}).then(function(u) {
|
|
910
909
|
if (a) try {
|
|
911
910
|
le(e, a, u);
|
|
@@ -918,14 +917,14 @@ var Mr = { exports: {} };
|
|
|
918
917
|
return this._trans("readwrite", function(n) {
|
|
919
918
|
return t.core.mutate({ trans: n, type: "delete", keys: [e] });
|
|
920
919
|
}).then(function(n) {
|
|
921
|
-
return n.numFailures ?
|
|
920
|
+
return n.numFailures ? B.reject(n.failures[0]) : void 0;
|
|
922
921
|
});
|
|
923
922
|
}, Z.prototype.clear = function() {
|
|
924
923
|
var e = this;
|
|
925
924
|
return this._trans("readwrite", function(t) {
|
|
926
925
|
return e.core.mutate({ trans: t, type: "deleteRange", range: or });
|
|
927
926
|
}).then(function(t) {
|
|
928
|
-
return t.numFailures ?
|
|
927
|
+
return t.numFailures ? B.reject(t.failures[0]) : void 0;
|
|
929
928
|
});
|
|
930
929
|
}, Z.prototype.bulkGet = function(e) {
|
|
931
930
|
var t = this;
|
|
@@ -1034,7 +1033,7 @@ var Mr = { exports: {} };
|
|
|
1034
1033
|
}
|
|
1035
1034
|
T(g = c).forEach(function(f) {
|
|
1036
1035
|
var w = g[f];
|
|
1037
|
-
if (
|
|
1036
|
+
if (j(w)) a(f, g[f][0], g[f][1]);
|
|
1038
1037
|
else {
|
|
1039
1038
|
if (w !== "asap") throw new $.InvalidArgument("Invalid event config");
|
|
1040
1039
|
var p = a(f, at, function() {
|
|
@@ -1113,7 +1112,7 @@ var Mr = { exports: {} };
|
|
|
1113
1112
|
var Ee = Symbol(), ht = (fr.prototype.execute = function(e) {
|
|
1114
1113
|
if (this.add !== void 0) {
|
|
1115
1114
|
var t = this.add;
|
|
1116
|
-
if (
|
|
1115
|
+
if (j(t)) return x(x([], j(e) ? e : [], !0), t).sort();
|
|
1117
1116
|
if (typeof t == "number") return (Number(e) || 0) + t;
|
|
1118
1117
|
if (typeof t == "bigint") try {
|
|
1119
1118
|
return BigInt(e) + t;
|
|
@@ -1124,7 +1123,7 @@ var Mr = { exports: {} };
|
|
|
1124
1123
|
}
|
|
1125
1124
|
if (this.remove !== void 0) {
|
|
1126
1125
|
var n = this.remove;
|
|
1127
|
-
if (
|
|
1126
|
+
if (j(n)) return j(e) ? e.filter(function(i) {
|
|
1128
1127
|
return !n.includes(i);
|
|
1129
1128
|
}).sort() : [];
|
|
1130
1129
|
if (typeof n == "number") return Number(e) - n;
|
|
@@ -1327,20 +1326,20 @@ var Mr = { exports: {} };
|
|
|
1327
1326
|
function S(O) {
|
|
1328
1327
|
var A = Math.min(b, y.length - O);
|
|
1329
1328
|
return u.getMany({ trans: i, keys: y.slice(O, O + A), cache: "immutable" }).then(function(P) {
|
|
1330
|
-
for (var M = [], I = [], C = h ? [] : null,
|
|
1329
|
+
for (var M = [], I = [], C = h ? [] : null, K = [], R = 0; R < A; ++R) {
|
|
1331
1330
|
var L = P[R], U = { value: Te(L), primKey: y[O + R] };
|
|
1332
|
-
c.call(U, U.value, U) !== !1 && (U.value == null ?
|
|
1331
|
+
c.call(U, U.value, U) !== !1 && (U.value == null ? K.push(y[O + R]) : h || H(g(L), g(U.value)) === 0 ? (I.push(U.value), h && C.push(y[O + R])) : (K.push(y[O + R]), M.push(U.value)));
|
|
1333
1332
|
}
|
|
1334
1333
|
return Promise.resolve(0 < M.length && u.mutate({ trans: i, type: "add", values: M }).then(function(W) {
|
|
1335
|
-
for (var z in W.failures)
|
|
1334
|
+
for (var z in W.failures) K.splice(parseInt(z), 1);
|
|
1336
1335
|
w(M.length, W);
|
|
1337
1336
|
})).then(function() {
|
|
1338
1337
|
return (0 < I.length || E && typeof e == "object") && u.mutate({ trans: i, type: "put", keys: C, values: I, criteria: E, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < O }).then(function(W) {
|
|
1339
1338
|
return w(I.length, W);
|
|
1340
1339
|
});
|
|
1341
1340
|
}).then(function() {
|
|
1342
|
-
return (0 <
|
|
1343
|
-
return w(
|
|
1341
|
+
return (0 < K.length || E && e === bn) && u.mutate({ trans: i, type: "delete", keys: K, criteria: E, isAdditionalChunk: 0 < O }).then(function(W) {
|
|
1342
|
+
return w(K.length, W);
|
|
1344
1343
|
});
|
|
1345
1344
|
}).then(function() {
|
|
1346
1345
|
return y.length > O + A && S(O + b);
|
|
@@ -1426,13 +1425,13 @@ var Mr = { exports: {} };
|
|
|
1426
1425
|
var E = a(S);
|
|
1427
1426
|
if (t(E, h, p)) return !0;
|
|
1428
1427
|
for (var O = null, A = p; A < f; ++A) {
|
|
1429
|
-
var P = function(M, I, C,
|
|
1430
|
-
for (var U = Math.min(M.length,
|
|
1428
|
+
var P = function(M, I, C, K, R, L) {
|
|
1429
|
+
for (var U = Math.min(M.length, K.length), W = -1, z = 0; z < U; ++z) {
|
|
1431
1430
|
var fe = I[z];
|
|
1432
|
-
if (fe !==
|
|
1431
|
+
if (fe !== K[z]) return R(M[z], C[z]) < 0 ? M.substr(0, z) + C[z] + C.substr(z + 1) : R(M[z], K[z]) < 0 ? M.substr(0, z) + K[z] + C.substr(z + 1) : 0 <= W ? M.substr(0, W) + I[W] + C.substr(W + 1) : null;
|
|
1433
1432
|
R(M[z], fe) < 0 && (W = z);
|
|
1434
1433
|
}
|
|
1435
|
-
return U <
|
|
1434
|
+
return U < K.length && L === "next" ? M + C.substr(M.length) : U < M.length && L === "prev" ? M.substr(0, C.length) : W < 0 ? null : M.substr(0, W) + K[W] + C.substr(W + 1);
|
|
1436
1435
|
}(S, E, u[A], h[A], c, g);
|
|
1437
1436
|
P === null && O === null ? p = A + 1 : (O === null || 0 < c(O, P)) && (O = P);
|
|
1438
1437
|
}
|
|
@@ -1633,13 +1632,13 @@ var Mr = { exports: {} };
|
|
|
1633
1632
|
var i = this;
|
|
1634
1633
|
if (e === "readwrite" && this.mode !== "readwrite") return te(new $.ReadOnly("Transaction is readonly"));
|
|
1635
1634
|
if (!this.active) return te(new $.TransactionInactive());
|
|
1636
|
-
if (this._locked()) return new
|
|
1635
|
+
if (this._locked()) return new B(function(a, c) {
|
|
1637
1636
|
i._blockedFuncs.push([function() {
|
|
1638
1637
|
i._promise(e, t, n).then(a, c);
|
|
1639
1638
|
}, G]);
|
|
1640
1639
|
});
|
|
1641
1640
|
if (n) return De(function() {
|
|
1642
|
-
var a = new
|
|
1641
|
+
var a = new B(function(c, u) {
|
|
1643
1642
|
i._lock();
|
|
1644
1643
|
var h = t(c, u, i);
|
|
1645
1644
|
h && h.then && h.then(c, u);
|
|
@@ -1648,7 +1647,7 @@ var Mr = { exports: {} };
|
|
|
1648
1647
|
return i._unlock();
|
|
1649
1648
|
}), a._lib = !0, a;
|
|
1650
1649
|
});
|
|
1651
|
-
var o = new
|
|
1650
|
+
var o = new B(function(a, c) {
|
|
1652
1651
|
var u = t(a, c, i);
|
|
1653
1652
|
u && u.then && u.then(a, c);
|
|
1654
1653
|
});
|
|
@@ -1656,7 +1655,7 @@ var Mr = { exports: {} };
|
|
|
1656
1655
|
}, be.prototype._root = function() {
|
|
1657
1656
|
return this.parent ? this.parent._root() : this;
|
|
1658
1657
|
}, be.prototype.waitFor = function(e) {
|
|
1659
|
-
var t, n = this._root(), i =
|
|
1658
|
+
var t, n = this._root(), i = B.resolve(e);
|
|
1660
1659
|
n._waitingFor ? n._waitingFor = n._waitingFor.then(function() {
|
|
1661
1660
|
return i;
|
|
1662
1661
|
}) : (n._waitingFor = i, n._waitingQueue = [], t = n.idbtrans.objectStore(n.storeNames[0]), function a() {
|
|
@@ -1664,7 +1663,7 @@ var Mr = { exports: {} };
|
|
|
1664
1663
|
n._waitingFor && (t.get(-1 / 0).onsuccess = a);
|
|
1665
1664
|
}());
|
|
1666
1665
|
var o = n._waitingFor;
|
|
1667
|
-
return new
|
|
1666
|
+
return new B(function(a, c) {
|
|
1668
1667
|
i.then(function(u) {
|
|
1669
1668
|
return n._waitingQueue.push(ee(a.bind(null, u)));
|
|
1670
1669
|
}, function(u) {
|
|
@@ -1740,8 +1739,8 @@ var Mr = { exports: {} };
|
|
|
1740
1739
|
var y = v.trans, S = v.type, E = v.keys, O = v.values, A = v.range;
|
|
1741
1740
|
return new Promise(function(P, M) {
|
|
1742
1741
|
P = ee(P);
|
|
1743
|
-
var I = y.objectStore(m), C = I.keyPath == null,
|
|
1744
|
-
if (!
|
|
1742
|
+
var I = y.objectStore(m), C = I.keyPath == null, K = S === "put" || S === "add";
|
|
1743
|
+
if (!K && S !== "delete" && S !== "deleteRange") throw new Error("Invalid operation type: " + S);
|
|
1745
1744
|
var R, L = (E || O || { length: 1 }).length;
|
|
1746
1745
|
if (E && O && E.length !== O.length) throw new Error("Given keys array must have same length as given values array.");
|
|
1747
1746
|
if (L === 0) return P({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
@@ -1753,8 +1752,8 @@ var Mr = { exports: {} };
|
|
|
1753
1752
|
if (A.type === 4) return P({ numFailures: fe, failures: z, results: [], lastResult: void 0 });
|
|
1754
1753
|
A.type === 3 ? W.push(R = I.clear()) : W.push(R = I.delete(i(A)));
|
|
1755
1754
|
} else {
|
|
1756
|
-
var C =
|
|
1757
|
-
if (
|
|
1755
|
+
var C = K ? C ? [O, E] : [O, null] : [E, null], F = C[0], se = C[1];
|
|
1756
|
+
if (K) for (var ce = 0; ce < L; ++ce) W.push(R = se && se[ce] !== void 0 ? I[S](F[ce], se[ce]) : I[S](F[ce])), R.onerror = U;
|
|
1758
1757
|
else for (ce = 0; ce < L; ++ce) W.push(R = I[S](F[ce])), R.onerror = U;
|
|
1759
1758
|
}
|
|
1760
1759
|
function Jt(ue) {
|
|
@@ -1772,8 +1771,8 @@ var Mr = { exports: {} };
|
|
|
1772
1771
|
var y = v.trans, S = v.keys;
|
|
1773
1772
|
return new Promise(function(E, O) {
|
|
1774
1773
|
E = ee(E);
|
|
1775
|
-
for (var A, P = y.objectStore(m), M = S.length, I = new Array(M), C = 0,
|
|
1776
|
-
W = W.target, I[W._pos] = W.result, ++
|
|
1774
|
+
for (var A, P = y.objectStore(m), M = S.length, I = new Array(M), C = 0, K = 0, R = function(W) {
|
|
1775
|
+
W = W.target, I[W._pos] = W.result, ++K === C && E(I);
|
|
1777
1776
|
}, L = me(O), U = 0; U < M; ++U) S[U] != null && ((A = P.get(S[U]))._pos = U, A.onsuccess = R, A.onerror = L, ++C);
|
|
1778
1777
|
C === 0 && E(I);
|
|
1779
1778
|
});
|
|
@@ -1789,11 +1788,11 @@ var Mr = { exports: {} };
|
|
|
1789
1788
|
}, query: (p = g, function(v) {
|
|
1790
1789
|
return new Promise(function(y, S) {
|
|
1791
1790
|
y = ee(y);
|
|
1792
|
-
var E, O, A, C = v.trans, P = v.values, M = v.limit, R = v.query, I = M === 1 / 0 ? void 0 : M,
|
|
1791
|
+
var E, O, A, C = v.trans, P = v.values, M = v.limit, R = v.query, I = M === 1 / 0 ? void 0 : M, K = R.index, R = R.range, C = C.objectStore(m), K = K.isPrimaryKey ? C : C.index(K.name), R = i(R);
|
|
1793
1792
|
if (M === 0) return y({ result: [] });
|
|
1794
|
-
p ? ((I = P ?
|
|
1793
|
+
p ? ((I = P ? K.getAll(R, I) : K.getAllKeys(R, I)).onsuccess = function(L) {
|
|
1795
1794
|
return y({ result: L.target.result });
|
|
1796
|
-
}, I.onerror = me(S)) : (E = 0, O = !P && "openKeyCursor" in
|
|
1795
|
+
}, I.onerror = me(S)) : (E = 0, O = !P && "openKeyCursor" in K ? K.openKeyCursor(R) : K.openCursor(R), A = [], O.onsuccess = function(L) {
|
|
1797
1796
|
var U = O.result;
|
|
1798
1797
|
return U ? (A.push(P ? U.value : U.primaryKey), ++E === M ? y({ result: A }) : void U.continue()) : y({ result: A });
|
|
1799
1798
|
}, O.onerror = me(S));
|
|
@@ -1802,7 +1801,7 @@ var Mr = { exports: {} };
|
|
|
1802
1801
|
var y = v.trans, S = v.values, E = v.query, O = v.reverse, A = v.unique;
|
|
1803
1802
|
return new Promise(function(P, M) {
|
|
1804
1803
|
P = ee(P);
|
|
1805
|
-
var
|
|
1804
|
+
var K = E.index, I = E.range, C = y.objectStore(m), C = K.isPrimaryKey ? C : C.index(K.name), K = O ? A ? "prevunique" : "prev" : A ? "nextunique" : "next", R = !S && "openKeyCursor" in C ? C.openKeyCursor(i(I), K) : C.openCursor(i(I), K);
|
|
1806
1805
|
R.onerror = me(M), R.onsuccess = ee(function(L) {
|
|
1807
1806
|
var U, W, z, fe, F = R.result;
|
|
1808
1807
|
F ? (F.___id = ++ui, F.done = !1, U = F.continue.bind(F), W = (W = F.continuePrimaryKey) && W.bind(F), z = F.advance.bind(F), fe = function() {
|
|
@@ -1851,10 +1850,10 @@ var Mr = { exports: {} };
|
|
|
1851
1850
|
var a, c, u, b = (c = h, u = yr((a = e).objectStoreNames), { schema: { name: a.name, tables: u.map(function(w) {
|
|
1852
1851
|
return c.objectStore(w);
|
|
1853
1852
|
}).map(function(w) {
|
|
1854
|
-
var p = w.keyPath, y = w.autoIncrement, m =
|
|
1853
|
+
var p = w.keyPath, y = w.autoIncrement, m = j(p), v = {}, y = { name: w.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: p == null, compound: m, keyPath: p, autoIncrement: y, unique: !0, extractKey: Sn(p) }, indexes: yr(w.indexNames).map(function(S) {
|
|
1855
1854
|
return w.index(S);
|
|
1856
1855
|
}).map(function(A) {
|
|
1857
|
-
var E = A.name, O = A.unique, P = A.multiEntry, A = A.keyPath, P = { name: E, compound:
|
|
1856
|
+
var E = A.name, O = A.unique, P = A.multiEntry, A = A.keyPath, P = { name: E, compound: j(A), keyPath: A, unique: O, multiEntry: P, extractKey: Sn(A) };
|
|
1858
1857
|
return v[mt(A)] = P;
|
|
1859
1858
|
}), getIndexByKeyPath: function(S) {
|
|
1860
1859
|
return v[mt(S)];
|
|
@@ -1915,7 +1914,7 @@ var Mr = { exports: {} };
|
|
|
1915
1914
|
De(function() {
|
|
1916
1915
|
return G.trans = a, G.transless = u, t !== 0 ? (Bt(e, n), g = t, ((h = a).storeNames.includes("$meta") ? h.table("$meta").get("version").then(function(b) {
|
|
1917
1916
|
return b ?? g;
|
|
1918
|
-
}) :
|
|
1917
|
+
}) : B.resolve(g)).then(function(b) {
|
|
1919
1918
|
return w = b, p = a, m = n, v = [], b = (f = e)._versions, y = f._dbSchema = $t(0, f.idbdb, m), (b = b.filter(function(S) {
|
|
1920
1919
|
return S._cfg.version >= w;
|
|
1921
1920
|
})).length !== 0 ? (b.forEach(function(S) {
|
|
@@ -1923,16 +1922,16 @@ var Mr = { exports: {} };
|
|
|
1923
1922
|
var E = y, O = S._cfg.dbschema;
|
|
1924
1923
|
Ft(f, E, m), Ft(f, O, m), y = f._dbSchema = O;
|
|
1925
1924
|
var A = On(E, O);
|
|
1926
|
-
A.add.forEach(function(
|
|
1927
|
-
xn(m,
|
|
1928
|
-
}), A.change.forEach(function(
|
|
1929
|
-
if (
|
|
1930
|
-
var R = m.objectStore(
|
|
1931
|
-
|
|
1925
|
+
A.add.forEach(function(K) {
|
|
1926
|
+
xn(m, K[0], K[1].primKey, K[1].indexes);
|
|
1927
|
+
}), A.change.forEach(function(K) {
|
|
1928
|
+
if (K.recreate) throw new $.Upgrade("Not yet support for changing primary key");
|
|
1929
|
+
var R = m.objectStore(K.name);
|
|
1930
|
+
K.add.forEach(function(L) {
|
|
1932
1931
|
return Gt(R, L);
|
|
1933
|
-
}),
|
|
1932
|
+
}), K.change.forEach(function(L) {
|
|
1934
1933
|
R.deleteIndex(L.name), Gt(R, L);
|
|
1935
|
-
}),
|
|
1934
|
+
}), K.del.forEach(function(L) {
|
|
1936
1935
|
return R.deleteIndex(L);
|
|
1937
1936
|
});
|
|
1938
1937
|
});
|
|
@@ -1940,14 +1939,14 @@ var Mr = { exports: {} };
|
|
|
1940
1939
|
if (P && S._cfg.version > w) {
|
|
1941
1940
|
Bt(f, m), p._memoizedTables = {};
|
|
1942
1941
|
var M = Yn(O);
|
|
1943
|
-
A.del.forEach(function(
|
|
1944
|
-
M[
|
|
1942
|
+
A.del.forEach(function(K) {
|
|
1943
|
+
M[K] = E[K];
|
|
1945
1944
|
}), En(f, [f.Transaction.prototype]), Lt(f, [f.Transaction.prototype], T(M), M), p.schema = M;
|
|
1946
1945
|
var I, C = nn(P);
|
|
1947
|
-
return C && qe(), A =
|
|
1948
|
-
var
|
|
1949
|
-
(I = P(p)) && C && (
|
|
1950
|
-
}), I && typeof I.then == "function" ?
|
|
1946
|
+
return C && qe(), A = B.follow(function() {
|
|
1947
|
+
var K;
|
|
1948
|
+
(I = P(p)) && C && (K = Pe.bind(null, null), I.then(K, K));
|
|
1949
|
+
}), I && typeof I.then == "function" ? B.resolve(I) : A.then(function() {
|
|
1951
1950
|
return I;
|
|
1952
1951
|
});
|
|
1953
1952
|
}
|
|
@@ -1962,14 +1961,14 @@ var Mr = { exports: {} };
|
|
|
1962
1961
|
})) : E.objectStore("$meta").put(S._cfg.version, "version"));
|
|
1963
1962
|
});
|
|
1964
1963
|
}), function S() {
|
|
1965
|
-
return v.length ?
|
|
1964
|
+
return v.length ? B.resolve(v.shift()(p.idbtrans)).then(S) : B.resolve();
|
|
1966
1965
|
}().then(function() {
|
|
1967
1966
|
mr(y, m);
|
|
1968
|
-
})) :
|
|
1967
|
+
})) : B.resolve();
|
|
1969
1968
|
var f, w, p, m, v, y;
|
|
1970
1969
|
}).catch(c)) : (T(o).forEach(function(b) {
|
|
1971
1970
|
xn(n, b, o[b].primKey, o[b].indexes);
|
|
1972
|
-
}), Bt(e, n), void
|
|
1971
|
+
}), Bt(e, n), void B.follow(function() {
|
|
1973
1972
|
return e.on.populate.fire(a);
|
|
1974
1973
|
}).catch(c));
|
|
1975
1974
|
var h, g;
|
|
@@ -2049,7 +2048,7 @@ var Mr = { exports: {} };
|
|
|
2049
2048
|
function br(e) {
|
|
2050
2049
|
return e.split(",").map(function(t, n) {
|
|
2051
2050
|
var i = (t = t.trim()).replace(/([&*]|\+\+)/g, ""), o = /^\[/.test(i) ? i.match(/^\[(.*)\]$/)[1].split("+") : i;
|
|
2052
|
-
return wn(i, o || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t),
|
|
2051
|
+
return wn(i, o || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t), j(o), n === 0);
|
|
2053
2052
|
});
|
|
2054
2053
|
}
|
|
2055
2054
|
var gi = (Ut.prototype._parseStoresSpec = function(e, t) {
|
|
@@ -2224,7 +2223,7 @@ var Mr = { exports: {} };
|
|
|
2224
2223
|
if (t.openCanceller !== i) throw new $.DatabaseClosed("db.open() was cancelled");
|
|
2225
2224
|
}
|
|
2226
2225
|
function u() {
|
|
2227
|
-
return new
|
|
2226
|
+
return new B(function(w, p) {
|
|
2228
2227
|
if (c(), !n) throw new $.MissingAPI();
|
|
2229
2228
|
var m = e.name, v = t.autoSchema || !o ? n.open(m) : n.open(m, o);
|
|
2230
2229
|
if (!v) throw new $.MissingAPI();
|
|
@@ -2259,11 +2258,11 @@ var Mr = { exports: {} };
|
|
|
2259
2258
|
case "VersionError":
|
|
2260
2259
|
if (0 < o) return o = 0, u();
|
|
2261
2260
|
}
|
|
2262
|
-
return
|
|
2261
|
+
return B.reject(w);
|
|
2263
2262
|
});
|
|
2264
2263
|
}
|
|
2265
2264
|
var h, g = t.dbReadyResolve, b = null, f = !1;
|
|
2266
|
-
return
|
|
2265
|
+
return B.race([i, (typeof navigator > "u" ? B.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(w) {
|
|
2267
2266
|
function p() {
|
|
2268
2267
|
return indexedDB.databases().finally(w);
|
|
2269
2268
|
}
|
|
@@ -2271,12 +2270,12 @@ var Mr = { exports: {} };
|
|
|
2271
2270
|
}).finally(function() {
|
|
2272
2271
|
return clearInterval(h);
|
|
2273
2272
|
}) : Promise.resolve()).then(u)]).then(function() {
|
|
2274
|
-
return c(), t.onReadyBeingFired = [],
|
|
2273
|
+
return c(), t.onReadyBeingFired = [], B.resolve(Dn(function() {
|
|
2275
2274
|
return e.on.ready.fire(e.vip);
|
|
2276
2275
|
})).then(function w() {
|
|
2277
2276
|
if (0 < t.onReadyBeingFired.length) {
|
|
2278
2277
|
var p = t.onReadyBeingFired.reduce(on, X);
|
|
2279
|
-
return t.onReadyBeingFired = [],
|
|
2278
|
+
return t.onReadyBeingFired = [], B.resolve(Dn(function() {
|
|
2280
2279
|
return p(e.vip);
|
|
2281
2280
|
})).then(w);
|
|
2282
2281
|
}
|
|
@@ -2311,13 +2310,13 @@ var Mr = { exports: {} };
|
|
|
2311
2310
|
function o(a) {
|
|
2312
2311
|
return function(h) {
|
|
2313
2312
|
var u = a(h), h = u.value;
|
|
2314
|
-
return u.done ? h : h && typeof h.then == "function" ? h.then(n, i) :
|
|
2313
|
+
return u.done ? h : h && typeof h.then == "function" ? h.then(n, i) : j(h) ? Promise.all(h).then(n, i) : n(h);
|
|
2315
2314
|
};
|
|
2316
2315
|
}
|
|
2317
2316
|
return o(t)();
|
|
2318
2317
|
}
|
|
2319
2318
|
function Yt(e, t, n) {
|
|
2320
|
-
for (var i =
|
|
2319
|
+
for (var i = j(e) ? e.slice() : [e], o = 0; o < n; ++o) i.push(t);
|
|
2321
2320
|
return i;
|
|
2322
2321
|
}
|
|
2323
2322
|
var mi = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
@@ -2417,15 +2416,15 @@ var Mr = { exports: {} };
|
|
|
2417
2416
|
if (!y) throw new Error("Keys missing");
|
|
2418
2417
|
return (f = f.type === "add" || f.type === "put" ? l(l({}, f), { keys: y }) : l({}, f)).type !== "delete" && (f.values = x([], f.values)), f.keys && (f.keys = x([], f.keys)), w = n, m = y, ((p = f).type === "add" ? Promise.resolve([]) : w.getMany({ trans: p.trans, keys: m, cache: "immutable" })).then(function(S) {
|
|
2419
2418
|
var E = y.map(function(O, A) {
|
|
2420
|
-
var P, M, I, C = S[A],
|
|
2421
|
-
return f.type === "delete" ? u.fire.call(
|
|
2419
|
+
var P, M, I, C = S[A], K = { onerror: null, onsuccess: null };
|
|
2420
|
+
return f.type === "delete" ? u.fire.call(K, O, C, v) : f.type === "add" || C === void 0 ? (P = h.fire.call(K, O, f.values[A], v), O == null && P != null && (f.keys[A] = O = P, i.outbound || le(f.values[A], i.keyPath, O))) : (P = jn(C, f.values[A]), (M = g.fire.call(K, P, O, C, v)) && (I = f.values[A], Object.keys(M).forEach(function(R) {
|
|
2422
2421
|
q(I, R) ? I[R] = M[R] : le(I, R, M[R]);
|
|
2423
|
-
}))),
|
|
2422
|
+
}))), K;
|
|
2424
2423
|
});
|
|
2425
2424
|
return n.mutate(f).then(function(O) {
|
|
2426
2425
|
for (var A = O.failures, P = O.results, M = O.numFailures, O = O.lastResult, I = 0; I < y.length; ++I) {
|
|
2427
|
-
var C = (P || y)[I],
|
|
2428
|
-
C == null ?
|
|
2426
|
+
var C = (P || y)[I], K = E[I];
|
|
2427
|
+
C == null ? K.onerror && K.onerror(A[I]) : K.onsuccess && K.onsuccess(f.type === "put" && S[I] ? f.values[I] : C);
|
|
2429
2428
|
}
|
|
2430
2429
|
return { failures: A, results: P, numFailures: M, lastResult: O };
|
|
2431
2430
|
}).catch(function(O) {
|
|
@@ -2453,7 +2452,7 @@ var Mr = { exports: {} };
|
|
|
2453
2452
|
return l(l({}, n), { getMany: function(i) {
|
|
2454
2453
|
if (!i.cache) return n.getMany(i);
|
|
2455
2454
|
var o = Er(i.keys, i.trans._cache, i.cache === "clone");
|
|
2456
|
-
return o ?
|
|
2455
|
+
return o ? B.resolve(o) : n.getMany(i).then(function(a) {
|
|
2457
2456
|
return i.trans._cache = { keys: i.keys, values: i.cache === "clone" ? Te(a) : a }, a;
|
|
2458
2457
|
});
|
|
2459
2458
|
}, mutate: function(i) {
|
|
@@ -2487,16 +2486,16 @@ var Mr = { exports: {} };
|
|
|
2487
2486
|
function m(R) {
|
|
2488
2487
|
return R = "idb://".concat(t, "/").concat(i, "/").concat(R), O[R] || (O[R] = new ae());
|
|
2489
2488
|
}
|
|
2490
|
-
var v, y, S, E = p.trans, O = p.mutatedParts || (p.mutatedParts = {}), A = m(""), P = m(":dels"), M = p.type,
|
|
2489
|
+
var v, y, S, E = p.trans, O = p.mutatedParts || (p.mutatedParts = {}), A = m(""), P = m(":dels"), M = p.type, K = p.type === "deleteRange" ? [p.range] : p.type === "delete" ? [p.keys] : p.values.length < 50 ? [Kn(c, p).filter(function(R) {
|
|
2491
2490
|
return R;
|
|
2492
|
-
}), p.values] : [], I =
|
|
2493
|
-
return
|
|
2491
|
+
}), p.values] : [], I = K[0], C = K[1], K = p.trans._cache;
|
|
2492
|
+
return j(I) ? (A.addKeys(I), (K = M === "delete" || I.length === C.length ? Er(I, K) : null) || P.addKeys(I), (K || C) && (v = m, y = K, S = C, a.indexes.forEach(function(R) {
|
|
2494
2493
|
var L = v(R.name || "");
|
|
2495
2494
|
function U(z) {
|
|
2496
2495
|
return z != null ? R.extractKey(z) : null;
|
|
2497
2496
|
}
|
|
2498
2497
|
function W(z) {
|
|
2499
|
-
return R.multiEntry &&
|
|
2498
|
+
return R.multiEntry && j(z) ? z.forEach(function(fe) {
|
|
2500
2499
|
return L.addKey(fe);
|
|
2501
2500
|
}) : L.addKey(z);
|
|
2502
2501
|
}
|
|
@@ -2539,8 +2538,8 @@ var Mr = { exports: {} };
|
|
|
2539
2538
|
if (h && m.values) return P.then(function(U) {
|
|
2540
2539
|
return U = U.result, O.addKeys(U), C;
|
|
2541
2540
|
});
|
|
2542
|
-
var
|
|
2543
|
-
(m.values ? O : A).addKeys(
|
|
2541
|
+
var K = m.values ? C.result.map(u) : C.result;
|
|
2542
|
+
(m.values ? O : A).addKeys(K);
|
|
2544
2543
|
} else if (p === "openCursor") {
|
|
2545
2544
|
var R = C, L = m.values;
|
|
2546
2545
|
return R && Object.create(R, { key: { get: function() {
|
|
@@ -2567,9 +2566,9 @@ var Mr = { exports: {} };
|
|
|
2567
2566
|
if (n.numFailures === 0) return t;
|
|
2568
2567
|
if (t.type === "deleteRange") return null;
|
|
2569
2568
|
var i = t.keys ? t.keys.length : "values" in t && t.values ? t.values.length : 1;
|
|
2570
|
-
return n.numFailures === i ? null : (t = l({}, t),
|
|
2569
|
+
return n.numFailures === i ? null : (t = l({}, t), j(t.keys) && (t.keys = t.keys.filter(function(o, a) {
|
|
2571
2570
|
return !(a in n.failures);
|
|
2572
|
-
})), "values" in t &&
|
|
2571
|
+
})), "values" in t && j(t.values) && (t.values = t.values.filter(function(o, a) {
|
|
2573
2572
|
return !(a in n.failures);
|
|
2574
2573
|
})), t);
|
|
2575
2574
|
}
|
|
@@ -2583,7 +2582,7 @@ var Mr = { exports: {} };
|
|
|
2583
2582
|
var v = p, y = [];
|
|
2584
2583
|
if (m.type === "add" || m.type === "put") for (var S = new ae(), E = m.values.length - 1; 0 <= E; --E) {
|
|
2585
2584
|
var O, A = m.values[E], P = g(A);
|
|
2586
|
-
S.hasKey(P) || (O = b(A), (u &&
|
|
2585
|
+
S.hasKey(P) || (O = b(A), (u && j(O) ? O.some(function(R) {
|
|
2587
2586
|
return Nn(R, h);
|
|
2588
2587
|
}) : Nn(O, h)) && (S.addKey(P), y.push(A)));
|
|
2589
2588
|
}
|
|
@@ -2616,9 +2615,9 @@ var Mr = { exports: {} };
|
|
|
2616
2615
|
});
|
|
2617
2616
|
break;
|
|
2618
2617
|
case "deleteRange":
|
|
2619
|
-
var
|
|
2618
|
+
var K = m.range;
|
|
2620
2619
|
v = p.filter(function(L) {
|
|
2621
|
-
return !Nn(g(L),
|
|
2620
|
+
return !Nn(g(L), K);
|
|
2622
2621
|
});
|
|
2623
2622
|
}
|
|
2624
2623
|
return v;
|
|
@@ -2679,9 +2678,9 @@ var Mr = { exports: {} };
|
|
|
2679
2678
|
p.optimisticOps = p.optimisticOps.filter(function(L) {
|
|
2680
2679
|
return L.trans !== u;
|
|
2681
2680
|
});
|
|
2682
|
-
for (var A = 0, P = Object.values(p.queries.query); A < P.length; A++) for (var M, I, C,
|
|
2681
|
+
for (var A = 0, P = Object.values(p.queries.query); A < P.length; A++) for (var M, I, C, K = 0, R = (M = P[A]).slice(); K < R.length; K++) (I = R[K]).res != null && u.mutatedParts && (h && !I.dirty ? (C = Object.isFrozen(I.res), C = kr(I.res, I.req, v, m, I, C), I.dirty ? (je(M, I), I.subscribers.forEach(function(L) {
|
|
2683
2682
|
return g.add(L);
|
|
2684
|
-
})) : C !== I.res && (I.res = C, I.promise =
|
|
2683
|
+
})) : C !== I.res && (I.res = C, I.promise = B.resolve({ result: C }))) : (I.dirty && je(M, I), I.subscribers.forEach(function(L) {
|
|
2685
2684
|
return g.add(L);
|
|
2686
2685
|
})));
|
|
2687
2686
|
}
|
|
@@ -2766,7 +2765,7 @@ var Mr = { exports: {} };
|
|
|
2766
2765
|
return n || (n = new this.Version(e), t.push(n), t.sort(fi), n.stores({}), this._state.autoSchema = !1, n);
|
|
2767
2766
|
}, ne.prototype._whenReady = function(e) {
|
|
2768
2767
|
var t = this;
|
|
2769
|
-
return this.idbdb && (this._state.openComplete || G.letThrough || this._vip) ? e() : new
|
|
2768
|
+
return this.idbdb && (this._state.openComplete || G.letThrough || this._vip) ? e() : new B(function(n, i) {
|
|
2770
2769
|
if (t._state.openComplete) return i(new $.DatabaseClosed(t._state.dbOpenError));
|
|
2771
2770
|
if (!t._state.isBeingOpened) {
|
|
2772
2771
|
if (!t._state.autoOpen) return void i(new $.DatabaseClosed());
|
|
@@ -2798,9 +2797,9 @@ var Mr = { exports: {} };
|
|
|
2798
2797
|
}
|
|
2799
2798
|
this.idbdb = null;
|
|
2800
2799
|
}
|
|
2801
|
-
e.isBeingOpened || (e.dbReadyPromise = new
|
|
2800
|
+
e.isBeingOpened || (e.dbReadyPromise = new B(function(n) {
|
|
2802
2801
|
e.dbReadyResolve = n;
|
|
2803
|
-
}), e.openCanceller = new
|
|
2802
|
+
}), e.openCanceller = new B(function(n, i) {
|
|
2804
2803
|
e.cancelOpen = i;
|
|
2805
2804
|
}));
|
|
2806
2805
|
}, ne.prototype.close = function(n) {
|
|
@@ -2810,7 +2809,7 @@ var Mr = { exports: {} };
|
|
|
2810
2809
|
var t = this;
|
|
2811
2810
|
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
2812
2811
|
var n = 0 < arguments.length && typeof arguments[0] != "object", i = this._state;
|
|
2813
|
-
return new
|
|
2812
|
+
return new B(function(o, a) {
|
|
2814
2813
|
function c() {
|
|
2815
2814
|
t.close(e);
|
|
2816
2815
|
var u = t._deps.indexedDB.deleteDatabase(t.name);
|
|
@@ -2878,7 +2877,7 @@ var Mr = { exports: {} };
|
|
|
2878
2877
|
}) : te(g);
|
|
2879
2878
|
}
|
|
2880
2879
|
var h = (function g(b, f, w, p, m) {
|
|
2881
|
-
return
|
|
2880
|
+
return B.resolve().then(function() {
|
|
2882
2881
|
var v = G.transless || G, y = b._createTransaction(f, w, b._dbSchema, p);
|
|
2883
2882
|
if (y.explicit = !0, v = { trans: y, transless: v }, p) y.idbtrans = p.idbtrans;
|
|
2884
2883
|
else try {
|
|
@@ -2889,10 +2888,10 @@ var Mr = { exports: {} };
|
|
|
2889
2888
|
})) : te(O);
|
|
2890
2889
|
}
|
|
2891
2890
|
var S, E = nn(m);
|
|
2892
|
-
return E && qe(), v =
|
|
2891
|
+
return E && qe(), v = B.follow(function() {
|
|
2893
2892
|
var O;
|
|
2894
2893
|
(S = m.call(y, y)) && (E ? (O = Pe.bind(null, null), S.then(O, O)) : typeof S.next == "function" && typeof S.throw == "function" && (S = Tn(S)));
|
|
2895
|
-
}, v), (S && typeof S.then == "function" ?
|
|
2894
|
+
}, v), (S && typeof S.then == "function" ? B.resolve(S).then(function(O) {
|
|
2896
2895
|
return y.active ? O : te(new $.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
2897
2896
|
}) : v.then(function() {
|
|
2898
2897
|
return S;
|
|
@@ -2918,15 +2917,15 @@ var Mr = { exports: {} };
|
|
|
2918
2917
|
var i = ne.dependencies;
|
|
2919
2918
|
this._options = t = l({ addons: ne.addons, autoOpen: !0, indexedDB: i.indexedDB, IDBKeyRange: i.IDBKeyRange, cache: "cloned" }, t), this._deps = { indexedDB: t.indexedDB, IDBKeyRange: t.IDBKeyRange }, i = t.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
2920
2919
|
var o, a, c, u, h, g = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: X, dbReadyPromise: null, cancelOpen: X, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
|
|
2921
|
-
g.dbReadyPromise = new
|
|
2920
|
+
g.dbReadyPromise = new B(function(f) {
|
|
2922
2921
|
g.dbReadyResolve = f;
|
|
2923
|
-
}), g.openCanceller = new
|
|
2922
|
+
}), g.openCanceller = new B(function(f, w) {
|
|
2924
2923
|
g.cancelOpen = w;
|
|
2925
2924
|
}), this._state = g, this.name = e, this.on = dt(this, "populate", "blocked", "versionchange", "close", { ready: [on, X] }), this.on.ready.subscribe = zn(this.on.ready.subscribe, function(f) {
|
|
2926
2925
|
return function(w, p) {
|
|
2927
2926
|
ne.vip(function() {
|
|
2928
2927
|
var m, v = n._state;
|
|
2929
|
-
v.openComplete ? (v.dbOpenError ||
|
|
2928
|
+
v.openComplete ? (v.dbOpenError || B.resolve().then(w), p && f(w)) : v.onReadyBeingFired ? (v.onReadyBeingFired.push(w), p && f(w)) : (f(w), m = n, p || f(function y() {
|
|
2930
2929
|
m.on.ready.unsubscribe(w), m.on.ready.unsubscribe(y);
|
|
2931
2930
|
}));
|
|
2932
2931
|
});
|
|
@@ -2945,7 +2944,7 @@ var Mr = { exports: {} };
|
|
|
2945
2944
|
this.db = a, this._tx = p, this.name = f, this.schema = w, this.hook = a._allTables[f] ? a._allTables[f].hook : dt(null, { creating: [Jr, X], reading: [Xr, at], updating: [Zr, X], deleting: [Vr, X] });
|
|
2946
2945
|
})), this.Transaction = (c = this, ft(ci.prototype, function(f, w, p, m, v) {
|
|
2947
2946
|
var y = this;
|
|
2948
|
-
this.db = c, this.mode = f, this.storeNames = w, this.schema = p, this.chromeTransactionDurability = m, this.idbtrans = null, this.on = dt(this, "complete", "error", "abort"), this.parent = v || 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
|
|
2947
|
+
this.db = c, this.mode = f, this.storeNames = w, this.schema = p, this.chromeTransactionDurability = m, this.idbtrans = null, this.on = dt(this, "complete", "error", "abort"), this.parent = v || 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 B(function(S, E) {
|
|
2949
2948
|
y._resolve = S, y._reject = E;
|
|
2950
2949
|
}), this._completion.then(function() {
|
|
2951
2950
|
y.active = !1, y.on.complete.fire();
|
|
@@ -3089,7 +3088,7 @@ var Mr = { exports: {} };
|
|
|
3089
3088
|
return function() {
|
|
3090
3089
|
try {
|
|
3091
3090
|
var t = Tn(e.apply(this, arguments));
|
|
3092
|
-
return t && typeof t.then == "function" ? t :
|
|
3091
|
+
return t && typeof t.then == "function" ? t : B.resolve(t);
|
|
3093
3092
|
} catch (n) {
|
|
3094
3093
|
return te(n);
|
|
3095
3094
|
}
|
|
@@ -3097,15 +3096,15 @@ var Mr = { exports: {} };
|
|
|
3097
3096
|
}, spawn: function(e, t, n) {
|
|
3098
3097
|
try {
|
|
3099
3098
|
var i = Tn(e.apply(n, t || []));
|
|
3100
|
-
return i && typeof i.then == "function" ? i :
|
|
3099
|
+
return i && typeof i.then == "function" ? i : B.resolve(i);
|
|
3101
3100
|
} catch (o) {
|
|
3102
3101
|
return te(o);
|
|
3103
3102
|
}
|
|
3104
3103
|
}, currentTransaction: { get: function() {
|
|
3105
3104
|
return G.trans || null;
|
|
3106
3105
|
} }, waitFor: function(e, t) {
|
|
3107
|
-
return t =
|
|
3108
|
-
}, Promise:
|
|
3106
|
+
return t = B.resolve(typeof e == "function" ? We.ignoreTransaction(e) : e).timeout(t || 6e4), G.trans ? G.trans.waitFor(t) : t;
|
|
3107
|
+
}, Promise: B, debug: { get: function() {
|
|
3109
3108
|
return ye;
|
|
3110
3109
|
}, set: function(e) {
|
|
3111
3110
|
Zn(e);
|
|
@@ -3137,7 +3136,7 @@ var Mr = { exports: {} };
|
|
|
3137
3136
|
}
|
|
3138
3137
|
}), addEventListener("pageshow", function(e) {
|
|
3139
3138
|
!Oe.disableBfCache && e.persisted && (ye && console.debug("Dexie: handling persisted pageshow"), Ir(), Ln({ all: new ae(-1 / 0, [[]]) }));
|
|
3140
|
-
})),
|
|
3139
|
+
})), B.rejectionMapper = function(e, t) {
|
|
3141
3140
|
return !e || e instanceof Xe || e instanceof TypeError || e instanceof SyntaxError || !e.name || !Vn[e.name] ? e : (t = new Vn[e.name](t || e.message, e), "stack" in e && Ae(t, "stack", { get: function() {
|
|
3142
3141
|
return this.inner.stack;
|
|
3143
3142
|
} }), t);
|
|
@@ -3167,11 +3166,11 @@ function Tr(d) {
|
|
|
3167
3166
|
return d.topics === void 0 && (d.topics = `${d.dashboard}-${d.widget}`), d;
|
|
3168
3167
|
}
|
|
3169
3168
|
function _t(d, r) {
|
|
3170
|
-
var
|
|
3169
|
+
var j;
|
|
3171
3170
|
let s, l, x, D, T;
|
|
3172
3171
|
switch (d.moderation) {
|
|
3173
3172
|
case Zt.BEFORE:
|
|
3174
|
-
s = /* @__PURE__ */ new Date(), l = (
|
|
3173
|
+
s = /* @__PURE__ */ new Date(), l = (j = d.beforeTime) == null ? void 0 : j.split(":"), x = Number.parseInt(l ? l[0] : "00"), D = Number.parseInt(l ? l[1] : "00"), T = Number.parseInt(l ? l[2] : "00"), r.before = s.setHours(x, D, T, 0) / 1e3, r.period || (r.period = s.getDay() === 1 ? 72 : 24);
|
|
3175
3174
|
break;
|
|
3176
3175
|
case Zt.DELAYED:
|
|
3177
3176
|
d.delay && d.delay > 0 && (r.delay = `${d.delay}`);
|
|
@@ -3195,7 +3194,7 @@ class jr {
|
|
|
3195
3194
|
* @returns IResponse
|
|
3196
3195
|
*/
|
|
3197
3196
|
k(this, "getCloud", async (r) => {
|
|
3198
|
-
const s = await this.db.table(
|
|
3197
|
+
const s = await this.db.table(N.CLOUD).where({ id: r.widget }).last().catch(() => {
|
|
3199
3198
|
console.warn(
|
|
3200
3199
|
"%capi%C %ccloud",
|
|
3201
3200
|
_.API,
|
|
@@ -3213,7 +3212,7 @@ class jr {
|
|
|
3213
3212
|
* @returns IResponse
|
|
3214
3213
|
*/
|
|
3215
3214
|
k(this, "getSeries", async (r) => {
|
|
3216
|
-
const s = await this.db.table(
|
|
3215
|
+
const s = await this.db.table(N.SERIES).where({ id: r.widget }).last().catch(() => {
|
|
3217
3216
|
console.warn(
|
|
3218
3217
|
"%capi%c %cseries",
|
|
3219
3218
|
_.API,
|
|
@@ -3235,10 +3234,10 @@ class jr {
|
|
|
3235
3234
|
s !== "utc" && (r.since = Math.floor(Date.now() / 1e3) - 60 * 60 * 24 * 7), this.options.delay != 0 ? r.before = Math.floor(Date.now() / 1e3) - (this.options.delay || 0) : r.before = Math.floor(Date.now() / 1e3);
|
|
3236
3235
|
const l = (T) => T.utc > ((r == null ? void 0 : r.since) || 0), x = (T) => T.utc < ((r == null ? void 0 : r.before) || Date.now() / 1e3), D = (T) => (T == null ? void 0 : T.visible) !== 0;
|
|
3237
3236
|
try {
|
|
3238
|
-
const
|
|
3239
|
-
if (
|
|
3237
|
+
const j = await this.db.table(N.TOPICS).where("widget_id").equals(r.widget).filter(D).filter(l).filter(x).reverse().limit((r == null ? void 0 : r.limit) ?? 25).sortBy(s);
|
|
3238
|
+
if (j.length === 0)
|
|
3240
3239
|
return { data: null, message: "No Messages error", success: !1 };
|
|
3241
|
-
let Q =
|
|
3240
|
+
let Q = j.map((V) => this.db.table(N.MESSAGES).get({ id: V.message_id }));
|
|
3242
3241
|
return qt.Promise.all(Q).then(async (V) => {
|
|
3243
3242
|
const ve = V.map((pe) => pe.data), q = {
|
|
3244
3243
|
data: {
|
|
@@ -3277,7 +3276,7 @@ class jr {
|
|
|
3277
3276
|
* @param data
|
|
3278
3277
|
* @returns number
|
|
3279
3278
|
*/
|
|
3280
|
-
k(this, "setCloud", async (r, s) => r.type ===
|
|
3279
|
+
k(this, "setCloud", async (r, s) => r.type === N.CLOUD && s !== "" ? await this.db.table(N.CLOUD).put({
|
|
3281
3280
|
id: r.widget,
|
|
3282
3281
|
dashboard_id: r.dashboard,
|
|
3283
3282
|
data: s.data
|
|
@@ -3288,7 +3287,7 @@ class jr {
|
|
|
3288
3287
|
* @param data
|
|
3289
3288
|
* @returns number
|
|
3290
3289
|
*/
|
|
3291
|
-
k(this, "setSeries", async (r, s) => r.type ===
|
|
3290
|
+
k(this, "setSeries", async (r, s) => r.type === N.SERIES && s !== "" ? await this.db.table(N.SERIES).put({
|
|
3292
3291
|
id: r.widget,
|
|
3293
3292
|
dashboard_id: r.dashboard,
|
|
3294
3293
|
data: s.data
|
|
@@ -3300,13 +3299,13 @@ class jr {
|
|
|
3300
3299
|
* @returns number
|
|
3301
3300
|
*/
|
|
3302
3301
|
k(this, "setMessages", async (r, s) => {
|
|
3303
|
-
if (r.type !==
|
|
3302
|
+
if (r.type !== N.MESSAGES)
|
|
3304
3303
|
return 400;
|
|
3305
3304
|
const l = s.data.title;
|
|
3306
3305
|
let x = 0;
|
|
3307
3306
|
return s.data.messages.forEach(async (D) => {
|
|
3308
|
-
var T,
|
|
3309
|
-
D.id !== null && (await this.db.table(
|
|
3307
|
+
var T, j, Q, V, ve, q, pe;
|
|
3308
|
+
D.id !== null && (await this.db.table(N.MESSAGES).put({
|
|
3310
3309
|
id: D.id,
|
|
3311
3310
|
utc: D.utc,
|
|
3312
3311
|
data: D,
|
|
@@ -3320,12 +3319,12 @@ class jr {
|
|
|
3320
3319
|
D,
|
|
3321
3320
|
He.message
|
|
3322
3321
|
);
|
|
3323
|
-
}), await this.db.table(
|
|
3322
|
+
}), await this.db.table(N.TOPICS).put({
|
|
3324
3323
|
title: l,
|
|
3325
3324
|
widget_id: r.widget,
|
|
3326
3325
|
message_id: D.id,
|
|
3327
3326
|
dashboard_id: r.dashboard,
|
|
3328
|
-
engagement: ((T = D.topics[0]) == null ? void 0 : T.engagement) || ((
|
|
3327
|
+
engagement: ((T = D.topics[0]) == null ? void 0 : T.engagement) || ((j = D.dynamics) == null ? void 0 : j.engagement) || 0,
|
|
3329
3328
|
impressions: ((Q = D.topics[0]) == null ? void 0 : Q.impressions) || ((V = D.dynamics) == null ? void 0 : V.semrush_visits) || 0,
|
|
3330
3329
|
reach: ((ve = D.topics[0]) == null ? void 0 : ve.reach) || ((q = D.dynamics) == null ? void 0 : q.potential_reach) || 0,
|
|
3331
3330
|
sentiment: ((pe = D.topics[0]) == null ? void 0 : pe.sentiment) || 0,
|
|
@@ -3342,8 +3341,8 @@ class jr {
|
|
|
3342
3341
|
);
|
|
3343
3342
|
}));
|
|
3344
3343
|
}), s.data.topics.forEach(async (D) => {
|
|
3345
|
-
const T = D.message_id,
|
|
3346
|
-
await this.db.table(
|
|
3344
|
+
const T = D.message_id, j = D.visible ? 1 : 0, Q = D.title;
|
|
3345
|
+
await this.db.table(N.TOPICS).where("message_id").equals(T).modify({ visible: j }).catch((V) => {
|
|
3347
3346
|
x++, console.error(
|
|
3348
3347
|
"%cstorage",
|
|
3349
3348
|
_.STORAGE,
|
|
@@ -3360,13 +3359,13 @@ class jr {
|
|
|
3360
3359
|
*/
|
|
3361
3360
|
k(this, "cleanMessages", async () => {
|
|
3362
3361
|
const r = Date.now() / 1e3, s = (D) => D.expires < r, l = (D) => D.expires < r;
|
|
3363
|
-
return await this.db.table(
|
|
3362
|
+
return await this.db.table(N.TOPICS).orderBy("expires").filter(s).delete().catch((D) => (console.error(
|
|
3364
3363
|
"%cstorage%c %cclean",
|
|
3365
3364
|
_.STORAGE,
|
|
3366
3365
|
_.NONE,
|
|
3367
3366
|
_.MESSAGES,
|
|
3368
3367
|
D.message
|
|
3369
|
-
), 0)), await this.db.table(
|
|
3368
|
+
), 0)), await this.db.table(N.MESSAGES).orderBy("expires").filter(l).delete().catch((D) => (console.error(
|
|
3370
3369
|
"%cstorage%c %clean",
|
|
3371
3370
|
_.STORAGE,
|
|
3372
3371
|
_.NONE,
|
|
@@ -3375,7 +3374,7 @@ class jr {
|
|
|
3375
3374
|
), 0));
|
|
3376
3375
|
});
|
|
3377
3376
|
k(this, "hideMessage", async (r, s) => {
|
|
3378
|
-
await this.db.table(
|
|
3377
|
+
await this.db.table(N.TOPICS).where("message_id").equals(r).modify({ visible: s ? 1 : 0 }).catch((l) => (console.error(
|
|
3379
3378
|
"%cstorage%c %chide",
|
|
3380
3379
|
_.STORAGE,
|
|
3381
3380
|
_.NONE,
|
|
@@ -3388,14 +3387,14 @@ class jr {
|
|
|
3388
3387
|
* @param query IQuery
|
|
3389
3388
|
* @returns number
|
|
3390
3389
|
*/
|
|
3391
|
-
k(this, "setWidget", async (r) => await this.db.table(
|
|
3390
|
+
k(this, "setWidget", async (r) => await this.db.table(N.WIDGETS).put({
|
|
3392
3391
|
id: r.widget,
|
|
3393
3392
|
dashboard_id: r.dashboard,
|
|
3394
3393
|
type: r.type
|
|
3395
3394
|
}).then(() => 201).catch((s) => (console.error(
|
|
3396
3395
|
"%cstorage",
|
|
3397
3396
|
_.STORAGE,
|
|
3398
|
-
|
|
3397
|
+
N.WIDGET,
|
|
3399
3398
|
r,
|
|
3400
3399
|
s.message
|
|
3401
3400
|
), 400)));
|
|
@@ -3406,7 +3405,7 @@ class jr {
|
|
|
3406
3405
|
*/
|
|
3407
3406
|
k(this, "subscribe", (r) => (r = Tr(r), this.subscribers.filter(
|
|
3408
3407
|
(l) => l.widget === r.widget
|
|
3409
|
-
).length > 0 || (r.type ===
|
|
3408
|
+
).length > 0 || (r.type === N.MESSAGES && (r = _t(this.options, r)), console.debug(
|
|
3410
3409
|
"%cstorage%c %csubscribe",
|
|
3411
3410
|
_.STORAGE,
|
|
3412
3411
|
_.NONE,
|
|
@@ -3425,7 +3424,7 @@ class jr {
|
|
|
3425
3424
|
* @returns IResponse
|
|
3426
3425
|
*/
|
|
3427
3426
|
k(this, "loadSlide", async (r) => {
|
|
3428
|
-
const s = await this.db.table(
|
|
3427
|
+
const s = await this.db.table(N.SLIDE).where({ id: r.id }).last().catch(() => {
|
|
3429
3428
|
console.warn(
|
|
3430
3429
|
"%capi%c %cseries",
|
|
3431
3430
|
_.API,
|
|
@@ -3441,7 +3440,7 @@ class jr {
|
|
|
3441
3440
|
* @param query IQuery
|
|
3442
3441
|
* @returns number
|
|
3443
3442
|
*/
|
|
3444
|
-
k(this, "storeSlide", async (r) => r.type ===
|
|
3443
|
+
k(this, "storeSlide", async (r) => r.type === N.SLIDE && r.data !== "" ? await this.db.table(N.SLIDE).put({
|
|
3445
3444
|
id: r.id,
|
|
3446
3445
|
title: r.data.title || "Not set",
|
|
3447
3446
|
json: r.data.json || {},
|
|
@@ -3496,15 +3495,15 @@ class Nr {
|
|
|
3496
3495
|
k(this, "options");
|
|
3497
3496
|
k(this, "getCloud", async (r) => {
|
|
3498
3497
|
const s = J(r);
|
|
3499
|
-
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi", _.API,
|
|
3498
|
+
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi", _.API, N.CLOUD, r.slide, r.widget), { data: null, message: "Cloud Data error", success: !1 }));
|
|
3500
3499
|
});
|
|
3501
3500
|
k(this, "getSeries", async (r) => {
|
|
3502
3501
|
const s = J(r);
|
|
3503
|
-
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi", _.API,
|
|
3502
|
+
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi", _.API, N.SERIES, r.slide, r.widget), { data: null, message: "Series Data error", success: !1 }));
|
|
3504
3503
|
});
|
|
3505
3504
|
k(this, "getMessages", async (r) => {
|
|
3506
3505
|
const s = J(r);
|
|
3507
|
-
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi", _.API,
|
|
3506
|
+
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi", _.API, N.MESSAGES, r.slide, r.widget), { data: null, message: "Messages Data error", success: !1 }));
|
|
3508
3507
|
});
|
|
3509
3508
|
/**
|
|
3510
3509
|
* Update Cloud
|
|
@@ -3516,7 +3515,7 @@ class Nr {
|
|
|
3516
3515
|
if (!s.success)
|
|
3517
3516
|
return 400;
|
|
3518
3517
|
const l = J(r);
|
|
3519
|
-
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((x) => (console.error("%cstorage", _.STORAGE,
|
|
3518
|
+
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((x) => (console.error("%cstorage", _.STORAGE, N.CLOUD, r, x.message), 400));
|
|
3520
3519
|
});
|
|
3521
3520
|
/**
|
|
3522
3521
|
* Update Series
|
|
@@ -3528,7 +3527,7 @@ class Nr {
|
|
|
3528
3527
|
if (!s.success)
|
|
3529
3528
|
return 400;
|
|
3530
3529
|
const l = J(r);
|
|
3531
|
-
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((x) => (console.error("%cstorage", _.STORAGE,
|
|
3530
|
+
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((x) => (console.error("%cstorage", _.STORAGE, N.SERIES, r, x.message), 400));
|
|
3532
3531
|
});
|
|
3533
3532
|
/**
|
|
3534
3533
|
* Update Messages
|
|
@@ -3540,7 +3539,7 @@ class Nr {
|
|
|
3540
3539
|
if (!s.success)
|
|
3541
3540
|
return 400;
|
|
3542
3541
|
const l = J(r);
|
|
3543
|
-
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((x) => (console.error("%cstorage", _.STORAGE,
|
|
3542
|
+
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((x) => (console.error("%cstorage", _.STORAGE, N.MESSAGES, r, x.message), 400));
|
|
3544
3543
|
});
|
|
3545
3544
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0))));
|
|
3546
3545
|
k(this, "hideMessage", async (r, s) => {
|
|
@@ -3559,14 +3558,14 @@ class Nr {
|
|
|
3559
3558
|
dashboard_id: r.dashboard,
|
|
3560
3559
|
type: r.type
|
|
3561
3560
|
};
|
|
3562
|
-
return await wt(s, l).then(() => 201).catch((x) => (console.error("%cstorage", _.STORAGE,
|
|
3561
|
+
return await wt(s, l).then(() => 201).catch((x) => (console.error("%cstorage", _.STORAGE, N.WIDGET, r, x.message), 400));
|
|
3563
3562
|
});
|
|
3564
3563
|
/**
|
|
3565
3564
|
* Add component subscriber
|
|
3566
3565
|
* @param query IQuery
|
|
3567
3566
|
* @returns null
|
|
3568
3567
|
*/
|
|
3569
|
-
k(this, "subscribe", (r) => (r.type ===
|
|
3568
|
+
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = _t(this.options, r)), this.subscribers.filter(
|
|
3570
3569
|
(l) => l.widget === r.widget
|
|
3571
3570
|
).length > 0 || (console.debug(
|
|
3572
3571
|
"%cstorage%c %csubscribe",
|
|
@@ -3583,7 +3582,7 @@ class Nr {
|
|
|
3583
3582
|
k(this, "getSubscribers", async () => await new Promise((r) => r(this.subscribers)));
|
|
3584
3583
|
k(this, "loadSlide", async (r) => {
|
|
3585
3584
|
const s = J(r);
|
|
3586
|
-
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi", _.API,
|
|
3585
|
+
return await Vt(s).then((l) => l).catch(() => (console.warn("%capi", _.API, N.SLIDE, r.slide), { data: null, message: "Slide Load error", success: !1 }));
|
|
3587
3586
|
});
|
|
3588
3587
|
/**
|
|
3589
3588
|
* Update Slide
|
|
@@ -3598,7 +3597,7 @@ class Nr {
|
|
|
3598
3597
|
html: r.data.html || "",
|
|
3599
3598
|
css: r.data.css || ""
|
|
3600
3599
|
};
|
|
3601
|
-
return await wt(s, l).then(() => 201).catch((x) => (console.error("%cstorage", _.STORAGE,
|
|
3600
|
+
return await wt(s, l).then(() => 201).catch((x) => (console.error("%cstorage", _.STORAGE, N.SLIDE, r, x.message), 400));
|
|
3602
3601
|
});
|
|
3603
3602
|
this.options = r;
|
|
3604
3603
|
}
|
|
@@ -3612,7 +3611,7 @@ class Br {
|
|
|
3612
3611
|
try {
|
|
3613
3612
|
return localStorage.getObject(s);
|
|
3614
3613
|
} catch (l) {
|
|
3615
|
-
return console.warn("%capi", _.API,
|
|
3614
|
+
return console.warn("%capi", _.API, N.CLOUD, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3616
3615
|
}
|
|
3617
3616
|
});
|
|
3618
3617
|
k(this, "getSeries", async (r) => {
|
|
@@ -3620,7 +3619,7 @@ class Br {
|
|
|
3620
3619
|
try {
|
|
3621
3620
|
return localStorage.getObject(s);
|
|
3622
3621
|
} catch (l) {
|
|
3623
|
-
return console.warn("%capi", _.API,
|
|
3622
|
+
return console.warn("%capi", _.API, N.SERIES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3624
3623
|
}
|
|
3625
3624
|
});
|
|
3626
3625
|
k(this, "getMessages", async (r) => {
|
|
@@ -3628,7 +3627,7 @@ class Br {
|
|
|
3628
3627
|
try {
|
|
3629
3628
|
return localStorage.getObject(s);
|
|
3630
3629
|
} catch (l) {
|
|
3631
|
-
return console.warn("%capi", _.API,
|
|
3630
|
+
return console.warn("%capi", _.API, N.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3632
3631
|
}
|
|
3633
3632
|
});
|
|
3634
3633
|
/**
|
|
@@ -3642,7 +3641,7 @@ class Br {
|
|
|
3642
3641
|
try {
|
|
3643
3642
|
return localStorage.setObject(l, s), 201;
|
|
3644
3643
|
} catch (x) {
|
|
3645
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3644
|
+
return console.error("%cstorage", _.STORAGE, N.CLOUD, r, x), 400;
|
|
3646
3645
|
}
|
|
3647
3646
|
});
|
|
3648
3647
|
/**
|
|
@@ -3656,7 +3655,7 @@ class Br {
|
|
|
3656
3655
|
try {
|
|
3657
3656
|
return localStorage.setObject(l, s), 201;
|
|
3658
3657
|
} catch (x) {
|
|
3659
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3658
|
+
return console.error("%cstorage", _.STORAGE, N.SERIES, r, x), 400;
|
|
3660
3659
|
}
|
|
3661
3660
|
});
|
|
3662
3661
|
/**
|
|
@@ -3670,7 +3669,7 @@ class Br {
|
|
|
3670
3669
|
try {
|
|
3671
3670
|
return localStorage.setObject(l, s), 200;
|
|
3672
3671
|
} catch (x) {
|
|
3673
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3672
|
+
return console.error("%cstorage", _.STORAGE, N.MESSAGES, r, x), 400;
|
|
3674
3673
|
}
|
|
3675
3674
|
});
|
|
3676
3675
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0))));
|
|
@@ -3682,7 +3681,7 @@ class Br {
|
|
|
3682
3681
|
try {
|
|
3683
3682
|
return localStorage.setObject(s, r), 201;
|
|
3684
3683
|
} catch (l) {
|
|
3685
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3684
|
+
return console.error("%cstorage", _.STORAGE, N.WIDGET, r, l), 400;
|
|
3686
3685
|
}
|
|
3687
3686
|
});
|
|
3688
3687
|
/**
|
|
@@ -3690,7 +3689,7 @@ class Br {
|
|
|
3690
3689
|
* @param query IQuery
|
|
3691
3690
|
* @returns null
|
|
3692
3691
|
*/
|
|
3693
|
-
k(this, "subscribe", (r) => (r.type ===
|
|
3692
|
+
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = _t(this.options, r)), this.subscribers.filter(
|
|
3694
3693
|
(l) => l.widget === r.widget
|
|
3695
3694
|
).length || (console.debug(
|
|
3696
3695
|
"%cstorage%c %csubscribe",
|
|
@@ -3709,7 +3708,7 @@ class Br {
|
|
|
3709
3708
|
try {
|
|
3710
3709
|
return localStorage.getObject(`${r.type}.${r.id}`);
|
|
3711
3710
|
} catch (s) {
|
|
3712
|
-
return console.warn("%capi", _.API,
|
|
3711
|
+
return console.warn("%capi", _.API, N.SLIDE, r.id, s), { data: null, message: "Slide Load error", success: !1 };
|
|
3713
3712
|
}
|
|
3714
3713
|
});
|
|
3715
3714
|
k(this, "storeSlide", async (r) => {
|
|
@@ -3722,7 +3721,7 @@ class Br {
|
|
|
3722
3721
|
css: r.data.css || ""
|
|
3723
3722
|
}), 201;
|
|
3724
3723
|
} catch (s) {
|
|
3725
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3724
|
+
return console.error("%cstorage", _.STORAGE, N.SLIDE, r, s), 400;
|
|
3726
3725
|
}
|
|
3727
3726
|
});
|
|
3728
3727
|
this.options = r, Storage.prototype.setObject = function(s, l) {
|
|
@@ -3742,7 +3741,7 @@ class Lr {
|
|
|
3742
3741
|
try {
|
|
3743
3742
|
return sessionStorage.getObject(s);
|
|
3744
3743
|
} catch (l) {
|
|
3745
|
-
return console.warn("%capi", _.API,
|
|
3744
|
+
return console.warn("%capi", _.API, N.CLOUD, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3746
3745
|
}
|
|
3747
3746
|
});
|
|
3748
3747
|
k(this, "getSeries", async (r) => {
|
|
@@ -3750,7 +3749,7 @@ class Lr {
|
|
|
3750
3749
|
try {
|
|
3751
3750
|
return sessionStorage.getObject(s);
|
|
3752
3751
|
} catch (l) {
|
|
3753
|
-
return console.warn("%capi", _.API,
|
|
3752
|
+
return console.warn("%capi", _.API, N.SERIES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3754
3753
|
}
|
|
3755
3754
|
});
|
|
3756
3755
|
k(this, "getMessages", async (r) => {
|
|
@@ -3758,7 +3757,7 @@ class Lr {
|
|
|
3758
3757
|
try {
|
|
3759
3758
|
return sessionStorage.getObject(s);
|
|
3760
3759
|
} catch (l) {
|
|
3761
|
-
return console.warn("%capi", _.API,
|
|
3760
|
+
return console.warn("%capi", _.API, N.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3762
3761
|
}
|
|
3763
3762
|
});
|
|
3764
3763
|
/**
|
|
@@ -3772,7 +3771,7 @@ class Lr {
|
|
|
3772
3771
|
try {
|
|
3773
3772
|
return sessionStorage.setObject(l, s), 201;
|
|
3774
3773
|
} catch (x) {
|
|
3775
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3774
|
+
return console.error("%cstorage", _.STORAGE, N.CLOUD, r, x), 400;
|
|
3776
3775
|
}
|
|
3777
3776
|
});
|
|
3778
3777
|
/**
|
|
@@ -3786,7 +3785,7 @@ class Lr {
|
|
|
3786
3785
|
try {
|
|
3787
3786
|
return sessionStorage.setObject(l, s), 201;
|
|
3788
3787
|
} catch (x) {
|
|
3789
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3788
|
+
return console.error("%cstorage", _.STORAGE, N.SERIES, r, x), 400;
|
|
3790
3789
|
}
|
|
3791
3790
|
});
|
|
3792
3791
|
/**
|
|
@@ -3800,7 +3799,7 @@ class Lr {
|
|
|
3800
3799
|
try {
|
|
3801
3800
|
return sessionStorage.setObject(l, s), 200;
|
|
3802
3801
|
} catch (x) {
|
|
3803
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3802
|
+
return console.error("%cstorage", _.STORAGE, N.MESSAGES, r, x), 400;
|
|
3804
3803
|
}
|
|
3805
3804
|
});
|
|
3806
3805
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0))));
|
|
@@ -3812,7 +3811,7 @@ class Lr {
|
|
|
3812
3811
|
try {
|
|
3813
3812
|
return sessionStorage.setObject(s, r), 201;
|
|
3814
3813
|
} catch (l) {
|
|
3815
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3814
|
+
return console.error("%cstorage", _.STORAGE, N.WIDGET, r, l), 400;
|
|
3816
3815
|
}
|
|
3817
3816
|
});
|
|
3818
3817
|
/**
|
|
@@ -3820,7 +3819,7 @@ class Lr {
|
|
|
3820
3819
|
* @param query IQuery
|
|
3821
3820
|
* @returns null
|
|
3822
3821
|
*/
|
|
3823
|
-
k(this, "subscribe", (r) => (r.type ===
|
|
3822
|
+
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = _t(this.options, r)), this.subscribers.filter(
|
|
3824
3823
|
(l) => l.widget === r.widget
|
|
3825
3824
|
).length || (console.debug(
|
|
3826
3825
|
"%cstorage%c %csubscribe",
|
|
@@ -3839,7 +3838,7 @@ class Lr {
|
|
|
3839
3838
|
try {
|
|
3840
3839
|
return sessionStorage.getObject(`${r.type}.${r.id}`);
|
|
3841
3840
|
} catch (s) {
|
|
3842
|
-
return console.warn("%capi", _.API,
|
|
3841
|
+
return console.warn("%capi", _.API, N.SLIDE, r.id, s), { data: null, message: "Store Load error", success: !1 };
|
|
3843
3842
|
}
|
|
3844
3843
|
});
|
|
3845
3844
|
/**
|
|
@@ -3857,7 +3856,7 @@ class Lr {
|
|
|
3857
3856
|
css: r.data.css || ""
|
|
3858
3857
|
}), 200;
|
|
3859
3858
|
} catch (s) {
|
|
3860
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3859
|
+
return console.error("%cstorage", _.STORAGE, N.SLIDE, r, s), 400;
|
|
3861
3860
|
}
|
|
3862
3861
|
});
|
|
3863
3862
|
this.options = r, Storage.prototype.setObject = function(s, l) {
|
|
@@ -3877,7 +3876,7 @@ class Gr {
|
|
|
3877
3876
|
try {
|
|
3878
3877
|
return window.BuzzCasting.WidgetData[s];
|
|
3879
3878
|
} catch (l) {
|
|
3880
|
-
return console.warn("%capi", _.API,
|
|
3879
|
+
return console.warn("%capi", _.API, N.CLOUD, r.slide, r.widget, l), { data: null, message: "Cloud Data error", success: !1 };
|
|
3881
3880
|
}
|
|
3882
3881
|
});
|
|
3883
3882
|
k(this, "getSeries", async (r) => {
|
|
@@ -3885,7 +3884,7 @@ class Gr {
|
|
|
3885
3884
|
try {
|
|
3886
3885
|
return window.BuzzCasting.WidgetData[s];
|
|
3887
3886
|
} catch (l) {
|
|
3888
|
-
return console.warn("%capi", _.API,
|
|
3887
|
+
return console.warn("%capi", _.API, N.SERIES, r.slide, r.widget, l), { data: null, message: "Series Data error", success: !1 };
|
|
3889
3888
|
}
|
|
3890
3889
|
});
|
|
3891
3890
|
k(this, "getMessages", async (r) => {
|
|
@@ -3893,7 +3892,7 @@ class Gr {
|
|
|
3893
3892
|
try {
|
|
3894
3893
|
return window.BuzzCasting.WidgetData[s];
|
|
3895
3894
|
} catch (l) {
|
|
3896
|
-
return console.warn("%capi", _.API,
|
|
3895
|
+
return console.warn("%capi", _.API, N.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3897
3896
|
}
|
|
3898
3897
|
});
|
|
3899
3898
|
/**
|
|
@@ -3947,7 +3946,7 @@ class Gr {
|
|
|
3947
3946
|
try {
|
|
3948
3947
|
return window.BuzzCasting.WidgetData[s] = r, 201;
|
|
3949
3948
|
} catch (l) {
|
|
3950
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3949
|
+
return console.error("%cstorage", _.STORAGE, N.WIDGET, r, l), 400;
|
|
3951
3950
|
}
|
|
3952
3951
|
});
|
|
3953
3952
|
/**
|
|
@@ -3955,7 +3954,7 @@ class Gr {
|
|
|
3955
3954
|
* @param query IQuery
|
|
3956
3955
|
* @returns null
|
|
3957
3956
|
*/
|
|
3958
|
-
k(this, "subscribe", (r) => (r.type ===
|
|
3957
|
+
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = _t(this.options, r)), this.subscribers.filter(
|
|
3959
3958
|
(l) => l.widget === r.widget
|
|
3960
3959
|
).length || (console.debug(
|
|
3961
3960
|
"%cstorage%c %csubscribe",
|
|
@@ -3974,7 +3973,7 @@ class Gr {
|
|
|
3974
3973
|
try {
|
|
3975
3974
|
return window.BuzzCasting.SlideData[r.id];
|
|
3976
3975
|
} catch (s) {
|
|
3977
|
-
return console.warn("%capi", _.API,
|
|
3976
|
+
return console.warn("%capi", _.API, N.SLIDE, r.id, s), { data: null, message: "Slide Load error", success: !1 };
|
|
3978
3977
|
}
|
|
3979
3978
|
});
|
|
3980
3979
|
k(this, "storeSlide", async (r) => {
|
|
@@ -3987,7 +3986,7 @@ class Gr {
|
|
|
3987
3986
|
css: r.data.css || ""
|
|
3988
3987
|
}, 201;
|
|
3989
3988
|
} catch (s) {
|
|
3990
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3989
|
+
return console.error("%cstorage", _.STORAGE, N.SLIDE, r, s), 400;
|
|
3991
3990
|
}
|
|
3992
3991
|
});
|
|
3993
3992
|
this.options = r, window.BuzzCasting.WidgetData = /* @__PURE__ */ new Set();
|
|
@@ -4189,8 +4188,8 @@ function Ji(d) {
|
|
|
4189
4188
|
function Vi(d) {
|
|
4190
4189
|
const r = window.BuzzCasting.getOptions().suspended ?? !1;
|
|
4191
4190
|
return d.forEach((s) => {
|
|
4192
|
-
var l, x, D, T,
|
|
4193
|
-
if (r ? s.content = "License suspended, please contact your Sales Representative to restore service" : s.content = ((l = s.content) == null ? void 0 : l.replace(/(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)((\?.*)?)/g, "")) || "", s.sender !== null ? ((((x = s.sender) == null ? void 0 : x.title) === "Unknown author" || ((D = s.sender) == null ? void 0 : D.title) === null) && (s.sender.title = ""), ((T = s.sender) == null ? void 0 : T.name) !== "" && s.sender.title === "" && (s.sender.title = s.sender.name), ((
|
|
4191
|
+
var l, x, D, T, j;
|
|
4192
|
+
if (r ? s.content = "License suspended, please contact your Sales Representative to restore service" : s.content = ((l = s.content) == null ? void 0 : l.replace(/(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)((\?.*)?)/g, "")) || "", s.sender !== null ? ((((x = s.sender) == null ? void 0 : x.title) === "Unknown author" || ((D = s.sender) == null ? void 0 : D.title) === null) && (s.sender.title = ""), ((T = s.sender) == null ? void 0 : T.name) !== "" && s.sender.title === "" && (s.sender.title = s.sender.name), ((j = s.sender) == null ? void 0 : j.name) !== "" && s.channel === "tw" && (s.sender.name = `@${s.sender.name}`)) : s.sender = { title: "", name: "", id: "", avatar: "default", bio: "", location: "", following: 0, verified: 0, listed: 0, followers: 0, favourites: 0, messages: 0, influence: 0 }, s.sender.title === "" && s.link !== "") {
|
|
4194
4193
|
const Q = new URL(s.link);
|
|
4195
4194
|
s.sender.title = Q.hostname.replace("www.", "");
|
|
4196
4195
|
}
|
|
@@ -4248,51 +4247,51 @@ class ro {
|
|
|
4248
4247
|
(x) => x.forEach(async (D) => {
|
|
4249
4248
|
let T = 400;
|
|
4250
4249
|
if (D.status === "fulfilled") {
|
|
4251
|
-
let
|
|
4250
|
+
let j = D.value;
|
|
4252
4251
|
if (this.sm === null)
|
|
4253
4252
|
return 400;
|
|
4254
|
-
if (
|
|
4253
|
+
if (j.success === !0) {
|
|
4255
4254
|
const Q = this.sm.subscribers.filter(
|
|
4256
|
-
(q) => q.widget ===
|
|
4255
|
+
(q) => q.widget === j.query.widget
|
|
4257
4256
|
)[0];
|
|
4258
4257
|
let V = "", ve;
|
|
4259
|
-
switch (
|
|
4260
|
-
case
|
|
4261
|
-
if (ve =
|
|
4258
|
+
switch (j.query.type) {
|
|
4259
|
+
case N.MESSAGES:
|
|
4260
|
+
if (ve = j.data.messages.filter(
|
|
4262
4261
|
(q) => q.id !== null
|
|
4263
|
-
),
|
|
4262
|
+
), j.data.messages = ve, V = Fn(j.data.messages), Q.hash === V)
|
|
4264
4263
|
return console.debug(
|
|
4265
4264
|
"%capi%c %cno updates",
|
|
4266
4265
|
_.API,
|
|
4267
4266
|
_.NONE,
|
|
4268
4267
|
_.NO_UPDATES,
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4268
|
+
N.MESSAGES,
|
|
4269
|
+
j.query.slide,
|
|
4270
|
+
j.query.widget
|
|
4272
4271
|
), 204;
|
|
4273
|
-
Q.hash = V, T = await this.sm.setMessages(
|
|
4272
|
+
Q.hash = V, T = await this.sm.setMessages(j.query, j);
|
|
4274
4273
|
break;
|
|
4275
|
-
case
|
|
4276
|
-
V = Fn(
|
|
4274
|
+
case N.CLOUD:
|
|
4275
|
+
V = Fn(j.data), Q.hash === V ? (console.debug(
|
|
4277
4276
|
"%capi%c %cno updates",
|
|
4278
4277
|
_.API,
|
|
4279
4278
|
_.NONE,
|
|
4280
4279
|
_.NO_UPDATES,
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
), T = 204) : (Q.hash = V, T = await this.sm.setCloud(
|
|
4280
|
+
N.CLOUD,
|
|
4281
|
+
j.query.slide,
|
|
4282
|
+
j.query.widget
|
|
4283
|
+
), T = 204) : (Q.hash = V, T = await this.sm.setCloud(j.query, j));
|
|
4285
4284
|
break;
|
|
4286
|
-
case
|
|
4287
|
-
V = Fn(
|
|
4285
|
+
case N.SERIES:
|
|
4286
|
+
V = Fn(j.data), Q.hash === V ? (console.debug(
|
|
4288
4287
|
"%capi%c %cno updates",
|
|
4289
4288
|
_.API,
|
|
4290
4289
|
_.NONE,
|
|
4291
4290
|
_.NO_UPDATES,
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
), T = 204) : (Q.hash = V, T = await this.sm.setSeries(
|
|
4291
|
+
N.SERIES,
|
|
4292
|
+
j.query.slide,
|
|
4293
|
+
j.query.widget
|
|
4294
|
+
), T = 204) : (Q.hash = V, T = await this.sm.setSeries(j.query, j));
|
|
4296
4295
|
break;
|
|
4297
4296
|
default:
|
|
4298
4297
|
console.warn(
|
|
@@ -4301,30 +4300,54 @@ class ro {
|
|
|
4301
4300
|
_.NONE,
|
|
4302
4301
|
_.STORAGE,
|
|
4303
4302
|
"error",
|
|
4304
|
-
`data type ${
|
|
4303
|
+
`data type ${j.query.type} unknown`
|
|
4305
4304
|
);
|
|
4306
4305
|
}
|
|
4307
4306
|
} else
|
|
4308
4307
|
T = 401;
|
|
4309
4308
|
switch (T) {
|
|
4310
4309
|
case 201:
|
|
4311
|
-
console.info(
|
|
4310
|
+
switch (console.info(
|
|
4312
4311
|
"%capp%c %cbroadcast",
|
|
4313
4312
|
_.API,
|
|
4314
4313
|
_.NONE,
|
|
4315
4314
|
_.BROADCAST,
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
),
|
|
4315
|
+
j.query.slide,
|
|
4316
|
+
j.data.title ?? j.query.widget
|
|
4317
|
+
), j.query.type) {
|
|
4318
|
+
case "messages":
|
|
4319
|
+
j = await this.sm.getMessages(j.query);
|
|
4320
|
+
break;
|
|
4321
|
+
case "cloud":
|
|
4322
|
+
j = await this.sm.getCloud(j.query);
|
|
4323
|
+
break;
|
|
4324
|
+
case "series":
|
|
4325
|
+
j = await this.sm.getSeries(j.query);
|
|
4326
|
+
break;
|
|
4327
|
+
default:
|
|
4328
|
+
console.warn(
|
|
4329
|
+
"%capp%c %cbroadcast",
|
|
4330
|
+
_.API,
|
|
4331
|
+
_.NONE,
|
|
4332
|
+
_.BROADCAST,
|
|
4333
|
+
"Unhandled data type",
|
|
4334
|
+
j.query
|
|
4335
|
+
);
|
|
4336
|
+
}
|
|
4337
|
+
j && this.bc.postMessage({
|
|
4338
|
+
event: re.WIDGET_UPDATE,
|
|
4339
|
+
data: j.data
|
|
4340
|
+
});
|
|
4319
4341
|
break;
|
|
4320
|
-
|
|
4342
|
+
default:
|
|
4321
4343
|
console.warn(
|
|
4322
4344
|
"%capp%c %cbroadcast",
|
|
4323
4345
|
_.API,
|
|
4324
4346
|
_.NONE,
|
|
4325
4347
|
_.BROADCAST,
|
|
4326
|
-
|
|
4327
|
-
|
|
4348
|
+
"Fetch error",
|
|
4349
|
+
j.query.slide,
|
|
4350
|
+
j.data.title ?? j.query.widget
|
|
4328
4351
|
);
|
|
4329
4352
|
break;
|
|
4330
4353
|
}
|
|
@@ -4455,7 +4478,7 @@ class Bi {
|
|
|
4455
4478
|
*/
|
|
4456
4479
|
k(this, "getCloud", async (r) => {
|
|
4457
4480
|
var s;
|
|
4458
|
-
return r.type !==
|
|
4481
|
+
return r.type !== N.CLOUD ? (console.warn(
|
|
4459
4482
|
"%capp%c %get",
|
|
4460
4483
|
_.APP,
|
|
4461
4484
|
_.NONE,
|
|
@@ -4476,7 +4499,7 @@ class Bi {
|
|
|
4476
4499
|
*/
|
|
4477
4500
|
k(this, "getMessages", async (r) => {
|
|
4478
4501
|
var s;
|
|
4479
|
-
return r.type !==
|
|
4502
|
+
return r.type !== N.MESSAGES ? (console.warn(
|
|
4480
4503
|
"%capp%c %get",
|
|
4481
4504
|
_.APP,
|
|
4482
4505
|
_.NONE,
|
|
@@ -4497,7 +4520,7 @@ class Bi {
|
|
|
4497
4520
|
*/
|
|
4498
4521
|
k(this, "getSeries", async (r) => {
|
|
4499
4522
|
var s;
|
|
4500
|
-
return r.type !==
|
|
4523
|
+
return r.type !== N.SERIES ? (console.warn(
|
|
4501
4524
|
"%capp%c %get",
|
|
4502
4525
|
_.APP,
|
|
4503
4526
|
_.NONE,
|
|
@@ -4551,11 +4574,11 @@ class io {
|
|
|
4551
4574
|
*/
|
|
4552
4575
|
k(this, "getData", async () => {
|
|
4553
4576
|
switch (this.query.type) {
|
|
4554
|
-
case
|
|
4577
|
+
case N.CLOUD:
|
|
4555
4578
|
return await this.getCloud();
|
|
4556
|
-
case
|
|
4579
|
+
case N.MESSAGES:
|
|
4557
4580
|
return await this.getMessages();
|
|
4558
|
-
case
|
|
4581
|
+
case N.SERIES:
|
|
4559
4582
|
return await this.getSeries();
|
|
4560
4583
|
}
|
|
4561
4584
|
return {
|
|
@@ -4569,7 +4592,7 @@ class io {
|
|
|
4569
4592
|
*
|
|
4570
4593
|
* @returns IResponse
|
|
4571
4594
|
*/
|
|
4572
|
-
k(this, "getCloud", async () => this.query.type !==
|
|
4595
|
+
k(this, "getCloud", async () => this.query.type !== N.CLOUD ? (console.warn(
|
|
4573
4596
|
"%cstorage%c %cwidget",
|
|
4574
4597
|
_.STORAGE,
|
|
4575
4598
|
_.NONE,
|
|
@@ -4587,7 +4610,7 @@ class io {
|
|
|
4587
4610
|
*
|
|
4588
4611
|
* @returns IResponse
|
|
4589
4612
|
*/
|
|
4590
|
-
k(this, "getMessages", async () => this.query.type !==
|
|
4613
|
+
k(this, "getMessages", async () => this.query.type !== N.MESSAGES ? (console.warn(
|
|
4591
4614
|
"%cstorage%c %cwidget",
|
|
4592
4615
|
_.STORAGE,
|
|
4593
4616
|
_.NONE,
|
|
@@ -4611,7 +4634,7 @@ class io {
|
|
|
4611
4634
|
*
|
|
4612
4635
|
* @returns IResponse
|
|
4613
4636
|
*/
|
|
4614
|
-
k(this, "getSeries", async () => this.query.type !==
|
|
4637
|
+
k(this, "getSeries", async () => this.query.type !== N.SERIES ? (console.warn(
|
|
4615
4638
|
"%cstorage%c %cwidget",
|
|
4616
4639
|
_.STORAGE,
|
|
4617
4640
|
_.NONE,
|
|
@@ -4704,7 +4727,7 @@ class io {
|
|
|
4704
4727
|
}
|
|
4705
4728
|
}
|
|
4706
4729
|
export {
|
|
4707
|
-
|
|
4730
|
+
N as API,
|
|
4708
4731
|
ro as BuzzcastingStorageManager,
|
|
4709
4732
|
Bi as BuzzcastingStorageReader,
|
|
4710
4733
|
_ as CSS,
|