buzzcasting-storage 3.1.3 → 3.1.5
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.d.ts +0 -3
- package/dist/buzzcasting-storage.esm.js +777 -791
- package/package.json +5 -5
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var k = (
|
|
4
|
-
var N = /* @__PURE__ */ ((
|
|
5
|
-
const ka = "3.1.
|
|
1
|
+
var xa = Object.defineProperty;
|
|
2
|
+
var Aa = (d, r, o) => r in d ? xa(d, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : d[r] = o;
|
|
3
|
+
var k = (d, r, o) => Aa(d, typeof r != "symbol" ? r + "" : r, o);
|
|
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 || {}), m = /* @__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))(m || {}), 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.MAUPPUT_UPDATE = "layoutUpdate", 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 || {}), ye = /* @__PURE__ */ ((d) => (d.KEYVAL = "keyval", d.LOCAL = "local", d.SESSION = "session", d.DEXIE = "dexie", d.WINDOW = "window", d))(ye || {});
|
|
5
|
+
const ka = "3.1.4";
|
|
6
6
|
class Da {
|
|
7
7
|
constructor(r) {
|
|
8
8
|
k(this, "options");
|
|
@@ -32,18 +32,18 @@ class Da {
|
|
|
32
32
|
this.options = r, this.url = `https://${r.app}.buzzcasting.net`;
|
|
33
33
|
}
|
|
34
34
|
async get(r) {
|
|
35
|
-
const { version: o } = this.options,
|
|
36
|
-
delete
|
|
37
|
-
const D = Object.keys(
|
|
35
|
+
const { version: o } = this.options, l = this.headers(), x = Object.assign({}, r);
|
|
36
|
+
delete x.slide, delete x.type, delete x.hash, delete x.order, delete x.period;
|
|
37
|
+
const D = Object.keys(x).length > 0 ? `?${new URLSearchParams(x).toString()}` : "";
|
|
38
38
|
return console.info(
|
|
39
39
|
"%capi%c %cfetch",
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
m.API,
|
|
41
|
+
m.NONE,
|
|
42
|
+
m.GET_DATA,
|
|
43
43
|
r.widget
|
|
44
|
-
), console.debug("%capi%c %cfetch",
|
|
44
|
+
), console.debug("%capi%c %cfetch", m.API, m.NONE, m.GET_DATA, x), await fetch(
|
|
45
45
|
[this.url, "api", o, r.type].join("/") + D,
|
|
46
|
-
{ ...
|
|
46
|
+
{ ...l, method: "get" }
|
|
47
47
|
).then(async (K) => {
|
|
48
48
|
if (!K.ok)
|
|
49
49
|
throw new Error(`${K.status}`);
|
|
@@ -51,25 +51,18 @@ class Da {
|
|
|
51
51
|
}).then((K) => K.json()).then((K) => (K.query = r, K)).catch((K) => ({ success: !1, message: `${K}`, data: null }));
|
|
52
52
|
}
|
|
53
53
|
async hideMessage(r) {
|
|
54
|
-
const { version: o } = this.options,
|
|
54
|
+
const { version: o } = this.options, l = this.headers(), x = "?action=visible";
|
|
55
55
|
return console.info(
|
|
56
56
|
"%capi%c %cput",
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
m.API,
|
|
58
|
+
m.NONE,
|
|
59
|
+
m.GET_DATA,
|
|
60
60
|
re.HIDE_MESSAGE,
|
|
61
61
|
r.widget,
|
|
62
62
|
r.id
|
|
63
|
-
), console.debug(
|
|
64
|
-
"%capi%c %cput",
|
|
65
|
-
g.API,
|
|
66
|
-
g.NONE,
|
|
67
|
-
g.GET_DATA,
|
|
68
|
-
re.HIDE_MESSAGE,
|
|
69
|
-
r
|
|
70
63
|
), await fetch(
|
|
71
|
-
[this.url, "api", o, "messages", r.id].join("/") +
|
|
72
|
-
{ ...
|
|
64
|
+
[this.url, "api", o, "messages", r.id].join("/") + x,
|
|
65
|
+
{ ...l, method: "put" }
|
|
73
66
|
).then((D) => {
|
|
74
67
|
if (!D.ok)
|
|
75
68
|
throw new Error(D.statusText);
|
|
@@ -77,20 +70,20 @@ class Da {
|
|
|
77
70
|
}).then((D) => D.json()).catch((D) => ({ succes: !1, message: D, data: [] }));
|
|
78
71
|
}
|
|
79
72
|
async hideLabels(r) {
|
|
80
|
-
const { version: o } = this.options,
|
|
73
|
+
const { version: o } = this.options, l = this.formHeaders(), x = new URLSearchParams(), D = r.labels || [];
|
|
81
74
|
for (const [K, U] of D.entries())
|
|
82
|
-
|
|
75
|
+
x.append(`custom_filters[${K}]`, U);
|
|
83
76
|
return console.info(
|
|
84
77
|
"%capi%c %cput",
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
78
|
+
m.API,
|
|
79
|
+
m.NONE,
|
|
80
|
+
m.GET_DATA,
|
|
88
81
|
re.HIDE_LABELS,
|
|
89
82
|
r.widget,
|
|
90
83
|
D
|
|
91
84
|
), await fetch(
|
|
92
85
|
[this.url, "api", o, r.type, r.widget].join("/"),
|
|
93
|
-
{ ...
|
|
86
|
+
{ ...l, body: x, method: "put" }
|
|
94
87
|
).then((K) => {
|
|
95
88
|
if (!K.ok)
|
|
96
89
|
throw new Error(K.statusText);
|
|
@@ -98,17 +91,17 @@ class Da {
|
|
|
98
91
|
}).then((K) => K.json()).catch((K) => ({ succes: !1, message: K, data: [] }));
|
|
99
92
|
}
|
|
100
93
|
async loadSlide(r) {
|
|
101
|
-
const { version: o } = this.options,
|
|
102
|
-
return delete
|
|
94
|
+
const { version: o } = this.options, l = this.headers(), x = Object.assign({}, r);
|
|
95
|
+
return delete x.slide, delete x.type, delete x.hash, console.debug(
|
|
103
96
|
"%capi%c %cloadSlide",
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
97
|
+
m.API,
|
|
98
|
+
m.NONE,
|
|
99
|
+
m.SLIDE,
|
|
107
100
|
re.SLIDE_LOAD,
|
|
108
101
|
r.slide
|
|
109
102
|
), await fetch(
|
|
110
103
|
[this.url, "api", o, "slides", r.id].join("/"),
|
|
111
|
-
{ ...
|
|
104
|
+
{ ...l, method: "get" }
|
|
112
105
|
).then(async (D) => {
|
|
113
106
|
if (!D.ok)
|
|
114
107
|
throw new Error(`${D.status}`);
|
|
@@ -123,26 +116,19 @@ class Da {
|
|
|
123
116
|
* @returns
|
|
124
117
|
*/
|
|
125
118
|
async storeSlide(r) {
|
|
126
|
-
const { version: o } = this.options,
|
|
119
|
+
const { version: o } = this.options, l = this.formHeaders();
|
|
127
120
|
delete r.update, delete r.type;
|
|
128
|
-
const
|
|
121
|
+
const x = JSON.stringify(r);
|
|
129
122
|
return console.info(
|
|
130
123
|
"%capi%c %cput",
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
124
|
+
m.API,
|
|
125
|
+
m.NONE,
|
|
126
|
+
m.SLIDE,
|
|
134
127
|
re.SLIDE_STORE,
|
|
135
128
|
r.id
|
|
136
|
-
), console.debug(
|
|
137
|
-
"%capi%c %cput",
|
|
138
|
-
g.API,
|
|
139
|
-
g.NONE,
|
|
140
|
-
g.SLIDE,
|
|
141
|
-
re.SLIDE_STORE,
|
|
142
|
-
r
|
|
143
129
|
), await fetch(
|
|
144
130
|
[this.url, "api", o, "slides", r.id].join("/"),
|
|
145
|
-
{ ...
|
|
131
|
+
{ ...l, body: x, method: "put" }
|
|
146
132
|
).then((D) => {
|
|
147
133
|
if (!D.ok)
|
|
148
134
|
throw new Error(D.statusText);
|
|
@@ -151,14 +137,14 @@ class Da {
|
|
|
151
137
|
}
|
|
152
138
|
}
|
|
153
139
|
var Pa = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
154
|
-
function Ia(
|
|
155
|
-
return
|
|
140
|
+
function Ia(d) {
|
|
141
|
+
return d && d.__esModule && Object.prototype.hasOwnProperty.call(d, "default") ? d.default : d;
|
|
156
142
|
}
|
|
157
143
|
var qt = { exports: {} }, Ca = qt.exports, Rr;
|
|
158
144
|
function Ra() {
|
|
159
|
-
return Rr || (Rr = 1, function(
|
|
160
|
-
(function(o,
|
|
161
|
-
|
|
145
|
+
return Rr || (Rr = 1, function(d, r) {
|
|
146
|
+
(function(o, l) {
|
|
147
|
+
d.exports = l();
|
|
162
148
|
})(Ca, function() {
|
|
163
149
|
var o = function(e, t) {
|
|
164
150
|
return (o = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, a) {
|
|
@@ -166,13 +152,13 @@ function Ra() {
|
|
|
166
152
|
} || function(n, a) {
|
|
167
153
|
for (var i in a) Object.prototype.hasOwnProperty.call(a, i) && (n[i] = a[i]);
|
|
168
154
|
})(e, t);
|
|
169
|
-
},
|
|
170
|
-
return (
|
|
155
|
+
}, l = function() {
|
|
156
|
+
return (l = Object.assign || function(e) {
|
|
171
157
|
for (var t, n = 1, a = arguments.length; n < a; n++) for (var i in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
172
158
|
return e;
|
|
173
159
|
}).apply(this, arguments);
|
|
174
160
|
};
|
|
175
|
-
function
|
|
161
|
+
function x(e, t, n) {
|
|
176
162
|
for (var a, i = 0, s = t.length; i < s; i++) !a && i in t || ((a = a || Array.prototype.slice.call(t, 0, i))[i] = t[i]);
|
|
177
163
|
return e.concat(a || Array.prototype.slice.call(t));
|
|
178
164
|
}
|
|
@@ -189,16 +175,16 @@ function Ra() {
|
|
|
189
175
|
}
|
|
190
176
|
function le(e, t) {
|
|
191
177
|
typeof t == "function" && (t = t(X(e))), (typeof Reflect > "u" ? K : Reflect.ownKeys)(t).forEach(function(n) {
|
|
192
|
-
|
|
178
|
+
xe(e, n, t[n]);
|
|
193
179
|
});
|
|
194
180
|
}
|
|
195
181
|
var He = Object.defineProperty;
|
|
196
|
-
function
|
|
182
|
+
function xe(e, t, n, a) {
|
|
197
183
|
He(e, t, M(n && ee(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, a));
|
|
198
184
|
}
|
|
199
185
|
function Ye(e) {
|
|
200
186
|
return { from: function(t) {
|
|
201
|
-
return e.prototype = Object.create(t.prototype),
|
|
187
|
+
return e.prototype = Object.create(t.prototype), xe(e.prototype, "constructor", e), { extend: le.bind(null, e.prototype) };
|
|
202
188
|
} };
|
|
203
189
|
}
|
|
204
190
|
var Ur = Object.getOwnPropertyDescriptor, Fr = [].slice;
|
|
@@ -415,8 +401,8 @@ function Ra() {
|
|
|
415
401
|
var t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
416
402
|
return [t, X(t), e];
|
|
417
403
|
}(), ut = Ne[0], ge = Ne[1], Ne = Ne[2], ge = ge && ge.then, Ke = ut && ut.constructor, on = !!Ne, ct = function(e, t) {
|
|
418
|
-
lt.push([e, t]),
|
|
419
|
-
}, un = !0,
|
|
404
|
+
lt.push([e, t]), xt && (queueMicrotask(ta), xt = !1);
|
|
405
|
+
}, un = !0, xt = !0, Be = [], At = [], cn = st, Ae = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: J, pgp: !1, env: {}, finalize: J }, G = Ae, lt = [], Le = 0, kt = [];
|
|
420
406
|
function B(e) {
|
|
421
407
|
if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
|
|
422
408
|
this._listeners = [], this._lib = !1;
|
|
@@ -444,14 +430,14 @@ function Ra() {
|
|
|
444
430
|
var ln = { get: function() {
|
|
445
431
|
var e = G, t = Ct;
|
|
446
432
|
function n(a, i) {
|
|
447
|
-
var s = this, u = !e.global && (e !== G || t !== Ct), c = u && !De(), h = new B(function(
|
|
448
|
-
fn(s, new tr(ar(a, e, u, c), ar(i, e, u, c),
|
|
433
|
+
var s = this, u = !e.global && (e !== G || t !== Ct), c = u && !De(), h = new B(function(g, v) {
|
|
434
|
+
fn(s, new tr(ar(a, e, u, c), ar(i, e, u, c), g, v, e));
|
|
449
435
|
});
|
|
450
436
|
return this._consoleTask && (h._consoleTask = this._consoleTask), h;
|
|
451
437
|
}
|
|
452
438
|
return n.prototype = ot, n;
|
|
453
439
|
}, set: function(e) {
|
|
454
|
-
|
|
440
|
+
xe(this, "then", e && e.prototype === ot ? ln : { get: function() {
|
|
455
441
|
return e;
|
|
456
442
|
}, set: ln.set });
|
|
457
443
|
} };
|
|
@@ -460,7 +446,7 @@ function Ra() {
|
|
|
460
446
|
}
|
|
461
447
|
function dn(e, t) {
|
|
462
448
|
var n, a;
|
|
463
|
-
|
|
449
|
+
At.push(t), e._state === null && (n = e._lib && Ve(), t = cn(t), e._state = !1, e._value = t, a = e, Be.some(function(i) {
|
|
464
450
|
return i._value === a._value;
|
|
465
451
|
}) || Be.push(a), nr(e), n && Ze());
|
|
466
452
|
}
|
|
@@ -483,9 +469,9 @@ function Ra() {
|
|
|
483
469
|
function ea(e, t, n) {
|
|
484
470
|
try {
|
|
485
471
|
var a, i = t._value;
|
|
486
|
-
!t._state &&
|
|
472
|
+
!t._state && At.length && (At = []), a = me && t._consoleTask ? t._consoleTask.run(function() {
|
|
487
473
|
return e(i);
|
|
488
|
-
}) : e(i), t._state ||
|
|
474
|
+
}) : e(i), t._state || At.indexOf(i) !== -1 || function(s) {
|
|
489
475
|
for (var u = Be.length; u; ) if (Be[--u]._value === s._value) return Be.splice(u, 1);
|
|
490
476
|
}(t), n.resolve(a);
|
|
491
477
|
} catch (s) {
|
|
@@ -495,13 +481,13 @@ function Ra() {
|
|
|
495
481
|
}
|
|
496
482
|
}
|
|
497
483
|
function ta() {
|
|
498
|
-
Ge(
|
|
484
|
+
Ge(Ae, function() {
|
|
499
485
|
Ve() && Ze();
|
|
500
486
|
});
|
|
501
487
|
}
|
|
502
488
|
function Ve() {
|
|
503
489
|
var e = un;
|
|
504
|
-
return
|
|
490
|
+
return xt = un = !1, e;
|
|
505
491
|
}
|
|
506
492
|
function Ze() {
|
|
507
493
|
var e, t, n;
|
|
@@ -511,7 +497,7 @@ function Ra() {
|
|
|
511
497
|
a[0].apply(null, a[1]);
|
|
512
498
|
}
|
|
513
499
|
while (0 < lt.length);
|
|
514
|
-
|
|
500
|
+
xt = un = !0;
|
|
515
501
|
}
|
|
516
502
|
function hn() {
|
|
517
503
|
var e = Be;
|
|
@@ -564,7 +550,7 @@ function Ra() {
|
|
|
564
550
|
}, e);
|
|
565
551
|
n.then(a, i).finally(clearTimeout.bind(null, s));
|
|
566
552
|
}) : this;
|
|
567
|
-
} }), typeof Symbol < "u" && Symbol.toStringTag &&
|
|
553
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && xe(B.prototype, Symbol.toStringTag, "Dexie.Promise"), Ae.env = rr(), le(B, { all: function() {
|
|
568
554
|
var e = Se.apply(null, arguments).map(Rt);
|
|
569
555
|
return new B(function(t, n) {
|
|
570
556
|
e.length === 0 && t([]);
|
|
@@ -608,15 +594,15 @@ function Ra() {
|
|
|
608
594
|
var c, h = this;
|
|
609
595
|
c = function() {
|
|
610
596
|
h.unhandleds.length === 0 ? i() : s(h.unhandleds[0]);
|
|
611
|
-
}, kt.push(function
|
|
612
|
-
c(), kt.splice(kt.indexOf(
|
|
597
|
+
}, kt.push(function g() {
|
|
598
|
+
c(), kt.splice(kt.indexOf(g), 1);
|
|
613
599
|
}), ++Le, ct(function() {
|
|
614
600
|
--Le == 0 && hn();
|
|
615
601
|
}, []);
|
|
616
602
|
}, u.finalize), e();
|
|
617
603
|
}, t, n, a);
|
|
618
604
|
});
|
|
619
|
-
} }), Ke && (Ke.allSettled &&
|
|
605
|
+
} }), Ke && (Ke.allSettled && xe(B, "allSettled", function() {
|
|
620
606
|
var e = Se.apply(null, arguments).map(Rt);
|
|
621
607
|
return new B(function(t) {
|
|
622
608
|
e.length === 0 && t([]);
|
|
@@ -631,7 +617,7 @@ function Ra() {
|
|
|
631
617
|
});
|
|
632
618
|
});
|
|
633
619
|
});
|
|
634
|
-
}), Ke.any && typeof AggregateError < "u" &&
|
|
620
|
+
}), Ke.any && typeof AggregateError < "u" && xe(B, "any", function() {
|
|
635
621
|
var e = Se.apply(null, arguments).map(Rt);
|
|
636
622
|
return new B(function(t, n) {
|
|
637
623
|
e.length === 0 && n(new AggregateError([]));
|
|
@@ -648,7 +634,7 @@ function Ra() {
|
|
|
648
634
|
var ae = { awaits: 0, echoes: 0, id: 0 }, na = 0, Pt = [], It = 0, Ct = 0, ra = 0;
|
|
649
635
|
function ke(e, t, n, a) {
|
|
650
636
|
var i = G, s = Object.create(i);
|
|
651
|
-
return s.parent = i, s.ref = 0, s.global = !1, s.id = ++ra,
|
|
637
|
+
return s.parent = i, s.ref = 0, s.global = !1, s.id = ++ra, Ae.env, s.env = on ? { 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 && M(s, t), ++i.ref, s.finalize = function() {
|
|
652
638
|
--this.parent.ref || this.parent.finalize();
|
|
653
639
|
}, a = Ge(s, e, n, a), s.ref === 0 && s.finalize(), a;
|
|
654
640
|
}
|
|
@@ -673,7 +659,7 @@ function Ra() {
|
|
|
673
659
|
var n, a = G;
|
|
674
660
|
(t ? !ae.echoes || It++ && e === G : !It || --It && e === G) || queueMicrotask(t ? (function(i) {
|
|
675
661
|
++Ct, ae.echoes && --ae.echoes != 0 || (ae.echoes = ae.awaits = ae.id = 0), Pt.push(G), Pe(i, !0);
|
|
676
|
-
}).bind(null, e) : aa), e !== G && (G = e, a ===
|
|
662
|
+
}).bind(null, e) : aa), e !== G && (G = e, a === Ae && (Ae.env = rr()), on && (n = Ae.env.Promise, t = e.env, (a.global || e.global) && (Object.defineProperty(D, "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))));
|
|
677
663
|
}
|
|
678
664
|
function rr() {
|
|
679
665
|
var e = D.Promise;
|
|
@@ -730,13 +716,13 @@ function Ra() {
|
|
|
730
716
|
return t < e ? 1 : e < t ? -1 : 0;
|
|
731
717
|
case "binary":
|
|
732
718
|
return function(i, s) {
|
|
733
|
-
for (var u = i.length, c = s.length, h = u < c ? u : c,
|
|
719
|
+
for (var u = i.length, c = s.length, h = u < c ? u : c, g = 0; g < h; ++g) if (i[g] !== s[g]) return i[g] < s[g] ? -1 : 1;
|
|
734
720
|
return u === c ? 0 : u < c ? -1 : 1;
|
|
735
721
|
}(cr(e), cr(t));
|
|
736
722
|
case "Array":
|
|
737
723
|
return function(i, s) {
|
|
738
|
-
for (var u = i.length, c = s.length, h = u < c ? u : c,
|
|
739
|
-
var v = Y(i[
|
|
724
|
+
for (var u = i.length, c = s.length, h = u < c ? u : c, g = 0; g < h; ++g) {
|
|
725
|
+
var v = Y(i[g], s[g]);
|
|
740
726
|
if (v !== 0) return v;
|
|
741
727
|
}
|
|
742
728
|
return u === c ? 0 : u < c ? -1 : 1;
|
|
@@ -755,7 +741,7 @@ function Ra() {
|
|
|
755
741
|
}
|
|
756
742
|
var lr = (Z.prototype._trans = function(e, t, n) {
|
|
757
743
|
var a = this._tx || G.trans, i = this.name, s = me && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
758
|
-
function u(
|
|
744
|
+
function u(g, v, f) {
|
|
759
745
|
if (!f.schema[i]) throw new $.NotFound("Table " + i + " not part of transaction");
|
|
760
746
|
return t(f.idbtrans, f);
|
|
761
747
|
}
|
|
@@ -763,19 +749,19 @@ function Ra() {
|
|
|
763
749
|
try {
|
|
764
750
|
var h = a && a.db._novip === this.db._novip ? a === G.trans ? a._promise(e, u, n) : ke(function() {
|
|
765
751
|
return a._promise(e, u, n);
|
|
766
|
-
}, { trans: a, transless: G.transless || G }) : function
|
|
752
|
+
}, { trans: a, transless: G.transless || G }) : function g(v, f, S, p) {
|
|
767
753
|
if (v.idbdb && (v._state.openComplete || G.letThrough || v._vip)) {
|
|
768
754
|
var b = v._createTransaction(f, S, v._dbSchema);
|
|
769
755
|
try {
|
|
770
756
|
b.create(), v._state.PR1398_maxLoop = 3;
|
|
771
757
|
} catch (w) {
|
|
772
758
|
return w.name === an.InvalidState && v.isOpen() && 0 < --v._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), v.close({ disableAutoOpen: !1 }), v.open().then(function() {
|
|
773
|
-
return
|
|
759
|
+
return g(v, f, S, p);
|
|
774
760
|
})) : te(w);
|
|
775
761
|
}
|
|
776
|
-
return b._promise(f, function(w,
|
|
762
|
+
return b._promise(f, function(w, y) {
|
|
777
763
|
return ke(function() {
|
|
778
|
-
return G.trans = b, p(w,
|
|
764
|
+
return G.trans = b, p(w, y, b);
|
|
779
765
|
});
|
|
780
766
|
}).then(function(w) {
|
|
781
767
|
if (f === "readwrite") try {
|
|
@@ -793,11 +779,11 @@ function Ra() {
|
|
|
793
779
|
v.open().catch(J);
|
|
794
780
|
}
|
|
795
781
|
return v._state.dbReadyPromise.then(function() {
|
|
796
|
-
return
|
|
782
|
+
return g(v, f, S, p);
|
|
797
783
|
});
|
|
798
784
|
}(this.db, e, [this.name], u);
|
|
799
|
-
return s && (h._consoleTask = s, h = h.catch(function(
|
|
800
|
-
return console.trace(
|
|
785
|
+
return s && (h._consoleTask = s, h = h.catch(function(g) {
|
|
786
|
+
return console.trace(g), te(g);
|
|
801
787
|
})), h;
|
|
802
788
|
} finally {
|
|
803
789
|
c && Ze();
|
|
@@ -815,8 +801,8 @@ function Ra() {
|
|
|
815
801
|
var t = K(e);
|
|
816
802
|
if (t.length === 1) return this.where(t[0]).equals(e[t[0]]);
|
|
817
803
|
var n = this.schema.indexes.concat(this.schema.primKey).filter(function(c) {
|
|
818
|
-
if (c.compound && t.every(function(
|
|
819
|
-
return 0 <= c.keyPath.indexOf(
|
|
804
|
+
if (c.compound && t.every(function(g) {
|
|
805
|
+
return 0 <= c.keyPath.indexOf(g);
|
|
820
806
|
})) {
|
|
821
807
|
for (var h = 0; h < t.length; ++h) if (t.indexOf(c.keyPath[h]) === -1) return !1;
|
|
822
808
|
return !0;
|
|
@@ -837,8 +823,8 @@ function Ra() {
|
|
|
837
823
|
return Y(c, h) === 0;
|
|
838
824
|
}
|
|
839
825
|
var u = t.reduce(function(f, h) {
|
|
840
|
-
var
|
|
841
|
-
return [
|
|
826
|
+
var g = f[0], v = f[1], f = a[h], S = e[h];
|
|
827
|
+
return [g || f, g || !f ? Ue(v, f && f.multi ? function(p) {
|
|
842
828
|
return p = we(p, h), U(p) && p.some(function(b) {
|
|
843
829
|
return i(S, b);
|
|
844
830
|
});
|
|
@@ -870,12 +856,12 @@ function Ra() {
|
|
|
870
856
|
function i() {
|
|
871
857
|
return t !== null && t.apply(this, arguments) || this;
|
|
872
858
|
}
|
|
873
|
-
(this.schema.mappedClass = e).prototype instanceof or && (function(h,
|
|
874
|
-
if (typeof
|
|
859
|
+
(this.schema.mappedClass = e).prototype instanceof or && (function(h, g) {
|
|
860
|
+
if (typeof g != "function" && g !== null) throw new TypeError("Class extends value " + String(g) + " is not a constructor or null");
|
|
875
861
|
function v() {
|
|
876
862
|
this.constructor = h;
|
|
877
863
|
}
|
|
878
|
-
o(h,
|
|
864
|
+
o(h, g), h.prototype = g === null ? Object.create(g) : (v.prototype = g.prototype, new v());
|
|
879
865
|
}(i, t = e), Object.defineProperty(i.prototype, "db", { get: function() {
|
|
880
866
|
return n;
|
|
881
867
|
}, enumerable: !1, configurable: !0 }), i.prototype.table = function() {
|
|
@@ -886,9 +872,9 @@ function Ra() {
|
|
|
886
872
|
});
|
|
887
873
|
function c(h) {
|
|
888
874
|
if (!h) return h;
|
|
889
|
-
var
|
|
890
|
-
for (
|
|
891
|
-
v[
|
|
875
|
+
var g, v = Object.create(e.prototype);
|
|
876
|
+
for (g in h) if (!s.has(g)) try {
|
|
877
|
+
v[g] = h[g];
|
|
892
878
|
} catch {
|
|
893
879
|
}
|
|
894
880
|
return v;
|
|
@@ -952,11 +938,11 @@ function Ra() {
|
|
|
952
938
|
}, Z.prototype.bulkAdd = function(e, t, n) {
|
|
953
939
|
var a = this, i = Array.isArray(t) ? t : void 0, s = (n = n || (i ? void 0 : t)) ? n.allKeys : void 0;
|
|
954
940
|
return this._trans("readwrite", function(u) {
|
|
955
|
-
var
|
|
956
|
-
if (
|
|
941
|
+
var g = a.schema.primKey, c = g.auto, g = g.keyPath;
|
|
942
|
+
if (g && i) throw new $.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
957
943
|
if (i && i.length !== e.length) throw new $.InvalidArgument("Arguments objects and keys must have the same length");
|
|
958
|
-
var h = e.length,
|
|
959
|
-
return a.core.mutate({ trans: u, type: "add", keys: i, values:
|
|
944
|
+
var h = e.length, g = g && c ? e.map(Mt(g)) : e;
|
|
945
|
+
return a.core.mutate({ trans: u, type: "add", keys: i, values: g, wantResults: s }).then(function(b) {
|
|
960
946
|
var f = b.numFailures, S = b.results, p = b.lastResult, b = b.failures;
|
|
961
947
|
if (f === 0) return s ? S : p;
|
|
962
948
|
throw new Je("".concat(a.name, ".bulkAdd(): ").concat(f, " of ").concat(h, " operations failed"), b);
|
|
@@ -965,11 +951,11 @@ function Ra() {
|
|
|
965
951
|
}, Z.prototype.bulkPut = function(e, t, n) {
|
|
966
952
|
var a = this, i = Array.isArray(t) ? t : void 0, s = (n = n || (i ? void 0 : t)) ? n.allKeys : void 0;
|
|
967
953
|
return this._trans("readwrite", function(u) {
|
|
968
|
-
var
|
|
969
|
-
if (
|
|
954
|
+
var g = a.schema.primKey, c = g.auto, g = g.keyPath;
|
|
955
|
+
if (g && i) throw new $.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
970
956
|
if (i && i.length !== e.length) throw new $.InvalidArgument("Arguments objects and keys must have the same length");
|
|
971
|
-
var h = e.length,
|
|
972
|
-
return a.core.mutate({ trans: u, type: "put", keys: i, values:
|
|
957
|
+
var h = e.length, g = g && c ? e.map(Mt(g)) : e;
|
|
958
|
+
return a.core.mutate({ trans: u, type: "put", keys: i, values: g, wantResults: s }).then(function(b) {
|
|
973
959
|
var f = b.numFailures, S = b.results, p = b.lastResult, b = b.failures;
|
|
974
960
|
if (f === 0) return s ? S : p;
|
|
975
961
|
throw new Je("".concat(a.name, ".bulkPut(): ").concat(f, " of ").concat(h, " operations failed"), b);
|
|
@@ -983,26 +969,26 @@ function Ra() {
|
|
|
983
969
|
}), s = [];
|
|
984
970
|
return this._trans("readwrite", function(u) {
|
|
985
971
|
return n.getMany({ trans: u, keys: a, cache: "clone" }).then(function(c) {
|
|
986
|
-
var h = [],
|
|
972
|
+
var h = [], g = [];
|
|
987
973
|
e.forEach(function(f, S) {
|
|
988
974
|
var p = f.key, b = f.changes, w = c[S];
|
|
989
975
|
if (w) {
|
|
990
|
-
for (var
|
|
991
|
-
var E = _[
|
|
976
|
+
for (var y = 0, _ = Object.keys(b); y < _.length; y++) {
|
|
977
|
+
var E = _[y], O = b[E];
|
|
992
978
|
if (E === t.schema.primKey.keyPath) {
|
|
993
979
|
if (Y(O, p) !== 0) throw new $.Constraint("Cannot update primary key in bulkUpdate()");
|
|
994
980
|
} else fe(w, E, O);
|
|
995
981
|
}
|
|
996
|
-
s.push(S), h.push(p),
|
|
982
|
+
s.push(S), h.push(p), g.push(w);
|
|
997
983
|
}
|
|
998
984
|
});
|
|
999
985
|
var v = h.length;
|
|
1000
|
-
return n.mutate({ trans: u, type: "put", keys: h, values:
|
|
986
|
+
return n.mutate({ trans: u, type: "put", keys: h, values: g, updates: { keys: a, changeSpecs: i } }).then(function(f) {
|
|
1001
987
|
var S = f.numFailures, p = f.failures;
|
|
1002
988
|
if (S === 0) return v;
|
|
1003
989
|
for (var b = 0, w = Object.keys(p); b < w.length; b++) {
|
|
1004
|
-
var
|
|
1005
|
-
E != null && (
|
|
990
|
+
var y, _ = w[b], E = s[Number(_)];
|
|
991
|
+
E != null && (y = p[_], delete p[_], p[E] = y);
|
|
1006
992
|
}
|
|
1007
993
|
throw new Je("".concat(t.name, ".bulkUpdate(): ").concat(S, " of ").concat(v, " operations failed"), p);
|
|
1008
994
|
});
|
|
@@ -1023,8 +1009,8 @@ function Ra() {
|
|
|
1023
1009
|
function dt(e) {
|
|
1024
1010
|
function t(u, c) {
|
|
1025
1011
|
if (c) {
|
|
1026
|
-
for (var h = arguments.length,
|
|
1027
|
-
return n[u].subscribe.apply(null,
|
|
1012
|
+
for (var h = arguments.length, g = new Array(h - 1); --h; ) g[h - 1] = arguments[h];
|
|
1013
|
+
return n[u].subscribe.apply(null, g), e;
|
|
1028
1014
|
}
|
|
1029
1015
|
if (typeof u == "string") return n[u];
|
|
1030
1016
|
}
|
|
@@ -1034,7 +1020,7 @@ function Ra() {
|
|
|
1034
1020
|
return t;
|
|
1035
1021
|
function s(u, c, h) {
|
|
1036
1022
|
if (typeof u != "object") {
|
|
1037
|
-
var
|
|
1023
|
+
var g;
|
|
1038
1024
|
c = c || qr;
|
|
1039
1025
|
var v = { subscribers: [], fire: h = h || J, subscribe: function(f) {
|
|
1040
1026
|
v.subscribers.indexOf(f) === -1 && (v.subscribers.push(f), v.fire = c(v.fire, f));
|
|
@@ -1045,16 +1031,16 @@ function Ra() {
|
|
|
1045
1031
|
} };
|
|
1046
1032
|
return n[u] = t[u] = v;
|
|
1047
1033
|
}
|
|
1048
|
-
K(
|
|
1049
|
-
var S =
|
|
1050
|
-
if (U(S)) s(f,
|
|
1034
|
+
K(g = u).forEach(function(f) {
|
|
1035
|
+
var S = g[f];
|
|
1036
|
+
if (U(S)) s(f, g[f][0], g[f][1]);
|
|
1051
1037
|
else {
|
|
1052
1038
|
if (S !== "asap") throw new $.InvalidArgument("Invalid event config");
|
|
1053
1039
|
var p = s(f, st, function() {
|
|
1054
1040
|
for (var b = arguments.length, w = new Array(b); b--; ) w[b] = arguments[b];
|
|
1055
|
-
p.subscribers.forEach(function(
|
|
1041
|
+
p.subscribers.forEach(function(y) {
|
|
1056
1042
|
Yn(function() {
|
|
1057
|
-
|
|
1043
|
+
y.apply(null, w);
|
|
1058
1044
|
});
|
|
1059
1045
|
});
|
|
1060
1046
|
});
|
|
@@ -1090,13 +1076,13 @@ function Ra() {
|
|
|
1090
1076
|
function Nt(e, t, n, a) {
|
|
1091
1077
|
var i = e.replayFilter ? Ue(e.filter, e.replayFilter()) : e.filter;
|
|
1092
1078
|
if (e.or) {
|
|
1093
|
-
var s = {}, u = function(c, h,
|
|
1079
|
+
var s = {}, u = function(c, h, g) {
|
|
1094
1080
|
var v, f;
|
|
1095
|
-
i && !i(h,
|
|
1081
|
+
i && !i(h, g, function(S) {
|
|
1096
1082
|
return h.stop(S);
|
|
1097
1083
|
}, function(S) {
|
|
1098
1084
|
return h.fail(S);
|
|
1099
|
-
}) || ((f = "" + (v = h.primaryKey)) == "[object ArrayBuffer]" && (f = "" + new Uint8Array(v)), ee(s, f) || (s[f] = !0, t(c, h,
|
|
1085
|
+
}) || ((f = "" + (v = h.primaryKey)) == "[object ArrayBuffer]" && (f = "" + new Uint8Array(v)), ee(s, f) || (s[f] = !0, t(c, h, g)));
|
|
1100
1086
|
};
|
|
1101
1087
|
return Promise.all([e.or._iterate(u, n), fr(dr(e, a, n), e.algorithm, u, !e.keysOnly && e.valueMapper)]);
|
|
1102
1088
|
}
|
|
@@ -1127,7 +1113,7 @@ function Ra() {
|
|
|
1127
1113
|
var t = this["@@propmod"];
|
|
1128
1114
|
if (t.add !== void 0) {
|
|
1129
1115
|
var n = t.add;
|
|
1130
|
-
if (U(n)) return
|
|
1116
|
+
if (U(n)) return x(x([], U(e) ? e : [], !0), n).sort();
|
|
1131
1117
|
if (typeof n == "number") return (Number(e) || 0) + n;
|
|
1132
1118
|
if (typeof n == "bigint") try {
|
|
1133
1119
|
return BigInt(e) + n;
|
|
@@ -1191,12 +1177,12 @@ function Ra() {
|
|
|
1191
1177
|
}).then(e);
|
|
1192
1178
|
}, Q.prototype.sortBy = function(e, t) {
|
|
1193
1179
|
var n = e.split(".").reverse(), a = n[0], i = n.length - 1;
|
|
1194
|
-
function s(h,
|
|
1195
|
-
return
|
|
1180
|
+
function s(h, g) {
|
|
1181
|
+
return g ? s(h[n[g]], g - 1) : h[a];
|
|
1196
1182
|
}
|
|
1197
1183
|
var u = this._ctx.dir === "next" ? 1 : -1;
|
|
1198
|
-
function c(h,
|
|
1199
|
-
return Y(s(h, i), s(
|
|
1184
|
+
function c(h, g) {
|
|
1185
|
+
return Y(s(h, i), s(g, i)) * u;
|
|
1200
1186
|
}
|
|
1201
1187
|
return this.toArray(function(h) {
|
|
1202
1188
|
return h.sort(c);
|
|
@@ -1319,31 +1305,31 @@ function Ra() {
|
|
|
1319
1305
|
var t = this, n = this._ctx;
|
|
1320
1306
|
return this._write(function(a) {
|
|
1321
1307
|
var i, s, u;
|
|
1322
|
-
u = typeof e == "function" ? e : (i = K(e), s = i.length, function(
|
|
1308
|
+
u = typeof e == "function" ? e : (i = K(e), s = i.length, function(y) {
|
|
1323
1309
|
for (var _ = !1, E = 0; E < s; ++E) {
|
|
1324
|
-
var O = i[E],
|
|
1325
|
-
|
|
1310
|
+
var O = i[E], A = e[O], P = we(y, O);
|
|
1311
|
+
A instanceof ht ? (fe(y, O, A.execute(P)), _ = !0) : P !== A && (fe(y, O, A), _ = !0);
|
|
1326
1312
|
}
|
|
1327
1313
|
return _;
|
|
1328
1314
|
});
|
|
1329
|
-
var c = n.table.core, f = c.schema.primaryKey, h = f.outbound,
|
|
1315
|
+
var c = n.table.core, f = c.schema.primaryKey, h = f.outbound, g = f.extractKey, v = 200, f = t.db._options.modifyChunkSize;
|
|
1330
1316
|
f && (v = typeof f == "object" ? f[c.name] || f["*"] || 200 : f);
|
|
1331
|
-
function S(
|
|
1317
|
+
function S(y, O) {
|
|
1332
1318
|
var E = O.failures, O = O.numFailures;
|
|
1333
|
-
b +=
|
|
1334
|
-
for (var
|
|
1335
|
-
var T = P[
|
|
1319
|
+
b += y - O;
|
|
1320
|
+
for (var A = 0, P = K(E); A < P.length; A++) {
|
|
1321
|
+
var T = P[A];
|
|
1336
1322
|
p.push(E[T]);
|
|
1337
1323
|
}
|
|
1338
1324
|
}
|
|
1339
1325
|
var p = [], b = 0, w = [];
|
|
1340
|
-
return t.clone().primaryKeys().then(function(
|
|
1326
|
+
return t.clone().primaryKeys().then(function(y) {
|
|
1341
1327
|
function _(O) {
|
|
1342
|
-
var
|
|
1343
|
-
return c.getMany({ trans: a, keys:
|
|
1344
|
-
for (var T = [], I = [], C = h ? [] : null, j = [], R = 0; R <
|
|
1345
|
-
var L = P[R], W = { value: Te(L), primKey:
|
|
1346
|
-
u.call(W, W.value, W) !== !1 && (W.value == null ? j.push(
|
|
1328
|
+
var A = Math.min(v, y.length - O);
|
|
1329
|
+
return c.getMany({ trans: a, keys: y.slice(O, O + A), cache: "immutable" }).then(function(P) {
|
|
1330
|
+
for (var T = [], I = [], C = h ? [] : null, j = [], R = 0; R < A; ++R) {
|
|
1331
|
+
var L = P[R], W = { value: Te(L), primKey: y[O + R] };
|
|
1332
|
+
u.call(W, W.value, W) !== !1 && (W.value == null ? j.push(y[O + R]) : h || Y(g(L), g(W.value)) === 0 ? (I.push(W.value), h && C.push(y[O + R])) : (j.push(y[O + R]), T.push(W.value)));
|
|
1347
1333
|
}
|
|
1348
1334
|
return Promise.resolve(0 < T.length && c.mutate({ trans: a, type: "add", values: T }).then(function(z) {
|
|
1349
1335
|
for (var H in z.failures) j.splice(parseInt(H), 1);
|
|
@@ -1357,14 +1343,14 @@ function Ra() {
|
|
|
1357
1343
|
return S(j.length, z);
|
|
1358
1344
|
});
|
|
1359
1345
|
}).then(function() {
|
|
1360
|
-
return
|
|
1346
|
+
return y.length > O + A && _(O + v);
|
|
1361
1347
|
});
|
|
1362
1348
|
});
|
|
1363
1349
|
}
|
|
1364
1350
|
var E = tt(n) && n.limit === 1 / 0 && (typeof e != "function" || e === vn) && { index: n.index, range: n.range };
|
|
1365
1351
|
return _(0).then(function() {
|
|
1366
1352
|
if (0 < p.length) throw new Et("Error modifying one or more objects", p, b, w);
|
|
1367
|
-
return
|
|
1353
|
+
return y.length;
|
|
1368
1354
|
});
|
|
1369
1355
|
});
|
|
1370
1356
|
});
|
|
@@ -1403,30 +1389,30 @@ function Ra() {
|
|
|
1403
1389
|
}).limit(0);
|
|
1404
1390
|
}
|
|
1405
1391
|
function Kt(e, t, n, a) {
|
|
1406
|
-
var i, s, u, c, h,
|
|
1392
|
+
var i, s, u, c, h, g, v, f = n.length;
|
|
1407
1393
|
if (!n.every(function(b) {
|
|
1408
1394
|
return typeof b == "string";
|
|
1409
1395
|
})) return he(e, ir);
|
|
1410
1396
|
function S(b) {
|
|
1411
|
-
i = b === "next" ? function(
|
|
1412
|
-
return
|
|
1413
|
-
} : function(
|
|
1414
|
-
return
|
|
1415
|
-
}, s = b === "next" ? function(
|
|
1416
|
-
return
|
|
1417
|
-
} : function(
|
|
1418
|
-
return
|
|
1397
|
+
i = b === "next" ? function(y) {
|
|
1398
|
+
return y.toUpperCase();
|
|
1399
|
+
} : function(y) {
|
|
1400
|
+
return y.toLowerCase();
|
|
1401
|
+
}, s = b === "next" ? function(y) {
|
|
1402
|
+
return y.toLowerCase();
|
|
1403
|
+
} : function(y) {
|
|
1404
|
+
return y.toUpperCase();
|
|
1419
1405
|
}, u = b === "next" ? sa : oa;
|
|
1420
|
-
var w = n.map(function(
|
|
1421
|
-
return { lower: s(
|
|
1422
|
-
}).sort(function(
|
|
1423
|
-
return u(
|
|
1406
|
+
var w = n.map(function(y) {
|
|
1407
|
+
return { lower: s(y), upper: i(y) };
|
|
1408
|
+
}).sort(function(y, _) {
|
|
1409
|
+
return u(y.lower, _.lower);
|
|
1424
1410
|
});
|
|
1425
|
-
c = w.map(function(
|
|
1426
|
-
return
|
|
1427
|
-
}), h = w.map(function(
|
|
1428
|
-
return
|
|
1429
|
-
}), v = (
|
|
1411
|
+
c = w.map(function(y) {
|
|
1412
|
+
return y.upper;
|
|
1413
|
+
}), h = w.map(function(y) {
|
|
1414
|
+
return y.lower;
|
|
1415
|
+
}), v = (g = b) === "next" ? "" : a;
|
|
1430
1416
|
}
|
|
1431
1417
|
S("next"), e = new e.Collection(e, function() {
|
|
1432
1418
|
return Ie(c[0], h[f - 1] + a);
|
|
@@ -1434,12 +1420,12 @@ function Ra() {
|
|
|
1434
1420
|
S(b);
|
|
1435
1421
|
};
|
|
1436
1422
|
var p = 0;
|
|
1437
|
-
return e._addAlgorithm(function(b, w,
|
|
1423
|
+
return e._addAlgorithm(function(b, w, y) {
|
|
1438
1424
|
var _ = b.key;
|
|
1439
1425
|
if (typeof _ != "string") return !1;
|
|
1440
1426
|
var E = s(_);
|
|
1441
1427
|
if (t(E, h, p)) return !0;
|
|
1442
|
-
for (var O = null,
|
|
1428
|
+
for (var O = null, A = p; A < f; ++A) {
|
|
1443
1429
|
var P = function(T, I, C, j, R, L) {
|
|
1444
1430
|
for (var W = Math.min(T.length, j.length), z = -1, H = 0; H < W; ++H) {
|
|
1445
1431
|
var pe = I[H];
|
|
@@ -1447,12 +1433,12 @@ function Ra() {
|
|
|
1447
1433
|
R(T[H], pe) < 0 && (z = H);
|
|
1448
1434
|
}
|
|
1449
1435
|
return W < j.length && L === "next" ? T + C.substr(T.length) : W < T.length && L === "prev" ? T.substr(0, C.length) : z < 0 ? null : T.substr(0, z) + j[z] + C.substr(z + 1);
|
|
1450
|
-
}(_, E, c[
|
|
1451
|
-
P === null && O === null ? p =
|
|
1436
|
+
}(_, E, c[A], h[A], u, g);
|
|
1437
|
+
P === null && O === null ? p = A + 1 : (O === null || 0 < u(O, P)) && (O = P);
|
|
1452
1438
|
}
|
|
1453
1439
|
return w(O !== null ? function() {
|
|
1454
1440
|
b.continue(O + v);
|
|
1455
|
-
} :
|
|
1441
|
+
} : y), !1;
|
|
1456
1442
|
}), e;
|
|
1457
1443
|
}
|
|
1458
1444
|
function Ie(e, t, n, a) {
|
|
@@ -1555,25 +1541,25 @@ function Ra() {
|
|
|
1555
1541
|
if (!_.every(function(E) {
|
|
1556
1542
|
return E[0] !== void 0 && E[1] !== void 0 && i(E[0], E[1]) <= 0;
|
|
1557
1543
|
})) return he(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", $.InvalidArgument);
|
|
1558
|
-
var h = !t || t.includeLowers !== !1,
|
|
1544
|
+
var h = !t || t.includeLowers !== !1, g = t && t.includeUppers === !0, v, f = i;
|
|
1559
1545
|
function S(E, O) {
|
|
1560
1546
|
return f(E[0], O[0]);
|
|
1561
1547
|
}
|
|
1562
1548
|
try {
|
|
1563
1549
|
(v = _.reduce(function(E, O) {
|
|
1564
|
-
for (var
|
|
1565
|
-
var T = E[
|
|
1550
|
+
for (var A = 0, P = E.length; A < P; ++A) {
|
|
1551
|
+
var T = E[A];
|
|
1566
1552
|
if (a(O[0], T[1]) < 0 && 0 < a(O[1], T[0])) {
|
|
1567
1553
|
T[0] = u(T[0], O[0]), T[1] = c(T[1], O[1]);
|
|
1568
1554
|
break;
|
|
1569
1555
|
}
|
|
1570
1556
|
}
|
|
1571
|
-
return
|
|
1557
|
+
return A === P && E.push(O), E;
|
|
1572
1558
|
}, [])).sort(S);
|
|
1573
1559
|
} catch {
|
|
1574
1560
|
return he(this, _e);
|
|
1575
1561
|
}
|
|
1576
|
-
var p = 0, b =
|
|
1562
|
+
var p = 0, b = g ? function(E) {
|
|
1577
1563
|
return 0 < i(E, v[p][1]);
|
|
1578
1564
|
} : function(E) {
|
|
1579
1565
|
return 0 <= i(E, v[p][1]);
|
|
@@ -1581,13 +1567,13 @@ function Ra() {
|
|
|
1581
1567
|
return 0 < s(E, v[p][0]);
|
|
1582
1568
|
} : function(E) {
|
|
1583
1569
|
return 0 <= s(E, v[p][0]);
|
|
1584
|
-
},
|
|
1585
|
-
return Ie(v[0][0], v[v.length - 1][1], !h, !
|
|
1570
|
+
}, y = b, _ = new this.Collection(this, function() {
|
|
1571
|
+
return Ie(v[0][0], v[v.length - 1][1], !h, !g);
|
|
1586
1572
|
});
|
|
1587
1573
|
return _._ondirectionchange = function(E) {
|
|
1588
|
-
f = E === "next" ? (
|
|
1589
|
-
}, _._addAlgorithm(function(E, O,
|
|
1590
|
-
for (var P, T = E.key;
|
|
1574
|
+
f = E === "next" ? (y = b, i) : (y = w, s), v.sort(S);
|
|
1575
|
+
}, _._addAlgorithm(function(E, O, A) {
|
|
1576
|
+
for (var P, T = E.key; y(T); ) if (++p === v.length) return O(A), !1;
|
|
1591
1577
|
return !b(P = T) && !w(P) || (n._cmp(T, v[p][1]) === 0 || n._cmp(T, v[p][0]) === 0 || O(function() {
|
|
1592
1578
|
f === i ? E.continue(v[p][0]) : E.continue(v[p][1]);
|
|
1593
1579
|
}), !1);
|
|
@@ -1742,19 +1728,19 @@ function Ra() {
|
|
|
1742
1728
|
return e == null ? ":id" : typeof e == "string" ? e : "[".concat(e.join("+"), "]");
|
|
1743
1729
|
}
|
|
1744
1730
|
function la(e, t, h) {
|
|
1745
|
-
function a(
|
|
1746
|
-
if (
|
|
1747
|
-
if (
|
|
1748
|
-
var p =
|
|
1749
|
-
return p === void 0 ? b === void 0 ? null : t.upperBound(b, !!
|
|
1731
|
+
function a(y) {
|
|
1732
|
+
if (y.type === 3) return null;
|
|
1733
|
+
if (y.type === 4) throw new Error("Cannot convert never type to IDBKeyRange");
|
|
1734
|
+
var p = y.lower, b = y.upper, w = y.lowerOpen, y = y.upperOpen;
|
|
1735
|
+
return p === void 0 ? b === void 0 ? null : t.upperBound(b, !!y) : b === void 0 ? t.lowerBound(p, !!w) : t.bound(p, b, !!w, !!y);
|
|
1750
1736
|
}
|
|
1751
1737
|
function i(S) {
|
|
1752
1738
|
var p, b = S.name;
|
|
1753
1739
|
return { name: b, schema: S, mutate: function(w) {
|
|
1754
|
-
var
|
|
1740
|
+
var y = w.trans, _ = w.type, E = w.keys, O = w.values, A = w.range;
|
|
1755
1741
|
return new Promise(function(P, T) {
|
|
1756
1742
|
P = q(P);
|
|
1757
|
-
var I =
|
|
1743
|
+
var I = y.objectStore(b), C = I.keyPath == null, j = _ === "put" || _ === "add";
|
|
1758
1744
|
if (!j && _ !== "delete" && _ !== "deleteRange") throw new Error("Invalid operation type: " + _);
|
|
1759
1745
|
var R, L = (E || O || { length: 1 }).length;
|
|
1760
1746
|
if (E && O && E.length !== O.length) throw new Error("Given keys array must have same length as given values array.");
|
|
@@ -1764,8 +1750,8 @@ function Ra() {
|
|
|
1764
1750
|
}
|
|
1765
1751
|
var z = [], H = [], pe = 0;
|
|
1766
1752
|
if (_ === "deleteRange") {
|
|
1767
|
-
if (
|
|
1768
|
-
|
|
1753
|
+
if (A.type === 4) return P({ numFailures: pe, failures: H, results: [], lastResult: void 0 });
|
|
1754
|
+
A.type === 3 ? z.push(R = I.clear()) : z.push(R = I.delete(a(A)));
|
|
1769
1755
|
} else {
|
|
1770
1756
|
var C = j ? C ? [O, E] : [O, null] : [E, null], F = C[0], ue = C[1];
|
|
1771
1757
|
if (j) for (var ce = 0; ce < L; ++ce) z.push(R = ue && ue[ce] !== void 0 ? I[_](F[ce], ue[ce]) : I[_](F[ce])), R.onerror = W;
|
|
@@ -1783,45 +1769,45 @@ function Ra() {
|
|
|
1783
1769
|
}, R.onsuccess = Jt;
|
|
1784
1770
|
});
|
|
1785
1771
|
}, getMany: function(w) {
|
|
1786
|
-
var
|
|
1772
|
+
var y = w.trans, _ = w.keys;
|
|
1787
1773
|
return new Promise(function(E, O) {
|
|
1788
1774
|
E = q(E);
|
|
1789
|
-
for (var
|
|
1775
|
+
for (var A, P = y.objectStore(b), T = _.length, I = new Array(T), C = 0, j = 0, R = function(z) {
|
|
1790
1776
|
z = z.target, I[z._pos] = z.result, ++j === C && E(I);
|
|
1791
|
-
}, L = be(O), W = 0; W < T; ++W) _[W] != null && ((
|
|
1777
|
+
}, L = be(O), W = 0; W < T; ++W) _[W] != null && ((A = P.get(_[W]))._pos = W, A.onsuccess = R, A.onerror = L, ++C);
|
|
1792
1778
|
C === 0 && E(I);
|
|
1793
1779
|
});
|
|
1794
1780
|
}, get: function(w) {
|
|
1795
|
-
var
|
|
1781
|
+
var y = w.trans, _ = w.key;
|
|
1796
1782
|
return new Promise(function(E, O) {
|
|
1797
1783
|
E = q(E);
|
|
1798
|
-
var
|
|
1799
|
-
|
|
1784
|
+
var A = y.objectStore(b).get(_);
|
|
1785
|
+
A.onsuccess = function(P) {
|
|
1800
1786
|
return E(P.target.result);
|
|
1801
|
-
},
|
|
1787
|
+
}, A.onerror = be(O);
|
|
1802
1788
|
});
|
|
1803
|
-
}, query: (p =
|
|
1804
|
-
return new Promise(function(
|
|
1805
|
-
|
|
1806
|
-
var E, O,
|
|
1807
|
-
if (T === 0) return
|
|
1789
|
+
}, query: (p = g, function(w) {
|
|
1790
|
+
return new Promise(function(y, _) {
|
|
1791
|
+
y = q(y);
|
|
1792
|
+
var E, O, A, C = w.trans, P = w.values, T = w.limit, R = w.query, I = T === 1 / 0 ? void 0 : T, j = R.index, R = R.range, C = C.objectStore(b), j = j.isPrimaryKey ? C : C.index(j.name), R = a(R);
|
|
1793
|
+
if (T === 0) return y({ result: [] });
|
|
1808
1794
|
p ? ((I = P ? j.getAll(R, I) : j.getAllKeys(R, I)).onsuccess = function(L) {
|
|
1809
|
-
return
|
|
1810
|
-
}, I.onerror = be(_)) : (E = 0, O = !P && "openKeyCursor" in j ? j.openKeyCursor(R) : j.openCursor(R),
|
|
1795
|
+
return y({ result: L.target.result });
|
|
1796
|
+
}, I.onerror = be(_)) : (E = 0, O = !P && "openKeyCursor" in j ? j.openKeyCursor(R) : j.openCursor(R), A = [], O.onsuccess = function(L) {
|
|
1811
1797
|
var W = O.result;
|
|
1812
|
-
return W ? (
|
|
1798
|
+
return W ? (A.push(P ? W.value : W.primaryKey), ++E === T ? y({ result: A }) : void W.continue()) : y({ result: A });
|
|
1813
1799
|
}, O.onerror = be(_));
|
|
1814
1800
|
});
|
|
1815
1801
|
}), openCursor: function(w) {
|
|
1816
|
-
var
|
|
1802
|
+
var y = w.trans, _ = w.values, E = w.query, O = w.reverse, A = w.unique;
|
|
1817
1803
|
return new Promise(function(P, T) {
|
|
1818
1804
|
P = q(P);
|
|
1819
|
-
var j = E.index, I = E.range, C =
|
|
1805
|
+
var j = E.index, I = E.range, C = y.objectStore(b), C = j.isPrimaryKey ? C : C.index(j.name), j = O ? A ? "prevunique" : "prev" : A ? "nextunique" : "next", R = !_ && "openKeyCursor" in C ? C.openKeyCursor(a(I), j) : C.openCursor(a(I), j);
|
|
1820
1806
|
R.onerror = be(T), R.onsuccess = q(function(L) {
|
|
1821
1807
|
var W, z, H, pe, F = R.result;
|
|
1822
1808
|
F ? (F.___id = ++ca, F.done = !1, W = F.continue.bind(F), z = (z = F.continuePrimaryKey) && z.bind(F), H = F.advance.bind(F), pe = function() {
|
|
1823
1809
|
throw new Error("Cursor not stopped");
|
|
1824
|
-
}, F.trans =
|
|
1810
|
+
}, F.trans = y, F.stop = F.continue = F.continuePrimaryKey = F.advance = function() {
|
|
1825
1811
|
throw new Error("Cursor not started");
|
|
1826
1812
|
}, F.fail = q(T), F.next = function() {
|
|
1827
1813
|
var ue = this, ce = 1;
|
|
@@ -1853,11 +1839,11 @@ function Ra() {
|
|
|
1853
1839
|
}, T);
|
|
1854
1840
|
});
|
|
1855
1841
|
}, count: function(w) {
|
|
1856
|
-
var
|
|
1857
|
-
return new Promise(function(
|
|
1842
|
+
var y = w.query, _ = w.trans, E = y.index, O = y.range;
|
|
1843
|
+
return new Promise(function(A, P) {
|
|
1858
1844
|
var T = _.objectStore(b), I = E.isPrimaryKey ? T : T.index(E.name), T = a(O), I = T ? I.count(T) : I.count();
|
|
1859
1845
|
I.onsuccess = q(function(C) {
|
|
1860
|
-
return
|
|
1846
|
+
return A(C.target.result);
|
|
1861
1847
|
}), I.onerror = be(P);
|
|
1862
1848
|
});
|
|
1863
1849
|
} };
|
|
@@ -1865,16 +1851,16 @@ function Ra() {
|
|
|
1865
1851
|
var s, u, c, v = (u = h, c = mr((s = e).objectStoreNames), { schema: { name: s.name, tables: c.map(function(S) {
|
|
1866
1852
|
return u.objectStore(S);
|
|
1867
1853
|
}).map(function(S) {
|
|
1868
|
-
var p = S.keyPath,
|
|
1854
|
+
var p = S.keyPath, y = S.autoIncrement, b = U(p), w = {}, y = { name: S.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: p == null, compound: b, keyPath: p, autoIncrement: y, unique: !0, extractKey: En(p) }, indexes: mr(S.indexNames).map(function(_) {
|
|
1869
1855
|
return S.index(_);
|
|
1870
|
-
}).map(function(
|
|
1871
|
-
var E =
|
|
1872
|
-
return w[mt(
|
|
1856
|
+
}).map(function(A) {
|
|
1857
|
+
var E = A.name, O = A.unique, P = A.multiEntry, A = A.keyPath, P = { name: E, compound: U(A), keyPath: A, unique: O, multiEntry: P, extractKey: En(A) };
|
|
1858
|
+
return w[mt(A)] = P;
|
|
1873
1859
|
}), getIndexByKeyPath: function(_) {
|
|
1874
1860
|
return w[mt(_)];
|
|
1875
1861
|
} };
|
|
1876
|
-
return w[":id"] =
|
|
1877
|
-
}) }, hasGetAll: 0 < c.length && "getAll" in u.objectStore(c[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), h = v.schema,
|
|
1862
|
+
return w[":id"] = y.primaryKey, p != null && (w[mt(p)] = y.primaryKey), y;
|
|
1863
|
+
}) }, hasGetAll: 0 < c.length && "getAll" in u.objectStore(c[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), h = v.schema, g = v.hasGetAll, v = h.tables.map(i), f = {};
|
|
1878
1864
|
return v.forEach(function(S) {
|
|
1879
1865
|
return f[S.name] = S;
|
|
1880
1866
|
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(S) {
|
|
@@ -1885,7 +1871,7 @@ function Ra() {
|
|
|
1885
1871
|
function da(e, t, n, a) {
|
|
1886
1872
|
var i = n.IDBKeyRange;
|
|
1887
1873
|
return n.indexedDB, { dbcore: (a = la(t, i, a), e.dbcore.reduce(function(s, u) {
|
|
1888
|
-
return u = u.create,
|
|
1874
|
+
return u = u.create, l(l({}, s), u(s));
|
|
1889
1875
|
}, a)) };
|
|
1890
1876
|
}
|
|
1891
1877
|
function Bt(e, a) {
|
|
@@ -1901,10 +1887,10 @@ function Ra() {
|
|
|
1901
1887
|
n.forEach(function(i) {
|
|
1902
1888
|
var s = a[i];
|
|
1903
1889
|
t.forEach(function(u) {
|
|
1904
|
-
var c = function h(
|
|
1905
|
-
return Ur(
|
|
1890
|
+
var c = function h(g, v) {
|
|
1891
|
+
return Ur(g, v) || (g = X(g)) && h(g, v);
|
|
1906
1892
|
}(u, i);
|
|
1907
|
-
(!c || "value" in c && c.value === void 0) && (u === e.Transaction.prototype || u instanceof e.Transaction ?
|
|
1893
|
+
(!c || "value" in c && c.value === void 0) && (u === e.Transaction.prototype || u instanceof e.Transaction ? xe(u, i, { get: function() {
|
|
1908
1894
|
return this.table(i);
|
|
1909
1895
|
}, set: function(h) {
|
|
1910
1896
|
He(this, i, { value: h, writable: !0, configurable: !0, enumerable: !0 });
|
|
@@ -1927,19 +1913,19 @@ function Ra() {
|
|
|
1927
1913
|
s.create(n), s._completion.catch(a);
|
|
1928
1914
|
var u = s._reject.bind(s), c = G.transless || G;
|
|
1929
1915
|
ke(function() {
|
|
1930
|
-
return G.trans = s, G.transless = c, t !== 0 ? (Bt(e, n),
|
|
1931
|
-
return v ??
|
|
1932
|
-
}) : B.resolve(
|
|
1933
|
-
return S = v, p = s, b = n, w = [], v = (f = e)._versions,
|
|
1916
|
+
return G.trans = s, G.transless = c, t !== 0 ? (Bt(e, n), g = t, ((h = s).storeNames.includes("$meta") ? h.table("$meta").get("version").then(function(v) {
|
|
1917
|
+
return v ?? g;
|
|
1918
|
+
}) : B.resolve(g)).then(function(v) {
|
|
1919
|
+
return S = v, p = s, b = n, w = [], v = (f = e)._versions, y = f._dbSchema = $t(0, f.idbdb, b), (v = v.filter(function(_) {
|
|
1934
1920
|
return _._cfg.version >= S;
|
|
1935
1921
|
})).length !== 0 ? (v.forEach(function(_) {
|
|
1936
1922
|
w.push(function() {
|
|
1937
|
-
var E =
|
|
1938
|
-
Ut(f, E, b), Ut(f, O, b),
|
|
1939
|
-
var
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
}),
|
|
1923
|
+
var E = y, O = _._cfg.dbschema;
|
|
1924
|
+
Ut(f, E, b), Ut(f, O, b), y = f._dbSchema = O;
|
|
1925
|
+
var A = xn(E, O);
|
|
1926
|
+
A.add.forEach(function(j) {
|
|
1927
|
+
An(b, j[0], j[1].primKey, j[1].indexes);
|
|
1928
|
+
}), A.change.forEach(function(j) {
|
|
1943
1929
|
if (j.recreate) throw new $.Upgrade("Not yet support for changing primary key");
|
|
1944
1930
|
var R = b.objectStore(j.name);
|
|
1945
1931
|
j.add.forEach(function(L) {
|
|
@@ -1954,21 +1940,21 @@ function Ra() {
|
|
|
1954
1940
|
if (P && _._cfg.version > S) {
|
|
1955
1941
|
Bt(f, b), p._memoizedTables = {};
|
|
1956
1942
|
var T = Qn(O);
|
|
1957
|
-
|
|
1943
|
+
A.del.forEach(function(j) {
|
|
1958
1944
|
T[j] = E[j];
|
|
1959
1945
|
}), On(f, [f.Transaction.prototype]), Lt(f, [f.Transaction.prototype], K(T), T), p.schema = T;
|
|
1960
1946
|
var I, C = rn(P);
|
|
1961
|
-
return C && qe(),
|
|
1947
|
+
return C && qe(), A = B.follow(function() {
|
|
1962
1948
|
var j;
|
|
1963
1949
|
(I = P(p)) && C && (j = De.bind(null, null), I.then(j, j));
|
|
1964
|
-
}), I && typeof I.then == "function" ? B.resolve(I) :
|
|
1950
|
+
}), I && typeof I.then == "function" ? B.resolve(I) : A.then(function() {
|
|
1965
1951
|
return I;
|
|
1966
1952
|
});
|
|
1967
1953
|
}
|
|
1968
1954
|
}), w.push(function(E) {
|
|
1969
|
-
var O,
|
|
1970
|
-
O = P,
|
|
1971
|
-
return O[T] == null &&
|
|
1955
|
+
var O, A, P = _._cfg.dbschema;
|
|
1956
|
+
O = P, A = E, [].slice.call(A.db.objectStoreNames).forEach(function(T) {
|
|
1957
|
+
return O[T] == null && A.db.deleteObjectStore(T);
|
|
1972
1958
|
}), On(f, [f.Transaction.prototype]), Lt(f, [f.Transaction.prototype], f._storeNames, f._dbSchema), p.schema = f._dbSchema;
|
|
1973
1959
|
}), w.push(function(E) {
|
|
1974
1960
|
f.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(f.idbdb.version / 10) === _._cfg.version ? (f.idbdb.deleteObjectStore("$meta"), delete f._dbSchema.$meta, f._storeNames = f._storeNames.filter(function(O) {
|
|
@@ -1978,22 +1964,22 @@ function Ra() {
|
|
|
1978
1964
|
}), function _() {
|
|
1979
1965
|
return w.length ? B.resolve(w.shift()(p.idbtrans)).then(_) : B.resolve();
|
|
1980
1966
|
}().then(function() {
|
|
1981
|
-
br(
|
|
1967
|
+
br(y, b);
|
|
1982
1968
|
})) : B.resolve();
|
|
1983
|
-
var f, S, p, b, w,
|
|
1969
|
+
var f, S, p, b, w, y;
|
|
1984
1970
|
}).catch(u)) : (K(i).forEach(function(v) {
|
|
1985
|
-
|
|
1971
|
+
An(n, v, i[v].primKey, i[v].indexes);
|
|
1986
1972
|
}), Bt(e, n), void B.follow(function() {
|
|
1987
1973
|
return e.on.populate.fire(s);
|
|
1988
1974
|
}).catch(u));
|
|
1989
|
-
var h,
|
|
1975
|
+
var h, g;
|
|
1990
1976
|
});
|
|
1991
1977
|
}
|
|
1992
1978
|
function pa(e, t) {
|
|
1993
1979
|
br(e._dbSchema, t), t.db.version % 10 != 0 || t.objectStoreNames.contains("$meta") || t.db.createObjectStore("$meta").add(Math.ceil(t.db.version / 10 - 1), "version");
|
|
1994
1980
|
var n = $t(0, e.idbdb, t);
|
|
1995
1981
|
Ut(e, e._dbSchema, t);
|
|
1996
|
-
for (var a = 0, i =
|
|
1982
|
+
for (var a = 0, i = xn(n, e._dbSchema).change; a < i.length; a++) {
|
|
1997
1983
|
var s = function(u) {
|
|
1998
1984
|
if (u.change.length || u.recreate) return console.warn("Unable to patch indexes of table ".concat(u.name, " because it has changes on the type of index or primary key.")), { value: void 0 };
|
|
1999
1985
|
var c = t.objectStore(u.name);
|
|
@@ -2004,7 +1990,7 @@ function Ra() {
|
|
|
2004
1990
|
if (typeof s == "object") return s.value;
|
|
2005
1991
|
}
|
|
2006
1992
|
}
|
|
2007
|
-
function
|
|
1993
|
+
function xn(e, t) {
|
|
2008
1994
|
var n, a = { del: [], add: [], change: [] };
|
|
2009
1995
|
for (n in e) t[n] || a.del.push(n);
|
|
2010
1996
|
for (n in t) {
|
|
@@ -2013,10 +1999,10 @@ function Ra() {
|
|
|
2013
1999
|
var u = { name: n, def: s, recreate: !1, del: [], add: [], change: [] };
|
|
2014
2000
|
if ("" + (i.primKey.keyPath || "") != "" + (s.primKey.keyPath || "") || i.primKey.auto !== s.primKey.auto) u.recreate = !0, a.change.push(u);
|
|
2015
2001
|
else {
|
|
2016
|
-
var c = i.idxByName, h = s.idxByName,
|
|
2017
|
-
for (
|
|
2018
|
-
for (
|
|
2019
|
-
var v = c[
|
|
2002
|
+
var c = i.idxByName, h = s.idxByName, g = void 0;
|
|
2003
|
+
for (g in c) h[g] || u.del.push(g);
|
|
2004
|
+
for (g in h) {
|
|
2005
|
+
var v = c[g], f = h[g];
|
|
2020
2006
|
v ? v.src !== f.src && u.change.push(f) : u.add.push(f);
|
|
2021
2007
|
}
|
|
2022
2008
|
(0 < u.del.length || 0 < u.add.length || 0 < u.change.length) && a.change.push(u);
|
|
@@ -2025,7 +2011,7 @@ function Ra() {
|
|
|
2025
2011
|
}
|
|
2026
2012
|
return a;
|
|
2027
2013
|
}
|
|
2028
|
-
function
|
|
2014
|
+
function An(e, t, n, a) {
|
|
2029
2015
|
var i = e.db.createObjectStore(t, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
|
|
2030
2016
|
return a.forEach(function(s) {
|
|
2031
2017
|
return Gt(i, s);
|
|
@@ -2033,7 +2019,7 @@ function Ra() {
|
|
|
2033
2019
|
}
|
|
2034
2020
|
function br(e, t) {
|
|
2035
2021
|
K(e).forEach(function(n) {
|
|
2036
|
-
t.db.objectStoreNames.contains(n) || (me && console.debug("Dexie: Creating missing table", n),
|
|
2022
|
+
t.db.objectStoreNames.contains(n) || (me && console.debug("Dexie: Creating missing table", n), An(t, n, e[n].primKey, e[n].indexes));
|
|
2037
2023
|
});
|
|
2038
2024
|
}
|
|
2039
2025
|
function Gt(e, t) {
|
|
@@ -2042,8 +2028,8 @@ function Ra() {
|
|
|
2042
2028
|
function $t(e, t, n) {
|
|
2043
2029
|
var a = {};
|
|
2044
2030
|
return _t(t.objectStoreNames, 0).forEach(function(i) {
|
|
2045
|
-
for (var s = n.objectStore(i), u = Sn(yr(
|
|
2046
|
-
var v = s.index(s.indexNames[h]),
|
|
2031
|
+
for (var s = n.objectStore(i), u = Sn(yr(g = s.keyPath), g || "", !0, !1, !!s.autoIncrement, g && typeof g != "string", !0), c = [], h = 0; h < s.indexNames.length; ++h) {
|
|
2032
|
+
var v = s.index(s.indexNames[h]), g = v.keyPath, v = Sn(v.name, g, !!v.unique, !!v.multiEntry, !1, g && typeof g != "string", !1);
|
|
2047
2033
|
c.push(v);
|
|
2048
2034
|
}
|
|
2049
2035
|
a[i] = _n(i, u, c);
|
|
@@ -2054,8 +2040,8 @@ function Ra() {
|
|
|
2054
2040
|
var s = a[i], u = n.objectStore(s);
|
|
2055
2041
|
e._hasGetAll = "getAll" in u;
|
|
2056
2042
|
for (var c = 0; c < u.indexNames.length; ++c) {
|
|
2057
|
-
var h = u.indexNames[c],
|
|
2058
|
-
!t[s] || (
|
|
2043
|
+
var h = u.indexNames[c], g = u.index(h).keyPath, v = typeof g == "string" ? g : "[" + _t(g).join("+") + "]";
|
|
2044
|
+
!t[s] || (g = t[s].idxByName[v]) && (g.name = h, delete t[s].idxByName[v], t[s].idxByName[h] = g);
|
|
2059
2045
|
}
|
|
2060
2046
|
}
|
|
2061
2047
|
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && D.WorkerGlobalScope && D instanceof D.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
|
|
@@ -2159,7 +2145,7 @@ function Ra() {
|
|
|
2159
2145
|
}
|
|
2160
2146
|
function Sr(e) {
|
|
2161
2147
|
var t, n, a = (((t = e.r) === null || t === void 0 ? void 0 : t.d) || 0) - (((n = e.l) === null || n === void 0 ? void 0 : n.d) || 0), i = 1 < a ? "r" : a < -1 ? "l" : "";
|
|
2162
|
-
i && (t = i == "r" ? "l" : "r", n =
|
|
2148
|
+
i && (t = i == "r" ? "l" : "r", n = l({}, e), a = e[i], e.from = a.from, e.to = a.to, e[i] = a[i], n[i] = a[t], (e[t] = n).d = _r(n)), e.d = _r(e);
|
|
2163
2149
|
}
|
|
2164
2150
|
function _r(n) {
|
|
2165
2151
|
var t = n.r, n = n.l;
|
|
@@ -2214,17 +2200,17 @@ function Ra() {
|
|
|
2214
2200
|
}
|
|
2215
2201
|
function Er(e, t, n, a) {
|
|
2216
2202
|
for (var i = [], s = 0, u = Object.entries(e.queries.query); s < u.length; s++) {
|
|
2217
|
-
for (var c = u[s], h = c[0],
|
|
2203
|
+
for (var c = u[s], h = c[0], g = [], v = 0, f = c[1]; v < f.length; v++) {
|
|
2218
2204
|
var S = f[v];
|
|
2219
|
-
Cn(t, S.obsSet) ? S.subscribers.forEach(function(
|
|
2220
|
-
return n.add(
|
|
2221
|
-
}) : a &&
|
|
2205
|
+
Cn(t, S.obsSet) ? S.subscribers.forEach(function(y) {
|
|
2206
|
+
return n.add(y);
|
|
2207
|
+
}) : a && g.push(S);
|
|
2222
2208
|
}
|
|
2223
|
-
a && i.push([h,
|
|
2209
|
+
a && i.push([h, g]);
|
|
2224
2210
|
}
|
|
2225
2211
|
if (a) for (var p = 0, b = i; p < b.length; p++) {
|
|
2226
|
-
var w = b[p], h = w[0],
|
|
2227
|
-
e.queries.query[h] =
|
|
2212
|
+
var w = b[p], h = w[0], g = w[1];
|
|
2213
|
+
e.queries.query[h] = g;
|
|
2228
2214
|
}
|
|
2229
2215
|
}
|
|
2230
2216
|
function ya(e) {
|
|
@@ -2242,18 +2228,18 @@ function Ra() {
|
|
|
2242
2228
|
if (u(), !n) throw new $.MissingAPI();
|
|
2243
2229
|
var b = e.name, w = t.autoSchema || !i ? n.open(b) : n.open(b, i);
|
|
2244
2230
|
if (!w) throw new $.MissingAPI();
|
|
2245
|
-
w.onerror = be(p), w.onblocked = q(e._fireOnBlocked), w.onupgradeneeded = q(function(
|
|
2231
|
+
w.onerror = be(p), w.onblocked = q(e._fireOnBlocked), w.onupgradeneeded = q(function(y) {
|
|
2246
2232
|
var _;
|
|
2247
2233
|
v = w.transaction, t.autoSchema && !e._options.allowEmptyDB ? (w.onerror = pt, v.abort(), w.result.close(), (_ = n.deleteDatabase(b)).onsuccess = _.onerror = q(function() {
|
|
2248
2234
|
p(new $.NoSuchDatabase("Database ".concat(b, " doesnt exist")));
|
|
2249
|
-
})) : (v.onerror = be(p),
|
|
2235
|
+
})) : (v.onerror = be(p), y = y.oldVersion > Math.pow(2, 62) ? 0 : y.oldVersion, f = y < 1, e.idbdb = w.result, s && pa(e, v), ha(e, y / 10, v, p));
|
|
2250
2236
|
}, p), w.onsuccess = q(function() {
|
|
2251
2237
|
v = null;
|
|
2252
|
-
var
|
|
2238
|
+
var y, _, E, O, A, P = e.idbdb = w.result, T = _t(P.objectStoreNames);
|
|
2253
2239
|
if (0 < T.length) try {
|
|
2254
2240
|
var I = P.transaction((O = T).length === 1 ? O[0] : O, "readonly");
|
|
2255
|
-
if (t.autoSchema) _ = P, E = I, (
|
|
2256
|
-
else if (Ut(e, e._dbSchema, I), ((
|
|
2241
|
+
if (t.autoSchema) _ = P, E = I, (y = e).verno = _.version / 10, E = y._dbSchema = $t(0, _, E), y._storeNames = _t(_.objectStoreNames, 0), Lt(y, [y._allTables], K(E), E);
|
|
2242
|
+
else if (Ut(e, e._dbSchema, I), ((A = xn($t(0, (A = e).idbdb, I), A._dbSchema)).add.length || A.change.some(function(C) {
|
|
2257
2243
|
return C.add.length || C.change.length;
|
|
2258
2244
|
})) && !s) 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."), P.close(), i = P.version + 1, s = !0, S(c());
|
|
2259
2245
|
Bt(e, I);
|
|
@@ -2263,7 +2249,7 @@ function Ra() {
|
|
|
2263
2249
|
t.vcFired = !0, e.on("versionchange").fire(C);
|
|
2264
2250
|
}), P.onclose = q(function(C) {
|
|
2265
2251
|
e.on("close").fire(C);
|
|
2266
|
-
}), f && (
|
|
2252
|
+
}), f && (A = e._deps, I = b, P = A.indexedDB, A = A.IDBKeyRange, Dn(P) || I === Tt || kn(P, A).put({ name: I }).catch(J)), S();
|
|
2267
2253
|
}, p);
|
|
2268
2254
|
}).catch(function(S) {
|
|
2269
2255
|
switch (S == null ? void 0 : S.name) {
|
|
@@ -2276,7 +2262,7 @@ function Ra() {
|
|
|
2276
2262
|
return B.reject(S);
|
|
2277
2263
|
});
|
|
2278
2264
|
}
|
|
2279
|
-
var h,
|
|
2265
|
+
var h, g = t.dbReadyResolve, v = null, f = !1;
|
|
2280
2266
|
return B.race([a, (typeof navigator > "u" ? B.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(S) {
|
|
2281
2267
|
function p() {
|
|
2282
2268
|
return indexedDB.databases().finally(S);
|
|
@@ -2305,7 +2291,7 @@ function Ra() {
|
|
|
2305
2291
|
}
|
|
2306
2292
|
return a === t.openCanceller && e._close(), te(S);
|
|
2307
2293
|
}).finally(function() {
|
|
2308
|
-
t.openComplete = !0,
|
|
2294
|
+
t.openComplete = !0, g();
|
|
2309
2295
|
}).then(function() {
|
|
2310
2296
|
var S;
|
|
2311
2297
|
return f && (S = {}, e.tables.forEach(function(p) {
|
|
@@ -2335,24 +2321,24 @@ function Ra() {
|
|
|
2335
2321
|
return a;
|
|
2336
2322
|
}
|
|
2337
2323
|
var ma = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2338
|
-
return
|
|
2324
|
+
return l(l({}, e), { table: function(t) {
|
|
2339
2325
|
var n = e.table(t), a = n.schema, i = {}, s = [];
|
|
2340
2326
|
function u(f, S, p) {
|
|
2341
|
-
var b = mt(f), w = i[b] = i[b] || [],
|
|
2342
|
-
return w.push(_), _.isPrimaryKey || s.push(_), 1 <
|
|
2327
|
+
var b = mt(f), w = i[b] = i[b] || [], y = f == null ? 0 : typeof f == "string" ? 1 : f.length, _ = 0 < S, _ = l(l({}, p), { name: _ ? "".concat(b, "(virtual-from:").concat(p.name, ")") : p.name, lowLevelIndex: p, isVirtual: _, keyTail: S, keyLength: y, extractKey: En(f), unique: !_ && p.unique });
|
|
2328
|
+
return w.push(_), _.isPrimaryKey || s.push(_), 1 < y && u(y === 2 ? f[0] : f.slice(0, y - 1), S + 1, p), w.sort(function(E, O) {
|
|
2343
2329
|
return E.keyTail - O.keyTail;
|
|
2344
2330
|
}), _;
|
|
2345
2331
|
}
|
|
2346
2332
|
t = u(a.primaryKey.keyPath, 0, a.primaryKey), i[":id"] = [t];
|
|
2347
2333
|
for (var c = 0, h = a.indexes; c < h.length; c++) {
|
|
2348
|
-
var
|
|
2349
|
-
u(
|
|
2334
|
+
var g = h[c];
|
|
2335
|
+
u(g.keyPath, 0, g);
|
|
2350
2336
|
}
|
|
2351
2337
|
function v(f) {
|
|
2352
2338
|
var S, p = f.query.index;
|
|
2353
|
-
return p.isVirtual ?
|
|
2339
|
+
return p.isVirtual ? l(l({}, f), { query: { index: p.lowLevelIndex, range: (S = f.query.range, p = p.keyTail, { type: S.type === 1 ? 2 : S.type, lower: Yt(S.lower, S.lowerOpen ? e.MAX_KEY : e.MIN_KEY, p), lowerOpen: !0, upper: Yt(S.upper, S.upperOpen ? e.MIN_KEY : e.MAX_KEY, p), upperOpen: !0 }) } }) : f;
|
|
2354
2340
|
}
|
|
2355
|
-
return
|
|
2341
|
+
return l(l({}, n), { schema: l(l({}, a), { primaryKey: t, indexes: s, getIndexByKeyPath: function(f) {
|
|
2356
2342
|
return (f = i[mt(f)]) && f[0];
|
|
2357
2343
|
} }), count: function(f) {
|
|
2358
2344
|
return n.count(v(f));
|
|
@@ -2361,9 +2347,9 @@ function Ra() {
|
|
|
2361
2347
|
}, openCursor: function(f) {
|
|
2362
2348
|
var S = f.query.index, p = S.keyTail, b = S.isVirtual, w = S.keyLength;
|
|
2363
2349
|
return b ? n.openCursor(v(f)).then(function(_) {
|
|
2364
|
-
return _ &&
|
|
2350
|
+
return _ && y(_);
|
|
2365
2351
|
}) : n.openCursor(f);
|
|
2366
|
-
function
|
|
2352
|
+
function y(_) {
|
|
2367
2353
|
return Object.create(_, { continue: { value: function(E) {
|
|
2368
2354
|
E != null ? _.continue(Yt(E, f.reverse ? e.MAX_KEY : e.MIN_KEY, p)) : f.unique ? _.continue(_.key.slice(0, w).concat(f.reverse ? e.MIN_KEY : e.MAX_KEY, p)) : _.continue();
|
|
2369
2355
|
} }, continuePrimaryKey: { value: function(E, O) {
|
|
@@ -2392,10 +2378,10 @@ function Ra() {
|
|
|
2392
2378
|
return t.type === "delete" ? t.keys : t.keys || t.values.map(e.extractKey);
|
|
2393
2379
|
}
|
|
2394
2380
|
var ba = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
2395
|
-
return
|
|
2381
|
+
return l(l({}, e), { table: function(t) {
|
|
2396
2382
|
var n = e.table(t), a = n.schema.primaryKey;
|
|
2397
|
-
return
|
|
2398
|
-
var s = G.trans, u = s.table(t).hook, c = u.deleting, h = u.creating,
|
|
2383
|
+
return l(l({}, n), { mutate: function(i) {
|
|
2384
|
+
var s = G.trans, u = s.table(t).hook, c = u.deleting, h = u.creating, g = u.updating;
|
|
2399
2385
|
switch (i.type) {
|
|
2400
2386
|
case "add":
|
|
2401
2387
|
if (h.fire === J) break;
|
|
@@ -2403,7 +2389,7 @@ function Ra() {
|
|
|
2403
2389
|
return v(i);
|
|
2404
2390
|
}, !0);
|
|
2405
2391
|
case "put":
|
|
2406
|
-
if (h.fire === J &&
|
|
2392
|
+
if (h.fire === J && g.fire === J) break;
|
|
2407
2393
|
return s._promise("readwrite", function() {
|
|
2408
2394
|
return v(i);
|
|
2409
2395
|
}, !0);
|
|
@@ -2417,9 +2403,9 @@ function Ra() {
|
|
|
2417
2403
|
return s._promise("readwrite", function() {
|
|
2418
2404
|
return function f(S, p, b) {
|
|
2419
2405
|
return n.query({ trans: S, values: !1, query: { index: a, range: p }, limit: b }).then(function(w) {
|
|
2420
|
-
var
|
|
2421
|
-
return v({ type: "delete", keys:
|
|
2422
|
-
return 0 < _.numFailures ? Promise.reject(_.failures[0]) :
|
|
2406
|
+
var y = w.result;
|
|
2407
|
+
return v({ type: "delete", keys: y, trans: S }).then(function(_) {
|
|
2408
|
+
return 0 < _.numFailures ? Promise.reject(_.failures[0]) : y.length < b ? { failures: [], numFailures: 0, lastResult: void 0 } : f(S, l(l({}, p), { lower: y[y.length - 1], lowerOpen: !0 }), b);
|
|
2423
2409
|
});
|
|
2424
2410
|
});
|
|
2425
2411
|
}(i.trans, i.range, 1e4);
|
|
@@ -2427,24 +2413,24 @@ function Ra() {
|
|
|
2427
2413
|
}
|
|
2428
2414
|
return n.mutate(i);
|
|
2429
2415
|
function v(f) {
|
|
2430
|
-
var S, p, b, w = G.trans,
|
|
2431
|
-
if (!
|
|
2432
|
-
return (f = f.type === "add" || f.type === "put" ?
|
|
2433
|
-
var E =
|
|
2434
|
-
var P, T, I, C = _[
|
|
2435
|
-
return f.type === "delete" ? c.fire.call(j, O, C, w) : f.type === "add" || C === void 0 ? (P = h.fire.call(j, O, f.values[
|
|
2416
|
+
var S, p, b, w = G.trans, y = f.keys || Kn(a, f);
|
|
2417
|
+
if (!y) throw new Error("Keys missing");
|
|
2418
|
+
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)), S = n, b = y, ((p = f).type === "add" ? Promise.resolve([]) : S.getMany({ trans: p.trans, keys: b, cache: "immutable" })).then(function(_) {
|
|
2419
|
+
var E = y.map(function(O, A) {
|
|
2420
|
+
var P, T, I, C = _[A], j = { onerror: null, onsuccess: null };
|
|
2421
|
+
return f.type === "delete" ? c.fire.call(j, O, C, w) : f.type === "add" || C === void 0 ? (P = h.fire.call(j, O, f.values[A], w), O == null && P != null && (f.keys[A] = O = P, a.outbound || fe(f.values[A], a.keyPath, O))) : (P = Nn(C, f.values[A]), (T = g.fire.call(j, P, O, C, w)) && (I = f.values[A], Object.keys(T).forEach(function(R) {
|
|
2436
2422
|
ee(I, R) ? I[R] = T[R] : fe(I, R, T[R]);
|
|
2437
2423
|
}))), j;
|
|
2438
2424
|
});
|
|
2439
2425
|
return n.mutate(f).then(function(O) {
|
|
2440
|
-
for (var
|
|
2441
|
-
var C = (P ||
|
|
2442
|
-
C == null ? j.onerror && j.onerror(
|
|
2426
|
+
for (var A = O.failures, P = O.results, T = O.numFailures, O = O.lastResult, I = 0; I < y.length; ++I) {
|
|
2427
|
+
var C = (P || y)[I], j = E[I];
|
|
2428
|
+
C == null ? j.onerror && j.onerror(A[I]) : j.onsuccess && j.onsuccess(f.type === "put" && _[I] ? f.values[I] : C);
|
|
2443
2429
|
}
|
|
2444
|
-
return { failures:
|
|
2430
|
+
return { failures: A, results: P, numFailures: T, lastResult: O };
|
|
2445
2431
|
}).catch(function(O) {
|
|
2446
|
-
return E.forEach(function(
|
|
2447
|
-
return
|
|
2432
|
+
return E.forEach(function(A) {
|
|
2433
|
+
return A.onerror && A.onerror(O);
|
|
2448
2434
|
}), Promise.reject(O);
|
|
2449
2435
|
});
|
|
2450
2436
|
});
|
|
@@ -2464,7 +2450,7 @@ function Ra() {
|
|
|
2464
2450
|
var va = { stack: "dbcore", level: -1, create: function(e) {
|
|
2465
2451
|
return { table: function(t) {
|
|
2466
2452
|
var n = e.table(t);
|
|
2467
|
-
return
|
|
2453
|
+
return l(l({}, n), { getMany: function(a) {
|
|
2468
2454
|
if (!a.cache) return n.getMany(a);
|
|
2469
2455
|
var i = Or(a.keys, a.trans._cache, a.cache === "clone");
|
|
2470
2456
|
return i ? B.resolve(i) : n.getMany(a).then(function(s) {
|
|
@@ -2475,10 +2461,10 @@ function Ra() {
|
|
|
2475
2461
|
} });
|
|
2476
2462
|
} };
|
|
2477
2463
|
} };
|
|
2478
|
-
function
|
|
2464
|
+
function xr(e, t) {
|
|
2479
2465
|
return e.trans.mode === "readonly" && !!e.subscr && !e.trans.explicit && e.trans.db._options.cache !== "disabled" && !t.schema.primaryKey.outbound;
|
|
2480
2466
|
}
|
|
2481
|
-
function
|
|
2467
|
+
function Ar(e, t) {
|
|
2482
2468
|
switch (e) {
|
|
2483
2469
|
case "query":
|
|
2484
2470
|
return t.values && !t.unique;
|
|
@@ -2491,20 +2477,20 @@ function Ra() {
|
|
|
2491
2477
|
}
|
|
2492
2478
|
var wa = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2493
2479
|
var t = e.schema.name, n = new oe(e.MIN_KEY, e.MAX_KEY);
|
|
2494
|
-
return
|
|
2480
|
+
return l(l({}, e), { transaction: function(a, i, s) {
|
|
2495
2481
|
if (G.subscr && i !== "readonly") throw new $.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(G.querier));
|
|
2496
2482
|
return e.transaction(a, i, s);
|
|
2497
2483
|
}, table: function(a) {
|
|
2498
|
-
var i = e.table(a), s = i.schema, u = s.primaryKey, f = s.indexes, c = u.extractKey, h = u.outbound,
|
|
2484
|
+
var i = e.table(a), s = i.schema, u = s.primaryKey, f = s.indexes, c = u.extractKey, h = u.outbound, g = u.autoIncrement && f.filter(function(p) {
|
|
2499
2485
|
return p.compound && p.keyPath.includes(u.keyPath);
|
|
2500
|
-
}), v =
|
|
2486
|
+
}), v = l(l({}, i), { mutate: function(p) {
|
|
2501
2487
|
function b(R) {
|
|
2502
2488
|
return R = "idb://".concat(t, "/").concat(a, "/").concat(R), O[R] || (O[R] = new oe());
|
|
2503
2489
|
}
|
|
2504
|
-
var w,
|
|
2490
|
+
var w, y, _, E = p.trans, O = p.mutatedParts || (p.mutatedParts = {}), A = b(""), P = b(":dels"), T = p.type, j = p.type === "deleteRange" ? [p.range] : p.type === "delete" ? [p.keys] : p.values.length < 50 ? [Kn(u, p).filter(function(R) {
|
|
2505
2491
|
return R;
|
|
2506
2492
|
}), p.values] : [], I = j[0], C = j[1], j = p.trans._cache;
|
|
2507
|
-
return U(I) ? (
|
|
2493
|
+
return U(I) ? (A.addKeys(I), (j = T === "delete" || I.length === C.length ? Or(I, j) : null) || P.addKeys(I), (j || C) && (w = b, y = j, _ = C, s.indexes.forEach(function(R) {
|
|
2508
2494
|
var L = w(R.name || "");
|
|
2509
2495
|
function W(H) {
|
|
2510
2496
|
return H != null ? R.extractKey(H) : null;
|
|
@@ -2514,14 +2500,14 @@ function Ra() {
|
|
|
2514
2500
|
return L.addKey(pe);
|
|
2515
2501
|
}) : L.addKey(H);
|
|
2516
2502
|
}
|
|
2517
|
-
(
|
|
2518
|
-
var F =
|
|
2503
|
+
(y || _).forEach(function(H, ue) {
|
|
2504
|
+
var F = y && W(y[ue]), ue = _ && W(_[ue]);
|
|
2519
2505
|
Y(F, ue) !== 0 && (F != null && z(F), ue != null && z(ue));
|
|
2520
2506
|
});
|
|
2521
|
-
}))) : I ? (C = { from: (C = I.lower) !== null && C !== void 0 ? C : e.MIN_KEY, to: (C = I.upper) !== null && C !== void 0 ? C : e.MAX_KEY }, P.add(C),
|
|
2507
|
+
}))) : I ? (C = { from: (C = I.lower) !== null && C !== void 0 ? C : e.MIN_KEY, to: (C = I.upper) !== null && C !== void 0 ? C : e.MAX_KEY }, P.add(C), A.add(C)) : (A.add(n), P.add(n), s.indexes.forEach(function(R) {
|
|
2522
2508
|
return b(R.name).add(n);
|
|
2523
2509
|
})), i.mutate(p).then(function(R) {
|
|
2524
|
-
return !I || p.type !== "add" && p.type !== "put" || (
|
|
2510
|
+
return !I || p.type !== "add" && p.type !== "put" || (A.addKeys(R.results), g && g.forEach(function(L) {
|
|
2525
2511
|
for (var W = p.values.map(function(F) {
|
|
2526
2512
|
return L.extractKey(F);
|
|
2527
2513
|
}), z = L.keyPath.findIndex(function(F) {
|
|
@@ -2540,28 +2526,28 @@ function Ra() {
|
|
|
2540
2526
|
}, count: f, query: f, openCursor: f };
|
|
2541
2527
|
return K(S).forEach(function(p) {
|
|
2542
2528
|
v[p] = function(b) {
|
|
2543
|
-
var w = G.subscr,
|
|
2544
|
-
if (
|
|
2529
|
+
var w = G.subscr, y = !!w, _ = xr(G, i) && Ar(p, b) ? b.obsSet = {} : w;
|
|
2530
|
+
if (y) {
|
|
2545
2531
|
var E = function(C) {
|
|
2546
2532
|
return C = "idb://".concat(t, "/").concat(a, "/").concat(C), _[C] || (_[C] = new oe());
|
|
2547
|
-
}, O = E(""),
|
|
2548
|
-
if ((p === "query" &&
|
|
2533
|
+
}, O = E(""), A = E(":dels"), w = S[p](b), y = w[0], w = w[1];
|
|
2534
|
+
if ((p === "query" && y.isPrimaryKey && !b.values ? A : E(y.name || "")).add(w), !y.isPrimaryKey) {
|
|
2549
2535
|
if (p !== "count") {
|
|
2550
|
-
var P = p === "query" && h && b.values && i.query(
|
|
2536
|
+
var P = p === "query" && h && b.values && i.query(l(l({}, b), { values: !1 }));
|
|
2551
2537
|
return i[p].apply(this, arguments).then(function(C) {
|
|
2552
2538
|
if (p === "query") {
|
|
2553
2539
|
if (h && b.values) return P.then(function(W) {
|
|
2554
2540
|
return W = W.result, O.addKeys(W), C;
|
|
2555
2541
|
});
|
|
2556
2542
|
var j = b.values ? C.result.map(c) : C.result;
|
|
2557
|
-
(b.values ? O :
|
|
2543
|
+
(b.values ? O : A).addKeys(j);
|
|
2558
2544
|
} else if (p === "openCursor") {
|
|
2559
2545
|
var R = C, L = b.values;
|
|
2560
2546
|
return R && Object.create(R, { key: { get: function() {
|
|
2561
|
-
return
|
|
2547
|
+
return A.addKey(R.primaryKey), R.key;
|
|
2562
2548
|
} }, primaryKey: { get: function() {
|
|
2563
2549
|
var W = R.primaryKey;
|
|
2564
|
-
return
|
|
2550
|
+
return A.addKey(W), W;
|
|
2565
2551
|
} }, value: { get: function() {
|
|
2566
2552
|
return L && O.addKey(R.primaryKey), R.value;
|
|
2567
2553
|
} } });
|
|
@@ -2569,7 +2555,7 @@ function Ra() {
|
|
|
2569
2555
|
return C;
|
|
2570
2556
|
});
|
|
2571
2557
|
}
|
|
2572
|
-
|
|
2558
|
+
A.add(n);
|
|
2573
2559
|
}
|
|
2574
2560
|
}
|
|
2575
2561
|
return i[p].apply(this, arguments);
|
|
@@ -2581,7 +2567,7 @@ function Ra() {
|
|
|
2581
2567
|
if (n.numFailures === 0) return t;
|
|
2582
2568
|
if (t.type === "deleteRange") return null;
|
|
2583
2569
|
var a = t.keys ? t.keys.length : "values" in t && t.values ? t.values.length : 1;
|
|
2584
|
-
return n.numFailures === a ? null : (t =
|
|
2570
|
+
return n.numFailures === a ? null : (t = l({}, t), U(t.keys) && (t.keys = t.keys.filter(function(i, s) {
|
|
2585
2571
|
return !(s in n.failures);
|
|
2586
2572
|
})), "values" in t && U(t.values) && (t.values = t.values.filter(function(i, s) {
|
|
2587
2573
|
return !(s in n.failures);
|
|
@@ -2593,52 +2579,52 @@ function Ra() {
|
|
|
2593
2579
|
}
|
|
2594
2580
|
function Dr(e, t, S, a, i, s) {
|
|
2595
2581
|
if (!S || S.length === 0) return e;
|
|
2596
|
-
var u = t.query.index, c = u.multiEntry, h = t.query.range,
|
|
2597
|
-
var w = p,
|
|
2582
|
+
var u = t.query.index, c = u.multiEntry, h = t.query.range, g = a.schema.primaryKey.extractKey, v = u.extractKey, f = (u.lowLevelIndex || u).extractKey, S = S.reduce(function(p, b) {
|
|
2583
|
+
var w = p, y = [];
|
|
2598
2584
|
if (b.type === "add" || b.type === "put") for (var _ = new oe(), E = b.values.length - 1; 0 <= E; --E) {
|
|
2599
|
-
var O,
|
|
2600
|
-
_.hasKey(P) || (O = v(
|
|
2585
|
+
var O, A = b.values[E], P = g(A);
|
|
2586
|
+
_.hasKey(P) || (O = v(A), (c && U(O) ? O.some(function(R) {
|
|
2601
2587
|
return Bn(R, h);
|
|
2602
|
-
}) : Bn(O, h)) && (_.addKey(P),
|
|
2588
|
+
}) : Bn(O, h)) && (_.addKey(P), y.push(A)));
|
|
2603
2589
|
}
|
|
2604
2590
|
switch (b.type) {
|
|
2605
2591
|
case "add":
|
|
2606
2592
|
var T = new oe().addKeys(t.values ? p.map(function(L) {
|
|
2607
|
-
return
|
|
2608
|
-
}) : p), w = p.concat(t.values ?
|
|
2609
|
-
return L =
|
|
2610
|
-
}) :
|
|
2611
|
-
return
|
|
2593
|
+
return g(L);
|
|
2594
|
+
}) : p), w = p.concat(t.values ? y.filter(function(L) {
|
|
2595
|
+
return L = g(L), !T.hasKey(L) && (T.addKey(L), !0);
|
|
2596
|
+
}) : y.map(function(L) {
|
|
2597
|
+
return g(L);
|
|
2612
2598
|
}).filter(function(L) {
|
|
2613
2599
|
return !T.hasKey(L) && (T.addKey(L), !0);
|
|
2614
2600
|
}));
|
|
2615
2601
|
break;
|
|
2616
2602
|
case "put":
|
|
2617
2603
|
var I = new oe().addKeys(b.values.map(function(L) {
|
|
2618
|
-
return
|
|
2604
|
+
return g(L);
|
|
2619
2605
|
}));
|
|
2620
2606
|
w = p.filter(function(L) {
|
|
2621
|
-
return !I.hasKey(t.values ?
|
|
2622
|
-
}).concat(t.values ?
|
|
2623
|
-
return
|
|
2607
|
+
return !I.hasKey(t.values ? g(L) : L);
|
|
2608
|
+
}).concat(t.values ? y : y.map(function(L) {
|
|
2609
|
+
return g(L);
|
|
2624
2610
|
}));
|
|
2625
2611
|
break;
|
|
2626
2612
|
case "delete":
|
|
2627
2613
|
var C = new oe().addKeys(b.keys);
|
|
2628
2614
|
w = p.filter(function(L) {
|
|
2629
|
-
return !C.hasKey(t.values ?
|
|
2615
|
+
return !C.hasKey(t.values ? g(L) : L);
|
|
2630
2616
|
});
|
|
2631
2617
|
break;
|
|
2632
2618
|
case "deleteRange":
|
|
2633
2619
|
var j = b.range;
|
|
2634
2620
|
w = p.filter(function(L) {
|
|
2635
|
-
return !Bn(
|
|
2621
|
+
return !Bn(g(L), j);
|
|
2636
2622
|
});
|
|
2637
2623
|
}
|
|
2638
2624
|
return w;
|
|
2639
2625
|
}, e);
|
|
2640
2626
|
return S === e ? e : (S.sort(function(p, b) {
|
|
2641
|
-
return Y(f(p), f(b)) || Y(
|
|
2627
|
+
return Y(f(p), f(b)) || Y(g(p), g(b));
|
|
2642
2628
|
}), t.limit && t.limit < 1 / 0 && (S.length > t.limit ? S.length = t.limit : e.length === t.limit && S.length < t.limit && (i.dirty = !0)), s ? Object.freeze(S) : S);
|
|
2643
2629
|
}
|
|
2644
2630
|
function Pr(e, t) {
|
|
@@ -2675,33 +2661,33 @@ function Ra() {
|
|
|
2675
2661
|
}
|
|
2676
2662
|
var Ea = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
|
|
2677
2663
|
var t = e.schema.name;
|
|
2678
|
-
return
|
|
2664
|
+
return l(l({}, e), { transaction: function(n, a, i) {
|
|
2679
2665
|
var s, u, c = e.transaction(n, a, i);
|
|
2680
2666
|
return a === "readwrite" && (u = (s = new AbortController()).signal, i = function(h) {
|
|
2681
2667
|
return function() {
|
|
2682
2668
|
if (s.abort(), a === "readwrite") {
|
|
2683
|
-
for (var
|
|
2669
|
+
for (var g = /* @__PURE__ */ new Set(), v = 0, f = n; v < f.length; v++) {
|
|
2684
2670
|
var S = f[v], p = Fe["idb://".concat(t, "/").concat(S)];
|
|
2685
2671
|
if (p) {
|
|
2686
2672
|
var b = e.table(S), w = p.optimisticOps.filter(function(L) {
|
|
2687
2673
|
return L.trans === c;
|
|
2688
2674
|
});
|
|
2689
|
-
if (c._explicit && h && c.mutatedParts) for (var
|
|
2690
|
-
return
|
|
2675
|
+
if (c._explicit && h && c.mutatedParts) for (var y = 0, _ = Object.values(p.queries.query); y < _.length; y++) for (var E = 0, O = (T = _[y]).slice(); E < O.length; E++) Cn((I = O[E]).obsSet, c.mutatedParts) && (Me(T, I), I.subscribers.forEach(function(L) {
|
|
2676
|
+
return g.add(L);
|
|
2691
2677
|
}));
|
|
2692
2678
|
else if (0 < w.length) {
|
|
2693
2679
|
p.optimisticOps = p.optimisticOps.filter(function(L) {
|
|
2694
2680
|
return L.trans !== c;
|
|
2695
2681
|
});
|
|
2696
|
-
for (var
|
|
2697
|
-
return
|
|
2682
|
+
for (var A = 0, P = Object.values(p.queries.query); A < P.length; A++) for (var T, I, C, j = 0, R = (T = P[A]).slice(); j < R.length; j++) (I = R[j]).res != null && c.mutatedParts && (h && !I.dirty ? (C = Object.isFrozen(I.res), C = Dr(I.res, I.req, w, b, I, C), I.dirty ? (Me(T, I), I.subscribers.forEach(function(L) {
|
|
2683
|
+
return g.add(L);
|
|
2698
2684
|
})) : C !== I.res && (I.res = C, I.promise = B.resolve({ result: C }))) : (I.dirty && Me(T, I), I.subscribers.forEach(function(L) {
|
|
2699
|
-
return
|
|
2685
|
+
return g.add(L);
|
|
2700
2686
|
})));
|
|
2701
2687
|
}
|
|
2702
2688
|
}
|
|
2703
2689
|
}
|
|
2704
|
-
|
|
2690
|
+
g.forEach(function(L) {
|
|
2705
2691
|
return L();
|
|
2706
2692
|
});
|
|
2707
2693
|
}
|
|
@@ -2709,7 +2695,7 @@ function Ra() {
|
|
|
2709
2695
|
}, c.addEventListener("abort", i(!1), { signal: u }), c.addEventListener("error", i(!1), { signal: u }), c.addEventListener("complete", i(!0), { signal: u })), c;
|
|
2710
2696
|
}, table: function(n) {
|
|
2711
2697
|
var a = e.table(n), i = a.schema.primaryKey;
|
|
2712
|
-
return
|
|
2698
|
+
return l(l({}, a), { mutate: function(s) {
|
|
2713
2699
|
var u = G.trans;
|
|
2714
2700
|
if (i.outbound || u.db._options.cache === "disabled" || u.explicit || u.idbtrans.mode !== "readwrite") return a.mutate(s);
|
|
2715
2701
|
var c = Fe["idb://".concat(t, "/").concat(n)];
|
|
@@ -2720,40 +2706,40 @@ function Ra() {
|
|
|
2720
2706
|
}), u.catch(function() {
|
|
2721
2707
|
Me(c.optimisticOps, s), s.mutatedParts && Ht(s.mutatedParts);
|
|
2722
2708
|
})) : u.then(function(h) {
|
|
2723
|
-
var
|
|
2709
|
+
var g = kr(0, l(l({}, s), { values: s.values.map(function(v, f) {
|
|
2724
2710
|
var S;
|
|
2725
|
-
return h.failures[f] ? v : (v = (S = i.keyPath) !== null && S !== void 0 && S.includes(".") ? Te(v) :
|
|
2711
|
+
return h.failures[f] ? v : (v = (S = i.keyPath) !== null && S !== void 0 && S.includes(".") ? Te(v) : l({}, v), fe(v, i.keyPath, h.results[f]), v);
|
|
2726
2712
|
}) }), h);
|
|
2727
|
-
c.optimisticOps.push(
|
|
2713
|
+
c.optimisticOps.push(g), queueMicrotask(function() {
|
|
2728
2714
|
return s.mutatedParts && Ht(s.mutatedParts);
|
|
2729
2715
|
});
|
|
2730
2716
|
}), u) : a.mutate(s);
|
|
2731
2717
|
}, query: function(s) {
|
|
2732
|
-
if (!
|
|
2733
|
-
var u = ((
|
|
2718
|
+
if (!xr(G, a) || !Ar("query", s)) return a.query(s);
|
|
2719
|
+
var u = ((g = G.trans) === null || g === void 0 ? void 0 : g.db._options.cache) === "immutable", f = G, c = f.requery, h = f.signal, g = function(b, w, y, _) {
|
|
2734
2720
|
var E = Fe["idb://".concat(b, "/").concat(w)];
|
|
2735
2721
|
if (!E) return [];
|
|
2736
|
-
if (!(w = E.queries[
|
|
2722
|
+
if (!(w = E.queries[y])) return [null, !1, E, null];
|
|
2737
2723
|
var O = w[(_.query ? _.query.index.name : null) || ""];
|
|
2738
2724
|
if (!O) return [null, !1, E, null];
|
|
2739
|
-
switch (
|
|
2725
|
+
switch (y) {
|
|
2740
2726
|
case "query":
|
|
2741
|
-
var
|
|
2727
|
+
var A = O.find(function(P) {
|
|
2742
2728
|
return P.req.limit === _.limit && P.req.values === _.values && Pr(P.req.query.range, _.query.range);
|
|
2743
2729
|
});
|
|
2744
|
-
return
|
|
2730
|
+
return A ? [A, !0, E, O] : [O.find(function(P) {
|
|
2745
2731
|
return ("limit" in P.req ? P.req.limit : 1 / 0) >= _.limit && (!_.values || P.req.values) && Sa(P.req.query.range, _.query.range);
|
|
2746
2732
|
}), !1, E, O];
|
|
2747
2733
|
case "count":
|
|
2748
|
-
return
|
|
2734
|
+
return A = O.find(function(P) {
|
|
2749
2735
|
return Pr(P.req.query.range, _.query.range);
|
|
2750
|
-
}), [
|
|
2736
|
+
}), [A, !!A, E, O];
|
|
2751
2737
|
}
|
|
2752
|
-
}(t, n, "query", s), v =
|
|
2738
|
+
}(t, n, "query", s), v = g[0], f = g[1], S = g[2], p = g[3];
|
|
2753
2739
|
return v && f ? v.obsSet = s.obsSet : (f = a.query(s).then(function(b) {
|
|
2754
2740
|
var w = b.result;
|
|
2755
2741
|
if (v && (v.res = w), u) {
|
|
2756
|
-
for (var
|
|
2742
|
+
for (var y = 0, _ = w.length; y < _; ++y) Object.freeze(w[y]);
|
|
2757
2743
|
Object.freeze(w);
|
|
2758
2744
|
} else b.result = Te(w);
|
|
2759
2745
|
return b;
|
|
@@ -2800,7 +2786,7 @@ function Ra() {
|
|
|
2800
2786
|
})), this;
|
|
2801
2787
|
}, ne.prototype.open = function() {
|
|
2802
2788
|
var e = this;
|
|
2803
|
-
return Ge(
|
|
2789
|
+
return Ge(Ae, function() {
|
|
2804
2790
|
return ya(e);
|
|
2805
2791
|
});
|
|
2806
2792
|
}, ne.prototype._close = function() {
|
|
@@ -2829,8 +2815,8 @@ function Ra() {
|
|
|
2829
2815
|
t.close(e);
|
|
2830
2816
|
var c = t._deps.indexedDB.deleteDatabase(t.name);
|
|
2831
2817
|
c.onsuccess = q(function() {
|
|
2832
|
-
var h,
|
|
2833
|
-
h = t._deps,
|
|
2818
|
+
var h, g, v;
|
|
2819
|
+
h = t._deps, g = t.name, v = h.indexedDB, h = h.IDBKeyRange, Dn(v) || g === Tt || kn(v, h).delete(g).catch(J), i();
|
|
2834
2820
|
}), c.onerror = be(s), c.onblocked = t._fireOnBlocked;
|
|
2835
2821
|
}
|
|
2836
2822
|
if (n) throw new $.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
@@ -2866,9 +2852,9 @@ function Ra() {
|
|
|
2866
2852
|
var s, u, c = e.indexOf("?") !== -1;
|
|
2867
2853
|
e = e.replace("!", "").replace("?", "");
|
|
2868
2854
|
try {
|
|
2869
|
-
if (u = t.map(function(
|
|
2870
|
-
if (
|
|
2871
|
-
return
|
|
2855
|
+
if (u = t.map(function(g) {
|
|
2856
|
+
if (g = g instanceof a.Table ? g.name : g, typeof g != "string") throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
|
|
2857
|
+
return g;
|
|
2872
2858
|
}), e == "r" || e === gn) s = gn;
|
|
2873
2859
|
else {
|
|
2874
2860
|
if (e != "rw" && e != yn) throw new $.InvalidArgument("Invalid transaction mode: " + e);
|
|
@@ -2879,43 +2865,43 @@ function Ra() {
|
|
|
2879
2865
|
if (!c) throw new $.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
2880
2866
|
i = null;
|
|
2881
2867
|
}
|
|
2882
|
-
i && u.forEach(function(
|
|
2883
|
-
if (i && i.storeNames.indexOf(
|
|
2884
|
-
if (!c) throw new $.SubTransaction("Table " +
|
|
2868
|
+
i && u.forEach(function(g) {
|
|
2869
|
+
if (i && i.storeNames.indexOf(g) === -1) {
|
|
2870
|
+
if (!c) throw new $.SubTransaction("Table " + g + " not included in parent transaction.");
|
|
2885
2871
|
i = null;
|
|
2886
2872
|
}
|
|
2887
2873
|
}), c && i && !i.active && (i = null);
|
|
2888
2874
|
}
|
|
2889
|
-
} catch (
|
|
2875
|
+
} catch (g) {
|
|
2890
2876
|
return i ? i._promise(null, function(v, f) {
|
|
2891
|
-
f(
|
|
2892
|
-
}) : te(
|
|
2877
|
+
f(g);
|
|
2878
|
+
}) : te(g);
|
|
2893
2879
|
}
|
|
2894
|
-
var h = (function
|
|
2880
|
+
var h = (function g(v, f, S, p, b) {
|
|
2895
2881
|
return B.resolve().then(function() {
|
|
2896
|
-
var w = G.transless || G,
|
|
2897
|
-
if (
|
|
2882
|
+
var w = G.transless || G, y = v._createTransaction(f, S, v._dbSchema, p);
|
|
2883
|
+
if (y.explicit = !0, w = { trans: y, transless: w }, p) y.idbtrans = p.idbtrans;
|
|
2898
2884
|
else try {
|
|
2899
|
-
|
|
2885
|
+
y.create(), y.idbtrans._explicit = !0, v._state.PR1398_maxLoop = 3;
|
|
2900
2886
|
} catch (O) {
|
|
2901
2887
|
return O.name === an.InvalidState && v.isOpen() && 0 < --v._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), v.close({ disableAutoOpen: !1 }), v.open().then(function() {
|
|
2902
|
-
return
|
|
2888
|
+
return g(v, f, S, null, b);
|
|
2903
2889
|
})) : te(O);
|
|
2904
2890
|
}
|
|
2905
2891
|
var _, E = rn(b);
|
|
2906
2892
|
return E && qe(), w = B.follow(function() {
|
|
2907
2893
|
var O;
|
|
2908
|
-
(_ = b.call(
|
|
2894
|
+
(_ = b.call(y, y)) && (E ? (O = De.bind(null, null), _.then(O, O)) : typeof _.next == "function" && typeof _.throw == "function" && (_ = jn(_)));
|
|
2909
2895
|
}, w), (_ && typeof _.then == "function" ? B.resolve(_).then(function(O) {
|
|
2910
|
-
return
|
|
2896
|
+
return y.active ? O : te(new $.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
2911
2897
|
}) : w.then(function() {
|
|
2912
2898
|
return _;
|
|
2913
2899
|
})).then(function(O) {
|
|
2914
|
-
return p &&
|
|
2900
|
+
return p && y._resolve(), y._completion.then(function() {
|
|
2915
2901
|
return O;
|
|
2916
2902
|
});
|
|
2917
2903
|
}).catch(function(O) {
|
|
2918
|
-
return
|
|
2904
|
+
return y._reject(O), te(O);
|
|
2919
2905
|
});
|
|
2920
2906
|
});
|
|
2921
2907
|
}).bind(null, this, s, u, i, n);
|
|
@@ -2930,42 +2916,42 @@ function Ra() {
|
|
|
2930
2916
|
var n = this;
|
|
2931
2917
|
this._middlewares = {}, this.verno = 0;
|
|
2932
2918
|
var a = ne.dependencies;
|
|
2933
|
-
this._options = t =
|
|
2934
|
-
var i, s, u, c, h,
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
}),
|
|
2938
|
-
|
|
2939
|
-
}), this._state =
|
|
2919
|
+
this._options = t = l({ addons: ne.addons, autoOpen: !0, indexedDB: a.indexedDB, IDBKeyRange: a.IDBKeyRange, cache: "cloned" }, t), this._deps = { indexedDB: t.indexedDB, IDBKeyRange: t.IDBKeyRange }, a = t.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
2920
|
+
var i, s, u, c, h, g = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: J, dbReadyPromise: null, cancelOpen: J, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
|
|
2921
|
+
g.dbReadyPromise = new B(function(f) {
|
|
2922
|
+
g.dbReadyResolve = f;
|
|
2923
|
+
}), g.openCanceller = new B(function(f, S) {
|
|
2924
|
+
g.cancelOpen = S;
|
|
2925
|
+
}), this._state = g, this.name = e, this.on = dt(this, "populate", "blocked", "versionchange", "close", { ready: [sn, J] }), this.on.ready.subscribe = Hn(this.on.ready.subscribe, function(f) {
|
|
2940
2926
|
return function(S, p) {
|
|
2941
2927
|
ne.vip(function() {
|
|
2942
2928
|
var b, w = n._state;
|
|
2943
|
-
w.openComplete ? (w.dbOpenError || B.resolve().then(S), p && f(S)) : w.onReadyBeingFired ? (w.onReadyBeingFired.push(S), p && f(S)) : (f(S), b = n, p || f(function
|
|
2944
|
-
b.on.ready.unsubscribe(S), b.on.ready.unsubscribe(
|
|
2929
|
+
w.openComplete ? (w.dbOpenError || B.resolve().then(S), p && f(S)) : w.onReadyBeingFired ? (w.onReadyBeingFired.push(S), p && f(S)) : (f(S), b = n, p || f(function y() {
|
|
2930
|
+
b.on.ready.unsubscribe(S), b.on.ready.unsubscribe(y);
|
|
2945
2931
|
}));
|
|
2946
2932
|
});
|
|
2947
2933
|
};
|
|
2948
|
-
}), this.Collection = (i = this, ft(ia.prototype, function(_,
|
|
2934
|
+
}), this.Collection = (i = this, ft(ia.prototype, function(_, y) {
|
|
2949
2935
|
this.db = i;
|
|
2950
2936
|
var p = sr, b = null;
|
|
2951
|
-
if (
|
|
2952
|
-
p =
|
|
2937
|
+
if (y) try {
|
|
2938
|
+
p = y();
|
|
2953
2939
|
} catch (E) {
|
|
2954
2940
|
b = E;
|
|
2955
2941
|
}
|
|
2956
|
-
var w = _._ctx,
|
|
2957
|
-
this._ctx = { table:
|
|
2942
|
+
var w = _._ctx, y = w.table, _ = y.hook.reading.fire;
|
|
2943
|
+
this._ctx = { table: y, index: w.index, isPrimKey: !w.index || y.schema.primKey.keyPath && w.index === y.schema.primKey.name, range: p, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: b, or: w.or, valueMapper: _ !== st ? _ : null };
|
|
2958
2944
|
})), this.Table = (s = this, ft(lr.prototype, function(f, S, p) {
|
|
2959
2945
|
this.db = s, this._tx = p, this.name = f, this.schema = S, this.hook = s._allTables[f] ? s._allTables[f].hook : dt(null, { creating: [Jr, J], reading: [Xr, st], updating: [Zr, J], deleting: [Vr, J] });
|
|
2960
2946
|
})), this.Transaction = (u = this, ft(ua.prototype, function(f, S, p, b, w) {
|
|
2961
|
-
var
|
|
2947
|
+
var y = this;
|
|
2962
2948
|
this.db = u, this.mode = f, this.storeNames = S, this.schema = p, this.chromeTransactionDurability = b, this.idbtrans = null, this.on = dt(this, "complete", "error", "abort"), this.parent = w || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new B(function(_, E) {
|
|
2963
|
-
|
|
2949
|
+
y._resolve = _, y._reject = E;
|
|
2964
2950
|
}), this._completion.then(function() {
|
|
2965
|
-
|
|
2951
|
+
y.active = !1, y.on.complete.fire();
|
|
2966
2952
|
}, function(_) {
|
|
2967
|
-
var E =
|
|
2968
|
-
return
|
|
2953
|
+
var E = y.active;
|
|
2954
|
+
return y.active = !1, y.on.error.fire(_), y.parent ? y.parent._reject(_) : E && y.idbtrans && y.idbtrans.abort(), te(_);
|
|
2969
2955
|
});
|
|
2970
2956
|
})), this.Version = (c = this, ft(ga.prototype, function(f) {
|
|
2971
2957
|
this.db = c, this._cfg = { version: f, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
@@ -3021,7 +3007,7 @@ function Ra() {
|
|
|
3021
3007
|
}
|
|
3022
3008
|
function Ir(e) {
|
|
3023
3009
|
var t, n = !1, a = new Oa(function(i) {
|
|
3024
|
-
var s = rn(e), u, c = !1, h = {},
|
|
3010
|
+
var s = rn(e), u, c = !1, h = {}, g = {}, v = { get closed() {
|
|
3025
3011
|
return c;
|
|
3026
3012
|
}, unsubscribe: function() {
|
|
3027
3013
|
c || (c = !0, u && u.abort(), f && Ce.storagemutated.unsubscribe(p));
|
|
@@ -3030,23 +3016,23 @@ function Ra() {
|
|
|
3030
3016
|
var f = !1, S = function() {
|
|
3031
3017
|
return pn(b);
|
|
3032
3018
|
}, p = function(w) {
|
|
3033
|
-
zt(h, w), Cn(
|
|
3019
|
+
zt(h, w), Cn(g, h) && S();
|
|
3034
3020
|
}, b = function() {
|
|
3035
|
-
var w,
|
|
3021
|
+
var w, y, _;
|
|
3036
3022
|
!c && Xt.indexedDB && (h = {}, w = {}, u && u.abort(), u = new AbortController(), _ = function(E) {
|
|
3037
3023
|
var O = Ve();
|
|
3038
3024
|
try {
|
|
3039
3025
|
s && qe();
|
|
3040
|
-
var
|
|
3041
|
-
return
|
|
3026
|
+
var A = ke(e, E);
|
|
3027
|
+
return A = s ? A.finally(De) : A;
|
|
3042
3028
|
} finally {
|
|
3043
3029
|
O && Ze();
|
|
3044
3030
|
}
|
|
3045
|
-
}(
|
|
3046
|
-
n = !0, t = E, c ||
|
|
3047
|
-
for (var
|
|
3031
|
+
}(y = { subscr: w, signal: u.signal, requery: S, querier: e, trans: null }), Promise.resolve(_).then(function(E) {
|
|
3032
|
+
n = !0, t = E, c || y.signal.aborted || (h = {}, function(O) {
|
|
3033
|
+
for (var A in O) if (ee(O, A)) return;
|
|
3048
3034
|
return 1;
|
|
3049
|
-
}(
|
|
3035
|
+
}(g = w) || f || (Ce(gt, p), f = !0), pn(function() {
|
|
3050
3036
|
return !c && i.next && i.next(E);
|
|
3051
3037
|
}));
|
|
3052
3038
|
}, function(E) {
|
|
@@ -3072,7 +3058,7 @@ function Ra() {
|
|
|
3072
3058
|
Re = t;
|
|
3073
3059
|
}
|
|
3074
3060
|
}
|
|
3075
|
-
le(We,
|
|
3061
|
+
le(We, l(l({}, Ot), { delete: function(e) {
|
|
3076
3062
|
return new We(e, { addons: [] }).delete();
|
|
3077
3063
|
}, exists: function(e) {
|
|
3078
3064
|
return new We(e, { addons: [] }).open().then(function(t) {
|
|
@@ -3152,10 +3138,10 @@ function Ra() {
|
|
|
3152
3138
|
}), addEventListener("pageshow", function(e) {
|
|
3153
3139
|
!Ee.disableBfCache && e.persisted && (me && console.debug("Dexie: handling persisted pageshow"), Cr(), Gn({ all: new oe(-1 / 0, [[]]) }));
|
|
3154
3140
|
})), B.rejectionMapper = function(e, t) {
|
|
3155
|
-
return !e || e instanceof Xe || e instanceof TypeError || e instanceof SyntaxError || !e.name || !Zn[e.name] ? e : (t = new Zn[e.name](t || e.message, e), "stack" in e &&
|
|
3141
|
+
return !e || e instanceof Xe || e instanceof TypeError || e instanceof SyntaxError || !e.name || !Zn[e.name] ? e : (t = new Zn[e.name](t || e.message, e), "stack" in e && xe(t, "stack", { get: function() {
|
|
3156
3142
|
return this.inner.stack;
|
|
3157
3143
|
} }), t);
|
|
3158
|
-
}, qn(me),
|
|
3144
|
+
}, qn(me), l(Ee, Object.freeze({ __proto__: null, Dexie: Ee, liveQuery: Ir, Entity: or, cmp: Y, PropModification: ht, replacePrefix: function(e, t) {
|
|
3159
3145
|
return new ht({ replacePrefix: [e, t] });
|
|
3160
3146
|
}, add: function(e) {
|
|
3161
3147
|
return new ht({ add: e });
|
|
@@ -3169,33 +3155,33 @@ var Ta = Ra();
|
|
|
3169
3155
|
const Wn = /* @__PURE__ */ Ia(Ta), Tr = Symbol.for("Dexie"), en = globalThis[Tr] || (globalThis[Tr] = Wn);
|
|
3170
3156
|
if (Wn.semVer !== en.semVer)
|
|
3171
3157
|
throw new Error(`Two different versions of Dexie loaded in the same app: ${Wn.semVer} and ${en.semVer}`);
|
|
3172
|
-
function V(
|
|
3173
|
-
let r = `${
|
|
3174
|
-
return
|
|
3158
|
+
function V(d) {
|
|
3159
|
+
let r = `${d.type}.${d.topics}`;
|
|
3160
|
+
return d.order && (r += `.${d.order}`), d.period && (r += `.${d.period}`), r;
|
|
3175
3161
|
}
|
|
3176
|
-
function Mr(
|
|
3162
|
+
function Mr(d) {
|
|
3177
3163
|
var r;
|
|
3178
|
-
if (
|
|
3179
|
-
const o = (r =
|
|
3180
|
-
o && o.length > 1 ? (
|
|
3164
|
+
if (d.widget === void 0) {
|
|
3165
|
+
const o = (r = d.topics) == null ? void 0 : r.split("-");
|
|
3166
|
+
o && o.length > 1 ? (d.dashboard = o ? o[0] : "", d.widget = o ? o[1] : "") : (d.widget = d.topics, d.dashboard = d.slide);
|
|
3181
3167
|
}
|
|
3182
|
-
return
|
|
3168
|
+
return d.topics === void 0 && (d.topics = `${d.dashboard}-${d.widget}`), d;
|
|
3183
3169
|
}
|
|
3184
|
-
function St(
|
|
3170
|
+
function St(d, r) {
|
|
3185
3171
|
var U;
|
|
3186
|
-
let o,
|
|
3187
|
-
switch (
|
|
3172
|
+
let o, l, x, D, K;
|
|
3173
|
+
switch (d.moderation) {
|
|
3188
3174
|
case Zt.BEFORE:
|
|
3189
|
-
o = /* @__PURE__ */ new Date(),
|
|
3175
|
+
o = /* @__PURE__ */ new Date(), l = (U = d.beforeTime) == null ? void 0 : U.split(":"), x = Number.parseInt(l ? l[0] : "00"), D = Number.parseInt(l ? l[1] : "00"), K = Number.parseInt(l ? l[2] : "00"), r.before = o.setHours(x, D, K, 0) / 1e3, r.period || (r.period = o.getDay() === 1 ? 72 : 24);
|
|
3190
3176
|
break;
|
|
3191
3177
|
case Zt.DELAYED:
|
|
3192
|
-
|
|
3178
|
+
d.delay && d.delay > 0 && (r.delay = `${d.delay}`);
|
|
3193
3179
|
break;
|
|
3194
3180
|
case Zt.APPROVED:
|
|
3195
3181
|
r.approved = "1";
|
|
3196
3182
|
break;
|
|
3197
3183
|
default:
|
|
3198
|
-
|
|
3184
|
+
d.period !== 0 && (r.period = d.period);
|
|
3199
3185
|
}
|
|
3200
3186
|
return r;
|
|
3201
3187
|
}
|
|
@@ -3213,9 +3199,9 @@ class jr {
|
|
|
3213
3199
|
const o = await this.db.table(N.CLOUD).where({ id: r.widget }).last().catch(() => {
|
|
3214
3200
|
console.warn(
|
|
3215
3201
|
"%capi%C %ccloud",
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3202
|
+
m.API,
|
|
3203
|
+
m.NONE,
|
|
3204
|
+
m.CLOUD,
|
|
3219
3205
|
r.slide,
|
|
3220
3206
|
r.widget
|
|
3221
3207
|
);
|
|
@@ -3231,9 +3217,9 @@ class jr {
|
|
|
3231
3217
|
const o = await this.db.table(N.SERIES).where({ id: r.widget }).last().catch(() => {
|
|
3232
3218
|
console.warn(
|
|
3233
3219
|
"%capi%c %cseries",
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3220
|
+
m.API,
|
|
3221
|
+
m.NONE,
|
|
3222
|
+
m.SERIES,
|
|
3237
3223
|
r.slide,
|
|
3238
3224
|
r.widget
|
|
3239
3225
|
);
|
|
@@ -3248,9 +3234,9 @@ class jr {
|
|
|
3248
3234
|
k(this, "getMessages", async (r) => {
|
|
3249
3235
|
const o = (r == null ? void 0 : r.order) ?? "utc";
|
|
3250
3236
|
o !== "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);
|
|
3251
|
-
const
|
|
3237
|
+
const l = (K) => K.utc > ((r == null ? void 0 : r.since) || 0), x = (K) => K.utc < ((r == null ? void 0 : r.before) || Date.now() / 1e3), D = (K) => (K == null ? void 0 : K.visible) !== 0;
|
|
3252
3238
|
try {
|
|
3253
|
-
const U = await this.db.table(N.TOPICS).where("widget_id").equals(r.widget).filter(D).filter(
|
|
3239
|
+
const U = 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(o);
|
|
3254
3240
|
if (U.length === 0)
|
|
3255
3241
|
return { data: null, message: "No Messages error", success: !1 };
|
|
3256
3242
|
let M = U.map((X) => this.db.table(N.MESSAGES).get({ id: X.message_id }));
|
|
@@ -3269,18 +3255,18 @@ class jr {
|
|
|
3269
3255
|
};
|
|
3270
3256
|
return console.debug(
|
|
3271
3257
|
"%cstorage%c %cmessages",
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3258
|
+
m.STORAGE,
|
|
3259
|
+
m.NONE,
|
|
3260
|
+
m.MESSAGES,
|
|
3275
3261
|
ee
|
|
3276
3262
|
), ee;
|
|
3277
3263
|
});
|
|
3278
3264
|
} catch (K) {
|
|
3279
3265
|
return console.warn(
|
|
3280
3266
|
"%cstorage%c %cmessages",
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3267
|
+
m.STORAGE,
|
|
3268
|
+
m.NONE,
|
|
3269
|
+
m.MESSAGES,
|
|
3284
3270
|
r,
|
|
3285
3271
|
K
|
|
3286
3272
|
), { data: null, message: "Messages Data error", success: !1 };
|
|
@@ -3297,7 +3283,7 @@ class jr {
|
|
|
3297
3283
|
dashboard_id: r.dashboard,
|
|
3298
3284
|
//data: data.data,
|
|
3299
3285
|
data: o
|
|
3300
|
-
}).then(() => 201).catch((
|
|
3286
|
+
}).then(() => 201).catch((l) => (console.error("%cstorage", m.STORAGE, "set", r, l.message), 400)) : 400);
|
|
3301
3287
|
/**
|
|
3302
3288
|
* Update Series
|
|
3303
3289
|
* @param query IQuery
|
|
@@ -3309,7 +3295,7 @@ class jr {
|
|
|
3309
3295
|
dashboard_id: r.dashboard,
|
|
3310
3296
|
//data: data.data,
|
|
3311
3297
|
data: o
|
|
3312
|
-
}).then(() => 201).catch((
|
|
3298
|
+
}).then(() => 201).catch((l) => (console.error("%cstorage", m.STORAGE, "set", r, l.message), 400)) : 400);
|
|
3313
3299
|
/**
|
|
3314
3300
|
* Update Messages
|
|
3315
3301
|
* @param query IQuery
|
|
@@ -3319,8 +3305,8 @@ class jr {
|
|
|
3319
3305
|
k(this, "setMessages", async (r, o) => {
|
|
3320
3306
|
if (r.type !== N.MESSAGES)
|
|
3321
3307
|
return 400;
|
|
3322
|
-
const
|
|
3323
|
-
let
|
|
3308
|
+
const l = o.data.title;
|
|
3309
|
+
let x = 0;
|
|
3324
3310
|
return o.data.messages.forEach(async (D) => {
|
|
3325
3311
|
var K, U, M, X, se, ee, le;
|
|
3326
3312
|
D.id !== null && (await this.db.table(N.MESSAGES).put({
|
|
@@ -3329,16 +3315,16 @@ class jr {
|
|
|
3329
3315
|
data: D,
|
|
3330
3316
|
expires: D.expires
|
|
3331
3317
|
}).catch((He) => {
|
|
3332
|
-
|
|
3318
|
+
x++, console.error(
|
|
3333
3319
|
"%cstorage",
|
|
3334
|
-
|
|
3320
|
+
m.STORAGE,
|
|
3335
3321
|
"set message",
|
|
3336
|
-
`title: ${
|
|
3322
|
+
`title: ${l}`,
|
|
3337
3323
|
D,
|
|
3338
3324
|
He.message
|
|
3339
3325
|
);
|
|
3340
3326
|
}), await this.db.table(N.TOPICS).put({
|
|
3341
|
-
title:
|
|
3327
|
+
title: l,
|
|
3342
3328
|
widget_id: r.widget,
|
|
3343
3329
|
message_id: D.id,
|
|
3344
3330
|
dashboard_id: r.dashboard,
|
|
@@ -3349,11 +3335,11 @@ class jr {
|
|
|
3349
3335
|
utc: D.utc,
|
|
3350
3336
|
expires: D.expires
|
|
3351
3337
|
}).catch((He) => {
|
|
3352
|
-
|
|
3338
|
+
x++, console.error(
|
|
3353
3339
|
"%cstorage",
|
|
3354
|
-
|
|
3340
|
+
m.STORAGE,
|
|
3355
3341
|
"set topic",
|
|
3356
|
-
`title: ${
|
|
3342
|
+
`title: ${l}`,
|
|
3357
3343
|
D,
|
|
3358
3344
|
He.message
|
|
3359
3345
|
);
|
|
@@ -3361,43 +3347,43 @@ class jr {
|
|
|
3361
3347
|
}), o.data.topics.forEach(async (D) => {
|
|
3362
3348
|
const K = D.message_id, U = D.visible ? 1 : 0, M = D.title;
|
|
3363
3349
|
await this.db.table(N.TOPICS).where("message_id").equals(K).modify({ visible: U }).catch((X) => {
|
|
3364
|
-
|
|
3350
|
+
x++, console.error(
|
|
3365
3351
|
"%cstorage",
|
|
3366
|
-
|
|
3352
|
+
m.STORAGE,
|
|
3367
3353
|
"update message visibility",
|
|
3368
3354
|
`title: ${M}`,
|
|
3369
3355
|
`widget: ${D.widget_id}`,
|
|
3370
3356
|
X.message
|
|
3371
3357
|
);
|
|
3372
3358
|
});
|
|
3373
|
-
}),
|
|
3359
|
+
}), x === 0 ? 201 : 400;
|
|
3374
3360
|
});
|
|
3375
3361
|
/**
|
|
3376
3362
|
* Wipe Message data after expires timestamp
|
|
3377
3363
|
*/
|
|
3378
3364
|
k(this, "cleanMessages", async () => {
|
|
3379
|
-
const r = Date.now() / 1e3, o = (D) => D.expires < r,
|
|
3365
|
+
const r = Date.now() / 1e3, o = (D) => D.expires < r, l = (D) => D.expires < r;
|
|
3380
3366
|
return await this.db.table(N.TOPICS).orderBy("expires").filter(o).delete().catch((D) => (console.error(
|
|
3381
3367
|
"%cstorage%c %cclean",
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3368
|
+
m.STORAGE,
|
|
3369
|
+
m.NONE,
|
|
3370
|
+
m.MESSAGES,
|
|
3385
3371
|
D.message
|
|
3386
|
-
), 0)), await this.db.table(N.MESSAGES).orderBy("expires").filter(
|
|
3372
|
+
), 0)), await this.db.table(N.MESSAGES).orderBy("expires").filter(l).delete().catch((D) => (console.error(
|
|
3387
3373
|
"%cstorage%c %clean",
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3374
|
+
m.STORAGE,
|
|
3375
|
+
m.NONE,
|
|
3376
|
+
m.MESSAGES,
|
|
3391
3377
|
D.message
|
|
3392
3378
|
), 0));
|
|
3393
3379
|
});
|
|
3394
3380
|
k(this, "hideMessage", async (r, o) => {
|
|
3395
|
-
await this.db.table(N.TOPICS).where("message_id").equals(r).modify({ visible: o ? 1 : 0 }).catch((
|
|
3381
|
+
await this.db.table(N.TOPICS).where("message_id").equals(r).modify({ visible: o ? 1 : 0 }).catch((l) => (console.error(
|
|
3396
3382
|
"%cstorage%c %chide",
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3383
|
+
m.STORAGE,
|
|
3384
|
+
m.NONE,
|
|
3385
|
+
m.HIDE,
|
|
3386
|
+
l.message
|
|
3401
3387
|
), 0));
|
|
3402
3388
|
});
|
|
3403
3389
|
/**
|
|
@@ -3411,7 +3397,7 @@ class jr {
|
|
|
3411
3397
|
type: r.type
|
|
3412
3398
|
}).then(() => 201).catch((o) => (console.error(
|
|
3413
3399
|
"%cstorage",
|
|
3414
|
-
|
|
3400
|
+
m.STORAGE,
|
|
3415
3401
|
N.WIDGET,
|
|
3416
3402
|
r,
|
|
3417
3403
|
o.message
|
|
@@ -3422,19 +3408,19 @@ class jr {
|
|
|
3422
3408
|
* @returns null
|
|
3423
3409
|
*/
|
|
3424
3410
|
k(this, "subscribe", (r) => (r = Mr(r), this.subscribers.filter(
|
|
3425
|
-
(
|
|
3411
|
+
(l) => l.widget === r.widget
|
|
3426
3412
|
).length > 0 || (r.type === N.MESSAGES && (r = St(this.options, r)), console.info(
|
|
3427
3413
|
"%cstorage%c %csubscribe",
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3414
|
+
m.STORAGE,
|
|
3415
|
+
m.NONE,
|
|
3416
|
+
m.SUBSCRIBE,
|
|
3431
3417
|
r.slide,
|
|
3432
3418
|
r.widget
|
|
3433
3419
|
), console.debug(
|
|
3434
3420
|
"%cstorage%c %csubscribe",
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3421
|
+
m.STORAGE,
|
|
3422
|
+
m.NONE,
|
|
3423
|
+
m.SUBSCRIBE,
|
|
3438
3424
|
r
|
|
3439
3425
|
), this.subscribers.push(r)), null));
|
|
3440
3426
|
/**
|
|
@@ -3451,9 +3437,9 @@ class jr {
|
|
|
3451
3437
|
const o = await this.db.table(N.SLIDE).where({ id: r.id }).last().catch(() => {
|
|
3452
3438
|
console.warn(
|
|
3453
3439
|
"%capi%c %cseries",
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3440
|
+
m.API,
|
|
3441
|
+
m.NONE,
|
|
3442
|
+
m.SERIES,
|
|
3457
3443
|
r.id
|
|
3458
3444
|
);
|
|
3459
3445
|
});
|
|
@@ -3472,7 +3458,7 @@ class jr {
|
|
|
3472
3458
|
css: r.data.css || ""
|
|
3473
3459
|
}).then(() => 200).catch((o) => (console.error(
|
|
3474
3460
|
"%cstorage",
|
|
3475
|
-
|
|
3461
|
+
m.STORAGE,
|
|
3476
3462
|
re.SLIDE_STORE,
|
|
3477
3463
|
r,
|
|
3478
3464
|
o.message
|
|
@@ -3492,26 +3478,26 @@ class jr {
|
|
|
3492
3478
|
}), this.db.open();
|
|
3493
3479
|
}
|
|
3494
3480
|
}
|
|
3495
|
-
function zn(
|
|
3481
|
+
function zn(d) {
|
|
3496
3482
|
return new Promise((r, o) => {
|
|
3497
|
-
|
|
3483
|
+
d.oncomplete = d.onsuccess = () => r(d.result), d.onabort = d.onerror = () => o(d.error);
|
|
3498
3484
|
});
|
|
3499
3485
|
}
|
|
3500
|
-
function Ma(
|
|
3501
|
-
const o = indexedDB.open(
|
|
3486
|
+
function Ma(d, r) {
|
|
3487
|
+
const o = indexedDB.open(d);
|
|
3502
3488
|
o.onupgradeneeded = () => o.result.createObjectStore(r);
|
|
3503
|
-
const
|
|
3504
|
-
return (
|
|
3489
|
+
const l = zn(o);
|
|
3490
|
+
return (x, D) => l.then((K) => D(K.transaction(r, x).objectStore(r)));
|
|
3505
3491
|
}
|
|
3506
3492
|
let Un;
|
|
3507
3493
|
function Nr() {
|
|
3508
3494
|
return Un || (Un = Ma("keyval-store", "keyval")), Un;
|
|
3509
3495
|
}
|
|
3510
|
-
function Vt(
|
|
3511
|
-
return r("readonly", (o) => zn(o.get(
|
|
3496
|
+
function Vt(d, r = Nr()) {
|
|
3497
|
+
return r("readonly", (o) => zn(o.get(d)));
|
|
3512
3498
|
}
|
|
3513
|
-
function wt(
|
|
3514
|
-
return o("readwrite", (
|
|
3499
|
+
function wt(d, r, o = Nr()) {
|
|
3500
|
+
return o("readwrite", (l) => (l.put(r, d), zn(l.transaction)));
|
|
3515
3501
|
}
|
|
3516
3502
|
class Kr {
|
|
3517
3503
|
constructor(r) {
|
|
@@ -3519,15 +3505,15 @@ class Kr {
|
|
|
3519
3505
|
k(this, "options");
|
|
3520
3506
|
k(this, "getCloud", async (r) => {
|
|
3521
3507
|
const o = V(r);
|
|
3522
|
-
return await Vt(o).then((
|
|
3508
|
+
return await Vt(o).then((l) => l).catch(() => (console.warn("%capi", m.API, N.CLOUD, r.slide, r.widget), { data: null, message: "Cloud Data error", success: !1 }));
|
|
3523
3509
|
});
|
|
3524
3510
|
k(this, "getSeries", async (r) => {
|
|
3525
3511
|
const o = V(r);
|
|
3526
|
-
return await Vt(o).then((
|
|
3512
|
+
return await Vt(o).then((l) => l).catch(() => (console.warn("%capi", m.API, N.SERIES, r.slide, r.widget), { data: null, message: "Series Data error", success: !1 }));
|
|
3527
3513
|
});
|
|
3528
3514
|
k(this, "getMessages", async (r) => {
|
|
3529
3515
|
const o = V(r);
|
|
3530
|
-
return await Vt(o).then((
|
|
3516
|
+
return await Vt(o).then((l) => l).catch(() => (console.warn("%capi", m.API, N.MESSAGES, r.slide, r.widget), { data: null, message: "Messages Data error", success: !1 }));
|
|
3531
3517
|
});
|
|
3532
3518
|
/**
|
|
3533
3519
|
* Update Cloud
|
|
@@ -3538,8 +3524,8 @@ class Kr {
|
|
|
3538
3524
|
k(this, "setCloud", async (r, o) => {
|
|
3539
3525
|
if (!o.success)
|
|
3540
3526
|
return 400;
|
|
3541
|
-
const
|
|
3542
|
-
return delete o.success, delete o.message, await wt(
|
|
3527
|
+
const l = V(r);
|
|
3528
|
+
return delete o.success, delete o.message, await wt(l, o).then(() => 201).catch((x) => (console.error("%cstorage", m.STORAGE, N.CLOUD, r, x.message), 400));
|
|
3543
3529
|
});
|
|
3544
3530
|
/**
|
|
3545
3531
|
* Update Series
|
|
@@ -3550,8 +3536,8 @@ class Kr {
|
|
|
3550
3536
|
k(this, "setSeries", async (r, o) => {
|
|
3551
3537
|
if (!o.success)
|
|
3552
3538
|
return 400;
|
|
3553
|
-
const
|
|
3554
|
-
return delete o.success, delete o.message, await wt(
|
|
3539
|
+
const l = V(r);
|
|
3540
|
+
return delete o.success, delete o.message, await wt(l, o).then(() => 201).catch((x) => (console.error("%cstorage", m.STORAGE, N.SERIES, r, x.message), 400));
|
|
3555
3541
|
});
|
|
3556
3542
|
/**
|
|
3557
3543
|
* Update Messages
|
|
@@ -3562,8 +3548,8 @@ class Kr {
|
|
|
3562
3548
|
k(this, "setMessages", async (r, o) => {
|
|
3563
3549
|
if (!o.success)
|
|
3564
3550
|
return 400;
|
|
3565
|
-
const
|
|
3566
|
-
return delete o.success, delete o.message, await wt(
|
|
3551
|
+
const l = V(r);
|
|
3552
|
+
return delete o.success, delete o.message, await wt(l, o).then(() => 201).catch((x) => (console.error("%cstorage", m.STORAGE, N.MESSAGES, r, x.message), 400));
|
|
3567
3553
|
});
|
|
3568
3554
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((o) => o(0))));
|
|
3569
3555
|
k(this, "hideMessage", async (r, o) => {
|
|
@@ -3577,12 +3563,12 @@ class Kr {
|
|
|
3577
3563
|
* @returns number
|
|
3578
3564
|
*/
|
|
3579
3565
|
k(this, "setWidget", async (r) => {
|
|
3580
|
-
const o = V(r),
|
|
3566
|
+
const o = V(r), l = {
|
|
3581
3567
|
id: r.widget,
|
|
3582
3568
|
dashboard_id: r.dashboard,
|
|
3583
3569
|
type: r.type
|
|
3584
3570
|
};
|
|
3585
|
-
return await wt(o,
|
|
3571
|
+
return await wt(o, l).then(() => 201).catch((x) => (console.error("%cstorage", m.STORAGE, N.WIDGET, r, x.message), 400));
|
|
3586
3572
|
});
|
|
3587
3573
|
/**
|
|
3588
3574
|
* Add component subscriber
|
|
@@ -3590,12 +3576,12 @@ class Kr {
|
|
|
3590
3576
|
* @returns null
|
|
3591
3577
|
*/
|
|
3592
3578
|
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = St(this.options, r)), this.subscribers.filter(
|
|
3593
|
-
(
|
|
3579
|
+
(l) => l.widget === r.widget
|
|
3594
3580
|
).length > 0 || (console.debug(
|
|
3595
3581
|
"%cstorage%c %csubscribe",
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3582
|
+
m.STORAGE,
|
|
3583
|
+
m.NONE,
|
|
3584
|
+
m.SUBSCRIBE,
|
|
3599
3585
|
r.slide,
|
|
3600
3586
|
r.widget
|
|
3601
3587
|
), this.subscribers.push(r)), null));
|
|
@@ -3606,7 +3592,7 @@ class Kr {
|
|
|
3606
3592
|
k(this, "getSubscribers", async () => await new Promise((r) => r(this.subscribers)));
|
|
3607
3593
|
k(this, "loadSlide", async (r) => {
|
|
3608
3594
|
const o = V(r);
|
|
3609
|
-
return await Vt(o).then((
|
|
3595
|
+
return await Vt(o).then((l) => l).catch(() => (console.warn("%capi", m.API, N.SLIDE, r.slide), { data: null, message: "Slide Load error", success: !1 }));
|
|
3610
3596
|
});
|
|
3611
3597
|
/**
|
|
3612
3598
|
* Update Slide
|
|
@@ -3614,14 +3600,14 @@ class Kr {
|
|
|
3614
3600
|
* @returns number
|
|
3615
3601
|
*/
|
|
3616
3602
|
k(this, "storeSlide", async (r) => {
|
|
3617
|
-
const o = V(r),
|
|
3603
|
+
const o = V(r), l = {
|
|
3618
3604
|
id: r.id,
|
|
3619
3605
|
title: r.data.title || "Not set",
|
|
3620
3606
|
json: r.data.json || {},
|
|
3621
3607
|
html: r.data.html || "",
|
|
3622
3608
|
css: r.data.css || ""
|
|
3623
3609
|
};
|
|
3624
|
-
return await wt(o,
|
|
3610
|
+
return await wt(o, l).then(() => 201).catch((x) => (console.error("%cstorage", m.STORAGE, N.SLIDE, r, x.message), 400));
|
|
3625
3611
|
});
|
|
3626
3612
|
this.options = r;
|
|
3627
3613
|
}
|
|
@@ -3634,24 +3620,24 @@ class Br {
|
|
|
3634
3620
|
const o = V(r);
|
|
3635
3621
|
try {
|
|
3636
3622
|
return localStorage.getObject(o);
|
|
3637
|
-
} catch (
|
|
3638
|
-
return console.warn("%capi",
|
|
3623
|
+
} catch (l) {
|
|
3624
|
+
return console.warn("%capi", m.API, N.CLOUD, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3639
3625
|
}
|
|
3640
3626
|
});
|
|
3641
3627
|
k(this, "getSeries", async (r) => {
|
|
3642
3628
|
const o = V(r);
|
|
3643
3629
|
try {
|
|
3644
3630
|
return localStorage.getObject(o);
|
|
3645
|
-
} catch (
|
|
3646
|
-
return console.warn("%capi",
|
|
3631
|
+
} catch (l) {
|
|
3632
|
+
return console.warn("%capi", m.API, N.SERIES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3647
3633
|
}
|
|
3648
3634
|
});
|
|
3649
3635
|
k(this, "getMessages", async (r) => {
|
|
3650
3636
|
const o = V(r);
|
|
3651
3637
|
try {
|
|
3652
3638
|
return localStorage.getObject(o);
|
|
3653
|
-
} catch (
|
|
3654
|
-
return console.warn("%capi",
|
|
3639
|
+
} catch (l) {
|
|
3640
|
+
return console.warn("%capi", m.API, N.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3655
3641
|
}
|
|
3656
3642
|
});
|
|
3657
3643
|
/**
|
|
@@ -3661,11 +3647,11 @@ class Br {
|
|
|
3661
3647
|
* @returns number
|
|
3662
3648
|
*/
|
|
3663
3649
|
k(this, "setCloud", async (r, o) => {
|
|
3664
|
-
const
|
|
3650
|
+
const l = V(r);
|
|
3665
3651
|
try {
|
|
3666
|
-
return localStorage.setObject(
|
|
3667
|
-
} catch (
|
|
3668
|
-
return console.error("%cstorage",
|
|
3652
|
+
return localStorage.setObject(l, o), 201;
|
|
3653
|
+
} catch (x) {
|
|
3654
|
+
return console.error("%cstorage", m.STORAGE, N.CLOUD, r, x), 400;
|
|
3669
3655
|
}
|
|
3670
3656
|
});
|
|
3671
3657
|
/**
|
|
@@ -3675,11 +3661,11 @@ class Br {
|
|
|
3675
3661
|
* @returns number
|
|
3676
3662
|
*/
|
|
3677
3663
|
k(this, "setSeries", async (r, o) => {
|
|
3678
|
-
const
|
|
3664
|
+
const l = V(r);
|
|
3679
3665
|
try {
|
|
3680
|
-
return localStorage.setObject(
|
|
3681
|
-
} catch (
|
|
3682
|
-
return console.error("%cstorage",
|
|
3666
|
+
return localStorage.setObject(l, o), 201;
|
|
3667
|
+
} catch (x) {
|
|
3668
|
+
return console.error("%cstorage", m.STORAGE, N.SERIES, r, x), 400;
|
|
3683
3669
|
}
|
|
3684
3670
|
});
|
|
3685
3671
|
/**
|
|
@@ -3689,11 +3675,11 @@ class Br {
|
|
|
3689
3675
|
* @returns number
|
|
3690
3676
|
*/
|
|
3691
3677
|
k(this, "setMessages", async (r, o) => {
|
|
3692
|
-
const
|
|
3678
|
+
const l = V(r);
|
|
3693
3679
|
try {
|
|
3694
|
-
return localStorage.setObject(
|
|
3695
|
-
} catch (
|
|
3696
|
-
return console.error("%cstorage",
|
|
3680
|
+
return localStorage.setObject(l, o), 200;
|
|
3681
|
+
} catch (x) {
|
|
3682
|
+
return console.error("%cstorage", m.STORAGE, N.MESSAGES, r, x), 400;
|
|
3697
3683
|
}
|
|
3698
3684
|
});
|
|
3699
3685
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((o) => o(0))));
|
|
@@ -3704,8 +3690,8 @@ class Br {
|
|
|
3704
3690
|
const o = `widget.${r.widget}`;
|
|
3705
3691
|
try {
|
|
3706
3692
|
return localStorage.setObject(o, r), 201;
|
|
3707
|
-
} catch (
|
|
3708
|
-
return console.error("%cstorage",
|
|
3693
|
+
} catch (l) {
|
|
3694
|
+
return console.error("%cstorage", m.STORAGE, N.WIDGET, r, l), 400;
|
|
3709
3695
|
}
|
|
3710
3696
|
});
|
|
3711
3697
|
/**
|
|
@@ -3714,12 +3700,12 @@ class Br {
|
|
|
3714
3700
|
* @returns null
|
|
3715
3701
|
*/
|
|
3716
3702
|
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = St(this.options, r)), this.subscribers.filter(
|
|
3717
|
-
(
|
|
3703
|
+
(l) => l.widget === r.widget
|
|
3718
3704
|
).length || (console.debug(
|
|
3719
3705
|
"%cstorage%c %csubscribe",
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3706
|
+
m.STORAGE,
|
|
3707
|
+
m.NONE,
|
|
3708
|
+
m.SUBSCRIBE,
|
|
3723
3709
|
r.slide,
|
|
3724
3710
|
r.widget
|
|
3725
3711
|
), this.subscribers.push(r)), null));
|
|
@@ -3732,7 +3718,7 @@ class Br {
|
|
|
3732
3718
|
try {
|
|
3733
3719
|
return localStorage.getObject(`${r.type}.${r.id}`);
|
|
3734
3720
|
} catch (o) {
|
|
3735
|
-
return console.warn("%capi",
|
|
3721
|
+
return console.warn("%capi", m.API, N.SLIDE, r.id, o), { data: null, message: "Slide Load error", success: !1 };
|
|
3736
3722
|
}
|
|
3737
3723
|
});
|
|
3738
3724
|
k(this, "storeSlide", async (r) => {
|
|
@@ -3745,14 +3731,14 @@ class Br {
|
|
|
3745
3731
|
css: r.data.css || ""
|
|
3746
3732
|
}), 201;
|
|
3747
3733
|
} catch (o) {
|
|
3748
|
-
return console.error("%cstorage",
|
|
3734
|
+
return console.error("%cstorage", m.STORAGE, N.SLIDE, r, o), 400;
|
|
3749
3735
|
}
|
|
3750
3736
|
});
|
|
3751
|
-
this.options = r, Storage.prototype.setObject = function(o,
|
|
3752
|
-
this.setObject(o, JSON.stringify(
|
|
3737
|
+
this.options = r, Storage.prototype.setObject = function(o, l) {
|
|
3738
|
+
this.setObject(o, JSON.stringify(l));
|
|
3753
3739
|
}, Storage.prototype.getObject = function(o) {
|
|
3754
|
-
const
|
|
3755
|
-
return
|
|
3740
|
+
const l = this.getObject(o);
|
|
3741
|
+
return l && JSON.parse(l);
|
|
3756
3742
|
};
|
|
3757
3743
|
}
|
|
3758
3744
|
}
|
|
@@ -3764,24 +3750,24 @@ class Lr {
|
|
|
3764
3750
|
const o = V(r);
|
|
3765
3751
|
try {
|
|
3766
3752
|
return sessionStorage.getObject(o);
|
|
3767
|
-
} catch (
|
|
3768
|
-
return console.warn("%capi",
|
|
3753
|
+
} catch (l) {
|
|
3754
|
+
return console.warn("%capi", m.API, N.CLOUD, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3769
3755
|
}
|
|
3770
3756
|
});
|
|
3771
3757
|
k(this, "getSeries", async (r) => {
|
|
3772
3758
|
const o = V(r);
|
|
3773
3759
|
try {
|
|
3774
3760
|
return sessionStorage.getObject(o);
|
|
3775
|
-
} catch (
|
|
3776
|
-
return console.warn("%capi",
|
|
3761
|
+
} catch (l) {
|
|
3762
|
+
return console.warn("%capi", m.API, N.SERIES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3777
3763
|
}
|
|
3778
3764
|
});
|
|
3779
3765
|
k(this, "getMessages", async (r) => {
|
|
3780
3766
|
const o = V(r);
|
|
3781
3767
|
try {
|
|
3782
3768
|
return sessionStorage.getObject(o);
|
|
3783
|
-
} catch (
|
|
3784
|
-
return console.warn("%capi",
|
|
3769
|
+
} catch (l) {
|
|
3770
|
+
return console.warn("%capi", m.API, N.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3785
3771
|
}
|
|
3786
3772
|
});
|
|
3787
3773
|
/**
|
|
@@ -3791,11 +3777,11 @@ class Lr {
|
|
|
3791
3777
|
* @returns number
|
|
3792
3778
|
*/
|
|
3793
3779
|
k(this, "setCloud", async (r, o) => {
|
|
3794
|
-
const
|
|
3780
|
+
const l = V(r);
|
|
3795
3781
|
try {
|
|
3796
|
-
return sessionStorage.setObject(
|
|
3797
|
-
} catch (
|
|
3798
|
-
return console.error("%cstorage",
|
|
3782
|
+
return sessionStorage.setObject(l, o), 201;
|
|
3783
|
+
} catch (x) {
|
|
3784
|
+
return console.error("%cstorage", m.STORAGE, N.CLOUD, r, x), 400;
|
|
3799
3785
|
}
|
|
3800
3786
|
});
|
|
3801
3787
|
/**
|
|
@@ -3805,11 +3791,11 @@ class Lr {
|
|
|
3805
3791
|
* @returns number
|
|
3806
3792
|
*/
|
|
3807
3793
|
k(this, "setSeries", async (r, o) => {
|
|
3808
|
-
const
|
|
3794
|
+
const l = V(r);
|
|
3809
3795
|
try {
|
|
3810
|
-
return sessionStorage.setObject(
|
|
3811
|
-
} catch (
|
|
3812
|
-
return console.error("%cstorage",
|
|
3796
|
+
return sessionStorage.setObject(l, o), 201;
|
|
3797
|
+
} catch (x) {
|
|
3798
|
+
return console.error("%cstorage", m.STORAGE, N.SERIES, r, x), 400;
|
|
3813
3799
|
}
|
|
3814
3800
|
});
|
|
3815
3801
|
/**
|
|
@@ -3819,11 +3805,11 @@ class Lr {
|
|
|
3819
3805
|
* @returns number
|
|
3820
3806
|
*/
|
|
3821
3807
|
k(this, "setMessages", async (r, o) => {
|
|
3822
|
-
const
|
|
3808
|
+
const l = V(r);
|
|
3823
3809
|
try {
|
|
3824
|
-
return sessionStorage.setObject(
|
|
3825
|
-
} catch (
|
|
3826
|
-
return console.error("%cstorage",
|
|
3810
|
+
return sessionStorage.setObject(l, o), 200;
|
|
3811
|
+
} catch (x) {
|
|
3812
|
+
return console.error("%cstorage", m.STORAGE, N.MESSAGES, r, x), 400;
|
|
3827
3813
|
}
|
|
3828
3814
|
});
|
|
3829
3815
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((o) => o(0))));
|
|
@@ -3834,8 +3820,8 @@ class Lr {
|
|
|
3834
3820
|
const o = `widget.${r.widget}`;
|
|
3835
3821
|
try {
|
|
3836
3822
|
return sessionStorage.setObject(o, r), 201;
|
|
3837
|
-
} catch (
|
|
3838
|
-
return console.error("%cstorage",
|
|
3823
|
+
} catch (l) {
|
|
3824
|
+
return console.error("%cstorage", m.STORAGE, N.WIDGET, r, l), 400;
|
|
3839
3825
|
}
|
|
3840
3826
|
});
|
|
3841
3827
|
/**
|
|
@@ -3844,12 +3830,12 @@ class Lr {
|
|
|
3844
3830
|
* @returns null
|
|
3845
3831
|
*/
|
|
3846
3832
|
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = St(this.options, r)), this.subscribers.filter(
|
|
3847
|
-
(
|
|
3833
|
+
(l) => l.widget === r.widget
|
|
3848
3834
|
).length || (console.debug(
|
|
3849
3835
|
"%cstorage%c %csubscribe",
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3836
|
+
m.STORAGE,
|
|
3837
|
+
m.NONE,
|
|
3838
|
+
m.SUBSCRIBE,
|
|
3853
3839
|
r.slide,
|
|
3854
3840
|
r.widget
|
|
3855
3841
|
), this.subscribers.push(r)), null));
|
|
@@ -3862,7 +3848,7 @@ class Lr {
|
|
|
3862
3848
|
try {
|
|
3863
3849
|
return sessionStorage.getObject(`${r.type}.${r.id}`);
|
|
3864
3850
|
} catch (o) {
|
|
3865
|
-
return console.warn("%capi",
|
|
3851
|
+
return console.warn("%capi", m.API, N.SLIDE, r.id, o), { data: null, message: "Store Load error", success: !1 };
|
|
3866
3852
|
}
|
|
3867
3853
|
});
|
|
3868
3854
|
/**
|
|
@@ -3880,14 +3866,14 @@ class Lr {
|
|
|
3880
3866
|
css: r.data.css || ""
|
|
3881
3867
|
}), 200;
|
|
3882
3868
|
} catch (o) {
|
|
3883
|
-
return console.error("%cstorage",
|
|
3869
|
+
return console.error("%cstorage", m.STORAGE, N.SLIDE, r, o), 400;
|
|
3884
3870
|
}
|
|
3885
3871
|
});
|
|
3886
|
-
this.options = r, Storage.prototype.setObject = function(o,
|
|
3887
|
-
this.setItem(o, JSON.stringify(
|
|
3872
|
+
this.options = r, Storage.prototype.setObject = function(o, l) {
|
|
3873
|
+
this.setItem(o, JSON.stringify(l));
|
|
3888
3874
|
}, Storage.prototype.getObject = function(o) {
|
|
3889
|
-
const
|
|
3890
|
-
return
|
|
3875
|
+
const l = this.getItem(o);
|
|
3876
|
+
return l && JSON.parse(l);
|
|
3891
3877
|
};
|
|
3892
3878
|
}
|
|
3893
3879
|
}
|
|
@@ -3899,24 +3885,24 @@ class Gr {
|
|
|
3899
3885
|
const o = V(r);
|
|
3900
3886
|
try {
|
|
3901
3887
|
return window.BuzzCasting.WidgetData[o];
|
|
3902
|
-
} catch (
|
|
3903
|
-
return console.warn("%capi",
|
|
3888
|
+
} catch (l) {
|
|
3889
|
+
return console.warn("%capi", m.API, N.CLOUD, r.slide, r.widget, l), { data: null, message: "Cloud Data error", success: !1 };
|
|
3904
3890
|
}
|
|
3905
3891
|
});
|
|
3906
3892
|
k(this, "getSeries", async (r) => {
|
|
3907
3893
|
const o = V(r);
|
|
3908
3894
|
try {
|
|
3909
3895
|
return window.BuzzCasting.WidgetData[o];
|
|
3910
|
-
} catch (
|
|
3911
|
-
return console.warn("%capi",
|
|
3896
|
+
} catch (l) {
|
|
3897
|
+
return console.warn("%capi", m.API, N.SERIES, r.slide, r.widget, l), { data: null, message: "Series Data error", success: !1 };
|
|
3912
3898
|
}
|
|
3913
3899
|
});
|
|
3914
3900
|
k(this, "getMessages", async (r) => {
|
|
3915
3901
|
const o = V(r);
|
|
3916
3902
|
try {
|
|
3917
3903
|
return window.BuzzCasting.WidgetData[o];
|
|
3918
|
-
} catch (
|
|
3919
|
-
return console.warn("%capi",
|
|
3904
|
+
} catch (l) {
|
|
3905
|
+
return console.warn("%capi", m.API, N.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3920
3906
|
}
|
|
3921
3907
|
});
|
|
3922
3908
|
/**
|
|
@@ -3926,11 +3912,11 @@ class Gr {
|
|
|
3926
3912
|
* @returns number
|
|
3927
3913
|
*/
|
|
3928
3914
|
k(this, "setCloud", async (r, o) => {
|
|
3929
|
-
const
|
|
3915
|
+
const l = V(r);
|
|
3930
3916
|
try {
|
|
3931
|
-
return window.BuzzCasting.WidgetData[
|
|
3932
|
-
} catch (
|
|
3933
|
-
return console.error("%cstorage",
|
|
3917
|
+
return window.BuzzCasting.WidgetData[l] = o, 201;
|
|
3918
|
+
} catch (x) {
|
|
3919
|
+
return console.error("%cstorage", m.STORAGE, "set", r, x), 400;
|
|
3934
3920
|
}
|
|
3935
3921
|
});
|
|
3936
3922
|
/**
|
|
@@ -3940,11 +3926,11 @@ class Gr {
|
|
|
3940
3926
|
* @returns number
|
|
3941
3927
|
*/
|
|
3942
3928
|
k(this, "setSeries", async (r, o) => {
|
|
3943
|
-
const
|
|
3929
|
+
const l = V(r);
|
|
3944
3930
|
try {
|
|
3945
|
-
return window.BuzzCasting.WidgetData[
|
|
3946
|
-
} catch (
|
|
3947
|
-
return console.error("%cstorage",
|
|
3931
|
+
return window.BuzzCasting.WidgetData[l] = o, 201;
|
|
3932
|
+
} catch (x) {
|
|
3933
|
+
return console.error("%cstorage", m.STORAGE, "set", r, x), 400;
|
|
3948
3934
|
}
|
|
3949
3935
|
});
|
|
3950
3936
|
/**
|
|
@@ -3954,11 +3940,11 @@ class Gr {
|
|
|
3954
3940
|
* @returns number
|
|
3955
3941
|
*/
|
|
3956
3942
|
k(this, "setMessages", async (r, o) => {
|
|
3957
|
-
const
|
|
3943
|
+
const l = V(r);
|
|
3958
3944
|
try {
|
|
3959
|
-
return window.BuzzCasting.WidgetData[
|
|
3960
|
-
} catch (
|
|
3961
|
-
return console.error("%cstorage",
|
|
3945
|
+
return window.BuzzCasting.WidgetData[l] = o, 201;
|
|
3946
|
+
} catch (x) {
|
|
3947
|
+
return console.error("%cstorage", m.STORAGE, "set", r, x), 400;
|
|
3962
3948
|
}
|
|
3963
3949
|
});
|
|
3964
3950
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((o) => o(0))));
|
|
@@ -3969,8 +3955,8 @@ class Gr {
|
|
|
3969
3955
|
const o = `widget.${r.widget}`;
|
|
3970
3956
|
try {
|
|
3971
3957
|
return window.BuzzCasting.WidgetData[o] = r, 201;
|
|
3972
|
-
} catch (
|
|
3973
|
-
return console.error("%cstorage",
|
|
3958
|
+
} catch (l) {
|
|
3959
|
+
return console.error("%cstorage", m.STORAGE, N.WIDGET, r, l), 400;
|
|
3974
3960
|
}
|
|
3975
3961
|
});
|
|
3976
3962
|
/**
|
|
@@ -3979,12 +3965,12 @@ class Gr {
|
|
|
3979
3965
|
* @returns null
|
|
3980
3966
|
*/
|
|
3981
3967
|
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = St(this.options, r)), this.subscribers.filter(
|
|
3982
|
-
(
|
|
3968
|
+
(l) => l.widget === r.widget
|
|
3983
3969
|
).length || (console.debug(
|
|
3984
3970
|
"%cstorage%c %csubscribe",
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3971
|
+
m.STORAGE,
|
|
3972
|
+
m.NONE,
|
|
3973
|
+
m.SUBSCRIBE,
|
|
3988
3974
|
r.slide,
|
|
3989
3975
|
r.widget
|
|
3990
3976
|
), this.subscribers.push(r)), null));
|
|
@@ -3997,7 +3983,7 @@ class Gr {
|
|
|
3997
3983
|
try {
|
|
3998
3984
|
return window.BuzzCasting.SlideData[r.id];
|
|
3999
3985
|
} catch (o) {
|
|
4000
|
-
return console.warn("%capi",
|
|
3986
|
+
return console.warn("%capi", m.API, N.SLIDE, r.id, o), { data: null, message: "Slide Load error", success: !1 };
|
|
4001
3987
|
}
|
|
4002
3988
|
});
|
|
4003
3989
|
k(this, "storeSlide", async (r) => {
|
|
@@ -4010,50 +3996,50 @@ class Gr {
|
|
|
4010
3996
|
css: r.data.css || ""
|
|
4011
3997
|
}, 201;
|
|
4012
3998
|
} catch (o) {
|
|
4013
|
-
return console.error("%cstorage",
|
|
3999
|
+
return console.error("%cstorage", m.STORAGE, N.SLIDE, r, o), 400;
|
|
4014
4000
|
}
|
|
4015
4001
|
});
|
|
4016
4002
|
this.options = r, window.BuzzCasting.WidgetData = /* @__PURE__ */ new Set();
|
|
4017
4003
|
}
|
|
4018
4004
|
}
|
|
4019
|
-
function Fa(
|
|
4020
|
-
const r =
|
|
4021
|
-
return r.length > 0 ? (r.forEach((o,
|
|
4022
|
-
r[
|
|
4005
|
+
function Fa(d) {
|
|
4006
|
+
const r = d.toUpperCase().split(/[\s_-]+/);
|
|
4007
|
+
return r.length > 0 ? (r.forEach((o, l) => {
|
|
4008
|
+
r[l] = `${o.charAt(0)}.`;
|
|
4023
4009
|
}), r.join(" ")) : "";
|
|
4024
4010
|
}
|
|
4025
|
-
function Wa(
|
|
4026
|
-
let r = "", o = "",
|
|
4011
|
+
function Wa(d) {
|
|
4012
|
+
let r = "", o = "", l = {
|
|
4027
4013
|
backgroundImage: ""
|
|
4028
4014
|
};
|
|
4029
|
-
return typeof
|
|
4030
|
-
(
|
|
4031
|
-
backgroundImage: `url(${
|
|
4032
|
-
}, o =
|
|
4015
|
+
return typeof d.media < "u" && d.media.forEach((x) => {
|
|
4016
|
+
(x.type === "photo" || x.type === "image") && (l = {
|
|
4017
|
+
backgroundImage: `url(${x.url})`
|
|
4018
|
+
}, o = x.url), x.type === "video" && (r = x.url);
|
|
4033
4019
|
}), {
|
|
4034
4020
|
image: o,
|
|
4035
|
-
background:
|
|
4021
|
+
background: l || null,
|
|
4036
4022
|
video: r
|
|
4037
4023
|
};
|
|
4038
4024
|
}
|
|
4039
|
-
function ja(
|
|
4025
|
+
function ja(d) {
|
|
4040
4026
|
const r = {};
|
|
4041
|
-
for (let o = 0; o <
|
|
4042
|
-
const
|
|
4043
|
-
|
|
4027
|
+
for (let o = 0; o < d.length; o++) {
|
|
4028
|
+
const l = d.item(o);
|
|
4029
|
+
l != null && l.name && (r[l.name] = l.value);
|
|
4044
4030
|
}
|
|
4045
4031
|
return r;
|
|
4046
4032
|
}
|
|
4047
|
-
function za(
|
|
4033
|
+
function za(d) {
|
|
4048
4034
|
const r = {};
|
|
4049
|
-
for (let o = 0; o <
|
|
4050
|
-
const
|
|
4051
|
-
|
|
4035
|
+
for (let o = 0; o < d.length; o++) {
|
|
4036
|
+
const l = d[o];
|
|
4037
|
+
l.name !== "class" && !l.name.includes("data") && (r[l.name] = l.value);
|
|
4052
4038
|
}
|
|
4053
4039
|
return r;
|
|
4054
4040
|
}
|
|
4055
|
-
function Ha(
|
|
4056
|
-
switch (
|
|
4041
|
+
function Ha(d, r) {
|
|
4042
|
+
switch (d) {
|
|
4057
4043
|
case "bl":
|
|
4058
4044
|
return `text-blue fa-solid fa-rss fa-${r}`;
|
|
4059
4045
|
case "co":
|
|
@@ -4094,63 +4080,63 @@ function Ha(l, r) {
|
|
|
4094
4080
|
return "";
|
|
4095
4081
|
}
|
|
4096
4082
|
}
|
|
4097
|
-
function Ya(
|
|
4098
|
-
return
|
|
4083
|
+
function Ya(d) {
|
|
4084
|
+
return d.replace(/^\w|[A-Z]|\b\w/g, (r, o) => o === 0 ? r.toLowerCase() : r.toUpperCase()).replace(/\s+/g, "");
|
|
4099
4085
|
}
|
|
4100
|
-
function Qa(
|
|
4101
|
-
return
|
|
4086
|
+
function Qa(d) {
|
|
4087
|
+
return d.toLowerCase().split("-").reduce((r, o) => r + (o.charAt(0).toUpperCase() + o.slice(1)));
|
|
4102
4088
|
}
|
|
4103
|
-
const Xa = (
|
|
4104
|
-
function Na(
|
|
4089
|
+
const Xa = (d) => d.charAt(0).toUpperCase() + d.slice(1);
|
|
4090
|
+
function Na(d) {
|
|
4105
4091
|
const r = document.createRange();
|
|
4106
|
-
r.selectNodeContents(
|
|
4092
|
+
r.selectNodeContents(d), r.deleteContents();
|
|
4107
4093
|
}
|
|
4108
|
-
function Ka(
|
|
4109
|
-
|
|
4094
|
+
function Ka(d) {
|
|
4095
|
+
d.reduce(
|
|
4110
4096
|
(r, o) => Object.keys(o).reduce(
|
|
4111
|
-
(
|
|
4112
|
-
...
|
|
4113
|
-
[
|
|
4097
|
+
(l, x) => ({
|
|
4098
|
+
...l,
|
|
4099
|
+
[x]: x in r && typeof r[x] == "object" && r[x] !== null && typeof o[x] == "object" && o[x] !== null ? Ka([r[x], o[x]]) : o[x]
|
|
4114
4100
|
}),
|
|
4115
4101
|
r
|
|
4116
4102
|
),
|
|
4117
4103
|
{}
|
|
4118
4104
|
);
|
|
4119
4105
|
}
|
|
4120
|
-
function Ja(
|
|
4121
|
-
return `${(
|
|
4106
|
+
function Ja(d, r = "font-bold") {
|
|
4107
|
+
return `${(d == null ? void 0 : d.title.length) > 0 ? `<div class="${r}">${d.title}</div>` : ""}${d != null && d.content ? d.content.replace(/\n\n/g, `
|
|
4122
4108
|
`).replace(/\n/g, "<br/>") : ""}`;
|
|
4123
4109
|
}
|
|
4124
|
-
function Ba(
|
|
4125
|
-
for (;
|
|
4126
|
-
|
|
4127
|
-
return
|
|
4110
|
+
function Ba(d, r) {
|
|
4111
|
+
for (; d.length < r; )
|
|
4112
|
+
d = `0${d}`;
|
|
4113
|
+
return d;
|
|
4128
4114
|
}
|
|
4129
|
-
function Oe(
|
|
4130
|
-
let o,
|
|
4115
|
+
function Oe(d, r) {
|
|
4116
|
+
let o, l, x;
|
|
4131
4117
|
if (r.length === 0)
|
|
4132
|
-
return
|
|
4133
|
-
for (o = 0,
|
|
4134
|
-
|
|
4135
|
-
return
|
|
4118
|
+
return d;
|
|
4119
|
+
for (o = 0, x = r.length; o < x; o++)
|
|
4120
|
+
l = r.charCodeAt(o), d = (d << 5) - d + l, d |= 0;
|
|
4121
|
+
return d < 0 ? d * -2 : d;
|
|
4136
4122
|
}
|
|
4137
|
-
function La(
|
|
4138
|
-
return Object.keys(r).sort().reduce(
|
|
4139
|
-
function
|
|
4140
|
-
return $r(
|
|
4123
|
+
function La(d, r, o) {
|
|
4124
|
+
return Object.keys(r).sort().reduce(l, d);
|
|
4125
|
+
function l(x, D) {
|
|
4126
|
+
return $r(x, r[D], D, o);
|
|
4141
4127
|
}
|
|
4142
4128
|
}
|
|
4143
|
-
function $r(
|
|
4144
|
-
const
|
|
4129
|
+
function $r(d, r, o, l) {
|
|
4130
|
+
const x = Oe(Oe(Oe(d, o), Ga(r)), typeof r);
|
|
4145
4131
|
if (r === null)
|
|
4146
|
-
return Oe(
|
|
4132
|
+
return Oe(x, "null");
|
|
4147
4133
|
if (r === void 0)
|
|
4148
|
-
return Oe(
|
|
4134
|
+
return Oe(x, "undefined");
|
|
4149
4135
|
if (typeof r == "object" || typeof r == "function") {
|
|
4150
|
-
if (
|
|
4151
|
-
return Oe(
|
|
4152
|
-
|
|
4153
|
-
const D = La(
|
|
4136
|
+
if (l.includes(r))
|
|
4137
|
+
return Oe(x, `[Circular]${o}`);
|
|
4138
|
+
l.push(r);
|
|
4139
|
+
const D = La(x, r, l);
|
|
4154
4140
|
if (!("valueOf" in r) || typeof r.valueOf != "function")
|
|
4155
4141
|
return D;
|
|
4156
4142
|
try {
|
|
@@ -4159,17 +4145,17 @@ function $r(l, r, o, d) {
|
|
|
4159
4145
|
return Oe(D, `[valueOf exception]${K.stack || K.message}`);
|
|
4160
4146
|
}
|
|
4161
4147
|
}
|
|
4162
|
-
return Oe(
|
|
4148
|
+
return Oe(x, r.toString());
|
|
4163
4149
|
}
|
|
4164
|
-
function Ga(
|
|
4165
|
-
return Object.prototype.toString.call(
|
|
4150
|
+
function Ga(d) {
|
|
4151
|
+
return Object.prototype.toString.call(d);
|
|
4166
4152
|
}
|
|
4167
|
-
function Fn(
|
|
4168
|
-
return Ba($r(0,
|
|
4153
|
+
function Fn(d) {
|
|
4154
|
+
return Ba($r(0, d, "", []).toString(16), 8);
|
|
4169
4155
|
}
|
|
4170
|
-
function Va(
|
|
4171
|
-
if (
|
|
4172
|
-
return
|
|
4156
|
+
function Va(d, r) {
|
|
4157
|
+
if (d = d.toString().replace(/[^0-9.]/g, ""), d < 1e3)
|
|
4158
|
+
return d;
|
|
4173
4159
|
const o = [
|
|
4174
4160
|
{ v: 1e3, s: "K" },
|
|
4175
4161
|
{ v: 1e6, s: "M" },
|
|
@@ -4178,12 +4164,12 @@ function Va(l, r) {
|
|
|
4178
4164
|
{ v: 1e15, s: "P" },
|
|
4179
4165
|
{ v: 1e18, s: "E" }
|
|
4180
4166
|
];
|
|
4181
|
-
let
|
|
4182
|
-
for (
|
|
4167
|
+
let l;
|
|
4168
|
+
for (l = o.length - 1; l > 0 && !(d >= o[l].v); l--)
|
|
4183
4169
|
;
|
|
4184
|
-
return (
|
|
4170
|
+
return (d / o[l].v).toFixed(r).replace(/\.0+$|(\.\d*[1-9])0+$/, "$1") + o[l].s;
|
|
4185
4171
|
}
|
|
4186
|
-
function Za(
|
|
4172
|
+
function Za(d, r) {
|
|
4187
4173
|
const o = [
|
|
4188
4174
|
{ value: 1, symbol: "" },
|
|
4189
4175
|
{ value: 1e3, symbol: "K" },
|
|
@@ -4192,14 +4178,14 @@ function Za(l, r) {
|
|
|
4192
4178
|
{ value: 1e12, symbol: "T" },
|
|
4193
4179
|
{ value: 1e15, symbol: "P" },
|
|
4194
4180
|
{ value: 1e18, symbol: "E" }
|
|
4195
|
-
],
|
|
4196
|
-
let
|
|
4197
|
-
for (
|
|
4181
|
+
], l = /\.0+$|(\.\d*[1-9])0+$/;
|
|
4182
|
+
let x;
|
|
4183
|
+
for (x = o.length - 1; x > 0 && !(d >= o[x].value); x--)
|
|
4198
4184
|
;
|
|
4199
|
-
return (
|
|
4185
|
+
return (d / o[x].value).toFixed(r).replace(l, "$1") + o[x].symbol;
|
|
4200
4186
|
}
|
|
4201
|
-
function qa(
|
|
4202
|
-
switch (
|
|
4187
|
+
function qa(d) {
|
|
4188
|
+
switch (d.language) {
|
|
4203
4189
|
case "ar":
|
|
4204
4190
|
return {
|
|
4205
4191
|
direction: "rtl",
|
|
@@ -4209,44 +4195,44 @@ function qa(l) {
|
|
|
4209
4195
|
return {};
|
|
4210
4196
|
}
|
|
4211
4197
|
}
|
|
4212
|
-
function ei(
|
|
4198
|
+
function ei(d) {
|
|
4213
4199
|
const r = window.BuzzCasting.getOptions().suspended ?? !1;
|
|
4214
|
-
return
|
|
4215
|
-
var
|
|
4216
|
-
if (r ? o.content = "License suspended, please contact your Sales Representative to restore service" : o.content = ((
|
|
4200
|
+
return d.forEach((o) => {
|
|
4201
|
+
var l, x, D, K, U;
|
|
4202
|
+
if (r ? o.content = "License suspended, please contact your Sales Representative to restore service" : o.content = ((l = o.content) == null ? void 0 : l.replace(/(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)((\?.*)?)/g, "")) || "", o.sender !== null ? ((((x = o.sender) == null ? void 0 : x.title) === "Unknown author" || ((D = o.sender) == null ? void 0 : D.title) === null) && (o.sender.title = ""), ((K = o.sender) == null ? void 0 : K.name) !== "" && o.sender.title === "" && (o.sender.title = o.sender.name), ((U = o.sender) == null ? void 0 : U.name) !== "" && o.channel === "tw" && (o.sender.name = `@${o.sender.name}`)) : o.sender = { title: "", name: "", id: "", avatar: "default", bio: "", location: "", following: 0, verified: 0, listed: 0, followers: 0, favourites: 0, messages: 0, influence: 0 }, o.sender.title === "" && o.link !== "") {
|
|
4217
4203
|
const M = new URL(o.link);
|
|
4218
4204
|
o.sender.title = M.hostname.replace("www.", "");
|
|
4219
4205
|
}
|
|
4220
|
-
}),
|
|
4206
|
+
}), d;
|
|
4221
4207
|
}
|
|
4222
|
-
function ti(
|
|
4223
|
-
|
|
4208
|
+
function ti(d, r, o, l) {
|
|
4209
|
+
d.stopPropagation(), r.showModal({
|
|
4224
4210
|
showComponent: "card-modal",
|
|
4225
|
-
props: { data: o, options:
|
|
4211
|
+
props: { data: o, options: l }
|
|
4226
4212
|
});
|
|
4227
4213
|
}
|
|
4228
|
-
function ni(
|
|
4229
|
-
const r = [...
|
|
4214
|
+
function ni(d) {
|
|
4215
|
+
const r = [...d];
|
|
4230
4216
|
for (let o = r.length - 1; o > 0; o--) {
|
|
4231
|
-
const
|
|
4232
|
-
[r[o], r[
|
|
4217
|
+
const l = Math.floor(Math.random() * (o + 1));
|
|
4218
|
+
[r[o], r[l]] = [r[l], r[o]];
|
|
4233
4219
|
}
|
|
4234
4220
|
return r;
|
|
4235
4221
|
}
|
|
4236
4222
|
function ri() {
|
|
4237
|
-
let
|
|
4223
|
+
let d = "";
|
|
4238
4224
|
const r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
4239
|
-
for (let o = 0; o < 7; o++)
|
|
4240
|
-
return
|
|
4225
|
+
for (let o = 0; o < 7; o++) d += r.charAt(Math.floor(Math.random() * r.length));
|
|
4226
|
+
return d;
|
|
4241
4227
|
}
|
|
4242
|
-
function ai(
|
|
4243
|
-
return
|
|
4228
|
+
function ai(d) {
|
|
4229
|
+
return d[Math.floor(Math.random() * d.length)];
|
|
4244
4230
|
}
|
|
4245
|
-
const ii = (
|
|
4231
|
+
const ii = (d) => {
|
|
4246
4232
|
switch (!0) {
|
|
4247
|
-
case
|
|
4233
|
+
case d < 0:
|
|
4248
4234
|
return "text-down text-xs";
|
|
4249
|
-
case
|
|
4235
|
+
case d > 0:
|
|
4250
4236
|
return "text-up text-xs";
|
|
4251
4237
|
default:
|
|
4252
4238
|
return "text-white text-xs";
|
|
@@ -4264,11 +4250,11 @@ class si {
|
|
|
4264
4250
|
const o = await this.sm.getSubscribers();
|
|
4265
4251
|
if (o.length === 0)
|
|
4266
4252
|
return;
|
|
4267
|
-
const
|
|
4268
|
-
r ?
|
|
4269
|
-
|
|
4270
|
-
}), await Promise.allSettled(
|
|
4271
|
-
(
|
|
4253
|
+
const l = [];
|
|
4254
|
+
r ? l.push(this.api.get(r)) : o == null || o.forEach((x) => {
|
|
4255
|
+
l.push(this.api.get(x));
|
|
4256
|
+
}), await Promise.allSettled(l).then(
|
|
4257
|
+
(x) => x.forEach(async (D) => {
|
|
4272
4258
|
let K, U = 400;
|
|
4273
4259
|
if (D.status === "fulfilled") {
|
|
4274
4260
|
let M = D.value;
|
|
@@ -4286,17 +4272,17 @@ class si {
|
|
|
4286
4272
|
), M.data.messages = ee, se = Fn(M.data.messages), X.hash === se)
|
|
4287
4273
|
return console.info(
|
|
4288
4274
|
"%capi%c %cno updates",
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4275
|
+
m.API,
|
|
4276
|
+
m.NONE,
|
|
4277
|
+
m.NO_UPDATES,
|
|
4292
4278
|
N.MESSAGES,
|
|
4293
4279
|
M.query.slide,
|
|
4294
4280
|
M.query.widget
|
|
4295
4281
|
), console.debug(
|
|
4296
4282
|
"%capi%c %cno updates",
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4283
|
+
m.API,
|
|
4284
|
+
m.NONE,
|
|
4285
|
+
m.NO_UPDATES,
|
|
4300
4286
|
N.MESSAGES,
|
|
4301
4287
|
M
|
|
4302
4288
|
), 204;
|
|
@@ -4305,17 +4291,17 @@ class si {
|
|
|
4305
4291
|
case N.CLOUD:
|
|
4306
4292
|
se = Fn(M.data), X.hash === se ? (console.info(
|
|
4307
4293
|
"%capi%c %cno updates",
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4294
|
+
m.API,
|
|
4295
|
+
m.NONE,
|
|
4296
|
+
m.NO_UPDATES,
|
|
4311
4297
|
N.CLOUD,
|
|
4312
4298
|
M.query.slide,
|
|
4313
4299
|
M.query.widget
|
|
4314
4300
|
), console.debug(
|
|
4315
4301
|
"%capi%c %cno updates",
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4302
|
+
m.API,
|
|
4303
|
+
m.NONE,
|
|
4304
|
+
m.NO_UPDATES,
|
|
4319
4305
|
N.CLOUD,
|
|
4320
4306
|
M
|
|
4321
4307
|
), U = 204) : (X.hash = se, K = {
|
|
@@ -4336,17 +4322,17 @@ class si {
|
|
|
4336
4322
|
case N.SERIES:
|
|
4337
4323
|
se = Fn(M.data), X.hash === se ? (console.info(
|
|
4338
4324
|
"%capi%c %cno updates",
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4325
|
+
m.API,
|
|
4326
|
+
m.NONE,
|
|
4327
|
+
m.NO_UPDATES,
|
|
4342
4328
|
N.SERIES,
|
|
4343
4329
|
M.query.slide,
|
|
4344
4330
|
M.query.widget
|
|
4345
4331
|
), console.debug(
|
|
4346
4332
|
"%capi%c %cno updates",
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4333
|
+
m.API,
|
|
4334
|
+
m.NONE,
|
|
4335
|
+
m.NO_UPDATES,
|
|
4350
4336
|
N.SERIES,
|
|
4351
4337
|
M
|
|
4352
4338
|
), U = 204) : (X.hash = se, K = {
|
|
@@ -4367,9 +4353,9 @@ class si {
|
|
|
4367
4353
|
default:
|
|
4368
4354
|
console.warn(
|
|
4369
4355
|
"%capi%c %cstorage",
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4356
|
+
m.API,
|
|
4357
|
+
m.NONE,
|
|
4358
|
+
m.STORAGE,
|
|
4373
4359
|
"error",
|
|
4374
4360
|
`data type ${M.query.type} unknown`
|
|
4375
4361
|
);
|
|
@@ -4380,16 +4366,16 @@ class si {
|
|
|
4380
4366
|
case 201:
|
|
4381
4367
|
console.info(
|
|
4382
4368
|
"%capp%c %cbroadcast",
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4369
|
+
m.API,
|
|
4370
|
+
m.NONE,
|
|
4371
|
+
m.BROADCAST,
|
|
4386
4372
|
M.query.slide,
|
|
4387
4373
|
M.data.title ?? M.query.widget
|
|
4388
4374
|
), console.debug(
|
|
4389
4375
|
"%capp%c %cbroadcast",
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4376
|
+
m.API,
|
|
4377
|
+
m.NONE,
|
|
4378
|
+
m.BROADCAST,
|
|
4393
4379
|
M
|
|
4394
4380
|
);
|
|
4395
4381
|
const X = structuredClone(K.query);
|
|
@@ -4406,9 +4392,9 @@ class si {
|
|
|
4406
4392
|
default:
|
|
4407
4393
|
console.warn(
|
|
4408
4394
|
"%capp%c %cbroadcast",
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4395
|
+
m.API,
|
|
4396
|
+
m.NONE,
|
|
4397
|
+
m.BROADCAST,
|
|
4412
4398
|
"Unhandled data type",
|
|
4413
4399
|
M.query
|
|
4414
4400
|
);
|
|
@@ -4423,9 +4409,9 @@ class si {
|
|
|
4423
4409
|
default:
|
|
4424
4410
|
console.warn(
|
|
4425
4411
|
"%capp%c %cbroadcast",
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4412
|
+
m.API,
|
|
4413
|
+
m.NONE,
|
|
4414
|
+
m.BROADCAST,
|
|
4429
4415
|
"Fetch error",
|
|
4430
4416
|
M.query.slide,
|
|
4431
4417
|
M.data.title ?? M.query.widget
|
|
@@ -4436,9 +4422,9 @@ class si {
|
|
|
4436
4422
|
} else
|
|
4437
4423
|
return console.warn(
|
|
4438
4424
|
"%capi%c %cstorage",
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4425
|
+
m.API,
|
|
4426
|
+
m.NONE,
|
|
4427
|
+
m.STORAGE,
|
|
4442
4428
|
re.ERROR,
|
|
4443
4429
|
D.status
|
|
4444
4430
|
), 400;
|
|
@@ -4457,9 +4443,9 @@ class si {
|
|
|
4457
4443
|
case re.UPDATE:
|
|
4458
4444
|
console.debug(
|
|
4459
4445
|
"%capi%c %cstorage",
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4446
|
+
m.API,
|
|
4447
|
+
m.NONE,
|
|
4448
|
+
m.STORAGE,
|
|
4463
4449
|
re.UPDATE,
|
|
4464
4450
|
r.data
|
|
4465
4451
|
), await this.update();
|
|
@@ -4467,36 +4453,36 @@ class si {
|
|
|
4467
4453
|
}
|
|
4468
4454
|
});
|
|
4469
4455
|
k(this, "cleanMessages", async () => {
|
|
4470
|
-
var
|
|
4471
|
-
if ((
|
|
4456
|
+
var l, x, D;
|
|
4457
|
+
if ((l = this.options) != null && l.suspended) {
|
|
4472
4458
|
console.info(
|
|
4473
4459
|
"%cstorage%c %cstorage",
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4460
|
+
m.STORAGE,
|
|
4461
|
+
m.NONE,
|
|
4462
|
+
m.MESSAGES,
|
|
4477
4463
|
"Account suspended"
|
|
4478
4464
|
);
|
|
4479
4465
|
return;
|
|
4480
4466
|
}
|
|
4481
|
-
const r = ((
|
|
4467
|
+
const r = ((x = this.options) == null ? void 0 : x.retention) || 86400 * 4, o = await ((D = this.sm) == null ? void 0 : D.cleanMessages(
|
|
4482
4468
|
r
|
|
4483
4469
|
));
|
|
4484
4470
|
console.info(
|
|
4485
4471
|
"%cstorage%c %cstorage",
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4472
|
+
m.STORAGE,
|
|
4473
|
+
m.NONE,
|
|
4474
|
+
m.MESSAGES,
|
|
4489
4475
|
`${o} messages deleted`
|
|
4490
4476
|
);
|
|
4491
4477
|
});
|
|
4492
4478
|
k(this, "hideMessage", async (r) => {
|
|
4493
|
-
var
|
|
4494
|
-
const o = await ((
|
|
4479
|
+
var l;
|
|
4480
|
+
const o = await ((l = this.sm) == null ? void 0 : l.hideMessage(r.id, 0));
|
|
4495
4481
|
return console.info(
|
|
4496
4482
|
"%cstorage%c %cstorage",
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4483
|
+
m.STORAGE,
|
|
4484
|
+
m.NONE,
|
|
4485
|
+
m.HIDE,
|
|
4500
4486
|
`${o} messages hidden`
|
|
4501
4487
|
), await this.api.hideMessage(r);
|
|
4502
4488
|
});
|
|
@@ -4508,15 +4494,15 @@ class si {
|
|
|
4508
4494
|
k(this, "loadSlide", async (r) => await this.api.loadSlide(r));
|
|
4509
4495
|
k(this, "storeSlide", async (r) => {
|
|
4510
4496
|
var o;
|
|
4511
|
-
return await ((o = this.sm) == null ? void 0 : o.storeSlide(r).then(async () => r != null && r.update && r.update ? await this.api.storeSlide(r) : new Promise((
|
|
4512
|
-
|
|
4497
|
+
return await ((o = this.sm) == null ? void 0 : o.storeSlide(r).then(async () => r != null && r.update && r.update ? await this.api.storeSlide(r) : new Promise((l, x) => {
|
|
4498
|
+
l(201);
|
|
4513
4499
|
})));
|
|
4514
4500
|
});
|
|
4515
4501
|
console.info(
|
|
4516
4502
|
"%cstorage%c %cslide",
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4503
|
+
m.STORAGE,
|
|
4504
|
+
m.NONE,
|
|
4505
|
+
m.SLIDE,
|
|
4520
4506
|
r.slide,
|
|
4521
4507
|
re.VERSION,
|
|
4522
4508
|
ka
|
|
@@ -4524,13 +4510,13 @@ class si {
|
|
|
4524
4510
|
const o = (r == null ? void 0 : r.slide) || r.app;
|
|
4525
4511
|
switch (this.bc = new BroadcastChannel(o), console.info(
|
|
4526
4512
|
"%capi%c %cbroadcast",
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4513
|
+
m.API,
|
|
4514
|
+
m.NONE,
|
|
4515
|
+
m.BROADCAST,
|
|
4530
4516
|
re.CHANNEL,
|
|
4531
4517
|
o
|
|
4532
|
-
), this.bc.onmessage = (
|
|
4533
|
-
this.actions(
|
|
4518
|
+
), this.bc.onmessage = (l) => {
|
|
4519
|
+
this.actions(l);
|
|
4534
4520
|
}, this.bc.postMessage({ event: re.STORAGE_INIT, data: {} }), this.api = new Da(r), r.storage) {
|
|
4535
4521
|
case ye.DEXIE:
|
|
4536
4522
|
this.sm = new jr(r);
|
|
@@ -4562,9 +4548,9 @@ class $a {
|
|
|
4562
4548
|
var o;
|
|
4563
4549
|
return r.type !== N.CLOUD ? (console.warn(
|
|
4564
4550
|
"%capp%c %get",
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4551
|
+
m.APP,
|
|
4552
|
+
m.NONE,
|
|
4553
|
+
m.GET_DATA,
|
|
4568
4554
|
r.widget,
|
|
4569
4555
|
"wrong method call for getMessages, type used is",
|
|
4570
4556
|
r.type
|
|
@@ -4583,9 +4569,9 @@ class $a {
|
|
|
4583
4569
|
var o;
|
|
4584
4570
|
return r.type !== N.MESSAGES ? (console.warn(
|
|
4585
4571
|
"%capp%c %get",
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4572
|
+
m.APP,
|
|
4573
|
+
m.NONE,
|
|
4574
|
+
m.GET_DATA,
|
|
4589
4575
|
r.widget,
|
|
4590
4576
|
"wrong method call for getMessages, type used is",
|
|
4591
4577
|
r.type
|
|
@@ -4604,9 +4590,9 @@ class $a {
|
|
|
4604
4590
|
var o;
|
|
4605
4591
|
return r.type !== N.SERIES ? (console.warn(
|
|
4606
4592
|
"%capp%c %get",
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4593
|
+
m.APP,
|
|
4594
|
+
m.NONE,
|
|
4595
|
+
m.GET_DATA,
|
|
4610
4596
|
r.widget,
|
|
4611
4597
|
"wrong method call for getMessages, type used is",
|
|
4612
4598
|
r.type
|
|
@@ -4643,7 +4629,7 @@ class oi {
|
|
|
4643
4629
|
* @param callbacks functions in the widget that will receive the update
|
|
4644
4630
|
* @param selector container for the element - by default buzzcasting-slide (optional)
|
|
4645
4631
|
*/
|
|
4646
|
-
constructor(r, o,
|
|
4632
|
+
constructor(r, o, l) {
|
|
4647
4633
|
k(this, "storageReader");
|
|
4648
4634
|
k(this, "broadcastChannel");
|
|
4649
4635
|
k(this, "element");
|
|
@@ -4676,9 +4662,9 @@ class oi {
|
|
|
4676
4662
|
*/
|
|
4677
4663
|
k(this, "getCloud", async () => this.query.type !== N.CLOUD ? (console.warn(
|
|
4678
4664
|
"%cstorage%c %cwidget",
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4665
|
+
m.STORAGE,
|
|
4666
|
+
m.NONE,
|
|
4667
|
+
m.WIDGET,
|
|
4682
4668
|
this.query.widget,
|
|
4683
4669
|
"Wrong method call for getCloud, expected type is",
|
|
4684
4670
|
this.query.type
|
|
@@ -4694,9 +4680,9 @@ class oi {
|
|
|
4694
4680
|
*/
|
|
4695
4681
|
k(this, "getMessages", async () => this.query.type !== N.MESSAGES ? (console.warn(
|
|
4696
4682
|
"%cstorage%c %cwidget",
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4683
|
+
m.STORAGE,
|
|
4684
|
+
m.NONE,
|
|
4685
|
+
m.WIDGET,
|
|
4700
4686
|
this.query.widget,
|
|
4701
4687
|
"Wrong method call for getMessages, expected type is",
|
|
4702
4688
|
this.query.type
|
|
@@ -4706,9 +4692,9 @@ class oi {
|
|
|
4706
4692
|
success: !1
|
|
4707
4693
|
}) : (console.debug(
|
|
4708
4694
|
"%cstorage%c %cwidget",
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4695
|
+
m.API,
|
|
4696
|
+
m.NONE,
|
|
4697
|
+
m.MESSAGES,
|
|
4712
4698
|
this.query
|
|
4713
4699
|
), await this.storageReader.getMessages(this.query)));
|
|
4714
4700
|
/**
|
|
@@ -4718,9 +4704,9 @@ class oi {
|
|
|
4718
4704
|
*/
|
|
4719
4705
|
k(this, "getSeries", async () => this.query.type !== N.SERIES ? (console.warn(
|
|
4720
4706
|
"%cstorage%c %cwidget",
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4707
|
+
m.STORAGE,
|
|
4708
|
+
m.NONE,
|
|
4709
|
+
m.WIDGET,
|
|
4724
4710
|
this.query.widget,
|
|
4725
4711
|
"Wrong method call for getSeries, expected type is",
|
|
4726
4712
|
this.query.type
|
|
@@ -4738,7 +4724,7 @@ class oi {
|
|
|
4738
4724
|
k(this, "showModal", (r) => {
|
|
4739
4725
|
console.debug(
|
|
4740
4726
|
"%cwidget",
|
|
4741
|
-
|
|
4727
|
+
m.WIDGET,
|
|
4742
4728
|
re.SHOW_MODAL,
|
|
4743
4729
|
r.showComponent,
|
|
4744
4730
|
// @ts-ignore
|
|
@@ -4759,11 +4745,11 @@ class oi {
|
|
|
4759
4745
|
window.dispatchEvent(o);
|
|
4760
4746
|
});
|
|
4761
4747
|
var K;
|
|
4762
|
-
this.element = r, this.listeners = o,
|
|
4763
|
-
let
|
|
4764
|
-
|
|
4748
|
+
this.element = r, this.listeners = o, l = typeof l < "u" ? l : "buzzcasting-slide";
|
|
4749
|
+
let x;
|
|
4750
|
+
x = { ...r.dataset }, delete x.hmr, x.slide = ((K = r.closest(l.toUpperCase())) == null ? void 0 : K.id) ?? `${l} not found`, x = Mr(x), this.query = x, Na(r);
|
|
4765
4751
|
const D = window.BuzzCasting.getOptions();
|
|
4766
|
-
this.storageReader = new $a(D), this.broadcastChannel = new BroadcastChannel(
|
|
4752
|
+
this.storageReader = new $a(D), this.broadcastChannel = new BroadcastChannel(x.slide), this.startListener();
|
|
4767
4753
|
}
|
|
4768
4754
|
addListener(r) {
|
|
4769
4755
|
this.listeners.push(r);
|
|
@@ -4774,11 +4760,11 @@ class oi {
|
|
|
4774
4760
|
startListener() {
|
|
4775
4761
|
const r = this.query;
|
|
4776
4762
|
this.broadcastChannel.onmessage = async (o) => {
|
|
4777
|
-
const
|
|
4763
|
+
const l = o.data.data;
|
|
4778
4764
|
switch (o.data.event) {
|
|
4779
4765
|
case re.WIDGET_UPDATE:
|
|
4780
|
-
|
|
4781
|
-
|
|
4766
|
+
l.query.slide === r.slide && l.query.widget === r.widget && this.listeners.forEach((x) => {
|
|
4767
|
+
x(o.data);
|
|
4782
4768
|
});
|
|
4783
4769
|
break;
|
|
4784
4770
|
case re.SLIDE_READY:
|
|
@@ -4794,16 +4780,16 @@ class oi {
|
|
|
4794
4780
|
subscribe() {
|
|
4795
4781
|
console.info(
|
|
4796
4782
|
"%cwidget%c %csubscribe",
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4783
|
+
m.WIDGET,
|
|
4784
|
+
m.NONE,
|
|
4785
|
+
m.SUBSCRIBE,
|
|
4800
4786
|
this.query.slide,
|
|
4801
4787
|
this.query.widget
|
|
4802
4788
|
), console.debug(
|
|
4803
4789
|
"%cwidget%c %csubscribe",
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4790
|
+
m.WIDGET,
|
|
4791
|
+
m.NONE,
|
|
4792
|
+
m.SUBSCRIBE,
|
|
4807
4793
|
this.query
|
|
4808
4794
|
), this.broadcastChannel.postMessage({
|
|
4809
4795
|
event: re.SUBSCRIBE,
|
|
@@ -4818,7 +4804,7 @@ export {
|
|
|
4818
4804
|
N as API,
|
|
4819
4805
|
si as BuzzcastingStorageManager,
|
|
4820
4806
|
$a as BuzzcastingStorageReader,
|
|
4821
|
-
|
|
4807
|
+
m as CSS,
|
|
4822
4808
|
re as EVENTS,
|
|
4823
4809
|
Zt as MODERATION,
|
|
4824
4810
|
ye as STORAGE,
|