buzzcasting-storage 2.16.26 → 2.16.27
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 +23 -0
- package/dist/buzzcasting-storage.esm.js +1032 -987
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var xi = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var K = /* @__PURE__ */ ((
|
|
5
|
-
const
|
|
2
|
+
var Ai = (d, r, s) => r in d ? xi(d, r, { enumerable: !0, configurable: !0, writable: !0, value: s }) : d[r] = s;
|
|
3
|
+
var k = (d, r, s) => Ai(d, typeof r != "symbol" ? r + "" : r, s);
|
|
4
|
+
var K = /* @__PURE__ */ ((d) => (d.MESSAGES = "messages", d.CLOUD = "cloud", d.SERIES = "series", d.TOPICS = "topics", d.WIDGET = "widget", d.WIDGETS = "widgets", d.SLIDE = "slide", d))(K || {}), _ = /* @__PURE__ */ ((d) => (d.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", d.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", d.BROADCAST = "color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", d.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", d.CLOUD = "color:grey;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", d.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", d.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", d.MESSAGES = "color:grey;background-color:tan;padding:0 4px 0 4px;border-radius:5px;", d.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", d.NONE = "color:transparent;background-color:transparent;", d.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", d.SERIES = "color:grey;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", d.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", d.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", d.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", d.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", d.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", d))(_ || {}), re = /* @__PURE__ */ ((d) => (d.ADD_SLIDE = "addSlide", d.APP_READY = "appReady", d.API_UPDATE = "apiUpdate", d.APPROVE_MESSAGE = "approveMessage", d.CHANNEL = "channel", d.CLEAN_MESSAGES = "cleanMessages", d.CLOSE_MODAL = "closeModal", d.CLOSE_BUILDER_MODAL = "closeBuilderModal", d.ERROR = "error", d.HIDE_MESSAGE = "hideMessage", d.HIDE_LABELS = "hideLabels", d.PAUSE_PRESENTATION = "pausePresentation", d.PRESENTATION_READY = "presentationReady", d.PREV_SLIDE = "prevSlide", d.RELOAD_PRESENTATION = "reloadPresentation", d.SHOW_MODAL = "showModal", d.STAR_MESSAGE = "starMessage", d.GOTO_SLIDE = "gotoSlide", d.NEXT_SLIDE = "nextSlide", d.SHOW_BUILDER_MODAL = "showBuilderModal", d.SLIDE_DID_LOAD = "slideDidLoad", d.SLIDE_GOTO = "slideGoto", d.SLIDE_READY = "slideReady", d.SLIDE_LOAD = "loadSlide", d.SLIDE_STORE = "storeSlide", d.SLIDE_TRANSITIONER = "slideTransitioner", d.START_TRANSITIONER = "startTransitioner", d.STORAGE_INIT = "storageInit", d.SUBSCRIBE = "subscribe", d.SUSPEND_ACCOUNT = "suspendAccount", d.REMOVE_CLOUD = "removeCloud", d.UPDATE = "update", d.VERSION = "version", d.WIDGET_UPDATE = "widgetUpdate", d))(re || {}), qt = /* @__PURE__ */ ((d) => (d.APPROVED = "approved", d.BEFORE = "before", d.DELAYED = "delayed", d.NONE = "none", d.REALTIME = "realtime", d))(qt || {}), pe = /* @__PURE__ */ ((d) => (d.KEYVAL = "keyval", d.LOCAL = "local", d.SESSION = "session", d.DEXIE = "dexie", d.WINDOW = "window", d))(pe || {});
|
|
5
|
+
const ki = "2.16.26";
|
|
6
6
|
class Di {
|
|
7
7
|
constructor(r) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
k(this, "options");
|
|
9
|
+
k(this, "url");
|
|
10
|
+
k(this, "headers", () => {
|
|
11
11
|
const r = `Bearer ${this.options.bearer}`;
|
|
12
12
|
return {
|
|
13
13
|
headers: new Headers({
|
|
@@ -18,7 +18,7 @@ class Di {
|
|
|
18
18
|
})
|
|
19
19
|
};
|
|
20
20
|
});
|
|
21
|
-
|
|
21
|
+
k(this, "formHeaders", () => {
|
|
22
22
|
const r = `Bearer ${this.options.bearer}`;
|
|
23
23
|
return {
|
|
24
24
|
headers: new Headers({
|
|
@@ -32,9 +32,9 @@ class Di {
|
|
|
32
32
|
this.options = r, this.url = `https://${r.app}.buzzcasting.net`;
|
|
33
33
|
}
|
|
34
34
|
async get(r) {
|
|
35
|
-
const { version: s } = this.options, l = this.headers(),
|
|
36
|
-
delete
|
|
37
|
-
const D = Object.keys(
|
|
35
|
+
const { version: s } = this.options, l = this.headers(), x = Object.assign({}, r);
|
|
36
|
+
delete x.slide, delete x.type, delete x.hash;
|
|
37
|
+
const D = Object.keys(x).length > 0 ? `?${new URLSearchParams(x).toString()}` : "";
|
|
38
38
|
return console.debug(
|
|
39
39
|
"%capi%c %cget",
|
|
40
40
|
_.API,
|
|
@@ -52,7 +52,7 @@ class Di {
|
|
|
52
52
|
}).then((R) => R.json()).then((R) => (R.query = r, R)).catch((R) => ({ success: !1, message: `${R}`, data: null }));
|
|
53
53
|
}
|
|
54
54
|
async hideMessage(r) {
|
|
55
|
-
const { version: s } = this.options, l = this.headers(),
|
|
55
|
+
const { version: s } = this.options, l = this.headers(), x = "?action=visible";
|
|
56
56
|
return console.info(
|
|
57
57
|
"%capi%c %cput",
|
|
58
58
|
_.API,
|
|
@@ -62,7 +62,7 @@ class Di {
|
|
|
62
62
|
r.widget,
|
|
63
63
|
r.id
|
|
64
64
|
), await fetch(
|
|
65
|
-
[this.url, "api", s, "messages", r.id].join("/") +
|
|
65
|
+
[this.url, "api", s, "messages", r.id].join("/") + x,
|
|
66
66
|
{ ...l, method: "put" }
|
|
67
67
|
).then((D) => {
|
|
68
68
|
if (!D.ok)
|
|
@@ -71,9 +71,9 @@ class Di {
|
|
|
71
71
|
}).then((D) => D.json()).catch((D) => ({ succes: !1, message: D, data: [] }));
|
|
72
72
|
}
|
|
73
73
|
async hideLabels(r) {
|
|
74
|
-
const { version: s } = this.options, l = this.formHeaders(),
|
|
74
|
+
const { version: s } = this.options, l = this.formHeaders(), x = new URLSearchParams(), D = r.labels || [];
|
|
75
75
|
for (const [R, B] of D.entries())
|
|
76
|
-
|
|
76
|
+
x.append(`custom_filters[${R}]`, B);
|
|
77
77
|
return console.info(
|
|
78
78
|
"%capi%c %cput",
|
|
79
79
|
_.API,
|
|
@@ -84,7 +84,7 @@ class Di {
|
|
|
84
84
|
D
|
|
85
85
|
), await fetch(
|
|
86
86
|
[this.url, "api", s, r.type, r.widget].join("/"),
|
|
87
|
-
{ ...l, body:
|
|
87
|
+
{ ...l, body: x, method: "put" }
|
|
88
88
|
).then((R) => {
|
|
89
89
|
if (!R.ok)
|
|
90
90
|
throw new Error(R.statusText);
|
|
@@ -92,8 +92,8 @@ class Di {
|
|
|
92
92
|
}).then((R) => R.json()).catch((R) => ({ succes: !1, message: R, data: [] }));
|
|
93
93
|
}
|
|
94
94
|
async loadSlide(r) {
|
|
95
|
-
const { version: s } = this.options, l = this.headers(),
|
|
96
|
-
return delete
|
|
95
|
+
const { version: s } = this.options, l = this.headers(), x = Object.assign({}, r);
|
|
96
|
+
return delete x.slide, delete x.type, delete x.hash, console.debug(
|
|
97
97
|
"%capi%c %cget",
|
|
98
98
|
_.API,
|
|
99
99
|
_.NONE,
|
|
@@ -119,7 +119,7 @@ class Di {
|
|
|
119
119
|
async storeSlide(r) {
|
|
120
120
|
const { version: s } = this.options, l = this.formHeaders();
|
|
121
121
|
delete r.update, delete r.type;
|
|
122
|
-
const
|
|
122
|
+
const x = JSON.stringify(r);
|
|
123
123
|
return console.info(
|
|
124
124
|
"%capi%c %cput",
|
|
125
125
|
_.API,
|
|
@@ -129,7 +129,7 @@ class Di {
|
|
|
129
129
|
r.id
|
|
130
130
|
), await fetch(
|
|
131
131
|
[this.url, "api", s, "slides", r.id].join("/"),
|
|
132
|
-
{ ...l, body:
|
|
132
|
+
{ ...l, body: x, method: "put" }
|
|
133
133
|
).then((D) => {
|
|
134
134
|
if (!D.ok)
|
|
135
135
|
throw new Error(D.statusText);
|
|
@@ -138,28 +138,28 @@ class Di {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
var Rr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
141
|
-
function Pi(
|
|
142
|
-
return
|
|
141
|
+
function Pi(d) {
|
|
142
|
+
return d && d.__esModule && Object.prototype.hasOwnProperty.call(d, "default") ? d.default : d;
|
|
143
143
|
}
|
|
144
144
|
var Mr = { exports: {} };
|
|
145
|
-
(function(
|
|
145
|
+
(function(d, r) {
|
|
146
146
|
(function(s, l) {
|
|
147
|
-
|
|
147
|
+
d.exports = l();
|
|
148
148
|
})(Rr, function() {
|
|
149
149
|
var s = function(e, t) {
|
|
150
150
|
return (s = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, i) {
|
|
151
151
|
n.__proto__ = i;
|
|
152
152
|
} || function(n, i) {
|
|
153
|
-
for (var
|
|
153
|
+
for (var o in i) Object.prototype.hasOwnProperty.call(i, o) && (n[o] = i[o]);
|
|
154
154
|
})(e, t);
|
|
155
155
|
}, l = function() {
|
|
156
156
|
return (l = Object.assign || function(e) {
|
|
157
|
-
for (var t, n = 1, i = arguments.length; n < i; n++) for (var
|
|
157
|
+
for (var t, n = 1, i = arguments.length; n < i; n++) for (var o in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
|
|
158
158
|
return e;
|
|
159
159
|
}).apply(this, arguments);
|
|
160
160
|
};
|
|
161
|
-
function
|
|
162
|
-
for (var i,
|
|
161
|
+
function x(e, t, n) {
|
|
162
|
+
for (var i, o = 0, a = t.length; o < a; o++) !i && o in t || ((i = i || Array.prototype.slice.call(t, 0, o))[o] = t[o]);
|
|
163
163
|
return e.concat(i || Array.prototype.slice.call(t));
|
|
164
164
|
}
|
|
165
165
|
var D = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Rr, R = Object.keys, B = Array.isArray;
|
|
@@ -175,16 +175,16 @@ var Mr = { exports: {} };
|
|
|
175
175
|
}
|
|
176
176
|
function xe(e, t) {
|
|
177
177
|
typeof t == "function" && (t = t(ee(e))), (typeof Reflect > "u" ? R : Reflect.ownKeys)(t).forEach(function(n) {
|
|
178
|
-
|
|
178
|
+
Ae(e, n, t[n]);
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
181
|
var St = Object.defineProperty;
|
|
182
|
-
function
|
|
182
|
+
function Ae(e, t, n, i) {
|
|
183
183
|
St(e, t, Q(n && Z(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, i));
|
|
184
184
|
}
|
|
185
185
|
function He(e) {
|
|
186
186
|
return { from: function(t) {
|
|
187
|
-
return e.prototype = Object.create(t.prototype),
|
|
187
|
+
return e.prototype = Object.create(t.prototype), Ae(e.prototype, "constructor", e), { extend: xe.bind(null, e.prototype) };
|
|
188
188
|
} };
|
|
189
189
|
}
|
|
190
190
|
var Fr = Object.getOwnPropertyDescriptor, Ur = [].slice;
|
|
@@ -204,9 +204,9 @@ var Mr = { exports: {} };
|
|
|
204
204
|
if (typeof t == "string" && Z(e, t)) return e[t];
|
|
205
205
|
if (!t) return e;
|
|
206
206
|
if (typeof t != "string") {
|
|
207
|
-
for (var n = [], i = 0,
|
|
208
|
-
var
|
|
209
|
-
n.push(
|
|
207
|
+
for (var n = [], i = 0, o = t.length; i < o; ++i) {
|
|
208
|
+
var a = ve(e, t[i]);
|
|
209
|
+
n.push(a);
|
|
210
210
|
}
|
|
211
211
|
return n;
|
|
212
212
|
}
|
|
@@ -219,10 +219,10 @@ var Mr = { exports: {} };
|
|
|
219
219
|
function le(e, t, n) {
|
|
220
220
|
if (e && t !== void 0 && !("isFrozen" in Object && Object.isFrozen(e))) if (typeof t != "string" && "length" in t) {
|
|
221
221
|
it(typeof n != "string" && "length" in n);
|
|
222
|
-
for (var i = 0,
|
|
222
|
+
for (var i = 0, o = t.length; i < o; ++i) le(e, t[i], n[i]);
|
|
223
223
|
} else {
|
|
224
|
-
var
|
|
225
|
-
u !== -1 ? (
|
|
224
|
+
var a, c, u = t.indexOf(".");
|
|
225
|
+
u !== -1 ? (a = t.substr(0, u), (c = t.substr(u + 1)) === "" ? n === void 0 ? B(e) && !isNaN(parseInt(a)) ? e.splice(a, 1) : delete e[a] : e[a] = n : le(u = !(u = e[a]) || !Z(e, a) ? e[a] = {} : u, c, n)) : n === void 0 ? B(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n;
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
function Qn(e) {
|
|
@@ -242,22 +242,22 @@ var Mr = { exports: {} };
|
|
|
242
242
|
return D[e];
|
|
243
243
|
}), Jn = new Set(Se.map(function(e) {
|
|
244
244
|
return D[e];
|
|
245
|
-
})),
|
|
245
|
+
})), ot = null;
|
|
246
246
|
function Me(e) {
|
|
247
|
-
return
|
|
247
|
+
return ot = /* @__PURE__ */ new WeakMap(), e = function t(n) {
|
|
248
248
|
if (!n || typeof n != "object") return n;
|
|
249
|
-
var i =
|
|
249
|
+
var i = ot.get(n);
|
|
250
250
|
if (i) return i;
|
|
251
251
|
if (B(n)) {
|
|
252
|
-
i = [],
|
|
253
|
-
for (var
|
|
252
|
+
i = [], ot.set(n, i);
|
|
253
|
+
for (var o = 0, a = n.length; o < a; ++o) i.push(t(n[o]));
|
|
254
254
|
} else if (Jn.has(n.constructor)) i = n;
|
|
255
255
|
else {
|
|
256
256
|
var c, u = ee(n);
|
|
257
|
-
for (c in i = u === Object.prototype ? {} : Object.create(u),
|
|
257
|
+
for (c in i = u === Object.prototype ? {} : Object.create(u), ot.set(n, i), n) Z(n, c) && (i[c] = t(n[c]));
|
|
258
258
|
}
|
|
259
259
|
return i;
|
|
260
|
-
}(e),
|
|
260
|
+
}(e), ot = null, e;
|
|
261
261
|
}
|
|
262
262
|
var zr = {}.toString;
|
|
263
263
|
function en(e) {
|
|
@@ -274,12 +274,12 @@ var Mr = { exports: {} };
|
|
|
274
274
|
}
|
|
275
275
|
var Ye = {};
|
|
276
276
|
function we(e) {
|
|
277
|
-
var t, n, i,
|
|
277
|
+
var t, n, i, o;
|
|
278
278
|
if (arguments.length === 1) {
|
|
279
279
|
if (B(e)) return e.slice();
|
|
280
280
|
if (this === Ye && typeof e == "string") return [e];
|
|
281
|
-
if (
|
|
282
|
-
for (n = []; !(i =
|
|
281
|
+
if (o = Hr(e)) {
|
|
282
|
+
for (n = []; !(i = o.next()).done; ) n.push(i.value);
|
|
283
283
|
return n;
|
|
284
284
|
}
|
|
285
285
|
if (e == null) return [e];
|
|
@@ -301,8 +301,8 @@ var Mr = { exports: {} };
|
|
|
301
301
|
function Vn(e, t) {
|
|
302
302
|
return e + ". Errors: " + Object.keys(t).map(function(n) {
|
|
303
303
|
return t[n].toString();
|
|
304
|
-
}).filter(function(n, i,
|
|
305
|
-
return
|
|
304
|
+
}).filter(function(n, i, o) {
|
|
305
|
+
return o.indexOf(n) === i;
|
|
306
306
|
}).join(`
|
|
307
307
|
`);
|
|
308
308
|
}
|
|
@@ -321,9 +321,9 @@ var Mr = { exports: {} };
|
|
|
321
321
|
return e[t] = t + "Error", e;
|
|
322
322
|
}, {}), Qr = Qe, $ = he.reduce(function(e, t) {
|
|
323
323
|
var n = t + "Error";
|
|
324
|
-
function i(
|
|
325
|
-
this.name = n,
|
|
326
|
-
` +
|
|
324
|
+
function i(o, a) {
|
|
325
|
+
this.name = n, o ? typeof o == "string" ? (this.message = "".concat(o).concat(a ? `
|
|
326
|
+
` + a : ""), this.inner = a || null) : typeof o == "object" && (this.message = "".concat(o.name, " ").concat(o.message), this.inner = o) : (this.message = Yr[t] || n, this.inner = null);
|
|
327
327
|
}
|
|
328
328
|
return He(i).from(Qr), e[t] = i, e;
|
|
329
329
|
}, {});
|
|
@@ -335,11 +335,11 @@ var Mr = { exports: {} };
|
|
|
335
335
|
}, {});
|
|
336
336
|
function X() {
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function at(e) {
|
|
339
339
|
return e;
|
|
340
340
|
}
|
|
341
341
|
function Xr(e, t) {
|
|
342
|
-
return e == null || e ===
|
|
342
|
+
return e == null || e === at ? t : function(n) {
|
|
343
343
|
return t(e(n));
|
|
344
344
|
};
|
|
345
345
|
}
|
|
@@ -352,10 +352,10 @@ var Mr = { exports: {} };
|
|
|
352
352
|
return e === X ? t : function() {
|
|
353
353
|
var n = e.apply(this, arguments);
|
|
354
354
|
n !== void 0 && (arguments[0] = n);
|
|
355
|
-
var i = this.onsuccess,
|
|
355
|
+
var i = this.onsuccess, o = this.onerror;
|
|
356
356
|
this.onsuccess = null, this.onerror = null;
|
|
357
|
-
var
|
|
358
|
-
return i && (this.onsuccess = this.onsuccess ? Ke(i, this.onsuccess) : i),
|
|
357
|
+
var a = t.apply(this, arguments);
|
|
358
|
+
return i && (this.onsuccess = this.onsuccess ? Ke(i, this.onsuccess) : i), o && (this.onerror = this.onerror ? Ke(o, this.onerror) : o), a !== void 0 ? a : n;
|
|
359
359
|
};
|
|
360
360
|
}
|
|
361
361
|
function Vr(e, t) {
|
|
@@ -369,8 +369,8 @@ var Mr = { exports: {} };
|
|
|
369
369
|
return e === X ? t : function(n) {
|
|
370
370
|
var i = e.apply(this, arguments);
|
|
371
371
|
Q(n, i);
|
|
372
|
-
var
|
|
373
|
-
return this.onsuccess = null, this.onerror = null, n = t.apply(this, arguments),
|
|
372
|
+
var o = this.onsuccess, a = this.onerror;
|
|
373
|
+
return this.onsuccess = null, this.onerror = null, n = t.apply(this, arguments), o && (this.onsuccess = this.onsuccess ? Ke(o, this.onsuccess) : o), a && (this.onerror = this.onerror ? Ke(a, this.onerror) : a), i === void 0 ? n === void 0 ? void 0 : n : Q(i, n);
|
|
374
374
|
};
|
|
375
375
|
}
|
|
376
376
|
function qr(e, t) {
|
|
@@ -378,13 +378,13 @@ var Mr = { exports: {} };
|
|
|
378
378
|
return t.apply(this, arguments) !== !1 && e.apply(this, arguments);
|
|
379
379
|
};
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function on(e, t) {
|
|
382
382
|
return e === X ? t : function() {
|
|
383
383
|
var n = e.apply(this, arguments);
|
|
384
384
|
if (n && typeof n.then == "function") {
|
|
385
|
-
for (var i = this,
|
|
385
|
+
for (var i = this, o = arguments.length, a = new Array(o); o--; ) a[o] = arguments[o];
|
|
386
386
|
return n.then(function() {
|
|
387
|
-
return t.apply(i,
|
|
387
|
+
return t.apply(i, a);
|
|
388
388
|
});
|
|
389
389
|
}
|
|
390
390
|
return t.apply(this, arguments);
|
|
@@ -400,9 +400,9 @@ var Mr = { exports: {} };
|
|
|
400
400
|
if (typeof crypto > "u" || !crypto.subtle) return [e, ee(e), e];
|
|
401
401
|
var t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
402
402
|
return [t, ee(t), e];
|
|
403
|
-
}(), ct = Se[0], he = Se[1], Se = Se[2], he = he && he.then, Ne = ct && ct.constructor,
|
|
404
|
-
lt.push([e, t]),
|
|
405
|
-
}, sn = !0,
|
|
403
|
+
}(), ct = Se[0], he = Se[1], Se = Se[2], he = he && he.then, Ne = ct && ct.constructor, an = !!Se, ut = function(e, t) {
|
|
404
|
+
lt.push([e, t]), At && (queueMicrotask(ti), At = !1);
|
|
405
|
+
}, sn = !0, At = !0, Be = [], kt = [], cn = at, ke = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: X, pgp: !1, env: {}, finalize: X }, G = ke, lt = [], Le = 0, Dt = [];
|
|
406
406
|
function N(e) {
|
|
407
407
|
if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
|
|
408
408
|
this._listeners = [], this._lib = !1;
|
|
@@ -411,51 +411,51 @@ var Mr = { exports: {} };
|
|
|
411
411
|
if (e !== st) throw new TypeError("Not a function");
|
|
412
412
|
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && ln(this, this._value));
|
|
413
413
|
}
|
|
414
|
-
this._state = null, this._value = null, ++t.ref, function n(i,
|
|
414
|
+
this._state = null, this._value = null, ++t.ref, function n(i, o) {
|
|
415
415
|
try {
|
|
416
|
-
|
|
416
|
+
o(function(a) {
|
|
417
417
|
if (i._state === null) {
|
|
418
|
-
if (
|
|
418
|
+
if (a === i) throw new TypeError("A promise cannot be resolved with itself.");
|
|
419
419
|
var c = i._lib && Je();
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
}) : (i._state = !0, i._value =
|
|
420
|
+
a && typeof a.then == "function" ? n(i, function(u, h) {
|
|
421
|
+
a instanceof N ? a._then(u, h) : a.then(u, h);
|
|
422
|
+
}) : (i._state = !0, i._value = a, nr(i)), c && Ve();
|
|
423
423
|
}
|
|
424
424
|
}, ln.bind(null, i));
|
|
425
|
-
} catch (
|
|
426
|
-
ln(i,
|
|
425
|
+
} catch (a) {
|
|
426
|
+
ln(i, a);
|
|
427
427
|
}
|
|
428
428
|
}(this, e);
|
|
429
429
|
}
|
|
430
430
|
var un = { get: function() {
|
|
431
431
|
var e = G, t = Rt;
|
|
432
|
-
function n(i,
|
|
433
|
-
var
|
|
434
|
-
dn(
|
|
432
|
+
function n(i, o) {
|
|
433
|
+
var a = this, c = !e.global && (e !== G || t !== Rt), u = c && !Pe(), h = new N(function(g, b) {
|
|
434
|
+
dn(a, new tr(ir(i, e, c, u), ir(o, e, c, u), g, b, e));
|
|
435
435
|
});
|
|
436
436
|
return this._consoleTask && (h._consoleTask = this._consoleTask), h;
|
|
437
437
|
}
|
|
438
438
|
return n.prototype = st, n;
|
|
439
439
|
}, set: function(e) {
|
|
440
|
-
|
|
440
|
+
Ae(this, "then", e && e.prototype === st ? un : { get: function() {
|
|
441
441
|
return e;
|
|
442
442
|
}, set: un.set });
|
|
443
443
|
} };
|
|
444
|
-
function tr(e, t, n, i,
|
|
445
|
-
this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof t == "function" ? t : null, this.resolve = n, this.reject = i, this.psd =
|
|
444
|
+
function tr(e, t, n, i, o) {
|
|
445
|
+
this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof t == "function" ? t : null, this.resolve = n, this.reject = i, this.psd = o;
|
|
446
446
|
}
|
|
447
447
|
function ln(e, t) {
|
|
448
448
|
var n, i;
|
|
449
|
-
|
|
450
|
-
return
|
|
449
|
+
kt.push(t), e._state === null && (n = e._lib && Je(), t = cn(t), e._state = !1, e._value = t, i = e, Be.some(function(o) {
|
|
450
|
+
return o._value === i._value;
|
|
451
451
|
}) || Be.push(i), nr(e), n && Ve());
|
|
452
452
|
}
|
|
453
453
|
function nr(e) {
|
|
454
454
|
var t = e._listeners;
|
|
455
455
|
e._listeners = [];
|
|
456
456
|
for (var n = 0, i = t.length; n < i; ++n) dn(e, t[n]);
|
|
457
|
-
var
|
|
458
|
-
--
|
|
457
|
+
var o = e._PSD;
|
|
458
|
+
--o.ref || o.finalize(), Le === 0 && (++Le, ut(function() {
|
|
459
459
|
--Le == 0 && fn();
|
|
460
460
|
}, []));
|
|
461
461
|
}
|
|
@@ -468,26 +468,26 @@ var Mr = { exports: {} };
|
|
|
468
468
|
}
|
|
469
469
|
function ei(e, t, n) {
|
|
470
470
|
try {
|
|
471
|
-
var i,
|
|
472
|
-
!t._state &&
|
|
473
|
-
return e(
|
|
474
|
-
}) : e(
|
|
475
|
-
for (var c = Be.length; c; ) if (Be[--c]._value ===
|
|
471
|
+
var i, o = t._value;
|
|
472
|
+
!t._state && kt.length && (kt = []), i = ye && t._consoleTask ? t._consoleTask.run(function() {
|
|
473
|
+
return e(o);
|
|
474
|
+
}) : e(o), t._state || kt.indexOf(o) !== -1 || function(a) {
|
|
475
|
+
for (var c = Be.length; c; ) if (Be[--c]._value === a._value) return Be.splice(c, 1);
|
|
476
476
|
}(t), n.resolve(i);
|
|
477
|
-
} catch (
|
|
478
|
-
n.reject(
|
|
477
|
+
} catch (a) {
|
|
478
|
+
n.reject(a);
|
|
479
479
|
} finally {
|
|
480
480
|
--Le == 0 && fn(), --n.psd.ref || n.psd.finalize();
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
function ti() {
|
|
484
|
-
Ge(
|
|
484
|
+
Ge(ke, function() {
|
|
485
485
|
Je() && Ve();
|
|
486
486
|
});
|
|
487
487
|
}
|
|
488
488
|
function Je() {
|
|
489
489
|
var e = sn;
|
|
490
|
-
return
|
|
490
|
+
return At = sn = !1, e;
|
|
491
491
|
}
|
|
492
492
|
function Ve() {
|
|
493
493
|
var e, t, n;
|
|
@@ -497,7 +497,7 @@ var Mr = { exports: {} };
|
|
|
497
497
|
i[0].apply(null, i[1]);
|
|
498
498
|
}
|
|
499
499
|
while (0 < lt.length);
|
|
500
|
-
|
|
500
|
+
At = sn = !0;
|
|
501
501
|
}
|
|
502
502
|
function fn() {
|
|
503
503
|
var e = Be;
|
|
@@ -512,13 +512,13 @@ var Mr = { exports: {} };
|
|
|
512
512
|
function q(e, t) {
|
|
513
513
|
var n = G;
|
|
514
514
|
return function() {
|
|
515
|
-
var i = Je(),
|
|
515
|
+
var i = Je(), o = G;
|
|
516
516
|
try {
|
|
517
517
|
return Ie(n, !0), e.apply(this, arguments);
|
|
518
|
-
} catch (
|
|
519
|
-
t && t(
|
|
518
|
+
} catch (a) {
|
|
519
|
+
t && t(a);
|
|
520
520
|
} finally {
|
|
521
|
-
Ie(
|
|
521
|
+
Ie(o, !1), i && Ve();
|
|
522
522
|
}
|
|
523
523
|
};
|
|
524
524
|
}
|
|
@@ -544,20 +544,20 @@ var Mr = { exports: {} };
|
|
|
544
544
|
});
|
|
545
545
|
}, timeout: function(e, t) {
|
|
546
546
|
var n = this;
|
|
547
|
-
return e < 1 / 0 ? new N(function(i,
|
|
548
|
-
var
|
|
549
|
-
return
|
|
547
|
+
return e < 1 / 0 ? new N(function(i, o) {
|
|
548
|
+
var a = setTimeout(function() {
|
|
549
|
+
return o(new $.Timeout(t));
|
|
550
550
|
}, e);
|
|
551
|
-
n.then(i,
|
|
551
|
+
n.then(i, o).finally(clearTimeout.bind(null, a));
|
|
552
552
|
}) : this;
|
|
553
|
-
} }), typeof Symbol < "u" && Symbol.toStringTag &&
|
|
553
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && Ae(N.prototype, Symbol.toStringTag, "Dexie.Promise"), ke.env = rr(), xe(N, { all: function() {
|
|
554
554
|
var e = we.apply(null, arguments).map(Tt);
|
|
555
555
|
return new N(function(t, n) {
|
|
556
556
|
e.length === 0 && t([]);
|
|
557
557
|
var i = e.length;
|
|
558
|
-
e.forEach(function(
|
|
559
|
-
return N.resolve(
|
|
560
|
-
e[
|
|
558
|
+
e.forEach(function(o, a) {
|
|
559
|
+
return N.resolve(o).then(function(c) {
|
|
560
|
+
e[a] = c, --i || t(e);
|
|
561
561
|
}, n);
|
|
562
562
|
});
|
|
563
563
|
});
|
|
@@ -588,12 +588,12 @@ var Mr = { exports: {} };
|
|
|
588
588
|
cn = e;
|
|
589
589
|
} }, follow: function(e, t) {
|
|
590
590
|
return new N(function(n, i) {
|
|
591
|
-
return De(function(
|
|
591
|
+
return De(function(o, a) {
|
|
592
592
|
var c = G;
|
|
593
|
-
c.unhandleds = [], c.onunhandled =
|
|
593
|
+
c.unhandleds = [], c.onunhandled = a, c.finalize = Ke(function() {
|
|
594
594
|
var u, h = this;
|
|
595
595
|
u = function() {
|
|
596
|
-
h.unhandleds.length === 0 ?
|
|
596
|
+
h.unhandleds.length === 0 ? o() : a(h.unhandleds[0]);
|
|
597
597
|
}, Dt.push(function g() {
|
|
598
598
|
u(), Dt.splice(Dt.indexOf(g), 1);
|
|
599
599
|
}), ++Le, ut(function() {
|
|
@@ -602,41 +602,41 @@ var Mr = { exports: {} };
|
|
|
602
602
|
}, c.finalize), e();
|
|
603
603
|
}, t, n, i);
|
|
604
604
|
});
|
|
605
|
-
} }), Ne && (Ne.allSettled &&
|
|
605
|
+
} }), Ne && (Ne.allSettled && Ae(N, "allSettled", function() {
|
|
606
606
|
var e = we.apply(null, arguments).map(Tt);
|
|
607
607
|
return new N(function(t) {
|
|
608
608
|
e.length === 0 && t([]);
|
|
609
609
|
var n = e.length, i = new Array(n);
|
|
610
|
-
e.forEach(function(
|
|
611
|
-
return N.resolve(
|
|
612
|
-
return i[
|
|
610
|
+
e.forEach(function(o, a) {
|
|
611
|
+
return N.resolve(o).then(function(c) {
|
|
612
|
+
return i[a] = { status: "fulfilled", value: c };
|
|
613
613
|
}, function(c) {
|
|
614
|
-
return i[
|
|
614
|
+
return i[a] = { status: "rejected", reason: c };
|
|
615
615
|
}).then(function() {
|
|
616
616
|
return --n || t(i);
|
|
617
617
|
});
|
|
618
618
|
});
|
|
619
619
|
});
|
|
620
|
-
}), Ne.any && typeof AggregateError < "u" &&
|
|
620
|
+
}), Ne.any && typeof AggregateError < "u" && Ae(N, "any", function() {
|
|
621
621
|
var e = we.apply(null, arguments).map(Tt);
|
|
622
622
|
return new N(function(t, n) {
|
|
623
623
|
e.length === 0 && n(new AggregateError([]));
|
|
624
|
-
var i = e.length,
|
|
625
|
-
e.forEach(function(
|
|
626
|
-
return N.resolve(
|
|
624
|
+
var i = e.length, o = new Array(i);
|
|
625
|
+
e.forEach(function(a, c) {
|
|
626
|
+
return N.resolve(a).then(function(u) {
|
|
627
627
|
return t(u);
|
|
628
628
|
}, function(u) {
|
|
629
|
-
|
|
629
|
+
o[c] = u, --i || n(new AggregateError(o));
|
|
630
630
|
});
|
|
631
631
|
});
|
|
632
632
|
});
|
|
633
633
|
}), Ne.withResolvers && (N.withResolvers = Ne.withResolvers));
|
|
634
634
|
var ie = { awaits: 0, echoes: 0, id: 0 }, ni = 0, It = [], Ct = 0, Rt = 0, ri = 0;
|
|
635
635
|
function De(e, t, n, i) {
|
|
636
|
-
var
|
|
637
|
-
return
|
|
636
|
+
var o = G, a = Object.create(o);
|
|
637
|
+
return a.parent = o, a.ref = 0, a.global = !1, a.id = ++ri, ke.env, a.env = an ? { Promise: N, PromiseProp: { value: N, configurable: !0, writable: !0 }, all: N.all, race: N.race, allSettled: N.allSettled, any: N.any, resolve: N.resolve, reject: N.reject } : {}, t && Q(a, t), ++o.ref, a.finalize = function() {
|
|
638
638
|
--this.parent.ref || this.parent.finalize();
|
|
639
|
-
}, i = Ge(
|
|
639
|
+
}, i = Ge(a, e, n, i), a.ref === 0 && a.finalize(), i;
|
|
640
640
|
}
|
|
641
641
|
function Ze() {
|
|
642
642
|
return ie.id || (ie.id = ++ni), ++ie.awaits, ie.echoes += er, ie.id;
|
|
@@ -657,30 +657,30 @@ var Mr = { exports: {} };
|
|
|
657
657
|
}
|
|
658
658
|
function Ie(e, t) {
|
|
659
659
|
var n, i = G;
|
|
660
|
-
(t ? !ie.echoes || Ct++ && e === G : !Ct || --Ct && e === G) || queueMicrotask(t ? (function(
|
|
661
|
-
++Rt, ie.echoes && --ie.echoes != 0 || (ie.echoes = ie.awaits = ie.id = 0), It.push(G), Ie(
|
|
662
|
-
}).bind(null, e) : ii), e !== G && (G = e, i ===
|
|
660
|
+
(t ? !ie.echoes || Ct++ && e === G : !Ct || --Ct && e === G) || queueMicrotask(t ? (function(o) {
|
|
661
|
+
++Rt, ie.echoes && --ie.echoes != 0 || (ie.echoes = ie.awaits = ie.id = 0), It.push(G), Ie(o, !0);
|
|
662
|
+
}).bind(null, e) : ii), e !== G && (G = e, i === ke && (ke.env = rr()), an && (n = ke.env.Promise, t = e.env, (i.global || e.global) && (Object.defineProperty(D, "Promise", t.PromiseProp), n.all = t.all, n.race = t.race, n.resolve = t.resolve, n.reject = t.reject, t.allSettled && (n.allSettled = t.allSettled), t.any && (n.any = t.any))));
|
|
663
663
|
}
|
|
664
664
|
function rr() {
|
|
665
665
|
var e = D.Promise;
|
|
666
|
-
return
|
|
666
|
+
return an ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(D, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
|
|
667
667
|
}
|
|
668
|
-
function Ge(e, t, n, i,
|
|
669
|
-
var
|
|
668
|
+
function Ge(e, t, n, i, o) {
|
|
669
|
+
var a = G;
|
|
670
670
|
try {
|
|
671
|
-
return Ie(e, !0), t(n, i,
|
|
671
|
+
return Ie(e, !0), t(n, i, o);
|
|
672
672
|
} finally {
|
|
673
|
-
Ie(
|
|
673
|
+
Ie(a, !1);
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
676
|
function ir(e, t, n, i) {
|
|
677
677
|
return typeof e != "function" ? e : function() {
|
|
678
|
-
var
|
|
678
|
+
var o = G;
|
|
679
679
|
n && Ze(), Ie(t, !0);
|
|
680
680
|
try {
|
|
681
681
|
return e.apply(this, arguments);
|
|
682
682
|
} finally {
|
|
683
|
-
Ie(
|
|
683
|
+
Ie(o, !1), i && queueMicrotask(Pe);
|
|
684
684
|
}
|
|
685
685
|
};
|
|
686
686
|
}
|
|
@@ -688,13 +688,13 @@ var Mr = { exports: {} };
|
|
|
688
688
|
Promise === Ne && ie.echoes === 0 ? Ct === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
689
689
|
}
|
|
690
690
|
("" + he).indexOf("[native code]") === -1 && (Ze = Pe = X);
|
|
691
|
-
var te = N.reject, $e = "", _e = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",
|
|
691
|
+
var te = N.reject, $e = "", _e = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", or = "String expected.", qe = [], Mt = "__dbnames", pn = "readonly", gn = "readwrite";
|
|
692
692
|
function Fe(e, t) {
|
|
693
693
|
return e ? t ? function() {
|
|
694
694
|
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
695
695
|
} : e : t;
|
|
696
696
|
}
|
|
697
|
-
var
|
|
697
|
+
var ar = { type: 3, lower: -1 / 0, lowerOpen: !1, upper: [[]], upperOpen: !1 };
|
|
698
698
|
function jt(e) {
|
|
699
699
|
return typeof e != "string" || /\./.test(e) ? function(t) {
|
|
700
700
|
return t;
|
|
@@ -715,14 +715,14 @@ var Mr = { exports: {} };
|
|
|
715
715
|
case "string":
|
|
716
716
|
return t < e ? 1 : e < t ? -1 : 0;
|
|
717
717
|
case "binary":
|
|
718
|
-
return function(
|
|
719
|
-
for (var c =
|
|
718
|
+
return function(o, a) {
|
|
719
|
+
for (var c = o.length, u = a.length, h = c < u ? c : u, g = 0; g < h; ++g) if (o[g] !== a[g]) return o[g] < a[g] ? -1 : 1;
|
|
720
720
|
return c === u ? 0 : c < u ? -1 : 1;
|
|
721
721
|
}(ur(e), ur(t));
|
|
722
722
|
case "Array":
|
|
723
|
-
return function(
|
|
724
|
-
for (var c =
|
|
725
|
-
var b = H(
|
|
723
|
+
return function(o, a) {
|
|
724
|
+
for (var c = o.length, u = a.length, h = c < u ? c : u, g = 0; g < h; ++g) {
|
|
725
|
+
var b = H(o[g], a[g]);
|
|
726
726
|
if (b !== 0) return b;
|
|
727
727
|
}
|
|
728
728
|
return c === u ? 0 : c < u ? -1 : 1;
|
|
@@ -740,35 +740,35 @@ var Mr = { exports: {} };
|
|
|
740
740
|
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
741
741
|
}
|
|
742
742
|
var lr = (V.prototype._trans = function(e, t, n) {
|
|
743
|
-
var i = this._tx || G.trans,
|
|
744
|
-
function c(g, b,
|
|
745
|
-
if (!
|
|
746
|
-
return t(
|
|
743
|
+
var i = this._tx || G.trans, o = this.name, a = ye && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
744
|
+
function c(g, b, f) {
|
|
745
|
+
if (!f.schema[o]) throw new $.NotFound("Table " + o + " not part of transaction");
|
|
746
|
+
return t(f.idbtrans, f);
|
|
747
747
|
}
|
|
748
748
|
var u = Je();
|
|
749
749
|
try {
|
|
750
750
|
var h = i && i.db._novip === this.db._novip ? i === G.trans ? i._promise(e, c, n) : De(function() {
|
|
751
751
|
return i._promise(e, c, n);
|
|
752
|
-
}, { trans: i, transless: G.transless || G }) : function g(b,
|
|
752
|
+
}, { trans: i, transless: G.transless || G }) : function g(b, f, w, p) {
|
|
753
753
|
if (b.idbdb && (b._state.openComplete || G.letThrough || b._vip)) {
|
|
754
|
-
var m = b._createTransaction(
|
|
754
|
+
var m = b._createTransaction(f, w, b._dbSchema);
|
|
755
755
|
try {
|
|
756
756
|
m.create(), b._state.PR1398_maxLoop = 3;
|
|
757
757
|
} catch (v) {
|
|
758
758
|
return v.name === rn.InvalidState && b.isOpen() && 0 < --b._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), b.close({ disableAutoOpen: !1 }), b.open().then(function() {
|
|
759
|
-
return g(b,
|
|
759
|
+
return g(b, f, w, p);
|
|
760
760
|
})) : te(v);
|
|
761
761
|
}
|
|
762
|
-
return m._promise(
|
|
762
|
+
return m._promise(f, function(v, y) {
|
|
763
763
|
return De(function() {
|
|
764
764
|
return G.trans = m, p(v, y, m);
|
|
765
765
|
});
|
|
766
766
|
}).then(function(v) {
|
|
767
|
-
if (
|
|
767
|
+
if (f === "readwrite") try {
|
|
768
768
|
m.idbtrans.commit();
|
|
769
769
|
} catch {
|
|
770
770
|
}
|
|
771
|
-
return
|
|
771
|
+
return f === "readonly" ? v : m._completion.then(function() {
|
|
772
772
|
return v;
|
|
773
773
|
});
|
|
774
774
|
});
|
|
@@ -779,10 +779,10 @@ var Mr = { exports: {} };
|
|
|
779
779
|
b.open().catch(X);
|
|
780
780
|
}
|
|
781
781
|
return b._state.dbReadyPromise.then(function() {
|
|
782
|
-
return g(b,
|
|
782
|
+
return g(b, f, w, p);
|
|
783
783
|
});
|
|
784
784
|
}(this.db, e, [this.name], c);
|
|
785
|
-
return
|
|
785
|
+
return a && (h._consoleTask = a, h = h.catch(function(g) {
|
|
786
786
|
return console.trace(g), te(g);
|
|
787
787
|
})), h;
|
|
788
788
|
} finally {
|
|
@@ -791,8 +791,8 @@ var Mr = { exports: {} };
|
|
|
791
791
|
}, V.prototype.get = function(e, t) {
|
|
792
792
|
var n = this;
|
|
793
793
|
return e && e.constructor === Object ? this.where(e).first(t) : e == null ? te(new $.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(i) {
|
|
794
|
-
return n.core.get({ trans: i, key: e }).then(function(
|
|
795
|
-
return n.hook.reading.fire(
|
|
794
|
+
return n.core.get({ trans: i, key: e }).then(function(o) {
|
|
795
|
+
return n.hook.reading.fire(o);
|
|
796
796
|
});
|
|
797
797
|
}).then(t);
|
|
798
798
|
}, V.prototype.where = function(e) {
|
|
@@ -812,27 +812,27 @@ var Mr = { exports: {} };
|
|
|
812
812
|
return u.keyPath.length - h.keyPath.length;
|
|
813
813
|
})[0];
|
|
814
814
|
if (n && this.db._maxKey !== $e) {
|
|
815
|
-
var
|
|
816
|
-
return this.where(
|
|
815
|
+
var a = n.keyPath.slice(0, t.length);
|
|
816
|
+
return this.where(a).equals(a.map(function(h) {
|
|
817
817
|
return e[h];
|
|
818
818
|
}));
|
|
819
819
|
}
|
|
820
820
|
!n && ye && console.warn("The query ".concat(JSON.stringify(e), " on ").concat(this.name, " would benefit from a ") + "compound index [".concat(t.join("+"), "]"));
|
|
821
821
|
var i = this.schema.idxByName;
|
|
822
|
-
function
|
|
822
|
+
function o(u, h) {
|
|
823
823
|
return H(u, h) === 0;
|
|
824
824
|
}
|
|
825
|
-
var c = t.reduce(function(
|
|
826
|
-
var g =
|
|
827
|
-
return [g ||
|
|
825
|
+
var c = t.reduce(function(f, h) {
|
|
826
|
+
var g = f[0], b = f[1], f = i[h], w = e[h];
|
|
827
|
+
return [g || f, g || !f ? Fe(b, f && f.multi ? function(p) {
|
|
828
828
|
return p = ve(p, h), B(p) && p.some(function(m) {
|
|
829
|
-
return
|
|
829
|
+
return o(w, m);
|
|
830
830
|
});
|
|
831
831
|
} : function(p) {
|
|
832
|
-
return
|
|
832
|
+
return o(w, ve(p, h));
|
|
833
833
|
}) : b];
|
|
834
|
-
}, [null, null]),
|
|
835
|
-
return
|
|
834
|
+
}, [null, null]), a = c[0], c = c[1];
|
|
835
|
+
return a ? this.where(a.name).equals(e[a.keyPath]).filter(c) : n ? this.filter(c) : this.where(t).equals("");
|
|
836
836
|
}, V.prototype.filter = function(e) {
|
|
837
837
|
return this.toCollection().and(e);
|
|
838
838
|
}, V.prototype.count = function(e) {
|
|
@@ -853,7 +853,7 @@ var Mr = { exports: {} };
|
|
|
853
853
|
return this.toCollection().reverse();
|
|
854
854
|
}, V.prototype.mapToClass = function(e) {
|
|
855
855
|
var t, n = this.db, i = this.name;
|
|
856
|
-
function
|
|
856
|
+
function o() {
|
|
857
857
|
return t !== null && t.apply(this, arguments) || this;
|
|
858
858
|
}
|
|
859
859
|
(this.schema.mappedClass = e).prototype instanceof sr && (function(h, g) {
|
|
@@ -862,18 +862,18 @@ var Mr = { exports: {} };
|
|
|
862
862
|
this.constructor = h;
|
|
863
863
|
}
|
|
864
864
|
s(h, g), h.prototype = g === null ? Object.create(g) : (b.prototype = g.prototype, new b());
|
|
865
|
-
}(
|
|
865
|
+
}(o, t = e), Object.defineProperty(o.prototype, "db", { get: function() {
|
|
866
866
|
return n;
|
|
867
|
-
}, enumerable: !1, configurable: !0 }),
|
|
867
|
+
}, enumerable: !1, configurable: !0 }), o.prototype.table = function() {
|
|
868
868
|
return i;
|
|
869
|
-
}, e =
|
|
870
|
-
for (var
|
|
871
|
-
return
|
|
869
|
+
}, e = o);
|
|
870
|
+
for (var a = /* @__PURE__ */ new Set(), c = e.prototype; c; c = ee(c)) Object.getOwnPropertyNames(c).forEach(function(h) {
|
|
871
|
+
return a.add(h);
|
|
872
872
|
});
|
|
873
873
|
function u(h) {
|
|
874
874
|
if (!h) return h;
|
|
875
875
|
var g, b = Object.create(e.prototype);
|
|
876
|
-
for (g in h) if (!
|
|
876
|
+
for (g in h) if (!a.has(g)) try {
|
|
877
877
|
b[g] = h[g];
|
|
878
878
|
} catch {
|
|
879
879
|
}
|
|
@@ -885,14 +885,14 @@ var Mr = { exports: {} };
|
|
|
885
885
|
Q(this, e);
|
|
886
886
|
});
|
|
887
887
|
}, V.prototype.add = function(e, t) {
|
|
888
|
-
var n = this, i = this.schema.primKey,
|
|
889
|
-
return
|
|
888
|
+
var n = this, i = this.schema.primKey, o = i.auto, a = i.keyPath, c = e;
|
|
889
|
+
return a && o && (c = jt(a)(e)), this._trans("readwrite", function(u) {
|
|
890
890
|
return n.core.mutate({ trans: u, type: "add", keys: t != null ? [t] : null, values: [c] });
|
|
891
891
|
}).then(function(u) {
|
|
892
892
|
return u.numFailures ? N.reject(u.failures[0]) : u.lastResult;
|
|
893
893
|
}).then(function(u) {
|
|
894
|
-
if (
|
|
895
|
-
le(e,
|
|
894
|
+
if (a) try {
|
|
895
|
+
le(e, a, u);
|
|
896
896
|
} catch {
|
|
897
897
|
}
|
|
898
898
|
return u;
|
|
@@ -900,14 +900,14 @@ var Mr = { exports: {} };
|
|
|
900
900
|
}, V.prototype.update = function(e, t) {
|
|
901
901
|
return typeof e != "object" || B(e) ? this.where(":id").equals(e).modify(t) : (e = ve(e, this.schema.primKey.keyPath), e === void 0 ? te(new $.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t));
|
|
902
902
|
}, V.prototype.put = function(e, t) {
|
|
903
|
-
var n = this, i = this.schema.primKey,
|
|
904
|
-
return
|
|
903
|
+
var n = this, i = this.schema.primKey, o = i.auto, a = i.keyPath, c = e;
|
|
904
|
+
return a && o && (c = jt(a)(e)), this._trans("readwrite", function(u) {
|
|
905
905
|
return n.core.mutate({ trans: u, type: "put", values: [c], keys: t != null ? [t] : null });
|
|
906
906
|
}).then(function(u) {
|
|
907
907
|
return u.numFailures ? N.reject(u.failures[0]) : u.lastResult;
|
|
908
908
|
}).then(function(u) {
|
|
909
|
-
if (
|
|
910
|
-
le(e,
|
|
909
|
+
if (a) try {
|
|
910
|
+
le(e, a, u);
|
|
911
911
|
} catch {
|
|
912
912
|
}
|
|
913
913
|
return u;
|
|
@@ -922,7 +922,7 @@ var Mr = { exports: {} };
|
|
|
922
922
|
}, V.prototype.clear = function() {
|
|
923
923
|
var e = this;
|
|
924
924
|
return this._trans("readwrite", function(t) {
|
|
925
|
-
return e.core.mutate({ trans: t, type: "deleteRange", range:
|
|
925
|
+
return e.core.mutate({ trans: t, type: "deleteRange", range: ar });
|
|
926
926
|
}).then(function(t) {
|
|
927
927
|
return t.numFailures ? N.reject(t.failures[0]) : void 0;
|
|
928
928
|
});
|
|
@@ -930,48 +930,48 @@ var Mr = { exports: {} };
|
|
|
930
930
|
var t = this;
|
|
931
931
|
return this._trans("readonly", function(n) {
|
|
932
932
|
return t.core.getMany({ keys: e, trans: n }).then(function(i) {
|
|
933
|
-
return i.map(function(
|
|
934
|
-
return t.hook.reading.fire(
|
|
933
|
+
return i.map(function(o) {
|
|
934
|
+
return t.hook.reading.fire(o);
|
|
935
935
|
});
|
|
936
936
|
});
|
|
937
937
|
});
|
|
938
938
|
}, V.prototype.bulkAdd = function(e, t, n) {
|
|
939
|
-
var i = this,
|
|
939
|
+
var i = this, o = Array.isArray(t) ? t : void 0, a = (n = n || (o ? void 0 : t)) ? n.allKeys : void 0;
|
|
940
940
|
return this._trans("readwrite", function(c) {
|
|
941
941
|
var g = i.schema.primKey, u = g.auto, g = g.keyPath;
|
|
942
|
-
if (g &&
|
|
943
|
-
if (
|
|
942
|
+
if (g && o) throw new $.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
943
|
+
if (o && o.length !== e.length) throw new $.InvalidArgument("Arguments objects and keys must have the same length");
|
|
944
944
|
var h = e.length, g = g && u ? e.map(jt(g)) : e;
|
|
945
|
-
return i.core.mutate({ trans: c, type: "add", keys:
|
|
946
|
-
var
|
|
947
|
-
if (
|
|
948
|
-
throw new Xe("".concat(i.name, ".bulkAdd(): ").concat(
|
|
945
|
+
return i.core.mutate({ trans: c, type: "add", keys: o, values: g, wantResults: a }).then(function(m) {
|
|
946
|
+
var f = m.numFailures, w = m.results, p = m.lastResult, m = m.failures;
|
|
947
|
+
if (f === 0) return a ? w : p;
|
|
948
|
+
throw new Xe("".concat(i.name, ".bulkAdd(): ").concat(f, " of ").concat(h, " operations failed"), m);
|
|
949
949
|
});
|
|
950
950
|
});
|
|
951
951
|
}, V.prototype.bulkPut = function(e, t, n) {
|
|
952
|
-
var i = this,
|
|
952
|
+
var i = this, o = Array.isArray(t) ? t : void 0, a = (n = n || (o ? void 0 : t)) ? n.allKeys : void 0;
|
|
953
953
|
return this._trans("readwrite", function(c) {
|
|
954
954
|
var g = i.schema.primKey, u = g.auto, g = g.keyPath;
|
|
955
|
-
if (g &&
|
|
956
|
-
if (
|
|
955
|
+
if (g && o) throw new $.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
956
|
+
if (o && o.length !== e.length) throw new $.InvalidArgument("Arguments objects and keys must have the same length");
|
|
957
957
|
var h = e.length, g = g && u ? e.map(jt(g)) : e;
|
|
958
|
-
return i.core.mutate({ trans: c, type: "put", keys:
|
|
959
|
-
var
|
|
960
|
-
if (
|
|
961
|
-
throw new Xe("".concat(i.name, ".bulkPut(): ").concat(
|
|
958
|
+
return i.core.mutate({ trans: c, type: "put", keys: o, values: g, wantResults: a }).then(function(m) {
|
|
959
|
+
var f = m.numFailures, w = m.results, p = m.lastResult, m = m.failures;
|
|
960
|
+
if (f === 0) return a ? w : p;
|
|
961
|
+
throw new Xe("".concat(i.name, ".bulkPut(): ").concat(f, " of ").concat(h, " operations failed"), m);
|
|
962
962
|
});
|
|
963
963
|
});
|
|
964
964
|
}, V.prototype.bulkUpdate = function(e) {
|
|
965
965
|
var t = this, n = this.core, i = e.map(function(c) {
|
|
966
966
|
return c.key;
|
|
967
|
-
}),
|
|
967
|
+
}), o = e.map(function(c) {
|
|
968
968
|
return c.changes;
|
|
969
|
-
}),
|
|
969
|
+
}), a = [];
|
|
970
970
|
return this._trans("readwrite", function(c) {
|
|
971
971
|
return n.getMany({ trans: c, keys: i, cache: "clone" }).then(function(u) {
|
|
972
972
|
var h = [], g = [];
|
|
973
|
-
e.forEach(function(
|
|
974
|
-
var p =
|
|
973
|
+
e.forEach(function(f, w) {
|
|
974
|
+
var p = f.key, m = f.changes, v = u[w];
|
|
975
975
|
if (v) {
|
|
976
976
|
for (var y = 0, S = Object.keys(m); y < S.length; y++) {
|
|
977
977
|
var E = S[y], O = m[E];
|
|
@@ -979,15 +979,15 @@ var Mr = { exports: {} };
|
|
|
979
979
|
if (H(O, p) !== 0) throw new $.Constraint("Cannot update primary key in bulkUpdate()");
|
|
980
980
|
} else le(v, E, O);
|
|
981
981
|
}
|
|
982
|
-
|
|
982
|
+
a.push(w), h.push(p), g.push(v);
|
|
983
983
|
}
|
|
984
984
|
});
|
|
985
985
|
var b = h.length;
|
|
986
|
-
return n.mutate({ trans: c, type: "put", keys: h, values: g, updates: { keys: i, changeSpecs:
|
|
987
|
-
var w =
|
|
986
|
+
return n.mutate({ trans: c, type: "put", keys: h, values: g, updates: { keys: i, changeSpecs: o } }).then(function(f) {
|
|
987
|
+
var w = f.numFailures, p = f.failures;
|
|
988
988
|
if (w === 0) return b;
|
|
989
989
|
for (var m = 0, v = Object.keys(p); m < v.length; m++) {
|
|
990
|
-
var y, S = v[m], E =
|
|
990
|
+
var y, S = v[m], E = a[Number(S)];
|
|
991
991
|
E != null && (y = p[S], delete p[S], p[E] = y);
|
|
992
992
|
}
|
|
993
993
|
throw new Xe("".concat(t.name, ".bulkUpdate(): ").concat(w, " of ").concat(b, " operations failed"), p);
|
|
@@ -999,9 +999,9 @@ var Mr = { exports: {} };
|
|
|
999
999
|
return this._trans("readwrite", function(i) {
|
|
1000
1000
|
return t.core.mutate({ trans: i, type: "delete", keys: e });
|
|
1001
1001
|
}).then(function(c) {
|
|
1002
|
-
var
|
|
1003
|
-
if (
|
|
1004
|
-
throw new Xe("".concat(t.name, ".bulkDelete(): ").concat(
|
|
1002
|
+
var o = c.numFailures, a = c.lastResult, c = c.failures;
|
|
1003
|
+
if (o === 0) return a;
|
|
1004
|
+
throw new Xe("".concat(t.name, ".bulkDelete(): ").concat(o, " of ").concat(n, " operations failed"), c);
|
|
1005
1005
|
});
|
|
1006
1006
|
}, V);
|
|
1007
1007
|
function V() {
|
|
@@ -1015,28 +1015,28 @@ var Mr = { exports: {} };
|
|
|
1015
1015
|
if (typeof c == "string") return n[c];
|
|
1016
1016
|
}
|
|
1017
1017
|
var n = {};
|
|
1018
|
-
t.addEventType =
|
|
1019
|
-
for (var i = 1,
|
|
1018
|
+
t.addEventType = a;
|
|
1019
|
+
for (var i = 1, o = arguments.length; i < o; ++i) a(arguments[i]);
|
|
1020
1020
|
return t;
|
|
1021
|
-
function
|
|
1021
|
+
function a(c, u, h) {
|
|
1022
1022
|
if (typeof c != "object") {
|
|
1023
1023
|
var g;
|
|
1024
1024
|
u = u || qr;
|
|
1025
|
-
var b = { subscribers: [], fire: h = h || X, subscribe: function(
|
|
1026
|
-
b.subscribers.indexOf(
|
|
1027
|
-
}, unsubscribe: function(
|
|
1025
|
+
var b = { subscribers: [], fire: h = h || X, subscribe: function(f) {
|
|
1026
|
+
b.subscribers.indexOf(f) === -1 && (b.subscribers.push(f), b.fire = u(b.fire, f));
|
|
1027
|
+
}, unsubscribe: function(f) {
|
|
1028
1028
|
b.subscribers = b.subscribers.filter(function(w) {
|
|
1029
|
-
return w !==
|
|
1029
|
+
return w !== f;
|
|
1030
1030
|
}), b.fire = b.subscribers.reduce(u, h);
|
|
1031
1031
|
} };
|
|
1032
1032
|
return n[c] = t[c] = b;
|
|
1033
1033
|
}
|
|
1034
|
-
R(g = c).forEach(function(
|
|
1035
|
-
var w = g[
|
|
1036
|
-
if (B(w))
|
|
1034
|
+
R(g = c).forEach(function(f) {
|
|
1035
|
+
var w = g[f];
|
|
1036
|
+
if (B(w)) a(f, g[f][0], g[f][1]);
|
|
1037
1037
|
else {
|
|
1038
1038
|
if (w !== "asap") throw new $.InvalidArgument("Invalid event config");
|
|
1039
|
-
var p =
|
|
1039
|
+
var p = a(f, at, function() {
|
|
1040
1040
|
for (var m = arguments.length, v = new Array(m); m--; ) v[m] = arguments[m];
|
|
1041
1041
|
p.subscribers.forEach(function(y) {
|
|
1042
1042
|
Yn(function() {
|
|
@@ -1074,36 +1074,36 @@ var Mr = { exports: {} };
|
|
|
1074
1074
|
return t.openCursor({ trans: n, values: !e.keysOnly, reverse: e.dir === "prev", unique: !!e.unique, query: { index: i, range: e.range } });
|
|
1075
1075
|
}
|
|
1076
1076
|
function Nt(e, t, n, i) {
|
|
1077
|
-
var
|
|
1077
|
+
var o = e.replayFilter ? Fe(e.filter, e.replayFilter()) : e.filter;
|
|
1078
1078
|
if (e.or) {
|
|
1079
|
-
var
|
|
1080
|
-
var b,
|
|
1081
|
-
|
|
1079
|
+
var a = {}, c = function(u, h, g) {
|
|
1080
|
+
var b, f;
|
|
1081
|
+
o && !o(h, g, function(w) {
|
|
1082
1082
|
return h.stop(w);
|
|
1083
1083
|
}, function(w) {
|
|
1084
1084
|
return h.fail(w);
|
|
1085
|
-
}) || ((
|
|
1085
|
+
}) || ((f = "" + (b = h.primaryKey)) == "[object ArrayBuffer]" && (f = "" + new Uint8Array(b)), Z(a, f) || (a[f] = !0, t(u, h, g)));
|
|
1086
1086
|
};
|
|
1087
1087
|
return Promise.all([e.or._iterate(c, n), fr(dr(e, i, n), e.algorithm, c, !e.keysOnly && e.valueMapper)]);
|
|
1088
1088
|
}
|
|
1089
|
-
return fr(dr(e, i, n), Fe(e.algorithm,
|
|
1089
|
+
return fr(dr(e, i, n), Fe(e.algorithm, o), t, !e.keysOnly && e.valueMapper);
|
|
1090
1090
|
}
|
|
1091
1091
|
function fr(e, t, n, i) {
|
|
1092
|
-
var
|
|
1093
|
-
return n(i(
|
|
1092
|
+
var o = q(i ? function(a, c, u) {
|
|
1093
|
+
return n(i(a), c, u);
|
|
1094
1094
|
} : n);
|
|
1095
|
-
return e.then(function(
|
|
1096
|
-
if (
|
|
1095
|
+
return e.then(function(a) {
|
|
1096
|
+
if (a) return a.start(function() {
|
|
1097
1097
|
var c = function() {
|
|
1098
|
-
return
|
|
1098
|
+
return a.continue();
|
|
1099
1099
|
};
|
|
1100
|
-
t && !t(
|
|
1100
|
+
t && !t(a, function(u) {
|
|
1101
1101
|
return c = u;
|
|
1102
1102
|
}, function(u) {
|
|
1103
|
-
|
|
1103
|
+
a.stop(u), c = X;
|
|
1104
1104
|
}, function(u) {
|
|
1105
|
-
|
|
1106
|
-
}) || a
|
|
1105
|
+
a.fail(u), c = X;
|
|
1106
|
+
}) || o(a.value, a, function(u) {
|
|
1107
1107
|
return c = u;
|
|
1108
1108
|
}), c();
|
|
1109
1109
|
});
|
|
@@ -1112,7 +1112,7 @@ var Mr = { exports: {} };
|
|
|
1112
1112
|
var Se = Symbol(), ht = (hr.prototype.execute = function(e) {
|
|
1113
1113
|
if (this.add !== void 0) {
|
|
1114
1114
|
var t = this.add;
|
|
1115
|
-
if (B(t)) return
|
|
1115
|
+
if (B(t)) return x(x([], B(e) ? e : [], !0), t).sort();
|
|
1116
1116
|
if (typeof t == "number") return (Number(e) || 0) + t;
|
|
1117
1117
|
if (typeof t == "bigint") try {
|
|
1118
1118
|
return BigInt(e) + t;
|
|
@@ -1139,7 +1139,7 @@ var Mr = { exports: {} };
|
|
|
1139
1139
|
function hr(e) {
|
|
1140
1140
|
Object.assign(this, e);
|
|
1141
1141
|
}
|
|
1142
|
-
var
|
|
1142
|
+
var oi = (Y.prototype._read = function(e, t) {
|
|
1143
1143
|
var n = this._ctx;
|
|
1144
1144
|
return n.error ? n.table._trans(null, te.bind(null, n.error)) : n.table._trans("readonly", e).then(t);
|
|
1145
1145
|
}, Y.prototype._write = function(e) {
|
|
@@ -1163,25 +1163,25 @@ var Mr = { exports: {} };
|
|
|
1163
1163
|
}, Y.prototype.count = function(e) {
|
|
1164
1164
|
var t = this;
|
|
1165
1165
|
return this._read(function(n) {
|
|
1166
|
-
var i = t._ctx,
|
|
1167
|
-
if (et(i, !0)) return
|
|
1166
|
+
var i = t._ctx, o = i.table.core;
|
|
1167
|
+
if (et(i, !0)) return o.count({ trans: n, query: { index: Kt(i, o.schema), range: i.range } }).then(function(c) {
|
|
1168
1168
|
return Math.min(c, i.limit);
|
|
1169
1169
|
});
|
|
1170
|
-
var
|
|
1170
|
+
var a = 0;
|
|
1171
1171
|
return Nt(i, function() {
|
|
1172
|
-
return ++
|
|
1173
|
-
}, n,
|
|
1174
|
-
return
|
|
1172
|
+
return ++a, !1;
|
|
1173
|
+
}, n, o).then(function() {
|
|
1174
|
+
return a;
|
|
1175
1175
|
});
|
|
1176
1176
|
}).then(e);
|
|
1177
1177
|
}, Y.prototype.sortBy = function(e, t) {
|
|
1178
|
-
var n = e.split(".").reverse(), i = n[0],
|
|
1179
|
-
function
|
|
1180
|
-
return g ?
|
|
1178
|
+
var n = e.split(".").reverse(), i = n[0], o = n.length - 1;
|
|
1179
|
+
function a(h, g) {
|
|
1180
|
+
return g ? a(h[n[g]], g - 1) : h[i];
|
|
1181
1181
|
}
|
|
1182
1182
|
var c = this._ctx.dir === "next" ? 1 : -1;
|
|
1183
1183
|
function u(h, g) {
|
|
1184
|
-
return H(
|
|
1184
|
+
return H(a(h, o), a(g, o)) * c;
|
|
1185
1185
|
}
|
|
1186
1186
|
return this.toArray(function(h) {
|
|
1187
1187
|
return h.sort(u);
|
|
@@ -1191,9 +1191,9 @@ var Mr = { exports: {} };
|
|
|
1191
1191
|
return this._read(function(n) {
|
|
1192
1192
|
var i = t._ctx;
|
|
1193
1193
|
if (i.dir === "next" && et(i, !0) && 0 < i.limit) {
|
|
1194
|
-
var
|
|
1195
|
-
return i.table.core.query({ trans: n, limit: i.limit, values: !0, query: { index:
|
|
1196
|
-
return u = u.result,
|
|
1194
|
+
var o = i.valueMapper, a = Kt(i, i.table.core.schema);
|
|
1195
|
+
return i.table.core.query({ trans: n, limit: i.limit, values: !0, query: { index: a, range: i.range } }).then(function(u) {
|
|
1196
|
+
return u = u.result, o ? u.map(o) : u;
|
|
1197
1197
|
});
|
|
1198
1198
|
}
|
|
1199
1199
|
var c = [];
|
|
@@ -1207,8 +1207,8 @@ var Mr = { exports: {} };
|
|
|
1207
1207
|
var t = this._ctx;
|
|
1208
1208
|
return e <= 0 || (t.offset += e, et(t) ? mn(t, function() {
|
|
1209
1209
|
var n = e;
|
|
1210
|
-
return function(i,
|
|
1211
|
-
return n === 0 || (n === 1 ? --n :
|
|
1210
|
+
return function(i, o) {
|
|
1211
|
+
return n === 0 || (n === 1 ? --n : o(function() {
|
|
1212
1212
|
i.advance(n), n = 0;
|
|
1213
1213
|
}), !1);
|
|
1214
1214
|
};
|
|
@@ -1221,13 +1221,13 @@ var Mr = { exports: {} };
|
|
|
1221
1221
|
}, Y.prototype.limit = function(e) {
|
|
1222
1222
|
return this._ctx.limit = Math.min(this._ctx.limit, e), mn(this._ctx, function() {
|
|
1223
1223
|
var t = e;
|
|
1224
|
-
return function(n, i,
|
|
1225
|
-
return --t <= 0 && i(
|
|
1224
|
+
return function(n, i, o) {
|
|
1225
|
+
return --t <= 0 && i(o), 0 <= t;
|
|
1226
1226
|
};
|
|
1227
1227
|
}, !0), this;
|
|
1228
1228
|
}, Y.prototype.until = function(e, t) {
|
|
1229
|
-
return yn(this._ctx, function(n, i,
|
|
1230
|
-
return !e(n.value) || (i(
|
|
1229
|
+
return yn(this._ctx, function(n, i, o) {
|
|
1230
|
+
return !e(n.value) || (i(o), t);
|
|
1231
1231
|
}), this;
|
|
1232
1232
|
}, Y.prototype.first = function(e) {
|
|
1233
1233
|
return this.limit(1).toArray(function(t) {
|
|
@@ -1264,23 +1264,23 @@ var Mr = { exports: {} };
|
|
|
1264
1264
|
var t = this._ctx;
|
|
1265
1265
|
t.keysOnly = !t.isMatch;
|
|
1266
1266
|
var n = [];
|
|
1267
|
-
return this.each(function(i,
|
|
1268
|
-
n.push(
|
|
1267
|
+
return this.each(function(i, o) {
|
|
1268
|
+
n.push(o.key);
|
|
1269
1269
|
}).then(function() {
|
|
1270
1270
|
return n;
|
|
1271
1271
|
}).then(e);
|
|
1272
1272
|
}, Y.prototype.primaryKeys = function(e) {
|
|
1273
1273
|
var t = this._ctx;
|
|
1274
1274
|
if (t.dir === "next" && et(t, !0) && 0 < t.limit) return this._read(function(i) {
|
|
1275
|
-
var
|
|
1276
|
-
return t.table.core.query({ trans: i, values: !1, limit: t.limit, query: { index:
|
|
1275
|
+
var o = Kt(t, t.table.core.schema);
|
|
1276
|
+
return t.table.core.query({ trans: i, values: !1, limit: t.limit, query: { index: o, range: t.range } });
|
|
1277
1277
|
}).then(function(i) {
|
|
1278
1278
|
return i.result;
|
|
1279
1279
|
}).then(e);
|
|
1280
1280
|
t.keysOnly = !t.isMatch;
|
|
1281
1281
|
var n = [];
|
|
1282
|
-
return this.each(function(i,
|
|
1283
|
-
n.push(
|
|
1282
|
+
return this.each(function(i, o) {
|
|
1283
|
+
n.push(o.primaryKey);
|
|
1284
1284
|
}).then(function() {
|
|
1285
1285
|
return n;
|
|
1286
1286
|
}).then(e);
|
|
@@ -1296,37 +1296,37 @@ var Mr = { exports: {} };
|
|
|
1296
1296
|
var e = this._ctx, e = e.index && e.table.schema.idxByName[e.index];
|
|
1297
1297
|
if (!e || !e.multi) return this;
|
|
1298
1298
|
var t = {};
|
|
1299
|
-
return yn(this._ctx, function(
|
|
1300
|
-
var i =
|
|
1301
|
-
return t[i] = !0, !
|
|
1299
|
+
return yn(this._ctx, function(o) {
|
|
1300
|
+
var i = o.primaryKey.toString(), o = Z(t, i);
|
|
1301
|
+
return t[i] = !0, !o;
|
|
1302
1302
|
}), this;
|
|
1303
1303
|
}, Y.prototype.modify = function(e) {
|
|
1304
1304
|
var t = this, n = this._ctx;
|
|
1305
1305
|
return this._write(function(i) {
|
|
1306
|
-
var
|
|
1307
|
-
c = typeof e == "function" ? e : (
|
|
1308
|
-
for (var S = !1, E = 0; E <
|
|
1309
|
-
var O =
|
|
1310
|
-
|
|
1306
|
+
var o, a, c;
|
|
1307
|
+
c = typeof e == "function" ? e : (o = R(e), a = o.length, function(y) {
|
|
1308
|
+
for (var S = !1, E = 0; E < a; ++E) {
|
|
1309
|
+
var O = o[E], A = e[O], P = ve(y, O);
|
|
1310
|
+
A instanceof ht ? (le(y, O, A.execute(P)), S = !0) : P !== A && (le(y, O, A), S = !0);
|
|
1311
1311
|
}
|
|
1312
1312
|
return S;
|
|
1313
1313
|
});
|
|
1314
|
-
var u = n.table.core,
|
|
1315
|
-
|
|
1314
|
+
var u = n.table.core, f = u.schema.primaryKey, h = f.outbound, g = f.extractKey, b = 200, f = t.db._options.modifyChunkSize;
|
|
1315
|
+
f && (b = typeof f == "object" ? f[u.name] || f["*"] || 200 : f);
|
|
1316
1316
|
function w(y, O) {
|
|
1317
1317
|
var E = O.failures, O = O.numFailures;
|
|
1318
1318
|
m += y - O;
|
|
1319
|
-
for (var
|
|
1320
|
-
var M = P[
|
|
1319
|
+
for (var A = 0, P = R(E); A < P.length; A++) {
|
|
1320
|
+
var M = P[A];
|
|
1321
1321
|
p.push(E[M]);
|
|
1322
1322
|
}
|
|
1323
1323
|
}
|
|
1324
1324
|
var p = [], m = 0, v = [];
|
|
1325
1325
|
return t.clone().primaryKeys().then(function(y) {
|
|
1326
1326
|
function S(O) {
|
|
1327
|
-
var
|
|
1328
|
-
return u.getMany({ trans: i, keys: y.slice(O, O +
|
|
1329
|
-
for (var M = [], I = [], C = h ? [] : null, j = [], T = 0; T <
|
|
1327
|
+
var A = Math.min(b, y.length - O);
|
|
1328
|
+
return u.getMany({ trans: i, keys: y.slice(O, O + A), cache: "immutable" }).then(function(P) {
|
|
1329
|
+
for (var M = [], I = [], C = h ? [] : null, j = [], T = 0; T < A; ++T) {
|
|
1330
1330
|
var L = P[T], U = { value: Me(L), primKey: y[O + T] };
|
|
1331
1331
|
c.call(U, U.value, U) !== !1 && (U.value == null ? j.push(y[O + T]) : h || H(g(L), g(U.value)) === 0 ? (I.push(U.value), h && C.push(y[O + T])) : (j.push(y[O + T]), M.push(U.value)));
|
|
1332
1332
|
}
|
|
@@ -1342,7 +1342,7 @@ var Mr = { exports: {} };
|
|
|
1342
1342
|
return w(j.length, W);
|
|
1343
1343
|
});
|
|
1344
1344
|
}).then(function() {
|
|
1345
|
-
return y.length > O +
|
|
1345
|
+
return y.length > O + A && S(O + b);
|
|
1346
1346
|
});
|
|
1347
1347
|
});
|
|
1348
1348
|
}
|
|
@@ -1356,14 +1356,14 @@ var Mr = { exports: {} };
|
|
|
1356
1356
|
}, Y.prototype.delete = function() {
|
|
1357
1357
|
var e = this._ctx, t = e.range;
|
|
1358
1358
|
return et(e) && (e.isPrimKey || t.type === 3) ? this._write(function(n) {
|
|
1359
|
-
var i = e.table.core.schema.primaryKey,
|
|
1360
|
-
return e.table.core.count({ trans: n, query: { index: i, range:
|
|
1361
|
-
return e.table.core.mutate({ trans: n, type: "deleteRange", range:
|
|
1359
|
+
var i = e.table.core.schema.primaryKey, o = t;
|
|
1360
|
+
return e.table.core.count({ trans: n, query: { index: i, range: o } }).then(function(a) {
|
|
1361
|
+
return e.table.core.mutate({ trans: n, type: "deleteRange", range: o }).then(function(c) {
|
|
1362
1362
|
var u = c.failures;
|
|
1363
1363
|
if (c.lastResult, c.results, c = c.numFailures, c) throw new Ot("Could not delete some values", Object.keys(u).map(function(h) {
|
|
1364
1364
|
return u[h];
|
|
1365
|
-
}),
|
|
1366
|
-
return
|
|
1365
|
+
}), a - c);
|
|
1366
|
+
return a - c;
|
|
1367
1367
|
});
|
|
1368
1368
|
});
|
|
1369
1369
|
}) : this.modify(bn);
|
|
@@ -1373,7 +1373,7 @@ var Mr = { exports: {} };
|
|
|
1373
1373
|
var bn = function(e, t) {
|
|
1374
1374
|
return t.value = null;
|
|
1375
1375
|
};
|
|
1376
|
-
function
|
|
1376
|
+
function ai(e, t) {
|
|
1377
1377
|
return e < t ? -1 : e === t ? 0 : 1;
|
|
1378
1378
|
}
|
|
1379
1379
|
function si(e, t) {
|
|
@@ -1388,22 +1388,22 @@ var Mr = { exports: {} };
|
|
|
1388
1388
|
}).limit(0);
|
|
1389
1389
|
}
|
|
1390
1390
|
function Bt(e, t, n, i) {
|
|
1391
|
-
var
|
|
1391
|
+
var o, a, c, u, h, g, b, f = n.length;
|
|
1392
1392
|
if (!n.every(function(m) {
|
|
1393
1393
|
return typeof m == "string";
|
|
1394
|
-
})) return de(e,
|
|
1394
|
+
})) return de(e, or);
|
|
1395
1395
|
function w(m) {
|
|
1396
|
-
|
|
1396
|
+
o = m === "next" ? function(y) {
|
|
1397
1397
|
return y.toUpperCase();
|
|
1398
1398
|
} : function(y) {
|
|
1399
1399
|
return y.toLowerCase();
|
|
1400
|
-
},
|
|
1400
|
+
}, a = m === "next" ? function(y) {
|
|
1401
1401
|
return y.toLowerCase();
|
|
1402
1402
|
} : function(y) {
|
|
1403
1403
|
return y.toUpperCase();
|
|
1404
|
-
}, c = m === "next" ?
|
|
1404
|
+
}, c = m === "next" ? ai : si;
|
|
1405
1405
|
var v = n.map(function(y) {
|
|
1406
|
-
return { lower:
|
|
1406
|
+
return { lower: a(y), upper: o(y) };
|
|
1407
1407
|
}).sort(function(y, S) {
|
|
1408
1408
|
return c(y.lower, S.lower);
|
|
1409
1409
|
});
|
|
@@ -1414,7 +1414,7 @@ var Mr = { exports: {} };
|
|
|
1414
1414
|
}), b = (g = m) === "next" ? "" : i;
|
|
1415
1415
|
}
|
|
1416
1416
|
w("next"), e = new e.Collection(e, function() {
|
|
1417
|
-
return Ce(u[0], h[
|
|
1417
|
+
return Ce(u[0], h[f - 1] + i);
|
|
1418
1418
|
}), e._ondirectionchange = function(m) {
|
|
1419
1419
|
w(m);
|
|
1420
1420
|
};
|
|
@@ -1422,9 +1422,9 @@ var Mr = { exports: {} };
|
|
|
1422
1422
|
return e._addAlgorithm(function(m, v, y) {
|
|
1423
1423
|
var S = m.key;
|
|
1424
1424
|
if (typeof S != "string") return !1;
|
|
1425
|
-
var E =
|
|
1425
|
+
var E = a(S);
|
|
1426
1426
|
if (t(E, h, p)) return !0;
|
|
1427
|
-
for (var O = null,
|
|
1427
|
+
for (var O = null, A = p; A < f; ++A) {
|
|
1428
1428
|
var P = function(M, I, C, j, T, L) {
|
|
1429
1429
|
for (var U = Math.min(M.length, j.length), W = -1, z = 0; z < U; ++z) {
|
|
1430
1430
|
var fe = I[z];
|
|
@@ -1432,8 +1432,8 @@ var Mr = { exports: {} };
|
|
|
1432
1432
|
T(M[z], fe) < 0 && (W = z);
|
|
1433
1433
|
}
|
|
1434
1434
|
return U < j.length && L === "next" ? M + C.substr(M.length) : U < M.length && L === "prev" ? M.substr(0, C.length) : W < 0 ? null : M.substr(0, W) + j[W] + C.substr(W + 1);
|
|
1435
|
-
}(S, E, u[
|
|
1436
|
-
P === null && O === null ? p =
|
|
1435
|
+
}(S, E, u[A], h[A], c, g);
|
|
1436
|
+
P === null && O === null ? p = A + 1 : (O === null || 0 < c(O, P)) && (O = P);
|
|
1437
1437
|
}
|
|
1438
1438
|
return v(O !== null ? function() {
|
|
1439
1439
|
m.continue(O + b);
|
|
@@ -1446,9 +1446,9 @@ var Mr = { exports: {} };
|
|
|
1446
1446
|
function pr(e) {
|
|
1447
1447
|
return { type: 1, lower: e, upper: e };
|
|
1448
1448
|
}
|
|
1449
|
-
var gr = (Object.defineProperty(
|
|
1449
|
+
var gr = (Object.defineProperty(oe.prototype, "Collection", { get: function() {
|
|
1450
1450
|
return this._ctx.table.db.Collection;
|
|
1451
|
-
}, enumerable: !1, configurable: !0 }),
|
|
1451
|
+
}, enumerable: !1, configurable: !0 }), oe.prototype.between = function(e, t, n, i) {
|
|
1452
1452
|
n = n !== !1, i = i === !0;
|
|
1453
1453
|
try {
|
|
1454
1454
|
return 0 < this._cmp(e, t) || this._cmp(e, t) === 0 && (n || i) && (!n || !i) ? tt(this) : new this.Collection(this, function() {
|
|
@@ -1457,49 +1457,49 @@ var Mr = { exports: {} };
|
|
|
1457
1457
|
} catch {
|
|
1458
1458
|
return de(this, _e);
|
|
1459
1459
|
}
|
|
1460
|
-
},
|
|
1460
|
+
}, oe.prototype.equals = function(e) {
|
|
1461
1461
|
return e == null ? de(this, _e) : new this.Collection(this, function() {
|
|
1462
1462
|
return pr(e);
|
|
1463
1463
|
});
|
|
1464
|
-
},
|
|
1464
|
+
}, oe.prototype.above = function(e) {
|
|
1465
1465
|
return e == null ? de(this, _e) : new this.Collection(this, function() {
|
|
1466
1466
|
return Ce(e, void 0, !0);
|
|
1467
1467
|
});
|
|
1468
|
-
},
|
|
1468
|
+
}, oe.prototype.aboveOrEqual = function(e) {
|
|
1469
1469
|
return e == null ? de(this, _e) : new this.Collection(this, function() {
|
|
1470
1470
|
return Ce(e, void 0, !1);
|
|
1471
1471
|
});
|
|
1472
|
-
},
|
|
1472
|
+
}, oe.prototype.below = function(e) {
|
|
1473
1473
|
return e == null ? de(this, _e) : new this.Collection(this, function() {
|
|
1474
1474
|
return Ce(void 0, e, !1, !0);
|
|
1475
1475
|
});
|
|
1476
|
-
},
|
|
1476
|
+
}, oe.prototype.belowOrEqual = function(e) {
|
|
1477
1477
|
return e == null ? de(this, _e) : new this.Collection(this, function() {
|
|
1478
1478
|
return Ce(void 0, e);
|
|
1479
1479
|
});
|
|
1480
|
-
},
|
|
1481
|
-
return typeof e != "string" ? de(this,
|
|
1482
|
-
},
|
|
1480
|
+
}, oe.prototype.startsWith = function(e) {
|
|
1481
|
+
return typeof e != "string" ? de(this, or) : this.between(e, e + $e, !0, !0);
|
|
1482
|
+
}, oe.prototype.startsWithIgnoreCase = function(e) {
|
|
1483
1483
|
return e === "" ? this.startsWith(e) : Bt(this, function(t, n) {
|
|
1484
1484
|
return t.indexOf(n[0]) === 0;
|
|
1485
1485
|
}, [e], $e);
|
|
1486
|
-
},
|
|
1486
|
+
}, oe.prototype.equalsIgnoreCase = function(e) {
|
|
1487
1487
|
return Bt(this, function(t, n) {
|
|
1488
1488
|
return t === n[0];
|
|
1489
1489
|
}, [e], "");
|
|
1490
|
-
},
|
|
1490
|
+
}, oe.prototype.anyOfIgnoreCase = function() {
|
|
1491
1491
|
var e = we.apply(Ye, arguments);
|
|
1492
1492
|
return e.length === 0 ? tt(this) : Bt(this, function(t, n) {
|
|
1493
1493
|
return n.indexOf(t) !== -1;
|
|
1494
1494
|
}, e, "");
|
|
1495
|
-
},
|
|
1495
|
+
}, oe.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
1496
1496
|
var e = we.apply(Ye, arguments);
|
|
1497
1497
|
return e.length === 0 ? tt(this) : Bt(this, function(t, n) {
|
|
1498
1498
|
return n.some(function(i) {
|
|
1499
1499
|
return t.indexOf(i) === 0;
|
|
1500
1500
|
});
|
|
1501
1501
|
}, e, $e);
|
|
1502
|
-
},
|
|
1502
|
+
}, oe.prototype.anyOf = function() {
|
|
1503
1503
|
var e = this, t = we.apply(Ye, arguments), n = this._cmp;
|
|
1504
1504
|
try {
|
|
1505
1505
|
t.sort(n);
|
|
@@ -1510,19 +1510,19 @@ var Mr = { exports: {} };
|
|
|
1510
1510
|
var i = new this.Collection(this, function() {
|
|
1511
1511
|
return Ce(t[0], t[t.length - 1]);
|
|
1512
1512
|
});
|
|
1513
|
-
i._ondirectionchange = function(
|
|
1514
|
-
n =
|
|
1513
|
+
i._ondirectionchange = function(a) {
|
|
1514
|
+
n = a === "next" ? e._ascending : e._descending, t.sort(n);
|
|
1515
1515
|
};
|
|
1516
|
-
var
|
|
1517
|
-
return i._addAlgorithm(function(
|
|
1518
|
-
for (var h =
|
|
1519
|
-
return n(h, t[
|
|
1520
|
-
|
|
1516
|
+
var o = 0;
|
|
1517
|
+
return i._addAlgorithm(function(a, c, u) {
|
|
1518
|
+
for (var h = a.key; 0 < n(h, t[o]); ) if (++o === t.length) return c(u), !1;
|
|
1519
|
+
return n(h, t[o]) === 0 || (c(function() {
|
|
1520
|
+
a.continue(t[o]);
|
|
1521
1521
|
}), !1);
|
|
1522
1522
|
}), i;
|
|
1523
|
-
},
|
|
1523
|
+
}, oe.prototype.notEqual = function(e) {
|
|
1524
1524
|
return this.inAnyRange([[-1 / 0, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
|
|
1525
|
-
},
|
|
1525
|
+
}, oe.prototype.noneOf = function() {
|
|
1526
1526
|
var e = we.apply(Ye, arguments);
|
|
1527
1527
|
if (e.length === 0) return new this.Collection(this);
|
|
1528
1528
|
try {
|
|
@@ -1534,58 +1534,58 @@ var Mr = { exports: {} };
|
|
|
1534
1534
|
return n ? n.concat([[n[n.length - 1][1], i]]) : [[-1 / 0, i]];
|
|
1535
1535
|
}, null);
|
|
1536
1536
|
return t.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(t, { includeLowers: !1, includeUppers: !1 });
|
|
1537
|
-
},
|
|
1538
|
-
var n = this, i = this._cmp,
|
|
1537
|
+
}, oe.prototype.inAnyRange = function(S, t) {
|
|
1538
|
+
var n = this, i = this._cmp, o = this._ascending, a = this._descending, c = this._min, u = this._max;
|
|
1539
1539
|
if (S.length === 0) return tt(this);
|
|
1540
1540
|
if (!S.every(function(E) {
|
|
1541
|
-
return E[0] !== void 0 && E[1] !== void 0 &&
|
|
1541
|
+
return E[0] !== void 0 && E[1] !== void 0 && o(E[0], E[1]) <= 0;
|
|
1542
1542
|
})) return de(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", $.InvalidArgument);
|
|
1543
|
-
var h = !t || t.includeLowers !== !1, g = t && t.includeUppers === !0, b,
|
|
1543
|
+
var h = !t || t.includeLowers !== !1, g = t && t.includeUppers === !0, b, f = o;
|
|
1544
1544
|
function w(E, O) {
|
|
1545
|
-
return
|
|
1545
|
+
return f(E[0], O[0]);
|
|
1546
1546
|
}
|
|
1547
1547
|
try {
|
|
1548
1548
|
(b = S.reduce(function(E, O) {
|
|
1549
|
-
for (var
|
|
1550
|
-
var M = E[
|
|
1549
|
+
for (var A = 0, P = E.length; A < P; ++A) {
|
|
1550
|
+
var M = E[A];
|
|
1551
1551
|
if (i(O[0], M[1]) < 0 && 0 < i(O[1], M[0])) {
|
|
1552
1552
|
M[0] = c(M[0], O[0]), M[1] = u(M[1], O[1]);
|
|
1553
1553
|
break;
|
|
1554
1554
|
}
|
|
1555
1555
|
}
|
|
1556
|
-
return
|
|
1556
|
+
return A === P && E.push(O), E;
|
|
1557
1557
|
}, [])).sort(w);
|
|
1558
1558
|
} catch {
|
|
1559
1559
|
return de(this, _e);
|
|
1560
1560
|
}
|
|
1561
1561
|
var p = 0, m = g ? function(E) {
|
|
1562
|
-
return 0 <
|
|
1562
|
+
return 0 < o(E, b[p][1]);
|
|
1563
1563
|
} : function(E) {
|
|
1564
|
-
return 0 <=
|
|
1564
|
+
return 0 <= o(E, b[p][1]);
|
|
1565
1565
|
}, v = h ? function(E) {
|
|
1566
|
-
return 0 <
|
|
1566
|
+
return 0 < a(E, b[p][0]);
|
|
1567
1567
|
} : function(E) {
|
|
1568
|
-
return 0 <=
|
|
1568
|
+
return 0 <= a(E, b[p][0]);
|
|
1569
1569
|
}, y = m, S = new this.Collection(this, function() {
|
|
1570
1570
|
return Ce(b[0][0], b[b.length - 1][1], !h, !g);
|
|
1571
1571
|
});
|
|
1572
1572
|
return S._ondirectionchange = function(E) {
|
|
1573
|
-
|
|
1574
|
-
}, S._addAlgorithm(function(E, O,
|
|
1575
|
-
for (var P, M = E.key; y(M); ) if (++p === b.length) return O(
|
|
1573
|
+
f = E === "next" ? (y = m, o) : (y = v, a), b.sort(w);
|
|
1574
|
+
}, S._addAlgorithm(function(E, O, A) {
|
|
1575
|
+
for (var P, M = E.key; y(M); ) if (++p === b.length) return O(A), !1;
|
|
1576
1576
|
return !m(P = M) && !v(P) || (n._cmp(M, b[p][1]) === 0 || n._cmp(M, b[p][0]) === 0 || O(function() {
|
|
1577
|
-
|
|
1577
|
+
f === o ? E.continue(b[p][0]) : E.continue(b[p][1]);
|
|
1578
1578
|
}), !1);
|
|
1579
1579
|
}), S;
|
|
1580
|
-
},
|
|
1580
|
+
}, oe.prototype.startsWithAnyOf = function() {
|
|
1581
1581
|
var e = we.apply(Ye, arguments);
|
|
1582
1582
|
return e.every(function(t) {
|
|
1583
1583
|
return typeof t == "string";
|
|
1584
1584
|
}) ? e.length === 0 ? tt(this) : this.inAnyRange(e.map(function(t) {
|
|
1585
1585
|
return [t, t + $e];
|
|
1586
1586
|
})) : de(this, "startsWithAnyOf() only works with strings");
|
|
1587
|
-
},
|
|
1588
|
-
function
|
|
1587
|
+
}, oe);
|
|
1588
|
+
function oe() {
|
|
1589
1589
|
}
|
|
1590
1590
|
function me(e) {
|
|
1591
1591
|
return q(function(t) {
|
|
@@ -1621,10 +1621,10 @@ var Mr = { exports: {} };
|
|
|
1621
1621
|
throw new $.OpenFailed(i);
|
|
1622
1622
|
}
|
|
1623
1623
|
if (!this.active) throw new $.TransactionInactive();
|
|
1624
|
-
return it(this._completion._state === null), (e = this.idbtrans = e || (this.db.core || n).transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability })).onerror = q(function(
|
|
1625
|
-
pt(
|
|
1626
|
-
}), e.onabort = q(function(
|
|
1627
|
-
pt(
|
|
1624
|
+
return it(this._completion._state === null), (e = this.idbtrans = e || (this.db.core || n).transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability })).onerror = q(function(o) {
|
|
1625
|
+
pt(o), t._reject(e.error);
|
|
1626
|
+
}), e.onabort = q(function(o) {
|
|
1627
|
+
pt(o), t.active && t._reject(new $.Abort(e.error)), t.active = !1, t.on("abort").fire(o);
|
|
1628
1628
|
}), e.oncomplete = q(function() {
|
|
1629
1629
|
t.active = !1, t._resolve(), "mutatedParts" in e && Re.storagemutated.fire(e.mutatedParts);
|
|
1630
1630
|
}), this;
|
|
@@ -1632,44 +1632,44 @@ var Mr = { exports: {} };
|
|
|
1632
1632
|
var i = this;
|
|
1633
1633
|
if (e === "readwrite" && this.mode !== "readwrite") return te(new $.ReadOnly("Transaction is readonly"));
|
|
1634
1634
|
if (!this.active) return te(new $.TransactionInactive());
|
|
1635
|
-
if (this._locked()) return new N(function(
|
|
1635
|
+
if (this._locked()) return new N(function(a, c) {
|
|
1636
1636
|
i._blockedFuncs.push([function() {
|
|
1637
|
-
i._promise(e, t, n).then(
|
|
1637
|
+
i._promise(e, t, n).then(a, c);
|
|
1638
1638
|
}, G]);
|
|
1639
1639
|
});
|
|
1640
1640
|
if (n) return De(function() {
|
|
1641
|
-
var
|
|
1641
|
+
var a = new N(function(c, u) {
|
|
1642
1642
|
i._lock();
|
|
1643
1643
|
var h = t(c, u, i);
|
|
1644
1644
|
h && h.then && h.then(c, u);
|
|
1645
1645
|
});
|
|
1646
|
-
return
|
|
1646
|
+
return a.finally(function() {
|
|
1647
1647
|
return i._unlock();
|
|
1648
|
-
}),
|
|
1648
|
+
}), a._lib = !0, a;
|
|
1649
1649
|
});
|
|
1650
|
-
var
|
|
1651
|
-
var u = t(
|
|
1652
|
-
u && u.then && u.then(
|
|
1650
|
+
var o = new N(function(a, c) {
|
|
1651
|
+
var u = t(a, c, i);
|
|
1652
|
+
u && u.then && u.then(a, c);
|
|
1653
1653
|
});
|
|
1654
|
-
return
|
|
1654
|
+
return o._lib = !0, o;
|
|
1655
1655
|
}, be.prototype._root = function() {
|
|
1656
1656
|
return this.parent ? this.parent._root() : this;
|
|
1657
1657
|
}, be.prototype.waitFor = function(e) {
|
|
1658
1658
|
var t, n = this._root(), i = N.resolve(e);
|
|
1659
1659
|
n._waitingFor ? n._waitingFor = n._waitingFor.then(function() {
|
|
1660
1660
|
return i;
|
|
1661
|
-
}) : (n._waitingFor = i, n._waitingQueue = [], t = n.idbtrans.objectStore(n.storeNames[0]), function
|
|
1661
|
+
}) : (n._waitingFor = i, n._waitingQueue = [], t = n.idbtrans.objectStore(n.storeNames[0]), function a() {
|
|
1662
1662
|
for (++n._spinCount; n._waitingQueue.length; ) n._waitingQueue.shift()();
|
|
1663
|
-
n._waitingFor && (t.get(-1 / 0).onsuccess =
|
|
1663
|
+
n._waitingFor && (t.get(-1 / 0).onsuccess = a);
|
|
1664
1664
|
}());
|
|
1665
|
-
var
|
|
1666
|
-
return new N(function(
|
|
1665
|
+
var o = n._waitingFor;
|
|
1666
|
+
return new N(function(a, c) {
|
|
1667
1667
|
i.then(function(u) {
|
|
1668
|
-
return n._waitingQueue.push(q(
|
|
1668
|
+
return n._waitingQueue.push(q(a.bind(null, u)));
|
|
1669
1669
|
}, function(u) {
|
|
1670
1670
|
return n._waitingQueue.push(q(c.bind(null, u)));
|
|
1671
1671
|
}).finally(function() {
|
|
1672
|
-
n._waitingFor ===
|
|
1672
|
+
n._waitingFor === o && (n._waitingFor = null);
|
|
1673
1673
|
});
|
|
1674
1674
|
});
|
|
1675
1675
|
}, be.prototype.abort = function() {
|
|
@@ -1683,17 +1683,17 @@ var Mr = { exports: {} };
|
|
|
1683
1683
|
}, be);
|
|
1684
1684
|
function be() {
|
|
1685
1685
|
}
|
|
1686
|
-
function wn(e, t, n, i,
|
|
1687
|
-
return { name: e, keyPath: t, unique: n, multi: i, auto:
|
|
1686
|
+
function wn(e, t, n, i, o, a, c) {
|
|
1687
|
+
return { name: e, keyPath: t, unique: n, multi: i, auto: o, compound: a, src: (n && !c ? "&" : "") + (i ? "*" : "") + (o ? "++" : "") + yr(t) };
|
|
1688
1688
|
}
|
|
1689
1689
|
function yr(e) {
|
|
1690
1690
|
return typeof e == "string" ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
|
|
1691
1691
|
}
|
|
1692
1692
|
function _n(e, t, n) {
|
|
1693
|
-
return { name: e, primKey: t, indexes: n, mappedClass: null, idxByName: (i = function(
|
|
1694
|
-
return [
|
|
1695
|
-
}, n.reduce(function(
|
|
1696
|
-
return c = i(
|
|
1693
|
+
return { name: e, primKey: t, indexes: n, mappedClass: null, idxByName: (i = function(o) {
|
|
1694
|
+
return [o.name, o];
|
|
1695
|
+
}, n.reduce(function(o, a, c) {
|
|
1696
|
+
return c = i(a, c), c && (o[c[0]] = c[1]), o;
|
|
1697
1697
|
}, {})) };
|
|
1698
1698
|
var i;
|
|
1699
1699
|
}
|
|
@@ -1733,10 +1733,10 @@ var Mr = { exports: {} };
|
|
|
1733
1733
|
var p = y.lower, m = y.upper, v = y.lowerOpen, y = y.upperOpen;
|
|
1734
1734
|
return p === void 0 ? m === void 0 ? null : t.upperBound(m, !!y) : m === void 0 ? t.lowerBound(p, !!v) : t.bound(p, m, !!v, !!y);
|
|
1735
1735
|
}
|
|
1736
|
-
function
|
|
1736
|
+
function o(w) {
|
|
1737
1737
|
var p, m = w.name;
|
|
1738
1738
|
return { name: m, schema: w, mutate: function(v) {
|
|
1739
|
-
var y = v.trans, S = v.type, E = v.keys, O = v.values,
|
|
1739
|
+
var y = v.trans, S = v.type, E = v.keys, O = v.values, A = v.range;
|
|
1740
1740
|
return new Promise(function(P, M) {
|
|
1741
1741
|
P = q(P);
|
|
1742
1742
|
var I = y.objectStore(m), C = I.keyPath == null, j = S === "put" || S === "add";
|
|
@@ -1749,8 +1749,8 @@ var Mr = { exports: {} };
|
|
|
1749
1749
|
}
|
|
1750
1750
|
var W = [], z = [], fe = 0;
|
|
1751
1751
|
if (S === "deleteRange") {
|
|
1752
|
-
if (
|
|
1753
|
-
|
|
1752
|
+
if (A.type === 4) return P({ numFailures: fe, failures: z, results: [], lastResult: void 0 });
|
|
1753
|
+
A.type === 3 ? W.push(T = I.clear()) : W.push(T = I.delete(i(A)));
|
|
1754
1754
|
} else {
|
|
1755
1755
|
var C = j ? C ? [O, E] : [O, null] : [E, null], F = C[0], se = C[1];
|
|
1756
1756
|
if (j) for (var ce = 0; ce < L; ++ce) W.push(T = se && se[ce] !== void 0 ? I[S](F[ce], se[ce]) : I[S](F[ce])), T.onerror = U;
|
|
@@ -1771,37 +1771,37 @@ var Mr = { exports: {} };
|
|
|
1771
1771
|
var y = v.trans, S = v.keys;
|
|
1772
1772
|
return new Promise(function(E, O) {
|
|
1773
1773
|
E = q(E);
|
|
1774
|
-
for (var
|
|
1774
|
+
for (var A, P = y.objectStore(m), M = S.length, I = new Array(M), C = 0, j = 0, T = function(W) {
|
|
1775
1775
|
W = W.target, I[W._pos] = W.result, ++j === C && E(I);
|
|
1776
|
-
}, L = me(O), U = 0; U < M; ++U) S[U] != null && ((
|
|
1776
|
+
}, L = me(O), U = 0; U < M; ++U) S[U] != null && ((A = P.get(S[U]))._pos = U, A.onsuccess = T, A.onerror = L, ++C);
|
|
1777
1777
|
C === 0 && E(I);
|
|
1778
1778
|
});
|
|
1779
1779
|
}, get: function(v) {
|
|
1780
1780
|
var y = v.trans, S = v.key;
|
|
1781
1781
|
return new Promise(function(E, O) {
|
|
1782
1782
|
E = q(E);
|
|
1783
|
-
var
|
|
1784
|
-
|
|
1783
|
+
var A = y.objectStore(m).get(S);
|
|
1784
|
+
A.onsuccess = function(P) {
|
|
1785
1785
|
return E(P.target.result);
|
|
1786
|
-
},
|
|
1786
|
+
}, A.onerror = me(O);
|
|
1787
1787
|
});
|
|
1788
1788
|
}, query: (p = g, function(v) {
|
|
1789
1789
|
return new Promise(function(y, S) {
|
|
1790
1790
|
y = q(y);
|
|
1791
|
-
var E, O,
|
|
1791
|
+
var E, O, A, C = v.trans, P = v.values, M = v.limit, T = v.query, I = M === 1 / 0 ? void 0 : M, j = T.index, T = T.range, C = C.objectStore(m), j = j.isPrimaryKey ? C : C.index(j.name), T = i(T);
|
|
1792
1792
|
if (M === 0) return y({ result: [] });
|
|
1793
1793
|
p ? ((I = P ? j.getAll(T, I) : j.getAllKeys(T, I)).onsuccess = function(L) {
|
|
1794
1794
|
return y({ result: L.target.result });
|
|
1795
|
-
}, I.onerror = me(S)) : (E = 0, O = !P && "openKeyCursor" in j ? j.openKeyCursor(T) : j.openCursor(T),
|
|
1795
|
+
}, I.onerror = me(S)) : (E = 0, O = !P && "openKeyCursor" in j ? j.openKeyCursor(T) : j.openCursor(T), A = [], O.onsuccess = function(L) {
|
|
1796
1796
|
var U = O.result;
|
|
1797
|
-
return U ? (
|
|
1797
|
+
return U ? (A.push(P ? U.value : U.primaryKey), ++E === M ? y({ result: A }) : void U.continue()) : y({ result: A });
|
|
1798
1798
|
}, O.onerror = me(S));
|
|
1799
1799
|
});
|
|
1800
1800
|
}), openCursor: function(v) {
|
|
1801
|
-
var y = v.trans, S = v.values, E = v.query, O = v.reverse,
|
|
1801
|
+
var y = v.trans, S = v.values, E = v.query, O = v.reverse, A = v.unique;
|
|
1802
1802
|
return new Promise(function(P, M) {
|
|
1803
1803
|
P = q(P);
|
|
1804
|
-
var j = E.index, I = E.range, C = y.objectStore(m), C = j.isPrimaryKey ? C : C.index(j.name), j = O ?
|
|
1804
|
+
var j = E.index, I = E.range, C = y.objectStore(m), C = j.isPrimaryKey ? C : C.index(j.name), j = O ? A ? "prevunique" : "prev" : A ? "nextunique" : "next", T = !S && "openKeyCursor" in C ? C.openKeyCursor(i(I), j) : C.openCursor(i(I), j);
|
|
1805
1805
|
T.onerror = me(M), T.onsuccess = q(function(L) {
|
|
1806
1806
|
var U, W, z, fe, F = T.result;
|
|
1807
1807
|
F ? (F.___id = ++ui, F.done = !1, U = F.continue.bind(F), W = (W = F.continuePrimaryKey) && W.bind(F), z = F.advance.bind(F), fe = function() {
|
|
@@ -1839,61 +1839,61 @@ var Mr = { exports: {} };
|
|
|
1839
1839
|
});
|
|
1840
1840
|
}, count: function(v) {
|
|
1841
1841
|
var y = v.query, S = v.trans, E = y.index, O = y.range;
|
|
1842
|
-
return new Promise(function(
|
|
1842
|
+
return new Promise(function(A, P) {
|
|
1843
1843
|
var M = S.objectStore(m), I = E.isPrimaryKey ? M : M.index(E.name), M = i(O), I = M ? I.count(M) : I.count();
|
|
1844
1844
|
I.onsuccess = q(function(C) {
|
|
1845
|
-
return
|
|
1845
|
+
return A(C.target.result);
|
|
1846
1846
|
}), I.onerror = me(P);
|
|
1847
1847
|
});
|
|
1848
1848
|
} };
|
|
1849
1849
|
}
|
|
1850
|
-
var
|
|
1850
|
+
var a, c, u, b = (c = h, u = mr((a = e).objectStoreNames), { schema: { name: a.name, tables: u.map(function(w) {
|
|
1851
1851
|
return c.objectStore(w);
|
|
1852
1852
|
}).map(function(w) {
|
|
1853
1853
|
var p = w.keyPath, y = w.autoIncrement, m = B(p), v = {}, y = { name: w.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: p == null, compound: m, keyPath: p, autoIncrement: y, unique: !0, extractKey: Sn(p) }, indexes: mr(w.indexNames).map(function(S) {
|
|
1854
1854
|
return w.index(S);
|
|
1855
|
-
}).map(function(
|
|
1856
|
-
var E =
|
|
1857
|
-
return v[mt(
|
|
1855
|
+
}).map(function(A) {
|
|
1856
|
+
var E = A.name, O = A.unique, P = A.multiEntry, A = A.keyPath, P = { name: E, compound: B(A), keyPath: A, unique: O, multiEntry: P, extractKey: Sn(A) };
|
|
1857
|
+
return v[mt(A)] = P;
|
|
1858
1858
|
}), getIndexByKeyPath: function(S) {
|
|
1859
1859
|
return v[mt(S)];
|
|
1860
1860
|
} };
|
|
1861
1861
|
return v[":id"] = y.primaryKey, p != null && (v[mt(p)] = y.primaryKey), y;
|
|
1862
|
-
}) }, hasGetAll: 0 < u.length && "getAll" in c.objectStore(u[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), h = b.schema, g = b.hasGetAll, b = h.tables.map(
|
|
1862
|
+
}) }, hasGetAll: 0 < u.length && "getAll" in c.objectStore(u[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), h = b.schema, g = b.hasGetAll, b = h.tables.map(o), f = {};
|
|
1863
1863
|
return b.forEach(function(w) {
|
|
1864
|
-
return
|
|
1864
|
+
return f[w.name] = w;
|
|
1865
1865
|
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(w) {
|
|
1866
|
-
if (!
|
|
1867
|
-
return
|
|
1866
|
+
if (!f[w]) throw new Error("Table '".concat(w, "' not found"));
|
|
1867
|
+
return f[w];
|
|
1868
1868
|
}, MIN_KEY: -1 / 0, MAX_KEY: yt(t), schema: h };
|
|
1869
1869
|
}
|
|
1870
1870
|
function di(e, t, n, i) {
|
|
1871
|
-
var
|
|
1872
|
-
return n.indexedDB, { dbcore: (i = li(t,
|
|
1873
|
-
return c = c.create, l(l({},
|
|
1871
|
+
var o = n.IDBKeyRange;
|
|
1872
|
+
return n.indexedDB, { dbcore: (i = li(t, o, i), e.dbcore.reduce(function(a, c) {
|
|
1873
|
+
return c = c.create, l(l({}, a), c(a));
|
|
1874
1874
|
}, i)) };
|
|
1875
1875
|
}
|
|
1876
1876
|
function Lt(e, i) {
|
|
1877
1877
|
var n = i.db, i = di(e._middlewares, n, e._deps, i);
|
|
1878
|
-
e.core = i.dbcore, e.tables.forEach(function(
|
|
1879
|
-
var
|
|
1878
|
+
e.core = i.dbcore, e.tables.forEach(function(o) {
|
|
1879
|
+
var a = o.name;
|
|
1880
1880
|
e.core.schema.tables.some(function(c) {
|
|
1881
|
-
return c.name ===
|
|
1882
|
-
}) && (
|
|
1881
|
+
return c.name === a;
|
|
1882
|
+
}) && (o.core = e.core.table(a), e[a] instanceof e.Table && (e[a].core = o.core));
|
|
1883
1883
|
});
|
|
1884
1884
|
}
|
|
1885
1885
|
function Gt(e, t, n, i) {
|
|
1886
|
-
n.forEach(function(
|
|
1887
|
-
var
|
|
1886
|
+
n.forEach(function(o) {
|
|
1887
|
+
var a = i[o];
|
|
1888
1888
|
t.forEach(function(c) {
|
|
1889
1889
|
var u = function h(g, b) {
|
|
1890
1890
|
return Fr(g, b) || (g = ee(g)) && h(g, b);
|
|
1891
|
-
}(c,
|
|
1892
|
-
(!u || "value" in u && u.value === void 0) && (c === e.Transaction.prototype || c instanceof e.Transaction ?
|
|
1893
|
-
return this.table(
|
|
1891
|
+
}(c, o);
|
|
1892
|
+
(!u || "value" in u && u.value === void 0) && (c === e.Transaction.prototype || c instanceof e.Transaction ? Ae(c, o, { get: function() {
|
|
1893
|
+
return this.table(o);
|
|
1894
1894
|
}, set: function(h) {
|
|
1895
|
-
St(this,
|
|
1896
|
-
} }) : c[
|
|
1895
|
+
St(this, o, { value: h, writable: !0, configurable: !0, enumerable: !0 });
|
|
1896
|
+
} }) : c[o] = new e.Table(o, a));
|
|
1897
1897
|
});
|
|
1898
1898
|
});
|
|
1899
1899
|
}
|
|
@@ -1906,25 +1906,25 @@ var Mr = { exports: {} };
|
|
|
1906
1906
|
return e._cfg.version - t._cfg.version;
|
|
1907
1907
|
}
|
|
1908
1908
|
function hi(e, t, n, i) {
|
|
1909
|
-
var
|
|
1910
|
-
n.objectStoreNames.contains("$meta") && !
|
|
1911
|
-
var
|
|
1912
|
-
|
|
1913
|
-
var c =
|
|
1909
|
+
var o = e._dbSchema;
|
|
1910
|
+
n.objectStoreNames.contains("$meta") && !o.$meta && (o.$meta = _n("$meta", vr("")[0], []), e._storeNames.push("$meta"));
|
|
1911
|
+
var a = e._createTransaction("readwrite", e._storeNames, o);
|
|
1912
|
+
a.create(n), a._completion.catch(i);
|
|
1913
|
+
var c = a._reject.bind(a), u = G.transless || G;
|
|
1914
1914
|
De(function() {
|
|
1915
|
-
return G.trans =
|
|
1915
|
+
return G.trans = a, G.transless = u, t !== 0 ? (Lt(e, n), g = t, ((h = a).storeNames.includes("$meta") ? h.table("$meta").get("version").then(function(b) {
|
|
1916
1916
|
return b ?? g;
|
|
1917
1917
|
}) : N.resolve(g)).then(function(b) {
|
|
1918
|
-
return w = b, p =
|
|
1918
|
+
return w = b, p = a, m = n, v = [], b = (f = e)._versions, y = f._dbSchema = Ft(0, f.idbdb, m), (b = b.filter(function(S) {
|
|
1919
1919
|
return S._cfg.version >= w;
|
|
1920
1920
|
})).length !== 0 ? (b.forEach(function(S) {
|
|
1921
1921
|
v.push(function() {
|
|
1922
1922
|
var E = y, O = S._cfg.dbschema;
|
|
1923
|
-
Ut(
|
|
1924
|
-
var
|
|
1925
|
-
|
|
1923
|
+
Ut(f, E, m), Ut(f, O, m), y = f._dbSchema = O;
|
|
1924
|
+
var A = On(E, O);
|
|
1925
|
+
A.add.forEach(function(j) {
|
|
1926
1926
|
xn(m, j[0], j[1].primKey, j[1].indexes);
|
|
1927
|
-
}),
|
|
1927
|
+
}), A.change.forEach(function(j) {
|
|
1928
1928
|
if (j.recreate) throw new $.Upgrade("Not yet support for changing primary key");
|
|
1929
1929
|
var T = m.objectStore(j.name);
|
|
1930
1930
|
j.add.forEach(function(L) {
|
|
@@ -1937,26 +1937,26 @@ var Mr = { exports: {} };
|
|
|
1937
1937
|
});
|
|
1938
1938
|
var P = S._cfg.contentUpgrade;
|
|
1939
1939
|
if (P && S._cfg.version > w) {
|
|
1940
|
-
Lt(
|
|
1940
|
+
Lt(f, m), p._memoizedTables = {};
|
|
1941
1941
|
var M = Qn(O);
|
|
1942
|
-
|
|
1942
|
+
A.del.forEach(function(j) {
|
|
1943
1943
|
M[j] = E[j];
|
|
1944
|
-
}), En(
|
|
1944
|
+
}), En(f, [f.Transaction.prototype]), Gt(f, [f.Transaction.prototype], R(M), M), p.schema = M;
|
|
1945
1945
|
var I, C = nn(P);
|
|
1946
|
-
return C && Ze(),
|
|
1946
|
+
return C && Ze(), A = N.follow(function() {
|
|
1947
1947
|
var j;
|
|
1948
1948
|
(I = P(p)) && C && (j = Pe.bind(null, null), I.then(j, j));
|
|
1949
|
-
}), I && typeof I.then == "function" ? N.resolve(I) :
|
|
1949
|
+
}), I && typeof I.then == "function" ? N.resolve(I) : A.then(function() {
|
|
1950
1950
|
return I;
|
|
1951
1951
|
});
|
|
1952
1952
|
}
|
|
1953
1953
|
}), v.push(function(E) {
|
|
1954
|
-
var O,
|
|
1955
|
-
O = P,
|
|
1956
|
-
return O[M] == null &&
|
|
1957
|
-
}), En(
|
|
1954
|
+
var O, A, P = S._cfg.dbschema;
|
|
1955
|
+
O = P, A = E, [].slice.call(A.db.objectStoreNames).forEach(function(M) {
|
|
1956
|
+
return O[M] == null && A.db.deleteObjectStore(M);
|
|
1957
|
+
}), En(f, [f.Transaction.prototype]), Gt(f, [f.Transaction.prototype], f._storeNames, f._dbSchema), p.schema = f._dbSchema;
|
|
1958
1958
|
}), v.push(function(E) {
|
|
1959
|
-
|
|
1959
|
+
f.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(f.idbdb.version / 10) === S._cfg.version ? (f.idbdb.deleteObjectStore("$meta"), delete f._dbSchema.$meta, f._storeNames = f._storeNames.filter(function(O) {
|
|
1960
1960
|
return O !== "$meta";
|
|
1961
1961
|
})) : E.objectStore("$meta").put(S._cfg.version, "version"));
|
|
1962
1962
|
});
|
|
@@ -1965,11 +1965,11 @@ var Mr = { exports: {} };
|
|
|
1965
1965
|
}().then(function() {
|
|
1966
1966
|
br(y, m);
|
|
1967
1967
|
})) : N.resolve();
|
|
1968
|
-
var
|
|
1969
|
-
}).catch(c)) : (R(
|
|
1970
|
-
xn(n, b,
|
|
1968
|
+
var f, w, p, m, v, y;
|
|
1969
|
+
}).catch(c)) : (R(o).forEach(function(b) {
|
|
1970
|
+
xn(n, b, o[b].primKey, o[b].indexes);
|
|
1971
1971
|
}), Lt(e, n), void N.follow(function() {
|
|
1972
|
-
return e.on.populate.fire(
|
|
1972
|
+
return e.on.populate.fire(a);
|
|
1973
1973
|
}).catch(c));
|
|
1974
1974
|
var h, g;
|
|
1975
1975
|
});
|
|
@@ -1978,43 +1978,43 @@ var Mr = { exports: {} };
|
|
|
1978
1978
|
br(e._dbSchema, t), t.db.version % 10 != 0 || t.objectStoreNames.contains("$meta") || t.db.createObjectStore("$meta").add(Math.ceil(t.db.version / 10 - 1), "version");
|
|
1979
1979
|
var n = Ft(0, e.idbdb, t);
|
|
1980
1980
|
Ut(e, e._dbSchema, t);
|
|
1981
|
-
for (var i = 0,
|
|
1982
|
-
var
|
|
1981
|
+
for (var i = 0, o = On(n, e._dbSchema).change; i < o.length; i++) {
|
|
1982
|
+
var a = function(c) {
|
|
1983
1983
|
if (c.change.length || c.recreate) return console.warn("Unable to patch indexes of table ".concat(c.name, " because it has changes on the type of index or primary key.")), { value: void 0 };
|
|
1984
1984
|
var u = t.objectStore(c.name);
|
|
1985
1985
|
c.add.forEach(function(h) {
|
|
1986
1986
|
ye && console.debug("Dexie upgrade patch: Creating missing index ".concat(c.name, ".").concat(h.src)), $t(u, h);
|
|
1987
1987
|
});
|
|
1988
|
-
}(
|
|
1989
|
-
if (typeof
|
|
1988
|
+
}(o[i]);
|
|
1989
|
+
if (typeof a == "object") return a.value;
|
|
1990
1990
|
}
|
|
1991
1991
|
}
|
|
1992
1992
|
function On(e, t) {
|
|
1993
1993
|
var n, i = { del: [], add: [], change: [] };
|
|
1994
1994
|
for (n in e) t[n] || i.del.push(n);
|
|
1995
1995
|
for (n in t) {
|
|
1996
|
-
var
|
|
1997
|
-
if (
|
|
1998
|
-
var c = { name: n, def:
|
|
1999
|
-
if ("" + (
|
|
1996
|
+
var o = e[n], a = t[n];
|
|
1997
|
+
if (o) {
|
|
1998
|
+
var c = { name: n, def: a, recreate: !1, del: [], add: [], change: [] };
|
|
1999
|
+
if ("" + (o.primKey.keyPath || "") != "" + (a.primKey.keyPath || "") || o.primKey.auto !== a.primKey.auto) c.recreate = !0, i.change.push(c);
|
|
2000
2000
|
else {
|
|
2001
|
-
var u =
|
|
2001
|
+
var u = o.idxByName, h = a.idxByName, g = void 0;
|
|
2002
2002
|
for (g in u) h[g] || c.del.push(g);
|
|
2003
2003
|
for (g in h) {
|
|
2004
|
-
var b = u[g],
|
|
2005
|
-
b ? b.src !==
|
|
2004
|
+
var b = u[g], f = h[g];
|
|
2005
|
+
b ? b.src !== f.src && c.change.push(f) : c.add.push(f);
|
|
2006
2006
|
}
|
|
2007
2007
|
(0 < c.del.length || 0 < c.add.length || 0 < c.change.length) && i.change.push(c);
|
|
2008
2008
|
}
|
|
2009
|
-
} else i.add.push([n,
|
|
2009
|
+
} else i.add.push([n, a]);
|
|
2010
2010
|
}
|
|
2011
2011
|
return i;
|
|
2012
2012
|
}
|
|
2013
2013
|
function xn(e, t, n, i) {
|
|
2014
|
-
var
|
|
2015
|
-
return i.forEach(function(
|
|
2016
|
-
return $t(
|
|
2017
|
-
}),
|
|
2014
|
+
var o = e.db.createObjectStore(t, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
|
|
2015
|
+
return i.forEach(function(a) {
|
|
2016
|
+
return $t(o, a);
|
|
2017
|
+
}), o;
|
|
2018
2018
|
}
|
|
2019
2019
|
function br(e, t) {
|
|
2020
2020
|
R(e).forEach(function(n) {
|
|
@@ -2026,59 +2026,59 @@ var Mr = { exports: {} };
|
|
|
2026
2026
|
}
|
|
2027
2027
|
function Ft(e, t, n) {
|
|
2028
2028
|
var i = {};
|
|
2029
|
-
return Et(t.objectStoreNames, 0).forEach(function(
|
|
2030
|
-
for (var
|
|
2031
|
-
var b =
|
|
2029
|
+
return Et(t.objectStoreNames, 0).forEach(function(o) {
|
|
2030
|
+
for (var a = n.objectStore(o), c = wn(yr(g = a.keyPath), g || "", !0, !1, !!a.autoIncrement, g && typeof g != "string", !0), u = [], h = 0; h < a.indexNames.length; ++h) {
|
|
2031
|
+
var b = a.index(a.indexNames[h]), g = b.keyPath, b = wn(b.name, g, !!b.unique, !!b.multiEntry, !1, g && typeof g != "string", !1);
|
|
2032
2032
|
u.push(b);
|
|
2033
2033
|
}
|
|
2034
|
-
i[
|
|
2034
|
+
i[o] = _n(o, c, u);
|
|
2035
2035
|
}), i;
|
|
2036
2036
|
}
|
|
2037
2037
|
function Ut(e, t, n) {
|
|
2038
|
-
for (var i = n.db.objectStoreNames,
|
|
2039
|
-
var
|
|
2038
|
+
for (var i = n.db.objectStoreNames, o = 0; o < i.length; ++o) {
|
|
2039
|
+
var a = i[o], c = n.objectStore(a);
|
|
2040
2040
|
e._hasGetAll = "getAll" in c;
|
|
2041
2041
|
for (var u = 0; u < c.indexNames.length; ++u) {
|
|
2042
2042
|
var h = c.indexNames[u], g = c.index(h).keyPath, b = typeof g == "string" ? g : "[" + Et(g).join("+") + "]";
|
|
2043
|
-
!t[
|
|
2043
|
+
!t[a] || (g = t[a].idxByName[b]) && (g.name = h, delete t[a].idxByName[b], t[a].idxByName[h] = g);
|
|
2044
2044
|
}
|
|
2045
2045
|
}
|
|
2046
2046
|
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && D.WorkerGlobalScope && D instanceof D.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
|
|
2047
2047
|
}
|
|
2048
2048
|
function vr(e) {
|
|
2049
2049
|
return e.split(",").map(function(t, n) {
|
|
2050
|
-
var i = (t = t.trim()).replace(/([&*]|\+\+)/g, ""),
|
|
2051
|
-
return wn(i,
|
|
2050
|
+
var i = (t = t.trim()).replace(/([&*]|\+\+)/g, ""), o = /^\[/.test(i) ? i.match(/^\[(.*)\]$/)[1].split("+") : i;
|
|
2051
|
+
return wn(i, o || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t), B(o), n === 0);
|
|
2052
2052
|
});
|
|
2053
2053
|
}
|
|
2054
2054
|
var gi = (Wt.prototype._parseStoresSpec = function(e, t) {
|
|
2055
2055
|
R(e).forEach(function(n) {
|
|
2056
2056
|
if (e[n] !== null) {
|
|
2057
|
-
var i = vr(e[n]),
|
|
2058
|
-
if (
|
|
2059
|
-
i.forEach(function(
|
|
2060
|
-
if (
|
|
2061
|
-
if (!
|
|
2062
|
-
}), t[n] = _n(n,
|
|
2057
|
+
var i = vr(e[n]), o = i.shift();
|
|
2058
|
+
if (o.unique = !0, o.multi) throw new $.Schema("Primary key cannot be multi-valued");
|
|
2059
|
+
i.forEach(function(a) {
|
|
2060
|
+
if (a.auto) throw new $.Schema("Only primary key can be marked as autoIncrement (++)");
|
|
2061
|
+
if (!a.keyPath) throw new $.Schema("Index must have a name and cannot be an empty string");
|
|
2062
|
+
}), t[n] = _n(n, o, i);
|
|
2063
2063
|
}
|
|
2064
2064
|
});
|
|
2065
2065
|
}, Wt.prototype.stores = function(n) {
|
|
2066
2066
|
var t = this.db;
|
|
2067
2067
|
this._cfg.storesSource = this._cfg.storesSource ? Q(this._cfg.storesSource, n) : n;
|
|
2068
|
-
var n = t._versions, i = {},
|
|
2069
|
-
return n.forEach(function(
|
|
2070
|
-
Q(i,
|
|
2071
|
-
}), t._dbSchema =
|
|
2068
|
+
var n = t._versions, i = {}, o = {};
|
|
2069
|
+
return n.forEach(function(a) {
|
|
2070
|
+
Q(i, a._cfg.storesSource), o = a._cfg.dbschema = {}, a._parseStoresSpec(i, o);
|
|
2071
|
+
}), t._dbSchema = o, En(t, [t._allTables, t, t.Transaction.prototype]), Gt(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], R(o), o), t._storeNames = R(o), this;
|
|
2072
2072
|
}, Wt.prototype.upgrade = function(e) {
|
|
2073
|
-
return this._cfg.contentUpgrade =
|
|
2073
|
+
return this._cfg.contentUpgrade = on(this._cfg.contentUpgrade || X, e), this;
|
|
2074
2074
|
}, Wt);
|
|
2075
2075
|
function Wt() {
|
|
2076
2076
|
}
|
|
2077
|
-
function
|
|
2077
|
+
function An(e, t) {
|
|
2078
2078
|
var n = e._dbNamesDB;
|
|
2079
2079
|
return n || (n = e._dbNamesDB = new Ee(Mt, { addons: [], indexedDB: e, IDBKeyRange: t })).version(1).stores({ dbnames: "name" }), n.table("dbnames");
|
|
2080
2080
|
}
|
|
2081
|
-
function
|
|
2081
|
+
function kn(e) {
|
|
2082
2082
|
return e && typeof e.databases == "function";
|
|
2083
2083
|
}
|
|
2084
2084
|
function Dn(e) {
|
|
@@ -2089,9 +2089,9 @@ var Mr = { exports: {} };
|
|
|
2089
2089
|
function Pn(e) {
|
|
2090
2090
|
return !("from" in e);
|
|
2091
2091
|
}
|
|
2092
|
-
var
|
|
2092
|
+
var ae = function(e, t) {
|
|
2093
2093
|
if (!this) {
|
|
2094
|
-
var n = new
|
|
2094
|
+
var n = new ae();
|
|
2095
2095
|
return e && "d" in e && Q(n, e), n;
|
|
2096
2096
|
}
|
|
2097
2097
|
Q(this, arguments.length ? { d: 1, from: e, to: 1 < arguments.length ? t : e } : { d: 0 });
|
|
@@ -2101,24 +2101,24 @@ var Mr = { exports: {} };
|
|
|
2101
2101
|
if (!isNaN(i)) {
|
|
2102
2102
|
if (0 < i) throw RangeError();
|
|
2103
2103
|
if (Pn(e)) return Q(e, { from: t, to: n, d: 1 });
|
|
2104
|
-
var
|
|
2105
|
-
if (H(n, e.from) < 0) return
|
|
2104
|
+
var o = e.l, i = e.r;
|
|
2105
|
+
if (H(n, e.from) < 0) return o ? bt(o, t, n) : e.l = { from: t, to: n, d: 1, l: null, r: null }, _r(e);
|
|
2106
2106
|
if (0 < H(t, e.to)) return i ? bt(i, t, n) : e.r = { from: t, to: n, d: 1, l: null, r: null }, _r(e);
|
|
2107
|
-
H(t, e.from) < 0 && (e.from = t, e.l = null, e.d = i ? i.d + 1 : 1), 0 < H(n, e.to) && (e.to = n, e.r = null, e.d = e.l ? e.l.d + 1 : 1), n = !e.r,
|
|
2107
|
+
H(t, e.from) < 0 && (e.from = t, e.l = null, e.d = i ? i.d + 1 : 1), 0 < H(n, e.to) && (e.to = n, e.r = null, e.d = e.l ? e.l.d + 1 : 1), n = !e.r, o && !e.l && vt(e, o), i && n && vt(e, i);
|
|
2108
2108
|
}
|
|
2109
2109
|
}
|
|
2110
2110
|
function vt(e, t) {
|
|
2111
2111
|
Pn(t) || function n(i, h) {
|
|
2112
|
-
var
|
|
2113
|
-
bt(i,
|
|
2112
|
+
var a = h.from, c = h.to, u = h.l, h = h.r;
|
|
2113
|
+
bt(i, a, c), u && n(i, u), h && n(i, h);
|
|
2114
2114
|
}(e, t);
|
|
2115
2115
|
}
|
|
2116
2116
|
function wr(e, t) {
|
|
2117
2117
|
var n = zt(t), i = n.next();
|
|
2118
2118
|
if (i.done) return !1;
|
|
2119
|
-
for (var
|
|
2120
|
-
if (H(u.from,
|
|
2121
|
-
H(
|
|
2119
|
+
for (var o = i.value, a = zt(e), c = a.next(o.from), u = c.value; !i.done && !c.done; ) {
|
|
2120
|
+
if (H(u.from, o.to) <= 0 && 0 <= H(u.to, o.from)) return !0;
|
|
2121
|
+
H(o.from, u.from) < 0 ? o = (i = n.next(u.from)).value : u = (c = a.next(o.from)).value;
|
|
2122
2122
|
}
|
|
2123
2123
|
return !1;
|
|
2124
2124
|
}
|
|
@@ -2143,8 +2143,8 @@ var Mr = { exports: {} };
|
|
|
2143
2143
|
} };
|
|
2144
2144
|
}
|
|
2145
2145
|
function _r(e) {
|
|
2146
|
-
var t, n, i = (((t = e.r) === null || t === void 0 ? void 0 : t.d) || 0) - (((n = e.l) === null || n === void 0 ? void 0 : n.d) || 0),
|
|
2147
|
-
|
|
2146
|
+
var t, n, i = (((t = e.r) === null || t === void 0 ? void 0 : t.d) || 0) - (((n = e.l) === null || n === void 0 ? void 0 : n.d) || 0), o = 1 < i ? "r" : i < -1 ? "l" : "";
|
|
2147
|
+
o && (t = o == "r" ? "l" : "r", n = l({}, e), i = e[o], e.from = i.from, e.to = i.to, e[o] = i[o], n[o] = i[t], (e[t] = n).d = Sr(n)), e.d = Sr(e);
|
|
2148
2148
|
}
|
|
2149
2149
|
function Sr(n) {
|
|
2150
2150
|
var t = n.r, n = n.l;
|
|
@@ -2152,9 +2152,9 @@ var Mr = { exports: {} };
|
|
|
2152
2152
|
}
|
|
2153
2153
|
function Ht(e, t) {
|
|
2154
2154
|
return R(t).forEach(function(n) {
|
|
2155
|
-
e[n] ? vt(e[n], t[n]) : e[n] = function i(
|
|
2156
|
-
var
|
|
2157
|
-
for (
|
|
2155
|
+
e[n] ? vt(e[n], t[n]) : e[n] = function i(o) {
|
|
2156
|
+
var a, c, u = {};
|
|
2157
|
+
for (a in o) Z(o, a) && (c = o[a], u[a] = !c || typeof c != "object" || Jn.has(c.constructor) ? c : i(c));
|
|
2158
2158
|
return u;
|
|
2159
2159
|
}(t[n]);
|
|
2160
2160
|
}), e;
|
|
@@ -2164,7 +2164,7 @@ var Mr = { exports: {} };
|
|
|
2164
2164
|
return t[n] && wr(t[n], e[n]);
|
|
2165
2165
|
});
|
|
2166
2166
|
}
|
|
2167
|
-
xe(
|
|
2167
|
+
xe(ae.prototype, ((he = { add: function(e) {
|
|
2168
2168
|
return vt(this, e), this;
|
|
2169
2169
|
}, addKey: function(e) {
|
|
2170
2170
|
return bt(this, e, e), this;
|
|
@@ -2188,26 +2188,26 @@ var Mr = { exports: {} };
|
|
|
2188
2188
|
function Tn(e, t) {
|
|
2189
2189
|
t === void 0 && (t = !1);
|
|
2190
2190
|
var n = /* @__PURE__ */ new Set();
|
|
2191
|
-
if (e.all) for (var i = 0,
|
|
2192
|
-
else for (var
|
|
2193
|
-
var c, u = /^idb\:\/\/(.*)\/(.*)\//.exec(
|
|
2194
|
-
u && (
|
|
2191
|
+
if (e.all) for (var i = 0, o = Object.values(Ue); i < o.length; i++) Er(c = o[i], e, n, t);
|
|
2192
|
+
else for (var a in e) {
|
|
2193
|
+
var c, u = /^idb\:\/\/(.*)\/(.*)\//.exec(a);
|
|
2194
|
+
u && (a = u[1], u = u[2], (c = Ue["idb://".concat(a, "/").concat(u)]) && Er(c, e, n, t));
|
|
2195
2195
|
}
|
|
2196
2196
|
n.forEach(function(h) {
|
|
2197
2197
|
return h();
|
|
2198
2198
|
});
|
|
2199
2199
|
}
|
|
2200
2200
|
function Er(e, t, n, i) {
|
|
2201
|
-
for (var
|
|
2202
|
-
for (var u = c[
|
|
2203
|
-
var w =
|
|
2201
|
+
for (var o = [], a = 0, c = Object.entries(e.queries.query); a < c.length; a++) {
|
|
2202
|
+
for (var u = c[a], h = u[0], g = [], b = 0, f = u[1]; b < f.length; b++) {
|
|
2203
|
+
var w = f[b];
|
|
2204
2204
|
In(t, w.obsSet) ? w.subscribers.forEach(function(y) {
|
|
2205
2205
|
return n.add(y);
|
|
2206
2206
|
}) : i && g.push(w);
|
|
2207
2207
|
}
|
|
2208
|
-
i &&
|
|
2208
|
+
i && o.push([h, g]);
|
|
2209
2209
|
}
|
|
2210
|
-
if (i) for (var p = 0, m =
|
|
2210
|
+
if (i) for (var p = 0, m = o; p < m.length; p++) {
|
|
2211
2211
|
var v = m[p], h = v[0], g = v[1];
|
|
2212
2212
|
e.queries.query[h] = g;
|
|
2213
2213
|
}
|
|
@@ -2218,29 +2218,29 @@ var Mr = { exports: {} };
|
|
|
2218
2218
|
return t.dbOpenError ? te(t.dbOpenError) : e;
|
|
2219
2219
|
});
|
|
2220
2220
|
t.isBeingOpened = !0, t.dbOpenError = null, t.openComplete = !1;
|
|
2221
|
-
var i = t.openCanceller,
|
|
2221
|
+
var i = t.openCanceller, o = Math.round(10 * e.verno), a = !1;
|
|
2222
2222
|
function c() {
|
|
2223
2223
|
if (t.openCanceller !== i) throw new $.DatabaseClosed("db.open() was cancelled");
|
|
2224
2224
|
}
|
|
2225
2225
|
function u() {
|
|
2226
2226
|
return new N(function(w, p) {
|
|
2227
2227
|
if (c(), !n) throw new $.MissingAPI();
|
|
2228
|
-
var m = e.name, v = t.autoSchema || !
|
|
2228
|
+
var m = e.name, v = t.autoSchema || !o ? n.open(m) : n.open(m, o);
|
|
2229
2229
|
if (!v) throw new $.MissingAPI();
|
|
2230
2230
|
v.onerror = me(p), v.onblocked = q(e._fireOnBlocked), v.onupgradeneeded = q(function(y) {
|
|
2231
2231
|
var S;
|
|
2232
2232
|
b = v.transaction, t.autoSchema && !e._options.allowEmptyDB ? (v.onerror = pt, b.abort(), v.result.close(), (S = n.deleteDatabase(m)).onsuccess = S.onerror = q(function() {
|
|
2233
2233
|
p(new $.NoSuchDatabase("Database ".concat(m, " doesnt exist")));
|
|
2234
|
-
})) : (b.onerror = me(p), y = y.oldVersion > Math.pow(2, 62) ? 0 : y.oldVersion,
|
|
2234
|
+
})) : (b.onerror = me(p), y = y.oldVersion > Math.pow(2, 62) ? 0 : y.oldVersion, f = y < 1, e.idbdb = v.result, a && pi(e, b), hi(e, y / 10, b, p));
|
|
2235
2235
|
}, p), v.onsuccess = q(function() {
|
|
2236
2236
|
b = null;
|
|
2237
|
-
var y, S, E, O,
|
|
2237
|
+
var y, S, E, O, A, P = e.idbdb = v.result, M = Et(P.objectStoreNames);
|
|
2238
2238
|
if (0 < M.length) try {
|
|
2239
2239
|
var I = P.transaction((O = M).length === 1 ? O[0] : O, "readonly");
|
|
2240
2240
|
if (t.autoSchema) S = P, E = I, (y = e).verno = S.version / 10, E = y._dbSchema = Ft(0, S, E), y._storeNames = Et(S.objectStoreNames, 0), Gt(y, [y._allTables], R(E), E);
|
|
2241
|
-
else if (Ut(e, e._dbSchema, I), ((
|
|
2241
|
+
else if (Ut(e, e._dbSchema, I), ((A = On(Ft(0, (A = e).idbdb, I), A._dbSchema)).add.length || A.change.some(function(C) {
|
|
2242
2242
|
return C.add.length || C.change.length;
|
|
2243
|
-
})) && !
|
|
2243
|
+
})) && !a) return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), P.close(), o = P.version + 1, a = !0, w(u());
|
|
2244
2244
|
Lt(e, I);
|
|
2245
2245
|
} catch {
|
|
2246
2246
|
}
|
|
@@ -2248,7 +2248,7 @@ var Mr = { exports: {} };
|
|
|
2248
2248
|
t.vcFired = !0, e.on("versionchange").fire(C);
|
|
2249
2249
|
}), P.onclose = q(function(C) {
|
|
2250
2250
|
e.on("close").fire(C);
|
|
2251
|
-
}),
|
|
2251
|
+
}), f && (A = e._deps, I = m, P = A.indexedDB, A = A.IDBKeyRange, kn(P) || I === Mt || An(P, A).put({ name: I }).catch(X)), w();
|
|
2252
2252
|
}, p);
|
|
2253
2253
|
}).catch(function(w) {
|
|
2254
2254
|
switch (w == null ? void 0 : w.name) {
|
|
@@ -2256,12 +2256,12 @@ var Mr = { exports: {} };
|
|
|
2256
2256
|
if (0 < t.PR1398_maxLoop) return t.PR1398_maxLoop--, console.warn("Dexie: Workaround for Chrome UnknownError on open()"), u();
|
|
2257
2257
|
break;
|
|
2258
2258
|
case "VersionError":
|
|
2259
|
-
if (0 <
|
|
2259
|
+
if (0 < o) return o = 0, u();
|
|
2260
2260
|
}
|
|
2261
2261
|
return N.reject(w);
|
|
2262
2262
|
});
|
|
2263
2263
|
}
|
|
2264
|
-
var h, g = t.dbReadyResolve, b = null,
|
|
2264
|
+
var h, g = t.dbReadyResolve, b = null, f = !1;
|
|
2265
2265
|
return N.race([i, (typeof navigator > "u" ? N.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(w) {
|
|
2266
2266
|
function p() {
|
|
2267
2267
|
return indexedDB.databases().finally(w);
|
|
@@ -2274,7 +2274,7 @@ var Mr = { exports: {} };
|
|
|
2274
2274
|
return e.on.ready.fire(e.vip);
|
|
2275
2275
|
})).then(function w() {
|
|
2276
2276
|
if (0 < t.onReadyBeingFired.length) {
|
|
2277
|
-
var p = t.onReadyBeingFired.reduce(
|
|
2277
|
+
var p = t.onReadyBeingFired.reduce(on, X);
|
|
2278
2278
|
return t.onReadyBeingFired = [], N.resolve(Dn(function() {
|
|
2279
2279
|
return p(e.vip);
|
|
2280
2280
|
})).then(w);
|
|
@@ -2293,64 +2293,64 @@ var Mr = { exports: {} };
|
|
|
2293
2293
|
t.openComplete = !0, g();
|
|
2294
2294
|
}).then(function() {
|
|
2295
2295
|
var w;
|
|
2296
|
-
return
|
|
2296
|
+
return f && (w = {}, e.tables.forEach(function(p) {
|
|
2297
2297
|
p.schema.indexes.forEach(function(m) {
|
|
2298
|
-
m.name && (w["idb://".concat(e.name, "/").concat(p.name, "/").concat(m.name)] = new
|
|
2299
|
-
}), w["idb://".concat(e.name, "/").concat(p.name, "/")] = w["idb://".concat(e.name, "/").concat(p.name, "/:dels")] = new
|
|
2298
|
+
m.name && (w["idb://".concat(e.name, "/").concat(p.name, "/").concat(m.name)] = new ae(-1 / 0, [[[]]]));
|
|
2299
|
+
}), w["idb://".concat(e.name, "/").concat(p.name, "/")] = w["idb://".concat(e.name, "/").concat(p.name, "/:dels")] = new ae(-1 / 0, [[[]]]);
|
|
2300
2300
|
}), Re(gt).fire(w), Tn(w, !0)), e;
|
|
2301
2301
|
});
|
|
2302
2302
|
}
|
|
2303
2303
|
function Mn(e) {
|
|
2304
|
-
function t(
|
|
2305
|
-
return e.next(
|
|
2304
|
+
function t(a) {
|
|
2305
|
+
return e.next(a);
|
|
2306
2306
|
}
|
|
2307
|
-
var n =
|
|
2308
|
-
return e.throw(
|
|
2307
|
+
var n = o(t), i = o(function(a) {
|
|
2308
|
+
return e.throw(a);
|
|
2309
2309
|
});
|
|
2310
|
-
function a
|
|
2310
|
+
function o(a) {
|
|
2311
2311
|
return function(h) {
|
|
2312
|
-
var u =
|
|
2312
|
+
var u = a(h), h = u.value;
|
|
2313
2313
|
return u.done ? h : h && typeof h.then == "function" ? h.then(n, i) : B(h) ? Promise.all(h).then(n, i) : n(h);
|
|
2314
2314
|
};
|
|
2315
2315
|
}
|
|
2316
|
-
return
|
|
2316
|
+
return o(t)();
|
|
2317
2317
|
}
|
|
2318
2318
|
function Qt(e, t, n) {
|
|
2319
|
-
for (var i = B(e) ? e.slice() : [e],
|
|
2319
|
+
for (var i = B(e) ? e.slice() : [e], o = 0; o < n; ++o) i.push(t);
|
|
2320
2320
|
return i;
|
|
2321
2321
|
}
|
|
2322
2322
|
var mi = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2323
2323
|
return l(l({}, e), { table: function(t) {
|
|
2324
|
-
var n = e.table(t), i = n.schema,
|
|
2325
|
-
function c(
|
|
2326
|
-
var m = mt(
|
|
2327
|
-
return v.push(S), S.isPrimaryKey ||
|
|
2324
|
+
var n = e.table(t), i = n.schema, o = {}, a = [];
|
|
2325
|
+
function c(f, w, p) {
|
|
2326
|
+
var m = mt(f), v = o[m] = o[m] || [], y = f == null ? 0 : typeof f == "string" ? 1 : f.length, S = 0 < w, S = l(l({}, p), { name: S ? "".concat(m, "(virtual-from:").concat(p.name, ")") : p.name, lowLevelIndex: p, isVirtual: S, keyTail: w, keyLength: y, extractKey: Sn(f), unique: !S && p.unique });
|
|
2327
|
+
return v.push(S), S.isPrimaryKey || a.push(S), 1 < y && c(y === 2 ? f[0] : f.slice(0, y - 1), w + 1, p), v.sort(function(E, O) {
|
|
2328
2328
|
return E.keyTail - O.keyTail;
|
|
2329
2329
|
}), S;
|
|
2330
2330
|
}
|
|
2331
|
-
t = c(i.primaryKey.keyPath, 0, i.primaryKey),
|
|
2331
|
+
t = c(i.primaryKey.keyPath, 0, i.primaryKey), o[":id"] = [t];
|
|
2332
2332
|
for (var u = 0, h = i.indexes; u < h.length; u++) {
|
|
2333
2333
|
var g = h[u];
|
|
2334
2334
|
c(g.keyPath, 0, g);
|
|
2335
2335
|
}
|
|
2336
|
-
function b(
|
|
2337
|
-
var w, p =
|
|
2338
|
-
return p.isVirtual ? l(l({},
|
|
2336
|
+
function b(f) {
|
|
2337
|
+
var w, p = f.query.index;
|
|
2338
|
+
return p.isVirtual ? l(l({}, f), { query: { index: p.lowLevelIndex, range: (w = f.query.range, p = p.keyTail, { type: w.type === 1 ? 2 : w.type, lower: Qt(w.lower, w.lowerOpen ? e.MAX_KEY : e.MIN_KEY, p), lowerOpen: !0, upper: Qt(w.upper, w.upperOpen ? e.MIN_KEY : e.MAX_KEY, p), upperOpen: !0 }) } }) : f;
|
|
2339
2339
|
}
|
|
2340
|
-
return l(l({}, n), { schema: l(l({}, i), { primaryKey: t, indexes:
|
|
2341
|
-
return (
|
|
2342
|
-
} }), count: function(
|
|
2343
|
-
return n.count(b(
|
|
2344
|
-
}, query: function(
|
|
2345
|
-
return n.query(b(
|
|
2346
|
-
}, openCursor: function(
|
|
2347
|
-
var w =
|
|
2348
|
-
return m ? n.openCursor(b(
|
|
2340
|
+
return l(l({}, n), { schema: l(l({}, i), { primaryKey: t, indexes: a, getIndexByKeyPath: function(f) {
|
|
2341
|
+
return (f = o[mt(f)]) && f[0];
|
|
2342
|
+
} }), count: function(f) {
|
|
2343
|
+
return n.count(b(f));
|
|
2344
|
+
}, query: function(f) {
|
|
2345
|
+
return n.query(b(f));
|
|
2346
|
+
}, openCursor: function(f) {
|
|
2347
|
+
var w = f.query.index, p = w.keyTail, m = w.isVirtual, v = w.keyLength;
|
|
2348
|
+
return m ? n.openCursor(b(f)).then(function(S) {
|
|
2349
2349
|
return S && y(S);
|
|
2350
|
-
}) : n.openCursor(
|
|
2350
|
+
}) : n.openCursor(f);
|
|
2351
2351
|
function y(S) {
|
|
2352
2352
|
return Object.create(S, { continue: { value: function(E) {
|
|
2353
|
-
E != null ? S.continue(Qt(E,
|
|
2353
|
+
E != null ? S.continue(Qt(E, f.reverse ? e.MAX_KEY : e.MIN_KEY, p)) : f.unique ? S.continue(S.key.slice(0, v).concat(f.reverse ? e.MIN_KEY : e.MAX_KEY, p)) : S.continue();
|
|
2354
2354
|
} }, continuePrimaryKey: { value: function(E, O) {
|
|
2355
2355
|
S.continuePrimaryKey(Qt(E, e.MAX_KEY, p), O);
|
|
2356
2356
|
} }, primaryKey: { get: function() {
|
|
@@ -2366,11 +2366,11 @@ var Mr = { exports: {} };
|
|
|
2366
2366
|
} });
|
|
2367
2367
|
} };
|
|
2368
2368
|
function jn(e, t, n, i) {
|
|
2369
|
-
return n = n || {}, i = i || "", R(e).forEach(function(
|
|
2370
|
-
var
|
|
2371
|
-
Z(t,
|
|
2372
|
-
}), R(t).forEach(function(
|
|
2373
|
-
Z(e,
|
|
2369
|
+
return n = n || {}, i = i || "", R(e).forEach(function(o) {
|
|
2370
|
+
var a, c, u;
|
|
2371
|
+
Z(t, o) ? (a = e[o], c = t[o], typeof a == "object" && typeof c == "object" && a && c ? (u = en(a)) !== en(c) ? n[i + o] = t[o] : u === "Object" ? jn(a, c, n, i + o + ".") : a !== c && (n[i + o] = t[o]) : a !== c && (n[i + o] = t[o])) : n[i + o] = void 0;
|
|
2372
|
+
}), R(t).forEach(function(o) {
|
|
2373
|
+
Z(e, o) || (n[i + o] = t[o]);
|
|
2374
2374
|
}), n;
|
|
2375
2375
|
}
|
|
2376
2376
|
function Kn(e, t) {
|
|
@@ -2379,57 +2379,57 @@ var Mr = { exports: {} };
|
|
|
2379
2379
|
var bi = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
2380
2380
|
return l(l({}, e), { table: function(t) {
|
|
2381
2381
|
var n = e.table(t), i = n.schema.primaryKey;
|
|
2382
|
-
return l(l({}, n), { mutate: function(
|
|
2383
|
-
var
|
|
2384
|
-
switch (
|
|
2382
|
+
return l(l({}, n), { mutate: function(o) {
|
|
2383
|
+
var a = G.trans, c = a.table(t).hook, u = c.deleting, h = c.creating, g = c.updating;
|
|
2384
|
+
switch (o.type) {
|
|
2385
2385
|
case "add":
|
|
2386
2386
|
if (h.fire === X) break;
|
|
2387
|
-
return
|
|
2388
|
-
return b(
|
|
2387
|
+
return a._promise("readwrite", function() {
|
|
2388
|
+
return b(o);
|
|
2389
2389
|
}, !0);
|
|
2390
2390
|
case "put":
|
|
2391
2391
|
if (h.fire === X && g.fire === X) break;
|
|
2392
|
-
return
|
|
2393
|
-
return b(
|
|
2392
|
+
return a._promise("readwrite", function() {
|
|
2393
|
+
return b(o);
|
|
2394
2394
|
}, !0);
|
|
2395
2395
|
case "delete":
|
|
2396
2396
|
if (u.fire === X) break;
|
|
2397
|
-
return
|
|
2398
|
-
return b(
|
|
2397
|
+
return a._promise("readwrite", function() {
|
|
2398
|
+
return b(o);
|
|
2399
2399
|
}, !0);
|
|
2400
2400
|
case "deleteRange":
|
|
2401
2401
|
if (u.fire === X) break;
|
|
2402
|
-
return
|
|
2403
|
-
return function
|
|
2402
|
+
return a._promise("readwrite", function() {
|
|
2403
|
+
return function f(w, p, m) {
|
|
2404
2404
|
return n.query({ trans: w, values: !1, query: { index: i, range: p }, limit: m }).then(function(v) {
|
|
2405
2405
|
var y = v.result;
|
|
2406
2406
|
return b({ type: "delete", keys: y, trans: w }).then(function(S) {
|
|
2407
|
-
return 0 < S.numFailures ? Promise.reject(S.failures[0]) : y.length < m ? { failures: [], numFailures: 0, lastResult: void 0 } :
|
|
2407
|
+
return 0 < S.numFailures ? Promise.reject(S.failures[0]) : y.length < m ? { failures: [], numFailures: 0, lastResult: void 0 } : f(w, l(l({}, p), { lower: y[y.length - 1], lowerOpen: !0 }), m);
|
|
2408
2408
|
});
|
|
2409
2409
|
});
|
|
2410
|
-
}(
|
|
2410
|
+
}(o.trans, o.range, 1e4);
|
|
2411
2411
|
}, !0);
|
|
2412
2412
|
}
|
|
2413
|
-
return n.mutate(
|
|
2414
|
-
function b(
|
|
2415
|
-
var w, p, m, v = G.trans, y =
|
|
2413
|
+
return n.mutate(o);
|
|
2414
|
+
function b(f) {
|
|
2415
|
+
var w, p, m, v = G.trans, y = f.keys || Kn(i, f);
|
|
2416
2416
|
if (!y) throw new Error("Keys missing");
|
|
2417
|
-
return (
|
|
2418
|
-
var E = y.map(function(O,
|
|
2419
|
-
var P, M, I, C = S[
|
|
2420
|
-
return
|
|
2417
|
+
return (f = f.type === "add" || f.type === "put" ? l(l({}, f), { keys: y }) : l({}, f)).type !== "delete" && (f.values = x([], f.values)), f.keys && (f.keys = x([], f.keys)), w = n, m = y, ((p = f).type === "add" ? Promise.resolve([]) : w.getMany({ trans: p.trans, keys: m, cache: "immutable" })).then(function(S) {
|
|
2418
|
+
var E = y.map(function(O, A) {
|
|
2419
|
+
var P, M, I, C = S[A], j = { onerror: null, onsuccess: null };
|
|
2420
|
+
return f.type === "delete" ? u.fire.call(j, O, C, v) : f.type === "add" || C === void 0 ? (P = h.fire.call(j, O, f.values[A], v), O == null && P != null && (f.keys[A] = O = P, i.outbound || le(f.values[A], i.keyPath, O))) : (P = jn(C, f.values[A]), (M = g.fire.call(j, P, O, C, v)) && (I = f.values[A], Object.keys(M).forEach(function(T) {
|
|
2421
2421
|
Z(I, T) ? I[T] = M[T] : le(I, T, M[T]);
|
|
2422
2422
|
}))), j;
|
|
2423
2423
|
});
|
|
2424
|
-
return n.mutate(
|
|
2425
|
-
for (var
|
|
2424
|
+
return n.mutate(f).then(function(O) {
|
|
2425
|
+
for (var A = O.failures, P = O.results, M = O.numFailures, O = O.lastResult, I = 0; I < y.length; ++I) {
|
|
2426
2426
|
var C = (P || y)[I], j = E[I];
|
|
2427
|
-
C == null ? j.onerror && j.onerror(
|
|
2427
|
+
C == null ? j.onerror && j.onerror(A[I]) : j.onsuccess && j.onsuccess(f.type === "put" && S[I] ? f.values[I] : C);
|
|
2428
2428
|
}
|
|
2429
|
-
return { failures:
|
|
2429
|
+
return { failures: A, results: P, numFailures: M, lastResult: O };
|
|
2430
2430
|
}).catch(function(O) {
|
|
2431
|
-
return E.forEach(function(
|
|
2432
|
-
return
|
|
2431
|
+
return E.forEach(function(A) {
|
|
2432
|
+
return A.onerror && A.onerror(O);
|
|
2433
2433
|
}), Promise.reject(O);
|
|
2434
2434
|
});
|
|
2435
2435
|
});
|
|
@@ -2440,7 +2440,7 @@ var Mr = { exports: {} };
|
|
|
2440
2440
|
function Or(e, t, n) {
|
|
2441
2441
|
try {
|
|
2442
2442
|
if (!t || t.keys.length < e.length) return null;
|
|
2443
|
-
for (var i = [],
|
|
2443
|
+
for (var i = [], o = 0, a = 0; o < t.keys.length && a < e.length; ++o) H(t.keys[o], e[a]) === 0 && (i.push(n ? Me(t.values[o]) : t.values[o]), ++a);
|
|
2444
2444
|
return i.length === e.length ? i : null;
|
|
2445
2445
|
} catch {
|
|
2446
2446
|
return null;
|
|
@@ -2451,9 +2451,9 @@ var Mr = { exports: {} };
|
|
|
2451
2451
|
var n = e.table(t);
|
|
2452
2452
|
return l(l({}, n), { getMany: function(i) {
|
|
2453
2453
|
if (!i.cache) return n.getMany(i);
|
|
2454
|
-
var
|
|
2455
|
-
return
|
|
2456
|
-
return i.trans._cache = { keys: i.keys, values: i.cache === "clone" ? Me(
|
|
2454
|
+
var o = Or(i.keys, i.trans._cache, i.cache === "clone");
|
|
2455
|
+
return o ? N.resolve(o) : n.getMany(i).then(function(a) {
|
|
2456
|
+
return i.trans._cache = { keys: i.keys, values: i.cache === "clone" ? Me(a) : a }, a;
|
|
2457
2457
|
});
|
|
2458
2458
|
}, mutate: function(i) {
|
|
2459
2459
|
return i.type !== "add" && (i.trans._cache = null), n.mutate(i);
|
|
@@ -2463,7 +2463,7 @@ var Mr = { exports: {} };
|
|
|
2463
2463
|
function xr(e, t) {
|
|
2464
2464
|
return e.trans.mode === "readonly" && !!e.subscr && !e.trans.explicit && e.trans.db._options.cache !== "disabled" && !t.schema.primaryKey.outbound;
|
|
2465
2465
|
}
|
|
2466
|
-
function
|
|
2466
|
+
function Ar(e, t) {
|
|
2467
2467
|
switch (e) {
|
|
2468
2468
|
case "query":
|
|
2469
2469
|
return t.values && !t.unique;
|
|
@@ -2475,21 +2475,21 @@ var Mr = { exports: {} };
|
|
|
2475
2475
|
}
|
|
2476
2476
|
}
|
|
2477
2477
|
var wi = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2478
|
-
var t = e.schema.name, n = new
|
|
2479
|
-
return l(l({}, e), { transaction: function(i,
|
|
2480
|
-
if (G.subscr &&
|
|
2481
|
-
return e.transaction(i,
|
|
2478
|
+
var t = e.schema.name, n = new ae(e.MIN_KEY, e.MAX_KEY);
|
|
2479
|
+
return l(l({}, e), { transaction: function(i, o, a) {
|
|
2480
|
+
if (G.subscr && o !== "readonly") throw new $.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(G.querier));
|
|
2481
|
+
return e.transaction(i, o, a);
|
|
2482
2482
|
}, table: function(i) {
|
|
2483
|
-
var
|
|
2483
|
+
var o = e.table(i), a = o.schema, c = a.primaryKey, f = a.indexes, u = c.extractKey, h = c.outbound, g = c.autoIncrement && f.filter(function(p) {
|
|
2484
2484
|
return p.compound && p.keyPath.includes(c.keyPath);
|
|
2485
|
-
}), b = l(l({},
|
|
2485
|
+
}), b = l(l({}, o), { mutate: function(p) {
|
|
2486
2486
|
function m(T) {
|
|
2487
|
-
return T = "idb://".concat(t, "/").concat(i, "/").concat(T), O[T] || (O[T] = new
|
|
2487
|
+
return T = "idb://".concat(t, "/").concat(i, "/").concat(T), O[T] || (O[T] = new ae());
|
|
2488
2488
|
}
|
|
2489
|
-
var v, y, S, E = p.trans, O = p.mutatedParts || (p.mutatedParts = {}),
|
|
2489
|
+
var v, y, S, E = p.trans, O = p.mutatedParts || (p.mutatedParts = {}), A = m(""), P = m(":dels"), M = p.type, j = p.type === "deleteRange" ? [p.range] : p.type === "delete" ? [p.keys] : p.values.length < 50 ? [Kn(c, p).filter(function(T) {
|
|
2490
2490
|
return T;
|
|
2491
2491
|
}), p.values] : [], I = j[0], C = j[1], j = p.trans._cache;
|
|
2492
|
-
return B(I) ? (
|
|
2492
|
+
return B(I) ? (A.addKeys(I), (j = M === "delete" || I.length === C.length ? Or(I, j) : null) || P.addKeys(I), (j || C) && (v = m, y = j, S = C, a.indexes.forEach(function(T) {
|
|
2493
2493
|
var L = v(T.name || "");
|
|
2494
2494
|
function U(z) {
|
|
2495
2495
|
return z != null ? T.extractKey(z) : null;
|
|
@@ -2503,10 +2503,10 @@ var Mr = { exports: {} };
|
|
|
2503
2503
|
var F = y && U(y[se]), se = S && U(S[se]);
|
|
2504
2504
|
H(F, se) !== 0 && (F != null && W(F), se != null && W(se));
|
|
2505
2505
|
});
|
|
2506
|
-
}))) : I ? (C = { from: (C = I.lower) !== null && C !== void 0 ? C : e.MIN_KEY, to: (C = I.upper) !== null && C !== void 0 ? C : e.MAX_KEY }, P.add(C),
|
|
2506
|
+
}))) : I ? (C = { from: (C = I.lower) !== null && C !== void 0 ? C : e.MIN_KEY, to: (C = I.upper) !== null && C !== void 0 ? C : e.MAX_KEY }, P.add(C), A.add(C)) : (A.add(n), P.add(n), a.indexes.forEach(function(T) {
|
|
2507
2507
|
return m(T.name).add(n);
|
|
2508
|
-
})),
|
|
2509
|
-
return !I || p.type !== "add" && p.type !== "put" || (
|
|
2508
|
+
})), o.mutate(p).then(function(T) {
|
|
2509
|
+
return !I || p.type !== "add" && p.type !== "put" || (A.addKeys(T.results), g && g.forEach(function(L) {
|
|
2510
2510
|
for (var U = p.values.map(function(F) {
|
|
2511
2511
|
return L.extractKey(F);
|
|
2512
2512
|
}), W = L.keyPath.findIndex(function(F) {
|
|
@@ -2515,38 +2515,38 @@ var Mr = { exports: {} };
|
|
|
2515
2515
|
m(L.name).addKeys(U);
|
|
2516
2516
|
})), E.mutatedParts = Ht(E.mutatedParts || {}, O), T;
|
|
2517
2517
|
});
|
|
2518
|
-
} }),
|
|
2518
|
+
} }), f = function(m) {
|
|
2519
2519
|
var v = m.query, m = v.index, v = v.range;
|
|
2520
|
-
return [m, new
|
|
2520
|
+
return [m, new ae((m = v.lower) !== null && m !== void 0 ? m : e.MIN_KEY, (v = v.upper) !== null && v !== void 0 ? v : e.MAX_KEY)];
|
|
2521
2521
|
}, w = { get: function(p) {
|
|
2522
|
-
return [c, new
|
|
2522
|
+
return [c, new ae(p.key)];
|
|
2523
2523
|
}, getMany: function(p) {
|
|
2524
|
-
return [c, new
|
|
2525
|
-
}, count:
|
|
2524
|
+
return [c, new ae().addKeys(p.keys)];
|
|
2525
|
+
}, count: f, query: f, openCursor: f };
|
|
2526
2526
|
return R(w).forEach(function(p) {
|
|
2527
2527
|
b[p] = function(m) {
|
|
2528
|
-
var v = G.subscr, y = !!v, S = xr(G,
|
|
2528
|
+
var v = G.subscr, y = !!v, S = xr(G, o) && Ar(p, m) ? m.obsSet = {} : v;
|
|
2529
2529
|
if (y) {
|
|
2530
2530
|
var E = function(C) {
|
|
2531
|
-
return C = "idb://".concat(t, "/").concat(i, "/").concat(C), S[C] || (S[C] = new
|
|
2532
|
-
}, O = E(""),
|
|
2533
|
-
if ((p === "query" && y.isPrimaryKey && !m.values ?
|
|
2531
|
+
return C = "idb://".concat(t, "/").concat(i, "/").concat(C), S[C] || (S[C] = new ae());
|
|
2532
|
+
}, O = E(""), A = E(":dels"), v = w[p](m), y = v[0], v = v[1];
|
|
2533
|
+
if ((p === "query" && y.isPrimaryKey && !m.values ? A : E(y.name || "")).add(v), !y.isPrimaryKey) {
|
|
2534
2534
|
if (p !== "count") {
|
|
2535
|
-
var P = p === "query" && h && m.values &&
|
|
2536
|
-
return
|
|
2535
|
+
var P = p === "query" && h && m.values && o.query(l(l({}, m), { values: !1 }));
|
|
2536
|
+
return o[p].apply(this, arguments).then(function(C) {
|
|
2537
2537
|
if (p === "query") {
|
|
2538
2538
|
if (h && m.values) return P.then(function(U) {
|
|
2539
2539
|
return U = U.result, O.addKeys(U), C;
|
|
2540
2540
|
});
|
|
2541
2541
|
var j = m.values ? C.result.map(u) : C.result;
|
|
2542
|
-
(m.values ? O :
|
|
2542
|
+
(m.values ? O : A).addKeys(j);
|
|
2543
2543
|
} else if (p === "openCursor") {
|
|
2544
2544
|
var T = C, L = m.values;
|
|
2545
2545
|
return T && Object.create(T, { key: { get: function() {
|
|
2546
|
-
return
|
|
2546
|
+
return A.addKey(T.primaryKey), T.key;
|
|
2547
2547
|
} }, primaryKey: { get: function() {
|
|
2548
2548
|
var U = T.primaryKey;
|
|
2549
|
-
return
|
|
2549
|
+
return A.addKey(U), U;
|
|
2550
2550
|
} }, value: { get: function() {
|
|
2551
2551
|
return L && O.addKey(T.primaryKey), T.value;
|
|
2552
2552
|
} } });
|
|
@@ -2554,41 +2554,41 @@ var Mr = { exports: {} };
|
|
|
2554
2554
|
return C;
|
|
2555
2555
|
});
|
|
2556
2556
|
}
|
|
2557
|
-
|
|
2557
|
+
A.add(n);
|
|
2558
2558
|
}
|
|
2559
2559
|
}
|
|
2560
|
-
return
|
|
2560
|
+
return o[p].apply(this, arguments);
|
|
2561
2561
|
};
|
|
2562
2562
|
}), b;
|
|
2563
2563
|
} });
|
|
2564
2564
|
} };
|
|
2565
|
-
function
|
|
2565
|
+
function kr(e, t, n) {
|
|
2566
2566
|
if (n.numFailures === 0) return t;
|
|
2567
2567
|
if (t.type === "deleteRange") return null;
|
|
2568
2568
|
var i = t.keys ? t.keys.length : "values" in t && t.values ? t.values.length : 1;
|
|
2569
|
-
return n.numFailures === i ? null : (t = l({}, t), B(t.keys) && (t.keys = t.keys.filter(function(
|
|
2570
|
-
return !(
|
|
2571
|
-
})), "values" in t && B(t.values) && (t.values = t.values.filter(function(
|
|
2572
|
-
return !(
|
|
2569
|
+
return n.numFailures === i ? null : (t = l({}, t), B(t.keys) && (t.keys = t.keys.filter(function(o, a) {
|
|
2570
|
+
return !(a in n.failures);
|
|
2571
|
+
})), "values" in t && B(t.values) && (t.values = t.values.filter(function(o, a) {
|
|
2572
|
+
return !(a in n.failures);
|
|
2573
2573
|
})), t);
|
|
2574
2574
|
}
|
|
2575
2575
|
function Nn(e, t) {
|
|
2576
2576
|
return n = e, ((i = t).lower === void 0 || (i.lowerOpen ? 0 < H(n, i.lower) : 0 <= H(n, i.lower))) && (e = e, (t = t).upper === void 0 || (t.upperOpen ? H(e, t.upper) < 0 : H(e, t.upper) <= 0));
|
|
2577
2577
|
var n, i;
|
|
2578
2578
|
}
|
|
2579
|
-
function Dr(e, t, w, i,
|
|
2579
|
+
function Dr(e, t, w, i, o, a) {
|
|
2580
2580
|
if (!w || w.length === 0) return e;
|
|
2581
|
-
var c = t.query.index, u = c.multiEntry, h = t.query.range, g = i.schema.primaryKey.extractKey, b = c.extractKey,
|
|
2581
|
+
var c = t.query.index, u = c.multiEntry, h = t.query.range, g = i.schema.primaryKey.extractKey, b = c.extractKey, f = (c.lowLevelIndex || c).extractKey, w = w.reduce(function(p, m) {
|
|
2582
2582
|
var v = p, y = [];
|
|
2583
|
-
if (m.type === "add" || m.type === "put") for (var S = new
|
|
2584
|
-
var O,
|
|
2585
|
-
S.hasKey(P) || (O = b(
|
|
2583
|
+
if (m.type === "add" || m.type === "put") for (var S = new ae(), E = m.values.length - 1; 0 <= E; --E) {
|
|
2584
|
+
var O, A = m.values[E], P = g(A);
|
|
2585
|
+
S.hasKey(P) || (O = b(A), (u && B(O) ? O.some(function(T) {
|
|
2586
2586
|
return Nn(T, h);
|
|
2587
|
-
}) : Nn(O, h)) && (S.addKey(P), y.push(
|
|
2587
|
+
}) : Nn(O, h)) && (S.addKey(P), y.push(A)));
|
|
2588
2588
|
}
|
|
2589
2589
|
switch (m.type) {
|
|
2590
2590
|
case "add":
|
|
2591
|
-
var M = new
|
|
2591
|
+
var M = new ae().addKeys(t.values ? p.map(function(L) {
|
|
2592
2592
|
return g(L);
|
|
2593
2593
|
}) : p), v = p.concat(t.values ? y.filter(function(L) {
|
|
2594
2594
|
return L = g(L), !M.hasKey(L) && (M.addKey(L), !0);
|
|
@@ -2599,7 +2599,7 @@ var Mr = { exports: {} };
|
|
|
2599
2599
|
}));
|
|
2600
2600
|
break;
|
|
2601
2601
|
case "put":
|
|
2602
|
-
var I = new
|
|
2602
|
+
var I = new ae().addKeys(m.values.map(function(L) {
|
|
2603
2603
|
return g(L);
|
|
2604
2604
|
}));
|
|
2605
2605
|
v = p.filter(function(L) {
|
|
@@ -2609,7 +2609,7 @@ var Mr = { exports: {} };
|
|
|
2609
2609
|
}));
|
|
2610
2610
|
break;
|
|
2611
2611
|
case "delete":
|
|
2612
|
-
var C = new
|
|
2612
|
+
var C = new ae().addKeys(m.keys);
|
|
2613
2613
|
v = p.filter(function(L) {
|
|
2614
2614
|
return !C.hasKey(t.values ? g(L) : L);
|
|
2615
2615
|
});
|
|
@@ -2623,50 +2623,50 @@ var Mr = { exports: {} };
|
|
|
2623
2623
|
return v;
|
|
2624
2624
|
}, e);
|
|
2625
2625
|
return w === e ? e : (w.sort(function(p, m) {
|
|
2626
|
-
return H(
|
|
2627
|
-
}), t.limit && t.limit < 1 / 0 && (w.length > t.limit ? w.length = t.limit : e.length === t.limit && w.length < t.limit && (
|
|
2626
|
+
return H(f(p), f(m)) || H(g(p), g(m));
|
|
2627
|
+
}), t.limit && t.limit < 1 / 0 && (w.length > t.limit ? w.length = t.limit : e.length === t.limit && w.length < t.limit && (o.dirty = !0)), a ? Object.freeze(w) : w);
|
|
2628
2628
|
}
|
|
2629
2629
|
function Pr(e, t) {
|
|
2630
2630
|
return H(e.lower, t.lower) === 0 && H(e.upper, t.upper) === 0 && !!e.lowerOpen == !!t.lowerOpen && !!e.upperOpen == !!t.upperOpen;
|
|
2631
2631
|
}
|
|
2632
2632
|
function _i(e, t) {
|
|
2633
|
-
return function(n, i,
|
|
2633
|
+
return function(n, i, o, a) {
|
|
2634
2634
|
if (n === void 0) return i !== void 0 ? -1 : 0;
|
|
2635
2635
|
if (i === void 0) return 1;
|
|
2636
2636
|
if ((i = H(n, i)) === 0) {
|
|
2637
|
-
if (
|
|
2638
|
-
if (
|
|
2639
|
-
if (
|
|
2637
|
+
if (o && a) return 0;
|
|
2638
|
+
if (o) return 1;
|
|
2639
|
+
if (a) return -1;
|
|
2640
2640
|
}
|
|
2641
2641
|
return i;
|
|
2642
|
-
}(e.lower, t.lower, e.lowerOpen, t.lowerOpen) <= 0 && 0 <= function(n, i,
|
|
2642
|
+
}(e.lower, t.lower, e.lowerOpen, t.lowerOpen) <= 0 && 0 <= function(n, i, o, a) {
|
|
2643
2643
|
if (n === void 0) return i !== void 0 ? 1 : 0;
|
|
2644
2644
|
if (i === void 0) return -1;
|
|
2645
2645
|
if ((i = H(n, i)) === 0) {
|
|
2646
|
-
if (
|
|
2647
|
-
if (
|
|
2648
|
-
if (
|
|
2646
|
+
if (o && a) return 0;
|
|
2647
|
+
if (o) return -1;
|
|
2648
|
+
if (a) return 1;
|
|
2649
2649
|
}
|
|
2650
2650
|
return i;
|
|
2651
2651
|
}(e.upper, t.upper, e.upperOpen, t.upperOpen);
|
|
2652
2652
|
}
|
|
2653
2653
|
function Si(e, t, n, i) {
|
|
2654
2654
|
e.subscribers.add(n), i.addEventListener("abort", function() {
|
|
2655
|
-
var
|
|
2656
|
-
e.subscribers.delete(n), e.subscribers.size === 0 && (
|
|
2657
|
-
|
|
2655
|
+
var o, a;
|
|
2656
|
+
e.subscribers.delete(n), e.subscribers.size === 0 && (o = e, a = t, setTimeout(function() {
|
|
2657
|
+
o.subscribers.size === 0 && je(a, o);
|
|
2658
2658
|
}, 3e3));
|
|
2659
2659
|
});
|
|
2660
2660
|
}
|
|
2661
2661
|
var Ei = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
|
|
2662
2662
|
var t = e.schema.name;
|
|
2663
|
-
return l(l({}, e), { transaction: function(n, i,
|
|
2664
|
-
var
|
|
2665
|
-
return i === "readwrite" && (c = (
|
|
2663
|
+
return l(l({}, e), { transaction: function(n, i, o) {
|
|
2664
|
+
var a, c, u = e.transaction(n, i, o);
|
|
2665
|
+
return i === "readwrite" && (c = (a = new AbortController()).signal, o = function(h) {
|
|
2666
2666
|
return function() {
|
|
2667
|
-
if (
|
|
2668
|
-
for (var g = /* @__PURE__ */ new Set(), b = 0,
|
|
2669
|
-
var w =
|
|
2667
|
+
if (a.abort(), i === "readwrite") {
|
|
2668
|
+
for (var g = /* @__PURE__ */ new Set(), b = 0, f = n; b < f.length; b++) {
|
|
2669
|
+
var w = f[b], p = Ue["idb://".concat(t, "/").concat(w)];
|
|
2670
2670
|
if (p) {
|
|
2671
2671
|
var m = e.table(w), v = p.optimisticOps.filter(function(L) {
|
|
2672
2672
|
return L.trans === u;
|
|
@@ -2678,7 +2678,7 @@ var Mr = { exports: {} };
|
|
|
2678
2678
|
p.optimisticOps = p.optimisticOps.filter(function(L) {
|
|
2679
2679
|
return L.trans !== u;
|
|
2680
2680
|
});
|
|
2681
|
-
for (var
|
|
2681
|
+
for (var A = 0, P = Object.values(p.queries.query); A < P.length; A++) for (var M, I, C, j = 0, T = (M = P[A]).slice(); j < T.length; j++) (I = T[j]).res != null && u.mutatedParts && (h && !I.dirty ? (C = Object.isFrozen(I.res), C = Dr(I.res, I.req, v, m, I, C), I.dirty ? (je(M, I), I.subscribers.forEach(function(L) {
|
|
2682
2682
|
return g.add(L);
|
|
2683
2683
|
})) : C !== I.res && (I.res = C, I.promise = N.resolve({ result: C }))) : (I.dirty && je(M, I), I.subscribers.forEach(function(L) {
|
|
2684
2684
|
return g.add(L);
|
|
@@ -2691,31 +2691,31 @@ var Mr = { exports: {} };
|
|
|
2691
2691
|
});
|
|
2692
2692
|
}
|
|
2693
2693
|
};
|
|
2694
|
-
}, u.addEventListener("abort",
|
|
2694
|
+
}, u.addEventListener("abort", o(!1), { signal: c }), u.addEventListener("error", o(!1), { signal: c }), u.addEventListener("complete", o(!0), { signal: c })), u;
|
|
2695
2695
|
}, table: function(n) {
|
|
2696
|
-
var i = e.table(n),
|
|
2697
|
-
return l(l({}, i), { mutate: function(
|
|
2696
|
+
var i = e.table(n), o = i.schema.primaryKey;
|
|
2697
|
+
return l(l({}, i), { mutate: function(a) {
|
|
2698
2698
|
var c = G.trans;
|
|
2699
|
-
if (
|
|
2699
|
+
if (o.outbound || c.db._options.cache === "disabled" || c.explicit || c.idbtrans.mode !== "readwrite") return i.mutate(a);
|
|
2700
2700
|
var u = Ue["idb://".concat(t, "/").concat(n)];
|
|
2701
|
-
return u ? (c = i.mutate(
|
|
2701
|
+
return u ? (c = i.mutate(a), a.type !== "add" && a.type !== "put" || !(50 <= a.values.length || Kn(o, a).some(function(h) {
|
|
2702
2702
|
return h == null;
|
|
2703
|
-
})) ? (u.optimisticOps.push(
|
|
2704
|
-
0 < h.numFailures && (je(u.optimisticOps,
|
|
2703
|
+
})) ? (u.optimisticOps.push(a), a.mutatedParts && Yt(a.mutatedParts), c.then(function(h) {
|
|
2704
|
+
0 < h.numFailures && (je(u.optimisticOps, a), (h = kr(0, a, h)) && u.optimisticOps.push(h), a.mutatedParts && Yt(a.mutatedParts));
|
|
2705
2705
|
}), c.catch(function() {
|
|
2706
|
-
je(u.optimisticOps,
|
|
2706
|
+
je(u.optimisticOps, a), a.mutatedParts && Yt(a.mutatedParts);
|
|
2707
2707
|
})) : c.then(function(h) {
|
|
2708
|
-
var g =
|
|
2708
|
+
var g = kr(0, l(l({}, a), { values: a.values.map(function(b, f) {
|
|
2709
2709
|
var w;
|
|
2710
|
-
return h.failures[
|
|
2710
|
+
return h.failures[f] ? b : (b = (w = o.keyPath) !== null && w !== void 0 && w.includes(".") ? Me(b) : l({}, b), le(b, o.keyPath, h.results[f]), b);
|
|
2711
2711
|
}) }), h);
|
|
2712
2712
|
u.optimisticOps.push(g), queueMicrotask(function() {
|
|
2713
|
-
return
|
|
2713
|
+
return a.mutatedParts && Yt(a.mutatedParts);
|
|
2714
2714
|
});
|
|
2715
|
-
}), c) : i.mutate(
|
|
2716
|
-
}, query: function(
|
|
2717
|
-
if (!xr(G, i) || !
|
|
2718
|
-
var c = ((g = G.trans) === null || g === void 0 ? void 0 : g.db._options.cache) === "immutable",
|
|
2715
|
+
}), c) : i.mutate(a);
|
|
2716
|
+
}, query: function(a) {
|
|
2717
|
+
if (!xr(G, i) || !Ar("query", a)) return i.query(a);
|
|
2718
|
+
var c = ((g = G.trans) === null || g === void 0 ? void 0 : g.db._options.cache) === "immutable", f = G, u = f.requery, h = f.signal, g = function(m, v, y, S) {
|
|
2719
2719
|
var E = Ue["idb://".concat(m, "/").concat(v)];
|
|
2720
2720
|
if (!E) return [];
|
|
2721
2721
|
if (!(v = E.queries[y])) return [null, !1, E, null];
|
|
@@ -2723,19 +2723,19 @@ var Mr = { exports: {} };
|
|
|
2723
2723
|
if (!O) return [null, !1, E, null];
|
|
2724
2724
|
switch (y) {
|
|
2725
2725
|
case "query":
|
|
2726
|
-
var
|
|
2726
|
+
var A = O.find(function(P) {
|
|
2727
2727
|
return P.req.limit === S.limit && P.req.values === S.values && Pr(P.req.query.range, S.query.range);
|
|
2728
2728
|
});
|
|
2729
|
-
return
|
|
2729
|
+
return A ? [A, !0, E, O] : [O.find(function(P) {
|
|
2730
2730
|
return ("limit" in P.req ? P.req.limit : 1 / 0) >= S.limit && (!S.values || P.req.values) && _i(P.req.query.range, S.query.range);
|
|
2731
2731
|
}), !1, E, O];
|
|
2732
2732
|
case "count":
|
|
2733
|
-
return
|
|
2733
|
+
return A = O.find(function(P) {
|
|
2734
2734
|
return Pr(P.req.query.range, S.query.range);
|
|
2735
|
-
}), [
|
|
2735
|
+
}), [A, !!A, E, O];
|
|
2736
2736
|
}
|
|
2737
|
-
}(t, n, "query",
|
|
2738
|
-
return b &&
|
|
2737
|
+
}(t, n, "query", a), b = g[0], f = g[1], w = g[2], p = g[3];
|
|
2738
|
+
return b && f ? b.obsSet = a.obsSet : (f = i.query(a).then(function(m) {
|
|
2739
2739
|
var v = m.result;
|
|
2740
2740
|
if (b && (b.res = v), c) {
|
|
2741
2741
|
for (var y = 0, S = v.length; y < S; ++y) Object.freeze(v[y]);
|
|
@@ -2744,15 +2744,15 @@ var Mr = { exports: {} };
|
|
|
2744
2744
|
return m;
|
|
2745
2745
|
}).catch(function(m) {
|
|
2746
2746
|
return p && b && je(p, b), Promise.reject(m);
|
|
2747
|
-
}), b = { obsSet:
|
|
2748
|
-
return { result: Dr(m.result,
|
|
2747
|
+
}), b = { obsSet: a.obsSet, promise: f, subscribers: /* @__PURE__ */ new Set(), type: "query", req: a, dirty: !1 }, p ? p.push(b) : (p = [b], (w = w || (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) {
|
|
2748
|
+
return { result: Dr(m.result, a, w == null ? void 0 : w.optimisticOps, i, b, c) };
|
|
2749
2749
|
});
|
|
2750
2750
|
} });
|
|
2751
2751
|
} });
|
|
2752
2752
|
} };
|
|
2753
2753
|
function Xt(e, t) {
|
|
2754
|
-
return new Proxy(e, { get: function(n, i,
|
|
2755
|
-
return i === "db" ? t : Reflect.get(n, i,
|
|
2754
|
+
return new Proxy(e, { get: function(n, i, o) {
|
|
2755
|
+
return i === "db" ? t : Reflect.get(n, i, o);
|
|
2756
2756
|
} });
|
|
2757
2757
|
}
|
|
2758
2758
|
var Ee = (ne.prototype.version = function(e) {
|
|
@@ -2774,18 +2774,18 @@ var Mr = { exports: {} };
|
|
|
2774
2774
|
t._state.dbReadyPromise.then(n, i);
|
|
2775
2775
|
}).then(e);
|
|
2776
2776
|
}, ne.prototype.use = function(e) {
|
|
2777
|
-
var t = e.stack, n = e.create, i = e.level,
|
|
2778
|
-
return
|
|
2779
|
-
return
|
|
2777
|
+
var t = e.stack, n = e.create, i = e.level, o = e.name;
|
|
2778
|
+
return o && this.unuse({ stack: t, name: o }), e = this._middlewares[t] || (this._middlewares[t] = []), e.push({ stack: t, create: n, level: i ?? 10, name: o }), e.sort(function(a, c) {
|
|
2779
|
+
return a.level - c.level;
|
|
2780
2780
|
}), this;
|
|
2781
2781
|
}, ne.prototype.unuse = function(e) {
|
|
2782
2782
|
var t = e.stack, n = e.name, i = e.create;
|
|
2783
|
-
return t && this._middlewares[t] && (this._middlewares[t] = this._middlewares[t].filter(function(
|
|
2784
|
-
return i ?
|
|
2783
|
+
return t && this._middlewares[t] && (this._middlewares[t] = this._middlewares[t].filter(function(o) {
|
|
2784
|
+
return i ? o.create !== i : !!n && o.name !== n;
|
|
2785
2785
|
})), this;
|
|
2786
2786
|
}, ne.prototype.open = function() {
|
|
2787
2787
|
var e = this;
|
|
2788
|
-
return Ge(
|
|
2788
|
+
return Ge(ke, function() {
|
|
2789
2789
|
return yi(e);
|
|
2790
2790
|
});
|
|
2791
2791
|
}, ne.prototype._close = function() {
|
|
@@ -2809,14 +2809,14 @@ var Mr = { exports: {} };
|
|
|
2809
2809
|
var t = this;
|
|
2810
2810
|
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
2811
2811
|
var n = 0 < arguments.length && typeof arguments[0] != "object", i = this._state;
|
|
2812
|
-
return new N(function(
|
|
2812
|
+
return new N(function(o, a) {
|
|
2813
2813
|
function c() {
|
|
2814
2814
|
t.close(e);
|
|
2815
2815
|
var u = t._deps.indexedDB.deleteDatabase(t.name);
|
|
2816
2816
|
u.onsuccess = q(function() {
|
|
2817
2817
|
var h, g, b;
|
|
2818
|
-
h = t._deps, g = t.name, b = h.indexedDB, h = h.IDBKeyRange,
|
|
2819
|
-
}), u.onerror = me(
|
|
2818
|
+
h = t._deps, g = t.name, b = h.indexedDB, h = h.IDBKeyRange, kn(b) || g === Mt || An(b, h).delete(g).catch(X), o();
|
|
2819
|
+
}), u.onerror = me(a), u.onblocked = t._fireOnBlocked;
|
|
2820
2820
|
}
|
|
2821
2821
|
if (n) throw new $.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
2822
2822
|
i.isBeingOpened ? i.dbReadyPromise.then(c) : c();
|
|
@@ -2839,52 +2839,52 @@ var Mr = { exports: {} };
|
|
|
2839
2839
|
});
|
|
2840
2840
|
}, enumerable: !1, configurable: !0 }), ne.prototype.transaction = function() {
|
|
2841
2841
|
var e = (function(t, n, i) {
|
|
2842
|
-
var
|
|
2843
|
-
if (
|
|
2844
|
-
for (var
|
|
2845
|
-
return i =
|
|
2842
|
+
var o = arguments.length;
|
|
2843
|
+
if (o < 2) throw new $.InvalidArgument("Too few arguments");
|
|
2844
|
+
for (var a = new Array(o - 1); --o; ) a[o - 1] = arguments[o];
|
|
2845
|
+
return i = a.pop(), [t, Xn(a), i];
|
|
2846
2846
|
}).apply(this, arguments);
|
|
2847
2847
|
return this._transaction.apply(this, e);
|
|
2848
2848
|
}, ne.prototype._transaction = function(e, t, n) {
|
|
2849
|
-
var i = this,
|
|
2850
|
-
|
|
2851
|
-
var
|
|
2849
|
+
var i = this, o = G.trans;
|
|
2850
|
+
o && o.db === this && e.indexOf("!") === -1 || (o = null);
|
|
2851
|
+
var a, c, u = e.indexOf("?") !== -1;
|
|
2852
2852
|
e = e.replace("!", "").replace("?", "");
|
|
2853
2853
|
try {
|
|
2854
2854
|
if (c = t.map(function(g) {
|
|
2855
2855
|
if (g = g instanceof i.Table ? g.name : g, typeof g != "string") throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
|
|
2856
2856
|
return g;
|
|
2857
|
-
}), e == "r" || e === pn)
|
|
2857
|
+
}), e == "r" || e === pn) a = pn;
|
|
2858
2858
|
else {
|
|
2859
2859
|
if (e != "rw" && e != gn) throw new $.InvalidArgument("Invalid transaction mode: " + e);
|
|
2860
|
-
|
|
2860
|
+
a = gn;
|
|
2861
2861
|
}
|
|
2862
|
-
if (
|
|
2863
|
-
if (
|
|
2862
|
+
if (o) {
|
|
2863
|
+
if (o.mode === pn && a === gn) {
|
|
2864
2864
|
if (!u) throw new $.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
2865
|
-
|
|
2865
|
+
o = null;
|
|
2866
2866
|
}
|
|
2867
|
-
|
|
2868
|
-
if (
|
|
2867
|
+
o && c.forEach(function(g) {
|
|
2868
|
+
if (o && o.storeNames.indexOf(g) === -1) {
|
|
2869
2869
|
if (!u) throw new $.SubTransaction("Table " + g + " not included in parent transaction.");
|
|
2870
|
-
|
|
2870
|
+
o = null;
|
|
2871
2871
|
}
|
|
2872
|
-
}), u &&
|
|
2872
|
+
}), u && o && !o.active && (o = null);
|
|
2873
2873
|
}
|
|
2874
2874
|
} catch (g) {
|
|
2875
|
-
return
|
|
2876
|
-
|
|
2875
|
+
return o ? o._promise(null, function(b, f) {
|
|
2876
|
+
f(g);
|
|
2877
2877
|
}) : te(g);
|
|
2878
2878
|
}
|
|
2879
|
-
var h = (function g(b,
|
|
2879
|
+
var h = (function g(b, f, w, p, m) {
|
|
2880
2880
|
return N.resolve().then(function() {
|
|
2881
|
-
var v = G.transless || G, y = b._createTransaction(
|
|
2881
|
+
var v = G.transless || G, y = b._createTransaction(f, w, b._dbSchema, p);
|
|
2882
2882
|
if (y.explicit = !0, v = { trans: y, transless: v }, p) y.idbtrans = p.idbtrans;
|
|
2883
2883
|
else try {
|
|
2884
2884
|
y.create(), y.idbtrans._explicit = !0, b._state.PR1398_maxLoop = 3;
|
|
2885
2885
|
} catch (O) {
|
|
2886
2886
|
return O.name === rn.InvalidState && b.isOpen() && 0 < --b._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), b.close({ disableAutoOpen: !1 }), b.open().then(function() {
|
|
2887
|
-
return g(b,
|
|
2887
|
+
return g(b, f, w, null, m);
|
|
2888
2888
|
})) : te(O);
|
|
2889
2889
|
}
|
|
2890
2890
|
var S, E = nn(m);
|
|
@@ -2903,8 +2903,8 @@ var Mr = { exports: {} };
|
|
|
2903
2903
|
return y._reject(O), te(O);
|
|
2904
2904
|
});
|
|
2905
2905
|
});
|
|
2906
|
-
}).bind(null, this,
|
|
2907
|
-
return
|
|
2906
|
+
}).bind(null, this, a, c, o, n);
|
|
2907
|
+
return o ? o._promise(a, h, "lock") : G.trans ? Ge(G.transless, function() {
|
|
2908
2908
|
return i._whenReady(h);
|
|
2909
2909
|
}) : this._whenReady(h);
|
|
2910
2910
|
}, ne.prototype.table = function(e) {
|
|
@@ -2916,35 +2916,35 @@ var Mr = { exports: {} };
|
|
|
2916
2916
|
this._middlewares = {}, this.verno = 0;
|
|
2917
2917
|
var i = ne.dependencies;
|
|
2918
2918
|
this._options = t = l({ addons: ne.addons, autoOpen: !0, indexedDB: i.indexedDB, IDBKeyRange: i.IDBKeyRange, cache: "cloned" }, t), this._deps = { indexedDB: t.indexedDB, IDBKeyRange: t.IDBKeyRange }, i = t.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
2919
|
-
var
|
|
2920
|
-
g.dbReadyPromise = new N(function(
|
|
2921
|
-
g.dbReadyResolve =
|
|
2922
|
-
}), g.openCanceller = new N(function(
|
|
2919
|
+
var o, a, c, u, h, g = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: X, dbReadyPromise: null, cancelOpen: X, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
|
|
2920
|
+
g.dbReadyPromise = new N(function(f) {
|
|
2921
|
+
g.dbReadyResolve = f;
|
|
2922
|
+
}), g.openCanceller = new N(function(f, w) {
|
|
2923
2923
|
g.cancelOpen = w;
|
|
2924
|
-
}), this._state = g, this.name = e, this.on = dt(this, "populate", "blocked", "versionchange", "close", { ready: [
|
|
2924
|
+
}), this._state = g, this.name = e, this.on = dt(this, "populate", "blocked", "versionchange", "close", { ready: [on, X] }), this.on.ready.subscribe = Hn(this.on.ready.subscribe, function(f) {
|
|
2925
2925
|
return function(w, p) {
|
|
2926
2926
|
ne.vip(function() {
|
|
2927
2927
|
var m, v = n._state;
|
|
2928
|
-
v.openComplete ? (v.dbOpenError || N.resolve().then(w), p &&
|
|
2928
|
+
v.openComplete ? (v.dbOpenError || N.resolve().then(w), p && f(w)) : v.onReadyBeingFired ? (v.onReadyBeingFired.push(w), p && f(w)) : (f(w), m = n, p || f(function y() {
|
|
2929
2929
|
m.on.ready.unsubscribe(w), m.on.ready.unsubscribe(y);
|
|
2930
2930
|
}));
|
|
2931
2931
|
});
|
|
2932
2932
|
};
|
|
2933
|
-
}), this.Collection = (
|
|
2934
|
-
this.db =
|
|
2935
|
-
var p =
|
|
2933
|
+
}), this.Collection = (o = this, ft(oi.prototype, function(S, y) {
|
|
2934
|
+
this.db = o;
|
|
2935
|
+
var p = ar, m = null;
|
|
2936
2936
|
if (y) try {
|
|
2937
2937
|
p = y();
|
|
2938
2938
|
} catch (E) {
|
|
2939
2939
|
m = E;
|
|
2940
2940
|
}
|
|
2941
2941
|
var v = S._ctx, y = v.table, S = y.hook.reading.fire;
|
|
2942
|
-
this._ctx = { table: y, index: v.index, isPrimKey: !v.index || y.schema.primKey.keyPath && v.index === y.schema.primKey.name, range: p, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: m, or: v.or, valueMapper: S !==
|
|
2943
|
-
})), this.Table = (
|
|
2944
|
-
this.db =
|
|
2945
|
-
})), this.Transaction = (c = this, ft(ci.prototype, function(
|
|
2942
|
+
this._ctx = { table: y, index: v.index, isPrimKey: !v.index || y.schema.primKey.keyPath && v.index === y.schema.primKey.name, range: p, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: m, or: v.or, valueMapper: S !== at ? S : null };
|
|
2943
|
+
})), this.Table = (a = this, ft(lr.prototype, function(f, w, p) {
|
|
2944
|
+
this.db = a, this._tx = p, this.name = f, this.schema = w, this.hook = a._allTables[f] ? a._allTables[f].hook : dt(null, { creating: [Jr, X], reading: [Xr, at], updating: [Zr, X], deleting: [Vr, X] });
|
|
2945
|
+
})), this.Transaction = (c = this, ft(ci.prototype, function(f, w, p, m, v) {
|
|
2946
2946
|
var y = this;
|
|
2947
|
-
this.db = c, this.mode =
|
|
2947
|
+
this.db = c, this.mode = f, this.storeNames = w, this.schema = p, this.chromeTransactionDurability = m, this.idbtrans = null, this.on = dt(this, "complete", "error", "abort"), this.parent = v || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new N(function(S, E) {
|
|
2948
2948
|
y._resolve = S, y._reject = E;
|
|
2949
2949
|
}), this._completion.then(function() {
|
|
2950
2950
|
y.active = !1, y.on.complete.fire();
|
|
@@ -2952,43 +2952,43 @@ var Mr = { exports: {} };
|
|
|
2952
2952
|
var E = y.active;
|
|
2953
2953
|
return y.active = !1, y.on.error.fire(S), y.parent ? y.parent._reject(S) : E && y.idbtrans && y.idbtrans.abort(), te(S);
|
|
2954
2954
|
});
|
|
2955
|
-
})), this.Version = (u = this, ft(gi.prototype, function(
|
|
2956
|
-
this.db = u, this._cfg = { version:
|
|
2957
|
-
})), this.WhereClause = (h = this, ft(gr.prototype, function(
|
|
2958
|
-
if (this.db = h, this._ctx = { table:
|
|
2955
|
+
})), this.Version = (u = this, ft(gi.prototype, function(f) {
|
|
2956
|
+
this.db = u, this._cfg = { version: f, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
2957
|
+
})), this.WhereClause = (h = this, ft(gr.prototype, function(f, w, p) {
|
|
2958
|
+
if (this.db = h, this._ctx = { table: f, index: w === ":id" ? null : w, or: p }, this._cmp = this._ascending = H, this._descending = function(m, v) {
|
|
2959
2959
|
return H(v, m);
|
|
2960
2960
|
}, this._max = function(m, v) {
|
|
2961
2961
|
return 0 < H(m, v) ? m : v;
|
|
2962
2962
|
}, this._min = function(m, v) {
|
|
2963
2963
|
return H(m, v) < 0 ? m : v;
|
|
2964
2964
|
}, this._IDBKeyRange = h._deps.IDBKeyRange, !this._IDBKeyRange) throw new $.MissingAPI();
|
|
2965
|
-
})), this.on("versionchange", function(
|
|
2966
|
-
0 <
|
|
2967
|
-
}), this.on("blocked", function(
|
|
2968
|
-
!
|
|
2969
|
-
}), this._maxKey = yt(t.IDBKeyRange), this._createTransaction = function(
|
|
2970
|
-
return new n.Transaction(
|
|
2971
|
-
}, this._fireOnBlocked = function(
|
|
2972
|
-
n.on("blocked").fire(
|
|
2965
|
+
})), this.on("versionchange", function(f) {
|
|
2966
|
+
0 < f.newVersion ? console.warn("Another connection wants to upgrade database '".concat(n.name, "'. Closing db now to resume the upgrade.")) : console.warn("Another connection wants to delete database '".concat(n.name, "'. Closing db now to resume the delete request.")), n.close({ disableAutoOpen: !1 });
|
|
2967
|
+
}), this.on("blocked", function(f) {
|
|
2968
|
+
!f.newVersion || f.newVersion < f.oldVersion ? console.warn("Dexie.delete('".concat(n.name, "') was blocked")) : console.warn("Upgrade '".concat(n.name, "' blocked by other connection holding version ").concat(f.oldVersion / 10));
|
|
2969
|
+
}), this._maxKey = yt(t.IDBKeyRange), this._createTransaction = function(f, w, p, m) {
|
|
2970
|
+
return new n.Transaction(f, w, p, n._options.chromeTransactionDurability, m);
|
|
2971
|
+
}, this._fireOnBlocked = function(f) {
|
|
2972
|
+
n.on("blocked").fire(f), qe.filter(function(w) {
|
|
2973
2973
|
return w.name === n.name && w !== n && !w._state.vcFired;
|
|
2974
2974
|
}).map(function(w) {
|
|
2975
|
-
return w.on("versionchange").fire(
|
|
2975
|
+
return w.on("versionchange").fire(f);
|
|
2976
2976
|
});
|
|
2977
2977
|
}, this.use(vi), this.use(Ei), this.use(wi), this.use(mi), this.use(bi);
|
|
2978
|
-
var b = new Proxy(this, { get: function(
|
|
2978
|
+
var b = new Proxy(this, { get: function(f, w, p) {
|
|
2979
2979
|
if (w === "_vip") return !0;
|
|
2980
2980
|
if (w === "table") return function(v) {
|
|
2981
2981
|
return Xt(n.table(v), b);
|
|
2982
2982
|
};
|
|
2983
|
-
var m = Reflect.get(
|
|
2983
|
+
var m = Reflect.get(f, w, p);
|
|
2984
2984
|
return m instanceof lr ? Xt(m, b) : w === "tables" ? m.map(function(v) {
|
|
2985
2985
|
return Xt(v, b);
|
|
2986
2986
|
}) : w === "_createTransaction" ? function() {
|
|
2987
2987
|
return Xt(m.apply(this, arguments), b);
|
|
2988
2988
|
} : m;
|
|
2989
2989
|
} });
|
|
2990
|
-
this.vip = b, i.forEach(function(
|
|
2991
|
-
return
|
|
2990
|
+
this.vip = b, i.forEach(function(f) {
|
|
2991
|
+
return f(n);
|
|
2992
2992
|
});
|
|
2993
2993
|
}
|
|
2994
2994
|
var Jt, he = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", Oi = (Bn.prototype.subscribe = function(e, t, n) {
|
|
@@ -3005,14 +3005,14 @@ var Mr = { exports: {} };
|
|
|
3005
3005
|
Jt = { indexedDB: null, IDBKeyRange: null };
|
|
3006
3006
|
}
|
|
3007
3007
|
function Ir(e) {
|
|
3008
|
-
var t, n = !1, i = new Oi(function(
|
|
3009
|
-
var
|
|
3008
|
+
var t, n = !1, i = new Oi(function(o) {
|
|
3009
|
+
var a = nn(e), c, u = !1, h = {}, g = {}, b = { get closed() {
|
|
3010
3010
|
return u;
|
|
3011
3011
|
}, unsubscribe: function() {
|
|
3012
|
-
u || (u = !0, c && c.abort(),
|
|
3012
|
+
u || (u = !0, c && c.abort(), f && Re.storagemutated.unsubscribe(p));
|
|
3013
3013
|
} };
|
|
3014
|
-
|
|
3015
|
-
var
|
|
3014
|
+
o.start && o.start(b);
|
|
3015
|
+
var f = !1, w = function() {
|
|
3016
3016
|
return hn(m);
|
|
3017
3017
|
}, p = function(v) {
|
|
3018
3018
|
Ht(h, v), In(g, h) && w();
|
|
@@ -3021,22 +3021,22 @@ var Mr = { exports: {} };
|
|
|
3021
3021
|
!u && Jt.indexedDB && (h = {}, v = {}, c && c.abort(), c = new AbortController(), S = function(E) {
|
|
3022
3022
|
var O = Je();
|
|
3023
3023
|
try {
|
|
3024
|
-
|
|
3025
|
-
var
|
|
3026
|
-
return
|
|
3024
|
+
a && Ze();
|
|
3025
|
+
var A = De(e, E);
|
|
3026
|
+
return A = a ? A.finally(Pe) : A;
|
|
3027
3027
|
} finally {
|
|
3028
3028
|
O && Ve();
|
|
3029
3029
|
}
|
|
3030
3030
|
}(y = { subscr: v, signal: c.signal, requery: w, querier: e, trans: null }), Promise.resolve(S).then(function(E) {
|
|
3031
3031
|
n = !0, t = E, u || y.signal.aborted || (h = {}, function(O) {
|
|
3032
|
-
for (var
|
|
3032
|
+
for (var A in O) if (Z(O, A)) return;
|
|
3033
3033
|
return 1;
|
|
3034
|
-
}(g = v) ||
|
|
3035
|
-
return !u &&
|
|
3034
|
+
}(g = v) || f || (Re(gt, p), f = !0), hn(function() {
|
|
3035
|
+
return !u && o.next && o.next(E);
|
|
3036
3036
|
}));
|
|
3037
3037
|
}, function(E) {
|
|
3038
3038
|
n = !1, ["DatabaseClosedError", "AbortError"].includes(E == null ? void 0 : E.name) || u || hn(function() {
|
|
3039
|
-
u ||
|
|
3039
|
+
u || o.error && o.error(E);
|
|
3040
3040
|
});
|
|
3041
3041
|
}));
|
|
3042
3042
|
};
|
|
@@ -3067,13 +3067,13 @@ var Mr = { exports: {} };
|
|
|
3067
3067
|
});
|
|
3068
3068
|
}, getDatabaseNames: function(e) {
|
|
3069
3069
|
try {
|
|
3070
|
-
return t = We.dependencies, n = t.indexedDB, t = t.IDBKeyRange, (
|
|
3071
|
-
return i.map(function(
|
|
3072
|
-
return
|
|
3073
|
-
}).filter(function(
|
|
3074
|
-
return
|
|
3070
|
+
return t = We.dependencies, n = t.indexedDB, t = t.IDBKeyRange, (kn(n) ? Promise.resolve(n.databases()).then(function(i) {
|
|
3071
|
+
return i.map(function(o) {
|
|
3072
|
+
return o.name;
|
|
3073
|
+
}).filter(function(o) {
|
|
3074
|
+
return o !== Mt;
|
|
3075
3075
|
});
|
|
3076
|
-
}) :
|
|
3076
|
+
}) : An(n, t).toCollection().primaryKeys()).then(e);
|
|
3077
3077
|
} catch {
|
|
3078
3078
|
return te(new $.MissingAPI());
|
|
3079
3079
|
}
|
|
@@ -3097,8 +3097,8 @@ var Mr = { exports: {} };
|
|
|
3097
3097
|
try {
|
|
3098
3098
|
var i = Mn(e.apply(n, t || []));
|
|
3099
3099
|
return i && typeof i.then == "function" ? i : N.resolve(i);
|
|
3100
|
-
} catch (
|
|
3101
|
-
return te(
|
|
3100
|
+
} catch (o) {
|
|
3101
|
+
return te(o);
|
|
3102
3102
|
}
|
|
3103
3103
|
}, currentTransaction: { get: function() {
|
|
3104
3104
|
return G.trans || null;
|
|
@@ -3135,9 +3135,9 @@ var Mr = { exports: {} };
|
|
|
3135
3135
|
for (var t = 0, n = qe; t < n.length; t++) n[t].close({ disableAutoOpen: !1 });
|
|
3136
3136
|
}
|
|
3137
3137
|
}), addEventListener("pageshow", function(e) {
|
|
3138
|
-
!Ee.disableBfCache && e.persisted && (ye && console.debug("Dexie: handling persisted pageshow"), Cr(), Ln({ all: new
|
|
3138
|
+
!Ee.disableBfCache && e.persisted && (ye && console.debug("Dexie: handling persisted pageshow"), Cr(), Ln({ all: new ae(-1 / 0, [[]]) }));
|
|
3139
3139
|
})), N.rejectionMapper = function(e, t) {
|
|
3140
|
-
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 &&
|
|
3140
|
+
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 && Ae(t, "stack", { get: function() {
|
|
3141
3141
|
return this.inner.stack;
|
|
3142
3142
|
} }), t);
|
|
3143
3143
|
}, qn(ye), l(Ee, Object.freeze({ __proto__: null, Dexie: Ee, liveQuery: Ir, Entity: sr, cmp: H, PropModSymbol: Se, PropModification: ht, replacePrefix: function(e, t) {
|
|
@@ -3146,54 +3146,54 @@ var Mr = { exports: {} };
|
|
|
3146
3146
|
return new ht({ add: e });
|
|
3147
3147
|
}, remove: function(e) {
|
|
3148
3148
|
return new ht({ remove: e });
|
|
3149
|
-
}, default: Ee, RangeSet:
|
|
3149
|
+
}, default: Ee, RangeSet: ae, mergeRanges: vt, rangesOverlap: wr }), { default: Ee }), Ee;
|
|
3150
3150
|
});
|
|
3151
3151
|
})(Mr);
|
|
3152
3152
|
var Ii = Mr.exports;
|
|
3153
3153
|
const Un = /* @__PURE__ */ Pi(Ii), Tr = Symbol.for("Dexie"), Wn = globalThis[Tr] || (globalThis[Tr] = Un);
|
|
3154
3154
|
if (Un.semVer !== Wn.semVer)
|
|
3155
3155
|
throw new Error(`Two different versions of Dexie loaded in the same app: ${Un.semVer} and ${Wn.semVer}`);
|
|
3156
|
-
function J(
|
|
3157
|
-
let r = `${
|
|
3158
|
-
return
|
|
3156
|
+
function J(d) {
|
|
3157
|
+
let r = `${d.type}.${d.topics}`;
|
|
3158
|
+
return d.order && (r += `.${d.order}`), d.period && (r += `.${d.period}`), r;
|
|
3159
3159
|
}
|
|
3160
|
-
function rt(
|
|
3160
|
+
function rt(d) {
|
|
3161
3161
|
var r;
|
|
3162
|
-
if (
|
|
3163
|
-
const s = (r =
|
|
3164
|
-
s && s.length > 1 ? (
|
|
3162
|
+
if (d.widget === void 0) {
|
|
3163
|
+
const s = (r = d.topics) == null ? void 0 : r.split("-");
|
|
3164
|
+
s && s.length > 1 ? (d.dashboard = s ? s[0] : "", d.widget = s ? s[1] : "") : (d.widget = d.topics, d.dashboard = d.slide);
|
|
3165
3165
|
}
|
|
3166
|
-
return
|
|
3166
|
+
return d.topics === void 0 && (d.topics = `${d.dashboard}-${d.widget}`), d;
|
|
3167
3167
|
}
|
|
3168
|
-
function _t(
|
|
3168
|
+
function _t(d, r) {
|
|
3169
3169
|
var B;
|
|
3170
|
-
let s, l,
|
|
3171
|
-
switch (
|
|
3170
|
+
let s, l, x, D, R;
|
|
3171
|
+
switch (d.moderation) {
|
|
3172
3172
|
case qt.BEFORE:
|
|
3173
|
-
s = /* @__PURE__ */ new Date(), l = (B =
|
|
3173
|
+
s = /* @__PURE__ */ new Date(), l = (B = d.beforeTime) == null ? void 0 : B.split(":"), x = Number.parseInt(l ? l[0] : "00"), D = Number.parseInt(l ? l[1] : "00"), R = Number.parseInt(l ? l[2] : "00"), r.before = s.setHours(x, D, R, 0) / 1e3, r.period || (r.period = s.getDay() === 1 ? 72 : 24);
|
|
3174
3174
|
break;
|
|
3175
3175
|
case qt.DELAYED:
|
|
3176
|
-
|
|
3176
|
+
d.delay && d.delay > 0 && (r.delay = `${d.delay}`);
|
|
3177
3177
|
break;
|
|
3178
3178
|
case qt.APPROVED:
|
|
3179
3179
|
r.approved = "1";
|
|
3180
3180
|
break;
|
|
3181
3181
|
default:
|
|
3182
|
-
|
|
3182
|
+
d.period !== 0 && (r.period = d.period);
|
|
3183
3183
|
}
|
|
3184
3184
|
return r;
|
|
3185
3185
|
}
|
|
3186
3186
|
class jr {
|
|
3187
3187
|
constructor(r) {
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3188
|
+
k(this, "db");
|
|
3189
|
+
k(this, "subscribers", []);
|
|
3190
|
+
k(this, "options");
|
|
3191
3191
|
/**
|
|
3192
3192
|
* Retrieve Cloud Data
|
|
3193
3193
|
* @param query IQuery
|
|
3194
3194
|
* @returns IResponse
|
|
3195
3195
|
*/
|
|
3196
|
-
|
|
3196
|
+
k(this, "getCloud", async (r) => {
|
|
3197
3197
|
const s = await this.db.table(K.CLOUD).where({ id: r.widget }).last().catch(() => {
|
|
3198
3198
|
console.warn(
|
|
3199
3199
|
"%capi%C %ccloud",
|
|
@@ -3211,7 +3211,7 @@ class jr {
|
|
|
3211
3211
|
* @param query IQuery
|
|
3212
3212
|
* @returns IResponse
|
|
3213
3213
|
*/
|
|
3214
|
-
|
|
3214
|
+
k(this, "getSeries", async (r) => {
|
|
3215
3215
|
const s = await this.db.table(K.SERIES).where({ id: r.widget }).last().catch(() => {
|
|
3216
3216
|
console.warn(
|
|
3217
3217
|
"%capi%c %cseries",
|
|
@@ -3229,10 +3229,10 @@ class jr {
|
|
|
3229
3229
|
* @param query IQuery
|
|
3230
3230
|
* @returns IResponse
|
|
3231
3231
|
*/
|
|
3232
|
-
|
|
3233
|
-
const s = (R) => R.widget_id === r.widget, l = (R) => R.utc > ((r == null ? void 0 : r.since) || 0),
|
|
3232
|
+
k(this, "getMessages", async (r) => {
|
|
3233
|
+
const s = (R) => R.widget_id === r.widget, l = (R) => R.utc > ((r == null ? void 0 : r.since) || 0), x = (R) => (R == null ? void 0 : R.visible) !== 0, D = r.order ?? "utc";
|
|
3234
3234
|
try {
|
|
3235
|
-
const R = await this.db.table(K.TOPICS).orderBy(D).reverse().filter(s).filter(l).filter(
|
|
3235
|
+
const R = await this.db.table(K.TOPICS).orderBy(D).reverse().filter(s).filter(l).filter(x).limit((r == null ? void 0 : r.limit) ?? 25).toArray().catch(() => {
|
|
3236
3236
|
console.warn(
|
|
3237
3237
|
"%capi%c %cmessages",
|
|
3238
3238
|
_.API,
|
|
@@ -3273,7 +3273,7 @@ class jr {
|
|
|
3273
3273
|
* @param data
|
|
3274
3274
|
* @returns number
|
|
3275
3275
|
*/
|
|
3276
|
-
|
|
3276
|
+
k(this, "setCloud", async (r, s) => r.type === K.CLOUD && s !== "" ? await this.db.table(K.CLOUD).put({
|
|
3277
3277
|
id: r.widget,
|
|
3278
3278
|
dashboard_id: r.dashboard,
|
|
3279
3279
|
data: s.data
|
|
@@ -3284,7 +3284,7 @@ class jr {
|
|
|
3284
3284
|
* @param data
|
|
3285
3285
|
* @returns number
|
|
3286
3286
|
*/
|
|
3287
|
-
|
|
3287
|
+
k(this, "setSeries", async (r, s) => r.type === K.SERIES && s !== "" ? await this.db.table(K.SERIES).put({
|
|
3288
3288
|
id: r.widget,
|
|
3289
3289
|
dashboard_id: r.dashboard,
|
|
3290
3290
|
data: s.data
|
|
@@ -3295,11 +3295,11 @@ class jr {
|
|
|
3295
3295
|
* @param data any
|
|
3296
3296
|
* @returns number
|
|
3297
3297
|
*/
|
|
3298
|
-
|
|
3298
|
+
k(this, "setMessages", async (r, s) => {
|
|
3299
3299
|
if (r.type !== K.MESSAGES)
|
|
3300
3300
|
return 400;
|
|
3301
3301
|
const l = s.data.title;
|
|
3302
|
-
let
|
|
3302
|
+
let x = 0;
|
|
3303
3303
|
return s.data.messages.forEach(async (D) => {
|
|
3304
3304
|
var R, B, Q, ee;
|
|
3305
3305
|
D.id !== null && (await this.db.table(K.MESSAGES).put({
|
|
@@ -3308,7 +3308,7 @@ class jr {
|
|
|
3308
3308
|
data: D,
|
|
3309
3309
|
expires: D.expires
|
|
3310
3310
|
}).catch((ge) => {
|
|
3311
|
-
|
|
3311
|
+
x++, console.error(
|
|
3312
3312
|
"%cstorage",
|
|
3313
3313
|
_.STORAGE,
|
|
3314
3314
|
"set message",
|
|
@@ -3328,7 +3328,7 @@ class jr {
|
|
|
3328
3328
|
utc: D.utc,
|
|
3329
3329
|
expires: D.expires
|
|
3330
3330
|
}).catch((ge) => {
|
|
3331
|
-
|
|
3331
|
+
x++, console.error(
|
|
3332
3332
|
"%cstorage",
|
|
3333
3333
|
_.STORAGE,
|
|
3334
3334
|
"set topic",
|
|
@@ -3340,7 +3340,7 @@ class jr {
|
|
|
3340
3340
|
}), s.data.topics.forEach(async (D) => {
|
|
3341
3341
|
const R = D.message_id, B = D.visible ? 1 : 0, Q = D.title;
|
|
3342
3342
|
await this.db.table(K.TOPICS).where("message_id").equals(R).modify({ visible: B }).catch((ee) => {
|
|
3343
|
-
|
|
3343
|
+
x++, console.error(
|
|
3344
3344
|
"%cstorage",
|
|
3345
3345
|
_.STORAGE,
|
|
3346
3346
|
"update message visibility",
|
|
@@ -3349,12 +3349,12 @@ class jr {
|
|
|
3349
3349
|
ee.message
|
|
3350
3350
|
);
|
|
3351
3351
|
});
|
|
3352
|
-
}),
|
|
3352
|
+
}), x === 0 ? 201 : 400;
|
|
3353
3353
|
});
|
|
3354
3354
|
/**
|
|
3355
3355
|
* Wipe Message data after expires timestamp
|
|
3356
3356
|
*/
|
|
3357
|
-
|
|
3357
|
+
k(this, "cleanMessages", async () => {
|
|
3358
3358
|
const r = Date.now() / 1e3, s = (D) => D.expires < r, l = (D) => D.expires < r;
|
|
3359
3359
|
return await this.db.table(K.TOPICS).orderBy("expires").filter(s).delete().catch((D) => (console.error(
|
|
3360
3360
|
"%cstorage%c %cclean",
|
|
@@ -3370,7 +3370,7 @@ class jr {
|
|
|
3370
3370
|
D.message
|
|
3371
3371
|
), 0));
|
|
3372
3372
|
});
|
|
3373
|
-
|
|
3373
|
+
k(this, "hideMessage", async (r, s) => {
|
|
3374
3374
|
await this.db.table(K.TOPICS).where("message_id").equals(r).modify({ visible: s ? 1 : 0 }).catch((l) => (console.error(
|
|
3375
3375
|
"%cstorage%c %chide",
|
|
3376
3376
|
_.STORAGE,
|
|
@@ -3384,7 +3384,7 @@ class jr {
|
|
|
3384
3384
|
* @param query IQuery
|
|
3385
3385
|
* @returns number
|
|
3386
3386
|
*/
|
|
3387
|
-
|
|
3387
|
+
k(this, "setWidget", async (r) => await this.db.table(K.WIDGETS).put({
|
|
3388
3388
|
id: r.widget,
|
|
3389
3389
|
dashboard_id: r.dashboard,
|
|
3390
3390
|
type: r.type
|
|
@@ -3400,7 +3400,7 @@ class jr {
|
|
|
3400
3400
|
* @param query IQuery
|
|
3401
3401
|
* @returns null
|
|
3402
3402
|
*/
|
|
3403
|
-
|
|
3403
|
+
k(this, "subscribe", (r) => (r = rt(r), this.subscribers.filter(
|
|
3404
3404
|
(l) => l.widget === r.widget
|
|
3405
3405
|
).length > 0 || (r.type === K.MESSAGES && (r = _t(this.options, r)), console.debug(
|
|
3406
3406
|
"%cstorage%c %csubscribe",
|
|
@@ -3414,13 +3414,13 @@ class jr {
|
|
|
3414
3414
|
* Get current subscribers
|
|
3415
3415
|
* @returns IQuery[]
|
|
3416
3416
|
*/
|
|
3417
|
-
|
|
3417
|
+
k(this, "getSubscribers", async () => await new Promise((r) => r(this.subscribers)));
|
|
3418
3418
|
/**
|
|
3419
3419
|
* Retrieve Cloud Data
|
|
3420
3420
|
* @param query IQuery
|
|
3421
3421
|
* @returns IResponse
|
|
3422
3422
|
*/
|
|
3423
|
-
|
|
3423
|
+
k(this, "loadSlide", async (r) => {
|
|
3424
3424
|
const s = await this.db.table(K.SLIDE).where({ id: r.id }).last().catch(() => {
|
|
3425
3425
|
console.warn(
|
|
3426
3426
|
"%capi%c %cseries",
|
|
@@ -3437,7 +3437,7 @@ class jr {
|
|
|
3437
3437
|
* @param query IQuery
|
|
3438
3438
|
* @returns number
|
|
3439
3439
|
*/
|
|
3440
|
-
|
|
3440
|
+
k(this, "storeSlide", async (r) => r.type === K.SLIDE && r.data !== "" ? await this.db.table(K.SLIDE).put({
|
|
3441
3441
|
id: r.id,
|
|
3442
3442
|
title: r.data.title || "Not set",
|
|
3443
3443
|
json: r.data.json || {},
|
|
@@ -3465,40 +3465,40 @@ class jr {
|
|
|
3465
3465
|
}), this.db.open();
|
|
3466
3466
|
}
|
|
3467
3467
|
}
|
|
3468
|
-
function zn(
|
|
3468
|
+
function zn(d) {
|
|
3469
3469
|
return new Promise((r, s) => {
|
|
3470
|
-
|
|
3470
|
+
d.oncomplete = d.onsuccess = () => r(d.result), d.onabort = d.onerror = () => s(d.error);
|
|
3471
3471
|
});
|
|
3472
3472
|
}
|
|
3473
|
-
function Ci(
|
|
3474
|
-
const s = indexedDB.open(
|
|
3473
|
+
function Ci(d, r) {
|
|
3474
|
+
const s = indexedDB.open(d);
|
|
3475
3475
|
s.onupgradeneeded = () => s.result.createObjectStore(r);
|
|
3476
3476
|
const l = zn(s);
|
|
3477
|
-
return (
|
|
3477
|
+
return (x, D) => l.then((R) => D(R.transaction(r, x).objectStore(r)));
|
|
3478
3478
|
}
|
|
3479
3479
|
let $n;
|
|
3480
3480
|
function Kr() {
|
|
3481
3481
|
return $n || ($n = Ci("keyval-store", "keyval")), $n;
|
|
3482
3482
|
}
|
|
3483
|
-
function Zt(
|
|
3484
|
-
return r("readonly", (s) => zn(s.get(
|
|
3483
|
+
function Zt(d, r = Kr()) {
|
|
3484
|
+
return r("readonly", (s) => zn(s.get(d)));
|
|
3485
3485
|
}
|
|
3486
|
-
function wt(
|
|
3487
|
-
return s("readwrite", (l) => (l.put(r,
|
|
3486
|
+
function wt(d, r, s = Kr()) {
|
|
3487
|
+
return s("readwrite", (l) => (l.put(r, d), zn(l.transaction)));
|
|
3488
3488
|
}
|
|
3489
3489
|
class Nr {
|
|
3490
3490
|
constructor(r) {
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3491
|
+
k(this, "subscribers", []);
|
|
3492
|
+
k(this, "options");
|
|
3493
|
+
k(this, "getCloud", async (r) => {
|
|
3494
3494
|
const s = J(r);
|
|
3495
3495
|
return await Zt(s).then((l) => l).catch(() => (console.warn("%capi", _.API, K.CLOUD, r.slide, r.widget), { data: null, message: "Cloud Data error", success: !1 }));
|
|
3496
3496
|
});
|
|
3497
|
-
|
|
3497
|
+
k(this, "getSeries", async (r) => {
|
|
3498
3498
|
const s = J(r);
|
|
3499
3499
|
return await Zt(s).then((l) => l).catch(() => (console.warn("%capi", _.API, K.SERIES, r.slide, r.widget), { data: null, message: "Series Data error", success: !1 }));
|
|
3500
3500
|
});
|
|
3501
|
-
|
|
3501
|
+
k(this, "getMessages", async (r) => {
|
|
3502
3502
|
const s = J(r);
|
|
3503
3503
|
return await Zt(s).then((l) => l).catch(() => (console.warn("%capi", _.API, K.MESSAGES, r.slide, r.widget), { data: null, message: "Messages Data error", success: !1 }));
|
|
3504
3504
|
});
|
|
@@ -3508,11 +3508,11 @@ class Nr {
|
|
|
3508
3508
|
* @param data
|
|
3509
3509
|
* @returns number
|
|
3510
3510
|
*/
|
|
3511
|
-
|
|
3511
|
+
k(this, "setCloud", async (r, s) => {
|
|
3512
3512
|
if (!s.success)
|
|
3513
3513
|
return 400;
|
|
3514
3514
|
const l = J(r);
|
|
3515
|
-
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((
|
|
3515
|
+
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((x) => (console.error("%cstorage", _.STORAGE, K.CLOUD, r, x.message), 400));
|
|
3516
3516
|
});
|
|
3517
3517
|
/**
|
|
3518
3518
|
* Update Series
|
|
@@ -3520,11 +3520,11 @@ class Nr {
|
|
|
3520
3520
|
* @param data
|
|
3521
3521
|
* @returns bumber
|
|
3522
3522
|
*/
|
|
3523
|
-
|
|
3523
|
+
k(this, "setSeries", async (r, s) => {
|
|
3524
3524
|
if (!s.success)
|
|
3525
3525
|
return 400;
|
|
3526
3526
|
const l = J(r);
|
|
3527
|
-
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((
|
|
3527
|
+
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((x) => (console.error("%cstorage", _.STORAGE, K.SERIES, r, x.message), 400));
|
|
3528
3528
|
});
|
|
3529
3529
|
/**
|
|
3530
3530
|
* Update Messages
|
|
@@ -3532,14 +3532,14 @@ class Nr {
|
|
|
3532
3532
|
* @param data
|
|
3533
3533
|
* @returns number
|
|
3534
3534
|
*/
|
|
3535
|
-
|
|
3535
|
+
k(this, "setMessages", async (r, s) => {
|
|
3536
3536
|
if (!s.success)
|
|
3537
3537
|
return 400;
|
|
3538
3538
|
const l = J(r);
|
|
3539
|
-
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((
|
|
3539
|
+
return delete s.success, delete s.message, await wt(l, s).then(() => 201).catch((x) => (console.error("%cstorage", _.STORAGE, K.MESSAGES, r, x.message), 400));
|
|
3540
3540
|
});
|
|
3541
|
-
|
|
3542
|
-
|
|
3541
|
+
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0))));
|
|
3542
|
+
k(this, "hideMessage", async (r, s) => {
|
|
3543
3543
|
console.debug(
|
|
3544
3544
|
`hideMessage ${r} ${s} not implemented for ${this.options.storage}`
|
|
3545
3545
|
);
|
|
@@ -3549,20 +3549,20 @@ class Nr {
|
|
|
3549
3549
|
* @param query IQuery
|
|
3550
3550
|
* @returns number
|
|
3551
3551
|
*/
|
|
3552
|
-
|
|
3552
|
+
k(this, "setWidget", async (r) => {
|
|
3553
3553
|
const s = J(r), l = {
|
|
3554
3554
|
id: r.widget,
|
|
3555
3555
|
dashboard_id: r.dashboard,
|
|
3556
3556
|
type: r.type
|
|
3557
3557
|
};
|
|
3558
|
-
return await wt(s, l).then(() => 201).catch((
|
|
3558
|
+
return await wt(s, l).then(() => 201).catch((x) => (console.error("%cstorage", _.STORAGE, K.WIDGET, r, x.message), 400));
|
|
3559
3559
|
});
|
|
3560
3560
|
/**
|
|
3561
3561
|
* Add component subscriber
|
|
3562
3562
|
* @param query IQuery
|
|
3563
3563
|
* @returns null
|
|
3564
3564
|
*/
|
|
3565
|
-
|
|
3565
|
+
k(this, "subscribe", (r) => (r = rt(r), r.type === K.MESSAGES && (r = _t(this.options, r)), this.subscribers.filter(
|
|
3566
3566
|
(l) => l.widget === r.widget
|
|
3567
3567
|
).length > 0 || (console.debug(
|
|
3568
3568
|
"%cstorage%c %csubscribe",
|
|
@@ -3576,8 +3576,8 @@ class Nr {
|
|
|
3576
3576
|
* Get current subscribers
|
|
3577
3577
|
* @returns IQuery[]
|
|
3578
3578
|
*/
|
|
3579
|
-
|
|
3580
|
-
|
|
3579
|
+
k(this, "getSubscribers", async () => await new Promise((r) => r(this.subscribers)));
|
|
3580
|
+
k(this, "loadSlide", async (r) => {
|
|
3581
3581
|
const s = J(r);
|
|
3582
3582
|
return await Zt(s).then((l) => l).catch(() => (console.warn("%capi", _.API, K.SLIDE, r.slide), { data: null, message: "Slide Load error", success: !1 }));
|
|
3583
3583
|
});
|
|
@@ -3586,7 +3586,7 @@ class Nr {
|
|
|
3586
3586
|
* @param query IQuery
|
|
3587
3587
|
* @returns number
|
|
3588
3588
|
*/
|
|
3589
|
-
|
|
3589
|
+
k(this, "storeSlide", async (r) => {
|
|
3590
3590
|
const s = J(r), l = {
|
|
3591
3591
|
id: r.id,
|
|
3592
3592
|
title: r.data.title || "Not set",
|
|
@@ -3594,16 +3594,16 @@ class Nr {
|
|
|
3594
3594
|
html: r.data.html || "",
|
|
3595
3595
|
css: r.data.css || ""
|
|
3596
3596
|
};
|
|
3597
|
-
return await wt(s, l).then(() => 201).catch((
|
|
3597
|
+
return await wt(s, l).then(() => 201).catch((x) => (console.error("%cstorage", _.STORAGE, K.SLIDE, r, x.message), 400));
|
|
3598
3598
|
});
|
|
3599
3599
|
this.options = r;
|
|
3600
3600
|
}
|
|
3601
3601
|
}
|
|
3602
3602
|
class Br {
|
|
3603
3603
|
constructor(r) {
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3604
|
+
k(this, "subscribers", []);
|
|
3605
|
+
k(this, "options");
|
|
3606
|
+
k(this, "getCloud", async (r) => {
|
|
3607
3607
|
const s = J(r);
|
|
3608
3608
|
try {
|
|
3609
3609
|
return localStorage.getObject(s);
|
|
@@ -3611,7 +3611,7 @@ class Br {
|
|
|
3611
3611
|
return console.warn("%capi", _.API, K.CLOUD, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3612
3612
|
}
|
|
3613
3613
|
});
|
|
3614
|
-
|
|
3614
|
+
k(this, "getSeries", async (r) => {
|
|
3615
3615
|
const s = J(r);
|
|
3616
3616
|
try {
|
|
3617
3617
|
return localStorage.getObject(s);
|
|
@@ -3619,7 +3619,7 @@ class Br {
|
|
|
3619
3619
|
return console.warn("%capi", _.API, K.SERIES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3620
3620
|
}
|
|
3621
3621
|
});
|
|
3622
|
-
|
|
3622
|
+
k(this, "getMessages", async (r) => {
|
|
3623
3623
|
const s = J(r);
|
|
3624
3624
|
try {
|
|
3625
3625
|
return localStorage.getObject(s);
|
|
@@ -3633,12 +3633,12 @@ class Br {
|
|
|
3633
3633
|
* @param data
|
|
3634
3634
|
* @returns number
|
|
3635
3635
|
*/
|
|
3636
|
-
|
|
3636
|
+
k(this, "setCloud", async (r, s) => {
|
|
3637
3637
|
const l = J(r);
|
|
3638
3638
|
try {
|
|
3639
3639
|
return localStorage.setObject(l, s), 201;
|
|
3640
|
-
} catch (
|
|
3641
|
-
return console.error("%cstorage", _.STORAGE, K.CLOUD, r,
|
|
3640
|
+
} catch (x) {
|
|
3641
|
+
return console.error("%cstorage", _.STORAGE, K.CLOUD, r, x), 400;
|
|
3642
3642
|
}
|
|
3643
3643
|
});
|
|
3644
3644
|
/**
|
|
@@ -3647,12 +3647,12 @@ class Br {
|
|
|
3647
3647
|
* @param data
|
|
3648
3648
|
* @returns number
|
|
3649
3649
|
*/
|
|
3650
|
-
|
|
3650
|
+
k(this, "setSeries", async (r, s) => {
|
|
3651
3651
|
const l = J(r);
|
|
3652
3652
|
try {
|
|
3653
3653
|
return localStorage.setObject(l, s), 201;
|
|
3654
|
-
} catch (
|
|
3655
|
-
return console.error("%cstorage", _.STORAGE, K.SERIES, r,
|
|
3654
|
+
} catch (x) {
|
|
3655
|
+
return console.error("%cstorage", _.STORAGE, K.SERIES, r, x), 400;
|
|
3656
3656
|
}
|
|
3657
3657
|
});
|
|
3658
3658
|
/**
|
|
@@ -3661,19 +3661,19 @@ class Br {
|
|
|
3661
3661
|
* @param data
|
|
3662
3662
|
* @returns number
|
|
3663
3663
|
*/
|
|
3664
|
-
|
|
3664
|
+
k(this, "setMessages", async (r, s) => {
|
|
3665
3665
|
const l = J(r);
|
|
3666
3666
|
try {
|
|
3667
3667
|
return localStorage.setObject(l, s), 200;
|
|
3668
|
-
} catch (
|
|
3669
|
-
return console.error("%cstorage", _.STORAGE, K.MESSAGES, r,
|
|
3668
|
+
} catch (x) {
|
|
3669
|
+
return console.error("%cstorage", _.STORAGE, K.MESSAGES, r, x), 400;
|
|
3670
3670
|
}
|
|
3671
3671
|
});
|
|
3672
|
-
|
|
3673
|
-
|
|
3672
|
+
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0))));
|
|
3673
|
+
k(this, "hideMessage", async (r, s) => {
|
|
3674
3674
|
console.debug(`hideMessage ${r} ${s} not implemented for ${this.options.storage}`);
|
|
3675
3675
|
});
|
|
3676
|
-
|
|
3676
|
+
k(this, "setWidget", async (r) => {
|
|
3677
3677
|
const s = `widget.${r.widget}`;
|
|
3678
3678
|
try {
|
|
3679
3679
|
return localStorage.setObject(s, r), 201;
|
|
@@ -3686,7 +3686,7 @@ class Br {
|
|
|
3686
3686
|
* @param query IQuery
|
|
3687
3687
|
* @returns null
|
|
3688
3688
|
*/
|
|
3689
|
-
|
|
3689
|
+
k(this, "subscribe", (r) => (r = rt(r), r.type === K.MESSAGES && (r = _t(this.options, r)), this.subscribers.filter(
|
|
3690
3690
|
(l) => l.widget === r.widget
|
|
3691
3691
|
).length || (console.debug(
|
|
3692
3692
|
"%cstorage%c %csubscribe",
|
|
@@ -3700,15 +3700,15 @@ class Br {
|
|
|
3700
3700
|
* Get current subscribers
|
|
3701
3701
|
* @returns IQuery[]
|
|
3702
3702
|
*/
|
|
3703
|
-
|
|
3704
|
-
|
|
3703
|
+
k(this, "getSubscribers", async () => await new Promise((r) => r(this.subscribers)));
|
|
3704
|
+
k(this, "loadSlide", async (r) => {
|
|
3705
3705
|
try {
|
|
3706
3706
|
return localStorage.getObject(`${r.type}.${r.id}`);
|
|
3707
3707
|
} catch (s) {
|
|
3708
3708
|
return console.warn("%capi", _.API, K.SLIDE, r.id, s), { data: null, message: "Slide Load error", success: !1 };
|
|
3709
3709
|
}
|
|
3710
3710
|
});
|
|
3711
|
-
|
|
3711
|
+
k(this, "storeSlide", async (r) => {
|
|
3712
3712
|
try {
|
|
3713
3713
|
return localStorage.setObject(`${r.type}.${r.id}`, {
|
|
3714
3714
|
id: r.id,
|
|
@@ -3731,9 +3731,9 @@ class Br {
|
|
|
3731
3731
|
}
|
|
3732
3732
|
class Lr {
|
|
3733
3733
|
constructor(r) {
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3734
|
+
k(this, "subscribers", []);
|
|
3735
|
+
k(this, "options");
|
|
3736
|
+
k(this, "getCloud", async (r) => {
|
|
3737
3737
|
const s = J(r);
|
|
3738
3738
|
try {
|
|
3739
3739
|
return sessionStorage.getObject(s);
|
|
@@ -3741,7 +3741,7 @@ class Lr {
|
|
|
3741
3741
|
return console.warn("%capi", _.API, K.CLOUD, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3742
3742
|
}
|
|
3743
3743
|
});
|
|
3744
|
-
|
|
3744
|
+
k(this, "getSeries", async (r) => {
|
|
3745
3745
|
const s = J(r);
|
|
3746
3746
|
try {
|
|
3747
3747
|
return sessionStorage.getObject(s);
|
|
@@ -3749,7 +3749,7 @@ class Lr {
|
|
|
3749
3749
|
return console.warn("%capi", _.API, K.SERIES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3750
3750
|
}
|
|
3751
3751
|
});
|
|
3752
|
-
|
|
3752
|
+
k(this, "getMessages", async (r) => {
|
|
3753
3753
|
const s = J(r);
|
|
3754
3754
|
try {
|
|
3755
3755
|
return sessionStorage.getObject(s);
|
|
@@ -3763,12 +3763,12 @@ class Lr {
|
|
|
3763
3763
|
* @param data
|
|
3764
3764
|
* @returns number
|
|
3765
3765
|
*/
|
|
3766
|
-
|
|
3766
|
+
k(this, "setCloud", async (r, s) => {
|
|
3767
3767
|
const l = J(r);
|
|
3768
3768
|
try {
|
|
3769
3769
|
return sessionStorage.setObject(l, s), 201;
|
|
3770
|
-
} catch (
|
|
3771
|
-
return console.error("%cstorage", _.STORAGE, K.CLOUD, r,
|
|
3770
|
+
} catch (x) {
|
|
3771
|
+
return console.error("%cstorage", _.STORAGE, K.CLOUD, r, x), 400;
|
|
3772
3772
|
}
|
|
3773
3773
|
});
|
|
3774
3774
|
/**
|
|
@@ -3777,12 +3777,12 @@ class Lr {
|
|
|
3777
3777
|
* @param data
|
|
3778
3778
|
* @returns number
|
|
3779
3779
|
*/
|
|
3780
|
-
|
|
3780
|
+
k(this, "setSeries", async (r, s) => {
|
|
3781
3781
|
const l = J(r);
|
|
3782
3782
|
try {
|
|
3783
3783
|
return sessionStorage.setObject(l, s), 201;
|
|
3784
|
-
} catch (
|
|
3785
|
-
return console.error("%cstorage", _.STORAGE, K.SERIES, r,
|
|
3784
|
+
} catch (x) {
|
|
3785
|
+
return console.error("%cstorage", _.STORAGE, K.SERIES, r, x), 400;
|
|
3786
3786
|
}
|
|
3787
3787
|
});
|
|
3788
3788
|
/**
|
|
@@ -3791,19 +3791,19 @@ class Lr {
|
|
|
3791
3791
|
* @param data
|
|
3792
3792
|
* @returns number
|
|
3793
3793
|
*/
|
|
3794
|
-
|
|
3794
|
+
k(this, "setMessages", async (r, s) => {
|
|
3795
3795
|
const l = J(r);
|
|
3796
3796
|
try {
|
|
3797
3797
|
return sessionStorage.setObject(l, s), 200;
|
|
3798
|
-
} catch (
|
|
3799
|
-
return console.error("%cstorage", _.STORAGE, K.MESSAGES, r,
|
|
3798
|
+
} catch (x) {
|
|
3799
|
+
return console.error("%cstorage", _.STORAGE, K.MESSAGES, r, x), 400;
|
|
3800
3800
|
}
|
|
3801
3801
|
});
|
|
3802
|
-
|
|
3803
|
-
|
|
3802
|
+
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0))));
|
|
3803
|
+
k(this, "hideMessage", async (r, s) => {
|
|
3804
3804
|
console.debug(`hideMessage ${r} ${s} not implemented for ${this.options.storage}`);
|
|
3805
3805
|
});
|
|
3806
|
-
|
|
3806
|
+
k(this, "setWidget", async (r) => {
|
|
3807
3807
|
const s = `widget.${r.widget}`;
|
|
3808
3808
|
try {
|
|
3809
3809
|
return sessionStorage.setObject(s, r), 201;
|
|
@@ -3816,7 +3816,7 @@ class Lr {
|
|
|
3816
3816
|
* @param query IQuery
|
|
3817
3817
|
* @returns null
|
|
3818
3818
|
*/
|
|
3819
|
-
|
|
3819
|
+
k(this, "subscribe", (r) => (r = rt(r), r.type === K.MESSAGES && (r = _t(this.options, r)), this.subscribers.filter(
|
|
3820
3820
|
(l) => l.widget === r.widget
|
|
3821
3821
|
).length || (console.debug(
|
|
3822
3822
|
"%cstorage%c %csubscribe",
|
|
@@ -3830,8 +3830,8 @@ class Lr {
|
|
|
3830
3830
|
* Get current subscribers
|
|
3831
3831
|
* @returns IQuery[]
|
|
3832
3832
|
*/
|
|
3833
|
-
|
|
3834
|
-
|
|
3833
|
+
k(this, "getSubscribers", async () => await new Promise((r) => r(this.subscribers)));
|
|
3834
|
+
k(this, "loadSlide", async (r) => {
|
|
3835
3835
|
try {
|
|
3836
3836
|
return sessionStorage.getObject(`${r.type}.${r.id}`);
|
|
3837
3837
|
} catch (s) {
|
|
@@ -3843,7 +3843,7 @@ class Lr {
|
|
|
3843
3843
|
* @param query IQuery
|
|
3844
3844
|
* @returns number
|
|
3845
3845
|
*/
|
|
3846
|
-
|
|
3846
|
+
k(this, "storeSlide", async (r) => {
|
|
3847
3847
|
try {
|
|
3848
3848
|
return sessionStorage.setObject(`${r.type}.${r.id}`, {
|
|
3849
3849
|
id: r.id,
|
|
@@ -3866,9 +3866,9 @@ class Lr {
|
|
|
3866
3866
|
}
|
|
3867
3867
|
class Gr {
|
|
3868
3868
|
constructor(r) {
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3869
|
+
k(this, "subscribers", []);
|
|
3870
|
+
k(this, "options");
|
|
3871
|
+
k(this, "getCloud", async (r) => {
|
|
3872
3872
|
const s = J(r);
|
|
3873
3873
|
try {
|
|
3874
3874
|
return window.BuzzCasting.WidgetData[s];
|
|
@@ -3876,7 +3876,7 @@ class Gr {
|
|
|
3876
3876
|
return console.warn("%capi", _.API, K.CLOUD, r.slide, r.widget, l), { data: null, message: "Cloud Data error", success: !1 };
|
|
3877
3877
|
}
|
|
3878
3878
|
});
|
|
3879
|
-
|
|
3879
|
+
k(this, "getSeries", async (r) => {
|
|
3880
3880
|
const s = J(r);
|
|
3881
3881
|
try {
|
|
3882
3882
|
return window.BuzzCasting.WidgetData[s];
|
|
@@ -3884,7 +3884,7 @@ class Gr {
|
|
|
3884
3884
|
return console.warn("%capi", _.API, K.SERIES, r.slide, r.widget, l), { data: null, message: "Series Data error", success: !1 };
|
|
3885
3885
|
}
|
|
3886
3886
|
});
|
|
3887
|
-
|
|
3887
|
+
k(this, "getMessages", async (r) => {
|
|
3888
3888
|
const s = J(r);
|
|
3889
3889
|
try {
|
|
3890
3890
|
return window.BuzzCasting.WidgetData[s];
|
|
@@ -3898,12 +3898,12 @@ class Gr {
|
|
|
3898
3898
|
* @param data
|
|
3899
3899
|
* @returns number
|
|
3900
3900
|
*/
|
|
3901
|
-
|
|
3901
|
+
k(this, "setCloud", async (r, s) => {
|
|
3902
3902
|
const l = J(r);
|
|
3903
3903
|
try {
|
|
3904
3904
|
return window.BuzzCasting.WidgetData[l] = s, 201;
|
|
3905
|
-
} catch (
|
|
3906
|
-
return console.error("%cstorage", _.STORAGE, "set", r,
|
|
3905
|
+
} catch (x) {
|
|
3906
|
+
return console.error("%cstorage", _.STORAGE, "set", r, x), 400;
|
|
3907
3907
|
}
|
|
3908
3908
|
});
|
|
3909
3909
|
/**
|
|
@@ -3912,12 +3912,12 @@ class Gr {
|
|
|
3912
3912
|
* @param data
|
|
3913
3913
|
* @returns number
|
|
3914
3914
|
*/
|
|
3915
|
-
|
|
3915
|
+
k(this, "setSeries", async (r, s) => {
|
|
3916
3916
|
const l = J(r);
|
|
3917
3917
|
try {
|
|
3918
3918
|
return window.BuzzCasting.WidgetData[l] = s, 201;
|
|
3919
|
-
} catch (
|
|
3920
|
-
return console.error("%cstorage", _.STORAGE, "set", r,
|
|
3919
|
+
} catch (x) {
|
|
3920
|
+
return console.error("%cstorage", _.STORAGE, "set", r, x), 400;
|
|
3921
3921
|
}
|
|
3922
3922
|
});
|
|
3923
3923
|
/**
|
|
@@ -3926,19 +3926,19 @@ class Gr {
|
|
|
3926
3926
|
* @param data
|
|
3927
3927
|
* @returns number
|
|
3928
3928
|
*/
|
|
3929
|
-
|
|
3929
|
+
k(this, "setMessages", async (r, s) => {
|
|
3930
3930
|
const l = J(r);
|
|
3931
3931
|
try {
|
|
3932
3932
|
return window.BuzzCasting.WidgetData[l] = s, 201;
|
|
3933
|
-
} catch (
|
|
3934
|
-
return console.error("%cstorage", _.STORAGE, "set", r,
|
|
3933
|
+
} catch (x) {
|
|
3934
|
+
return console.error("%cstorage", _.STORAGE, "set", r, x), 400;
|
|
3935
3935
|
}
|
|
3936
3936
|
});
|
|
3937
|
-
|
|
3938
|
-
|
|
3937
|
+
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0))));
|
|
3938
|
+
k(this, "hideMessage", async (r, s) => {
|
|
3939
3939
|
console.debug(`hideMessage ${r} ${s} not implemented for ${this.options.storage}`);
|
|
3940
3940
|
});
|
|
3941
|
-
|
|
3941
|
+
k(this, "setWidget", async (r) => {
|
|
3942
3942
|
const s = `widget.${r.widget}`;
|
|
3943
3943
|
try {
|
|
3944
3944
|
return window.BuzzCasting.WidgetData[s] = r, 201;
|
|
@@ -3951,7 +3951,7 @@ class Gr {
|
|
|
3951
3951
|
* @param query IQuery
|
|
3952
3952
|
* @returns null
|
|
3953
3953
|
*/
|
|
3954
|
-
|
|
3954
|
+
k(this, "subscribe", (r) => (r = rt(r), r.type === K.MESSAGES && (r = _t(this.options, r)), this.subscribers.filter(
|
|
3955
3955
|
(l) => l.widget === r.widget
|
|
3956
3956
|
).length || (console.debug(
|
|
3957
3957
|
"%cstorage%c %csubscribe",
|
|
@@ -3965,15 +3965,15 @@ class Gr {
|
|
|
3965
3965
|
* Get current subscribers
|
|
3966
3966
|
* @returns IQuery[]
|
|
3967
3967
|
*/
|
|
3968
|
-
|
|
3969
|
-
|
|
3968
|
+
k(this, "getSubscribers", async () => await new Promise((r) => r(this.subscribers)));
|
|
3969
|
+
k(this, "loadSlide", async (r) => {
|
|
3970
3970
|
try {
|
|
3971
3971
|
return window.BuzzCasting.SlideData[r.id];
|
|
3972
3972
|
} catch (s) {
|
|
3973
3973
|
return console.warn("%capi", _.API, K.SLIDE, r.id, s), { data: null, message: "Slide Load error", success: !1 };
|
|
3974
3974
|
}
|
|
3975
3975
|
});
|
|
3976
|
-
|
|
3976
|
+
k(this, "storeSlide", async (r) => {
|
|
3977
3977
|
try {
|
|
3978
3978
|
return window.BuzzCasting.SlideData[r.id] = {
|
|
3979
3979
|
id: r.slide,
|
|
@@ -3989,44 +3989,44 @@ class Gr {
|
|
|
3989
3989
|
this.options = r, window.BuzzCasting.WidgetData = /* @__PURE__ */ new Set();
|
|
3990
3990
|
}
|
|
3991
3991
|
}
|
|
3992
|
-
function
|
|
3993
|
-
const r =
|
|
3992
|
+
function Gi(d) {
|
|
3993
|
+
const r = d.toUpperCase().split(/[\s_-]+/);
|
|
3994
3994
|
return r.length > 0 ? (r.forEach((s, l) => {
|
|
3995
3995
|
r[l] = `${s.charAt(0)}.`;
|
|
3996
3996
|
}), r.join(" ")) : "";
|
|
3997
3997
|
}
|
|
3998
|
-
function
|
|
3998
|
+
function $i(d) {
|
|
3999
3999
|
let r = "", s = "", l = {
|
|
4000
4000
|
backgroundImage: ""
|
|
4001
4001
|
};
|
|
4002
|
-
return typeof
|
|
4003
|
-
(
|
|
4004
|
-
backgroundImage: `url(${
|
|
4005
|
-
}, s =
|
|
4002
|
+
return typeof d.media < "u" && d.media.forEach((x) => {
|
|
4003
|
+
(x.type === "photo" || x.type === "image") && (l = {
|
|
4004
|
+
backgroundImage: `url(${x.url})`
|
|
4005
|
+
}, s = x.url), x.type === "video" && (r = x.url);
|
|
4006
4006
|
}), {
|
|
4007
4007
|
image: s,
|
|
4008
4008
|
background: l || null,
|
|
4009
4009
|
video: r
|
|
4010
4010
|
};
|
|
4011
4011
|
}
|
|
4012
|
-
function Ri(
|
|
4012
|
+
function Ri(d) {
|
|
4013
4013
|
const r = {};
|
|
4014
|
-
for (let s = 0; s <
|
|
4015
|
-
const l =
|
|
4014
|
+
for (let s = 0; s < d.length; s++) {
|
|
4015
|
+
const l = d.item(s);
|
|
4016
4016
|
l != null && l.name && (r[l.name] = l.value);
|
|
4017
4017
|
}
|
|
4018
4018
|
return r;
|
|
4019
4019
|
}
|
|
4020
|
-
function
|
|
4020
|
+
function Fi(d) {
|
|
4021
4021
|
const r = {};
|
|
4022
|
-
for (let s = 0; s <
|
|
4023
|
-
const l =
|
|
4022
|
+
for (let s = 0; s < d.length; s++) {
|
|
4023
|
+
const l = d[s];
|
|
4024
4024
|
l.name !== "class" && !l.name.includes("data") && (r[l.name] = l.value);
|
|
4025
4025
|
}
|
|
4026
4026
|
return r;
|
|
4027
4027
|
}
|
|
4028
|
-
function
|
|
4029
|
-
switch (
|
|
4028
|
+
function Ui(d, r) {
|
|
4029
|
+
switch (d) {
|
|
4030
4030
|
case "bl":
|
|
4031
4031
|
return `text-blue fa-solid fa-rss fa-${r}`;
|
|
4032
4032
|
case "co":
|
|
@@ -4067,50 +4067,63 @@ function Fi(f, r) {
|
|
|
4067
4067
|
return "";
|
|
4068
4068
|
}
|
|
4069
4069
|
}
|
|
4070
|
-
function
|
|
4071
|
-
return
|
|
4070
|
+
function Wi(d) {
|
|
4071
|
+
return d.replace(/^\w|[A-Z]|\b\w/g, (r, s) => s === 0 ? r.toLowerCase() : r.toUpperCase()).replace(/\s+/g, "");
|
|
4072
4072
|
}
|
|
4073
|
-
function
|
|
4074
|
-
return
|
|
4073
|
+
function zi(d) {
|
|
4074
|
+
return d.toLowerCase().split("-").reduce((r, s) => r + (s.charAt(0).toUpperCase() + s.slice(1)));
|
|
4075
4075
|
}
|
|
4076
|
-
|
|
4076
|
+
const Hi = (d) => d.charAt(0).toUpperCase() + d.slice(1);
|
|
4077
|
+
function Ti(d) {
|
|
4077
4078
|
const r = document.createRange();
|
|
4078
|
-
r.selectNodeContents(
|
|
4079
|
+
r.selectNodeContents(d), r.deleteContents();
|
|
4080
|
+
}
|
|
4081
|
+
function Mi(d) {
|
|
4082
|
+
d.reduce(
|
|
4083
|
+
(r, s) => Object.keys(s).reduce(
|
|
4084
|
+
(l, x) => ({
|
|
4085
|
+
...l,
|
|
4086
|
+
[x]: x in r && typeof r[x] == "object" && r[x] !== null && typeof s[x] == "object" && s[x] !== null ? Mi([r[x], s[x]]) : s[x]
|
|
4087
|
+
}),
|
|
4088
|
+
r
|
|
4089
|
+
),
|
|
4090
|
+
{}
|
|
4091
|
+
);
|
|
4079
4092
|
}
|
|
4080
|
-
function
|
|
4081
|
-
return `${(
|
|
4093
|
+
function Yi(d, r = "font-bold") {
|
|
4094
|
+
return `${(d == null ? void 0 : d.title.length) > 0 ? `<div class="${r}">${d.title}</div>` : ""}${d != null && d.content ? d.content.replace(/\n\n/g, `
|
|
4082
4095
|
`).replace(/\n/g, "<br/>") : ""}`;
|
|
4083
4096
|
}
|
|
4084
|
-
function
|
|
4085
|
-
for (;
|
|
4086
|
-
|
|
4087
|
-
return
|
|
4097
|
+
function ji(d, r) {
|
|
4098
|
+
for (; d.length < r; )
|
|
4099
|
+
d = `0${d}`;
|
|
4100
|
+
return d;
|
|
4088
4101
|
}
|
|
4089
|
-
function Oe(
|
|
4090
|
-
let s, l,
|
|
4102
|
+
function Oe(d, r) {
|
|
4103
|
+
let s, l, x;
|
|
4091
4104
|
if (r.length === 0)
|
|
4092
|
-
return
|
|
4093
|
-
for (s = 0,
|
|
4094
|
-
l = r.charCodeAt(s),
|
|
4095
|
-
return
|
|
4105
|
+
return d;
|
|
4106
|
+
for (s = 0, x = r.length; s < x; s++)
|
|
4107
|
+
l = r.charCodeAt(s), d = (d << 5) - d + l, d |= 0;
|
|
4108
|
+
return d < 0 ? d * -2 : d;
|
|
4096
4109
|
}
|
|
4097
|
-
function
|
|
4098
|
-
return Object.keys(r).sort().reduce(l,
|
|
4099
|
-
function l(
|
|
4100
|
-
return $r(
|
|
4110
|
+
function Ki(d, r, s) {
|
|
4111
|
+
return Object.keys(r).sort().reduce(l, d);
|
|
4112
|
+
function l(x, D) {
|
|
4113
|
+
return $r(x, r[D], D, s);
|
|
4101
4114
|
}
|
|
4102
4115
|
}
|
|
4103
|
-
function $r(
|
|
4104
|
-
const
|
|
4116
|
+
function $r(d, r, s, l) {
|
|
4117
|
+
const x = Oe(Oe(Oe(d, s), Ni(r)), typeof r);
|
|
4105
4118
|
if (r === null)
|
|
4106
|
-
return Oe(
|
|
4119
|
+
return Oe(x, "null");
|
|
4107
4120
|
if (r === void 0)
|
|
4108
|
-
return Oe(
|
|
4121
|
+
return Oe(x, "undefined");
|
|
4109
4122
|
if (typeof r == "object" || typeof r == "function") {
|
|
4110
4123
|
if (l.includes(r))
|
|
4111
|
-
return Oe(
|
|
4124
|
+
return Oe(x, `[Circular]${s}`);
|
|
4112
4125
|
l.push(r);
|
|
4113
|
-
const D =
|
|
4126
|
+
const D = Ki(x, r, l);
|
|
4114
4127
|
if (!("valueOf" in r) || typeof r.valueOf != "function")
|
|
4115
4128
|
return D;
|
|
4116
4129
|
try {
|
|
@@ -4119,17 +4132,17 @@ function $r(f, r, s, l) {
|
|
|
4119
4132
|
return Oe(D, `[valueOf exception]${R.stack || R.message}`);
|
|
4120
4133
|
}
|
|
4121
4134
|
}
|
|
4122
|
-
return Oe(
|
|
4135
|
+
return Oe(x, r.toString());
|
|
4123
4136
|
}
|
|
4124
|
-
function
|
|
4125
|
-
return Object.prototype.toString.call(
|
|
4137
|
+
function Ni(d) {
|
|
4138
|
+
return Object.prototype.toString.call(d);
|
|
4126
4139
|
}
|
|
4127
|
-
function Fn(
|
|
4128
|
-
return
|
|
4140
|
+
function Fn(d) {
|
|
4141
|
+
return ji($r(0, d, "", []).toString(16), 8);
|
|
4129
4142
|
}
|
|
4130
|
-
function
|
|
4131
|
-
if (
|
|
4132
|
-
return
|
|
4143
|
+
function Qi(d, r) {
|
|
4144
|
+
if (d = d.toString().replace(/[^0-9.]/g, ""), d < 1e3)
|
|
4145
|
+
return d;
|
|
4133
4146
|
const s = [
|
|
4134
4147
|
{ v: 1e3, s: "K" },
|
|
4135
4148
|
{ v: 1e6, s: "M" },
|
|
@@ -4139,11 +4152,11 @@ function Hi(f, r) {
|
|
|
4139
4152
|
{ v: 1e18, s: "E" }
|
|
4140
4153
|
];
|
|
4141
4154
|
let l;
|
|
4142
|
-
for (l = s.length - 1; l > 0 && !(
|
|
4155
|
+
for (l = s.length - 1; l > 0 && !(d >= s[l].v); l--)
|
|
4143
4156
|
;
|
|
4144
|
-
return (
|
|
4157
|
+
return (d / s[l].v).toFixed(r).replace(/\.0+$|(\.\d*[1-9])0+$/, "$1") + s[l].s;
|
|
4145
4158
|
}
|
|
4146
|
-
function
|
|
4159
|
+
function Xi(d, r) {
|
|
4147
4160
|
const s = [
|
|
4148
4161
|
{ value: 1, symbol: "" },
|
|
4149
4162
|
{ value: 1e3, symbol: "K" },
|
|
@@ -4153,13 +4166,13 @@ function Yi(f, r) {
|
|
|
4153
4166
|
{ value: 1e15, symbol: "P" },
|
|
4154
4167
|
{ value: 1e18, symbol: "E" }
|
|
4155
4168
|
], l = /\.0+$|(\.\d*[1-9])0+$/;
|
|
4156
|
-
let
|
|
4157
|
-
for (
|
|
4169
|
+
let x;
|
|
4170
|
+
for (x = s.length - 1; x > 0 && !(d >= s[x].value); x--)
|
|
4158
4171
|
;
|
|
4159
|
-
return (
|
|
4172
|
+
return (d / s[x].value).toFixed(r).replace(l, "$1") + s[x].symbol;
|
|
4160
4173
|
}
|
|
4161
|
-
function
|
|
4162
|
-
switch (
|
|
4174
|
+
function Ji(d) {
|
|
4175
|
+
switch (d.language) {
|
|
4163
4176
|
case "ar":
|
|
4164
4177
|
return {
|
|
4165
4178
|
direction: "rtl",
|
|
@@ -4169,41 +4182,66 @@ function Qi(f) {
|
|
|
4169
4182
|
return {};
|
|
4170
4183
|
}
|
|
4171
4184
|
}
|
|
4172
|
-
function
|
|
4185
|
+
function Vi(d) {
|
|
4173
4186
|
const r = window.BuzzCasting.getOptions().suspended ?? !1;
|
|
4174
|
-
return
|
|
4175
|
-
var l,
|
|
4176
|
-
if (r ? s.content = "License suspended, please contact your Sales Representative to restore service" : s.content = ((l = s.content) == null ? void 0 : l.replace(/(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)((\?.*)?)/g, "")) || "", s.sender !== null ? ((((
|
|
4187
|
+
return d.forEach((s) => {
|
|
4188
|
+
var l, x, D, R, B;
|
|
4189
|
+
if (r ? s.content = "License suspended, please contact your Sales Representative to restore service" : s.content = ((l = s.content) == null ? void 0 : l.replace(/(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)((\?.*)?)/g, "")) || "", s.sender !== null ? ((((x = s.sender) == null ? void 0 : x.title) === "Unknown author" || ((D = s.sender) == null ? void 0 : D.title) === null) && (s.sender.title = ""), ((R = s.sender) == null ? void 0 : R.name) !== "" && s.sender.title === "" && (s.sender.title = s.sender.name), ((B = s.sender) == null ? void 0 : B.name) !== "" && s.channel === "tw" && (s.sender.name = `@${s.sender.name}`)) : s.sender = { title: "", name: "", id: "", avatar: "default", bio: "", location: "", following: 0, verified: 0, listed: 0, followers: 0, favourites: 0, messages: 0, influence: 0 }, s.sender.title === "" && s.link !== "") {
|
|
4177
4190
|
const Q = new URL(s.link);
|
|
4178
4191
|
s.sender.title = Q.hostname.replace("www.", "");
|
|
4179
4192
|
}
|
|
4180
|
-
}),
|
|
4193
|
+
}), d;
|
|
4194
|
+
}
|
|
4195
|
+
function Zi(d, r, s, l) {
|
|
4196
|
+
d.stopPropagation(), r.showModal({
|
|
4197
|
+
showComponent: "card-modal",
|
|
4198
|
+
props: { data: s, options: l }
|
|
4199
|
+
});
|
|
4181
4200
|
}
|
|
4182
|
-
function
|
|
4183
|
-
const r = [...
|
|
4201
|
+
function qi(d) {
|
|
4202
|
+
const r = [...d];
|
|
4184
4203
|
for (let s = r.length - 1; s > 0; s--) {
|
|
4185
4204
|
const l = Math.floor(Math.random() * (s + 1));
|
|
4186
4205
|
[r[s], r[l]] = [r[l], r[s]];
|
|
4187
4206
|
}
|
|
4188
4207
|
return r;
|
|
4189
4208
|
}
|
|
4190
|
-
|
|
4209
|
+
function eo() {
|
|
4210
|
+
let d = "";
|
|
4211
|
+
const r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
4212
|
+
for (let s = 0; s < 7; s++) d += r.charAt(Math.floor(Math.random() * r.length));
|
|
4213
|
+
return d;
|
|
4214
|
+
}
|
|
4215
|
+
function to(d) {
|
|
4216
|
+
return d[Math.floor(Math.random() * d.length)];
|
|
4217
|
+
}
|
|
4218
|
+
const no = (d) => {
|
|
4219
|
+
switch (!0) {
|
|
4220
|
+
case d < 0:
|
|
4221
|
+
return "text-down text-xs";
|
|
4222
|
+
case d > 0:
|
|
4223
|
+
return "text-up text-xs";
|
|
4224
|
+
default:
|
|
4225
|
+
return "text-white text-xs";
|
|
4226
|
+
}
|
|
4227
|
+
};
|
|
4228
|
+
class ro {
|
|
4191
4229
|
constructor(r) {
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4230
|
+
k(this, "sm");
|
|
4231
|
+
k(this, "api");
|
|
4232
|
+
k(this, "bc");
|
|
4233
|
+
k(this, "options");
|
|
4234
|
+
k(this, "update", async (r) => {
|
|
4197
4235
|
if (this.sm === null)
|
|
4198
4236
|
return;
|
|
4199
4237
|
const s = await this.sm.getSubscribers();
|
|
4200
4238
|
if (s.length === 0)
|
|
4201
4239
|
return;
|
|
4202
4240
|
const l = [];
|
|
4203
|
-
r ? l.push(this.api.get(r)) : s == null || s.forEach((
|
|
4204
|
-
l.push(this.api.get(
|
|
4241
|
+
r ? l.push(this.api.get(r)) : s == null || s.forEach((x) => {
|
|
4242
|
+
l.push(this.api.get(x));
|
|
4205
4243
|
}), await Promise.allSettled(l).then(
|
|
4206
|
-
(
|
|
4244
|
+
(x) => x.forEach(async (D) => {
|
|
4207
4245
|
let R = 400;
|
|
4208
4246
|
if (D.status === "fulfilled") {
|
|
4209
4247
|
const B = D.value;
|
|
@@ -4296,10 +4334,10 @@ class Vi {
|
|
|
4296
4334
|
})
|
|
4297
4335
|
);
|
|
4298
4336
|
});
|
|
4299
|
-
|
|
4337
|
+
k(this, "hide", (r) => {
|
|
4300
4338
|
this.api.hideMessage(r);
|
|
4301
4339
|
});
|
|
4302
|
-
|
|
4340
|
+
k(this, "actions", async (r) => {
|
|
4303
4341
|
var s;
|
|
4304
4342
|
switch (r.data.event) {
|
|
4305
4343
|
case re.SUBSCRIBE:
|
|
@@ -4317,9 +4355,9 @@ class Vi {
|
|
|
4317
4355
|
break;
|
|
4318
4356
|
}
|
|
4319
4357
|
});
|
|
4320
|
-
|
|
4321
|
-
var l,
|
|
4322
|
-
const r = ((l = this.options) == null ? void 0 : l.retention) || 345600, s = await ((
|
|
4358
|
+
k(this, "cleanMessages", async () => {
|
|
4359
|
+
var l, x;
|
|
4360
|
+
const r = ((l = this.options) == null ? void 0 : l.retention) || 345600, s = await ((x = this.sm) == null ? void 0 : x.cleanMessages(
|
|
4323
4361
|
r
|
|
4324
4362
|
));
|
|
4325
4363
|
console.info(
|
|
@@ -4330,7 +4368,7 @@ class Vi {
|
|
|
4330
4368
|
`${s} messages deleted`
|
|
4331
4369
|
);
|
|
4332
4370
|
});
|
|
4333
|
-
|
|
4371
|
+
k(this, "hideMessage", async (r) => {
|
|
4334
4372
|
var l;
|
|
4335
4373
|
const s = await ((l = this.sm) == null ? void 0 : l.hideMessage(r.id, 0));
|
|
4336
4374
|
return console.info(
|
|
@@ -4341,15 +4379,15 @@ class Vi {
|
|
|
4341
4379
|
`${s} messages hidden`
|
|
4342
4380
|
), await this.api.hideMessage(r);
|
|
4343
4381
|
});
|
|
4344
|
-
|
|
4345
|
-
|
|
4382
|
+
k(this, "hideLabels", async (r) => await this.api.hideLabels(r));
|
|
4383
|
+
k(this, "getSubscribers", async () => {
|
|
4346
4384
|
var r;
|
|
4347
4385
|
return await ((r = this.sm) == null ? void 0 : r.getSubscribers());
|
|
4348
4386
|
});
|
|
4349
|
-
|
|
4350
|
-
|
|
4387
|
+
k(this, "loadSlide", async (r) => await this.api.loadSlide(r));
|
|
4388
|
+
k(this, "storeSlide", async (r) => {
|
|
4351
4389
|
var s;
|
|
4352
|
-
return console.log(r), await ((s = this.sm) == null ? void 0 : s.storeSlide(r).then(async () => r != null && r.update && r.update ? await this.api.storeSlide(r) : new Promise((l,
|
|
4390
|
+
return console.log(r), await ((s = this.sm) == null ? void 0 : s.storeSlide(r).then(async () => r != null && r.update && r.update ? await this.api.storeSlide(r) : new Promise((l, x) => {
|
|
4353
4391
|
l(201);
|
|
4354
4392
|
})));
|
|
4355
4393
|
});
|
|
@@ -4360,7 +4398,7 @@ class Vi {
|
|
|
4360
4398
|
_.SLIDE,
|
|
4361
4399
|
r.slide,
|
|
4362
4400
|
re.VERSION,
|
|
4363
|
-
|
|
4401
|
+
ki
|
|
4364
4402
|
), this.options = r, this.sm = null;
|
|
4365
4403
|
const s = (r == null ? void 0 : r.slide) || r.app;
|
|
4366
4404
|
switch (this.bc = new BroadcastChannel(s), console.info(
|
|
@@ -4391,15 +4429,15 @@ class Vi {
|
|
|
4391
4429
|
}
|
|
4392
4430
|
}
|
|
4393
4431
|
}
|
|
4394
|
-
class
|
|
4432
|
+
class Bi {
|
|
4395
4433
|
constructor(r) {
|
|
4396
|
-
|
|
4434
|
+
k(this, "sm");
|
|
4397
4435
|
/**
|
|
4398
4436
|
* Retieve Cloud Data
|
|
4399
4437
|
* @param query Widgets parameters, type "cloud"
|
|
4400
4438
|
* @returns IResponse
|
|
4401
4439
|
*/
|
|
4402
|
-
|
|
4440
|
+
k(this, "getCloud", async (r) => {
|
|
4403
4441
|
var s;
|
|
4404
4442
|
return r.type !== K.CLOUD ? (console.warn(
|
|
4405
4443
|
"%capp%c %get",
|
|
@@ -4420,7 +4458,7 @@ class Ni {
|
|
|
4420
4458
|
* @param query Widgets parameters, type "messages"
|
|
4421
4459
|
* @returns IResponse
|
|
4422
4460
|
*/
|
|
4423
|
-
|
|
4461
|
+
k(this, "getMessages", async (r) => {
|
|
4424
4462
|
var s;
|
|
4425
4463
|
return r.type !== K.MESSAGES ? (console.warn(
|
|
4426
4464
|
"%capp%c %get",
|
|
@@ -4441,7 +4479,7 @@ class Ni {
|
|
|
4441
4479
|
* @param query Widgets parameters, type "series"
|
|
4442
4480
|
* @returns IResponse
|
|
4443
4481
|
*/
|
|
4444
|
-
|
|
4482
|
+
k(this, "getSeries", async (r) => {
|
|
4445
4483
|
var s;
|
|
4446
4484
|
return r.type !== K.SERIES ? (console.warn(
|
|
4447
4485
|
"%capp%c %get",
|
|
@@ -4476,7 +4514,7 @@ class Ni {
|
|
|
4476
4514
|
}
|
|
4477
4515
|
}
|
|
4478
4516
|
}
|
|
4479
|
-
class
|
|
4517
|
+
class io {
|
|
4480
4518
|
/**
|
|
4481
4519
|
* Main container for managing widgets and data updates
|
|
4482
4520
|
*
|
|
@@ -4485,17 +4523,17 @@ class Zi {
|
|
|
4485
4523
|
* @param selector container for the element - by default buzzcasting-slide (optional)
|
|
4486
4524
|
*/
|
|
4487
4525
|
constructor(r, s, l) {
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4526
|
+
k(this, "storageReader");
|
|
4527
|
+
k(this, "broadcastChannel");
|
|
4528
|
+
k(this, "element");
|
|
4529
|
+
k(this, "query");
|
|
4530
|
+
k(this, "listeners");
|
|
4493
4531
|
/**
|
|
4494
4532
|
* Generic call to any query type
|
|
4495
4533
|
*
|
|
4496
4534
|
* @returns IResponse
|
|
4497
4535
|
*/
|
|
4498
|
-
|
|
4536
|
+
k(this, "getData", async () => {
|
|
4499
4537
|
switch (this.query.type) {
|
|
4500
4538
|
case K.CLOUD:
|
|
4501
4539
|
return await this.getCloud();
|
|
@@ -4515,7 +4553,7 @@ class Zi {
|
|
|
4515
4553
|
*
|
|
4516
4554
|
* @returns IResponse
|
|
4517
4555
|
*/
|
|
4518
|
-
|
|
4556
|
+
k(this, "getCloud", async () => this.query.type !== K.CLOUD ? (console.warn(
|
|
4519
4557
|
"%cstorage%c %cwidget",
|
|
4520
4558
|
_.STORAGE,
|
|
4521
4559
|
_.NONE,
|
|
@@ -4533,7 +4571,7 @@ class Zi {
|
|
|
4533
4571
|
*
|
|
4534
4572
|
* @returns IResponse
|
|
4535
4573
|
*/
|
|
4536
|
-
|
|
4574
|
+
k(this, "getMessages", async () => this.query.type !== K.MESSAGES ? (console.warn(
|
|
4537
4575
|
"%cstorage%c %cwidget",
|
|
4538
4576
|
_.STORAGE,
|
|
4539
4577
|
_.NONE,
|
|
@@ -4551,7 +4589,7 @@ class Zi {
|
|
|
4551
4589
|
*
|
|
4552
4590
|
* @returns IResponse
|
|
4553
4591
|
*/
|
|
4554
|
-
|
|
4592
|
+
k(this, "getSeries", async () => this.query.type !== K.SERIES ? (console.warn(
|
|
4555
4593
|
"%cstorage%c %cwidget",
|
|
4556
4594
|
_.STORAGE,
|
|
4557
4595
|
_.NONE,
|
|
@@ -4570,7 +4608,7 @@ class Zi {
|
|
|
4570
4608
|
*
|
|
4571
4609
|
* @param modal IModal
|
|
4572
4610
|
*/
|
|
4573
|
-
|
|
4611
|
+
k(this, "showModal", (r) => {
|
|
4574
4612
|
const s = Ri(this.element.attributes);
|
|
4575
4613
|
if (Object.prototype.hasOwnProperty.call(s, "data-topics")) {
|
|
4576
4614
|
const D = s["data-topics"].split("-");
|
|
@@ -4585,7 +4623,7 @@ class Zi {
|
|
|
4585
4623
|
// @ts-expect-error cannot get string type out of IFilteredAttributes props
|
|
4586
4624
|
s["data-widget"]
|
|
4587
4625
|
);
|
|
4588
|
-
const
|
|
4626
|
+
const x = new CustomEvent(re.SHOW_MODAL, {
|
|
4589
4627
|
detail: {
|
|
4590
4628
|
component: r.showComponent,
|
|
4591
4629
|
props: l,
|
|
@@ -4595,14 +4633,14 @@ class Zi {
|
|
|
4595
4633
|
cancelable: !0,
|
|
4596
4634
|
composed: !0
|
|
4597
4635
|
});
|
|
4598
|
-
window.dispatchEvent(
|
|
4636
|
+
window.dispatchEvent(x);
|
|
4599
4637
|
});
|
|
4600
4638
|
var R;
|
|
4601
4639
|
this.element = r, this.listeners = s, l = typeof l < "u" ? l : "buzzcasting-slide";
|
|
4602
|
-
let
|
|
4603
|
-
|
|
4640
|
+
let x;
|
|
4641
|
+
x = { ...r.dataset }, delete x.hmr, x.slide = ((R = r.closest(l.toUpperCase())) == null ? void 0 : R.id) ?? `${l} not found`, x = rt(x), this.query = x, Ti(r);
|
|
4604
4642
|
const D = window.BuzzCasting.getOptions();
|
|
4605
|
-
this.storageReader = new
|
|
4643
|
+
this.storageReader = new Bi(D), this.broadcastChannel = new BroadcastChannel(x.slide), this.startListener();
|
|
4606
4644
|
}
|
|
4607
4645
|
addListener(r) {
|
|
4608
4646
|
this.listeners.push(r);
|
|
@@ -4616,8 +4654,8 @@ class Zi {
|
|
|
4616
4654
|
const l = s.data.data;
|
|
4617
4655
|
switch (s.data.event) {
|
|
4618
4656
|
case re.WIDGET_UPDATE:
|
|
4619
|
-
l.query.slide === r.slide && l.query.widget === r.widget && this.listeners.forEach((
|
|
4620
|
-
|
|
4657
|
+
l.query.slide === r.slide && l.query.widget === r.widget && this.listeners.forEach((x) => {
|
|
4658
|
+
x(s.data.data);
|
|
4621
4659
|
});
|
|
4622
4660
|
break;
|
|
4623
4661
|
case re.SLIDE_READY:
|
|
@@ -4649,26 +4687,33 @@ class Zi {
|
|
|
4649
4687
|
}
|
|
4650
4688
|
export {
|
|
4651
4689
|
K as API,
|
|
4652
|
-
|
|
4653
|
-
|
|
4690
|
+
ro as BuzzcastingStorageManager,
|
|
4691
|
+
Bi as BuzzcastingStorageReader,
|
|
4654
4692
|
_ as CSS,
|
|
4655
4693
|
re as EVENTS,
|
|
4656
4694
|
qt as MODERATION,
|
|
4657
4695
|
pe as STORAGE,
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4696
|
+
io as Widget,
|
|
4697
|
+
Gi as anonymize,
|
|
4698
|
+
$i as attachedMedia,
|
|
4661
4699
|
Ri as attrs,
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4700
|
+
Ui as brandLogo,
|
|
4701
|
+
zi as camelCase,
|
|
4702
|
+
Wi as camelize,
|
|
4703
|
+
Hi as capitalizeFirstLetter,
|
|
4665
4704
|
Ti as clearContents,
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
Qi as
|
|
4671
|
-
Xi as
|
|
4672
|
-
|
|
4705
|
+
Mi as deepMerge,
|
|
4706
|
+
Fi as filterAttributes,
|
|
4707
|
+
Yi as formatContent,
|
|
4708
|
+
Fn as hashSum,
|
|
4709
|
+
Qi as intToString,
|
|
4710
|
+
Xi as numberFormatter,
|
|
4711
|
+
to as randomValue,
|
|
4712
|
+
Ji as rtl,
|
|
4713
|
+
Vi as sanitize,
|
|
4714
|
+
Zi as showModal,
|
|
4715
|
+
qi as shuffleMessages,
|
|
4716
|
+
eo as stringGen,
|
|
4717
|
+
no as upDownColor,
|
|
4673
4718
|
rt as widgetParams
|
|
4674
4719
|
};
|