buzzcasting-storage 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/buzzcasting-storage.esm.js +167 -181
- package/package.json +1 -1
|
@@ -75,7 +75,7 @@ const $e = Object.getPrototypeOf, dr = {}.hasOwnProperty;
|
|
|
75
75
|
function H(t, e) {
|
|
76
76
|
return dr.call(t, e);
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function Ce(t, e) {
|
|
79
79
|
typeof e == "function" && (e = e($e(t))), (typeof Reflect > "u" ? R : Reflect.ownKeys)(e).forEach((n) => {
|
|
80
80
|
te(t, n, e[n]);
|
|
81
81
|
});
|
|
@@ -84,9 +84,9 @@ const Kn = Object.defineProperty;
|
|
|
84
84
|
function te(t, e, n, r) {
|
|
85
85
|
Kn(t, e, z(n && H(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, r));
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function Ee(t) {
|
|
88
88
|
return { from: function(e) {
|
|
89
|
-
return t.prototype = Object.create(e.prototype), te(t.prototype, "constructor", t), { extend:
|
|
89
|
+
return t.prototype = Object.create(e.prototype), te(t.prototype, "constructor", t), { extend: Ce.bind(null, t.prototype) };
|
|
90
90
|
} };
|
|
91
91
|
}
|
|
92
92
|
const fr = Object.getOwnPropertyDescriptor;
|
|
@@ -198,13 +198,13 @@ const Bt = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", br = typeof Bt
|
|
|
198
198
|
return t != null && (e = t[Bt]) && e.apply(t);
|
|
199
199
|
} : function() {
|
|
200
200
|
return null;
|
|
201
|
-
},
|
|
201
|
+
}, Se = {};
|
|
202
202
|
function q(t) {
|
|
203
203
|
var e, n, r, s;
|
|
204
204
|
if (arguments.length === 1) {
|
|
205
205
|
if (L(t))
|
|
206
206
|
return t.slice();
|
|
207
|
-
if (this ===
|
|
207
|
+
if (this === Se && typeof t == "string")
|
|
208
208
|
return [t];
|
|
209
209
|
if (s = br(t)) {
|
|
210
210
|
for (n = []; !(r = s.next()).done; )
|
|
@@ -231,10 +231,10 @@ function Rn(t, e) {
|
|
|
231
231
|
}
|
|
232
232
|
var Fn = () => !0;
|
|
233
233
|
const vr = !new Error("").stack;
|
|
234
|
-
function
|
|
234
|
+
function ve() {
|
|
235
235
|
if (vr)
|
|
236
236
|
try {
|
|
237
|
-
throw
|
|
237
|
+
throw ve.arguments, new Error();
|
|
238
238
|
} catch (t) {
|
|
239
239
|
return t;
|
|
240
240
|
}
|
|
@@ -248,33 +248,33 @@ function Tt(t, e) {
|
|
|
248
248
|
` + r).join("")) : "";
|
|
249
249
|
}
|
|
250
250
|
var Nn = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], an = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(Nn), wr = { VersionChanged: "Database version changed by other database connection", DatabaseClosed: "Database has been closed", Abort: "Transaction aborted", TransactionInactive: "Transaction has already completed or failed", MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb" };
|
|
251
|
-
function
|
|
252
|
-
this._e =
|
|
251
|
+
function Oe(t, e) {
|
|
252
|
+
this._e = ve(), this.name = t, this.message = e;
|
|
253
253
|
}
|
|
254
254
|
function $n(t, e) {
|
|
255
255
|
return t + ". Errors: " + Object.keys(e).map((n) => e[n].toString()).filter((n, r, s) => s.indexOf(n) === r).join(`
|
|
256
256
|
`);
|
|
257
257
|
}
|
|
258
258
|
function dt(t, e, n, r) {
|
|
259
|
-
this._e =
|
|
259
|
+
this._e = ve(), this.failures = e, this.failedKeys = r, this.successCount = n, this.message = $n(t, e);
|
|
260
260
|
}
|
|
261
261
|
function Te(t, e) {
|
|
262
|
-
this._e =
|
|
262
|
+
this._e = ve(), this.name = "BulkError", this.failures = Object.keys(e).map((n) => e[n]), this.failuresByPos = e, this.message = $n(t, e);
|
|
263
263
|
}
|
|
264
|
-
|
|
264
|
+
Ee(Oe).from(Error).extend({ stack: { get: function() {
|
|
265
265
|
return this._stack || (this._stack = this.name + ": " + this.message + Tt(this._e, 2));
|
|
266
266
|
} }, toString: function() {
|
|
267
267
|
return this.name + ": " + this.message;
|
|
268
|
-
} }),
|
|
268
|
+
} }), Ee(dt).from(Oe), Ee(Te).from(Oe);
|
|
269
269
|
var cn = an.reduce((t, e) => (t[e] = e + "Error", t), {});
|
|
270
|
-
const _r =
|
|
270
|
+
const _r = Oe;
|
|
271
271
|
var C = an.reduce((t, e) => {
|
|
272
272
|
var n = e + "Error";
|
|
273
273
|
function r(s, i) {
|
|
274
|
-
this._e =
|
|
274
|
+
this._e = ve(), this.name = n, s ? typeof s == "string" ? (this.message = `${s}${i ? `
|
|
275
275
|
` + i : ""}`, this.inner = i || null) : typeof s == "object" && (this.message = `${s.name} ${s.message}`, this.inner = s) : (this.message = wr[e] || n, this.inner = null);
|
|
276
276
|
}
|
|
277
|
-
return
|
|
277
|
+
return Ee(r).from(_r), t[e] = r, t;
|
|
278
278
|
}, {});
|
|
279
279
|
C.Syntax = SyntaxError, C.Type = TypeError, C.Range = RangeError;
|
|
280
280
|
var bn = Nn.reduce((t, e) => (t[e + "Error"] = C[e], t), {}), st = an.reduce((t, e) => (["Syntax", "Type", "Range"].indexOf(e) === -1 && (t[e + "Error"] = C[e]), t), {});
|
|
@@ -320,7 +320,7 @@ function Er(t, e) {
|
|
|
320
320
|
return s && (this.onsuccess = this.onsuccess ? ye(s, this.onsuccess) : s), i && (this.onerror = this.onerror ? ye(i, this.onerror) : i), r === void 0 ? o === void 0 ? void 0 : o : z(r, o);
|
|
321
321
|
};
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function Or(t, e) {
|
|
324
324
|
return t === A ? e : function() {
|
|
325
325
|
return e.apply(this, arguments) !== !1 && t.apply(this, arguments);
|
|
326
326
|
};
|
|
@@ -338,7 +338,7 @@ function ln(t, e) {
|
|
|
338
338
|
return e.apply(this, arguments);
|
|
339
339
|
};
|
|
340
340
|
}
|
|
341
|
-
st.ModifyError = dt, st.DexieError =
|
|
341
|
+
st.ModifyError = dt, st.DexieError = Oe, st.BulkError = Te;
|
|
342
342
|
var Ue = {};
|
|
343
343
|
const Ln = 100, [Mt, ft, Rt] = typeof Promise > "u" ? [] : (() => {
|
|
344
344
|
let t = Promise.resolve();
|
|
@@ -347,7 +347,7 @@ const Ln = 100, [Mt, ft, Rt] = typeof Promise > "u" ? [] : (() => {
|
|
|
347
347
|
const e = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
348
348
|
return [e, $e(e), t];
|
|
349
349
|
})(), Un = ft && ft.then, it = Mt && Mt.constructor, un = !!Rt;
|
|
350
|
-
var Ft = !1,
|
|
350
|
+
var Ft = !1, Pr = Rt ? () => {
|
|
351
351
|
Rt.then(Xe);
|
|
352
352
|
} : D.setImmediate ? setImmediate.bind(null, Xe) : D.MutationObserver ? () => {
|
|
353
353
|
var t = document.createElement("div");
|
|
@@ -357,7 +357,7 @@ var Ft = !1, Or = Rt ? () => {
|
|
|
357
357
|
} : () => {
|
|
358
358
|
setTimeout(Xe, 0);
|
|
359
359
|
}, Me = function(t, e) {
|
|
360
|
-
Be.push([t, e]), pt && (
|
|
360
|
+
Be.push([t, e]), pt && (Pr(), pt = !1);
|
|
361
361
|
}, Nt = !0, pt = !0, fe = [], ot = [], $t = null, Lt = Le, Pe = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: _n, pgp: !1, env: {}, finalize: function() {
|
|
362
362
|
this.unhandleds.forEach((t) => {
|
|
363
363
|
try {
|
|
@@ -365,13 +365,13 @@ var Ft = !1, Or = Rt ? () => {
|
|
|
365
365
|
} catch {
|
|
366
366
|
}
|
|
367
367
|
});
|
|
368
|
-
} },
|
|
368
|
+
} }, P = Pe, Be = [], pe = 0, at = [];
|
|
369
369
|
function E(t) {
|
|
370
370
|
if (typeof this != "object")
|
|
371
371
|
throw new TypeError("Promises must be constructed via new");
|
|
372
372
|
this._listeners = [], this.onuncatched = A, this._lib = !1;
|
|
373
|
-
var e = this._PSD =
|
|
374
|
-
if (J && (this._stackHolder =
|
|
373
|
+
var e = this._PSD = P;
|
|
374
|
+
if (J && (this._stackHolder = ve(), this._prev = null, this._numPrev = 0), typeof t != "function") {
|
|
375
375
|
if (t !== Ue)
|
|
376
376
|
throw new TypeError("Not a function");
|
|
377
377
|
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && Wt(this, this._value));
|
|
@@ -379,9 +379,9 @@ function E(t) {
|
|
|
379
379
|
this._state = null, this._value = null, ++e.ref, zn(this, t);
|
|
380
380
|
}
|
|
381
381
|
const Ut = { get: function() {
|
|
382
|
-
var t =
|
|
382
|
+
var t = P, e = mt;
|
|
383
383
|
function n(r, s) {
|
|
384
|
-
var i = !t.global && (t !==
|
|
384
|
+
var i = !t.global && (t !== P || e !== mt);
|
|
385
385
|
const o = i && !re();
|
|
386
386
|
var a = new E((c, l) => {
|
|
387
387
|
hn(this, new Wn(yt(r, t, i, o), yt(s, t, i, o), c, l, t));
|
|
@@ -508,9 +508,9 @@ function Ze(t) {
|
|
|
508
508
|
return new E(Ue, !1, t);
|
|
509
509
|
}
|
|
510
510
|
function I(t, e) {
|
|
511
|
-
var n =
|
|
511
|
+
var n = P;
|
|
512
512
|
return function() {
|
|
513
|
-
var r = Ye(), s =
|
|
513
|
+
var r = Ye(), s = P;
|
|
514
514
|
try {
|
|
515
515
|
return ce(n, !0), t.apply(this, arguments);
|
|
516
516
|
} catch (i) {
|
|
@@ -520,8 +520,8 @@ function I(t, e) {
|
|
|
520
520
|
}
|
|
521
521
|
};
|
|
522
522
|
}
|
|
523
|
-
|
|
524
|
-
hn(this, new Wn(null, null, t, e,
|
|
523
|
+
Ce(E.prototype, { then: Ut, _then: function(t, e) {
|
|
524
|
+
hn(this, new Wn(null, null, t, e, P));
|
|
525
525
|
}, catch: function(t) {
|
|
526
526
|
if (arguments.length === 1)
|
|
527
527
|
return this.then(null, t);
|
|
@@ -545,7 +545,7 @@ From previous: `);
|
|
|
545
545
|
var s = setTimeout(() => r(new C.Timeout(e)), t);
|
|
546
546
|
this.then(n, r).finally(clearTimeout.bind(null, s));
|
|
547
547
|
}) : this;
|
|
548
|
-
} }), typeof Symbol < "u" && Symbol.toStringTag && te(E.prototype, Symbol.toStringTag, "Dexie.Promise"), Pe.env = Yn(),
|
|
548
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && te(E.prototype, Symbol.toStringTag, "Dexie.Promise"), Pe.env = Yn(), Ce(E, { all: function() {
|
|
549
549
|
var t = q.apply(null, arguments).map(qe);
|
|
550
550
|
return new E(function(e, n) {
|
|
551
551
|
t.length === 0 && e([]);
|
|
@@ -568,12 +568,12 @@ From previous: `);
|
|
|
568
568
|
return new E((e, n) => {
|
|
569
569
|
t.map((r) => E.resolve(r).then(e, n));
|
|
570
570
|
});
|
|
571
|
-
}, PSD: { get: () =>
|
|
571
|
+
}, PSD: { get: () => P, set: (t) => P = t }, totalEchoes: { get: () => mt }, newPSD: ae, usePSD: Ke, scheduler: { get: () => Me, set: (t) => {
|
|
572
572
|
Me = t;
|
|
573
573
|
} }, rejectionMapper: { get: () => Lt, set: (t) => {
|
|
574
574
|
Lt = t;
|
|
575
575
|
} }, follow: (t, e) => new E((n, r) => ae((s, i) => {
|
|
576
|
-
var o =
|
|
576
|
+
var o = P;
|
|
577
577
|
o.unhandleds = [], o.onunhandled = i, o.finalize = ye(function() {
|
|
578
578
|
(function(a) {
|
|
579
579
|
function c() {
|
|
@@ -608,7 +608,7 @@ From previous: `);
|
|
|
608
608
|
const $ = { awaits: 0, echoes: 0, id: 0 };
|
|
609
609
|
var jr = 0, ct = [], kt = 0, mt = 0, Kr = 0;
|
|
610
610
|
function ae(t, e, n, r) {
|
|
611
|
-
var s =
|
|
611
|
+
var s = P, i = Object.create(s);
|
|
612
612
|
i.parent = s, i.ref = 0, i.global = !1, i.id = ++Kr;
|
|
613
613
|
var o = Pe.env;
|
|
614
614
|
i.env = un ? { Promise: E, PromiseProp: { value: E, configurable: !0, writable: !0 }, all: E.all, race: E.race, allSettled: E.allSettled, any: E.any, resolve: E.resolve, reject: E.reject, nthen: vn(o.nthen, i), gthen: vn(o.gthen, i) } : {}, e && z(i, e), ++s.ref, i.finalize = function() {
|
|
@@ -627,15 +627,15 @@ function qe(t) {
|
|
|
627
627
|
return $.echoes && t && t.constructor === it ? (je(), t.then((e) => (re(), e), (e) => (re(), F(e)))) : t;
|
|
628
628
|
}
|
|
629
629
|
function Ar(t) {
|
|
630
|
-
++mt, $.echoes && --$.echoes != 0 || ($.echoes = $.id = 0), ct.push(
|
|
630
|
+
++mt, $.echoes && --$.echoes != 0 || ($.echoes = $.id = 0), ct.push(P), ce(t, !0);
|
|
631
631
|
}
|
|
632
632
|
function Dr() {
|
|
633
633
|
var t = ct[ct.length - 1];
|
|
634
634
|
ct.pop(), ce(t, !1);
|
|
635
635
|
}
|
|
636
636
|
function ce(t, e) {
|
|
637
|
-
var n =
|
|
638
|
-
if ((e ? !$.echoes || kt++ && t ===
|
|
637
|
+
var n = P;
|
|
638
|
+
if ((e ? !$.echoes || kt++ && t === P : !kt || --kt && t === P) || Qn(e ? Ar.bind(null, t) : Dr), t !== P && (P = t, n === Pe && (Pe.env = Yn()), un)) {
|
|
639
639
|
var r = Pe.env.Promise, s = t.env;
|
|
640
640
|
ft.then = s.nthen, r.prototype.then = s.gthen, (n.global || t.global) && (Object.defineProperty(D, "Promise", s.PromiseProp), r.all = s.all, r.race = s.race, r.resolve = s.resolve, r.reject = s.reject, s.allSettled && (r.allSettled = s.allSettled), s.any && (r.any = s.any));
|
|
641
641
|
}
|
|
@@ -645,7 +645,7 @@ function Yn() {
|
|
|
645
645
|
return un ? { Promise: t, PromiseProp: Object.getOwnPropertyDescriptor(D, "Promise"), all: t.all, race: t.race, allSettled: t.allSettled, any: t.any, resolve: t.resolve, reject: t.reject, nthen: ft.then, gthen: t.prototype.then } : {};
|
|
646
646
|
}
|
|
647
647
|
function Ke(t, e, n, r, s) {
|
|
648
|
-
var i =
|
|
648
|
+
var i = P;
|
|
649
649
|
try {
|
|
650
650
|
return ce(t, !0), e(n, r, s);
|
|
651
651
|
} finally {
|
|
@@ -657,7 +657,7 @@ function Qn(t) {
|
|
|
657
657
|
}
|
|
658
658
|
function yt(t, e, n, r) {
|
|
659
659
|
return typeof t != "function" ? t : function() {
|
|
660
|
-
var s =
|
|
660
|
+
var s = P;
|
|
661
661
|
n && je(), ce(e, !0);
|
|
662
662
|
try {
|
|
663
663
|
return t.apply(this, arguments);
|
|
@@ -693,14 +693,14 @@ function _n(t, e) {
|
|
|
693
693
|
}
|
|
694
694
|
var F = E.reject;
|
|
695
695
|
function zt(t, e, n, r) {
|
|
696
|
-
if (t.idbdb && (t._state.openComplete ||
|
|
696
|
+
if (t.idbdb && (t._state.openComplete || P.letThrough || t._vip)) {
|
|
697
697
|
var s = t._createTransaction(e, n, t._dbSchema);
|
|
698
698
|
try {
|
|
699
699
|
s.create(), t._state.PR1398_maxLoop = 3;
|
|
700
700
|
} catch (i) {
|
|
701
701
|
return i.name === cn.InvalidState && t.isOpen() && --t._state.PR1398_maxLoop > 0 ? (console.warn("Dexie: Need to reopen db"), t._close(), t.open().then(() => zt(t, e, n, r))) : F(i);
|
|
702
702
|
}
|
|
703
|
-
return s._promise(e, (i, o) => ae(() => (
|
|
703
|
+
return s._promise(e, (i, o) => ae(() => (P.trans = s, r(i, o, s)))).then((i) => s._completion.then(() => i));
|
|
704
704
|
}
|
|
705
705
|
if (t._state.openComplete)
|
|
706
706
|
return F(new C.DatabaseClosed(t._state.dbOpenError));
|
|
@@ -723,7 +723,7 @@ function et(t) {
|
|
|
723
723
|
}
|
|
724
724
|
class Tr {
|
|
725
725
|
_trans(e, n, r) {
|
|
726
|
-
const s = this._tx ||
|
|
726
|
+
const s = this._tx || P.trans, i = this.name;
|
|
727
727
|
function o(c, l, u) {
|
|
728
728
|
if (!u.schema[i])
|
|
729
729
|
throw new C.NotFound("Table " + i + " not part of transaction");
|
|
@@ -731,7 +731,7 @@ class Tr {
|
|
|
731
731
|
}
|
|
732
732
|
const a = Ye();
|
|
733
733
|
try {
|
|
734
|
-
return s && s.db === this.db ? s ===
|
|
734
|
+
return s && s.db === this.db ? s === P.trans ? s._promise(e, o, r) : ae(() => s._promise(e, o, r), { trans: s, transless: P.transless || P }) : zt(this.db, e, [this.name], o);
|
|
735
735
|
} finally {
|
|
736
736
|
a && Qe();
|
|
737
737
|
}
|
|
@@ -935,7 +935,7 @@ function Fe(t) {
|
|
|
935
935
|
function i(o, a, c) {
|
|
936
936
|
if (typeof o != "object") {
|
|
937
937
|
var l;
|
|
938
|
-
a || (a =
|
|
938
|
+
a || (a = Or), c || (c = A);
|
|
939
939
|
var u = { subscribers: [], fire: c, subscribe: function(d) {
|
|
940
940
|
u.subscribers.indexOf(d) === -1 && (u.subscribers.push(d), u.fire = a(u.fire, d));
|
|
941
941
|
}, unsubscribe: function(d) {
|
|
@@ -966,15 +966,15 @@ function Fe(t) {
|
|
|
966
966
|
}
|
|
967
967
|
}
|
|
968
968
|
function De(t, e) {
|
|
969
|
-
return
|
|
969
|
+
return Ee(e).from({ prototype: t }), e;
|
|
970
970
|
}
|
|
971
|
-
function
|
|
971
|
+
function ke(t, e) {
|
|
972
972
|
return !(t.filter || t.algorithm || t.or) && (e ? t.justLimit : !t.replayFilter);
|
|
973
973
|
}
|
|
974
974
|
function Et(t, e) {
|
|
975
975
|
t.filter = ge(t.filter, e);
|
|
976
976
|
}
|
|
977
|
-
function
|
|
977
|
+
function Ot(t, e, n) {
|
|
978
978
|
var r = t.replayFilter;
|
|
979
979
|
t.replayFilter = r ? () => ge(r(), e()) : e, t.justLimit = n && !r;
|
|
980
980
|
}
|
|
@@ -1034,7 +1034,7 @@ function W(t, e) {
|
|
|
1034
1034
|
if (s[l] !== i[l])
|
|
1035
1035
|
return s[l] < i[l] ? -1 : 1;
|
|
1036
1036
|
return o === a ? 0 : o < a ? -1 : 1;
|
|
1037
|
-
}(
|
|
1037
|
+
}(On(t), On(e));
|
|
1038
1038
|
case "Array":
|
|
1039
1039
|
return function(s, i) {
|
|
1040
1040
|
const o = s.length, a = i.length, c = o < a ? o : a;
|
|
@@ -1059,7 +1059,7 @@ function En(t) {
|
|
|
1059
1059
|
const n = It(t);
|
|
1060
1060
|
return n === "ArrayBuffer" ? "binary" : n;
|
|
1061
1061
|
}
|
|
1062
|
-
function
|
|
1062
|
+
function On(t) {
|
|
1063
1063
|
return t instanceof Uint8Array ? t : ArrayBuffer.isView(t) ? new Uint8Array(t.buffer, t.byteOffset, t.byteLength) : new Uint8Array(t);
|
|
1064
1064
|
}
|
|
1065
1065
|
class Mr {
|
|
@@ -1092,7 +1092,7 @@ class Mr {
|
|
|
1092
1092
|
count(e) {
|
|
1093
1093
|
return this._read((n) => {
|
|
1094
1094
|
const r = this._ctx, s = r.table.core;
|
|
1095
|
-
if (
|
|
1095
|
+
if (ke(r, !0))
|
|
1096
1096
|
return s.count({ trans: n, query: { index: lt(r, s.schema), range: r.range } }).then((o) => Math.min(o, r.limit));
|
|
1097
1097
|
var i = 0;
|
|
1098
1098
|
return tt(r, () => (++i, !1), n, s).then(() => i);
|
|
@@ -1115,7 +1115,7 @@ class Mr {
|
|
|
1115
1115
|
toArray(e) {
|
|
1116
1116
|
return this._read((n) => {
|
|
1117
1117
|
var r = this._ctx;
|
|
1118
|
-
if (r.dir === "next" &&
|
|
1118
|
+
if (r.dir === "next" && ke(r, !0) && r.limit > 0) {
|
|
1119
1119
|
const { valueMapper: s } = r, i = lt(r, r.table.core.schema);
|
|
1120
1120
|
return r.table.core.query({ trans: n, limit: r.limit, values: !0, query: { index: i, range: r.range } }).then(({ result: o }) => s ? o.map(s) : o);
|
|
1121
1121
|
}
|
|
@@ -1127,18 +1127,18 @@ class Mr {
|
|
|
1127
1127
|
}
|
|
1128
1128
|
offset(e) {
|
|
1129
1129
|
var n = this._ctx;
|
|
1130
|
-
return e <= 0 || (n.offset += e,
|
|
1130
|
+
return e <= 0 || (n.offset += e, ke(n) ? Ot(n, () => {
|
|
1131
1131
|
var r = e;
|
|
1132
1132
|
return (s, i) => r === 0 || (r === 1 ? (--r, !1) : (i(() => {
|
|
1133
1133
|
s.advance(r), r = 0;
|
|
1134
1134
|
}), !1));
|
|
1135
|
-
}) :
|
|
1135
|
+
}) : Ot(n, () => {
|
|
1136
1136
|
var r = e;
|
|
1137
1137
|
return () => --r < 0;
|
|
1138
1138
|
})), this;
|
|
1139
1139
|
}
|
|
1140
1140
|
limit(e) {
|
|
1141
|
-
return this._ctx.limit = Math.min(this._ctx.limit, e),
|
|
1141
|
+
return this._ctx.limit = Math.min(this._ctx.limit, e), Ot(this._ctx, () => {
|
|
1142
1142
|
var n = e;
|
|
1143
1143
|
return function(r, s, i) {
|
|
1144
1144
|
return --n <= 0 && s(i), n >= 0;
|
|
@@ -1203,7 +1203,7 @@ class Mr {
|
|
|
1203
1203
|
}
|
|
1204
1204
|
primaryKeys(e) {
|
|
1205
1205
|
var n = this._ctx;
|
|
1206
|
-
if (n.dir === "next" &&
|
|
1206
|
+
if (n.dir === "next" && ke(n, !0) && n.limit > 0)
|
|
1207
1207
|
return this._read((s) => {
|
|
1208
1208
|
var i = lt(n, n.table.core.schema);
|
|
1209
1209
|
return n.table.core.query({ trans: s, values: !1, limit: n.limit, query: { index: i, range: n.range } });
|
|
@@ -1265,17 +1265,17 @@ class Mr {
|
|
|
1265
1265
|
const b = (m) => {
|
|
1266
1266
|
const f = Math.min(u, y.length - m);
|
|
1267
1267
|
return a.getMany({ trans: r, keys: y.slice(m, m + f), cache: "immutable" }).then((w) => {
|
|
1268
|
-
const S = [],
|
|
1268
|
+
const S = [], O = [], x = c ? [] : null, v = [];
|
|
1269
1269
|
for (let _ = 0; _ < f; ++_) {
|
|
1270
1270
|
const T = w[_], K = { value: He(T), primKey: y[m + _] };
|
|
1271
|
-
s.call(K, K.value, K) !== !1 && (K.value == null ? v.push(y[m + _]) : c || W(l(T), l(K.value)) === 0 ? (
|
|
1271
|
+
s.call(K, K.value, K) !== !1 && (K.value == null ? v.push(y[m + _]) : c || W(l(T), l(K.value)) === 0 ? (O.push(K.value), c && x.push(y[m + _])) : (v.push(y[m + _]), S.push(K.value)));
|
|
1272
1272
|
}
|
|
1273
|
-
const j =
|
|
1273
|
+
const j = ke(n) && n.limit === 1 / 0 && (typeof e != "function" || e === Pt) && { index: n.index, range: n.range };
|
|
1274
1274
|
return Promise.resolve(S.length > 0 && a.mutate({ trans: r, type: "add", values: S }).then((_) => {
|
|
1275
1275
|
for (let T in _.failures)
|
|
1276
1276
|
v.splice(parseInt(T), 1);
|
|
1277
1277
|
g(S.length, _);
|
|
1278
|
-
})).then(() => (
|
|
1278
|
+
})).then(() => (O.length > 0 || j && typeof e == "object") && a.mutate({ trans: r, type: "put", keys: x, values: O, criteria: j, changeSpec: typeof e != "function" && e }).then((_) => g(O.length, _))).then(() => (v.length > 0 || j && e === Pt) && a.mutate({ trans: r, type: "delete", keys: v, criteria: j }).then((_) => g(v.length, _))).then(() => y.length > m + f && b(m + u));
|
|
1279
1279
|
});
|
|
1280
1280
|
};
|
|
1281
1281
|
return b(0).then(() => {
|
|
@@ -1288,17 +1288,17 @@ class Mr {
|
|
|
1288
1288
|
}
|
|
1289
1289
|
delete() {
|
|
1290
1290
|
var e = this._ctx, n = e.range;
|
|
1291
|
-
return
|
|
1291
|
+
return ke(e) && (e.isPrimKey && !Br || n.type === 3) ? this._write((r) => {
|
|
1292
1292
|
const { primaryKey: s } = e.table.core.schema, i = n;
|
|
1293
1293
|
return e.table.core.count({ trans: r, query: { index: s, range: i } }).then((o) => e.table.core.mutate({ trans: r, type: "deleteRange", range: i }).then(({ failures: a, lastResult: c, results: l, numFailures: u }) => {
|
|
1294
1294
|
if (u)
|
|
1295
1295
|
throw new dt("Could not delete some values", Object.keys(a).map((d) => a[d]), o - u);
|
|
1296
1296
|
return o - u;
|
|
1297
1297
|
}));
|
|
1298
|
-
}) : this.modify(
|
|
1298
|
+
}) : this.modify(Pt);
|
|
1299
1299
|
}
|
|
1300
1300
|
}
|
|
1301
|
-
const
|
|
1301
|
+
const Pt = (t, e) => e.value = null;
|
|
1302
1302
|
function Rr(t, e) {
|
|
1303
1303
|
return t < e ? -1 : t === e ? 0 : 1;
|
|
1304
1304
|
}
|
|
@@ -1309,7 +1309,7 @@ function G(t, e, n) {
|
|
|
1309
1309
|
var r = t instanceof er ? new t.Collection(t) : t;
|
|
1310
1310
|
return r._ctx.error = n ? new n(e) : new TypeError(e), r;
|
|
1311
1311
|
}
|
|
1312
|
-
function
|
|
1312
|
+
function xe(t) {
|
|
1313
1313
|
return new t.Collection(t, () => qn("")).limit(0);
|
|
1314
1314
|
}
|
|
1315
1315
|
function Nr(t, e, n, r, s, i) {
|
|
@@ -1355,9 +1355,9 @@ function nt(t, e, n, r) {
|
|
|
1355
1355
|
var w = i(f);
|
|
1356
1356
|
if (e(w, c, g))
|
|
1357
1357
|
return !0;
|
|
1358
|
-
for (var S = null,
|
|
1359
|
-
var x = Nr(f, w, a[
|
|
1360
|
-
x === null && S === null ? g =
|
|
1358
|
+
for (var S = null, O = g; O < d; ++O) {
|
|
1359
|
+
var x = Nr(f, w, a[O], c[O], o, l);
|
|
1360
|
+
x === null && S === null ? g = O + 1 : (S === null || o(S, x) > 0) && (S = x);
|
|
1361
1361
|
}
|
|
1362
1362
|
return b(S !== null ? function() {
|
|
1363
1363
|
y.continue(S + u);
|
|
@@ -1377,7 +1377,7 @@ class er {
|
|
|
1377
1377
|
between(e, n, r, s) {
|
|
1378
1378
|
r = r !== !1, s = s === !0;
|
|
1379
1379
|
try {
|
|
1380
|
-
return this._cmp(e, n) > 0 || this._cmp(e, n) === 0 && (r || s) && (!r || !s) ?
|
|
1380
|
+
return this._cmp(e, n) > 0 || this._cmp(e, n) === 0 && (r || s) && (!r || !s) ? xe(this) : new this.Collection(this, () => se(e, n, !r, !s));
|
|
1381
1381
|
} catch {
|
|
1382
1382
|
return G(this, X);
|
|
1383
1383
|
}
|
|
@@ -1407,15 +1407,15 @@ class er {
|
|
|
1407
1407
|
return nt(this, (n, r) => n === r[0], [e], "");
|
|
1408
1408
|
}
|
|
1409
1409
|
anyOfIgnoreCase() {
|
|
1410
|
-
var e = q.apply(
|
|
1411
|
-
return e.length === 0 ?
|
|
1410
|
+
var e = q.apply(Se, arguments);
|
|
1411
|
+
return e.length === 0 ? xe(this) : nt(this, (n, r) => r.indexOf(n) !== -1, e, "");
|
|
1412
1412
|
}
|
|
1413
1413
|
startsWithAnyOfIgnoreCase() {
|
|
1414
|
-
var e = q.apply(
|
|
1415
|
-
return e.length === 0 ?
|
|
1414
|
+
var e = q.apply(Se, arguments);
|
|
1415
|
+
return e.length === 0 ? xe(this) : nt(this, (n, r) => r.some((s) => n.indexOf(s) === 0), e, de);
|
|
1416
1416
|
}
|
|
1417
1417
|
anyOf() {
|
|
1418
|
-
const e = q.apply(
|
|
1418
|
+
const e = q.apply(Se, arguments);
|
|
1419
1419
|
let n = this._cmp;
|
|
1420
1420
|
try {
|
|
1421
1421
|
e.sort(n);
|
|
@@ -1423,7 +1423,7 @@ class er {
|
|
|
1423
1423
|
return G(this, X);
|
|
1424
1424
|
}
|
|
1425
1425
|
if (e.length === 0)
|
|
1426
|
-
return
|
|
1426
|
+
return xe(this);
|
|
1427
1427
|
const r = new this.Collection(this, () => se(e[0], e[e.length - 1]));
|
|
1428
1428
|
r._ondirectionchange = (i) => {
|
|
1429
1429
|
n = i === "next" ? this._ascending : this._descending, e.sort(n);
|
|
@@ -1443,7 +1443,7 @@ class er {
|
|
|
1443
1443
|
return this.inAnyRange([[Vt, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
|
|
1444
1444
|
}
|
|
1445
1445
|
noneOf() {
|
|
1446
|
-
const e = q.apply(
|
|
1446
|
+
const e = q.apply(Se, arguments);
|
|
1447
1447
|
if (e.length === 0)
|
|
1448
1448
|
return new this.Collection(this);
|
|
1449
1449
|
try {
|
|
@@ -1457,7 +1457,7 @@ class er {
|
|
|
1457
1457
|
inAnyRange(e, n) {
|
|
1458
1458
|
const r = this._cmp, s = this._ascending, i = this._descending, o = this._min, a = this._max;
|
|
1459
1459
|
if (e.length === 0)
|
|
1460
|
-
return
|
|
1460
|
+
return xe(this);
|
|
1461
1461
|
if (!e.every((f) => f[0] !== void 0 && f[1] !== void 0 && s(f[0], f[1]) <= 0))
|
|
1462
1462
|
return G(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", C.InvalidArgument);
|
|
1463
1463
|
const c = !n || n.includeLowers !== !1, l = n && n.includeUppers === !0;
|
|
@@ -1467,15 +1467,15 @@ class er {
|
|
|
1467
1467
|
}
|
|
1468
1468
|
try {
|
|
1469
1469
|
u = e.reduce(function(f, w) {
|
|
1470
|
-
let S = 0,
|
|
1471
|
-
for (; S <
|
|
1470
|
+
let S = 0, O = f.length;
|
|
1471
|
+
for (; S < O; ++S) {
|
|
1472
1472
|
const x = f[S];
|
|
1473
1473
|
if (r(w[0], x[1]) < 0 && r(w[1], x[0]) > 0) {
|
|
1474
1474
|
x[0] = o(x[0], w[0]), x[1] = a(x[1], w[1]);
|
|
1475
1475
|
break;
|
|
1476
1476
|
}
|
|
1477
1477
|
}
|
|
1478
|
-
return S ===
|
|
1478
|
+
return S === O && f.push(w), f;
|
|
1479
1479
|
}, []), u.sort(h);
|
|
1480
1480
|
} catch {
|
|
1481
1481
|
return G(this, X);
|
|
@@ -1487,19 +1487,19 @@ class er {
|
|
|
1487
1487
|
return m._ondirectionchange = (f) => {
|
|
1488
1488
|
f === "next" ? (b = g, d = s) : (b = y, d = i), u.sort(h);
|
|
1489
1489
|
}, m._addAlgorithm((f, w, S) => {
|
|
1490
|
-
for (var
|
|
1490
|
+
for (var O = f.key; b(O); )
|
|
1491
1491
|
if (++p, p === u.length)
|
|
1492
1492
|
return w(S), !1;
|
|
1493
1493
|
return !!function(x) {
|
|
1494
1494
|
return !g(x) && !y(x);
|
|
1495
|
-
}(
|
|
1495
|
+
}(O) || (this._cmp(O, u[p][1]) === 0 || this._cmp(O, u[p][0]) === 0 || w(() => {
|
|
1496
1496
|
d === s ? f.continue(u[p][0]) : f.continue(u[p][1]);
|
|
1497
1497
|
}), !1);
|
|
1498
1498
|
}), m;
|
|
1499
1499
|
}
|
|
1500
1500
|
startsWithAnyOf() {
|
|
1501
|
-
const e = q.apply(
|
|
1502
|
-
return e.every((n) => typeof n == "string") ? e.length === 0 ?
|
|
1501
|
+
const e = q.apply(Se, arguments);
|
|
1502
|
+
return e.every((n) => typeof n == "string") ? e.length === 0 ? xe(this) : this.inAnyRange(e.map((n) => [n, n + de])) : G(this, "startsWithAnyOf() only works with strings");
|
|
1503
1503
|
}
|
|
1504
1504
|
}
|
|
1505
1505
|
function Q(t) {
|
|
@@ -1513,11 +1513,11 @@ function We(t) {
|
|
|
1513
1513
|
const ze = "storagemutated", oe = "x-storagemutated-1", le = Fe(null, ze);
|
|
1514
1514
|
class $r {
|
|
1515
1515
|
_lock() {
|
|
1516
|
-
return Ie(!
|
|
1516
|
+
return Ie(!P.global), ++this._reculock, this._reculock !== 1 || P.global || (P.lockOwnerFor = this), this;
|
|
1517
1517
|
}
|
|
1518
1518
|
_unlock() {
|
|
1519
|
-
if (Ie(!
|
|
1520
|
-
for (
|
|
1519
|
+
if (Ie(!P.global), --this._reculock == 0)
|
|
1520
|
+
for (P.global || (P.lockOwnerFor = null); this._blockedFuncs.length > 0 && !this._locked(); ) {
|
|
1521
1521
|
var e = this._blockedFuncs.shift();
|
|
1522
1522
|
try {
|
|
1523
1523
|
Ke(e[1], e[0]);
|
|
@@ -1527,7 +1527,7 @@ class $r {
|
|
|
1527
1527
|
return this;
|
|
1528
1528
|
}
|
|
1529
1529
|
_locked() {
|
|
1530
|
-
return this._reculock &&
|
|
1530
|
+
return this._reculock && P.lockOwnerFor !== this;
|
|
1531
1531
|
}
|
|
1532
1532
|
create(e) {
|
|
1533
1533
|
if (!this.mode)
|
|
@@ -1561,7 +1561,7 @@ class $r {
|
|
|
1561
1561
|
return new E((i, o) => {
|
|
1562
1562
|
this._blockedFuncs.push([() => {
|
|
1563
1563
|
this._promise(e, n, r).then(i, o);
|
|
1564
|
-
},
|
|
1564
|
+
}, P]);
|
|
1565
1565
|
});
|
|
1566
1566
|
if (r)
|
|
1567
1567
|
return ae(() => {
|
|
@@ -1638,7 +1638,7 @@ function Ht(t) {
|
|
|
1638
1638
|
return e.split(".").length === 1 ? (r) => r[e] : (r) => ne(r, e);
|
|
1639
1639
|
}(t) : (e) => ne(e, t);
|
|
1640
1640
|
}
|
|
1641
|
-
function
|
|
1641
|
+
function Pn(t) {
|
|
1642
1642
|
return [].slice.call(t);
|
|
1643
1643
|
}
|
|
1644
1644
|
let Lr = 0;
|
|
@@ -1655,10 +1655,10 @@ function Ur(t, e, n) {
|
|
|
1655
1655
|
return l === void 0 ? u === void 0 ? null : e.upperBound(u, !!h) : u === void 0 ? e.lowerBound(l, !!d) : e.bound(l, u, !!d, !!h);
|
|
1656
1656
|
}
|
|
1657
1657
|
const { schema: s, hasGetAll: i } = function(c, l) {
|
|
1658
|
-
const u =
|
|
1658
|
+
const u = Pn(c.objectStoreNames);
|
|
1659
1659
|
return { schema: { name: c.name, tables: u.map((d) => l.objectStore(d)).map((d) => {
|
|
1660
|
-
const { keyPath: h, autoIncrement: p } = d, g = L(h), y = h == null, b = {}, m = { name: d.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: y, compound: g, keyPath: h, autoIncrement: p, unique: !0, extractKey: Ht(h) }, indexes:
|
|
1661
|
-
const { name: w, unique: S, multiEntry:
|
|
1660
|
+
const { keyPath: h, autoIncrement: p } = d, g = L(h), y = h == null, b = {}, m = { name: d.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: y, compound: g, keyPath: h, autoIncrement: p, unique: !0, extractKey: Ht(h) }, indexes: Pn(d.indexNames).map((f) => d.index(f)).map((f) => {
|
|
1661
|
+
const { name: w, unique: S, multiEntry: O, keyPath: x } = f, v = { name: w, compound: L(x), keyPath: x, unique: S, multiEntry: O, extractKey: Ht(x) };
|
|
1662
1662
|
return b[Ne(x)] = v, v;
|
|
1663
1663
|
}), getIndexByKeyPath: (f) => b[Ne(f)] };
|
|
1664
1664
|
return b[":id"] = m.primaryKey, h != null && (b[Ne(h)] = m.primaryKey), m;
|
|
@@ -1671,10 +1671,10 @@ function Ur(t, e, n) {
|
|
|
1671
1671
|
const f = d.objectStore(u), w = f.keyPath == null, S = h === "put" || h === "add";
|
|
1672
1672
|
if (!S && h !== "delete" && h !== "deleteRange")
|
|
1673
1673
|
throw new Error("Invalid operation type: " + h);
|
|
1674
|
-
const { length:
|
|
1674
|
+
const { length: O } = p || g || { length: 1 };
|
|
1675
1675
|
if (p && g && p.length !== g.length)
|
|
1676
1676
|
throw new Error("Given keys array must have same length as given values array.");
|
|
1677
|
-
if (
|
|
1677
|
+
if (O === 0)
|
|
1678
1678
|
return b({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
1679
1679
|
let x;
|
|
1680
1680
|
const v = [], j = [];
|
|
@@ -1689,15 +1689,15 @@ function Ur(t, e, n) {
|
|
|
1689
1689
|
} else {
|
|
1690
1690
|
const [U, N] = S ? w ? [g, p] : [g, null] : [p, null];
|
|
1691
1691
|
if (S)
|
|
1692
|
-
for (let M = 0; M <
|
|
1692
|
+
for (let M = 0; M < O; ++M)
|
|
1693
1693
|
v.push(x = N && N[M] !== void 0 ? f[h](U[M], N[M]) : f[h](U[M])), x.onerror = T;
|
|
1694
1694
|
else
|
|
1695
|
-
for (let M = 0; M <
|
|
1695
|
+
for (let M = 0; M < O; ++M)
|
|
1696
1696
|
v.push(x = f[h](U[M])), x.onerror = T;
|
|
1697
1697
|
}
|
|
1698
1698
|
const K = (U) => {
|
|
1699
1699
|
const N = U.target.result;
|
|
1700
|
-
v.forEach((M,
|
|
1700
|
+
v.forEach((M, we) => M.error != null && (j[we] = M.error)), b({ numFailures: _, failures: j, results: h === "delete" ? p : v.map((M) => M.result), lastResult: N });
|
|
1701
1701
|
};
|
|
1702
1702
|
x.onerror = (U) => {
|
|
1703
1703
|
T(U), K(U);
|
|
@@ -1707,12 +1707,12 @@ function Ur(t, e, n) {
|
|
|
1707
1707
|
p = I(p);
|
|
1708
1708
|
const y = d.objectStore(u), b = h.length, m = new Array(b);
|
|
1709
1709
|
let f, w = 0, S = 0;
|
|
1710
|
-
const
|
|
1710
|
+
const O = (v) => {
|
|
1711
1711
|
const j = v.target;
|
|
1712
1712
|
m[j._pos] = j.result, ++S === w && p(m);
|
|
1713
1713
|
}, x = Q(g);
|
|
1714
1714
|
for (let v = 0; v < b; ++v)
|
|
1715
|
-
h[v] != null && (f = y.get(h[v]), f._pos = v, f.onsuccess =
|
|
1715
|
+
h[v] != null && (f = y.get(h[v]), f._pos = v, f.onsuccess = O, f.onerror = x, ++w);
|
|
1716
1716
|
w === 0 && p(m);
|
|
1717
1717
|
}), get: ({ trans: d, key: h }) => new Promise((p, g) => {
|
|
1718
1718
|
p = I(p);
|
|
@@ -1721,7 +1721,7 @@ function Ur(t, e, n) {
|
|
|
1721
1721
|
}), query: /* @__PURE__ */ function(d) {
|
|
1722
1722
|
return (h) => new Promise((p, g) => {
|
|
1723
1723
|
p = I(p);
|
|
1724
|
-
const { trans: y, values: b, limit: m, query: f } = h, w = m === 1 / 0 ? void 0 : m, { index: S, range:
|
|
1724
|
+
const { trans: y, values: b, limit: m, query: f } = h, w = m === 1 / 0 ? void 0 : m, { index: S, range: O } = f, x = y.objectStore(u), v = S.isPrimaryKey ? x : x.index(S.name), j = r(O);
|
|
1725
1725
|
if (m === 0)
|
|
1726
1726
|
return p({ result: [] });
|
|
1727
1727
|
if (d) {
|
|
@@ -1739,7 +1739,7 @@ function Ur(t, e, n) {
|
|
|
1739
1739
|
}(i), openCursor: function({ trans: d, values: h, query: p, reverse: g, unique: y }) {
|
|
1740
1740
|
return new Promise((b, m) => {
|
|
1741
1741
|
b = I(b);
|
|
1742
|
-
const { index: f, range: w } = p, S = d.objectStore(u),
|
|
1742
|
+
const { index: f, range: w } = p, S = d.objectStore(u), O = f.isPrimaryKey ? S : S.index(f.name), x = g ? y ? "prevunique" : "prev" : y ? "nextunique" : "next", v = h || !("openKeyCursor" in O) ? O.openCursor(r(w), x) : O.openKeyCursor(r(w), x);
|
|
1743
1743
|
v.onerror = Q(m), v.onsuccess = I((j) => {
|
|
1744
1744
|
const _ = v.result;
|
|
1745
1745
|
if (!_)
|
|
@@ -1757,11 +1757,11 @@ function Ur(t, e, n) {
|
|
|
1757
1757
|
let M = 1;
|
|
1758
1758
|
return this.start(() => M-- ? this.continue() : this.stop()).then(() => this);
|
|
1759
1759
|
}, _.start = (M) => {
|
|
1760
|
-
const
|
|
1760
|
+
const we = new Promise((V, ue) => {
|
|
1761
1761
|
V = I(V), v.onerror = Q(ue), _.fail = ue, _.stop = (Ae) => {
|
|
1762
1762
|
_.stop = _.continue = _.continuePrimaryKey = _.advance = N, V(Ae);
|
|
1763
1763
|
};
|
|
1764
|
-
}),
|
|
1764
|
+
}), _e = () => {
|
|
1765
1765
|
if (v.result)
|
|
1766
1766
|
try {
|
|
1767
1767
|
M();
|
|
@@ -1774,8 +1774,8 @@ function Ur(t, e, n) {
|
|
|
1774
1774
|
}, _.stop();
|
|
1775
1775
|
};
|
|
1776
1776
|
return v.onsuccess = I((V) => {
|
|
1777
|
-
v.onsuccess =
|
|
1778
|
-
}), _.continue = T, _.continuePrimaryKey = K, _.advance = U,
|
|
1777
|
+
v.onsuccess = _e, _e();
|
|
1778
|
+
}), _.continue = T, _.continuePrimaryKey = K, _.advance = U, _e(), we;
|
|
1779
1779
|
}, b(_);
|
|
1780
1780
|
}, m);
|
|
1781
1781
|
});
|
|
@@ -1783,7 +1783,7 @@ function Ur(t, e, n) {
|
|
|
1783
1783
|
const { index: p, range: g } = d;
|
|
1784
1784
|
return new Promise((y, b) => {
|
|
1785
1785
|
const m = h.objectStore(u), f = p.isPrimaryKey ? m : m.index(p.name), w = r(g), S = w ? f.count(w) : f.count();
|
|
1786
|
-
S.onsuccess = I((
|
|
1786
|
+
S.onsuccess = I((O) => y(O.target.result)), S.onerror = Q(b);
|
|
1787
1787
|
});
|
|
1788
1788
|
} };
|
|
1789
1789
|
}(c)), a = {};
|
|
@@ -1829,9 +1829,9 @@ function Wr(t, e) {
|
|
|
1829
1829
|
function zr(t, e, n, r) {
|
|
1830
1830
|
const s = t._dbSchema, i = t._createTransaction("readwrite", t._storeNames, s);
|
|
1831
1831
|
i.create(n), i._completion.catch(r);
|
|
1832
|
-
const o = i._reject.bind(i), a =
|
|
1832
|
+
const o = i._reject.bind(i), a = P.transless || P;
|
|
1833
1833
|
ae(() => {
|
|
1834
|
-
|
|
1834
|
+
P.trans = i, P.transless = a, e === 0 ? (R(s).forEach((c) => {
|
|
1835
1835
|
Ct(n, c, s[c].primKey, s[c].indexes);
|
|
1836
1836
|
}), Yt(t, n), E.follow(() => t.on.populate.fire(i)).catch(o)) : function({ _novip: c }, l, u, d) {
|
|
1837
1837
|
const h = [], p = c._versions;
|
|
@@ -1844,10 +1844,10 @@ function zr(t, e, n, r) {
|
|
|
1844
1844
|
h.push(() => {
|
|
1845
1845
|
const w = g, S = f._cfg.dbschema;
|
|
1846
1846
|
Zt(c, w, d), Zt(c, S, d), g = c._dbSchema = S;
|
|
1847
|
-
const
|
|
1848
|
-
|
|
1847
|
+
const O = rr(w, S);
|
|
1848
|
+
O.add.forEach((v) => {
|
|
1849
1849
|
Ct(d, v[0], v[1].primKey, v[1].indexes);
|
|
1850
|
-
}),
|
|
1850
|
+
}), O.change.forEach((v) => {
|
|
1851
1851
|
if (v.recreate)
|
|
1852
1852
|
throw new C.Upgrade("Not yet support for changing primary key");
|
|
1853
1853
|
{
|
|
@@ -1861,7 +1861,7 @@ function zr(t, e, n, r) {
|
|
|
1861
1861
|
if (x && f._cfg.version > l) {
|
|
1862
1862
|
Yt(c, d), u._memoizedTables = {}, y = !0;
|
|
1863
1863
|
let v = Bn(S);
|
|
1864
|
-
|
|
1864
|
+
O.del.forEach((K) => {
|
|
1865
1865
|
v[K] = w[K];
|
|
1866
1866
|
}), Qt(c, [c.Transaction.prototype]), gt(c, [c.Transaction.prototype], R(v), v), u.schema = v;
|
|
1867
1867
|
const j = on(x);
|
|
@@ -1876,8 +1876,8 @@ function zr(t, e, n, r) {
|
|
|
1876
1876
|
return _ && typeof _.then == "function" ? E.resolve(_) : T.then(() => _);
|
|
1877
1877
|
}
|
|
1878
1878
|
}), h.push((w) => {
|
|
1879
|
-
(!y || !Ir) && function(S,
|
|
1880
|
-
[].slice.call(
|
|
1879
|
+
(!y || !Ir) && function(S, O) {
|
|
1880
|
+
[].slice.call(O.db.objectStoreNames).forEach((x) => S[x] == null && O.db.deleteObjectStore(x));
|
|
1881
1881
|
}(f._cfg.dbschema, w), Qt(c, [c.Transaction.prototype]), gt(c, [c.Transaction.prototype], c._storeNames, c._dbSchema), u.schema = c._dbSchema;
|
|
1882
1882
|
});
|
|
1883
1883
|
}), m().then(() => {
|
|
@@ -1994,7 +1994,7 @@ function pn(t) {
|
|
|
1994
1994
|
}
|
|
1995
1995
|
function qt(t) {
|
|
1996
1996
|
return ae(function() {
|
|
1997
|
-
return
|
|
1997
|
+
return P.letThrough = !0, t();
|
|
1998
1998
|
});
|
|
1999
1999
|
}
|
|
2000
2000
|
function Gr() {
|
|
@@ -2012,7 +2012,7 @@ function Hr(t) {
|
|
|
2012
2012
|
const e = t._state, { indexedDB: n } = t._deps;
|
|
2013
2013
|
if (e.isBeingOpened || t.idbdb)
|
|
2014
2014
|
return e.dbReadyPromise.then(() => e.dbOpenError ? F(e.dbOpenError) : t);
|
|
2015
|
-
J && (e.openCanceller._stackHolder =
|
|
2015
|
+
J && (e.openCanceller._stackHolder = ve()), e.isBeingOpened = !0, e.dbOpenError = null, e.openComplete = !1;
|
|
2016
2016
|
const r = e.openCanceller;
|
|
2017
2017
|
function s() {
|
|
2018
2018
|
if (e.openCanceller !== r)
|
|
@@ -2101,7 +2101,7 @@ function Yr(t, e, n) {
|
|
|
2101
2101
|
}
|
|
2102
2102
|
function sr(t, e, n, r, s) {
|
|
2103
2103
|
return E.resolve().then(() => {
|
|
2104
|
-
const i =
|
|
2104
|
+
const i = P.transless || P, o = t._createTransaction(e, n, t._dbSchema, r), a = { trans: o, transless: i };
|
|
2105
2105
|
if (r)
|
|
2106
2106
|
o.idbtrans = r.idbtrans;
|
|
2107
2107
|
else
|
|
@@ -2182,7 +2182,7 @@ function mn(t, e, n, r) {
|
|
|
2182
2182
|
const Jr = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: (t) => ({ ...t, table(e) {
|
|
2183
2183
|
const n = t.table(e), { primaryKey: r } = n.schema;
|
|
2184
2184
|
return { ...n, mutate(i) {
|
|
2185
|
-
const o =
|
|
2185
|
+
const o = P.trans, { deleting: a, creating: c, updating: l } = o.table(e).hook;
|
|
2186
2186
|
switch (i.type) {
|
|
2187
2187
|
case "add":
|
|
2188
2188
|
if (c.fire === A)
|
|
@@ -2205,7 +2205,7 @@ const Jr = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: (t) =>
|
|
|
2205
2205
|
}
|
|
2206
2206
|
return n.mutate(i);
|
|
2207
2207
|
function u(h) {
|
|
2208
|
-
const p =
|
|
2208
|
+
const p = P.trans, g = h.keys || function(y, b) {
|
|
2209
2209
|
return b.type === "delete" ? b.keys : b.keys || b.values.map(y.extractKey);
|
|
2210
2210
|
}(r, h);
|
|
2211
2211
|
if (!g)
|
|
@@ -2218,10 +2218,10 @@ const Jr = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: (t) =>
|
|
|
2218
2218
|
if (h.type === "delete")
|
|
2219
2219
|
a.fire.call(S, m, w, p);
|
|
2220
2220
|
else if (h.type === "add" || w === void 0) {
|
|
2221
|
-
const
|
|
2222
|
-
m == null &&
|
|
2221
|
+
const O = c.fire.call(S, m, h.values[f], p);
|
|
2222
|
+
m == null && O != null && (m = O, h.keys[f] = m, r.outbound || Y(h.values[f], r.keyPath, m));
|
|
2223
2223
|
} else {
|
|
2224
|
-
const
|
|
2224
|
+
const O = mn(w, h.values[f]), x = l.fire.call(S, O, m, w, p);
|
|
2225
2225
|
if (x) {
|
|
2226
2226
|
const v = h.values[f];
|
|
2227
2227
|
Object.keys(x).forEach((j) => {
|
|
@@ -2232,9 +2232,9 @@ const Jr = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: (t) =>
|
|
|
2232
2232
|
return S;
|
|
2233
2233
|
});
|
|
2234
2234
|
return n.mutate(h).then(({ failures: m, results: f, numFailures: w, lastResult: S }) => {
|
|
2235
|
-
for (let
|
|
2236
|
-
const x = f ? f[
|
|
2237
|
-
x == null ? v.onerror && v.onerror(m[
|
|
2235
|
+
for (let O = 0; O < g.length; ++O) {
|
|
2236
|
+
const x = f ? f[O] : g[O], v = b[O];
|
|
2237
|
+
x == null ? v.onerror && v.onerror(m[O]) : v.onsuccess && v.onsuccess(h.type === "put" && y[O] ? h.values[O] : x);
|
|
2238
2238
|
}
|
|
2239
2239
|
return { failures: m, results: f, numFailures: w, lastResult: S };
|
|
2240
2240
|
}).catch((m) => (b.forEach((f) => f.onerror && f.onerror(m)), Promise.reject(m)));
|
|
@@ -2352,7 +2352,7 @@ function Cn(t) {
|
|
|
2352
2352
|
function jn({ r: t, l: e }) {
|
|
2353
2353
|
return (t ? e ? Math.max(t.d, e.d) : t.d : e ? e.d : 0) + 1;
|
|
2354
2354
|
}
|
|
2355
|
-
|
|
2355
|
+
Ce(Z.prototype, { add(t) {
|
|
2356
2356
|
return bt(this, t), this;
|
|
2357
2357
|
}, addKey(t) {
|
|
2358
2358
|
return Ge(this, t, t), this;
|
|
@@ -2370,21 +2370,21 @@ const qr = { stack: "dbcore", level: 0, create: (t) => {
|
|
|
2370
2370
|
return g[v] || (g[v] = new Z());
|
|
2371
2371
|
}, b = y(""), m = y(":dels"), { type: f } = h;
|
|
2372
2372
|
let [w, S] = h.type === "deleteRange" ? [h.range] : h.type === "delete" ? [h.keys] : h.values.length < 50 ? [[], h.values] : [];
|
|
2373
|
-
const
|
|
2373
|
+
const O = h.trans._cache;
|
|
2374
2374
|
return s.mutate(h).then((x) => {
|
|
2375
2375
|
if (L(w)) {
|
|
2376
2376
|
f !== "delete" && (w = x.results), b.addKeys(w);
|
|
2377
|
-
const v = ir(w,
|
|
2377
|
+
const v = ir(w, O);
|
|
2378
2378
|
v || f === "add" || m.addKeys(w), (v || S) && function(j, _, T, K) {
|
|
2379
2379
|
function U(N) {
|
|
2380
2380
|
const M = j(N.name || "");
|
|
2381
|
-
function
|
|
2381
|
+
function we(V) {
|
|
2382
2382
|
return V != null ? N.extractKey(V) : null;
|
|
2383
2383
|
}
|
|
2384
|
-
const
|
|
2384
|
+
const _e = (V) => N.multiEntry && L(V) ? V.forEach((ue) => M.addKey(ue)) : M.addKey(V);
|
|
2385
2385
|
(T || K).forEach((V, ue) => {
|
|
2386
|
-
const Ae = T &&
|
|
2387
|
-
W(Ae, _t) !== 0 && (Ae != null &&
|
|
2386
|
+
const Ae = T && we(T[ue]), _t = K && we(K[ue]);
|
|
2387
|
+
W(Ae, _t) !== 0 && (Ae != null && _e(Ae), _t != null && _e(_t));
|
|
2388
2388
|
});
|
|
2389
2389
|
}
|
|
2390
2390
|
_.indexes.forEach(U);
|
|
@@ -2402,29 +2402,29 @@ const qr = { stack: "dbcore", level: 0, create: (t) => {
|
|
|
2402
2402
|
}, d = { get: (h) => [o, new Z(h.key)], getMany: (h) => [o, new Z().addKeys(h.keys)], count: u, query: u, openCursor: u };
|
|
2403
2403
|
return R(d).forEach((h) => {
|
|
2404
2404
|
l[h] = function(p) {
|
|
2405
|
-
const { subscr: g } =
|
|
2405
|
+
const { subscr: g } = P;
|
|
2406
2406
|
if (g) {
|
|
2407
2407
|
const y = (S) => {
|
|
2408
|
-
const
|
|
2409
|
-
return g[
|
|
2408
|
+
const O = `idb://${e}/${r}/${S}`;
|
|
2409
|
+
return g[O] || (g[O] = new Z());
|
|
2410
2410
|
}, b = y(""), m = y(":dels"), [f, w] = d[h](p);
|
|
2411
2411
|
if (y(f.name || "").add(w), !f.isPrimaryKey) {
|
|
2412
2412
|
if (h !== "count") {
|
|
2413
2413
|
const S = h === "query" && c && p.values && s.query({ ...p, values: !1 });
|
|
2414
|
-
return s[h].apply(this, arguments).then((
|
|
2414
|
+
return s[h].apply(this, arguments).then((O) => {
|
|
2415
2415
|
if (h === "query") {
|
|
2416
2416
|
if (c && p.values)
|
|
2417
|
-
return S.then(({ result: v }) => (b.addKeys(v),
|
|
2418
|
-
const x = p.values ?
|
|
2417
|
+
return S.then(({ result: v }) => (b.addKeys(v), O));
|
|
2418
|
+
const x = p.values ? O.result.map(a) : O.result;
|
|
2419
2419
|
p.values ? b.addKeys(x) : m.addKeys(x);
|
|
2420
2420
|
} else if (h === "openCursor") {
|
|
2421
|
-
const x =
|
|
2421
|
+
const x = O, v = p.values;
|
|
2422
2422
|
return x && Object.create(x, { key: { get: () => (m.addKey(x.primaryKey), x.key) }, primaryKey: { get() {
|
|
2423
2423
|
const j = x.primaryKey;
|
|
2424
2424
|
return m.addKey(j), j;
|
|
2425
2425
|
} }, value: { get: () => (v && b.addKey(x.primaryKey), x.value) } });
|
|
2426
2426
|
}
|
|
2427
|
-
return
|
|
2427
|
+
return O;
|
|
2428
2428
|
});
|
|
2429
2429
|
}
|
|
2430
2430
|
m.add(n);
|
|
@@ -2520,7 +2520,7 @@ class me {
|
|
|
2520
2520
|
return r || (r = new this.Version(e), n.push(r), n.sort(Wr), r.stores({}), this._state.autoSchema = !1, r);
|
|
2521
2521
|
}
|
|
2522
2522
|
_whenReady(e) {
|
|
2523
|
-
return this.idbdb && (this._state.openComplete ||
|
|
2523
|
+
return this.idbdb && (this._state.openComplete || P.letThrough || this._vip) ? e() : new E((n, r) => {
|
|
2524
2524
|
if (this._state.openComplete)
|
|
2525
2525
|
return r(new C.DatabaseClosed(this._state.dbOpenError));
|
|
2526
2526
|
if (!this._state.isBeingOpened) {
|
|
@@ -2603,7 +2603,7 @@ class me {
|
|
|
2603
2603
|
return this._transaction.apply(this, e);
|
|
2604
2604
|
}
|
|
2605
2605
|
_transaction(e, n, r) {
|
|
2606
|
-
let s =
|
|
2606
|
+
let s = P.trans;
|
|
2607
2607
|
s && s.db === this && e.indexOf("!") === -1 || (s = null);
|
|
2608
2608
|
const i = e.indexOf("?") !== -1;
|
|
2609
2609
|
let o, a;
|
|
@@ -2641,7 +2641,7 @@ class me {
|
|
|
2641
2641
|
}) : F(l);
|
|
2642
2642
|
}
|
|
2643
2643
|
const c = sr.bind(null, this, o, a, s, r);
|
|
2644
|
-
return s ? s._promise(o, c, "lock") :
|
|
2644
|
+
return s ? s._promise(o, c, "lock") : P.trans ? Ke(P.transless, () => this._whenReady(c)) : this._whenReady(c);
|
|
2645
2645
|
}
|
|
2646
2646
|
table(e) {
|
|
2647
2647
|
if (!H(this._allTables, e))
|
|
@@ -2689,7 +2689,7 @@ function ns(t) {
|
|
|
2689
2689
|
a = {};
|
|
2690
2690
|
const y = {}, b = function(m) {
|
|
2691
2691
|
i && je();
|
|
2692
|
-
const f = () => ae(t, { subscr: m, trans: null }), w =
|
|
2692
|
+
const f = () => ae(t, { subscr: m, trans: null }), w = P.trans ? Ke(P.transless, f) : f();
|
|
2693
2693
|
return i && w.then(re, re), w;
|
|
2694
2694
|
}(y);
|
|
2695
2695
|
d || (le(ze, p), d = !0), u = !0, Promise.resolve(b).then((m) => {
|
|
@@ -2717,7 +2717,7 @@ function ut(t) {
|
|
|
2717
2717
|
ee = e;
|
|
2718
2718
|
}
|
|
2719
2719
|
}
|
|
2720
|
-
|
|
2720
|
+
Ce(he, { ...st, delete: (t) => new he(t, { addons: [] }).delete(), exists: (t) => new he(t, { addons: [] }).open().then((e) => (e.close(), !0)).catch("NoSuchDatabaseError", () => !1), getDatabaseNames(t) {
|
|
2721
2721
|
try {
|
|
2722
2722
|
return function({ indexedDB: e, IDBKeyRange: n }) {
|
|
2723
2723
|
return pn(e) ? Promise.resolve(e.databases()).then((r) => r.map((s) => s.name).filter((s) => s !== wt)) : fn(e, n).toCollection().primaryKeys();
|
|
@@ -2727,7 +2727,7 @@ Oe(he, { ...st, delete: (t) => new he(t, { addons: [] }).delete(), exists: (t) =
|
|
|
2727
2727
|
}
|
|
2728
2728
|
}, defineClass: () => function(t) {
|
|
2729
2729
|
z(this, t);
|
|
2730
|
-
}, ignoreTransaction: (t) =>
|
|
2730
|
+
}, ignoreTransaction: (t) => P.trans ? Ke(P.transless, t) : t(), vip: qt, async: function(t) {
|
|
2731
2731
|
return function() {
|
|
2732
2732
|
try {
|
|
2733
2733
|
var e = en(t.apply(this, arguments));
|
|
@@ -2743,12 +2743,12 @@ Oe(he, { ...st, delete: (t) => new he(t, { addons: [] }).delete(), exists: (t) =
|
|
|
2743
2743
|
} catch (s) {
|
|
2744
2744
|
return F(s);
|
|
2745
2745
|
}
|
|
2746
|
-
}, currentTransaction: { get: () =>
|
|
2746
|
+
}, currentTransaction: { get: () => P.trans || null }, waitFor: function(t, e) {
|
|
2747
2747
|
const n = E.resolve(typeof t == "function" ? he.ignoreTransaction(t) : t).timeout(e || 6e4);
|
|
2748
|
-
return
|
|
2748
|
+
return P.trans ? P.trans.waitFor(n) : n;
|
|
2749
2749
|
}, Promise: E, debug: { get: () => J, set: (t) => {
|
|
2750
2750
|
Rn(t, t === "dexie" ? () => !0 : Xn);
|
|
2751
|
-
} }, derive:
|
|
2751
|
+
} }, derive: Ee, extend: z, props: Ce, override: An, Events: Fe, on: le, liveQuery: ns, extendObservabilitySet: or, getByKeyPath: ne, setByKeyPath: Y, delByKeyPath: function(t, e) {
|
|
2752
2752
|
typeof e == "string" ? Y(t, e, void 0) : "length" in e && [].map.call(e, function(n) {
|
|
2753
2753
|
Y(t, n, void 0);
|
|
2754
2754
|
});
|
|
@@ -2786,7 +2786,7 @@ if (typeof BroadcastChannel < "u") {
|
|
|
2786
2786
|
});
|
|
2787
2787
|
}
|
|
2788
2788
|
E.rejectionMapper = function(t, e) {
|
|
2789
|
-
if (!t || t instanceof
|
|
2789
|
+
if (!t || t instanceof Oe || t instanceof TypeError || t instanceof SyntaxError || !t.name || !bn[t.name])
|
|
2790
2790
|
return t;
|
|
2791
2791
|
var n = new bn[t.name](e || t.message, t);
|
|
2792
2792
|
return "stack" in t && te(n, "stack", { get: function() {
|
|
@@ -2846,7 +2846,7 @@ class rs {
|
|
|
2846
2846
|
const r = n.title;
|
|
2847
2847
|
n.messages.forEach((s) => {
|
|
2848
2848
|
var i, o, a;
|
|
2849
|
-
this.db.table(
|
|
2849
|
+
this.db.table(be).put({ id: s.id, utc: s.utc, data: s }), this.db.table(ls).put({
|
|
2850
2850
|
widget_id: e.widget,
|
|
2851
2851
|
message_id: s.id,
|
|
2852
2852
|
dashboard_id: e.dashboard,
|
|
@@ -2886,7 +2886,7 @@ class rs {
|
|
|
2886
2886
|
const s = (r = e.topics) == null ? void 0 : r.split("-");
|
|
2887
2887
|
e.dashboard = s ? s[0] : "", e.widget = s ? s[1] : "";
|
|
2888
2888
|
}
|
|
2889
|
-
this.subscribers.filter((s) => s.widget == e.widget).length > 0 || (e.type ===
|
|
2889
|
+
this.subscribers.filter((s) => s.widget == e.widget).length > 0 || (e.type === be && (e = Je(this.options, e)), console.log("[storage] subscribe", e), this.subscribers.push(e));
|
|
2890
2890
|
});
|
|
2891
2891
|
this.options = e, this.db = new me(e.app), this.db.version(2).stores({
|
|
2892
2892
|
player: "id,title,name,location",
|
|
@@ -2954,16 +2954,14 @@ class is {
|
|
|
2954
2954
|
const n = B(e);
|
|
2955
2955
|
return await Kt(n);
|
|
2956
2956
|
});
|
|
2957
|
-
k(this, "cleanMessages", async (e) =>
|
|
2958
|
-
console.log("cleanMessages not implemented for ", this.options.storage);
|
|
2959
|
-
});
|
|
2957
|
+
k(this, "cleanMessages", async (e) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((n) => n())));
|
|
2960
2958
|
k(this, "subscribe", (e) => {
|
|
2961
2959
|
var r;
|
|
2962
2960
|
if (e.widget === void 0) {
|
|
2963
2961
|
const s = (r = e.topics) == null ? void 0 : r.split("-");
|
|
2964
2962
|
e.dashboard = s ? s[0] : "", e.widget = s ? s[1] : "";
|
|
2965
2963
|
}
|
|
2966
|
-
e.type ===
|
|
2964
|
+
e.type === be && (e = Je(this.options, e)), !this.subscribers.filter((s) => s.widget == e.widget).length && this.subscribers.push(e);
|
|
2967
2965
|
});
|
|
2968
2966
|
this.options = e;
|
|
2969
2967
|
}
|
|
@@ -3026,7 +3024,7 @@ class os {
|
|
|
3026
3024
|
const s = (r = e.topics) == null ? void 0 : r.split("-");
|
|
3027
3025
|
e.dashboard = s ? s[0] : "", e.widget = s ? s[1] : "";
|
|
3028
3026
|
}
|
|
3029
|
-
e.type ===
|
|
3027
|
+
e.type === be && (e = Je(this.options, e)), !this.subscribers.filter(
|
|
3030
3028
|
(s) => s.widget == e.widget
|
|
3031
3029
|
).length && this.subscribers.push(e);
|
|
3032
3030
|
});
|
|
@@ -3096,7 +3094,7 @@ class as {
|
|
|
3096
3094
|
const s = (r = e.topics) == null ? void 0 : r.split("-");
|
|
3097
3095
|
e.dashboard = s ? s[0] : "", e.widget = s ? s[1] : "";
|
|
3098
3096
|
}
|
|
3099
|
-
e.type ===
|
|
3097
|
+
e.type === be && (e = Je(this.options, e)), !this.subscribers.filter(
|
|
3100
3098
|
(s) => s.widget == e.widget
|
|
3101
3099
|
).length && this.subscribers.push(e);
|
|
3102
3100
|
});
|
|
@@ -3117,48 +3115,34 @@ class cs {
|
|
|
3117
3115
|
k(this, "options");
|
|
3118
3116
|
k(this, "setCloud", async (e, n) => {
|
|
3119
3117
|
const r = B(e);
|
|
3120
|
-
|
|
3121
|
-
s(window.BuzzCasting.WidgetData[r] = n);
|
|
3122
|
-
});
|
|
3118
|
+
window.BuzzCasting.WidgetData[r] = n;
|
|
3123
3119
|
});
|
|
3124
3120
|
k(this, "getCloud", async (e) => {
|
|
3125
3121
|
const n = B(e);
|
|
3126
|
-
return
|
|
3127
|
-
r(window.localStorage.getObject(n));
|
|
3128
|
-
});
|
|
3122
|
+
return window.localStorage.getObject(n);
|
|
3129
3123
|
});
|
|
3130
3124
|
k(this, "setSeries", async (e, n) => {
|
|
3131
3125
|
const r = B(e);
|
|
3132
|
-
|
|
3133
|
-
s(window.localStorage.setObject(r, n));
|
|
3134
|
-
});
|
|
3126
|
+
window.localStorage.setObject(r, n);
|
|
3135
3127
|
});
|
|
3136
3128
|
k(this, "getSeries", async (e) => {
|
|
3137
3129
|
const n = B(e);
|
|
3138
|
-
return
|
|
3139
|
-
r(window.localStorage.getObject(n));
|
|
3140
|
-
});
|
|
3130
|
+
return window.localStorage.getObject(n);
|
|
3141
3131
|
});
|
|
3142
3132
|
k(this, "setMessages", async (e, n) => {
|
|
3143
3133
|
const r = B(e);
|
|
3144
|
-
|
|
3145
|
-
s(window.localStorage.setObject(r, n));
|
|
3146
|
-
});
|
|
3134
|
+
window.localStorage.setObject(r, n);
|
|
3147
3135
|
});
|
|
3148
3136
|
k(this, "getMessages", async (e) => {
|
|
3149
3137
|
const n = B(e);
|
|
3150
|
-
return
|
|
3151
|
-
r(window.localStorage.getObject(n));
|
|
3152
|
-
});
|
|
3138
|
+
return window.localStorage.getObject(n);
|
|
3153
3139
|
});
|
|
3154
3140
|
k(this, "cleanMessages", async (e) => {
|
|
3155
3141
|
console.log("cleanMessages not implemented for ", this.options.storage);
|
|
3156
3142
|
});
|
|
3157
3143
|
k(this, "setWidget", async (e) => {
|
|
3158
3144
|
let n = `widget.${e.widget}`;
|
|
3159
|
-
|
|
3160
|
-
r(window.localStorage.setObject(n, e));
|
|
3161
|
-
});
|
|
3145
|
+
window.localStorage.setObject(n, e);
|
|
3162
3146
|
});
|
|
3163
3147
|
k(this, "subscribe", (e) => {
|
|
3164
3148
|
var r;
|
|
@@ -3166,7 +3150,9 @@ class cs {
|
|
|
3166
3150
|
const s = (r = e.topics) == null ? void 0 : r.split("-");
|
|
3167
3151
|
e.dashboard = s ? s[0] : "", e.widget = s ? s[1] : "";
|
|
3168
3152
|
}
|
|
3169
|
-
e.type ===
|
|
3153
|
+
e.type === be && (e = Je(this.options, e)), !this.subscribers.filter(
|
|
3154
|
+
(s) => s.widget == e.widget
|
|
3155
|
+
).length && this.subscribers.push(e);
|
|
3170
3156
|
});
|
|
3171
3157
|
this.options = e, window.BuzzCasting.WidgetData = /* @__PURE__ */ new Set();
|
|
3172
3158
|
}
|
|
@@ -3174,7 +3160,7 @@ class cs {
|
|
|
3174
3160
|
return this.subscribers;
|
|
3175
3161
|
}
|
|
3176
3162
|
}
|
|
3177
|
-
const
|
|
3163
|
+
const be = "messages", cr = "cloud", rn = "series", ls = "topics", us = "keyval", hs = "local", ds = "session", fs = "dexie", ps = "window";
|
|
3178
3164
|
class ys {
|
|
3179
3165
|
//private options: IStorageManager
|
|
3180
3166
|
constructor(e) {
|
|
@@ -3196,7 +3182,7 @@ class ys {
|
|
|
3196
3182
|
if (i.status === "fulfilled") {
|
|
3197
3183
|
const l = i.value;
|
|
3198
3184
|
switch (l.query.type) {
|
|
3199
|
-
case
|
|
3185
|
+
case be:
|
|
3200
3186
|
(o = this.sm) == null || o.setMessages(l.query, l.data);
|
|
3201
3187
|
break;
|
|
3202
3188
|
case cr:
|
|
@@ -3274,7 +3260,7 @@ class ys {
|
|
|
3274
3260
|
}
|
|
3275
3261
|
export {
|
|
3276
3262
|
cr as CLOUD,
|
|
3277
|
-
|
|
3263
|
+
be as MESSAGES,
|
|
3278
3264
|
rn as SERIES,
|
|
3279
3265
|
fs as STORAGE_DEXIE,
|
|
3280
3266
|
us as STORAGE_KEYVAL,
|