buzzcasting-storage 2.10.7 → 2.10.9
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 +29 -13
- package/dist/buzzcasting-storage.esm.js +364 -352
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var P = (v, o, l) => (
|
|
4
|
-
const
|
|
5
|
-
|
|
1
|
+
var xi = Object.defineProperty;
|
|
2
|
+
var ki = (v, o, l) => o in v ? xi(v, o, { enumerable: !0, configurable: !0, writable: !0, value: l }) : v[o] = l;
|
|
3
|
+
var P = (v, o, l) => (ki(v, typeof o != "symbol" ? o + "" : o, l), l);
|
|
4
|
+
const Ai = "2.10.8";
|
|
5
|
+
var K = /* @__PURE__ */ ((v) => (v.MESSAGES = "messages", v.CLOUD = "cloud", v.SERIES = "series", v.TOPICS = "topics", v.WIDGET = "widget", v.WIDGETS = "widgets", v))(K || {}), x = /* @__PURE__ */ ((v) => (v.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", v.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", v.BROADCAST = "color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", v.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", v.CLOUD = "color:grey;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", v.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", v.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", v.MESSAGES = "color:grey;background-color:tan;padding:0 4px 0 4px;border-radius:5px;", v.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", v.NONE = "color:transparent;background-color:transparent;", v.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", v.SERIES = "color:grey;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", v.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", v.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", v.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", v.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", v.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", v))(x || {}), se = /* @__PURE__ */ ((v) => (v.ADD_SLIDE = "addSlide", v.APP_READY = "appReady", v.API_UPDATE = "apiUpdate", v.APPROVE_MESSAGE = "approveMessage", v.CHANNEL = "channel", v.ERROR = "error", v.GOTO_SLIDE = "gotoSlide", v.HIDE_MESSAGE = "hideMessage", v.NEXT_SLIDE = "nextSlide", v.PAUSE_PRESENTATION = "pausePresentation", v.PRESENTATION_READY = "presentationReady", v.PREV_SLIDE = "prevSlide", v.RELOAD_PRESENTATION = "reloadPresentation", v.SHOW_MODAL = "showModal", v.STAR_MESSAGE = "starMessage", v.SLIDE_DID_LOAD = "slideDidLoad", v.SLIDE_GOTO = "slideGoto", v.SLIDE_READY = "slideReady", v.SLIDE_TRANSITIONER = "slideTransitioner", v.START_TRANSITIONER = "startTransitioner", v.STORAGE_INIT = "stroageInit", v.SUBSCRIBE = "subscribe", v.UPDATE = "update", v.VERSION = "version", v.WIDGET_UPDATE = "widgetUpdate", v))(se || {}), vt = /* @__PURE__ */ ((v) => (v.APPROVED = "approved", v.BEFORE = "before", v.DELAYED = "delayed", v.NONE = "none", v.REALTIME = "realtime", v))(vt || {}), he = /* @__PURE__ */ ((v) => (v.KEYVAL = "keyval", v.LOCAL = "local", v.SESSION = "session", v.DEXIE = "dexie", v.WINDOW = "window", v))(he || {});
|
|
6
|
+
class Di {
|
|
6
7
|
constructor(o) {
|
|
7
8
|
P(this, "options");
|
|
8
9
|
P(this, "url");
|
|
@@ -45,7 +46,7 @@ class ki {
|
|
|
45
46
|
x.API,
|
|
46
47
|
x.NONE,
|
|
47
48
|
x.GET_DATA,
|
|
48
|
-
|
|
49
|
+
se.HIDE_MESSAGE,
|
|
49
50
|
[l, "api", y, o.type, o.id].join("/") + j,
|
|
50
51
|
{ ...I, method: "put" }
|
|
51
52
|
), await fetch(
|
|
@@ -59,7 +60,7 @@ class ki {
|
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
var Ir = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
62
|
-
function
|
|
63
|
+
function Pi(v) {
|
|
63
64
|
return v && v.__esModule && Object.prototype.hasOwnProperty.call(v, "default") ? v.default : v;
|
|
64
65
|
}
|
|
65
66
|
var Rr = { exports: {} };
|
|
@@ -108,14 +109,14 @@ var Rr = { exports: {} };
|
|
|
108
109
|
function ke(e, t, n, r) {
|
|
109
110
|
$n(e, t, Z(n && ie(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, r));
|
|
110
111
|
}
|
|
111
|
-
function
|
|
112
|
+
function Ye(e) {
|
|
112
113
|
return { from: function(t) {
|
|
113
114
|
return e.prototype = Object.create(t.prototype), ke(e.prototype, "constructor", e), { extend: xe.bind(null, e.prototype) };
|
|
114
115
|
} };
|
|
115
116
|
}
|
|
116
|
-
var
|
|
117
|
-
function
|
|
118
|
-
return
|
|
117
|
+
var Ur = Object.getOwnPropertyDescriptor, Wr = [].slice;
|
|
118
|
+
function _t(e, t, n) {
|
|
119
|
+
return Wr.call(e, t, n);
|
|
119
120
|
}
|
|
120
121
|
function Yn(e, t) {
|
|
121
122
|
return t(e);
|
|
@@ -162,9 +163,9 @@ var Rr = { exports: {} };
|
|
|
162
163
|
ie(e, t) && (n[t] = e[t]);
|
|
163
164
|
return n;
|
|
164
165
|
}
|
|
165
|
-
var
|
|
166
|
+
var zr = [].concat;
|
|
166
167
|
function Vn(e) {
|
|
167
|
-
return
|
|
168
|
+
return zr.apply([], e);
|
|
168
169
|
}
|
|
169
170
|
var ge = "BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Vn([8, 16, 32, 64].map(function(e) {
|
|
170
171
|
return ["Int", "Uint", "Float"].map(function(t) {
|
|
@@ -196,11 +197,11 @@ var Rr = { exports: {} };
|
|
|
196
197
|
return r;
|
|
197
198
|
}(e), it = null, e;
|
|
198
199
|
}
|
|
199
|
-
var
|
|
200
|
+
var $r = {}.toString;
|
|
200
201
|
function Jt(e) {
|
|
201
|
-
return
|
|
202
|
+
return $r.call(e).slice(8, -1);
|
|
202
203
|
}
|
|
203
|
-
var Zt = typeof Symbol < "u" ? Symbol.iterator : "@@iterator",
|
|
204
|
+
var Zt = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", Yr = typeof Zt == "symbol" ? function(e) {
|
|
204
205
|
var t;
|
|
205
206
|
return e != null && (t = e[Zt]) && t.apply(e);
|
|
206
207
|
} : function() {
|
|
@@ -209,15 +210,15 @@ var Rr = { exports: {} };
|
|
|
209
210
|
function Me(e, t) {
|
|
210
211
|
return t = e.indexOf(t), 0 <= t && e.splice(t, 1), 0 <= t;
|
|
211
212
|
}
|
|
212
|
-
var
|
|
213
|
+
var He = {};
|
|
213
214
|
function we(e) {
|
|
214
215
|
var t, n, r, i;
|
|
215
216
|
if (arguments.length === 1) {
|
|
216
217
|
if (N(e))
|
|
217
218
|
return e.slice();
|
|
218
|
-
if (this ===
|
|
219
|
+
if (this === He && typeof e == "string")
|
|
219
220
|
return [e];
|
|
220
|
-
if (i =
|
|
221
|
+
if (i = Yr(e)) {
|
|
221
222
|
for (n = []; !(r = i.next()).done; )
|
|
222
223
|
n.push(r.value);
|
|
223
224
|
return n;
|
|
@@ -238,8 +239,8 @@ var Rr = { exports: {} };
|
|
|
238
239
|
return e[Symbol.toStringTag] === "AsyncFunction";
|
|
239
240
|
} : function() {
|
|
240
241
|
return !1;
|
|
241
|
-
}, st = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], fe = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(st),
|
|
242
|
-
function
|
|
242
|
+
}, st = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], fe = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(st), Hr = { 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" };
|
|
243
|
+
function Qe(e, t) {
|
|
243
244
|
this.name = e, this.message = t;
|
|
244
245
|
}
|
|
245
246
|
function Jn(e, t) {
|
|
@@ -250,31 +251,31 @@ var Rr = { exports: {} };
|
|
|
250
251
|
}).join(`
|
|
251
252
|
`);
|
|
252
253
|
}
|
|
253
|
-
function
|
|
254
|
+
function St(e, t, n, r) {
|
|
254
255
|
this.failures = t, this.failedKeys = r, this.successCount = n, this.message = Jn(e, t);
|
|
255
256
|
}
|
|
256
|
-
function
|
|
257
|
+
function Ve(e, t) {
|
|
257
258
|
this.name = "BulkError", this.failures = Object.keys(t).map(function(n) {
|
|
258
259
|
return t[n];
|
|
259
260
|
}), this.failuresByPos = t, this.message = Jn(e, this.failures);
|
|
260
261
|
}
|
|
261
|
-
|
|
262
|
+
Ye(Qe).from(Error).extend({ toString: function() {
|
|
262
263
|
return this.name + ": " + this.message;
|
|
263
|
-
} }),
|
|
264
|
+
} }), Ye(St).from(Qe), Ye(Ve).from(Qe);
|
|
264
265
|
var en = fe.reduce(function(e, t) {
|
|
265
266
|
return e[t] = t + "Error", e;
|
|
266
|
-
}, {}),
|
|
267
|
+
}, {}), Qr = Qe, L = fe.reduce(function(e, t) {
|
|
267
268
|
var n = t + "Error";
|
|
268
269
|
function r(i, a) {
|
|
269
270
|
this.name = n, i ? typeof i == "string" ? (this.message = "".concat(i).concat(a ? `
|
|
270
|
-
` + a : ""), this.inner = a || null) : typeof i == "object" && (this.message = "".concat(i.name, " ").concat(i.message), this.inner = i) : (this.message =
|
|
271
|
+
` + a : ""), this.inner = a || null) : typeof i == "object" && (this.message = "".concat(i.name, " ").concat(i.message), this.inner = i) : (this.message = Hr[t] || n, this.inner = null);
|
|
271
272
|
}
|
|
272
|
-
return
|
|
273
|
+
return Ye(r).from(Qr), e[t] = r, e;
|
|
273
274
|
}, {});
|
|
274
275
|
L.Syntax = SyntaxError, L.Type = TypeError, L.Range = RangeError;
|
|
275
276
|
var Zn = st.reduce(function(e, t) {
|
|
276
277
|
return e[t + "Error"] = L[t], e;
|
|
277
|
-
}, {}),
|
|
278
|
+
}, {}), Et = fe.reduce(function(e, t) {
|
|
278
279
|
return ["Syntax", "Type", "Range"].indexOf(t) === -1 && (e[t + "Error"] = L[t]), e;
|
|
279
280
|
}, {});
|
|
280
281
|
function H() {
|
|
@@ -282,7 +283,7 @@ var Rr = { exports: {} };
|
|
|
282
283
|
function ot(e) {
|
|
283
284
|
return e;
|
|
284
285
|
}
|
|
285
|
-
function
|
|
286
|
+
function Vr(e, t) {
|
|
286
287
|
return e == null || e === ot ? t : function(n) {
|
|
287
288
|
return t(e(n));
|
|
288
289
|
};
|
|
@@ -292,7 +293,7 @@ var Rr = { exports: {} };
|
|
|
292
293
|
e.apply(this, arguments), t.apply(this, arguments);
|
|
293
294
|
};
|
|
294
295
|
}
|
|
295
|
-
function
|
|
296
|
+
function Xr(e, t) {
|
|
296
297
|
return e === H ? t : function() {
|
|
297
298
|
var n = e.apply(this, arguments);
|
|
298
299
|
n !== void 0 && (arguments[0] = n);
|
|
@@ -302,14 +303,14 @@ var Rr = { exports: {} };
|
|
|
302
303
|
return r && (this.onsuccess = this.onsuccess ? Ke(r, this.onsuccess) : r), i && (this.onerror = this.onerror ? Ke(i, this.onerror) : i), a !== void 0 ? a : n;
|
|
303
304
|
};
|
|
304
305
|
}
|
|
305
|
-
function
|
|
306
|
+
function Jr(e, t) {
|
|
306
307
|
return e === H ? t : function() {
|
|
307
308
|
e.apply(this, arguments);
|
|
308
309
|
var n = this.onsuccess, r = this.onerror;
|
|
309
310
|
this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? Ke(n, this.onsuccess) : n), r && (this.onerror = this.onerror ? Ke(r, this.onerror) : r);
|
|
310
311
|
};
|
|
311
312
|
}
|
|
312
|
-
function
|
|
313
|
+
function Zr(e, t) {
|
|
313
314
|
return e === H ? t : function(n) {
|
|
314
315
|
var r = e.apply(this, arguments);
|
|
315
316
|
Z(n, r);
|
|
@@ -317,7 +318,7 @@ var Rr = { exports: {} };
|
|
|
317
318
|
return this.onsuccess = null, this.onerror = null, n = t.apply(this, arguments), i && (this.onsuccess = this.onsuccess ? Ke(i, this.onsuccess) : i), a && (this.onerror = this.onerror ? Ke(a, this.onerror) : a), r === void 0 ? n === void 0 ? void 0 : n : Z(r, n);
|
|
318
319
|
};
|
|
319
320
|
}
|
|
320
|
-
function
|
|
321
|
+
function qr(e, t) {
|
|
321
322
|
return e === H ? t : function() {
|
|
322
323
|
return t.apply(this, arguments) !== !1 && e.apply(this, arguments);
|
|
323
324
|
};
|
|
@@ -335,7 +336,7 @@ var Rr = { exports: {} };
|
|
|
335
336
|
return t.apply(this, arguments);
|
|
336
337
|
};
|
|
337
338
|
}
|
|
338
|
-
|
|
339
|
+
Et.ModifyError = St, Et.DexieError = Qe, Et.BulkError = Ve;
|
|
339
340
|
var pe = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
|
|
340
341
|
function qn(e) {
|
|
341
342
|
pe = e;
|
|
@@ -347,8 +348,8 @@ var Rr = { exports: {} };
|
|
|
347
348
|
var t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
348
349
|
return [t, te(t), e];
|
|
349
350
|
}(), st = ge[0], fe = ge[1], ge = ge[2], fe = fe && fe.then, ut = st && st.constructor, nn = !!ge, ct = function(e, t) {
|
|
350
|
-
lt.push([e, t]),
|
|
351
|
-
}, rn = !0,
|
|
351
|
+
lt.push([e, t]), Ot && (queueMicrotask(ti), Ot = !1);
|
|
352
|
+
}, rn = !0, Ot = !0, Be = [], xt = [], on = ot, De = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: H, pgp: !1, env: {}, finalize: H }, B = De, lt = [], Ne = 0, kt = [];
|
|
352
353
|
function T(e) {
|
|
353
354
|
if (typeof this != "object")
|
|
354
355
|
throw new TypeError("Promises must be constructed via new");
|
|
@@ -365,10 +366,10 @@ var Rr = { exports: {} };
|
|
|
365
366
|
if (r._state === null) {
|
|
366
367
|
if (a === r)
|
|
367
368
|
throw new TypeError("A promise cannot be resolved with itself.");
|
|
368
|
-
var s = r._lib &&
|
|
369
|
+
var s = r._lib && Xe();
|
|
369
370
|
a && typeof a.then == "function" ? n(r, function(u, h) {
|
|
370
371
|
a instanceof T ? a._then(u, h) : a.then(u, h);
|
|
371
|
-
}) : (r._state = !0, r._value = a, nr(r)), s &&
|
|
372
|
+
}) : (r._state = !0, r._value = a, nr(r)), s && Je();
|
|
372
373
|
}
|
|
373
374
|
}, sn.bind(null, r));
|
|
374
375
|
} catch (a) {
|
|
@@ -377,9 +378,9 @@ var Rr = { exports: {} };
|
|
|
377
378
|
}(this, e);
|
|
378
379
|
}
|
|
379
380
|
var an = { get: function() {
|
|
380
|
-
var e = B, t =
|
|
381
|
+
var e = B, t = It;
|
|
381
382
|
function n(r, i) {
|
|
382
|
-
var a = this, s = !e.global && (e !== B || t !==
|
|
383
|
+
var a = this, s = !e.global && (e !== B || t !== It), u = s && !Ie(), h = new T(function(d, b) {
|
|
383
384
|
un(a, new tr(ir(r, e, s, u), ir(i, e, s, u), d, b, e));
|
|
384
385
|
});
|
|
385
386
|
return this._consoleTask && (h._consoleTask = this._consoleTask), h;
|
|
@@ -395,9 +396,9 @@ var Rr = { exports: {} };
|
|
|
395
396
|
}
|
|
396
397
|
function sn(e, t) {
|
|
397
398
|
var n, r;
|
|
398
|
-
|
|
399
|
+
xt.push(t), e._state === null && (n = e._lib && Xe(), t = on(t), e._state = !1, e._value = t, r = e, Be.some(function(i) {
|
|
399
400
|
return i._value === r._value;
|
|
400
|
-
}) || Be.push(r), nr(e), n &&
|
|
401
|
+
}) || Be.push(r), nr(e), n && Je());
|
|
401
402
|
}
|
|
402
403
|
function nr(e) {
|
|
403
404
|
var t = e._listeners;
|
|
@@ -414,16 +415,16 @@ var Rr = { exports: {} };
|
|
|
414
415
|
var n = e._state ? t.onFulfilled : t.onRejected;
|
|
415
416
|
if (n === null)
|
|
416
417
|
return (e._state ? t.resolve : t.reject)(e._value);
|
|
417
|
-
++t.psd.ref, ++Ne, ct(
|
|
418
|
+
++t.psd.ref, ++Ne, ct(ei, [n, e, t]);
|
|
418
419
|
} else
|
|
419
420
|
e._listeners.push(t);
|
|
420
421
|
}
|
|
421
|
-
function
|
|
422
|
+
function ei(e, t, n) {
|
|
422
423
|
try {
|
|
423
424
|
var r, i = t._value;
|
|
424
|
-
!t._state &&
|
|
425
|
+
!t._state && xt.length && (xt = []), r = pe && t._consoleTask ? t._consoleTask.run(function() {
|
|
425
426
|
return e(i);
|
|
426
|
-
}) : e(i), t._state ||
|
|
427
|
+
}) : e(i), t._state || xt.indexOf(i) !== -1 || function(a) {
|
|
427
428
|
for (var s = Be.length; s; )
|
|
428
429
|
if (Be[--s]._value === a._value)
|
|
429
430
|
return Be.splice(s, 1);
|
|
@@ -434,16 +435,16 @@ var Rr = { exports: {} };
|
|
|
434
435
|
--Ne == 0 && cn(), --n.psd.ref || n.psd.finalize();
|
|
435
436
|
}
|
|
436
437
|
}
|
|
437
|
-
function
|
|
438
|
+
function ti() {
|
|
438
439
|
Ge(De, function() {
|
|
439
|
-
|
|
440
|
+
Xe() && Je();
|
|
440
441
|
});
|
|
441
442
|
}
|
|
442
|
-
function
|
|
443
|
+
function Xe() {
|
|
443
444
|
var e = rn;
|
|
444
|
-
return
|
|
445
|
+
return Ot = rn = !1, e;
|
|
445
446
|
}
|
|
446
|
-
function
|
|
447
|
+
function Je() {
|
|
447
448
|
var e, t, n;
|
|
448
449
|
do
|
|
449
450
|
for (; 0 < lt.length; )
|
|
@@ -452,29 +453,29 @@ var Rr = { exports: {} };
|
|
|
452
453
|
r[0].apply(null, r[1]);
|
|
453
454
|
}
|
|
454
455
|
while (0 < lt.length);
|
|
455
|
-
|
|
456
|
+
Ot = rn = !0;
|
|
456
457
|
}
|
|
457
458
|
function cn() {
|
|
458
459
|
var e = Be;
|
|
459
460
|
Be = [], e.forEach(function(r) {
|
|
460
461
|
r._PSD.onunhandled.call(null, r._value, r);
|
|
461
462
|
});
|
|
462
|
-
for (var t =
|
|
463
|
+
for (var t = kt.slice(0), n = t.length; n; )
|
|
463
464
|
t[--n]();
|
|
464
465
|
}
|
|
465
|
-
function
|
|
466
|
+
function At(e) {
|
|
466
467
|
return new T(at, !1, e);
|
|
467
468
|
}
|
|
468
469
|
function J(e, t) {
|
|
469
470
|
var n = B;
|
|
470
471
|
return function() {
|
|
471
|
-
var r =
|
|
472
|
+
var r = Xe(), i = B;
|
|
472
473
|
try {
|
|
473
474
|
return Ce(n, !0), e.apply(this, arguments);
|
|
474
475
|
} catch (a) {
|
|
475
476
|
t && t(a);
|
|
476
477
|
} finally {
|
|
477
|
-
Ce(i, !1), r &&
|
|
478
|
+
Ce(i, !1), r && Je();
|
|
478
479
|
}
|
|
479
480
|
};
|
|
480
481
|
}
|
|
@@ -485,9 +486,9 @@ var Rr = { exports: {} };
|
|
|
485
486
|
return this.then(null, e);
|
|
486
487
|
var t = e, n = arguments[1];
|
|
487
488
|
return typeof t == "function" ? this.then(null, function(r) {
|
|
488
|
-
return (r instanceof t ? n :
|
|
489
|
+
return (r instanceof t ? n : At)(r);
|
|
489
490
|
}) : this.then(null, function(r) {
|
|
490
|
-
return (r && r.name === t ? n :
|
|
491
|
+
return (r && r.name === t ? n : At)(r);
|
|
491
492
|
});
|
|
492
493
|
}, finally: function(e) {
|
|
493
494
|
return this.then(function(t) {
|
|
@@ -496,7 +497,7 @@ var Rr = { exports: {} };
|
|
|
496
497
|
});
|
|
497
498
|
}, function(t) {
|
|
498
499
|
return T.resolve(e()).then(function() {
|
|
499
|
-
return
|
|
500
|
+
return At(t);
|
|
500
501
|
});
|
|
501
502
|
});
|
|
502
503
|
}, timeout: function(e, t) {
|
|
@@ -508,7 +509,7 @@ var Rr = { exports: {} };
|
|
|
508
509
|
n.then(r, i).finally(clearTimeout.bind(null, a));
|
|
509
510
|
}) : this;
|
|
510
511
|
} }), typeof Symbol < "u" && Symbol.toStringTag && ke(T.prototype, Symbol.toStringTag, "Dexie.Promise"), De.env = rr(), xe(T, { all: function() {
|
|
511
|
-
var e = we.apply(null, arguments).map(
|
|
512
|
+
var e = we.apply(null, arguments).map(Ct);
|
|
512
513
|
return new T(function(t, n) {
|
|
513
514
|
e.length === 0 && t([]);
|
|
514
515
|
var r = e.length;
|
|
@@ -522,8 +523,8 @@ var Rr = { exports: {} };
|
|
|
522
523
|
return e instanceof T ? e : e && typeof e.then == "function" ? new T(function(t, n) {
|
|
523
524
|
e.then(t, n);
|
|
524
525
|
}) : new T(at, !0, e);
|
|
525
|
-
}, reject:
|
|
526
|
-
var e = we.apply(null, arguments).map(
|
|
526
|
+
}, reject: At, race: function() {
|
|
527
|
+
var e = we.apply(null, arguments).map(Ct);
|
|
527
528
|
return new T(function(t, n) {
|
|
528
529
|
e.map(function(r) {
|
|
529
530
|
return T.resolve(r).then(t, n);
|
|
@@ -534,7 +535,7 @@ var Rr = { exports: {} };
|
|
|
534
535
|
}, set: function(e) {
|
|
535
536
|
return B = e;
|
|
536
537
|
} }, totalEchoes: { get: function() {
|
|
537
|
-
return
|
|
538
|
+
return It;
|
|
538
539
|
} }, newPSD: Pe, usePSD: Ge, scheduler: { get: function() {
|
|
539
540
|
return ct;
|
|
540
541
|
}, set: function(e) {
|
|
@@ -551,8 +552,8 @@ var Rr = { exports: {} };
|
|
|
551
552
|
var u, h = this;
|
|
552
553
|
u = function() {
|
|
553
554
|
h.unhandleds.length === 0 ? i() : a(h.unhandleds[0]);
|
|
554
|
-
},
|
|
555
|
-
u(),
|
|
555
|
+
}, kt.push(function d() {
|
|
556
|
+
u(), kt.splice(kt.indexOf(d), 1);
|
|
556
557
|
}), ++Ne, ct(function() {
|
|
557
558
|
--Ne == 0 && cn();
|
|
558
559
|
}, []);
|
|
@@ -560,7 +561,7 @@ var Rr = { exports: {} };
|
|
|
560
561
|
}, t, n, r);
|
|
561
562
|
});
|
|
562
563
|
} }), ut && (ut.allSettled && ke(T, "allSettled", function() {
|
|
563
|
-
var e = we.apply(null, arguments).map(
|
|
564
|
+
var e = we.apply(null, arguments).map(Ct);
|
|
564
565
|
return new T(function(t) {
|
|
565
566
|
e.length === 0 && t([]);
|
|
566
567
|
var n = e.length, r = new Array(n);
|
|
@@ -575,7 +576,7 @@ var Rr = { exports: {} };
|
|
|
575
576
|
});
|
|
576
577
|
});
|
|
577
578
|
}), ut.any && typeof AggregateError < "u" && ke(T, "any", function() {
|
|
578
|
-
var e = we.apply(null, arguments).map(
|
|
579
|
+
var e = we.apply(null, arguments).map(Ct);
|
|
579
580
|
return new T(function(t, n) {
|
|
580
581
|
e.length === 0 && n(new AggregateError([]));
|
|
581
582
|
var r = e.length, i = new Array(r);
|
|
@@ -588,35 +589,35 @@ var Rr = { exports: {} };
|
|
|
588
589
|
});
|
|
589
590
|
});
|
|
590
591
|
}));
|
|
591
|
-
var ne = { awaits: 0, echoes: 0, id: 0 },
|
|
592
|
+
var ne = { awaits: 0, echoes: 0, id: 0 }, ni = 0, Dt = [], Pt = 0, It = 0, ri = 0;
|
|
592
593
|
function Pe(e, t, n, r) {
|
|
593
594
|
var i = B, a = Object.create(i);
|
|
594
|
-
return a.parent = i, a.ref = 0, a.global = !1, a.id = ++
|
|
595
|
+
return a.parent = i, a.ref = 0, a.global = !1, a.id = ++ri, De.env, a.env = nn ? { Promise: T, PromiseProp: { value: T, configurable: !0, writable: !0 }, all: T.all, race: T.race, allSettled: T.allSettled, any: T.any, resolve: T.resolve, reject: T.reject } : {}, t && Z(a, t), ++i.ref, a.finalize = function() {
|
|
595
596
|
--this.parent.ref || this.parent.finalize();
|
|
596
597
|
}, r = Ge(a, e, n, r), a.ref === 0 && a.finalize(), r;
|
|
597
598
|
}
|
|
598
|
-
function
|
|
599
|
-
return ne.id || (ne.id = ++
|
|
599
|
+
function Ze() {
|
|
600
|
+
return ne.id || (ne.id = ++ni), ++ne.awaits, ne.echoes += er, ne.id;
|
|
600
601
|
}
|
|
601
602
|
function Ie() {
|
|
602
603
|
return !!ne.awaits && (--ne.awaits == 0 && (ne.id = 0), ne.echoes = ne.awaits * er, !0);
|
|
603
604
|
}
|
|
604
|
-
function
|
|
605
|
-
return ne.echoes && e && e.constructor === ut ? (
|
|
605
|
+
function Ct(e) {
|
|
606
|
+
return ne.echoes && e && e.constructor === ut ? (Ze(), e.then(function(t) {
|
|
606
607
|
return Ie(), t;
|
|
607
608
|
}, function(t) {
|
|
608
609
|
return Ie(), q(t);
|
|
609
610
|
})) : e;
|
|
610
611
|
}
|
|
611
|
-
function
|
|
612
|
-
var e =
|
|
613
|
-
|
|
612
|
+
function ii() {
|
|
613
|
+
var e = Dt[Dt.length - 1];
|
|
614
|
+
Dt.pop(), Ce(e, !1);
|
|
614
615
|
}
|
|
615
616
|
function Ce(e, t) {
|
|
616
617
|
var n, r = B;
|
|
617
|
-
(t ? !ne.echoes ||
|
|
618
|
-
++
|
|
619
|
-
}).bind(null, e) :
|
|
618
|
+
(t ? !ne.echoes || Pt++ && e === B : !Pt || --Pt && e === B) || queueMicrotask(t ? (function(i) {
|
|
619
|
+
++It, ne.echoes && --ne.echoes != 0 || (ne.echoes = ne.awaits = ne.id = 0), Dt.push(B), Ce(i, !0);
|
|
620
|
+
}).bind(null, e) : ii), e !== B && (B = e, r === De && (De.env = rr()), nn && (n = De.env.Promise, t = e.env, (r.global || e.global) && (Object.defineProperty(j, "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))));
|
|
620
621
|
}
|
|
621
622
|
function rr() {
|
|
622
623
|
var e = j.Promise;
|
|
@@ -633,7 +634,7 @@ var Rr = { exports: {} };
|
|
|
633
634
|
function ir(e, t, n, r) {
|
|
634
635
|
return typeof e != "function" ? e : function() {
|
|
635
636
|
var i = B;
|
|
636
|
-
n &&
|
|
637
|
+
n && Ze(), Ce(t, !0);
|
|
637
638
|
try {
|
|
638
639
|
return e.apply(this, arguments);
|
|
639
640
|
} finally {
|
|
@@ -642,17 +643,17 @@ var Rr = { exports: {} };
|
|
|
642
643
|
};
|
|
643
644
|
}
|
|
644
645
|
function ln(e) {
|
|
645
|
-
Promise === ut && ne.echoes === 0 ?
|
|
646
|
+
Promise === ut && ne.echoes === 0 ? Pt === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
646
647
|
}
|
|
647
|
-
("" + fe).indexOf("[native code]") === -1 && (
|
|
648
|
-
var q = T.reject, ge = "4.0.1-beta.10", Le = "", _e = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", or = "String expected.",
|
|
648
|
+
("" + fe).indexOf("[native code]") === -1 && (Ze = Ie = H);
|
|
649
|
+
var q = T.reject, ge = "4.0.1-beta.10", Le = "", _e = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", or = "String expected.", qe = [], Rt = "__dbnames", dn = "readonly", fn = "readwrite";
|
|
649
650
|
function Fe(e, t) {
|
|
650
651
|
return e ? t ? function() {
|
|
651
652
|
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
652
653
|
} : e : t;
|
|
653
654
|
}
|
|
654
655
|
var ar = { type: 3, lower: -1 / 0, lowerOpen: !1, upper: [[]], upperOpen: !1 };
|
|
655
|
-
function
|
|
656
|
+
function Tt(e) {
|
|
656
657
|
return typeof e != "string" || /\./.test(e) ? function(t) {
|
|
657
658
|
return t;
|
|
658
659
|
} : function(t) {
|
|
@@ -707,7 +708,7 @@ var Rr = { exports: {} };
|
|
|
707
708
|
throw new L.NotFound("Table " + i + " not part of transaction");
|
|
708
709
|
return t(c.idbtrans, c);
|
|
709
710
|
}
|
|
710
|
-
var u =
|
|
711
|
+
var u = Xe();
|
|
711
712
|
try {
|
|
712
713
|
var h = r && r.db._novip === this.db._novip ? r === B.trans ? r._promise(e, s, n) : Pe(function() {
|
|
713
714
|
return r._promise(e, s, n);
|
|
@@ -751,7 +752,7 @@ var Rr = { exports: {} };
|
|
|
751
752
|
return console.trace(d), q(d);
|
|
752
753
|
})), h;
|
|
753
754
|
} finally {
|
|
754
|
-
u &&
|
|
755
|
+
u && Je();
|
|
755
756
|
}
|
|
756
757
|
}, V.prototype.get = function(e, t) {
|
|
757
758
|
var n = this;
|
|
@@ -861,7 +862,7 @@ var Rr = { exports: {} };
|
|
|
861
862
|
});
|
|
862
863
|
}, V.prototype.add = function(e, t) {
|
|
863
864
|
var n = this, r = this.schema.primKey, i = r.auto, a = r.keyPath, s = e;
|
|
864
|
-
return a && i && (s =
|
|
865
|
+
return a && i && (s = Tt(a)(e)), this._trans("readwrite", function(u) {
|
|
865
866
|
return n.core.mutate({ trans: u, type: "add", keys: t != null ? [t] : null, values: [s] });
|
|
866
867
|
}).then(function(u) {
|
|
867
868
|
return u.numFailures ? T.reject(u.failures[0]) : u.lastResult;
|
|
@@ -877,7 +878,7 @@ var Rr = { exports: {} };
|
|
|
877
878
|
return typeof e != "object" || N(e) ? this.where(":id").equals(e).modify(t) : (e = ve(e, this.schema.primKey.keyPath), e === void 0 ? q(new L.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t));
|
|
878
879
|
}, V.prototype.put = function(e, t) {
|
|
879
880
|
var n = this, r = this.schema.primKey, i = r.auto, a = r.keyPath, s = e;
|
|
880
|
-
return a && i && (s =
|
|
881
|
+
return a && i && (s = Tt(a)(e)), this._trans("readwrite", function(u) {
|
|
881
882
|
return n.core.mutate({ trans: u, type: "put", values: [s], keys: t != null ? [t] : null });
|
|
882
883
|
}).then(function(u) {
|
|
883
884
|
return u.numFailures ? T.reject(u.failures[0]) : u.lastResult;
|
|
@@ -920,12 +921,12 @@ var Rr = { exports: {} };
|
|
|
920
921
|
throw new L.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
921
922
|
if (i && i.length !== e.length)
|
|
922
923
|
throw new L.InvalidArgument("Arguments objects and keys must have the same length");
|
|
923
|
-
var h = e.length, d = d && u ? e.map(
|
|
924
|
+
var h = e.length, d = d && u ? e.map(Tt(d)) : e;
|
|
924
925
|
return r.core.mutate({ trans: s, type: "add", keys: i, values: d, wantResults: a }).then(function(m) {
|
|
925
926
|
var c = m.numFailures, f = m.results, p = m.lastResult, m = m.failures;
|
|
926
927
|
if (c === 0)
|
|
927
928
|
return a ? f : p;
|
|
928
|
-
throw new
|
|
929
|
+
throw new Ve("".concat(r.name, ".bulkAdd(): ").concat(c, " of ").concat(h, " operations failed"), m);
|
|
929
930
|
});
|
|
930
931
|
});
|
|
931
932
|
}, V.prototype.bulkPut = function(e, t, n) {
|
|
@@ -936,12 +937,12 @@ var Rr = { exports: {} };
|
|
|
936
937
|
throw new L.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
937
938
|
if (i && i.length !== e.length)
|
|
938
939
|
throw new L.InvalidArgument("Arguments objects and keys must have the same length");
|
|
939
|
-
var h = e.length, d = d && u ? e.map(
|
|
940
|
+
var h = e.length, d = d && u ? e.map(Tt(d)) : e;
|
|
940
941
|
return r.core.mutate({ trans: s, type: "put", keys: i, values: d, wantResults: a }).then(function(m) {
|
|
941
942
|
var c = m.numFailures, f = m.results, p = m.lastResult, m = m.failures;
|
|
942
943
|
if (c === 0)
|
|
943
944
|
return a ? f : p;
|
|
944
|
-
throw new
|
|
945
|
+
throw new Ve("".concat(r.name, ".bulkPut(): ").concat(c, " of ").concat(h, " operations failed"), m);
|
|
945
946
|
});
|
|
946
947
|
});
|
|
947
948
|
}, V.prototype.bulkUpdate = function(e) {
|
|
@@ -976,7 +977,7 @@ var Rr = { exports: {} };
|
|
|
976
977
|
var g, _ = w[m], S = a[Number(_)];
|
|
977
978
|
S != null && (g = p[_], delete p[_], p[S] = g);
|
|
978
979
|
}
|
|
979
|
-
throw new
|
|
980
|
+
throw new Ve("".concat(t.name, ".bulkUpdate(): ").concat(f, " of ").concat(b, " operations failed"), p);
|
|
980
981
|
});
|
|
981
982
|
});
|
|
982
983
|
});
|
|
@@ -988,7 +989,7 @@ var Rr = { exports: {} };
|
|
|
988
989
|
var i = s.numFailures, a = s.lastResult, s = s.failures;
|
|
989
990
|
if (i === 0)
|
|
990
991
|
return a;
|
|
991
|
-
throw new
|
|
992
|
+
throw new Ve("".concat(t.name, ".bulkDelete(): ").concat(i, " of ").concat(n, " operations failed"), s);
|
|
992
993
|
});
|
|
993
994
|
}, V);
|
|
994
995
|
function V() {
|
|
@@ -1011,7 +1012,7 @@ var Rr = { exports: {} };
|
|
|
1011
1012
|
function a(s, u, h) {
|
|
1012
1013
|
if (typeof s != "object") {
|
|
1013
1014
|
var d;
|
|
1014
|
-
u = u ||
|
|
1015
|
+
u = u || qr;
|
|
1015
1016
|
var b = { subscribers: [], fire: h = h || H, subscribe: function(c) {
|
|
1016
1017
|
b.subscribers.indexOf(c) === -1 && (b.subscribers.push(c), b.fire = u(b.fire, c));
|
|
1017
1018
|
}, unsubscribe: function(c) {
|
|
@@ -1042,9 +1043,9 @@ var Rr = { exports: {} };
|
|
|
1042
1043
|
}
|
|
1043
1044
|
}
|
|
1044
1045
|
function ft(e, t) {
|
|
1045
|
-
return
|
|
1046
|
+
return Ye(t).from({ prototype: e }), t;
|
|
1046
1047
|
}
|
|
1047
|
-
function
|
|
1048
|
+
function et(e, t) {
|
|
1048
1049
|
return !(e.filter || e.algorithm || e.or) && (t ? e.justLimit : !e.replayFilter);
|
|
1049
1050
|
}
|
|
1050
1051
|
function hn(e, t) {
|
|
@@ -1056,7 +1057,7 @@ var Rr = { exports: {} };
|
|
|
1056
1057
|
return Fe(r(), t());
|
|
1057
1058
|
} : t, e.justLimit = n && !r;
|
|
1058
1059
|
}
|
|
1059
|
-
function
|
|
1060
|
+
function jt(e, t) {
|
|
1060
1061
|
if (e.isPrimKey)
|
|
1061
1062
|
return t.primaryKey;
|
|
1062
1063
|
var n = t.getIndexByKeyPath(e.index);
|
|
@@ -1065,10 +1066,10 @@ var Rr = { exports: {} };
|
|
|
1065
1066
|
return n;
|
|
1066
1067
|
}
|
|
1067
1068
|
function dr(e, t, n) {
|
|
1068
|
-
var r =
|
|
1069
|
+
var r = jt(e, t.schema);
|
|
1069
1070
|
return t.openCursor({ trans: n, values: !e.keysOnly, reverse: e.dir === "prev", unique: !!e.unique, query: { index: r, range: e.range } });
|
|
1070
1071
|
}
|
|
1071
|
-
function
|
|
1072
|
+
function Mt(e, t, n, r) {
|
|
1072
1073
|
var i = e.replayFilter ? Fe(e.filter, e.replayFilter()) : e.filter;
|
|
1073
1074
|
if (e.or) {
|
|
1074
1075
|
var a = {}, s = function(u, h, d) {
|
|
@@ -1105,7 +1106,7 @@ var Rr = { exports: {} };
|
|
|
1105
1106
|
});
|
|
1106
1107
|
});
|
|
1107
1108
|
}
|
|
1108
|
-
var
|
|
1109
|
+
var oi = (z.prototype._read = function(e, t) {
|
|
1109
1110
|
var n = this._ctx;
|
|
1110
1111
|
return n.error ? n.table._trans(null, q.bind(null, n.error)) : n.table._trans("readonly", e).then(t);
|
|
1111
1112
|
}, z.prototype._write = function(e) {
|
|
@@ -1115,7 +1116,7 @@ var Rr = { exports: {} };
|
|
|
1115
1116
|
var t = this._ctx;
|
|
1116
1117
|
t.algorithm = Fe(t.algorithm, e);
|
|
1117
1118
|
}, z.prototype._iterate = function(e, t) {
|
|
1118
|
-
return
|
|
1119
|
+
return Mt(this._ctx, e, t, this._ctx.table.core);
|
|
1119
1120
|
}, z.prototype.clone = function(e) {
|
|
1120
1121
|
var t = Object.create(this.constructor.prototype), n = Object.create(this._ctx);
|
|
1121
1122
|
return e && Z(n, e), t._ctx = n, t;
|
|
@@ -1124,18 +1125,18 @@ var Rr = { exports: {} };
|
|
|
1124
1125
|
}, z.prototype.each = function(e) {
|
|
1125
1126
|
var t = this._ctx;
|
|
1126
1127
|
return this._read(function(n) {
|
|
1127
|
-
return
|
|
1128
|
+
return Mt(t, e, n, t.table.core);
|
|
1128
1129
|
});
|
|
1129
1130
|
}, z.prototype.count = function(e) {
|
|
1130
1131
|
var t = this;
|
|
1131
1132
|
return this._read(function(n) {
|
|
1132
1133
|
var r = t._ctx, i = r.table.core;
|
|
1133
|
-
if (
|
|
1134
|
-
return i.count({ trans: n, query: { index:
|
|
1134
|
+
if (et(r, !0))
|
|
1135
|
+
return i.count({ trans: n, query: { index: jt(r, i.schema), range: r.range } }).then(function(s) {
|
|
1135
1136
|
return Math.min(s, r.limit);
|
|
1136
1137
|
});
|
|
1137
1138
|
var a = 0;
|
|
1138
|
-
return
|
|
1139
|
+
return Mt(r, function() {
|
|
1139
1140
|
return ++a, !1;
|
|
1140
1141
|
}, n, i).then(function() {
|
|
1141
1142
|
return a;
|
|
@@ -1157,14 +1158,14 @@ var Rr = { exports: {} };
|
|
|
1157
1158
|
var t = this;
|
|
1158
1159
|
return this._read(function(n) {
|
|
1159
1160
|
var r = t._ctx;
|
|
1160
|
-
if (r.dir === "next" &&
|
|
1161
|
-
var i = r.valueMapper, a =
|
|
1161
|
+
if (r.dir === "next" && et(r, !0) && 0 < r.limit) {
|
|
1162
|
+
var i = r.valueMapper, a = jt(r, r.table.core.schema);
|
|
1162
1163
|
return r.table.core.query({ trans: n, limit: r.limit, values: !0, query: { index: a, range: r.range } }).then(function(u) {
|
|
1163
1164
|
return u = u.result, i ? u.map(i) : u;
|
|
1164
1165
|
});
|
|
1165
1166
|
}
|
|
1166
1167
|
var s = [];
|
|
1167
|
-
return
|
|
1168
|
+
return Mt(r, function(u) {
|
|
1168
1169
|
return s.push(u);
|
|
1169
1170
|
}, n, r.table.core).then(function() {
|
|
1170
1171
|
return s;
|
|
@@ -1172,7 +1173,7 @@ var Rr = { exports: {} };
|
|
|
1172
1173
|
}, e);
|
|
1173
1174
|
}, z.prototype.offset = function(e) {
|
|
1174
1175
|
var t = this._ctx;
|
|
1175
|
-
return e <= 0 || (t.offset += e,
|
|
1176
|
+
return e <= 0 || (t.offset += e, et(t) ? pn(t, function() {
|
|
1176
1177
|
var n = e;
|
|
1177
1178
|
return function(r, i) {
|
|
1178
1179
|
return n === 0 || (n === 1 ? --n : i(function() {
|
|
@@ -1238,9 +1239,9 @@ var Rr = { exports: {} };
|
|
|
1238
1239
|
}).then(e);
|
|
1239
1240
|
}, z.prototype.primaryKeys = function(e) {
|
|
1240
1241
|
var t = this._ctx;
|
|
1241
|
-
if (t.dir === "next" &&
|
|
1242
|
+
if (t.dir === "next" && et(t, !0) && 0 < t.limit)
|
|
1242
1243
|
return this._read(function(r) {
|
|
1243
|
-
var i =
|
|
1244
|
+
var i = jt(t, t.table.core.schema);
|
|
1244
1245
|
return t.table.core.query({ trans: r, values: !1, limit: t.limit, query: { index: i, range: t.range } });
|
|
1245
1246
|
}).then(function(r) {
|
|
1246
1247
|
return r.result;
|
|
@@ -1297,7 +1298,7 @@ var Rr = { exports: {} };
|
|
|
1297
1298
|
var G = O[D], F = { value: Ae(G), primKey: g[S + D] };
|
|
1298
1299
|
s.call(F, F.value, F) !== !1 && (F.value == null ? R.push(g[S + D]) : b || $(c(G), c(F.value)) === 0 ? (C.push(F.value), b && A.push(g[S + D])) : (R.push(g[S + D]), k.push(F.value)));
|
|
1299
1300
|
}
|
|
1300
|
-
var Y =
|
|
1301
|
+
var Y = et(n) && n.limit === 1 / 0 && (typeof e != "function" || e === gn) && { index: n.index, range: n.range };
|
|
1301
1302
|
return Promise.resolve(0 < k.length && h.mutate({ trans: r, type: "add", values: k }).then(function(W) {
|
|
1302
1303
|
for (var Q in W.failures)
|
|
1303
1304
|
R.splice(parseInt(Q), 1);
|
|
@@ -1317,20 +1318,20 @@ var Rr = { exports: {} };
|
|
|
1317
1318
|
}
|
|
1318
1319
|
return _(0).then(function() {
|
|
1319
1320
|
if (0 < p.length)
|
|
1320
|
-
throw new
|
|
1321
|
+
throw new St("Error modifying one or more objects", p, m, w);
|
|
1321
1322
|
return g.length;
|
|
1322
1323
|
});
|
|
1323
1324
|
});
|
|
1324
1325
|
});
|
|
1325
1326
|
}, z.prototype.delete = function() {
|
|
1326
1327
|
var e = this._ctx, t = e.range;
|
|
1327
|
-
return
|
|
1328
|
+
return et(e) && (e.isPrimKey || t.type === 3) ? this._write(function(n) {
|
|
1328
1329
|
var r = e.table.core.schema.primaryKey, i = t;
|
|
1329
1330
|
return e.table.core.count({ trans: n, query: { index: r, range: i } }).then(function(a) {
|
|
1330
1331
|
return e.table.core.mutate({ trans: n, type: "deleteRange", range: i }).then(function(s) {
|
|
1331
1332
|
var u = s.failures;
|
|
1332
1333
|
if (s.lastResult, s.results, s = s.numFailures, s)
|
|
1333
|
-
throw new
|
|
1334
|
+
throw new St("Could not delete some values", Object.keys(u).map(function(h) {
|
|
1334
1335
|
return u[h];
|
|
1335
1336
|
}), a - s);
|
|
1336
1337
|
return a - s;
|
|
@@ -1343,21 +1344,21 @@ var Rr = { exports: {} };
|
|
|
1343
1344
|
var gn = function(e, t) {
|
|
1344
1345
|
return t.value = null;
|
|
1345
1346
|
};
|
|
1346
|
-
function
|
|
1347
|
+
function ai(e, t) {
|
|
1347
1348
|
return e < t ? -1 : e === t ? 0 : 1;
|
|
1348
1349
|
}
|
|
1349
|
-
function
|
|
1350
|
+
function si(e, t) {
|
|
1350
1351
|
return t < e ? -1 : e === t ? 0 : 1;
|
|
1351
1352
|
}
|
|
1352
1353
|
function ce(e, t, n) {
|
|
1353
1354
|
return e = e instanceof pr ? new e.Collection(e) : e, e._ctx.error = new (n || TypeError)(t), e;
|
|
1354
1355
|
}
|
|
1355
|
-
function
|
|
1356
|
+
function tt(e) {
|
|
1356
1357
|
return new e.Collection(e, function() {
|
|
1357
1358
|
return hr("");
|
|
1358
1359
|
}).limit(0);
|
|
1359
1360
|
}
|
|
1360
|
-
function
|
|
1361
|
+
function Kt(e, t, n, r) {
|
|
1361
1362
|
var i, a, s, u, h, d, b, c = n.length;
|
|
1362
1363
|
if (!n.every(function(m) {
|
|
1363
1364
|
return typeof m == "string";
|
|
@@ -1372,7 +1373,7 @@ var Rr = { exports: {} };
|
|
|
1372
1373
|
return g.toLowerCase();
|
|
1373
1374
|
} : function(g) {
|
|
1374
1375
|
return g.toUpperCase();
|
|
1375
|
-
}, s = m === "next" ?
|
|
1376
|
+
}, s = m === "next" ? ai : si;
|
|
1376
1377
|
var w = n.map(function(g) {
|
|
1377
1378
|
return { lower: a(g), upper: i(g) };
|
|
1378
1379
|
}).sort(function(g, _) {
|
|
@@ -1425,7 +1426,7 @@ var Rr = { exports: {} };
|
|
|
1425
1426
|
}, enumerable: !1, configurable: !0 }), re.prototype.between = function(e, t, n, r) {
|
|
1426
1427
|
n = n !== !1, r = r === !0;
|
|
1427
1428
|
try {
|
|
1428
|
-
return 0 < this._cmp(e, t) || this._cmp(e, t) === 0 && (n || r) && (!n || !r) ?
|
|
1429
|
+
return 0 < this._cmp(e, t) || this._cmp(e, t) === 0 && (n || r) && (!n || !r) ? tt(this) : new this.Collection(this, function() {
|
|
1429
1430
|
return Re(e, t, !n, !r);
|
|
1430
1431
|
});
|
|
1431
1432
|
} catch {
|
|
@@ -1454,34 +1455,34 @@ var Rr = { exports: {} };
|
|
|
1454
1455
|
}, re.prototype.startsWith = function(e) {
|
|
1455
1456
|
return typeof e != "string" ? ce(this, or) : this.between(e, e + Le, !0, !0);
|
|
1456
1457
|
}, re.prototype.startsWithIgnoreCase = function(e) {
|
|
1457
|
-
return e === "" ? this.startsWith(e) :
|
|
1458
|
+
return e === "" ? this.startsWith(e) : Kt(this, function(t, n) {
|
|
1458
1459
|
return t.indexOf(n[0]) === 0;
|
|
1459
1460
|
}, [e], Le);
|
|
1460
1461
|
}, re.prototype.equalsIgnoreCase = function(e) {
|
|
1461
|
-
return
|
|
1462
|
+
return Kt(this, function(t, n) {
|
|
1462
1463
|
return t === n[0];
|
|
1463
1464
|
}, [e], "");
|
|
1464
1465
|
}, re.prototype.anyOfIgnoreCase = function() {
|
|
1465
|
-
var e = we.apply(
|
|
1466
|
-
return e.length === 0 ?
|
|
1466
|
+
var e = we.apply(He, arguments);
|
|
1467
|
+
return e.length === 0 ? tt(this) : Kt(this, function(t, n) {
|
|
1467
1468
|
return n.indexOf(t) !== -1;
|
|
1468
1469
|
}, e, "");
|
|
1469
1470
|
}, re.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
1470
|
-
var e = we.apply(
|
|
1471
|
-
return e.length === 0 ?
|
|
1471
|
+
var e = we.apply(He, arguments);
|
|
1472
|
+
return e.length === 0 ? tt(this) : Kt(this, function(t, n) {
|
|
1472
1473
|
return n.some(function(r) {
|
|
1473
1474
|
return t.indexOf(r) === 0;
|
|
1474
1475
|
});
|
|
1475
1476
|
}, e, Le);
|
|
1476
1477
|
}, re.prototype.anyOf = function() {
|
|
1477
|
-
var e = this, t = we.apply(
|
|
1478
|
+
var e = this, t = we.apply(He, arguments), n = this._cmp;
|
|
1478
1479
|
try {
|
|
1479
1480
|
t.sort(n);
|
|
1480
1481
|
} catch {
|
|
1481
1482
|
return ce(this, _e);
|
|
1482
1483
|
}
|
|
1483
1484
|
if (t.length === 0)
|
|
1484
|
-
return
|
|
1485
|
+
return tt(this);
|
|
1485
1486
|
var r = new this.Collection(this, function() {
|
|
1486
1487
|
return Re(t[0], t[t.length - 1]);
|
|
1487
1488
|
});
|
|
@@ -1500,7 +1501,7 @@ var Rr = { exports: {} };
|
|
|
1500
1501
|
}, re.prototype.notEqual = function(e) {
|
|
1501
1502
|
return this.inAnyRange([[-1 / 0, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
|
|
1502
1503
|
}, re.prototype.noneOf = function() {
|
|
1503
|
-
var e = we.apply(
|
|
1504
|
+
var e = we.apply(He, arguments);
|
|
1504
1505
|
if (e.length === 0)
|
|
1505
1506
|
return new this.Collection(this);
|
|
1506
1507
|
try {
|
|
@@ -1515,7 +1516,7 @@ var Rr = { exports: {} };
|
|
|
1515
1516
|
}, re.prototype.inAnyRange = function(_, t) {
|
|
1516
1517
|
var n = this, r = this._cmp, i = this._ascending, a = this._descending, s = this._min, u = this._max;
|
|
1517
1518
|
if (_.length === 0)
|
|
1518
|
-
return
|
|
1519
|
+
return tt(this);
|
|
1519
1520
|
if (!_.every(function(S) {
|
|
1520
1521
|
return S[0] !== void 0 && S[1] !== void 0 && i(S[0], S[1]) <= 0;
|
|
1521
1522
|
}))
|
|
@@ -1560,10 +1561,10 @@ var Rr = { exports: {} };
|
|
|
1560
1561
|
}), !1);
|
|
1561
1562
|
}), _;
|
|
1562
1563
|
}, re.prototype.startsWithAnyOf = function() {
|
|
1563
|
-
var e = we.apply(
|
|
1564
|
+
var e = we.apply(He, arguments);
|
|
1564
1565
|
return e.every(function(t) {
|
|
1565
1566
|
return typeof t == "string";
|
|
1566
|
-
}) ? e.length === 0 ?
|
|
1567
|
+
}) ? e.length === 0 ? tt(this) : this.inAnyRange(e.map(function(t) {
|
|
1567
1568
|
return [t, t + Le];
|
|
1568
1569
|
})) : ce(this, "startsWithAnyOf() only works with strings");
|
|
1569
1570
|
}, re);
|
|
@@ -1577,7 +1578,7 @@ var Rr = { exports: {} };
|
|
|
1577
1578
|
function ht(e) {
|
|
1578
1579
|
e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
|
|
1579
1580
|
}
|
|
1580
|
-
var pt = "storagemutated", yn = "x-storagemutated-1", Te = dt(null, pt),
|
|
1581
|
+
var pt = "storagemutated", yn = "x-storagemutated-1", Te = dt(null, pt), ui = (me.prototype._lock = function() {
|
|
1581
1582
|
return rt(!B.global), ++this._reculock, this._reculock !== 1 || B.global || (B.lockOwnerFor = this), this;
|
|
1582
1583
|
}, me.prototype._unlock = function() {
|
|
1583
1584
|
if (rt(!B.global), --this._reculock == 0)
|
|
@@ -1715,11 +1716,11 @@ var Rr = { exports: {} };
|
|
|
1715
1716
|
function yr(e) {
|
|
1716
1717
|
return [].slice.call(e);
|
|
1717
1718
|
}
|
|
1718
|
-
var
|
|
1719
|
+
var ci = 0;
|
|
1719
1720
|
function yt(e) {
|
|
1720
1721
|
return e == null ? ":id" : typeof e == "string" ? e : "[".concat(e.join("+"), "]");
|
|
1721
1722
|
}
|
|
1722
|
-
function
|
|
1723
|
+
function li(e, t, h) {
|
|
1723
1724
|
function r(g) {
|
|
1724
1725
|
if (g.type === 3)
|
|
1725
1726
|
return null;
|
|
@@ -1742,8 +1743,8 @@ var Rr = { exports: {} };
|
|
|
1742
1743
|
throw new Error("Given keys array must have same length as given values array.");
|
|
1743
1744
|
if (F === 0)
|
|
1744
1745
|
return k({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
1745
|
-
function Y(
|
|
1746
|
-
++le, ht(
|
|
1746
|
+
function Y(ue) {
|
|
1747
|
+
++le, ht(ue);
|
|
1747
1748
|
}
|
|
1748
1749
|
var W = [], Q = [], le = 0;
|
|
1749
1750
|
if (_ === "deleteRange") {
|
|
@@ -1759,16 +1760,16 @@ var Rr = { exports: {} };
|
|
|
1759
1760
|
for (ae = 0; ae < F; ++ae)
|
|
1760
1761
|
W.push(G = A[_](U[ae])), G.onerror = Y;
|
|
1761
1762
|
}
|
|
1762
|
-
function
|
|
1763
|
-
|
|
1763
|
+
function Vt(ue) {
|
|
1764
|
+
ue = ue.target.result, W.forEach(function(ze, Nn) {
|
|
1764
1765
|
return ze.error != null && (Q[Nn] = ze.error);
|
|
1765
1766
|
}), k({ numFailures: le, failures: Q, results: _ === "delete" ? S : W.map(function(ze) {
|
|
1766
1767
|
return ze.result;
|
|
1767
|
-
}), lastResult:
|
|
1768
|
+
}), lastResult: ue });
|
|
1768
1769
|
}
|
|
1769
|
-
G.onerror = function(
|
|
1770
|
-
Y(
|
|
1771
|
-
}, G.onsuccess =
|
|
1770
|
+
G.onerror = function(ue) {
|
|
1771
|
+
Y(ue), Vt(ue);
|
|
1772
|
+
}, G.onsuccess = Vt;
|
|
1772
1773
|
});
|
|
1773
1774
|
}, getMany: function(w) {
|
|
1774
1775
|
var g = w.trans, _ = w.keys;
|
|
@@ -1809,7 +1810,7 @@ var Rr = { exports: {} };
|
|
|
1809
1810
|
var D = S.index, A = S.range, R = g.objectStore(m), R = D.isPrimaryKey ? R : R.index(D.name), D = E ? O ? "prevunique" : "prev" : O ? "nextunique" : "next", G = !_ && "openKeyCursor" in R ? R.openKeyCursor(r(A), D) : R.openCursor(r(A), D);
|
|
1810
1811
|
G.onerror = ye(C), G.onsuccess = J(function(F) {
|
|
1811
1812
|
var Y, W, Q, le, U = G.result;
|
|
1812
|
-
U ? (U.___id = ++
|
|
1813
|
+
U ? (U.___id = ++ci, U.done = !1, Y = U.continue.bind(U), W = (W = U.continuePrimaryKey) && W.bind(U), Q = U.advance.bind(U), le = function() {
|
|
1813
1814
|
throw new Error("Cursor not stopped");
|
|
1814
1815
|
}, U.trans = g, U.stop = U.continue = U.continuePrimaryKey = U.advance = function() {
|
|
1815
1816
|
throw new Error("Cursor not started");
|
|
@@ -1825,22 +1826,22 @@ var Rr = { exports: {} };
|
|
|
1825
1826
|
if (G.result)
|
|
1826
1827
|
try {
|
|
1827
1828
|
Ee();
|
|
1828
|
-
} catch (
|
|
1829
|
-
U.fail(
|
|
1829
|
+
} catch (ue) {
|
|
1830
|
+
U.fail(ue);
|
|
1830
1831
|
}
|
|
1831
1832
|
else
|
|
1832
1833
|
U.done = !0, U.start = function() {
|
|
1833
1834
|
throw new Error("Cursor behind last entry");
|
|
1834
1835
|
}, U.stop();
|
|
1835
1836
|
}
|
|
1836
|
-
var
|
|
1837
|
-
|
|
1838
|
-
U.stop = U.continue = U.continuePrimaryKey = U.advance = le,
|
|
1837
|
+
var Vt = new Promise(function(ue, ze) {
|
|
1838
|
+
ue = J(ue), G.onerror = ye(ze), U.fail = ze, U.stop = function(Nn) {
|
|
1839
|
+
U.stop = U.continue = U.continuePrimaryKey = U.advance = le, ue(Nn);
|
|
1839
1840
|
};
|
|
1840
1841
|
});
|
|
1841
|
-
return G.onsuccess = J(function(
|
|
1842
|
+
return G.onsuccess = J(function(ue) {
|
|
1842
1843
|
G.onsuccess = ae, ae();
|
|
1843
|
-
}), U.continue = Y, U.continuePrimaryKey = W, U.advance = Q, ae(),
|
|
1844
|
+
}), U.continue = Y, U.continuePrimaryKey = W, U.advance = Q, ae(), Vt;
|
|
1844
1845
|
}, k(U)) : k(null);
|
|
1845
1846
|
}, C);
|
|
1846
1847
|
});
|
|
@@ -1875,14 +1876,14 @@ var Rr = { exports: {} };
|
|
|
1875
1876
|
return c[f];
|
|
1876
1877
|
}, MIN_KEY: -1 / 0, MAX_KEY: gt(t), schema: h };
|
|
1877
1878
|
}
|
|
1878
|
-
function
|
|
1879
|
+
function di(e, t, n, r) {
|
|
1879
1880
|
var i = n.IDBKeyRange;
|
|
1880
|
-
return n.indexedDB, { dbcore: (r =
|
|
1881
|
+
return n.indexedDB, { dbcore: (r = li(t, i, r), e.dbcore.reduce(function(a, s) {
|
|
1881
1882
|
return s = s.create, y(y({}, a), s(a));
|
|
1882
1883
|
}, r)) };
|
|
1883
1884
|
}
|
|
1884
|
-
function
|
|
1885
|
-
var n = r.db, r =
|
|
1885
|
+
function Bt(e, r) {
|
|
1886
|
+
var n = r.db, r = di(e._middlewares, n, e._deps, r);
|
|
1886
1887
|
e.core = r.dbcore, e.tables.forEach(function(i) {
|
|
1887
1888
|
var a = i.name;
|
|
1888
1889
|
e.core.schema.tables.some(function(s) {
|
|
@@ -1890,12 +1891,12 @@ var Rr = { exports: {} };
|
|
|
1890
1891
|
}) && (i.core = e.core.table(a), e[a] instanceof e.Table && (e[a].core = i.core));
|
|
1891
1892
|
});
|
|
1892
1893
|
}
|
|
1893
|
-
function
|
|
1894
|
+
function Nt(e, t, n, r) {
|
|
1894
1895
|
n.forEach(function(i) {
|
|
1895
1896
|
var a = r[i];
|
|
1896
1897
|
t.forEach(function(s) {
|
|
1897
1898
|
var u = function h(d, b) {
|
|
1898
|
-
return
|
|
1899
|
+
return Ur(d, b) || (d = te(d)) && h(d, b);
|
|
1899
1900
|
}(s, i);
|
|
1900
1901
|
(!u || "value" in u && u.value === void 0) && (s === e.Transaction.prototype || s instanceof e.Transaction ? ke(s, i, { get: function() {
|
|
1901
1902
|
return this.table(i);
|
|
@@ -1911,25 +1912,25 @@ var Rr = { exports: {} };
|
|
|
1911
1912
|
n[r] instanceof e.Table && delete n[r];
|
|
1912
1913
|
});
|
|
1913
1914
|
}
|
|
1914
|
-
function
|
|
1915
|
+
function fi(e, t) {
|
|
1915
1916
|
return e._cfg.version - t._cfg.version;
|
|
1916
1917
|
}
|
|
1917
|
-
function
|
|
1918
|
+
function hi(e, t, n, r) {
|
|
1918
1919
|
var i = e._dbSchema;
|
|
1919
1920
|
n.objectStoreNames.contains("$meta") && !i.$meta && (i.$meta = bn("$meta", br("")[0], []), e._storeNames.push("$meta"));
|
|
1920
1921
|
var a = e._createTransaction("readwrite", e._storeNames, i);
|
|
1921
1922
|
a.create(n), a._completion.catch(r);
|
|
1922
1923
|
var s = a._reject.bind(a), u = B.transless || B;
|
|
1923
1924
|
Pe(function() {
|
|
1924
|
-
return B.trans = a, B.transless = u, t !== 0 ? (
|
|
1925
|
+
return B.trans = a, B.transless = u, t !== 0 ? (Bt(e, n), d = t, ((h = a).storeNames.includes("$meta") ? h.table("$meta").get("version").then(function(b) {
|
|
1925
1926
|
return b ?? d;
|
|
1926
1927
|
}) : T.resolve(d)).then(function(b) {
|
|
1927
|
-
return f = b, p = a, m = n, w = [], b = (c = e)._versions, g = c._dbSchema =
|
|
1928
|
+
return f = b, p = a, m = n, w = [], b = (c = e)._versions, g = c._dbSchema = Lt(0, c.idbdb, m), (b = b.filter(function(_) {
|
|
1928
1929
|
return _._cfg.version >= f;
|
|
1929
1930
|
})).length !== 0 ? (b.forEach(function(_) {
|
|
1930
1931
|
w.push(function() {
|
|
1931
1932
|
var S = g, E = _._cfg.dbschema;
|
|
1932
|
-
|
|
1933
|
+
Ft(c, S, m), Ft(c, E, m), g = c._dbSchema = E;
|
|
1933
1934
|
var O = _n(S, E);
|
|
1934
1935
|
O.add.forEach(function(D) {
|
|
1935
1936
|
Sn(m, D[0], D[1].primKey, D[1].indexes);
|
|
@@ -1938,22 +1939,22 @@ var Rr = { exports: {} };
|
|
|
1938
1939
|
throw new L.Upgrade("Not yet support for changing primary key");
|
|
1939
1940
|
var G = m.objectStore(D.name);
|
|
1940
1941
|
D.add.forEach(function(F) {
|
|
1941
|
-
return
|
|
1942
|
+
return Gt(G, F);
|
|
1942
1943
|
}), D.change.forEach(function(F) {
|
|
1943
|
-
G.deleteIndex(F.name),
|
|
1944
|
+
G.deleteIndex(F.name), Gt(G, F);
|
|
1944
1945
|
}), D.del.forEach(function(F) {
|
|
1945
1946
|
return G.deleteIndex(F);
|
|
1946
1947
|
});
|
|
1947
1948
|
});
|
|
1948
1949
|
var k = _._cfg.contentUpgrade;
|
|
1949
1950
|
if (k && _._cfg.version > f) {
|
|
1950
|
-
|
|
1951
|
+
Bt(c, m), p._memoizedTables = {};
|
|
1951
1952
|
var C = Qn(E);
|
|
1952
1953
|
O.del.forEach(function(D) {
|
|
1953
1954
|
C[D] = S[D];
|
|
1954
|
-
}), wn(c, [c.Transaction.prototype]),
|
|
1955
|
+
}), wn(c, [c.Transaction.prototype]), Nt(c, [c.Transaction.prototype], M(C), C), p.schema = C;
|
|
1955
1956
|
var A, R = qt(k);
|
|
1956
|
-
return R &&
|
|
1957
|
+
return R && Ze(), O = T.follow(function() {
|
|
1957
1958
|
var D;
|
|
1958
1959
|
(A = k(p)) && R && (D = Ie.bind(null, null), A.then(D, D));
|
|
1959
1960
|
}), A && typeof A.then == "function" ? T.resolve(A) : O.then(function() {
|
|
@@ -1964,7 +1965,7 @@ var Rr = { exports: {} };
|
|
|
1964
1965
|
var E, O, k = _._cfg.dbschema;
|
|
1965
1966
|
E = k, O = S, [].slice.call(O.db.objectStoreNames).forEach(function(C) {
|
|
1966
1967
|
return E[C] == null && O.db.deleteObjectStore(C);
|
|
1967
|
-
}), wn(c, [c.Transaction.prototype]),
|
|
1968
|
+
}), wn(c, [c.Transaction.prototype]), Nt(c, [c.Transaction.prototype], c._storeNames, c._dbSchema), p.schema = c._dbSchema;
|
|
1968
1969
|
}), w.push(function(S) {
|
|
1969
1970
|
c.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(c.idbdb.version / 10) === _._cfg.version ? (c.idbdb.deleteObjectStore("$meta"), delete c._dbSchema.$meta, c._storeNames = c._storeNames.filter(function(E) {
|
|
1970
1971
|
return E !== "$meta";
|
|
@@ -1978,23 +1979,23 @@ var Rr = { exports: {} };
|
|
|
1978
1979
|
var c, f, p, m, w, g;
|
|
1979
1980
|
}).catch(s)) : (M(i).forEach(function(b) {
|
|
1980
1981
|
Sn(n, b, i[b].primKey, i[b].indexes);
|
|
1981
|
-
}),
|
|
1982
|
+
}), Bt(e, n), void T.follow(function() {
|
|
1982
1983
|
return e.on.populate.fire(a);
|
|
1983
1984
|
}).catch(s));
|
|
1984
1985
|
var h, d;
|
|
1985
1986
|
});
|
|
1986
1987
|
}
|
|
1987
|
-
function
|
|
1988
|
+
function pi(e, t) {
|
|
1988
1989
|
mr(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");
|
|
1989
|
-
var n =
|
|
1990
|
-
|
|
1990
|
+
var n = Lt(0, e.idbdb, t);
|
|
1991
|
+
Ft(e, e._dbSchema, t);
|
|
1991
1992
|
for (var r = 0, i = _n(n, e._dbSchema).change; r < i.length; r++) {
|
|
1992
1993
|
var a = function(s) {
|
|
1993
1994
|
if (s.change.length || s.recreate)
|
|
1994
1995
|
return console.warn("Unable to patch indexes of table ".concat(s.name, " because it has changes on the type of index or primary key.")), { value: void 0 };
|
|
1995
1996
|
var u = t.objectStore(s.name);
|
|
1996
1997
|
s.add.forEach(function(h) {
|
|
1997
|
-
pe && console.debug("Dexie upgrade patch: Creating missing index ".concat(s.name, ".").concat(h.src)),
|
|
1998
|
+
pe && console.debug("Dexie upgrade patch: Creating missing index ".concat(s.name, ".").concat(h.src)), Gt(u, h);
|
|
1998
1999
|
});
|
|
1999
2000
|
}(i[r]);
|
|
2000
2001
|
if (typeof a == "object")
|
|
@@ -2029,7 +2030,7 @@ var Rr = { exports: {} };
|
|
|
2029
2030
|
function Sn(e, t, n, r) {
|
|
2030
2031
|
var i = e.db.createObjectStore(t, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
|
|
2031
2032
|
return r.forEach(function(a) {
|
|
2032
|
-
return
|
|
2033
|
+
return Gt(i, a);
|
|
2033
2034
|
}), i;
|
|
2034
2035
|
}
|
|
2035
2036
|
function mr(e, t) {
|
|
@@ -2037,12 +2038,12 @@ var Rr = { exports: {} };
|
|
|
2037
2038
|
t.db.objectStoreNames.contains(n) || (pe && console.debug("Dexie: Creating missing table", n), Sn(t, n, e[n].primKey, e[n].indexes));
|
|
2038
2039
|
});
|
|
2039
2040
|
}
|
|
2040
|
-
function
|
|
2041
|
+
function Gt(e, t) {
|
|
2041
2042
|
e.createIndex(t.name, t.keyPath, { unique: t.unique, multiEntry: t.multi });
|
|
2042
2043
|
}
|
|
2043
|
-
function
|
|
2044
|
+
function Lt(e, t, n) {
|
|
2044
2045
|
var r = {};
|
|
2045
|
-
return
|
|
2046
|
+
return _t(t.objectStoreNames, 0).forEach(function(i) {
|
|
2046
2047
|
for (var a = n.objectStore(i), s = mn(gr(d = a.keyPath), d || "", !0, !1, !!a.autoIncrement, d && typeof d != "string", !0), u = [], h = 0; h < a.indexNames.length; ++h) {
|
|
2047
2048
|
var b = a.index(a.indexNames[h]), d = b.keyPath, b = mn(b.name, d, !!b.unique, !!b.multiEntry, !1, d && typeof d != "string", !1);
|
|
2048
2049
|
u.push(b);
|
|
@@ -2050,12 +2051,12 @@ var Rr = { exports: {} };
|
|
|
2050
2051
|
r[i] = bn(i, s, u);
|
|
2051
2052
|
}), r;
|
|
2052
2053
|
}
|
|
2053
|
-
function
|
|
2054
|
+
function Ft(e, t, n) {
|
|
2054
2055
|
for (var r = n.db.objectStoreNames, i = 0; i < r.length; ++i) {
|
|
2055
2056
|
var a = r[i], s = n.objectStore(a);
|
|
2056
2057
|
e._hasGetAll = "getAll" in s;
|
|
2057
2058
|
for (var u = 0; u < s.indexNames.length; ++u) {
|
|
2058
|
-
var h = s.indexNames[u], d = s.index(h).keyPath, b = typeof d == "string" ? d : "[" +
|
|
2059
|
+
var h = s.indexNames[u], d = s.index(h).keyPath, b = typeof d == "string" ? d : "[" + _t(d).join("+") + "]";
|
|
2059
2060
|
!t[a] || (d = t[a].idxByName[b]) && (d.name = h, delete t[a].idxByName[b], t[a].idxByName[h] = d);
|
|
2060
2061
|
}
|
|
2061
2062
|
}
|
|
@@ -2067,7 +2068,7 @@ var Rr = { exports: {} };
|
|
|
2067
2068
|
return mn(r, i || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t), N(i), n === 0);
|
|
2068
2069
|
});
|
|
2069
2070
|
}
|
|
2070
|
-
var
|
|
2071
|
+
var gi = (Ut.prototype._parseStoresSpec = function(e, t) {
|
|
2071
2072
|
M(e).forEach(function(n) {
|
|
2072
2073
|
if (e[n] !== null) {
|
|
2073
2074
|
var r = br(e[n]), i = r.shift();
|
|
@@ -2081,21 +2082,21 @@ var Rr = { exports: {} };
|
|
|
2081
2082
|
}), t[n] = bn(n, i, r);
|
|
2082
2083
|
}
|
|
2083
2084
|
});
|
|
2084
|
-
},
|
|
2085
|
+
}, Ut.prototype.stores = function(n) {
|
|
2085
2086
|
var t = this.db;
|
|
2086
2087
|
this._cfg.storesSource = this._cfg.storesSource ? Z(this._cfg.storesSource, n) : n;
|
|
2087
2088
|
var n = t._versions, r = {}, i = {};
|
|
2088
2089
|
return n.forEach(function(a) {
|
|
2089
2090
|
Z(r, a._cfg.storesSource), i = a._cfg.dbschema = {}, a._parseStoresSpec(r, i);
|
|
2090
|
-
}), t._dbSchema = i, wn(t, [t._allTables, t, t.Transaction.prototype]),
|
|
2091
|
-
},
|
|
2091
|
+
}), t._dbSchema = i, wn(t, [t._allTables, t, t.Transaction.prototype]), Nt(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], M(i), i), t._storeNames = M(i), this;
|
|
2092
|
+
}, Ut.prototype.upgrade = function(e) {
|
|
2092
2093
|
return this._cfg.contentUpgrade = tn(this._cfg.contentUpgrade || H, e), this;
|
|
2093
|
-
},
|
|
2094
|
-
function
|
|
2094
|
+
}, Ut);
|
|
2095
|
+
function Ut() {
|
|
2095
2096
|
}
|
|
2096
2097
|
function En(e, t) {
|
|
2097
2098
|
var n = e._dbNamesDB;
|
|
2098
|
-
return n || (n = e._dbNamesDB = new Se(
|
|
2099
|
+
return n || (n = e._dbNamesDB = new Se(Rt, { addons: [], indexedDB: e, IDBKeyRange: t })).version(1).stores({ dbnames: "name" }), n.table("dbnames");
|
|
2099
2100
|
}
|
|
2100
2101
|
function On(e) {
|
|
2101
2102
|
return e && typeof e.databases == "function";
|
|
@@ -2136,7 +2137,7 @@ var Rr = { exports: {} };
|
|
|
2136
2137
|
mt(r, a, s), u && n(r, u), h && n(r, h);
|
|
2137
2138
|
}(e, t);
|
|
2138
2139
|
}
|
|
2139
|
-
function
|
|
2140
|
+
function Wt(e, t) {
|
|
2140
2141
|
var n = An(t), r = n.next();
|
|
2141
2142
|
if (r.done)
|
|
2142
2143
|
return !1;
|
|
@@ -2181,7 +2182,7 @@ var Rr = { exports: {} };
|
|
|
2181
2182
|
var t = n.r, n = n.l;
|
|
2182
2183
|
return (t ? n ? Math.max(t.d, n.d) : t.d : n ? n.d : 0) + 1;
|
|
2183
2184
|
}
|
|
2184
|
-
function
|
|
2185
|
+
function zt(e, t) {
|
|
2185
2186
|
return M(t).forEach(function(n) {
|
|
2186
2187
|
e[n] ? bt(e[n], t[n]) : e[n] = function r(i) {
|
|
2187
2188
|
var a, s, u = {};
|
|
@@ -2193,7 +2194,7 @@ var Rr = { exports: {} };
|
|
|
2193
2194
|
}
|
|
2194
2195
|
function Dn(e, t) {
|
|
2195
2196
|
return e.all || t.all || Object.keys(e).some(function(n) {
|
|
2196
|
-
return t[n] &&
|
|
2197
|
+
return t[n] && Wt(t[n], e[n]);
|
|
2197
2198
|
});
|
|
2198
2199
|
}
|
|
2199
2200
|
xe(oe.prototype, ((fe = { add: function(e) {
|
|
@@ -2209,8 +2210,8 @@ var Rr = { exports: {} };
|
|
|
2209
2210
|
return An(this);
|
|
2210
2211
|
}, fe));
|
|
2211
2212
|
var Ue = {}, Pn = {}, In = !1;
|
|
2212
|
-
function
|
|
2213
|
-
|
|
2213
|
+
function $t(e) {
|
|
2214
|
+
zt(Pn, e), In || (In = !0, setTimeout(function() {
|
|
2214
2215
|
In = !1, Cn(Pn, !(Pn = {}));
|
|
2215
2216
|
}, 0));
|
|
2216
2217
|
}
|
|
@@ -2245,7 +2246,7 @@ var Rr = { exports: {} };
|
|
|
2245
2246
|
e.queries.query[h] = d;
|
|
2246
2247
|
}
|
|
2247
2248
|
}
|
|
2248
|
-
function
|
|
2249
|
+
function yi(e) {
|
|
2249
2250
|
var t = e._state, n = e._deps.indexedDB;
|
|
2250
2251
|
if (t.isBeingOpened || e.idbdb)
|
|
2251
2252
|
return t.dbReadyPromise.then(function() {
|
|
@@ -2268,27 +2269,27 @@ var Rr = { exports: {} };
|
|
|
2268
2269
|
var _;
|
|
2269
2270
|
b = w.transaction, t.autoSchema && !e._options.allowEmptyDB ? (w.onerror = ht, b.abort(), w.result.close(), (_ = n.deleteDatabase(m)).onsuccess = _.onerror = J(function() {
|
|
2270
2271
|
p(new L.NoSuchDatabase("Database ".concat(m, " doesnt exist")));
|
|
2271
|
-
})) : (b.onerror = ye(p), g = g.oldVersion > Math.pow(2, 62) ? 0 : g.oldVersion, c = g < 1, e.idbdb = w.result, a &&
|
|
2272
|
+
})) : (b.onerror = ye(p), g = g.oldVersion > Math.pow(2, 62) ? 0 : g.oldVersion, c = g < 1, e.idbdb = w.result, a && pi(e, b), hi(e, g / 10, b, p));
|
|
2272
2273
|
}, p), w.onsuccess = J(function() {
|
|
2273
2274
|
b = null;
|
|
2274
|
-
var g, _, S, E, O, k = e.idbdb = w.result, C =
|
|
2275
|
+
var g, _, S, E, O, k = e.idbdb = w.result, C = _t(k.objectStoreNames);
|
|
2275
2276
|
if (0 < C.length)
|
|
2276
2277
|
try {
|
|
2277
2278
|
var A = k.transaction((E = C).length === 1 ? E[0] : E, "readonly");
|
|
2278
2279
|
if (t.autoSchema)
|
|
2279
|
-
_ = k, S = A, (g = e).verno = _.version / 10, S = g._dbSchema =
|
|
2280
|
-
else if (
|
|
2280
|
+
_ = k, S = A, (g = e).verno = _.version / 10, S = g._dbSchema = Lt(0, _, S), g._storeNames = _t(_.objectStoreNames, 0), Nt(g, [g._allTables], M(S), S);
|
|
2281
|
+
else if (Ft(e, e._dbSchema, A), ((O = _n(Lt(0, (O = e).idbdb, A), O._dbSchema)).add.length || O.change.some(function(R) {
|
|
2281
2282
|
return R.add.length || R.change.length;
|
|
2282
2283
|
})) && !a)
|
|
2283
2284
|
return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), k.close(), i = k.version + 1, a = !0, f(u());
|
|
2284
|
-
|
|
2285
|
+
Bt(e, A);
|
|
2285
2286
|
} catch {
|
|
2286
2287
|
}
|
|
2287
|
-
|
|
2288
|
+
qe.push(e), k.onversionchange = J(function(R) {
|
|
2288
2289
|
t.vcFired = !0, e.on("versionchange").fire(R);
|
|
2289
2290
|
}), k.onclose = J(function(R) {
|
|
2290
2291
|
e.on("close").fire(R);
|
|
2291
|
-
}), c && (O = e._deps, A = m, k = O.indexedDB, O = O.IDBKeyRange, On(k) || A ===
|
|
2292
|
+
}), c && (O = e._deps, A = m, k = O.indexedDB, O = O.IDBKeyRange, On(k) || A === Rt || En(k, O).put({ name: A }).catch(H)), f();
|
|
2292
2293
|
}, p);
|
|
2293
2294
|
}).catch(function(f) {
|
|
2294
2295
|
switch (f == null ? void 0 : f.name) {
|
|
@@ -2357,12 +2358,12 @@ var Rr = { exports: {} };
|
|
|
2357
2358
|
}
|
|
2358
2359
|
return i(t)();
|
|
2359
2360
|
}
|
|
2360
|
-
function
|
|
2361
|
+
function Yt(e, t, n) {
|
|
2361
2362
|
for (var r = N(e) ? e.slice() : [e], i = 0; i < n; ++i)
|
|
2362
2363
|
r.push(t);
|
|
2363
2364
|
return r;
|
|
2364
2365
|
}
|
|
2365
|
-
var
|
|
2366
|
+
var mi = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2366
2367
|
return y(y({}, e), { table: function(t) {
|
|
2367
2368
|
var n = e.table(t), r = n.schema, i = {}, a = [];
|
|
2368
2369
|
function s(c, f, p) {
|
|
@@ -2378,7 +2379,7 @@ var Rr = { exports: {} };
|
|
|
2378
2379
|
}
|
|
2379
2380
|
function b(c) {
|
|
2380
2381
|
var f, p = c.query.index;
|
|
2381
|
-
return p.isVirtual ? y(y({}, c), { query: { index: p.lowLevelIndex, range: (f = c.query.range, p = p.keyTail, { type: f.type === 1 ? 2 : f.type, lower:
|
|
2382
|
+
return p.isVirtual ? y(y({}, c), { query: { index: p.lowLevelIndex, range: (f = c.query.range, p = p.keyTail, { type: f.type === 1 ? 2 : f.type, lower: Yt(f.lower, f.lowerOpen ? e.MAX_KEY : e.MIN_KEY, p), lowerOpen: !0, upper: Yt(f.upper, f.upperOpen ? e.MIN_KEY : e.MAX_KEY, p), upperOpen: !0 }) } }) : c;
|
|
2382
2383
|
}
|
|
2383
2384
|
return y(y({}, n), { schema: y(y({}, r), { primaryKey: t, indexes: a, getIndexByKeyPath: function(c) {
|
|
2384
2385
|
return (c = i[yt(c)]) && c[0];
|
|
@@ -2393,9 +2394,9 @@ var Rr = { exports: {} };
|
|
|
2393
2394
|
}) : n.openCursor(c);
|
|
2394
2395
|
function g(_) {
|
|
2395
2396
|
return Object.create(_, { continue: { value: function(S) {
|
|
2396
|
-
S != null ? _.continue(
|
|
2397
|
+
S != null ? _.continue(Yt(S, c.reverse ? e.MAX_KEY : e.MIN_KEY, p)) : c.unique ? _.continue(_.key.slice(0, w).concat(c.reverse ? e.MIN_KEY : e.MAX_KEY, p)) : _.continue();
|
|
2397
2398
|
} }, continuePrimaryKey: { value: function(S, E) {
|
|
2398
|
-
_.continuePrimaryKey(
|
|
2399
|
+
_.continuePrimaryKey(Yt(S, e.MAX_KEY, p), E);
|
|
2399
2400
|
} }, primaryKey: { get: function() {
|
|
2400
2401
|
return _.primaryKey;
|
|
2401
2402
|
} }, key: { get: function() {
|
|
@@ -2419,7 +2420,7 @@ var Rr = { exports: {} };
|
|
|
2419
2420
|
function jn(e, t) {
|
|
2420
2421
|
return t.type === "delete" ? t.keys : t.keys || t.values.map(e.extractKey);
|
|
2421
2422
|
}
|
|
2422
|
-
var
|
|
2423
|
+
var bi = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
2423
2424
|
return y(y({}, e), { table: function(t) {
|
|
2424
2425
|
var n = e.table(t), r = n.schema.primaryKey;
|
|
2425
2426
|
return y(y({}, n), { mutate: function(i) {
|
|
@@ -2496,7 +2497,7 @@ var Rr = { exports: {} };
|
|
|
2496
2497
|
return null;
|
|
2497
2498
|
}
|
|
2498
2499
|
}
|
|
2499
|
-
var
|
|
2500
|
+
var vi = { stack: "dbcore", level: -1, create: function(e) {
|
|
2500
2501
|
return { table: function(t) {
|
|
2501
2502
|
var n = e.table(t);
|
|
2502
2503
|
return y(y({}, n), { getMany: function(r) {
|
|
@@ -2525,7 +2526,7 @@ var Rr = { exports: {} };
|
|
|
2525
2526
|
return !1;
|
|
2526
2527
|
}
|
|
2527
2528
|
}
|
|
2528
|
-
var
|
|
2529
|
+
var wi = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2529
2530
|
var t = e.schema.name, n = new oe(e.MIN_KEY, e.MAX_KEY);
|
|
2530
2531
|
return y(y({}, e), { transaction: function(r, i, a) {
|
|
2531
2532
|
if (B.subscr && i !== "readonly")
|
|
@@ -2560,7 +2561,7 @@ var Rr = { exports: {} };
|
|
|
2560
2561
|
}))) : C ? (A = { from: C.lower, to: C.upper }, O.add(A), E.add(A)) : (E.add(n), O.add(n), s.indexes.forEach(function(D) {
|
|
2561
2562
|
return p(D.name).add(n);
|
|
2562
2563
|
})), a.mutate(f).then(function(D) {
|
|
2563
|
-
return !C || f.type !== "add" && f.type !== "put" || E.addKeys(D.results), _.mutatedParts =
|
|
2564
|
+
return !C || f.type !== "add" && f.type !== "put" || E.addKeys(D.results), _.mutatedParts = zt(_.mutatedParts || {}, S), D;
|
|
2564
2565
|
});
|
|
2565
2566
|
} }), c = { get: function(f) {
|
|
2566
2567
|
return [u, new oe(f.key)];
|
|
@@ -2644,7 +2645,7 @@ var Rr = { exports: {} };
|
|
|
2644
2645
|
var _ = new oe().addKeys(m.values.map(function(k) {
|
|
2645
2646
|
return d(k);
|
|
2646
2647
|
})), w = p.filter(function(k) {
|
|
2647
|
-
return k = t.values ? d(k) : k, !
|
|
2648
|
+
return k = t.values ? d(k) : k, !Wt(new oe(k), _);
|
|
2648
2649
|
}).concat(t.values ? g : g.map(function(k) {
|
|
2649
2650
|
return d(k);
|
|
2650
2651
|
}));
|
|
@@ -2652,7 +2653,7 @@ var Rr = { exports: {} };
|
|
|
2652
2653
|
case "delete":
|
|
2653
2654
|
var S = new oe().addKeys(m.keys);
|
|
2654
2655
|
w = p.filter(function(k) {
|
|
2655
|
-
return k = t.values ? d(k) : k, !
|
|
2656
|
+
return k = t.values ? d(k) : k, !Wt(new oe(k), S);
|
|
2656
2657
|
});
|
|
2657
2658
|
break;
|
|
2658
2659
|
case "deleteRange":
|
|
@@ -2670,7 +2671,7 @@ var Rr = { exports: {} };
|
|
|
2670
2671
|
function Ar(e, t) {
|
|
2671
2672
|
return $(e.lower, t.lower) === 0 && $(e.upper, t.upper) === 0 && !!e.lowerOpen == !!t.lowerOpen && !!e.upperOpen == !!t.upperOpen;
|
|
2672
2673
|
}
|
|
2673
|
-
function
|
|
2674
|
+
function _i(e, t) {
|
|
2674
2675
|
return function(n, r, i, a) {
|
|
2675
2676
|
if (n === void 0)
|
|
2676
2677
|
return r !== void 0 ? -1 : 0;
|
|
@@ -2701,7 +2702,7 @@ var Rr = { exports: {} };
|
|
|
2701
2702
|
return r;
|
|
2702
2703
|
}(e.upper, t.upper, e.upperOpen, t.upperOpen);
|
|
2703
2704
|
}
|
|
2704
|
-
function
|
|
2705
|
+
function Si(e, t, n, r) {
|
|
2705
2706
|
e.subscribers.add(n), r.addEventListener("abort", function() {
|
|
2706
2707
|
var i, a;
|
|
2707
2708
|
e.subscribers.delete(n), e.subscribers.size === 0 && (i = e, a = t, setTimeout(function() {
|
|
@@ -2709,7 +2710,7 @@ var Rr = { exports: {} };
|
|
|
2709
2710
|
}, 3e3));
|
|
2710
2711
|
});
|
|
2711
2712
|
}
|
|
2712
|
-
var
|
|
2713
|
+
var Ei = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
|
|
2713
2714
|
var t = e.schema.name;
|
|
2714
2715
|
return y(y({}, e), { transaction: function(n, r, i) {
|
|
2715
2716
|
var a, s, u = e.transaction(n, r, i);
|
|
@@ -2757,17 +2758,17 @@ var Rr = { exports: {} };
|
|
|
2757
2758
|
var u = Ue["idb://".concat(t, "/").concat(n)];
|
|
2758
2759
|
return u ? (s = r.mutate(a), a.type !== "add" && a.type !== "put" || !(50 <= a.values.length || jn(i, a).some(function(h) {
|
|
2759
2760
|
return h == null;
|
|
2760
|
-
})) ? (u.optimisticOps.push(a), a.mutatedParts &&
|
|
2761
|
-
0 < h.numFailures && (Me(u.optimisticOps, a), (h = xr(0, a, h)) && u.optimisticOps.push(h), a.mutatedParts &&
|
|
2761
|
+
})) ? (u.optimisticOps.push(a), a.mutatedParts && $t(a.mutatedParts), s.then(function(h) {
|
|
2762
|
+
0 < h.numFailures && (Me(u.optimisticOps, a), (h = xr(0, a, h)) && u.optimisticOps.push(h), a.mutatedParts && $t(a.mutatedParts));
|
|
2762
2763
|
}), s.catch(function() {
|
|
2763
|
-
Me(u.optimisticOps, a), a.mutatedParts &&
|
|
2764
|
+
Me(u.optimisticOps, a), a.mutatedParts && $t(a.mutatedParts);
|
|
2764
2765
|
})) : s.then(function(h) {
|
|
2765
2766
|
var d = xr(0, y(y({}, a), { values: a.values.map(function(p, c) {
|
|
2766
2767
|
var f, p = (f = i.keyPath) !== null && f !== void 0 && f.includes(".") ? Ae(p) : y({}, p);
|
|
2767
2768
|
return de(p, i.keyPath, h.results[c]), p;
|
|
2768
2769
|
}) }), h);
|
|
2769
2770
|
u.optimisticOps.push(d), queueMicrotask(function() {
|
|
2770
|
-
return a.mutatedParts &&
|
|
2771
|
+
return a.mutatedParts && $t(a.mutatedParts);
|
|
2771
2772
|
});
|
|
2772
2773
|
}), s) : r.mutate(a);
|
|
2773
2774
|
}, query: function(a) {
|
|
@@ -2788,7 +2789,7 @@ var Rr = { exports: {} };
|
|
|
2788
2789
|
return k.req.limit === _.limit && k.req.values === _.values && Ar(k.req.query.range, _.query.range);
|
|
2789
2790
|
});
|
|
2790
2791
|
return O ? [O, !0, S, E] : [E.find(function(k) {
|
|
2791
|
-
return ("limit" in k.req ? k.req.limit : 1 / 0) >= _.limit && (!_.values || k.req.values) &&
|
|
2792
|
+
return ("limit" in k.req ? k.req.limit : 1 / 0) >= _.limit && (!_.values || k.req.values) && _i(k.req.query.range, _.query.range);
|
|
2792
2793
|
}), !1, S, E];
|
|
2793
2794
|
case "count":
|
|
2794
2795
|
return O = E.find(function(k) {
|
|
@@ -2807,13 +2808,13 @@ var Rr = { exports: {} };
|
|
|
2807
2808
|
return m;
|
|
2808
2809
|
}).catch(function(m) {
|
|
2809
2810
|
return p && b && Me(p, b), Promise.reject(m);
|
|
2810
|
-
}), b = { obsSet: a.obsSet, promise: c, subscribers: /* @__PURE__ */ new Set(), type: "query", req: a, dirty: !1 }, p ? p.push(b) : (p = [b], (f = f || (Ue["idb://".concat(t, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[a.query.index.name || ""] = p)),
|
|
2811
|
+
}), b = { obsSet: a.obsSet, promise: c, subscribers: /* @__PURE__ */ new Set(), type: "query", req: a, dirty: !1 }, p ? p.push(b) : (p = [b], (f = f || (Ue["idb://".concat(t, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[a.query.index.name || ""] = p)), Si(b, p, u, h), b.promise.then(function(m) {
|
|
2811
2812
|
return { result: kr(m.result, a, f == null ? void 0 : f.optimisticOps, r, b, s) };
|
|
2812
2813
|
});
|
|
2813
2814
|
} });
|
|
2814
2815
|
} });
|
|
2815
2816
|
} };
|
|
2816
|
-
function
|
|
2817
|
+
function Ht(e, t) {
|
|
2817
2818
|
return new Proxy(e, { get: function(n, r, i) {
|
|
2818
2819
|
return r === "db" ? t : Reflect.get(n, r, i);
|
|
2819
2820
|
} });
|
|
@@ -2827,7 +2828,7 @@ var Rr = { exports: {} };
|
|
|
2827
2828
|
var t = this._versions, n = t.filter(function(r) {
|
|
2828
2829
|
return r._cfg.version === e;
|
|
2829
2830
|
})[0];
|
|
2830
|
-
return n || (n = new this.Version(e), t.push(n), t.sort(
|
|
2831
|
+
return n || (n = new this.Version(e), t.push(n), t.sort(fi), n.stores({}), this._state.autoSchema = !1, n);
|
|
2831
2832
|
}, ee.prototype._whenReady = function(e) {
|
|
2832
2833
|
var t = this;
|
|
2833
2834
|
return this.idbdb && (this._state.openComplete || B.letThrough || this._vip) ? e() : new T(function(n, r) {
|
|
@@ -2853,11 +2854,11 @@ var Rr = { exports: {} };
|
|
|
2853
2854
|
}, ee.prototype.open = function() {
|
|
2854
2855
|
var e = this;
|
|
2855
2856
|
return Ge(De, function() {
|
|
2856
|
-
return
|
|
2857
|
+
return yi(e);
|
|
2857
2858
|
});
|
|
2858
2859
|
}, ee.prototype._close = function() {
|
|
2859
|
-
var e = this._state, t =
|
|
2860
|
-
if (0 <= t &&
|
|
2860
|
+
var e = this._state, t = qe.indexOf(this);
|
|
2861
|
+
if (0 <= t && qe.splice(t, 1), this.idbdb) {
|
|
2861
2862
|
try {
|
|
2862
2863
|
this.idbdb.close();
|
|
2863
2864
|
} catch {
|
|
@@ -2882,7 +2883,7 @@ var Rr = { exports: {} };
|
|
|
2882
2883
|
var u = t._deps.indexedDB.deleteDatabase(t.name);
|
|
2883
2884
|
u.onsuccess = J(function() {
|
|
2884
2885
|
var h, d, b;
|
|
2885
|
-
h = t._deps, d = t.name, b = h.indexedDB, h = h.IDBKeyRange, On(b) || d ===
|
|
2886
|
+
h = t._deps, d = t.name, b = h.indexedDB, h = h.IDBKeyRange, On(b) || d === Rt || En(b, h).delete(d).catch(H), i();
|
|
2886
2887
|
}), u.onerror = ye(a), u.onblocked = t._fireOnBlocked;
|
|
2887
2888
|
}
|
|
2888
2889
|
if (n)
|
|
@@ -2965,7 +2966,7 @@ var Rr = { exports: {} };
|
|
|
2965
2966
|
})) : q(E);
|
|
2966
2967
|
}
|
|
2967
2968
|
var _, S = qt(m);
|
|
2968
|
-
return S &&
|
|
2969
|
+
return S && Ze(), w = T.follow(function() {
|
|
2969
2970
|
var E;
|
|
2970
2971
|
(_ = m.call(g, g)) && (S ? (E = Ie.bind(null, null), _.then(E, E)) : typeof _.next == "function" && typeof _.throw == "function" && (_ = Rn(_)));
|
|
2971
2972
|
}, w), (_ && typeof _.then == "function" ? T.resolve(_).then(function(E) {
|
|
@@ -3008,7 +3009,7 @@ var Rr = { exports: {} };
|
|
|
3008
3009
|
}));
|
|
3009
3010
|
});
|
|
3010
3011
|
};
|
|
3011
|
-
}), this.Collection = (i = this, ft(
|
|
3012
|
+
}), this.Collection = (i = this, ft(oi.prototype, function(_, g) {
|
|
3012
3013
|
this.db = i;
|
|
3013
3014
|
var p = ar, m = null;
|
|
3014
3015
|
if (g)
|
|
@@ -3020,8 +3021,8 @@ var Rr = { exports: {} };
|
|
|
3020
3021
|
var w = _._ctx, g = w.table, _ = g.hook.reading.fire;
|
|
3021
3022
|
this._ctx = { table: g, index: w.index, isPrimKey: !w.index || g.schema.primKey.keyPath && w.index === g.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: m, or: w.or, valueMapper: _ !== ot ? _ : null };
|
|
3022
3023
|
})), this.Table = (a = this, ft(lr.prototype, function(c, f, p) {
|
|
3023
|
-
this.db = a, this._tx = p, this.name = c, this.schema = f, this.hook = a._allTables[c] ? a._allTables[c].hook : dt(null, { creating: [
|
|
3024
|
-
})), this.Transaction = (s = this, ft(
|
|
3024
|
+
this.db = a, this._tx = p, this.name = c, this.schema = f, this.hook = a._allTables[c] ? a._allTables[c].hook : dt(null, { creating: [Xr, H], reading: [Vr, ot], updating: [Zr, H], deleting: [Jr, H] });
|
|
3025
|
+
})), this.Transaction = (s = this, ft(ui.prototype, function(c, f, p, m, w) {
|
|
3025
3026
|
var g = this;
|
|
3026
3027
|
this.db = s, this.mode = c, this.storeNames = f, this.schema = p, this.chromeTransactionDurability = m, 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 T(function(_, S) {
|
|
3027
3028
|
g._resolve = _, g._reject = S;
|
|
@@ -3031,7 +3032,7 @@ var Rr = { exports: {} };
|
|
|
3031
3032
|
var S = g.active;
|
|
3032
3033
|
return g.active = !1, g.on.error.fire(_), g.parent ? g.parent._reject(_) : S && g.idbtrans && g.idbtrans.abort(), q(_);
|
|
3033
3034
|
});
|
|
3034
|
-
})), this.Version = (u = this, ft(
|
|
3035
|
+
})), this.Version = (u = this, ft(gi.prototype, function(c) {
|
|
3035
3036
|
this.db = u, this._cfg = { version: c, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
3036
3037
|
})), this.WhereClause = (h = this, ft(pr.prototype, function(c, f, p) {
|
|
3037
3038
|
if (this.db = h, this._ctx = { table: c, index: f === ":id" ? null : f, or: p }, this._cmp = this._ascending = $, this._descending = function(m, w) {
|
|
@@ -3049,31 +3050,31 @@ var Rr = { exports: {} };
|
|
|
3049
3050
|
}), this._maxKey = gt(t.IDBKeyRange), this._createTransaction = function(c, f, p, m) {
|
|
3050
3051
|
return new n.Transaction(c, f, p, n._options.chromeTransactionDurability, m);
|
|
3051
3052
|
}, this._fireOnBlocked = function(c) {
|
|
3052
|
-
n.on("blocked").fire(c),
|
|
3053
|
+
n.on("blocked").fire(c), qe.filter(function(f) {
|
|
3053
3054
|
return f.name === n.name && f !== n && !f._state.vcFired;
|
|
3054
3055
|
}).map(function(f) {
|
|
3055
3056
|
return f.on("versionchange").fire(c);
|
|
3056
3057
|
});
|
|
3057
|
-
}, this.use(
|
|
3058
|
+
}, this.use(vi), this.use(Ei), this.use(wi), this.use(mi), this.use(bi);
|
|
3058
3059
|
var b = new Proxy(this, { get: function(c, f, p) {
|
|
3059
3060
|
if (f === "_vip")
|
|
3060
3061
|
return !0;
|
|
3061
3062
|
if (f === "table")
|
|
3062
3063
|
return function(w) {
|
|
3063
|
-
return
|
|
3064
|
+
return Ht(n.table(w), b);
|
|
3064
3065
|
};
|
|
3065
3066
|
var m = Reflect.get(c, f, p);
|
|
3066
|
-
return m instanceof lr ?
|
|
3067
|
-
return
|
|
3067
|
+
return m instanceof lr ? Ht(m, b) : f === "tables" ? m.map(function(w) {
|
|
3068
|
+
return Ht(w, b);
|
|
3068
3069
|
}) : f === "_createTransaction" ? function() {
|
|
3069
|
-
return
|
|
3070
|
+
return Ht(m.apply(this, arguments), b);
|
|
3070
3071
|
} : m;
|
|
3071
3072
|
} });
|
|
3072
3073
|
this.vip = b, r.forEach(function(c) {
|
|
3073
3074
|
return c(n);
|
|
3074
3075
|
});
|
|
3075
3076
|
}
|
|
3076
|
-
var
|
|
3077
|
+
var Qt, fe = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", Oi = (Kn.prototype.subscribe = function(e, t, n) {
|
|
3077
3078
|
return this._subscribe(e && typeof e != "function" ? e : { next: e, error: t, complete: n });
|
|
3078
3079
|
}, Kn.prototype[fe] = function() {
|
|
3079
3080
|
return this;
|
|
@@ -3082,12 +3083,12 @@ var Rr = { exports: {} };
|
|
|
3082
3083
|
this._subscribe = e;
|
|
3083
3084
|
}
|
|
3084
3085
|
try {
|
|
3085
|
-
|
|
3086
|
+
Qt = { indexedDB: j.indexedDB || j.mozIndexedDB || j.webkitIndexedDB || j.msIndexedDB, IDBKeyRange: j.IDBKeyRange || j.webkitIDBKeyRange };
|
|
3086
3087
|
} catch {
|
|
3087
|
-
|
|
3088
|
+
Qt = { indexedDB: null, IDBKeyRange: null };
|
|
3088
3089
|
}
|
|
3089
3090
|
function Dr(e) {
|
|
3090
|
-
var t, n = !1, r = new
|
|
3091
|
+
var t, n = !1, r = new Oi(function(i) {
|
|
3091
3092
|
var a = qt(e), s, u = !1, h = {}, d = {}, b = { get closed() {
|
|
3092
3093
|
return u;
|
|
3093
3094
|
}, unsubscribe: function() {
|
|
@@ -3097,17 +3098,17 @@ var Rr = { exports: {} };
|
|
|
3097
3098
|
var c = !1, f = function() {
|
|
3098
3099
|
return ln(m);
|
|
3099
3100
|
}, p = function(w) {
|
|
3100
|
-
|
|
3101
|
+
zt(h, w), Dn(d, h) && f();
|
|
3101
3102
|
}, m = function() {
|
|
3102
3103
|
var w, g, _;
|
|
3103
|
-
!u &&
|
|
3104
|
-
var E =
|
|
3104
|
+
!u && Qt.indexedDB && (h = {}, w = {}, s && s.abort(), s = new AbortController(), _ = function(S) {
|
|
3105
|
+
var E = Xe();
|
|
3105
3106
|
try {
|
|
3106
|
-
a &&
|
|
3107
|
+
a && Ze();
|
|
3107
3108
|
var O = Pe(e, S);
|
|
3108
3109
|
return O = a ? O.finally(Ie) : O;
|
|
3109
3110
|
} finally {
|
|
3110
|
-
E &&
|
|
3111
|
+
E && Je();
|
|
3111
3112
|
}
|
|
3112
3113
|
}(g = { subscr: w, signal: s.signal, requery: f, querier: e, trans: null }), Promise.resolve(_).then(function(S) {
|
|
3113
3114
|
n = !0, t = S, u || g.signal.aborted || (h = {}, function(E) {
|
|
@@ -3141,7 +3142,7 @@ var Rr = { exports: {} };
|
|
|
3141
3142
|
je = t;
|
|
3142
3143
|
}
|
|
3143
3144
|
}
|
|
3144
|
-
xe(We, y(y({},
|
|
3145
|
+
xe(We, y(y({}, Et), { delete: function(e) {
|
|
3145
3146
|
return new We(e, { addons: [] }).delete();
|
|
3146
3147
|
}, exists: function(e) {
|
|
3147
3148
|
return new We(e, { addons: [] }).open().then(function(t) {
|
|
@@ -3155,7 +3156,7 @@ var Rr = { exports: {} };
|
|
|
3155
3156
|
return r.map(function(i) {
|
|
3156
3157
|
return i.name;
|
|
3157
3158
|
}).filter(function(i) {
|
|
3158
|
-
return i !==
|
|
3159
|
+
return i !== Rt;
|
|
3159
3160
|
});
|
|
3160
3161
|
}) : En(n, t).toCollection().primaryKeys()).then(e);
|
|
3161
3162
|
} catch {
|
|
@@ -3192,11 +3193,11 @@ var Rr = { exports: {} };
|
|
|
3192
3193
|
return pe;
|
|
3193
3194
|
}, set: function(e) {
|
|
3194
3195
|
qn(e);
|
|
3195
|
-
} }, derive:
|
|
3196
|
+
} }, derive: Ye, extend: Z, props: xe, override: Yn, Events: dt, on: Te, liveQuery: Dr, extendObservabilitySet: zt, getByKeyPath: ve, setByKeyPath: de, delByKeyPath: function(e, t) {
|
|
3196
3197
|
typeof t == "string" ? de(e, t, void 0) : "length" in t && [].map.call(t, function(n) {
|
|
3197
3198
|
de(e, n, void 0);
|
|
3198
3199
|
});
|
|
3199
|
-
}, shallowClone: Qn, deepClone: Ae, getObjectDiff: Tn, cmp: $, asap: Hn, minKey: -1 / 0, addons: [], connections:
|
|
3200
|
+
}, shallowClone: Qn, deepClone: Ae, getObjectDiff: Tn, cmp: $, asap: Hn, minKey: -1 / 0, addons: [], connections: qe, errnames: en, dependencies: Qt, cache: Ue, semVer: ge, version: ge.split(".").map(function(e) {
|
|
3200
3201
|
return parseInt(e);
|
|
3201
3202
|
}).reduce(function(e, t, n) {
|
|
3202
3203
|
return e + t / Math.pow(10, 2 * n);
|
|
@@ -3205,38 +3206,38 @@ var Rr = { exports: {} };
|
|
|
3205
3206
|
}), addEventListener(yn, function(e) {
|
|
3206
3207
|
e = e.detail, je || Bn(e);
|
|
3207
3208
|
}));
|
|
3208
|
-
var
|
|
3209
|
+
var nt, je = !1, Pr = function() {
|
|
3209
3210
|
};
|
|
3210
3211
|
return typeof BroadcastChannel < "u" && ((Pr = function() {
|
|
3211
|
-
(
|
|
3212
|
+
(nt = new BroadcastChannel(yn)).onmessage = function(e) {
|
|
3212
3213
|
return e.data && Bn(e.data);
|
|
3213
3214
|
};
|
|
3214
|
-
})(), typeof
|
|
3215
|
-
je ||
|
|
3215
|
+
})(), typeof nt.unref == "function" && nt.unref(), Te(pt, function(e) {
|
|
3216
|
+
je || nt.postMessage(e);
|
|
3216
3217
|
})), typeof addEventListener < "u" && (addEventListener("pagehide", function(e) {
|
|
3217
3218
|
if (!Se.disableBfCache && e.persisted) {
|
|
3218
|
-
pe && console.debug("Dexie: handling persisted pagehide"),
|
|
3219
|
-
for (var t = 0, n =
|
|
3219
|
+
pe && console.debug("Dexie: handling persisted pagehide"), nt != null && nt.close();
|
|
3220
|
+
for (var t = 0, n = qe; t < n.length; t++)
|
|
3220
3221
|
n[t].close({ disableAutoOpen: !1 });
|
|
3221
3222
|
}
|
|
3222
3223
|
}), addEventListener("pageshow", function(e) {
|
|
3223
3224
|
!Se.disableBfCache && e.persisted && (pe && console.debug("Dexie: handling persisted pageshow"), Pr(), Bn({ all: new oe(-1 / 0, [[]]) }));
|
|
3224
3225
|
})), T.rejectionMapper = function(e, t) {
|
|
3225
|
-
return !e || e instanceof
|
|
3226
|
+
return !e || e instanceof Qe || e instanceof TypeError || e instanceof SyntaxError || !e.name || !Zn[e.name] ? e : (t = new Zn[e.name](t || e.message, e), "stack" in e && ke(t, "stack", { get: function() {
|
|
3226
3227
|
return this.inner.stack;
|
|
3227
3228
|
} }), t);
|
|
3228
|
-
}, qn(pe), y(Se, Object.freeze({ __proto__: null, Dexie: Se, liveQuery: Dr, Entity: sr, cmp: $, default: Se, RangeSet: oe, mergeRanges: bt, rangesOverlap:
|
|
3229
|
+
}, qn(pe), y(Se, Object.freeze({ __proto__: null, Dexie: Se, liveQuery: Dr, Entity: sr, cmp: $, default: Se, RangeSet: oe, mergeRanges: bt, rangesOverlap: Wt }), { default: Se }), Se;
|
|
3229
3230
|
});
|
|
3230
3231
|
})(Rr);
|
|
3231
|
-
var
|
|
3232
|
-
const Un = /* @__PURE__ */
|
|
3232
|
+
var Ii = Rr.exports;
|
|
3233
|
+
const Un = /* @__PURE__ */ Pi(Ii), Cr = Symbol.for("Dexie"), Wn = globalThis[Cr] || (globalThis[Cr] = Un);
|
|
3233
3234
|
if (Un.semVer !== Wn.semVer)
|
|
3234
3235
|
throw new Error(`Two different versions of Dexie loaded in the same app: ${Un.semVer} and ${Wn.semVer}`);
|
|
3235
3236
|
function X(v) {
|
|
3236
3237
|
let o = `${v.type}.${v.topics}`;
|
|
3237
3238
|
return v.order && (o += `.${v.order}`), v.period && (o += `.${v.period}`), o;
|
|
3238
3239
|
}
|
|
3239
|
-
function
|
|
3240
|
+
function $e(v) {
|
|
3240
3241
|
var o;
|
|
3241
3242
|
if (v.widget === void 0) {
|
|
3242
3243
|
const l = (o = v.topics) == null ? void 0 : o.split("-");
|
|
@@ -3244,17 +3245,17 @@ function nt(v) {
|
|
|
3244
3245
|
}
|
|
3245
3246
|
return v.topics === void 0 && (v.topics = `${v.dashboard}-${v.widget}`), v;
|
|
3246
3247
|
}
|
|
3247
|
-
function
|
|
3248
|
+
function wt(v, o) {
|
|
3248
3249
|
var N;
|
|
3249
3250
|
let l, y, I, j, M;
|
|
3250
3251
|
switch (v.moderation) {
|
|
3251
|
-
case
|
|
3252
|
+
case vt.BEFORE:
|
|
3252
3253
|
l = /* @__PURE__ */ new Date(), y = (N = v.beforeTime) == null ? void 0 : N.split(":"), I = Number.parseInt(y ? y[0] : "00"), j = Number.parseInt(y ? y[1] : "00"), M = Number.parseInt(y ? y[2] : "00"), o.before = l.setHours(I, j, M, 0) / 1e3, o.period || (o.period = l.getDay() === 1 ? 72 : 24);
|
|
3253
3254
|
break;
|
|
3254
|
-
case
|
|
3255
|
+
case vt.DELAYED:
|
|
3255
3256
|
v.delay && v.delay > 0 && (o.delay = `${v.delay}`);
|
|
3256
3257
|
break;
|
|
3257
|
-
case
|
|
3258
|
+
case vt.APPROVED:
|
|
3258
3259
|
o.approved = "1";
|
|
3259
3260
|
break;
|
|
3260
3261
|
default:
|
|
@@ -3273,15 +3274,17 @@ class Tr {
|
|
|
3273
3274
|
* @returns IResponse
|
|
3274
3275
|
*/
|
|
3275
3276
|
P(this, "getCloud", async (o) => {
|
|
3276
|
-
const l = await this.db.table(K.CLOUD).where({ id: o.widget }).last().catch(() =>
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3277
|
+
const l = await this.db.table(K.CLOUD).where({ id: o.widget }).last().catch(() => {
|
|
3278
|
+
console.warn(
|
|
3279
|
+
"%capi%C %ccloud",
|
|
3280
|
+
x.API,
|
|
3281
|
+
x.NONE,
|
|
3282
|
+
x.CLOUD,
|
|
3283
|
+
o.slide,
|
|
3284
|
+
o.widget
|
|
3285
|
+
);
|
|
3286
|
+
});
|
|
3287
|
+
return l === void 0 ? { data: null, message: "Cloud Data error", success: !1 } : (l.data.presentation = (o == null ? void 0 : o.presentation) || "not set", l.data.slide = (o == null ? void 0 : o.slide) || "not set", l.message = "Messages retrieved successfully", l.success = !0, l);
|
|
3285
3288
|
});
|
|
3286
3289
|
/**
|
|
3287
3290
|
* Retrieve Cloud Data
|
|
@@ -3289,15 +3292,17 @@ class Tr {
|
|
|
3289
3292
|
* @returns IResponse
|
|
3290
3293
|
*/
|
|
3291
3294
|
P(this, "getSeries", async (o) => {
|
|
3292
|
-
const l = await this.db.table(K.SERIES).where({ id: o.widget }).last().catch(() =>
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3295
|
+
const l = await this.db.table(K.SERIES).where({ id: o.widget }).last().catch(() => {
|
|
3296
|
+
console.warn(
|
|
3297
|
+
"%capi%c %cseries",
|
|
3298
|
+
x.API,
|
|
3299
|
+
x.NONE,
|
|
3300
|
+
x.SERIES,
|
|
3301
|
+
o.slide,
|
|
3302
|
+
o.widget
|
|
3303
|
+
);
|
|
3304
|
+
});
|
|
3305
|
+
return l === void 0 ? { data: null, message: "Series Data error", success: !1 } : (l.data.presentation = (o == null ? void 0 : o.presentation) || "not set", l.data.slide = (o == null ? void 0 : o.slide) || "not set", l.message = "Messages retrieved successfully", l.success = !0, l);
|
|
3301
3306
|
});
|
|
3302
3307
|
/**
|
|
3303
3308
|
* Retrieve Cloud Data
|
|
@@ -3307,14 +3312,19 @@ class Tr {
|
|
|
3307
3312
|
P(this, "getMessages", async (o) => {
|
|
3308
3313
|
const l = (j) => j.widget_id === o.widget, y = (j) => j.utc > ((o == null ? void 0 : o.since) || 0), I = (j) => (j == null ? void 0 : j.visible) !== 0;
|
|
3309
3314
|
try {
|
|
3310
|
-
const j = await this.db.table(K.TOPICS).orderBy("utc").reverse().filter(l).filter(y).filter(I).limit((o == null ? void 0 : o.limit) ?? 25).toArray().catch(() =>
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3315
|
+
const j = await this.db.table(K.TOPICS).orderBy("utc").reverse().filter(l).filter(y).filter(I).limit((o == null ? void 0 : o.limit) ?? 25).toArray().catch(() => {
|
|
3316
|
+
console.warn(
|
|
3317
|
+
"%capi%c %cmessages",
|
|
3318
|
+
x.API,
|
|
3319
|
+
x.NONE,
|
|
3320
|
+
x.MESSAGES,
|
|
3321
|
+
o.slide,
|
|
3322
|
+
o.widget
|
|
3323
|
+
);
|
|
3324
|
+
});
|
|
3325
|
+
if (j.length === 0)
|
|
3326
|
+
return { data: null, message: "No Messages error", success: !1 };
|
|
3327
|
+
const M = j[0] ? j[0].title : "No title", N = j.map(
|
|
3318
3328
|
(be) => be.message_id
|
|
3319
3329
|
), te = (await this.db.table(K.MESSAGES).where("id").anyOf(N).toArray().then((be) => be.sort((ie, xe) => xe.utc - ie.utc))).map(
|
|
3320
3330
|
(be) => be.data
|
|
@@ -3414,9 +3424,9 @@ class Tr {
|
|
|
3414
3424
|
* @param query IQuery
|
|
3415
3425
|
* @returns null
|
|
3416
3426
|
*/
|
|
3417
|
-
P(this, "subscribe", (o) => (o =
|
|
3427
|
+
P(this, "subscribe", (o) => (o = $e(o), this.subscribers.filter(
|
|
3418
3428
|
(y) => y.widget === o.widget
|
|
3419
|
-
).length > 0 || (o.type === K.MESSAGES && (o =
|
|
3429
|
+
).length > 0 || (o.type === K.MESSAGES && (o = wt(this.options, o)), console.debug(
|
|
3420
3430
|
"%cstorage%c %csubscribe",
|
|
3421
3431
|
x.STORAGE,
|
|
3422
3432
|
x.NONE,
|
|
@@ -3448,7 +3458,7 @@ function zn(v) {
|
|
|
3448
3458
|
v.oncomplete = v.onsuccess = () => o(v.result), v.onabort = v.onerror = () => l(v.error);
|
|
3449
3459
|
});
|
|
3450
3460
|
}
|
|
3451
|
-
function
|
|
3461
|
+
function Ci(v, o) {
|
|
3452
3462
|
const l = indexedDB.open(v);
|
|
3453
3463
|
l.onupgradeneeded = () => l.result.createObjectStore(o);
|
|
3454
3464
|
const y = zn(l);
|
|
@@ -3456,12 +3466,12 @@ function Pi(v, o) {
|
|
|
3456
3466
|
}
|
|
3457
3467
|
let Gn;
|
|
3458
3468
|
function jr() {
|
|
3459
|
-
return Gn || (Gn =
|
|
3469
|
+
return Gn || (Gn = Ci("keyval-store", "keyval")), Gn;
|
|
3460
3470
|
}
|
|
3461
3471
|
function Ln(v, o = jr()) {
|
|
3462
3472
|
return o("readonly", (l) => zn(l.get(v)));
|
|
3463
3473
|
}
|
|
3464
|
-
function
|
|
3474
|
+
function Xt(v, o, l = jr()) {
|
|
3465
3475
|
return l("readwrite", (y) => (y.put(o, v), zn(y.transaction)));
|
|
3466
3476
|
}
|
|
3467
3477
|
class Mr {
|
|
@@ -3490,7 +3500,7 @@ class Mr {
|
|
|
3490
3500
|
if (!l.success)
|
|
3491
3501
|
return 400;
|
|
3492
3502
|
const y = X(o);
|
|
3493
|
-
return delete l.success, delete l.message, await
|
|
3503
|
+
return delete l.success, delete l.message, await Xt(y, l).then(() => 201).catch((I) => (console.error("%cstorage", x.STORAGE, K.CLOUD, o, I), 400));
|
|
3494
3504
|
});
|
|
3495
3505
|
/**
|
|
3496
3506
|
* Update Series
|
|
@@ -3502,7 +3512,7 @@ class Mr {
|
|
|
3502
3512
|
if (!l.success)
|
|
3503
3513
|
return 400;
|
|
3504
3514
|
const y = X(o);
|
|
3505
|
-
return delete l.success, delete l.message, await
|
|
3515
|
+
return delete l.success, delete l.message, await Xt(y, l).then(() => 201).catch((I) => (console.error("%cstorage", x.STORAGE, K.SERIES, o, I), 400));
|
|
3506
3516
|
});
|
|
3507
3517
|
/**
|
|
3508
3518
|
* Update Messages
|
|
@@ -3514,7 +3524,7 @@ class Mr {
|
|
|
3514
3524
|
if (!l.success)
|
|
3515
3525
|
return 400;
|
|
3516
3526
|
const y = X(o);
|
|
3517
|
-
return delete l.success, delete l.message, await
|
|
3527
|
+
return delete l.success, delete l.message, await Xt(y, l).then(() => 201).catch((I) => (console.error("%cstorage", x.STORAGE, K.MESSAGES, o, I), 400));
|
|
3518
3528
|
});
|
|
3519
3529
|
P(this, "cleanMessages", async (o) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((l) => l())));
|
|
3520
3530
|
/**
|
|
@@ -3528,14 +3538,14 @@ class Mr {
|
|
|
3528
3538
|
dashboard_id: o.dashboard,
|
|
3529
3539
|
type: o.type
|
|
3530
3540
|
};
|
|
3531
|
-
return await
|
|
3541
|
+
return await Xt(l, y).then(() => 201).catch((I) => (console.error("%cstorage", x.STORAGE, K.WIDGET, o, I), 400));
|
|
3532
3542
|
});
|
|
3533
3543
|
/**
|
|
3534
3544
|
* Add component subscriber
|
|
3535
3545
|
* @param query IQuery
|
|
3536
3546
|
* @returns null
|
|
3537
3547
|
*/
|
|
3538
|
-
P(this, "subscribe", (o) => (o =
|
|
3548
|
+
P(this, "subscribe", (o) => (o = $e(o), o.type === K.MESSAGES && (o = wt(this.options, o)), this.subscribers.filter(
|
|
3539
3549
|
(y) => y.widget === o.widget
|
|
3540
3550
|
).length > 0 || (console.debug(
|
|
3541
3551
|
"%cstorage%c %csubscribe",
|
|
@@ -3639,7 +3649,7 @@ class Kr {
|
|
|
3639
3649
|
* @param query IQuery
|
|
3640
3650
|
* @returns null
|
|
3641
3651
|
*/
|
|
3642
|
-
P(this, "subscribe", (o) => (o =
|
|
3652
|
+
P(this, "subscribe", (o) => (o = $e(o), o.type === K.MESSAGES && (o = wt(this.options, o)), this.subscribers.filter(
|
|
3643
3653
|
(y) => y.widget === o.widget
|
|
3644
3654
|
).length || (console.debug(
|
|
3645
3655
|
"%cstorage%c %csubscribe",
|
|
@@ -3748,7 +3758,7 @@ class Br {
|
|
|
3748
3758
|
* @param query IQuery
|
|
3749
3759
|
* @returns null
|
|
3750
3760
|
*/
|
|
3751
|
-
P(this, "subscribe", (o) => (o =
|
|
3761
|
+
P(this, "subscribe", (o) => (o = $e(o), o.type === K.MESSAGES && (o = wt(this.options, o)), this.subscribers.filter(
|
|
3752
3762
|
(y) => y.widget === o.widget
|
|
3753
3763
|
).length || (console.debug(
|
|
3754
3764
|
"%cstorage%c %csubscribe",
|
|
@@ -3857,7 +3867,7 @@ class Nr {
|
|
|
3857
3867
|
* @param query IQuery
|
|
3858
3868
|
* @returns null
|
|
3859
3869
|
*/
|
|
3860
|
-
P(this, "subscribe", (o) => (o =
|
|
3870
|
+
P(this, "subscribe", (o) => (o = $e(o), o.type === K.MESSAGES && (o = wt(this.options, o)), this.subscribers.filter(
|
|
3861
3871
|
(y) => y.widget === o.widget
|
|
3862
3872
|
).length || (console.debug(
|
|
3863
3873
|
"%cstorage%c %csubscribe",
|
|
@@ -3875,7 +3885,7 @@ class Nr {
|
|
|
3875
3885
|
this.options = o, window.BuzzCasting.WidgetData = /* @__PURE__ */ new Set();
|
|
3876
3886
|
}
|
|
3877
3887
|
}
|
|
3878
|
-
function
|
|
3888
|
+
function Gr(v) {
|
|
3879
3889
|
const o = {};
|
|
3880
3890
|
for (let l = 0; l < v.length; l++) {
|
|
3881
3891
|
const y = v.item(l);
|
|
@@ -3883,7 +3893,7 @@ function Ii(v) {
|
|
|
3883
3893
|
}
|
|
3884
3894
|
return o;
|
|
3885
3895
|
}
|
|
3886
|
-
function
|
|
3896
|
+
function Ri(v) {
|
|
3887
3897
|
const o = {};
|
|
3888
3898
|
for (let l = 0; l < v.length; l++) {
|
|
3889
3899
|
const y = v[l];
|
|
@@ -3891,13 +3901,13 @@ function Ki(v) {
|
|
|
3891
3901
|
}
|
|
3892
3902
|
return o;
|
|
3893
3903
|
}
|
|
3894
|
-
function
|
|
3904
|
+
function Ti(v) {
|
|
3895
3905
|
return v.replace(/(?:^\w|[A-Z]|\b\w)/g, (o, l) => l === 0 ? o.toLowerCase() : o.toUpperCase()).replace(/\s+/g, "");
|
|
3896
3906
|
}
|
|
3897
|
-
function
|
|
3907
|
+
function ji(v) {
|
|
3898
3908
|
return v.toLowerCase().split("-").reduce((o, l) => o + (l.charAt(0).toUpperCase() + l.slice(1)));
|
|
3899
3909
|
}
|
|
3900
|
-
function
|
|
3910
|
+
function Mi(v, o) {
|
|
3901
3911
|
for (; v.length < o; )
|
|
3902
3912
|
v = `0${v}`;
|
|
3903
3913
|
return v;
|
|
@@ -3910,14 +3920,14 @@ function Oe(v, o) {
|
|
|
3910
3920
|
y = o.charCodeAt(l), v = (v << 5) - v + y, v |= 0;
|
|
3911
3921
|
return v < 0 ? v * -2 : v;
|
|
3912
3922
|
}
|
|
3913
|
-
function
|
|
3923
|
+
function Ki(v, o, l) {
|
|
3914
3924
|
return Object.keys(o).sort().reduce(y, v);
|
|
3915
3925
|
function y(I, j) {
|
|
3916
|
-
return
|
|
3926
|
+
return Lr(I, o[j], j, l);
|
|
3917
3927
|
}
|
|
3918
3928
|
}
|
|
3919
|
-
function
|
|
3920
|
-
const I = Oe(Oe(Oe(v, l),
|
|
3929
|
+
function Lr(v, o, l, y) {
|
|
3930
|
+
const I = Oe(Oe(Oe(v, l), Bi(o)), typeof o);
|
|
3921
3931
|
if (o === null)
|
|
3922
3932
|
return Oe(I, "null");
|
|
3923
3933
|
if (o === void 0)
|
|
@@ -3926,7 +3936,7 @@ function Gr(v, o, l, y) {
|
|
|
3926
3936
|
if (y.includes(o))
|
|
3927
3937
|
return Oe(I, `[Circular]${l}`);
|
|
3928
3938
|
y.push(o);
|
|
3929
|
-
const j =
|
|
3939
|
+
const j = Ki(I, o, y);
|
|
3930
3940
|
if (!("valueOf" in o) || typeof o.valueOf != "function")
|
|
3931
3941
|
return j;
|
|
3932
3942
|
try {
|
|
@@ -3937,13 +3947,13 @@ function Gr(v, o, l, y) {
|
|
|
3937
3947
|
}
|
|
3938
3948
|
return Oe(I, o.toString());
|
|
3939
3949
|
}
|
|
3940
|
-
function
|
|
3950
|
+
function Bi(v) {
|
|
3941
3951
|
return Object.prototype.toString.call(v);
|
|
3942
3952
|
}
|
|
3943
3953
|
function Fn(v) {
|
|
3944
|
-
return
|
|
3954
|
+
return Mi(Lr(0, v, "", []).toString(16), 8);
|
|
3945
3955
|
}
|
|
3946
|
-
class
|
|
3956
|
+
class Ni {
|
|
3947
3957
|
constructor(o) {
|
|
3948
3958
|
P(this, "sm");
|
|
3949
3959
|
P(this, "api");
|
|
@@ -4027,7 +4037,7 @@ class Gi {
|
|
|
4027
4037
|
x.BROADCAST,
|
|
4028
4038
|
N.query.slide,
|
|
4029
4039
|
N.data.title ?? N.query.widget
|
|
4030
|
-
), this.bc.postMessage({ event:
|
|
4040
|
+
), this.bc.postMessage({ event: se.WIDGET_UPDATE, data: N });
|
|
4031
4041
|
break;
|
|
4032
4042
|
case 400:
|
|
4033
4043
|
console.warn(
|
|
@@ -4047,7 +4057,7 @@ class Gi {
|
|
|
4047
4057
|
x.API,
|
|
4048
4058
|
x.NONE,
|
|
4049
4059
|
x.STORAGE,
|
|
4050
|
-
|
|
4060
|
+
se.ERROR
|
|
4051
4061
|
), 400;
|
|
4052
4062
|
})
|
|
4053
4063
|
);
|
|
@@ -4058,16 +4068,16 @@ class Gi {
|
|
|
4058
4068
|
P(this, "actions", async (o) => {
|
|
4059
4069
|
var l;
|
|
4060
4070
|
switch (o.data.event) {
|
|
4061
|
-
case
|
|
4071
|
+
case se.SUBSCRIBE:
|
|
4062
4072
|
(l = this.sm) == null || l.subscribe(o.data.data);
|
|
4063
4073
|
break;
|
|
4064
|
-
case
|
|
4074
|
+
case se.UPDATE:
|
|
4065
4075
|
console.debug(
|
|
4066
4076
|
"%capi%c %cstorage",
|
|
4067
4077
|
x.API,
|
|
4068
4078
|
x.NONE,
|
|
4069
4079
|
x.STORAGE,
|
|
4070
|
-
|
|
4080
|
+
se.UPDATE,
|
|
4071
4081
|
o.data
|
|
4072
4082
|
), await this.update();
|
|
4073
4083
|
break;
|
|
@@ -4091,8 +4101,8 @@ class Gi {
|
|
|
4091
4101
|
x.NONE,
|
|
4092
4102
|
x.SLIDE,
|
|
4093
4103
|
o.slide,
|
|
4094
|
-
|
|
4095
|
-
|
|
4104
|
+
se.VERSION,
|
|
4105
|
+
Ai
|
|
4096
4106
|
), this.options = o, this.sm = null;
|
|
4097
4107
|
const l = (o == null ? void 0 : o.slide) || o.app;
|
|
4098
4108
|
switch (this.bc = new BroadcastChannel(l), console.info(
|
|
@@ -4100,11 +4110,11 @@ class Gi {
|
|
|
4100
4110
|
x.API,
|
|
4101
4111
|
x.NONE,
|
|
4102
4112
|
x.BROADCAST,
|
|
4103
|
-
|
|
4113
|
+
se.CHANNEL,
|
|
4104
4114
|
l
|
|
4105
4115
|
), this.bc.onmessage = (y) => {
|
|
4106
4116
|
this.actions(y);
|
|
4107
|
-
}, this.bc.postMessage({ event:
|
|
4117
|
+
}, this.bc.postMessage({ event: se.STORAGE_INIT, data: {} }), this.api = new Di(o), o.storage) {
|
|
4108
4118
|
case he.DEXIE:
|
|
4109
4119
|
this.sm = new Tr(o);
|
|
4110
4120
|
break;
|
|
@@ -4123,7 +4133,7 @@ class Gi {
|
|
|
4123
4133
|
}
|
|
4124
4134
|
}
|
|
4125
4135
|
}
|
|
4126
|
-
class
|
|
4136
|
+
class Fr {
|
|
4127
4137
|
constructor(o) {
|
|
4128
4138
|
P(this, "sm");
|
|
4129
4139
|
/**
|
|
@@ -4208,8 +4218,7 @@ class ji {
|
|
|
4208
4218
|
}
|
|
4209
4219
|
}
|
|
4210
4220
|
}
|
|
4211
|
-
|
|
4212
|
-
class Li {
|
|
4221
|
+
class Gi {
|
|
4213
4222
|
/**
|
|
4214
4223
|
* Main container for managing widgets and data updates
|
|
4215
4224
|
*
|
|
@@ -4304,7 +4313,7 @@ class Li {
|
|
|
4304
4313
|
* @param modal IModal
|
|
4305
4314
|
*/
|
|
4306
4315
|
P(this, "showModal", (o) => {
|
|
4307
|
-
const l =
|
|
4316
|
+
const l = Gr(this.element.attributes);
|
|
4308
4317
|
if (Object.prototype.hasOwnProperty.call(l, "data-topics")) {
|
|
4309
4318
|
const j = l["data-topics"].split("-");
|
|
4310
4319
|
j.length > 1 ? (l["data-widget"] = j[1], l["data-dashboard"] = j[0]) : (l["data-widget"] = j[0], l["data-dashboard"] = this.query.slide);
|
|
@@ -4313,12 +4322,12 @@ class Li {
|
|
|
4313
4322
|
console.debug(
|
|
4314
4323
|
"%cwidget",
|
|
4315
4324
|
x.WIDGET,
|
|
4316
|
-
|
|
4325
|
+
se.SHOW_MODAL,
|
|
4317
4326
|
o.showComponent,
|
|
4318
4327
|
// @ts-expect-error cannot get string type out of IFilteredAttributes props
|
|
4319
4328
|
l["data-widget"]
|
|
4320
4329
|
);
|
|
4321
|
-
const I = new CustomEvent(
|
|
4330
|
+
const I = new CustomEvent(se.SHOW_MODAL, {
|
|
4322
4331
|
detail: {
|
|
4323
4332
|
component: o.showComponent,
|
|
4324
4333
|
props: y
|
|
@@ -4332,9 +4341,9 @@ class Li {
|
|
|
4332
4341
|
var M;
|
|
4333
4342
|
this.element = o, this.listeners = l, y = typeof y < "u" ? y : "buzzcasting-slide";
|
|
4334
4343
|
let I;
|
|
4335
|
-
I = { ...o.dataset }, delete I.hmr, I.slide = ((M = o.closest(y.toUpperCase())) == null ? void 0 : M.id) ?? `${y} not found`, I =
|
|
4344
|
+
I = { ...o.dataset }, delete I.hmr, I.slide = ((M = o.closest(y.toUpperCase())) == null ? void 0 : M.id) ?? `${y} not found`, I = $e(I), this.query = I;
|
|
4336
4345
|
const j = window.BuzzCasting.getOptions();
|
|
4337
|
-
this.storageReader = new
|
|
4346
|
+
this.storageReader = new Fr(j), this.broadcastChannel = new BroadcastChannel(I.slide), this.startListener();
|
|
4338
4347
|
}
|
|
4339
4348
|
addListener(o) {
|
|
4340
4349
|
this.listeners.push(o);
|
|
@@ -4347,12 +4356,12 @@ class Li {
|
|
|
4347
4356
|
this.broadcastChannel.onmessage = async (l) => {
|
|
4348
4357
|
const y = l.data.data;
|
|
4349
4358
|
switch (l.data.event) {
|
|
4350
|
-
case
|
|
4359
|
+
case se.WIDGET_UPDATE:
|
|
4351
4360
|
y.query.slide === o.slide && y.query.widget === o.widget && this.listeners.forEach((I) => {
|
|
4352
4361
|
I(l.data.data);
|
|
4353
4362
|
});
|
|
4354
4363
|
break;
|
|
4355
|
-
case
|
|
4364
|
+
case se.SLIDE_READY:
|
|
4356
4365
|
this.subscribe();
|
|
4357
4366
|
break;
|
|
4358
4367
|
}
|
|
@@ -4371,7 +4380,7 @@ class Li {
|
|
|
4371
4380
|
this.query.slide,
|
|
4372
4381
|
this.query.widget
|
|
4373
4382
|
), this.broadcastChannel.postMessage({
|
|
4374
|
-
event:
|
|
4383
|
+
event: se.SUBSCRIBE,
|
|
4375
4384
|
data: this.query
|
|
4376
4385
|
});
|
|
4377
4386
|
}
|
|
@@ -4379,18 +4388,21 @@ class Li {
|
|
|
4379
4388
|
this.broadcastChannel.close();
|
|
4380
4389
|
}
|
|
4381
4390
|
}
|
|
4391
|
+
const Fi = {
|
|
4392
|
+
BuzzcastingStorageManager: Ni,
|
|
4393
|
+
BuzzcastingStorageReader: Fr,
|
|
4394
|
+
Widget: Gi,
|
|
4395
|
+
attrs: Gr,
|
|
4396
|
+
filterAttributes: Ri,
|
|
4397
|
+
widgetParams: $e,
|
|
4398
|
+
camelCase: ji,
|
|
4399
|
+
camelize: Ti,
|
|
4400
|
+
API: K,
|
|
4401
|
+
CSS: x,
|
|
4402
|
+
EVENTS: se,
|
|
4403
|
+
MODERATION: vt,
|
|
4404
|
+
STORAGE: he
|
|
4405
|
+
};
|
|
4382
4406
|
export {
|
|
4383
|
-
|
|
4384
|
-
Gi as BuzzcastingStorageManager,
|
|
4385
|
-
ji as BuzzcastingStorageReader,
|
|
4386
|
-
x as CSS,
|
|
4387
|
-
ue as EVENTS,
|
|
4388
|
-
Xt as MODERATION,
|
|
4389
|
-
he as STORAGE,
|
|
4390
|
-
Li as Widget,
|
|
4391
|
-
Ii as attrs,
|
|
4392
|
-
Ni as camelCase,
|
|
4393
|
-
Bi as camelize,
|
|
4394
|
-
Ki as filterAttributes,
|
|
4395
|
-
nt as widgetParams
|
|
4407
|
+
Fi as default
|
|
4396
4408
|
};
|