buzzcasting-storage 2.16.23 → 2.16.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/buzzcasting-storage.esm.js +897 -897
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var xi = Object.defineProperty;
|
|
2
2
|
var ki = (f, r, s) => r in f ? xi(f, r, { enumerable: !0, configurable: !0, writable: !0, value: s }) : f[r] = s;
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
const Ai = "2.16.
|
|
3
|
+
var A = (f, r, s) => ki(f, typeof r != "symbol" ? r + "" : r, s);
|
|
4
|
+
var K = /* @__PURE__ */ ((f) => (f.MESSAGES = "messages", f.CLOUD = "cloud", f.SERIES = "series", f.TOPICS = "topics", f.WIDGET = "widget", f.WIDGETS = "widgets", f.SLIDE = "slide", f))(K || {}), _ = /* @__PURE__ */ ((f) => (f.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", f.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", f.BROADCAST = "color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", f.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", f.CLOUD = "color:grey;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", f.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", f.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", f.MESSAGES = "color:grey;background-color:tan;padding:0 4px 0 4px;border-radius:5px;", f.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", f.NONE = "color:transparent;background-color:transparent;", f.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", f.SERIES = "color:grey;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", f.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", f.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", f.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", f.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", f.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", f))(_ || {}), re = /* @__PURE__ */ ((f) => (f.ADD_SLIDE = "addSlide", f.APP_READY = "appReady", f.API_UPDATE = "apiUpdate", f.APPROVE_MESSAGE = "approveMessage", f.CHANNEL = "channel", f.CLEAN_MESSAGES = "cleanMessages", f.CLOSE_MODAL = "closeModal", f.CLOSE_BUILDER_MODAL = "closeBuilderModal", f.ERROR = "error", f.HIDE_MESSAGE = "hideMessage", f.HIDE_LABELS = "hideLabels", f.PAUSE_PRESENTATION = "pausePresentation", f.PRESENTATION_READY = "presentationReady", f.PREV_SLIDE = "prevSlide", f.RELOAD_PRESENTATION = "reloadPresentation", f.SHOW_MODAL = "showModal", f.STAR_MESSAGE = "starMessage", f.GOTO_SLIDE = "gotoSlide", f.NEXT_SLIDE = "nextSlide", f.SHOW_BUILDER_MODAL = "showBuilderModal", f.SLIDE_DID_LOAD = "slideDidLoad", f.SLIDE_GOTO = "slideGoto", f.SLIDE_READY = "slideReady", f.SLIDE_LOAD = "loadSlide", f.SLIDE_STORE = "storeSlide", f.SLIDE_TRANSITIONER = "slideTransitioner", f.START_TRANSITIONER = "startTransitioner", f.STORAGE_INIT = "storageInit", f.SUBSCRIBE = "subscribe", f.SUSPEND_ACCOUNT = "suspendAccount", f.REMOVE_CLOUD = "removeCloud", f.UPDATE = "update", f.VERSION = "version", f.WIDGET_UPDATE = "widgetUpdate", f))(re || {}), qt = /* @__PURE__ */ ((f) => (f.APPROVED = "approved", f.BEFORE = "before", f.DELAYED = "delayed", f.NONE = "none", f.REALTIME = "realtime", f))(qt || {}), pe = /* @__PURE__ */ ((f) => (f.KEYVAL = "keyval", f.LOCAL = "local", f.SESSION = "session", f.DEXIE = "dexie", f.WINDOW = "window", f))(pe || {});
|
|
5
|
+
const Ai = "2.16.23";
|
|
6
6
|
class Di {
|
|
7
7
|
constructor(r) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
A(this, "options");
|
|
9
|
+
A(this, "url");
|
|
10
|
+
A(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
|
+
A(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
|
|
35
|
+
const { version: s } = this.options, l = this.headers(), k = Object.assign({}, r);
|
|
36
|
+
delete k.slide, delete k.type, delete k.hash;
|
|
37
|
+
const D = Object.keys(k).length > 0 ? `?${new URLSearchParams(k).toString()}` : "";
|
|
38
38
|
return console.debug(
|
|
39
39
|
"%capi%c %cget",
|
|
40
40
|
_.API,
|
|
@@ -43,16 +43,16 @@ class Di {
|
|
|
43
43
|
r.slide,
|
|
44
44
|
r.widget
|
|
45
45
|
), await fetch(
|
|
46
|
-
[this.url, "api", s, r.type].join("/") +
|
|
46
|
+
[this.url, "api", s, r.type].join("/") + D,
|
|
47
47
|
{ ...l, method: "get" }
|
|
48
|
-
).then(async (
|
|
49
|
-
if (!
|
|
50
|
-
throw new Error(`${
|
|
51
|
-
return
|
|
52
|
-
}).then((
|
|
48
|
+
).then(async (R) => {
|
|
49
|
+
if (!R.ok)
|
|
50
|
+
throw new Error(`${R.status}`);
|
|
51
|
+
return R;
|
|
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(), k = "?action=visible";
|
|
56
56
|
return console.info(
|
|
57
57
|
"%capi%c %cput",
|
|
58
58
|
_.API,
|
|
@@ -62,18 +62,18 @@ 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("/") + k,
|
|
66
66
|
{ ...l, method: "put" }
|
|
67
|
-
).then((
|
|
68
|
-
if (!
|
|
69
|
-
throw new Error(
|
|
70
|
-
return
|
|
71
|
-
}).then((
|
|
67
|
+
).then((D) => {
|
|
68
|
+
if (!D.ok)
|
|
69
|
+
throw new Error(D.statusText);
|
|
70
|
+
return D;
|
|
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(),
|
|
75
|
-
for (const [
|
|
76
|
-
|
|
74
|
+
const { version: s } = this.options, l = this.formHeaders(), k = new URLSearchParams(), D = r.labels || [];
|
|
75
|
+
for (const [R, B] of D.entries())
|
|
76
|
+
k.append(`custom_filters[${R}]`, B);
|
|
77
77
|
return console.info(
|
|
78
78
|
"%capi%c %cput",
|
|
79
79
|
_.API,
|
|
@@ -81,19 +81,19 @@ class Di {
|
|
|
81
81
|
_.GET_DATA,
|
|
82
82
|
re.HIDE_LABELS,
|
|
83
83
|
r.widget,
|
|
84
|
-
|
|
84
|
+
D
|
|
85
85
|
), await fetch(
|
|
86
86
|
[this.url, "api", s, r.type, r.widget].join("/"),
|
|
87
|
-
{ ...l, body:
|
|
88
|
-
).then((
|
|
89
|
-
if (!
|
|
90
|
-
throw new Error(
|
|
91
|
-
return
|
|
92
|
-
}).then((
|
|
87
|
+
{ ...l, body: k, method: "put" }
|
|
88
|
+
).then((R) => {
|
|
89
|
+
if (!R.ok)
|
|
90
|
+
throw new Error(R.statusText);
|
|
91
|
+
return R;
|
|
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(), k = Object.assign({}, r);
|
|
96
|
+
return delete k.slide, delete k.type, delete k.hash, console.debug(
|
|
97
97
|
"%capi%c %cget",
|
|
98
98
|
_.API,
|
|
99
99
|
_.NONE,
|
|
@@ -103,11 +103,11 @@ class Di {
|
|
|
103
103
|
), await fetch(
|
|
104
104
|
[this.url, "api", s, "slides", r.id].join("/"),
|
|
105
105
|
{ ...l, method: "get" }
|
|
106
|
-
).then(async (
|
|
107
|
-
if (!
|
|
108
|
-
throw new Error(`${
|
|
109
|
-
return
|
|
110
|
-
}).then((
|
|
106
|
+
).then(async (D) => {
|
|
107
|
+
if (!D.ok)
|
|
108
|
+
throw new Error(`${D.status}`);
|
|
109
|
+
return D;
|
|
110
|
+
}).then((D) => D.json()).then((D) => (D.query = r, D)).catch((D) => ({ success: !1, message: `${D}`, data: null }));
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
113
|
* Store slide definition
|
|
@@ -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 k = JSON.stringify(r);
|
|
123
123
|
return console.info(
|
|
124
124
|
"%capi%c %cput",
|
|
125
125
|
_.API,
|
|
@@ -129,12 +129,12 @@ class Di {
|
|
|
129
129
|
r.id
|
|
130
130
|
), await fetch(
|
|
131
131
|
[this.url, "api", s, "slides", r.id].join("/"),
|
|
132
|
-
{ ...l, body:
|
|
133
|
-
).then((
|
|
134
|
-
if (!
|
|
135
|
-
throw new Error(
|
|
136
|
-
return
|
|
137
|
-
}).then((
|
|
132
|
+
{ ...l, body: k, method: "put" }
|
|
133
|
+
).then((D) => {
|
|
134
|
+
if (!D.ok)
|
|
135
|
+
throw new Error(D.statusText);
|
|
136
|
+
return D;
|
|
137
|
+
}).then((D) => D.json()).catch((D) => ({ succes: !1, message: D, data: [] }));
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
var Rr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
@@ -158,29 +158,29 @@ var Mr = { exports: {} };
|
|
|
158
158
|
return e;
|
|
159
159
|
}).apply(this, arguments);
|
|
160
160
|
};
|
|
161
|
-
function
|
|
161
|
+
function k(e, t, n) {
|
|
162
162
|
for (var i, a = 0, o = t.length; a < o; a++) !i && a in t || ((i = i || Array.prototype.slice.call(t, 0, a))[a] = t[a]);
|
|
163
163
|
return e.concat(i || Array.prototype.slice.call(t));
|
|
164
164
|
}
|
|
165
|
-
var
|
|
165
|
+
var D = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Rr, R = Object.keys, B = Array.isArray;
|
|
166
166
|
function Q(e, t) {
|
|
167
|
-
return typeof t != "object" ||
|
|
167
|
+
return typeof t != "object" || R(t).forEach(function(n) {
|
|
168
168
|
e[n] = t[n];
|
|
169
169
|
}), e;
|
|
170
170
|
}
|
|
171
|
-
typeof Promise > "u" ||
|
|
172
|
-
var
|
|
173
|
-
function
|
|
174
|
-
return
|
|
171
|
+
typeof Promise > "u" || D.Promise || (D.Promise = Promise);
|
|
172
|
+
var ee = Object.getPrototypeOf, ge = {}.hasOwnProperty;
|
|
173
|
+
function Z(e, t) {
|
|
174
|
+
return ge.call(e, t);
|
|
175
175
|
}
|
|
176
176
|
function xe(e, t) {
|
|
177
|
-
typeof t == "function" && (t = t(
|
|
177
|
+
typeof t == "function" && (t = t(ee(e))), (typeof Reflect > "u" ? R : Reflect.ownKeys)(t).forEach(function(n) {
|
|
178
178
|
ke(e, n, t[n]);
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
|
-
var
|
|
181
|
+
var St = Object.defineProperty;
|
|
182
182
|
function ke(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) {
|
|
@@ -188,7 +188,7 @@ var Mr = { exports: {} };
|
|
|
188
188
|
} };
|
|
189
189
|
}
|
|
190
190
|
var Fr = Object.getOwnPropertyDescriptor, Ur = [].slice;
|
|
191
|
-
function
|
|
191
|
+
function Et(e, t, n) {
|
|
192
192
|
return Ur.call(e, t, n);
|
|
193
193
|
}
|
|
194
194
|
function Hn(e, t) {
|
|
@@ -198,10 +198,10 @@ var Mr = { exports: {} };
|
|
|
198
198
|
if (!e) throw new Error("Assertion Failed");
|
|
199
199
|
}
|
|
200
200
|
function Yn(e) {
|
|
201
|
-
|
|
201
|
+
D.setImmediate ? setImmediate(e) : setTimeout(e, 0);
|
|
202
202
|
}
|
|
203
203
|
function ve(e, t) {
|
|
204
|
-
if (typeof t == "string" &&
|
|
204
|
+
if (typeof t == "string" && Z(e, t)) return e[t];
|
|
205
205
|
if (!t) return e;
|
|
206
206
|
if (typeof t != "string") {
|
|
207
207
|
for (var n = [], i = 0, a = t.length; i < a; ++i) {
|
|
@@ -216,18 +216,18 @@ var Mr = { exports: {} };
|
|
|
216
216
|
return u == null ? void 0 : ve(u, t.substr(c + 1));
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
-
function
|
|
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, a = t.length; i < a; ++i)
|
|
222
|
+
for (var i = 0, a = t.length; i < a; ++i) le(e, t[i], n[i]);
|
|
223
223
|
} else {
|
|
224
224
|
var o, c, u = t.indexOf(".");
|
|
225
|
-
u !== -1 ? (o = t.substr(0, u), (c = t.substr(u + 1)) === "" ? n === void 0 ? B(e) && !isNaN(parseInt(o)) ? e.splice(o, 1) : delete e[o] : e[o] = n :
|
|
225
|
+
u !== -1 ? (o = t.substr(0, u), (c = t.substr(u + 1)) === "" ? n === void 0 ? B(e) && !isNaN(parseInt(o)) ? e.splice(o, 1) : delete e[o] : e[o] = n : le(u = !(u = e[o]) || !Z(e, o) ? e[o] = {} : 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) {
|
|
229
229
|
var t, n = {};
|
|
230
|
-
for (t in e)
|
|
230
|
+
for (t in e) Z(e, t) && (n[t] = e[t]);
|
|
231
231
|
return n;
|
|
232
232
|
}
|
|
233
233
|
var Wr = [].concat;
|
|
@@ -239,9 +239,9 @@ var Mr = { exports: {} };
|
|
|
239
239
|
return t + e + "Array";
|
|
240
240
|
});
|
|
241
241
|
}))).filter(function(e) {
|
|
242
|
-
return
|
|
242
|
+
return D[e];
|
|
243
243
|
}), Jn = new Set(Se.map(function(e) {
|
|
244
|
-
return
|
|
244
|
+
return D[e];
|
|
245
245
|
})), at = null;
|
|
246
246
|
function Me(e) {
|
|
247
247
|
return at = /* @__PURE__ */ new WeakMap(), e = function t(n) {
|
|
@@ -253,19 +253,19 @@ var Mr = { exports: {} };
|
|
|
253
253
|
for (var a = 0, o = n.length; a < o; ++a) i.push(t(n[a]));
|
|
254
254
|
} else if (Jn.has(n.constructor)) i = n;
|
|
255
255
|
else {
|
|
256
|
-
var c, u =
|
|
257
|
-
for (c in i = u === Object.prototype ? {} : Object.create(u), at.set(n, i), n)
|
|
256
|
+
var c, u = ee(n);
|
|
257
|
+
for (c in i = u === Object.prototype ? {} : Object.create(u), at.set(n, i), n) Z(n, c) && (i[c] = t(n[c]));
|
|
258
258
|
}
|
|
259
259
|
return i;
|
|
260
260
|
}(e), at = null, e;
|
|
261
261
|
}
|
|
262
262
|
var zr = {}.toString;
|
|
263
|
-
function
|
|
263
|
+
function en(e) {
|
|
264
264
|
return zr.call(e).slice(8, -1);
|
|
265
265
|
}
|
|
266
|
-
var
|
|
266
|
+
var tn = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", Hr = typeof tn == "symbol" ? function(e) {
|
|
267
267
|
var t;
|
|
268
|
-
return e != null && (t = e[
|
|
268
|
+
return e != null && (t = e[tn]) && t.apply(e);
|
|
269
269
|
} : function() {
|
|
270
270
|
return null;
|
|
271
271
|
};
|
|
@@ -290,11 +290,11 @@ var Mr = { exports: {} };
|
|
|
290
290
|
for (t = arguments.length, n = new Array(t); t--; ) n[t] = arguments[t];
|
|
291
291
|
return n;
|
|
292
292
|
}
|
|
293
|
-
var
|
|
293
|
+
var nn = typeof Symbol < "u" ? function(e) {
|
|
294
294
|
return e[Symbol.toStringTag] === "AsyncFunction";
|
|
295
295
|
} : function() {
|
|
296
296
|
return !1;
|
|
297
|
-
}, ct = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"],
|
|
297
|
+
}, ct = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], he = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(ct), Yr = { VersionChanged: "Database version changed by other database connection", DatabaseClosed: "Database has been closed", Abort: "Transaction aborted", TransactionInactive: "Transaction has already completed or failed", MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb" };
|
|
298
298
|
function Qe(e, t) {
|
|
299
299
|
this.name = e, this.message = t;
|
|
300
300
|
}
|
|
@@ -306,7 +306,7 @@ var Mr = { exports: {} };
|
|
|
306
306
|
}).join(`
|
|
307
307
|
`);
|
|
308
308
|
}
|
|
309
|
-
function
|
|
309
|
+
function Ot(e, t, n, i) {
|
|
310
310
|
this.failures = t, this.failedKeys = i, this.successCount = n, this.message = Vn(e, t);
|
|
311
311
|
}
|
|
312
312
|
function Xe(e, t) {
|
|
@@ -316,10 +316,10 @@ var Mr = { exports: {} };
|
|
|
316
316
|
}
|
|
317
317
|
He(Qe).from(Error).extend({ toString: function() {
|
|
318
318
|
return this.name + ": " + this.message;
|
|
319
|
-
} }), He(
|
|
320
|
-
var
|
|
319
|
+
} }), He(Ot).from(Qe), He(Xe).from(Qe);
|
|
320
|
+
var rn = he.reduce(function(e, t) {
|
|
321
321
|
return e[t] = t + "Error", e;
|
|
322
|
-
}, {}), Qr = Qe, $ =
|
|
322
|
+
}, {}), Qr = Qe, $ = he.reduce(function(e, t) {
|
|
323
323
|
var n = t + "Error";
|
|
324
324
|
function i(a, o) {
|
|
325
325
|
this.name = n, a ? typeof a == "string" ? (this.message = "".concat(a).concat(o ? `
|
|
@@ -330,7 +330,7 @@ var Mr = { exports: {} };
|
|
|
330
330
|
$.Syntax = SyntaxError, $.Type = TypeError, $.Range = RangeError;
|
|
331
331
|
var Zn = ct.reduce(function(e, t) {
|
|
332
332
|
return e[t + "Error"] = $[t], e;
|
|
333
|
-
}, {}),
|
|
333
|
+
}, {}), xt = he.reduce(function(e, t) {
|
|
334
334
|
return ["Syntax", "Type", "Range"].indexOf(t) === -1 && (e[t + "Error"] = $[t]), e;
|
|
335
335
|
}, {});
|
|
336
336
|
function X() {
|
|
@@ -378,7 +378,7 @@ var Mr = { exports: {} };
|
|
|
378
378
|
return t.apply(this, arguments) !== !1 && e.apply(this, arguments);
|
|
379
379
|
};
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function an(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") {
|
|
@@ -390,26 +390,26 @@ var Mr = { exports: {} };
|
|
|
390
390
|
return t.apply(this, arguments);
|
|
391
391
|
};
|
|
392
392
|
}
|
|
393
|
-
|
|
393
|
+
xt.ModifyError = Ot, xt.DexieError = Qe, xt.BulkError = Xe;
|
|
394
394
|
var ye = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
|
|
395
395
|
function qn(e) {
|
|
396
396
|
ye = e;
|
|
397
397
|
}
|
|
398
398
|
var st = {}, er = 100, Se = typeof Promise > "u" ? [] : function() {
|
|
399
399
|
var e = Promise.resolve();
|
|
400
|
-
if (typeof crypto > "u" || !crypto.subtle) return [e,
|
|
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
|
-
return [t,
|
|
403
|
-
}(), ct = Se[0],
|
|
404
|
-
lt.push([e, t]),
|
|
405
|
-
},
|
|
406
|
-
function
|
|
402
|
+
return [t, ee(t), e];
|
|
403
|
+
}(), ct = Se[0], he = Se[1], Se = Se[2], he = he && he.then, Ne = ct && ct.constructor, on = !!Se, ut = function(e, t) {
|
|
404
|
+
lt.push([e, t]), kt && (queueMicrotask(ti), kt = !1);
|
|
405
|
+
}, sn = !0, kt = !0, Be = [], At = [], cn = ot, Ae = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: X, pgp: !1, env: {}, finalize: X }, G = Ae, lt = [], Le = 0, Dt = [];
|
|
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;
|
|
409
409
|
var t = this._PSD = G;
|
|
410
410
|
if (typeof e != "function") {
|
|
411
411
|
if (e !== st) throw new TypeError("Not a function");
|
|
412
|
-
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 &&
|
|
412
|
+
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && ln(this, this._value));
|
|
413
413
|
}
|
|
414
414
|
this._state = null, this._value = null, ++t.ref, function n(i, a) {
|
|
415
415
|
try {
|
|
@@ -418,48 +418,48 @@ var Mr = { exports: {} };
|
|
|
418
418
|
if (o === i) throw new TypeError("A promise cannot be resolved with itself.");
|
|
419
419
|
var c = i._lib && Je();
|
|
420
420
|
o && typeof o.then == "function" ? n(i, function(u, h) {
|
|
421
|
-
o instanceof
|
|
421
|
+
o instanceof N ? o._then(u, h) : o.then(u, h);
|
|
422
422
|
}) : (i._state = !0, i._value = o, nr(i)), c && Ve();
|
|
423
423
|
}
|
|
424
|
-
},
|
|
424
|
+
}, ln.bind(null, i));
|
|
425
425
|
} catch (o) {
|
|
426
|
-
|
|
426
|
+
ln(i, o);
|
|
427
427
|
}
|
|
428
428
|
}(this, e);
|
|
429
429
|
}
|
|
430
|
-
var
|
|
431
|
-
var e = G, t =
|
|
430
|
+
var un = { get: function() {
|
|
431
|
+
var e = G, t = Rt;
|
|
432
432
|
function n(i, a) {
|
|
433
|
-
var o = this, c = !e.global && (e !== G || t !==
|
|
434
|
-
|
|
433
|
+
var o = this, c = !e.global && (e !== G || t !== Rt), u = c && !Pe(), h = new N(function(g, b) {
|
|
434
|
+
dn(o, new tr(ir(i, e, c, u), ir(a, 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
|
-
ke(this, "then", e && e.prototype === st ?
|
|
440
|
+
ke(this, "then", e && e.prototype === st ? un : { get: function() {
|
|
441
441
|
return e;
|
|
442
|
-
}, set:
|
|
442
|
+
}, set: un.set });
|
|
443
443
|
} };
|
|
444
444
|
function tr(e, t, n, i, a) {
|
|
445
445
|
this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof t == "function" ? t : null, this.resolve = n, this.reject = i, this.psd = a;
|
|
446
446
|
}
|
|
447
|
-
function
|
|
447
|
+
function ln(e, t) {
|
|
448
448
|
var n, i;
|
|
449
|
-
|
|
449
|
+
At.push(t), e._state === null && (n = e._lib && Je(), t = cn(t), e._state = !1, e._value = t, i = e, Be.some(function(a) {
|
|
450
450
|
return a._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
|
-
for (var n = 0, i = t.length; n < i; ++n)
|
|
456
|
+
for (var n = 0, i = t.length; n < i; ++n) dn(e, t[n]);
|
|
457
457
|
var a = e._PSD;
|
|
458
458
|
--a.ref || a.finalize(), Le === 0 && (++Le, ut(function() {
|
|
459
|
-
--Le == 0 &&
|
|
459
|
+
--Le == 0 && fn();
|
|
460
460
|
}, []));
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function dn(e, t) {
|
|
463
463
|
if (e._state !== null) {
|
|
464
464
|
var n = e._state ? t.onFulfilled : t.onRejected;
|
|
465
465
|
if (n === null) return (e._state ? t.resolve : t.reject)(e._value);
|
|
@@ -469,15 +469,15 @@ var Mr = { exports: {} };
|
|
|
469
469
|
function ei(e, t, n) {
|
|
470
470
|
try {
|
|
471
471
|
var i, a = t._value;
|
|
472
|
-
!t._state &&
|
|
472
|
+
!t._state && At.length && (At = []), i = ye && t._consoleTask ? t._consoleTask.run(function() {
|
|
473
473
|
return e(a);
|
|
474
|
-
}) : e(a), t._state ||
|
|
474
|
+
}) : e(a), t._state || At.indexOf(a) !== -1 || function(o) {
|
|
475
475
|
for (var c = Be.length; c; ) if (Be[--c]._value === o._value) return Be.splice(c, 1);
|
|
476
476
|
}(t), n.resolve(i);
|
|
477
477
|
} catch (o) {
|
|
478
478
|
n.reject(o);
|
|
479
479
|
} finally {
|
|
480
|
-
--Le == 0 &&
|
|
480
|
+
--Le == 0 && fn(), --n.psd.ref || n.psd.finalize();
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
function ti() {
|
|
@@ -486,8 +486,8 @@ var Mr = { exports: {} };
|
|
|
486
486
|
});
|
|
487
487
|
}
|
|
488
488
|
function Je() {
|
|
489
|
-
var e =
|
|
490
|
-
return
|
|
489
|
+
var e = sn;
|
|
490
|
+
return kt = sn = !1, e;
|
|
491
491
|
}
|
|
492
492
|
function Ve() {
|
|
493
493
|
var e, t, n;
|
|
@@ -497,19 +497,19 @@ var Mr = { exports: {} };
|
|
|
497
497
|
i[0].apply(null, i[1]);
|
|
498
498
|
}
|
|
499
499
|
while (0 < lt.length);
|
|
500
|
-
|
|
500
|
+
kt = sn = !0;
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function fn() {
|
|
503
503
|
var e = Be;
|
|
504
504
|
Be = [], e.forEach(function(i) {
|
|
505
505
|
i._PSD.onunhandled.call(null, i._value, i);
|
|
506
506
|
});
|
|
507
|
-
for (var t =
|
|
507
|
+
for (var t = Dt.slice(0), n = t.length; n; ) t[--n]();
|
|
508
508
|
}
|
|
509
|
-
function
|
|
510
|
-
return new
|
|
509
|
+
function Pt(e) {
|
|
510
|
+
return new N(st, !1, e);
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function q(e, t) {
|
|
513
513
|
var n = G;
|
|
514
514
|
return function() {
|
|
515
515
|
var i = Je(), a = G;
|
|
@@ -522,54 +522,54 @@ var Mr = { exports: {} };
|
|
|
522
522
|
}
|
|
523
523
|
};
|
|
524
524
|
}
|
|
525
|
-
xe(
|
|
526
|
-
|
|
525
|
+
xe(N.prototype, { then: un, _then: function(e, t) {
|
|
526
|
+
dn(this, new tr(null, null, e, t, G));
|
|
527
527
|
}, catch: function(e) {
|
|
528
528
|
if (arguments.length === 1) return this.then(null, e);
|
|
529
529
|
var t = e, n = arguments[1];
|
|
530
530
|
return typeof t == "function" ? this.then(null, function(i) {
|
|
531
|
-
return (i instanceof t ? n :
|
|
531
|
+
return (i instanceof t ? n : Pt)(i);
|
|
532
532
|
}) : this.then(null, function(i) {
|
|
533
|
-
return (i && i.name === t ? n :
|
|
533
|
+
return (i && i.name === t ? n : Pt)(i);
|
|
534
534
|
});
|
|
535
535
|
}, finally: function(e) {
|
|
536
536
|
return this.then(function(t) {
|
|
537
|
-
return
|
|
537
|
+
return N.resolve(e()).then(function() {
|
|
538
538
|
return t;
|
|
539
539
|
});
|
|
540
540
|
}, function(t) {
|
|
541
|
-
return
|
|
542
|
-
return
|
|
541
|
+
return N.resolve(e()).then(function() {
|
|
542
|
+
return Pt(t);
|
|
543
543
|
});
|
|
544
544
|
});
|
|
545
545
|
}, timeout: function(e, t) {
|
|
546
546
|
var n = this;
|
|
547
|
-
return e < 1 / 0 ? new
|
|
547
|
+
return e < 1 / 0 ? new N(function(i, a) {
|
|
548
548
|
var o = setTimeout(function() {
|
|
549
549
|
return a(new $.Timeout(t));
|
|
550
550
|
}, e);
|
|
551
551
|
n.then(i, a).finally(clearTimeout.bind(null, o));
|
|
552
552
|
}) : this;
|
|
553
|
-
} }), typeof Symbol < "u" && Symbol.toStringTag && ke(
|
|
554
|
-
var e = we.apply(null, arguments).map(
|
|
555
|
-
return new
|
|
553
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && ke(N.prototype, Symbol.toStringTag, "Dexie.Promise"), Ae.env = rr(), xe(N, { all: function() {
|
|
554
|
+
var e = we.apply(null, arguments).map(Tt);
|
|
555
|
+
return new N(function(t, n) {
|
|
556
556
|
e.length === 0 && t([]);
|
|
557
557
|
var i = e.length;
|
|
558
558
|
e.forEach(function(a, o) {
|
|
559
|
-
return
|
|
559
|
+
return N.resolve(a).then(function(c) {
|
|
560
560
|
e[o] = c, --i || t(e);
|
|
561
561
|
}, n);
|
|
562
562
|
});
|
|
563
563
|
});
|
|
564
564
|
}, resolve: function(e) {
|
|
565
|
-
return e instanceof
|
|
565
|
+
return e instanceof N ? e : e && typeof e.then == "function" ? new N(function(t, n) {
|
|
566
566
|
e.then(t, n);
|
|
567
|
-
}) : new
|
|
568
|
-
}, reject:
|
|
569
|
-
var e = we.apply(null, arguments).map(
|
|
570
|
-
return new
|
|
567
|
+
}) : new N(st, !0, e);
|
|
568
|
+
}, reject: Pt, race: function() {
|
|
569
|
+
var e = we.apply(null, arguments).map(Tt);
|
|
570
|
+
return new N(function(t, n) {
|
|
571
571
|
e.map(function(i) {
|
|
572
|
-
return
|
|
572
|
+
return N.resolve(i).then(t, n);
|
|
573
573
|
});
|
|
574
574
|
});
|
|
575
575
|
}, PSD: { get: function() {
|
|
@@ -577,38 +577,38 @@ var Mr = { exports: {} };
|
|
|
577
577
|
}, set: function(e) {
|
|
578
578
|
return G = e;
|
|
579
579
|
} }, totalEchoes: { get: function() {
|
|
580
|
-
return
|
|
580
|
+
return Rt;
|
|
581
581
|
} }, newPSD: De, usePSD: Ge, scheduler: { get: function() {
|
|
582
582
|
return ut;
|
|
583
583
|
}, set: function(e) {
|
|
584
584
|
ut = e;
|
|
585
585
|
} }, rejectionMapper: { get: function() {
|
|
586
|
-
return
|
|
586
|
+
return cn;
|
|
587
587
|
}, set: function(e) {
|
|
588
|
-
|
|
588
|
+
cn = e;
|
|
589
589
|
} }, follow: function(e, t) {
|
|
590
|
-
return new
|
|
590
|
+
return new N(function(n, i) {
|
|
591
591
|
return De(function(a, o) {
|
|
592
592
|
var c = G;
|
|
593
593
|
c.unhandleds = [], c.onunhandled = o, c.finalize = Ke(function() {
|
|
594
594
|
var u, h = this;
|
|
595
595
|
u = function() {
|
|
596
596
|
h.unhandleds.length === 0 ? a() : o(h.unhandleds[0]);
|
|
597
|
-
},
|
|
598
|
-
u(),
|
|
597
|
+
}, Dt.push(function g() {
|
|
598
|
+
u(), Dt.splice(Dt.indexOf(g), 1);
|
|
599
599
|
}), ++Le, ut(function() {
|
|
600
|
-
--Le == 0 &&
|
|
600
|
+
--Le == 0 && fn();
|
|
601
601
|
}, []);
|
|
602
602
|
}, c.finalize), e();
|
|
603
603
|
}, t, n, i);
|
|
604
604
|
});
|
|
605
|
-
} }), Ne && (Ne.allSettled && ke(
|
|
606
|
-
var e = we.apply(null, arguments).map(
|
|
607
|
-
return new
|
|
605
|
+
} }), Ne && (Ne.allSettled && ke(N, "allSettled", function() {
|
|
606
|
+
var e = we.apply(null, arguments).map(Tt);
|
|
607
|
+
return new N(function(t) {
|
|
608
608
|
e.length === 0 && t([]);
|
|
609
609
|
var n = e.length, i = new Array(n);
|
|
610
610
|
e.forEach(function(a, o) {
|
|
611
|
-
return
|
|
611
|
+
return N.resolve(a).then(function(c) {
|
|
612
612
|
return i[o] = { status: "fulfilled", value: c };
|
|
613
613
|
}, function(c) {
|
|
614
614
|
return i[o] = { status: "rejected", reason: c };
|
|
@@ -617,24 +617,24 @@ var Mr = { exports: {} };
|
|
|
617
617
|
});
|
|
618
618
|
});
|
|
619
619
|
});
|
|
620
|
-
}), Ne.any && typeof AggregateError < "u" && ke(
|
|
621
|
-
var e = we.apply(null, arguments).map(
|
|
622
|
-
return new
|
|
620
|
+
}), Ne.any && typeof AggregateError < "u" && ke(N, "any", function() {
|
|
621
|
+
var e = we.apply(null, arguments).map(Tt);
|
|
622
|
+
return new N(function(t, n) {
|
|
623
623
|
e.length === 0 && n(new AggregateError([]));
|
|
624
624
|
var i = e.length, a = new Array(i);
|
|
625
625
|
e.forEach(function(o, c) {
|
|
626
|
-
return
|
|
626
|
+
return N.resolve(o).then(function(u) {
|
|
627
627
|
return t(u);
|
|
628
628
|
}, function(u) {
|
|
629
629
|
a[c] = u, --i || n(new AggregateError(a));
|
|
630
630
|
});
|
|
631
631
|
});
|
|
632
632
|
});
|
|
633
|
-
}), Ne.withResolvers && (
|
|
634
|
-
var ie = { awaits: 0, echoes: 0, id: 0 }, ni = 0,
|
|
633
|
+
}), Ne.withResolvers && (N.withResolvers = Ne.withResolvers));
|
|
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
636
|
var a = G, o = Object.create(a);
|
|
637
|
-
return o.parent = a, o.ref = 0, o.global = !1, o.id = ++ri, Ae.env, o.env =
|
|
637
|
+
return o.parent = a, o.ref = 0, o.global = !1, o.id = ++ri, Ae.env, o.env = on ? { 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(o, t), ++a.ref, o.finalize = function() {
|
|
638
638
|
--this.parent.ref || this.parent.finalize();
|
|
639
639
|
}, i = Ge(o, e, n, i), o.ref === 0 && o.finalize(), i;
|
|
640
640
|
}
|
|
@@ -644,26 +644,26 @@ var Mr = { exports: {} };
|
|
|
644
644
|
function Pe() {
|
|
645
645
|
return !!ie.awaits && (--ie.awaits == 0 && (ie.id = 0), ie.echoes = ie.awaits * er, !0);
|
|
646
646
|
}
|
|
647
|
-
function
|
|
647
|
+
function Tt(e) {
|
|
648
648
|
return ie.echoes && e && e.constructor === Ne ? (Ze(), e.then(function(t) {
|
|
649
649
|
return Pe(), t;
|
|
650
650
|
}, function(t) {
|
|
651
|
-
return Pe(),
|
|
651
|
+
return Pe(), te(t);
|
|
652
652
|
})) : e;
|
|
653
653
|
}
|
|
654
654
|
function ii() {
|
|
655
|
-
var e =
|
|
656
|
-
|
|
655
|
+
var e = It[It.length - 1];
|
|
656
|
+
It.pop(), Ie(e, !1);
|
|
657
657
|
}
|
|
658
658
|
function Ie(e, t) {
|
|
659
659
|
var n, i = G;
|
|
660
|
-
(t ? !ie.echoes ||
|
|
661
|
-
++
|
|
662
|
-
}).bind(null, e) : ii), e !== G && (G = e, i === Ae && (Ae.env = rr()),
|
|
660
|
+
(t ? !ie.echoes || Ct++ && e === G : !Ct || --Ct && e === G) || queueMicrotask(t ? (function(a) {
|
|
661
|
+
++Rt, ie.echoes && --ie.echoes != 0 || (ie.echoes = ie.awaits = ie.id = 0), It.push(G), Ie(a, !0);
|
|
662
|
+
}).bind(null, e) : ii), e !== G && (G = e, i === Ae && (Ae.env = rr()), on && (n = Ae.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
|
-
var e =
|
|
666
|
-
return
|
|
665
|
+
var e = D.Promise;
|
|
666
|
+
return on ? { 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
668
|
function Ge(e, t, n, i, a) {
|
|
669
669
|
var o = G;
|
|
@@ -684,18 +684,18 @@ var Mr = { exports: {} };
|
|
|
684
684
|
}
|
|
685
685
|
};
|
|
686
686
|
}
|
|
687
|
-
function
|
|
688
|
-
Promise === Ne && ie.echoes === 0 ?
|
|
687
|
+
function hn(e) {
|
|
688
|
+
Promise === Ne && ie.echoes === 0 ? Ct === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
689
689
|
}
|
|
690
|
-
("" +
|
|
691
|
-
var
|
|
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>.", ar = "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
697
|
var or = { type: 3, lower: -1 / 0, lowerOpen: !1, upper: [[]], upperOpen: !1 };
|
|
698
|
-
function
|
|
698
|
+
function jt(e) {
|
|
699
699
|
return typeof e != "string" || /\./.test(e) ? function(t) {
|
|
700
700
|
return t;
|
|
701
701
|
} : function(t) {
|
|
@@ -734,7 +734,7 @@ var Mr = { exports: {} };
|
|
|
734
734
|
}
|
|
735
735
|
function cr(e) {
|
|
736
736
|
var t = typeof e;
|
|
737
|
-
return t != "object" ? t : ArrayBuffer.isView(e) ? "binary" : (e =
|
|
737
|
+
return t != "object" ? t : ArrayBuffer.isView(e) ? "binary" : (e = en(e), e === "ArrayBuffer" ? "binary" : e);
|
|
738
738
|
}
|
|
739
739
|
function ur(e) {
|
|
740
740
|
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
@@ -755,9 +755,9 @@ var Mr = { exports: {} };
|
|
|
755
755
|
try {
|
|
756
756
|
m.create(), b._state.PR1398_maxLoop = 3;
|
|
757
757
|
} catch (v) {
|
|
758
|
-
return v.name ===
|
|
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
759
|
return g(b, d, w, p);
|
|
760
|
-
})) :
|
|
760
|
+
})) : te(v);
|
|
761
761
|
}
|
|
762
762
|
return m._promise(d, function(v, y) {
|
|
763
763
|
return De(function() {
|
|
@@ -773,9 +773,9 @@ var Mr = { exports: {} };
|
|
|
773
773
|
});
|
|
774
774
|
});
|
|
775
775
|
}
|
|
776
|
-
if (b._state.openComplete) return
|
|
776
|
+
if (b._state.openComplete) return te(new $.DatabaseClosed(b._state.dbOpenError));
|
|
777
777
|
if (!b._state.isBeingOpened) {
|
|
778
|
-
if (!b._state.autoOpen) return
|
|
778
|
+
if (!b._state.autoOpen) return te(new $.DatabaseClosed());
|
|
779
779
|
b.open().catch(X);
|
|
780
780
|
}
|
|
781
781
|
return b._state.dbReadyPromise.then(function() {
|
|
@@ -783,14 +783,14 @@ var Mr = { exports: {} };
|
|
|
783
783
|
});
|
|
784
784
|
}(this.db, e, [this.name], c);
|
|
785
785
|
return o && (h._consoleTask = o, h = h.catch(function(g) {
|
|
786
|
-
return console.trace(g),
|
|
786
|
+
return console.trace(g), te(g);
|
|
787
787
|
})), h;
|
|
788
788
|
} finally {
|
|
789
789
|
u && Ve();
|
|
790
790
|
}
|
|
791
791
|
}, V.prototype.get = function(e, t) {
|
|
792
792
|
var n = this;
|
|
793
|
-
return e && e.constructor === Object ? this.where(e).first(t) : e == null ?
|
|
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
794
|
return n.core.get({ trans: i, key: e }).then(function(a) {
|
|
795
795
|
return n.hook.reading.fire(a);
|
|
796
796
|
});
|
|
@@ -798,7 +798,7 @@ var Mr = { exports: {} };
|
|
|
798
798
|
}, V.prototype.where = function(e) {
|
|
799
799
|
if (typeof e == "string") return new this.db.WhereClause(this, e);
|
|
800
800
|
if (B(e)) return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
801
|
-
var t =
|
|
801
|
+
var t = R(e);
|
|
802
802
|
if (t.length === 1) return this.where(t[0]).equals(e[t[0]]);
|
|
803
803
|
var n = this.schema.indexes.concat(this.schema.primKey).filter(function(u) {
|
|
804
804
|
if (u.compound && t.every(function(g) {
|
|
@@ -867,7 +867,7 @@ var Mr = { exports: {} };
|
|
|
867
867
|
}, enumerable: !1, configurable: !0 }), a.prototype.table = function() {
|
|
868
868
|
return i;
|
|
869
869
|
}, e = a);
|
|
870
|
-
for (var o = /* @__PURE__ */ new Set(), c = e.prototype; c; c =
|
|
870
|
+
for (var o = /* @__PURE__ */ new Set(), c = e.prototype; c; c = ee(c)) Object.getOwnPropertyNames(c).forEach(function(h) {
|
|
871
871
|
return o.add(h);
|
|
872
872
|
});
|
|
873
873
|
function u(h) {
|
|
@@ -886,28 +886,28 @@ var Mr = { exports: {} };
|
|
|
886
886
|
});
|
|
887
887
|
}, V.prototype.add = function(e, t) {
|
|
888
888
|
var n = this, i = this.schema.primKey, a = i.auto, o = i.keyPath, c = e;
|
|
889
|
-
return o && a && (c =
|
|
889
|
+
return o && a && (c = jt(o)(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
|
-
return u.numFailures ?
|
|
892
|
+
return u.numFailures ? N.reject(u.failures[0]) : u.lastResult;
|
|
893
893
|
}).then(function(u) {
|
|
894
894
|
if (o) try {
|
|
895
|
-
|
|
895
|
+
le(e, o, u);
|
|
896
896
|
} catch {
|
|
897
897
|
}
|
|
898
898
|
return u;
|
|
899
899
|
});
|
|
900
900
|
}, V.prototype.update = function(e, t) {
|
|
901
|
-
return typeof e != "object" || B(e) ? this.where(":id").equals(e).modify(t) : (e = ve(e, this.schema.primKey.keyPath), e === void 0 ?
|
|
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
903
|
var n = this, i = this.schema.primKey, a = i.auto, o = i.keyPath, c = e;
|
|
904
|
-
return o && a && (c =
|
|
904
|
+
return o && a && (c = jt(o)(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
|
-
return u.numFailures ?
|
|
907
|
+
return u.numFailures ? N.reject(u.failures[0]) : u.lastResult;
|
|
908
908
|
}).then(function(u) {
|
|
909
909
|
if (o) try {
|
|
910
|
-
|
|
910
|
+
le(e, o, u);
|
|
911
911
|
} catch {
|
|
912
912
|
}
|
|
913
913
|
return u;
|
|
@@ -917,14 +917,14 @@ var Mr = { exports: {} };
|
|
|
917
917
|
return this._trans("readwrite", function(n) {
|
|
918
918
|
return t.core.mutate({ trans: n, type: "delete", keys: [e] });
|
|
919
919
|
}).then(function(n) {
|
|
920
|
-
return n.numFailures ?
|
|
920
|
+
return n.numFailures ? N.reject(n.failures[0]) : void 0;
|
|
921
921
|
});
|
|
922
922
|
}, V.prototype.clear = function() {
|
|
923
923
|
var e = this;
|
|
924
924
|
return this._trans("readwrite", function(t) {
|
|
925
925
|
return e.core.mutate({ trans: t, type: "deleteRange", range: or });
|
|
926
926
|
}).then(function(t) {
|
|
927
|
-
return t.numFailures ?
|
|
927
|
+
return t.numFailures ? N.reject(t.failures[0]) : void 0;
|
|
928
928
|
});
|
|
929
929
|
}, V.prototype.bulkGet = function(e) {
|
|
930
930
|
var t = this;
|
|
@@ -941,7 +941,7 @@ var Mr = { exports: {} };
|
|
|
941
941
|
var g = i.schema.primKey, u = g.auto, g = g.keyPath;
|
|
942
942
|
if (g && a) throw new $.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
943
943
|
if (a && a.length !== e.length) throw new $.InvalidArgument("Arguments objects and keys must have the same length");
|
|
944
|
-
var h = e.length, g = g && u ? e.map(
|
|
944
|
+
var h = e.length, g = g && u ? e.map(jt(g)) : e;
|
|
945
945
|
return i.core.mutate({ trans: c, type: "add", keys: a, values: g, wantResults: o }).then(function(m) {
|
|
946
946
|
var d = m.numFailures, w = m.results, p = m.lastResult, m = m.failures;
|
|
947
947
|
if (d === 0) return o ? w : p;
|
|
@@ -954,7 +954,7 @@ var Mr = { exports: {} };
|
|
|
954
954
|
var g = i.schema.primKey, u = g.auto, g = g.keyPath;
|
|
955
955
|
if (g && a) throw new $.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
956
956
|
if (a && a.length !== e.length) throw new $.InvalidArgument("Arguments objects and keys must have the same length");
|
|
957
|
-
var h = e.length, g = g && u ? e.map(
|
|
957
|
+
var h = e.length, g = g && u ? e.map(jt(g)) : e;
|
|
958
958
|
return i.core.mutate({ trans: c, type: "put", keys: a, values: g, wantResults: o }).then(function(m) {
|
|
959
959
|
var d = m.numFailures, w = m.results, p = m.lastResult, m = m.failures;
|
|
960
960
|
if (d === 0) return o ? w : p;
|
|
@@ -977,7 +977,7 @@ var Mr = { exports: {} };
|
|
|
977
977
|
var E = S[y], O = m[E];
|
|
978
978
|
if (E === t.schema.primKey.keyPath) {
|
|
979
979
|
if (H(O, p) !== 0) throw new $.Constraint("Cannot update primary key in bulkUpdate()");
|
|
980
|
-
} else
|
|
980
|
+
} else le(v, E, O);
|
|
981
981
|
}
|
|
982
982
|
o.push(w), h.push(p), g.push(v);
|
|
983
983
|
}
|
|
@@ -1031,7 +1031,7 @@ var Mr = { exports: {} };
|
|
|
1031
1031
|
} };
|
|
1032
1032
|
return n[c] = t[c] = b;
|
|
1033
1033
|
}
|
|
1034
|
-
|
|
1034
|
+
R(g = c).forEach(function(d) {
|
|
1035
1035
|
var w = g[d];
|
|
1036
1036
|
if (B(w)) o(d, g[d][0], g[d][1]);
|
|
1037
1037
|
else {
|
|
@@ -1054,26 +1054,26 @@ var Mr = { exports: {} };
|
|
|
1054
1054
|
function et(e, t) {
|
|
1055
1055
|
return !(e.filter || e.algorithm || e.or) && (t ? e.justLimit : !e.replayFilter);
|
|
1056
1056
|
}
|
|
1057
|
-
function
|
|
1057
|
+
function yn(e, t) {
|
|
1058
1058
|
e.filter = Fe(e.filter, t);
|
|
1059
1059
|
}
|
|
1060
|
-
function
|
|
1060
|
+
function mn(e, t, n) {
|
|
1061
1061
|
var i = e.replayFilter;
|
|
1062
1062
|
e.replayFilter = i ? function() {
|
|
1063
1063
|
return Fe(i(), t());
|
|
1064
1064
|
} : t, e.justLimit = n && !i;
|
|
1065
1065
|
}
|
|
1066
|
-
function
|
|
1066
|
+
function Kt(e, t) {
|
|
1067
1067
|
if (e.isPrimKey) return t.primaryKey;
|
|
1068
1068
|
var n = t.getIndexByKeyPath(e.index);
|
|
1069
1069
|
if (!n) throw new $.Schema("KeyPath " + e.index + " on object store " + t.name + " is not indexed");
|
|
1070
1070
|
return n;
|
|
1071
1071
|
}
|
|
1072
1072
|
function dr(e, t, n) {
|
|
1073
|
-
var i =
|
|
1073
|
+
var i = Kt(e, t.schema);
|
|
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
|
-
function
|
|
1076
|
+
function Nt(e, t, n, i) {
|
|
1077
1077
|
var a = e.replayFilter ? Fe(e.filter, e.replayFilter()) : e.filter;
|
|
1078
1078
|
if (e.or) {
|
|
1079
1079
|
var o = {}, c = function(u, h, g) {
|
|
@@ -1082,14 +1082,14 @@ var Mr = { exports: {} };
|
|
|
1082
1082
|
return h.stop(w);
|
|
1083
1083
|
}, function(w) {
|
|
1084
1084
|
return h.fail(w);
|
|
1085
|
-
}) || ((d = "" + (b = h.primaryKey)) == "[object ArrayBuffer]" && (d = "" + new Uint8Array(b)),
|
|
1085
|
+
}) || ((d = "" + (b = h.primaryKey)) == "[object ArrayBuffer]" && (d = "" + new Uint8Array(b)), Z(o, d) || (o[d] = !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
1089
|
return fr(dr(e, i, n), Fe(e.algorithm, a), t, !e.keysOnly && e.valueMapper);
|
|
1090
1090
|
}
|
|
1091
1091
|
function fr(e, t, n, i) {
|
|
1092
|
-
var a =
|
|
1092
|
+
var a = q(i ? function(o, c, u) {
|
|
1093
1093
|
return n(i(o), c, u);
|
|
1094
1094
|
} : n);
|
|
1095
1095
|
return e.then(function(o) {
|
|
@@ -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 k(k([], 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;
|
|
@@ -1141,15 +1141,15 @@ var Mr = { exports: {} };
|
|
|
1141
1141
|
}
|
|
1142
1142
|
var ai = (Y.prototype._read = function(e, t) {
|
|
1143
1143
|
var n = this._ctx;
|
|
1144
|
-
return n.error ? n.table._trans(null,
|
|
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) {
|
|
1146
1146
|
var t = this._ctx;
|
|
1147
|
-
return t.error ? t.table._trans(null,
|
|
1147
|
+
return t.error ? t.table._trans(null, te.bind(null, t.error)) : t.table._trans("readwrite", e, "locked");
|
|
1148
1148
|
}, Y.prototype._addAlgorithm = function(e) {
|
|
1149
1149
|
var t = this._ctx;
|
|
1150
1150
|
t.algorithm = Fe(t.algorithm, e);
|
|
1151
1151
|
}, Y.prototype._iterate = function(e, t) {
|
|
1152
|
-
return
|
|
1152
|
+
return Nt(this._ctx, e, t, this._ctx.table.core);
|
|
1153
1153
|
}, Y.prototype.clone = function(e) {
|
|
1154
1154
|
var t = Object.create(this.constructor.prototype), n = Object.create(this._ctx);
|
|
1155
1155
|
return e && Q(n, e), t._ctx = n, t;
|
|
@@ -1158,17 +1158,17 @@ var Mr = { exports: {} };
|
|
|
1158
1158
|
}, Y.prototype.each = function(e) {
|
|
1159
1159
|
var t = this._ctx;
|
|
1160
1160
|
return this._read(function(n) {
|
|
1161
|
-
return
|
|
1161
|
+
return Nt(t, e, n, t.table.core);
|
|
1162
1162
|
});
|
|
1163
1163
|
}, Y.prototype.count = function(e) {
|
|
1164
1164
|
var t = this;
|
|
1165
1165
|
return this._read(function(n) {
|
|
1166
1166
|
var i = t._ctx, a = i.table.core;
|
|
1167
|
-
if (et(i, !0)) return a.count({ trans: n, query: { index:
|
|
1167
|
+
if (et(i, !0)) return a.count({ trans: n, query: { index: Kt(i, a.schema), range: i.range } }).then(function(c) {
|
|
1168
1168
|
return Math.min(c, i.limit);
|
|
1169
1169
|
});
|
|
1170
1170
|
var o = 0;
|
|
1171
|
-
return
|
|
1171
|
+
return Nt(i, function() {
|
|
1172
1172
|
return ++o, !1;
|
|
1173
1173
|
}, n, a).then(function() {
|
|
1174
1174
|
return o;
|
|
@@ -1191,13 +1191,13 @@ 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 a = i.valueMapper, o =
|
|
1194
|
+
var a = i.valueMapper, o = Kt(i, i.table.core.schema);
|
|
1195
1195
|
return i.table.core.query({ trans: n, limit: i.limit, values: !0, query: { index: o, range: i.range } }).then(function(u) {
|
|
1196
1196
|
return u = u.result, a ? u.map(a) : u;
|
|
1197
1197
|
});
|
|
1198
1198
|
}
|
|
1199
1199
|
var c = [];
|
|
1200
|
-
return
|
|
1200
|
+
return Nt(i, function(u) {
|
|
1201
1201
|
return c.push(u);
|
|
1202
1202
|
}, n, i.table.core).then(function() {
|
|
1203
1203
|
return c;
|
|
@@ -1205,28 +1205,28 @@ var Mr = { exports: {} };
|
|
|
1205
1205
|
}, e);
|
|
1206
1206
|
}, Y.prototype.offset = function(e) {
|
|
1207
1207
|
var t = this._ctx;
|
|
1208
|
-
return e <= 0 || (t.offset += e, et(t) ?
|
|
1208
|
+
return e <= 0 || (t.offset += e, et(t) ? mn(t, function() {
|
|
1209
1209
|
var n = e;
|
|
1210
1210
|
return function(i, a) {
|
|
1211
1211
|
return n === 0 || (n === 1 ? --n : a(function() {
|
|
1212
1212
|
i.advance(n), n = 0;
|
|
1213
1213
|
}), !1);
|
|
1214
1214
|
};
|
|
1215
|
-
}) :
|
|
1215
|
+
}) : mn(t, function() {
|
|
1216
1216
|
var n = e;
|
|
1217
1217
|
return function() {
|
|
1218
1218
|
return --n < 0;
|
|
1219
1219
|
};
|
|
1220
1220
|
})), this;
|
|
1221
1221
|
}, Y.prototype.limit = function(e) {
|
|
1222
|
-
return this._ctx.limit = Math.min(this._ctx.limit, e),
|
|
1222
|
+
return this._ctx.limit = Math.min(this._ctx.limit, e), mn(this._ctx, function() {
|
|
1223
1223
|
var t = e;
|
|
1224
1224
|
return function(n, i, a) {
|
|
1225
1225
|
return --t <= 0 && i(a), 0 <= t;
|
|
1226
1226
|
};
|
|
1227
1227
|
}, !0), this;
|
|
1228
1228
|
}, Y.prototype.until = function(e, t) {
|
|
1229
|
-
return
|
|
1229
|
+
return yn(this._ctx, function(n, i, a) {
|
|
1230
1230
|
return !e(n.value) || (i(a), t);
|
|
1231
1231
|
}), this;
|
|
1232
1232
|
}, Y.prototype.first = function(e) {
|
|
@@ -1237,7 +1237,7 @@ var Mr = { exports: {} };
|
|
|
1237
1237
|
return this.reverse().first(e);
|
|
1238
1238
|
}, Y.prototype.filter = function(e) {
|
|
1239
1239
|
var t;
|
|
1240
|
-
return
|
|
1240
|
+
return yn(this._ctx, function(n) {
|
|
1241
1241
|
return e(n.value);
|
|
1242
1242
|
}), (t = this._ctx).isMatch = Fe(t.isMatch, e), this;
|
|
1243
1243
|
}, Y.prototype.and = function(e) {
|
|
@@ -1272,7 +1272,7 @@ var Mr = { exports: {} };
|
|
|
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 a =
|
|
1275
|
+
var a = Kt(t, t.table.core.schema);
|
|
1276
1276
|
return t.table.core.query({ trans: i, values: !1, limit: t.limit, query: { index: a, range: t.range } });
|
|
1277
1277
|
}).then(function(i) {
|
|
1278
1278
|
return i.result;
|
|
@@ -1296,18 +1296,18 @@ 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
|
|
1300
|
-
var i = a.primaryKey.toString(), a =
|
|
1299
|
+
return yn(this._ctx, function(a) {
|
|
1300
|
+
var i = a.primaryKey.toString(), a = Z(t, i);
|
|
1301
1301
|
return t[i] = !0, !a;
|
|
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
1306
|
var a, o, c;
|
|
1307
|
-
c = typeof e == "function" ? e : (a =
|
|
1307
|
+
c = typeof e == "function" ? e : (a = R(e), o = a.length, function(y) {
|
|
1308
1308
|
for (var S = !1, E = 0; E < o; ++E) {
|
|
1309
1309
|
var O = a[E], x = e[O], P = ve(y, O);
|
|
1310
|
-
x instanceof ht ? (
|
|
1310
|
+
x instanceof ht ? (le(y, O, x.execute(P)), S = !0) : P !== x && (le(y, O, x), S = !0);
|
|
1311
1311
|
}
|
|
1312
1312
|
return S;
|
|
1313
1313
|
});
|
|
@@ -1316,9 +1316,9 @@ var Mr = { exports: {} };
|
|
|
1316
1316
|
function w(y, O) {
|
|
1317
1317
|
var E = O.failures, O = O.numFailures;
|
|
1318
1318
|
m += y - O;
|
|
1319
|
-
for (var x = 0, P =
|
|
1320
|
-
var
|
|
1321
|
-
p.push(E[
|
|
1319
|
+
for (var x = 0, P = R(E); x < P.length; x++) {
|
|
1320
|
+
var M = P[x];
|
|
1321
|
+
p.push(E[M]);
|
|
1322
1322
|
}
|
|
1323
1323
|
}
|
|
1324
1324
|
var p = [], m = 0, v = [];
|
|
@@ -1326,29 +1326,29 @@ var Mr = { exports: {} };
|
|
|
1326
1326
|
function S(O) {
|
|
1327
1327
|
var x = Math.min(b, y.length - O);
|
|
1328
1328
|
return u.getMany({ trans: i, keys: y.slice(O, O + x), cache: "immutable" }).then(function(P) {
|
|
1329
|
-
for (var
|
|
1330
|
-
var L = P[
|
|
1331
|
-
c.call(U, U.value, U) !== !1 && (U.value == null ?
|
|
1329
|
+
for (var M = [], I = [], C = h ? [] : null, j = [], T = 0; T < x; ++T) {
|
|
1330
|
+
var L = P[T], U = { value: Me(L), primKey: y[O + T] };
|
|
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
|
}
|
|
1333
|
-
return Promise.resolve(0 <
|
|
1334
|
-
for (var z in W.failures)
|
|
1335
|
-
w(
|
|
1333
|
+
return Promise.resolve(0 < M.length && u.mutate({ trans: i, type: "add", values: M }).then(function(W) {
|
|
1334
|
+
for (var z in W.failures) j.splice(parseInt(z), 1);
|
|
1335
|
+
w(M.length, W);
|
|
1336
1336
|
})).then(function() {
|
|
1337
1337
|
return (0 < I.length || E && typeof e == "object") && u.mutate({ trans: i, type: "put", keys: C, values: I, criteria: E, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < O }).then(function(W) {
|
|
1338
1338
|
return w(I.length, W);
|
|
1339
1339
|
});
|
|
1340
1340
|
}).then(function() {
|
|
1341
|
-
return (0 <
|
|
1342
|
-
return w(
|
|
1341
|
+
return (0 < j.length || E && e === bn) && u.mutate({ trans: i, type: "delete", keys: j, criteria: E, isAdditionalChunk: 0 < O }).then(function(W) {
|
|
1342
|
+
return w(j.length, W);
|
|
1343
1343
|
});
|
|
1344
1344
|
}).then(function() {
|
|
1345
1345
|
return y.length > O + x && S(O + b);
|
|
1346
1346
|
});
|
|
1347
1347
|
});
|
|
1348
1348
|
}
|
|
1349
|
-
var E = et(n) && n.limit === 1 / 0 && (typeof e != "function" || e ===
|
|
1349
|
+
var E = et(n) && n.limit === 1 / 0 && (typeof e != "function" || e === bn) && { index: n.index, range: n.range };
|
|
1350
1350
|
return S(0).then(function() {
|
|
1351
|
-
if (0 < p.length) throw new
|
|
1351
|
+
if (0 < p.length) throw new Ot("Error modifying one or more objects", p, m, v);
|
|
1352
1352
|
return y.length;
|
|
1353
1353
|
});
|
|
1354
1354
|
});
|
|
@@ -1360,17 +1360,17 @@ var Mr = { exports: {} };
|
|
|
1360
1360
|
return e.table.core.count({ trans: n, query: { index: i, range: a } }).then(function(o) {
|
|
1361
1361
|
return e.table.core.mutate({ trans: n, type: "deleteRange", range: a }).then(function(c) {
|
|
1362
1362
|
var u = c.failures;
|
|
1363
|
-
if (c.lastResult, c.results, c = c.numFailures, c) throw new
|
|
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
1365
|
}), o - c);
|
|
1366
1366
|
return o - c;
|
|
1367
1367
|
});
|
|
1368
1368
|
});
|
|
1369
|
-
}) : this.modify(
|
|
1369
|
+
}) : this.modify(bn);
|
|
1370
1370
|
}, Y);
|
|
1371
1371
|
function Y() {
|
|
1372
1372
|
}
|
|
1373
|
-
var
|
|
1373
|
+
var bn = function(e, t) {
|
|
1374
1374
|
return t.value = null;
|
|
1375
1375
|
};
|
|
1376
1376
|
function oi(e, t) {
|
|
@@ -1379,7 +1379,7 @@ var Mr = { exports: {} };
|
|
|
1379
1379
|
function si(e, t) {
|
|
1380
1380
|
return t < e ? -1 : e === t ? 0 : 1;
|
|
1381
1381
|
}
|
|
1382
|
-
function
|
|
1382
|
+
function de(e, t, n) {
|
|
1383
1383
|
return e = e instanceof gr ? new e.Collection(e) : e, e._ctx.error = new (n || TypeError)(t), e;
|
|
1384
1384
|
}
|
|
1385
1385
|
function tt(e) {
|
|
@@ -1387,11 +1387,11 @@ var Mr = { exports: {} };
|
|
|
1387
1387
|
return pr("");
|
|
1388
1388
|
}).limit(0);
|
|
1389
1389
|
}
|
|
1390
|
-
function
|
|
1390
|
+
function Bt(e, t, n, i) {
|
|
1391
1391
|
var a, o, c, u, h, g, b, d = n.length;
|
|
1392
1392
|
if (!n.every(function(m) {
|
|
1393
1393
|
return typeof m == "string";
|
|
1394
|
-
})) return
|
|
1394
|
+
})) return de(e, ar);
|
|
1395
1395
|
function w(m) {
|
|
1396
1396
|
a = m === "next" ? function(y) {
|
|
1397
1397
|
return y.toUpperCase();
|
|
@@ -1425,13 +1425,13 @@ var Mr = { exports: {} };
|
|
|
1425
1425
|
var E = o(S);
|
|
1426
1426
|
if (t(E, h, p)) return !0;
|
|
1427
1427
|
for (var O = null, x = p; x < d; ++x) {
|
|
1428
|
-
var P = function(
|
|
1429
|
-
for (var U = Math.min(
|
|
1430
|
-
var
|
|
1431
|
-
if (
|
|
1432
|
-
|
|
1428
|
+
var P = function(M, I, C, j, T, L) {
|
|
1429
|
+
for (var U = Math.min(M.length, j.length), W = -1, z = 0; z < U; ++z) {
|
|
1430
|
+
var fe = I[z];
|
|
1431
|
+
if (fe !== j[z]) return T(M[z], C[z]) < 0 ? M.substr(0, z) + C[z] + C.substr(z + 1) : T(M[z], j[z]) < 0 ? M.substr(0, z) + j[z] + C.substr(z + 1) : 0 <= W ? M.substr(0, W) + I[W] + C.substr(W + 1) : null;
|
|
1432
|
+
T(M[z], fe) < 0 && (W = z);
|
|
1433
1433
|
}
|
|
1434
|
-
return U <
|
|
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
1435
|
}(S, E, u[x], h[x], c, g);
|
|
1436
1436
|
P === null && O === null ? p = x + 1 : (O === null || 0 < c(O, P)) && (O = P);
|
|
1437
1437
|
}
|
|
@@ -1455,46 +1455,46 @@ var Mr = { exports: {} };
|
|
|
1455
1455
|
return Ce(e, t, !n, !i);
|
|
1456
1456
|
});
|
|
1457
1457
|
} catch {
|
|
1458
|
-
return
|
|
1458
|
+
return de(this, _e);
|
|
1459
1459
|
}
|
|
1460
1460
|
}, ae.prototype.equals = function(e) {
|
|
1461
|
-
return e == null ?
|
|
1461
|
+
return e == null ? de(this, _e) : new this.Collection(this, function() {
|
|
1462
1462
|
return pr(e);
|
|
1463
1463
|
});
|
|
1464
1464
|
}, ae.prototype.above = function(e) {
|
|
1465
|
-
return e == null ?
|
|
1465
|
+
return e == null ? de(this, _e) : new this.Collection(this, function() {
|
|
1466
1466
|
return Ce(e, void 0, !0);
|
|
1467
1467
|
});
|
|
1468
1468
|
}, ae.prototype.aboveOrEqual = function(e) {
|
|
1469
|
-
return e == null ?
|
|
1469
|
+
return e == null ? de(this, _e) : new this.Collection(this, function() {
|
|
1470
1470
|
return Ce(e, void 0, !1);
|
|
1471
1471
|
});
|
|
1472
1472
|
}, ae.prototype.below = function(e) {
|
|
1473
|
-
return e == null ?
|
|
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
|
}, ae.prototype.belowOrEqual = function(e) {
|
|
1477
|
-
return e == null ?
|
|
1477
|
+
return e == null ? de(this, _e) : new this.Collection(this, function() {
|
|
1478
1478
|
return Ce(void 0, e);
|
|
1479
1479
|
});
|
|
1480
1480
|
}, ae.prototype.startsWith = function(e) {
|
|
1481
|
-
return typeof e != "string" ?
|
|
1481
|
+
return typeof e != "string" ? de(this, ar) : this.between(e, e + $e, !0, !0);
|
|
1482
1482
|
}, ae.prototype.startsWithIgnoreCase = function(e) {
|
|
1483
|
-
return e === "" ? this.startsWith(e) :
|
|
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
|
}, ae.prototype.equalsIgnoreCase = function(e) {
|
|
1487
|
-
return
|
|
1487
|
+
return Bt(this, function(t, n) {
|
|
1488
1488
|
return t === n[0];
|
|
1489
1489
|
}, [e], "");
|
|
1490
1490
|
}, ae.prototype.anyOfIgnoreCase = function() {
|
|
1491
1491
|
var e = we.apply(Ye, arguments);
|
|
1492
|
-
return e.length === 0 ? tt(this) :
|
|
1492
|
+
return e.length === 0 ? tt(this) : Bt(this, function(t, n) {
|
|
1493
1493
|
return n.indexOf(t) !== -1;
|
|
1494
1494
|
}, e, "");
|
|
1495
1495
|
}, ae.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
1496
1496
|
var e = we.apply(Ye, arguments);
|
|
1497
|
-
return e.length === 0 ? tt(this) :
|
|
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
|
});
|
|
@@ -1504,7 +1504,7 @@ var Mr = { exports: {} };
|
|
|
1504
1504
|
try {
|
|
1505
1505
|
t.sort(n);
|
|
1506
1506
|
} catch {
|
|
1507
|
-
return
|
|
1507
|
+
return de(this, _e);
|
|
1508
1508
|
}
|
|
1509
1509
|
if (t.length === 0) return tt(this);
|
|
1510
1510
|
var i = new this.Collection(this, function() {
|
|
@@ -1528,7 +1528,7 @@ var Mr = { exports: {} };
|
|
|
1528
1528
|
try {
|
|
1529
1529
|
e.sort(this._ascending);
|
|
1530
1530
|
} catch {
|
|
1531
|
-
return
|
|
1531
|
+
return de(this, _e);
|
|
1532
1532
|
}
|
|
1533
1533
|
var t = e.reduce(function(n, i) {
|
|
1534
1534
|
return n ? n.concat([[n[n.length - 1][1], i]]) : [[-1 / 0, i]];
|
|
@@ -1539,7 +1539,7 @@ var Mr = { exports: {} };
|
|
|
1539
1539
|
if (S.length === 0) return tt(this);
|
|
1540
1540
|
if (!S.every(function(E) {
|
|
1541
1541
|
return E[0] !== void 0 && E[1] !== void 0 && a(E[0], E[1]) <= 0;
|
|
1542
|
-
})) return
|
|
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
1543
|
var h = !t || t.includeLowers !== !1, g = t && t.includeUppers === !0, b, d = a;
|
|
1544
1544
|
function w(E, O) {
|
|
1545
1545
|
return d(E[0], O[0]);
|
|
@@ -1547,16 +1547,16 @@ var Mr = { exports: {} };
|
|
|
1547
1547
|
try {
|
|
1548
1548
|
(b = S.reduce(function(E, O) {
|
|
1549
1549
|
for (var x = 0, P = E.length; x < P; ++x) {
|
|
1550
|
-
var
|
|
1551
|
-
if (i(O[0],
|
|
1552
|
-
|
|
1550
|
+
var M = E[x];
|
|
1551
|
+
if (i(O[0], M[1]) < 0 && 0 < i(O[1], M[0])) {
|
|
1552
|
+
M[0] = c(M[0], O[0]), M[1] = u(M[1], O[1]);
|
|
1553
1553
|
break;
|
|
1554
1554
|
}
|
|
1555
1555
|
}
|
|
1556
1556
|
return x === P && E.push(O), E;
|
|
1557
1557
|
}, [])).sort(w);
|
|
1558
1558
|
} catch {
|
|
1559
|
-
return
|
|
1559
|
+
return de(this, _e);
|
|
1560
1560
|
}
|
|
1561
1561
|
var p = 0, m = g ? function(E) {
|
|
1562
1562
|
return 0 < a(E, b[p][1]);
|
|
@@ -1572,8 +1572,8 @@ var Mr = { exports: {} };
|
|
|
1572
1572
|
return S._ondirectionchange = function(E) {
|
|
1573
1573
|
d = E === "next" ? (y = m, a) : (y = v, o), b.sort(w);
|
|
1574
1574
|
}, S._addAlgorithm(function(E, O, x) {
|
|
1575
|
-
for (var P,
|
|
1576
|
-
return !m(P =
|
|
1575
|
+
for (var P, M = E.key; y(M); ) if (++p === b.length) return O(x), !1;
|
|
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
|
d === a ? E.continue(b[p][0]) : E.continue(b[p][1]);
|
|
1578
1578
|
}), !1);
|
|
1579
1579
|
}), S;
|
|
@@ -1583,19 +1583,19 @@ var Mr = { exports: {} };
|
|
|
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
1587
|
}, ae);
|
|
1588
1588
|
function ae() {
|
|
1589
1589
|
}
|
|
1590
1590
|
function me(e) {
|
|
1591
|
-
return
|
|
1591
|
+
return q(function(t) {
|
|
1592
1592
|
return pt(t), e(t.target.error), !1;
|
|
1593
1593
|
});
|
|
1594
1594
|
}
|
|
1595
1595
|
function pt(e) {
|
|
1596
1596
|
e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
|
|
1597
1597
|
}
|
|
1598
|
-
var gt = "storagemutated",
|
|
1598
|
+
var gt = "storagemutated", vn = "x-storagemutated-1", Re = dt(null, gt), ci = (be.prototype._lock = function() {
|
|
1599
1599
|
return it(!G.global), ++this._reculock, this._reculock !== 1 || G.global || (G.lockOwnerFor = this), this;
|
|
1600
1600
|
}, be.prototype._unlock = function() {
|
|
1601
1601
|
if (it(!G.global), --this._reculock == 0) for (G.global || (G.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked(); ) {
|
|
@@ -1621,24 +1621,24 @@ 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 =
|
|
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(a) {
|
|
1625
1625
|
pt(a), t._reject(e.error);
|
|
1626
|
-
}), e.onabort =
|
|
1626
|
+
}), e.onabort = q(function(a) {
|
|
1627
1627
|
pt(a), t.active && t._reject(new $.Abort(e.error)), t.active = !1, t.on("abort").fire(a);
|
|
1628
|
-
}), e.oncomplete =
|
|
1628
|
+
}), e.oncomplete = q(function() {
|
|
1629
1629
|
t.active = !1, t._resolve(), "mutatedParts" in e && Re.storagemutated.fire(e.mutatedParts);
|
|
1630
1630
|
}), this;
|
|
1631
1631
|
}, be.prototype._promise = function(e, t, n) {
|
|
1632
1632
|
var i = this;
|
|
1633
|
-
if (e === "readwrite" && this.mode !== "readwrite") return
|
|
1634
|
-
if (!this.active) return
|
|
1635
|
-
if (this._locked()) return new
|
|
1633
|
+
if (e === "readwrite" && this.mode !== "readwrite") return te(new $.ReadOnly("Transaction is readonly"));
|
|
1634
|
+
if (!this.active) return te(new $.TransactionInactive());
|
|
1635
|
+
if (this._locked()) return new N(function(o, c) {
|
|
1636
1636
|
i._blockedFuncs.push([function() {
|
|
1637
1637
|
i._promise(e, t, n).then(o, c);
|
|
1638
1638
|
}, G]);
|
|
1639
1639
|
});
|
|
1640
1640
|
if (n) return De(function() {
|
|
1641
|
-
var o = new
|
|
1641
|
+
var o = 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);
|
|
@@ -1647,7 +1647,7 @@ var Mr = { exports: {} };
|
|
|
1647
1647
|
return i._unlock();
|
|
1648
1648
|
}), o._lib = !0, o;
|
|
1649
1649
|
});
|
|
1650
|
-
var a = new
|
|
1650
|
+
var a = new N(function(o, c) {
|
|
1651
1651
|
var u = t(o, c, i);
|
|
1652
1652
|
u && u.then && u.then(o, c);
|
|
1653
1653
|
});
|
|
@@ -1655,7 +1655,7 @@ var Mr = { exports: {} };
|
|
|
1655
1655
|
}, be.prototype._root = function() {
|
|
1656
1656
|
return this.parent ? this.parent._root() : this;
|
|
1657
1657
|
}, be.prototype.waitFor = function(e) {
|
|
1658
|
-
var t, n = this._root(), i =
|
|
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
1661
|
}) : (n._waitingFor = i, n._waitingQueue = [], t = n.idbtrans.objectStore(n.storeNames[0]), function o() {
|
|
@@ -1663,11 +1663,11 @@ var Mr = { exports: {} };
|
|
|
1663
1663
|
n._waitingFor && (t.get(-1 / 0).onsuccess = o);
|
|
1664
1664
|
}());
|
|
1665
1665
|
var a = n._waitingFor;
|
|
1666
|
-
return new
|
|
1666
|
+
return new N(function(o, c) {
|
|
1667
1667
|
i.then(function(u) {
|
|
1668
|
-
return n._waitingQueue.push(
|
|
1668
|
+
return n._waitingQueue.push(q(o.bind(null, u)));
|
|
1669
1669
|
}, function(u) {
|
|
1670
|
-
return n._waitingQueue.push(
|
|
1670
|
+
return n._waitingQueue.push(q(c.bind(null, u)));
|
|
1671
1671
|
}).finally(function() {
|
|
1672
1672
|
n._waitingFor === a && (n._waitingFor = null);
|
|
1673
1673
|
});
|
|
@@ -1676,20 +1676,20 @@ var Mr = { exports: {} };
|
|
|
1676
1676
|
this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new $.Abort()));
|
|
1677
1677
|
}, be.prototype.table = function(e) {
|
|
1678
1678
|
var t = this._memoizedTables || (this._memoizedTables = {});
|
|
1679
|
-
if (
|
|
1679
|
+
if (Z(t, e)) return t[e];
|
|
1680
1680
|
var n = this.schema[e];
|
|
1681
1681
|
if (!n) throw new $.NotFound("Table " + e + " not part of transaction");
|
|
1682
1682
|
return n = new this.db.Table(e, n, this), n.core = this.db.core.table(e), t[e] = n;
|
|
1683
1683
|
}, be);
|
|
1684
1684
|
function be() {
|
|
1685
1685
|
}
|
|
1686
|
-
function
|
|
1686
|
+
function wn(e, t, n, i, a, o, c) {
|
|
1687
1687
|
return { name: e, keyPath: t, unique: n, multi: i, auto: a, compound: o, src: (n && !c ? "&" : "") + (i ? "*" : "") + (a ? "++" : "") + yr(t) };
|
|
1688
1688
|
}
|
|
1689
1689
|
function yr(e) {
|
|
1690
1690
|
return typeof e == "string" ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
|
|
1691
1691
|
}
|
|
1692
|
-
function
|
|
1692
|
+
function _n(e, t, n) {
|
|
1693
1693
|
return { name: e, primKey: t, indexes: n, mappedClass: null, idxByName: (i = function(a) {
|
|
1694
1694
|
return [a.name, a];
|
|
1695
1695
|
}, n.reduce(function(a, o, c) {
|
|
@@ -1708,7 +1708,7 @@ var Mr = { exports: {} };
|
|
|
1708
1708
|
}, $e;
|
|
1709
1709
|
}
|
|
1710
1710
|
};
|
|
1711
|
-
function
|
|
1711
|
+
function Sn(e) {
|
|
1712
1712
|
return e == null ? function() {
|
|
1713
1713
|
} : typeof e == "string" ? (t = e).split(".").length === 1 ? function(n) {
|
|
1714
1714
|
return n[t];
|
|
@@ -1737,49 +1737,49 @@ var Mr = { exports: {} };
|
|
|
1737
1737
|
var p, m = w.name;
|
|
1738
1738
|
return { name: m, schema: w, mutate: function(v) {
|
|
1739
1739
|
var y = v.trans, S = v.type, E = v.keys, O = v.values, x = v.range;
|
|
1740
|
-
return new Promise(function(P,
|
|
1741
|
-
P =
|
|
1742
|
-
var I = y.objectStore(m), C = I.keyPath == null,
|
|
1743
|
-
if (!
|
|
1744
|
-
var
|
|
1740
|
+
return new Promise(function(P, M) {
|
|
1741
|
+
P = q(P);
|
|
1742
|
+
var I = y.objectStore(m), C = I.keyPath == null, j = S === "put" || S === "add";
|
|
1743
|
+
if (!j && S !== "delete" && S !== "deleteRange") throw new Error("Invalid operation type: " + S);
|
|
1744
|
+
var T, L = (E || O || { length: 1 }).length;
|
|
1745
1745
|
if (E && O && E.length !== O.length) throw new Error("Given keys array must have same length as given values array.");
|
|
1746
1746
|
if (L === 0) return P({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
1747
1747
|
function U(ue) {
|
|
1748
|
-
++
|
|
1748
|
+
++fe, pt(ue);
|
|
1749
1749
|
}
|
|
1750
|
-
var W = [], z = [],
|
|
1750
|
+
var W = [], z = [], fe = 0;
|
|
1751
1751
|
if (S === "deleteRange") {
|
|
1752
|
-
if (x.type === 4) return P({ numFailures:
|
|
1753
|
-
x.type === 3 ? W.push(
|
|
1752
|
+
if (x.type === 4) return P({ numFailures: fe, failures: z, results: [], lastResult: void 0 });
|
|
1753
|
+
x.type === 3 ? W.push(T = I.clear()) : W.push(T = I.delete(i(x)));
|
|
1754
1754
|
} else {
|
|
1755
|
-
var C =
|
|
1756
|
-
if (
|
|
1757
|
-
else for (ce = 0; ce < L; ++ce) W.push(
|
|
1755
|
+
var C = j ? C ? [O, E] : [O, null] : [E, null], F = C[0], se = C[1];
|
|
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;
|
|
1757
|
+
else for (ce = 0; ce < L; ++ce) W.push(T = I[S](F[ce])), T.onerror = U;
|
|
1758
1758
|
}
|
|
1759
|
-
function
|
|
1760
|
-
ue = ue.target.result, W.forEach(function(ze,
|
|
1761
|
-
return ze.error != null && (z[
|
|
1762
|
-
}), P({ numFailures:
|
|
1759
|
+
function Vt(ue) {
|
|
1760
|
+
ue = ue.target.result, W.forEach(function(ze, Gn) {
|
|
1761
|
+
return ze.error != null && (z[Gn] = ze.error);
|
|
1762
|
+
}), P({ numFailures: fe, failures: z, results: S === "delete" ? E : W.map(function(ze) {
|
|
1763
1763
|
return ze.result;
|
|
1764
1764
|
}), lastResult: ue });
|
|
1765
1765
|
}
|
|
1766
|
-
|
|
1767
|
-
U(ue),
|
|
1768
|
-
},
|
|
1766
|
+
T.onerror = function(ue) {
|
|
1767
|
+
U(ue), Vt(ue);
|
|
1768
|
+
}, T.onsuccess = Vt;
|
|
1769
1769
|
});
|
|
1770
1770
|
}, getMany: function(v) {
|
|
1771
1771
|
var y = v.trans, S = v.keys;
|
|
1772
1772
|
return new Promise(function(E, O) {
|
|
1773
|
-
E =
|
|
1774
|
-
for (var x, P = y.objectStore(m),
|
|
1775
|
-
W = W.target, I[W._pos] = W.result, ++
|
|
1776
|
-
}, L = me(O), U = 0; U <
|
|
1773
|
+
E = q(E);
|
|
1774
|
+
for (var x, P = y.objectStore(m), M = S.length, I = new Array(M), C = 0, j = 0, T = function(W) {
|
|
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 && ((x = P.get(S[U]))._pos = U, x.onsuccess = T, x.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
|
-
E =
|
|
1782
|
+
E = q(E);
|
|
1783
1783
|
var x = y.objectStore(m).get(S);
|
|
1784
1784
|
x.onsuccess = function(P) {
|
|
1785
1785
|
return E(P.target.result);
|
|
@@ -1787,28 +1787,28 @@ var Mr = { exports: {} };
|
|
|
1787
1787
|
});
|
|
1788
1788
|
}, query: (p = g, function(v) {
|
|
1789
1789
|
return new Promise(function(y, S) {
|
|
1790
|
-
y =
|
|
1791
|
-
var E, O, x, C = v.trans, P = v.values,
|
|
1792
|
-
if (
|
|
1793
|
-
p ? ((I = P ?
|
|
1790
|
+
y = q(y);
|
|
1791
|
+
var E, O, x, 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
|
+
if (M === 0) return y({ result: [] });
|
|
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
|
|
1795
|
+
}, I.onerror = me(S)) : (E = 0, O = !P && "openKeyCursor" in j ? j.openKeyCursor(T) : j.openCursor(T), x = [], O.onsuccess = function(L) {
|
|
1796
1796
|
var U = O.result;
|
|
1797
|
-
return U ? (x.push(P ? U.value : U.primaryKey), ++E ===
|
|
1797
|
+
return U ? (x.push(P ? U.value : U.primaryKey), ++E === M ? y({ result: x }) : void U.continue()) : y({ result: x });
|
|
1798
1798
|
}, O.onerror = me(S));
|
|
1799
1799
|
});
|
|
1800
1800
|
}), openCursor: function(v) {
|
|
1801
1801
|
var y = v.trans, S = v.values, E = v.query, O = v.reverse, x = v.unique;
|
|
1802
|
-
return new Promise(function(P,
|
|
1803
|
-
P =
|
|
1804
|
-
var
|
|
1805
|
-
|
|
1806
|
-
var U, W, z,
|
|
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),
|
|
1802
|
+
return new Promise(function(P, M) {
|
|
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 ? x ? "prevunique" : "prev" : x ? "nextunique" : "next", T = !S && "openKeyCursor" in C ? C.openKeyCursor(i(I), j) : C.openCursor(i(I), j);
|
|
1805
|
+
T.onerror = me(M), T.onsuccess = q(function(L) {
|
|
1806
|
+
var U, W, z, fe, F = T.result;
|
|
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() {
|
|
1808
1808
|
throw new Error("Cursor not stopped");
|
|
1809
1809
|
}, F.trans = y, F.stop = F.continue = F.continuePrimaryKey = F.advance = function() {
|
|
1810
1810
|
throw new Error("Cursor not started");
|
|
1811
|
-
}, F.fail =
|
|
1811
|
+
}, F.fail = q(M), F.next = function() {
|
|
1812
1812
|
var se = this, ce = 1;
|
|
1813
1813
|
return this.start(function() {
|
|
1814
1814
|
return ce-- ? se.continue() : se.stop();
|
|
@@ -1817,7 +1817,7 @@ var Mr = { exports: {} };
|
|
|
1817
1817
|
});
|
|
1818
1818
|
}, F.start = function(se) {
|
|
1819
1819
|
function ce() {
|
|
1820
|
-
if (
|
|
1820
|
+
if (T.result) try {
|
|
1821
1821
|
se();
|
|
1822
1822
|
} catch (ue) {
|
|
1823
1823
|
F.fail(ue);
|
|
@@ -1826,22 +1826,22 @@ var Mr = { exports: {} };
|
|
|
1826
1826
|
throw new Error("Cursor behind last entry");
|
|
1827
1827
|
}, F.stop();
|
|
1828
1828
|
}
|
|
1829
|
-
var
|
|
1830
|
-
ue =
|
|
1831
|
-
F.stop = F.continue = F.continuePrimaryKey = F.advance =
|
|
1829
|
+
var Vt = new Promise(function(ue, ze) {
|
|
1830
|
+
ue = q(ue), T.onerror = me(ze), F.fail = ze, F.stop = function(Gn) {
|
|
1831
|
+
F.stop = F.continue = F.continuePrimaryKey = F.advance = fe, ue(Gn);
|
|
1832
1832
|
};
|
|
1833
1833
|
});
|
|
1834
|
-
return
|
|
1835
|
-
|
|
1836
|
-
}), F.continue = U, F.continuePrimaryKey = W, F.advance = z, ce(),
|
|
1834
|
+
return T.onsuccess = q(function(ue) {
|
|
1835
|
+
T.onsuccess = ce, ce();
|
|
1836
|
+
}), F.continue = U, F.continuePrimaryKey = W, F.advance = z, ce(), Vt;
|
|
1837
1837
|
}, P(F)) : P(null);
|
|
1838
|
-
},
|
|
1838
|
+
}, M);
|
|
1839
1839
|
});
|
|
1840
1840
|
}, count: function(v) {
|
|
1841
1841
|
var y = v.query, S = v.trans, E = y.index, O = y.range;
|
|
1842
1842
|
return new Promise(function(x, P) {
|
|
1843
|
-
var
|
|
1844
|
-
I.onsuccess =
|
|
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
|
+
I.onsuccess = q(function(C) {
|
|
1845
1845
|
return x(C.target.result);
|
|
1846
1846
|
}), I.onerror = me(P);
|
|
1847
1847
|
});
|
|
@@ -1850,10 +1850,10 @@ var Mr = { exports: {} };
|
|
|
1850
1850
|
var o, c, u, b = (c = h, u = mr((o = e).objectStoreNames), { schema: { name: o.name, tables: u.map(function(w) {
|
|
1851
1851
|
return c.objectStore(w);
|
|
1852
1852
|
}).map(function(w) {
|
|
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:
|
|
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
1855
|
}).map(function(x) {
|
|
1856
|
-
var E = x.name, O = x.unique, P = x.multiEntry, x = x.keyPath, P = { name: E, compound: B(x), keyPath: x, unique: O, multiEntry: P, extractKey:
|
|
1856
|
+
var E = x.name, O = x.unique, P = x.multiEntry, x = x.keyPath, P = { name: E, compound: B(x), keyPath: x, unique: O, multiEntry: P, extractKey: Sn(x) };
|
|
1857
1857
|
return v[mt(x)] = P;
|
|
1858
1858
|
}), getIndexByKeyPath: function(S) {
|
|
1859
1859
|
return v[mt(S)];
|
|
@@ -1873,7 +1873,7 @@ var Mr = { exports: {} };
|
|
|
1873
1873
|
return c = c.create, l(l({}, o), c(o));
|
|
1874
1874
|
}, i)) };
|
|
1875
1875
|
}
|
|
1876
|
-
function
|
|
1876
|
+
function Lt(e, i) {
|
|
1877
1877
|
var n = i.db, i = di(e._middlewares, n, e._deps, i);
|
|
1878
1878
|
e.core = i.dbcore, e.tables.forEach(function(a) {
|
|
1879
1879
|
var o = a.name;
|
|
@@ -1882,22 +1882,22 @@ var Mr = { exports: {} };
|
|
|
1882
1882
|
}) && (a.core = e.core.table(o), e[o] instanceof e.Table && (e[o].core = a.core));
|
|
1883
1883
|
});
|
|
1884
1884
|
}
|
|
1885
|
-
function
|
|
1885
|
+
function Gt(e, t, n, i) {
|
|
1886
1886
|
n.forEach(function(a) {
|
|
1887
1887
|
var o = i[a];
|
|
1888
1888
|
t.forEach(function(c) {
|
|
1889
1889
|
var u = function h(g, b) {
|
|
1890
|
-
return Fr(g, b) || (g =
|
|
1890
|
+
return Fr(g, b) || (g = ee(g)) && h(g, b);
|
|
1891
1891
|
}(c, a);
|
|
1892
1892
|
(!u || "value" in u && u.value === void 0) && (c === e.Transaction.prototype || c instanceof e.Transaction ? ke(c, a, { get: function() {
|
|
1893
1893
|
return this.table(a);
|
|
1894
1894
|
}, set: function(h) {
|
|
1895
|
-
|
|
1895
|
+
St(this, a, { value: h, writable: !0, configurable: !0, enumerable: !0 });
|
|
1896
1896
|
} }) : c[a] = new e.Table(a, o));
|
|
1897
1897
|
});
|
|
1898
1898
|
});
|
|
1899
1899
|
}
|
|
1900
|
-
function
|
|
1900
|
+
function En(e, t) {
|
|
1901
1901
|
t.forEach(function(n) {
|
|
1902
1902
|
for (var i in n) n[i] instanceof e.Table && delete n[i];
|
|
1903
1903
|
});
|
|
@@ -1907,68 +1907,68 @@ var Mr = { exports: {} };
|
|
|
1907
1907
|
}
|
|
1908
1908
|
function hi(e, t, n, i) {
|
|
1909
1909
|
var a = e._dbSchema;
|
|
1910
|
-
n.objectStoreNames.contains("$meta") && !a.$meta && (a.$meta =
|
|
1910
|
+
n.objectStoreNames.contains("$meta") && !a.$meta && (a.$meta = _n("$meta", vr("")[0], []), e._storeNames.push("$meta"));
|
|
1911
1911
|
var o = e._createTransaction("readwrite", e._storeNames, a);
|
|
1912
1912
|
o.create(n), o._completion.catch(i);
|
|
1913
1913
|
var c = o._reject.bind(o), u = G.transless || G;
|
|
1914
1914
|
De(function() {
|
|
1915
|
-
return G.trans = o, G.transless = u, t !== 0 ? (
|
|
1915
|
+
return G.trans = o, G.transless = u, t !== 0 ? (Lt(e, n), g = t, ((h = o).storeNames.includes("$meta") ? h.table("$meta").get("version").then(function(b) {
|
|
1916
1916
|
return b ?? g;
|
|
1917
|
-
}) :
|
|
1918
|
-
return w = b, p = o, m = n, v = [], b = (d = e)._versions, y = d._dbSchema =
|
|
1917
|
+
}) : N.resolve(g)).then(function(b) {
|
|
1918
|
+
return w = b, p = o, m = n, v = [], b = (d = e)._versions, y = d._dbSchema = Ft(0, d.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
|
-
|
|
1924
|
-
var x =
|
|
1925
|
-
x.add.forEach(function(
|
|
1926
|
-
|
|
1927
|
-
}), x.change.forEach(function(
|
|
1928
|
-
if (
|
|
1929
|
-
var
|
|
1930
|
-
|
|
1931
|
-
return
|
|
1932
|
-
}),
|
|
1933
|
-
|
|
1934
|
-
}),
|
|
1935
|
-
return
|
|
1923
|
+
Ut(d, E, m), Ut(d, O, m), y = d._dbSchema = O;
|
|
1924
|
+
var x = On(E, O);
|
|
1925
|
+
x.add.forEach(function(j) {
|
|
1926
|
+
xn(m, j[0], j[1].primKey, j[1].indexes);
|
|
1927
|
+
}), x.change.forEach(function(j) {
|
|
1928
|
+
if (j.recreate) throw new $.Upgrade("Not yet support for changing primary key");
|
|
1929
|
+
var T = m.objectStore(j.name);
|
|
1930
|
+
j.add.forEach(function(L) {
|
|
1931
|
+
return $t(T, L);
|
|
1932
|
+
}), j.change.forEach(function(L) {
|
|
1933
|
+
T.deleteIndex(L.name), $t(T, L);
|
|
1934
|
+
}), j.del.forEach(function(L) {
|
|
1935
|
+
return T.deleteIndex(L);
|
|
1936
1936
|
});
|
|
1937
1937
|
});
|
|
1938
1938
|
var P = S._cfg.contentUpgrade;
|
|
1939
1939
|
if (P && S._cfg.version > w) {
|
|
1940
|
-
|
|
1941
|
-
var
|
|
1942
|
-
x.del.forEach(function(
|
|
1943
|
-
|
|
1944
|
-
}),
|
|
1945
|
-
var I, C =
|
|
1946
|
-
return C && Ze(), x =
|
|
1947
|
-
var
|
|
1948
|
-
(I = P(p)) && C && (
|
|
1949
|
-
}), I && typeof I.then == "function" ?
|
|
1940
|
+
Lt(d, m), p._memoizedTables = {};
|
|
1941
|
+
var M = Qn(O);
|
|
1942
|
+
x.del.forEach(function(j) {
|
|
1943
|
+
M[j] = E[j];
|
|
1944
|
+
}), En(d, [d.Transaction.prototype]), Gt(d, [d.Transaction.prototype], R(M), M), p.schema = M;
|
|
1945
|
+
var I, C = nn(P);
|
|
1946
|
+
return C && Ze(), x = N.follow(function() {
|
|
1947
|
+
var j;
|
|
1948
|
+
(I = P(p)) && C && (j = Pe.bind(null, null), I.then(j, j));
|
|
1949
|
+
}), I && typeof I.then == "function" ? N.resolve(I) : x.then(function() {
|
|
1950
1950
|
return I;
|
|
1951
1951
|
});
|
|
1952
1952
|
}
|
|
1953
1953
|
}), v.push(function(E) {
|
|
1954
1954
|
var O, x, P = S._cfg.dbschema;
|
|
1955
|
-
O = P, x = E, [].slice.call(x.db.objectStoreNames).forEach(function(
|
|
1956
|
-
return O[
|
|
1957
|
-
}),
|
|
1955
|
+
O = P, x = E, [].slice.call(x.db.objectStoreNames).forEach(function(M) {
|
|
1956
|
+
return O[M] == null && x.db.deleteObjectStore(M);
|
|
1957
|
+
}), En(d, [d.Transaction.prototype]), Gt(d, [d.Transaction.prototype], d._storeNames, d._dbSchema), p.schema = d._dbSchema;
|
|
1958
1958
|
}), v.push(function(E) {
|
|
1959
1959
|
d.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(d.idbdb.version / 10) === S._cfg.version ? (d.idbdb.deleteObjectStore("$meta"), delete d._dbSchema.$meta, d._storeNames = d._storeNames.filter(function(O) {
|
|
1960
1960
|
return O !== "$meta";
|
|
1961
1961
|
})) : E.objectStore("$meta").put(S._cfg.version, "version"));
|
|
1962
1962
|
});
|
|
1963
1963
|
}), function S() {
|
|
1964
|
-
return v.length ?
|
|
1964
|
+
return v.length ? N.resolve(v.shift()(p.idbtrans)).then(S) : N.resolve();
|
|
1965
1965
|
}().then(function() {
|
|
1966
1966
|
br(y, m);
|
|
1967
|
-
})) :
|
|
1967
|
+
})) : N.resolve();
|
|
1968
1968
|
var d, w, p, m, v, y;
|
|
1969
|
-
}).catch(c)) : (
|
|
1970
|
-
|
|
1971
|
-
}),
|
|
1969
|
+
}).catch(c)) : (R(a).forEach(function(b) {
|
|
1970
|
+
xn(n, b, a[b].primKey, a[b].indexes);
|
|
1971
|
+
}), Lt(e, n), void N.follow(function() {
|
|
1972
1972
|
return e.on.populate.fire(o);
|
|
1973
1973
|
}).catch(c));
|
|
1974
1974
|
var h, g;
|
|
@@ -1976,20 +1976,20 @@ var Mr = { exports: {} };
|
|
|
1976
1976
|
}
|
|
1977
1977
|
function pi(e, t) {
|
|
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
|
-
var n =
|
|
1980
|
-
|
|
1981
|
-
for (var i = 0, a =
|
|
1979
|
+
var n = Ft(0, e.idbdb, t);
|
|
1980
|
+
Ut(e, e._dbSchema, t);
|
|
1981
|
+
for (var i = 0, a = On(n, e._dbSchema).change; i < a.length; i++) {
|
|
1982
1982
|
var o = 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
|
-
ye && console.debug("Dexie upgrade patch: Creating missing index ".concat(c.name, ".").concat(h.src)),
|
|
1986
|
+
ye && console.debug("Dexie upgrade patch: Creating missing index ".concat(c.name, ".").concat(h.src)), $t(u, h);
|
|
1987
1987
|
});
|
|
1988
1988
|
}(a[i]);
|
|
1989
1989
|
if (typeof o == "object") return o.value;
|
|
1990
1990
|
}
|
|
1991
1991
|
}
|
|
1992
|
-
function
|
|
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) {
|
|
@@ -2010,83 +2010,83 @@ var Mr = { exports: {} };
|
|
|
2010
2010
|
}
|
|
2011
2011
|
return i;
|
|
2012
2012
|
}
|
|
2013
|
-
function
|
|
2013
|
+
function xn(e, t, n, i) {
|
|
2014
2014
|
var a = e.db.createObjectStore(t, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
|
|
2015
2015
|
return i.forEach(function(o) {
|
|
2016
|
-
return
|
|
2016
|
+
return $t(a, o);
|
|
2017
2017
|
}), a;
|
|
2018
2018
|
}
|
|
2019
2019
|
function br(e, t) {
|
|
2020
|
-
|
|
2021
|
-
t.db.objectStoreNames.contains(n) || (ye && console.debug("Dexie: Creating missing table", n),
|
|
2020
|
+
R(e).forEach(function(n) {
|
|
2021
|
+
t.db.objectStoreNames.contains(n) || (ye && console.debug("Dexie: Creating missing table", n), xn(t, n, e[n].primKey, e[n].indexes));
|
|
2022
2022
|
});
|
|
2023
2023
|
}
|
|
2024
|
-
function
|
|
2024
|
+
function $t(e, t) {
|
|
2025
2025
|
e.createIndex(t.name, t.keyPath, { unique: t.unique, multiEntry: t.multi });
|
|
2026
2026
|
}
|
|
2027
|
-
function
|
|
2027
|
+
function Ft(e, t, n) {
|
|
2028
2028
|
var i = {};
|
|
2029
|
-
return
|
|
2030
|
-
for (var o = n.objectStore(a), c =
|
|
2031
|
-
var b = o.index(o.indexNames[h]), g = b.keyPath, b =
|
|
2029
|
+
return Et(t.objectStoreNames, 0).forEach(function(a) {
|
|
2030
|
+
for (var o = n.objectStore(a), c = wn(yr(g = o.keyPath), g || "", !0, !1, !!o.autoIncrement, g && typeof g != "string", !0), u = [], h = 0; h < o.indexNames.length; ++h) {
|
|
2031
|
+
var b = o.index(o.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[a] =
|
|
2034
|
+
i[a] = _n(a, c, u);
|
|
2035
2035
|
}), i;
|
|
2036
2036
|
}
|
|
2037
|
-
function
|
|
2037
|
+
function Ut(e, t, n) {
|
|
2038
2038
|
for (var i = n.db.objectStoreNames, a = 0; a < i.length; ++a) {
|
|
2039
2039
|
var o = i[a], c = n.objectStore(o);
|
|
2040
2040
|
e._hasGetAll = "getAll" in c;
|
|
2041
2041
|
for (var u = 0; u < c.indexNames.length; ++u) {
|
|
2042
|
-
var h = c.indexNames[u], g = c.index(h).keyPath, b = typeof g == "string" ? g : "[" +
|
|
2042
|
+
var h = c.indexNames[u], g = c.index(h).keyPath, b = typeof g == "string" ? g : "[" + Et(g).join("+") + "]";
|
|
2043
2043
|
!t[o] || (g = t[o].idxByName[b]) && (g.name = h, delete t[o].idxByName[b], t[o].idxByName[h] = g);
|
|
2044
2044
|
}
|
|
2045
2045
|
}
|
|
2046
|
-
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) &&
|
|
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
2050
|
var i = (t = t.trim()).replace(/([&*]|\+\+)/g, ""), a = /^\[/.test(i) ? i.match(/^\[(.*)\]$/)[1].split("+") : i;
|
|
2051
|
-
return
|
|
2051
|
+
return wn(i, a || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t), B(a), n === 0);
|
|
2052
2052
|
});
|
|
2053
2053
|
}
|
|
2054
|
-
var gi = (
|
|
2055
|
-
|
|
2054
|
+
var gi = (Wt.prototype._parseStoresSpec = function(e, t) {
|
|
2055
|
+
R(e).forEach(function(n) {
|
|
2056
2056
|
if (e[n] !== null) {
|
|
2057
2057
|
var i = vr(e[n]), a = i.shift();
|
|
2058
2058
|
if (a.unique = !0, a.multi) throw new $.Schema("Primary key cannot be multi-valued");
|
|
2059
2059
|
i.forEach(function(o) {
|
|
2060
2060
|
if (o.auto) throw new $.Schema("Only primary key can be marked as autoIncrement (++)");
|
|
2061
2061
|
if (!o.keyPath) throw new $.Schema("Index must have a name and cannot be an empty string");
|
|
2062
|
-
}), t[n] =
|
|
2062
|
+
}), t[n] = _n(n, a, 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
2068
|
var n = t._versions, i = {}, a = {};
|
|
2069
2069
|
return n.forEach(function(o) {
|
|
2070
2070
|
Q(i, o._cfg.storesSource), a = o._cfg.dbschema = {}, o._parseStoresSpec(i, a);
|
|
2071
|
-
}), t._dbSchema = a,
|
|
2072
|
-
},
|
|
2073
|
-
return this._cfg.contentUpgrade =
|
|
2074
|
-
},
|
|
2075
|
-
function
|
|
2071
|
+
}), t._dbSchema = a, En(t, [t._allTables, t, t.Transaction.prototype]), Gt(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], R(a), a), t._storeNames = R(a), this;
|
|
2072
|
+
}, Wt.prototype.upgrade = function(e) {
|
|
2073
|
+
return this._cfg.contentUpgrade = an(this._cfg.contentUpgrade || X, e), this;
|
|
2074
|
+
}, Wt);
|
|
2075
|
+
function Wt() {
|
|
2076
2076
|
}
|
|
2077
|
-
function
|
|
2077
|
+
function kn(e, t) {
|
|
2078
2078
|
var n = e._dbNamesDB;
|
|
2079
|
-
return n || (n = e._dbNamesDB = new Ee(
|
|
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 An(e) {
|
|
2082
2082
|
return e && typeof e.databases == "function";
|
|
2083
2083
|
}
|
|
2084
|
-
function
|
|
2084
|
+
function Dn(e) {
|
|
2085
2085
|
return De(function() {
|
|
2086
2086
|
return G.letThrough = !0, e();
|
|
2087
2087
|
});
|
|
2088
2088
|
}
|
|
2089
|
-
function
|
|
2089
|
+
function Pn(e) {
|
|
2090
2090
|
return !("from" in e);
|
|
2091
2091
|
}
|
|
2092
2092
|
var oe = function(e, t) {
|
|
@@ -2100,7 +2100,7 @@ var Mr = { exports: {} };
|
|
|
2100
2100
|
var i = H(t, n);
|
|
2101
2101
|
if (!isNaN(i)) {
|
|
2102
2102
|
if (0 < i) throw RangeError();
|
|
2103
|
-
if (
|
|
2103
|
+
if (Pn(e)) return Q(e, { from: t, to: n, d: 1 });
|
|
2104
2104
|
var a = e.l, i = e.r;
|
|
2105
2105
|
if (H(n, e.from) < 0) return a ? bt(a, 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);
|
|
@@ -2108,22 +2108,22 @@ var Mr = { exports: {} };
|
|
|
2108
2108
|
}
|
|
2109
2109
|
}
|
|
2110
2110
|
function vt(e, t) {
|
|
2111
|
-
|
|
2111
|
+
Pn(t) || function n(i, h) {
|
|
2112
2112
|
var o = h.from, c = h.to, u = h.l, h = h.r;
|
|
2113
2113
|
bt(i, o, c), u && n(i, u), h && n(i, h);
|
|
2114
2114
|
}(e, t);
|
|
2115
2115
|
}
|
|
2116
2116
|
function wr(e, t) {
|
|
2117
|
-
var n =
|
|
2117
|
+
var n = zt(t), i = n.next();
|
|
2118
2118
|
if (i.done) return !1;
|
|
2119
|
-
for (var a = i.value, o =
|
|
2119
|
+
for (var a = i.value, o = zt(e), c = o.next(a.from), u = c.value; !i.done && !c.done; ) {
|
|
2120
2120
|
if (H(u.from, a.to) <= 0 && 0 <= H(u.to, a.from)) return !0;
|
|
2121
2121
|
H(a.from, u.from) < 0 ? a = (i = n.next(u.from)).value : u = (c = o.next(a.from)).value;
|
|
2122
2122
|
}
|
|
2123
2123
|
return !1;
|
|
2124
2124
|
}
|
|
2125
|
-
function
|
|
2126
|
-
var t =
|
|
2125
|
+
function zt(e) {
|
|
2126
|
+
var t = Pn(e) ? null : { s: 0, n: e };
|
|
2127
2127
|
return { next: function(n) {
|
|
2128
2128
|
for (var i = 0 < arguments.length; t; ) switch (t.s) {
|
|
2129
2129
|
case 0:
|
|
@@ -2150,21 +2150,21 @@ var Mr = { exports: {} };
|
|
|
2150
2150
|
var t = n.r, n = n.l;
|
|
2151
2151
|
return (t ? n ? Math.max(t.d, n.d) : t.d : n ? n.d : 0) + 1;
|
|
2152
2152
|
}
|
|
2153
|
-
function
|
|
2154
|
-
return
|
|
2153
|
+
function Ht(e, t) {
|
|
2154
|
+
return R(t).forEach(function(n) {
|
|
2155
2155
|
e[n] ? vt(e[n], t[n]) : e[n] = function i(a) {
|
|
2156
2156
|
var o, c, u = {};
|
|
2157
|
-
for (o in a)
|
|
2157
|
+
for (o in a) Z(a, o) && (c = a[o], u[o] = !c || typeof c != "object" || Jn.has(c.constructor) ? c : i(c));
|
|
2158
2158
|
return u;
|
|
2159
2159
|
}(t[n]);
|
|
2160
2160
|
}), e;
|
|
2161
2161
|
}
|
|
2162
|
-
function
|
|
2162
|
+
function In(e, t) {
|
|
2163
2163
|
return e.all || t.all || Object.keys(e).some(function(n) {
|
|
2164
2164
|
return t[n] && wr(t[n], e[n]);
|
|
2165
2165
|
});
|
|
2166
2166
|
}
|
|
2167
|
-
xe(oe.prototype, ((
|
|
2167
|
+
xe(oe.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;
|
|
@@ -2174,18 +2174,18 @@ var Mr = { exports: {} };
|
|
|
2174
2174
|
return bt(t, n, n);
|
|
2175
2175
|
}), this;
|
|
2176
2176
|
}, hasKey: function(e) {
|
|
2177
|
-
var t =
|
|
2177
|
+
var t = zt(this).next(e).value;
|
|
2178
2178
|
return t && H(t.from, e) <= 0 && 0 <= H(t.to, e);
|
|
2179
|
-
} })[
|
|
2180
|
-
return
|
|
2181
|
-
},
|
|
2182
|
-
var Ue = {},
|
|
2183
|
-
function
|
|
2184
|
-
|
|
2185
|
-
|
|
2179
|
+
} })[tn] = function() {
|
|
2180
|
+
return zt(this);
|
|
2181
|
+
}, he));
|
|
2182
|
+
var Ue = {}, Cn = {}, Rn = !1;
|
|
2183
|
+
function Yt(e) {
|
|
2184
|
+
Ht(Cn, e), Rn || (Rn = !0, setTimeout(function() {
|
|
2185
|
+
Rn = !1, Tn(Cn, !(Cn = {}));
|
|
2186
2186
|
}, 0));
|
|
2187
2187
|
}
|
|
2188
|
-
function
|
|
2188
|
+
function Tn(e, t) {
|
|
2189
2189
|
t === void 0 && (t = !1);
|
|
2190
2190
|
var n = /* @__PURE__ */ new Set();
|
|
2191
2191
|
if (e.all) for (var i = 0, a = Object.values(Ue); i < a.length; i++) Er(c = a[i], e, n, t);
|
|
@@ -2201,7 +2201,7 @@ var Mr = { exports: {} };
|
|
|
2201
2201
|
for (var a = [], o = 0, c = Object.entries(e.queries.query); o < c.length; o++) {
|
|
2202
2202
|
for (var u = c[o], h = u[0], g = [], b = 0, d = u[1]; b < d.length; b++) {
|
|
2203
2203
|
var w = d[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
|
}
|
|
@@ -2215,7 +2215,7 @@ var Mr = { exports: {} };
|
|
|
2215
2215
|
function yi(e) {
|
|
2216
2216
|
var t = e._state, n = e._deps.indexedDB;
|
|
2217
2217
|
if (t.isBeingOpened || e.idbdb) return t.dbReadyPromise.then(function() {
|
|
2218
|
-
return t.dbOpenError ?
|
|
2218
|
+
return t.dbOpenError ? te(t.dbOpenError) : e;
|
|
2219
2219
|
});
|
|
2220
2220
|
t.isBeingOpened = !0, t.dbOpenError = null, t.openComplete = !1;
|
|
2221
2221
|
var i = t.openCanceller, a = Math.round(10 * e.verno), o = !1;
|
|
@@ -2223,32 +2223,32 @@ var Mr = { exports: {} };
|
|
|
2223
2223
|
if (t.openCanceller !== i) throw new $.DatabaseClosed("db.open() was cancelled");
|
|
2224
2224
|
}
|
|
2225
2225
|
function u() {
|
|
2226
|
-
return new
|
|
2226
|
+
return new N(function(w, p) {
|
|
2227
2227
|
if (c(), !n) throw new $.MissingAPI();
|
|
2228
2228
|
var m = e.name, v = t.autoSchema || !a ? n.open(m) : n.open(m, a);
|
|
2229
2229
|
if (!v) throw new $.MissingAPI();
|
|
2230
|
-
v.onerror = me(p), v.onblocked =
|
|
2230
|
+
v.onerror = me(p), v.onblocked = q(e._fireOnBlocked), v.onupgradeneeded = q(function(y) {
|
|
2231
2231
|
var S;
|
|
2232
|
-
b = v.transaction, t.autoSchema && !e._options.allowEmptyDB ? (v.onerror = pt, b.abort(), v.result.close(), (S = n.deleteDatabase(m)).onsuccess = S.onerror =
|
|
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
2234
|
})) : (b.onerror = me(p), y = y.oldVersion > Math.pow(2, 62) ? 0 : y.oldVersion, d = y < 1, e.idbdb = v.result, o && pi(e, b), hi(e, y / 10, b, p));
|
|
2235
|
-
}, p), v.onsuccess =
|
|
2235
|
+
}, p), v.onsuccess = q(function() {
|
|
2236
2236
|
b = null;
|
|
2237
|
-
var y, S, E, O, x, P = e.idbdb = v.result,
|
|
2238
|
-
if (0 <
|
|
2239
|
-
var I = P.transaction((O =
|
|
2240
|
-
if (t.autoSchema) S = P, E = I, (y = e).verno = S.version / 10, E = y._dbSchema =
|
|
2241
|
-
else if (
|
|
2237
|
+
var y, S, E, O, x, P = e.idbdb = v.result, M = Et(P.objectStoreNames);
|
|
2238
|
+
if (0 < M.length) try {
|
|
2239
|
+
var I = P.transaction((O = M).length === 1 ? O[0] : O, "readonly");
|
|
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), ((x = On(Ft(0, (x = e).idbdb, I), x._dbSchema)).add.length || x.change.some(function(C) {
|
|
2242
2242
|
return C.add.length || C.change.length;
|
|
2243
2243
|
})) && !o) 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(), a = P.version + 1, o = !0, w(u());
|
|
2244
|
-
|
|
2244
|
+
Lt(e, I);
|
|
2245
2245
|
} catch {
|
|
2246
2246
|
}
|
|
2247
|
-
qe.push(e), P.onversionchange =
|
|
2247
|
+
qe.push(e), P.onversionchange = q(function(C) {
|
|
2248
2248
|
t.vcFired = !0, e.on("versionchange").fire(C);
|
|
2249
|
-
}), P.onclose =
|
|
2249
|
+
}), P.onclose = q(function(C) {
|
|
2250
2250
|
e.on("close").fire(C);
|
|
2251
|
-
}), d && (x = e._deps, I = m, P = x.indexedDB, x = x.IDBKeyRange,
|
|
2251
|
+
}), d && (x = e._deps, I = m, P = x.indexedDB, x = x.IDBKeyRange, An(P) || I === Mt || kn(P, x).put({ name: I }).catch(X)), w();
|
|
2252
2252
|
}, p);
|
|
2253
2253
|
}).catch(function(w) {
|
|
2254
2254
|
switch (w == null ? void 0 : w.name) {
|
|
@@ -2258,11 +2258,11 @@ var Mr = { exports: {} };
|
|
|
2258
2258
|
case "VersionError":
|
|
2259
2259
|
if (0 < a) return a = 0, u();
|
|
2260
2260
|
}
|
|
2261
|
-
return
|
|
2261
|
+
return N.reject(w);
|
|
2262
2262
|
});
|
|
2263
2263
|
}
|
|
2264
2264
|
var h, g = t.dbReadyResolve, b = null, d = !1;
|
|
2265
|
-
return
|
|
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);
|
|
2268
2268
|
}
|
|
@@ -2270,12 +2270,12 @@ var Mr = { exports: {} };
|
|
|
2270
2270
|
}).finally(function() {
|
|
2271
2271
|
return clearInterval(h);
|
|
2272
2272
|
}) : Promise.resolve()).then(u)]).then(function() {
|
|
2273
|
-
return c(), t.onReadyBeingFired = [],
|
|
2273
|
+
return c(), t.onReadyBeingFired = [], N.resolve(Dn(function() {
|
|
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(
|
|
2278
|
-
return t.onReadyBeingFired = [],
|
|
2277
|
+
var p = t.onReadyBeingFired.reduce(an, X);
|
|
2278
|
+
return t.onReadyBeingFired = [], N.resolve(Dn(function() {
|
|
2279
2279
|
return p(e.vip);
|
|
2280
2280
|
})).then(w);
|
|
2281
2281
|
}
|
|
@@ -2288,7 +2288,7 @@ var Mr = { exports: {} };
|
|
|
2288
2288
|
b && b.abort();
|
|
2289
2289
|
} catch {
|
|
2290
2290
|
}
|
|
2291
|
-
return i === t.openCanceller && e._close(),
|
|
2291
|
+
return i === t.openCanceller && e._close(), te(w);
|
|
2292
2292
|
}).finally(function() {
|
|
2293
2293
|
t.openComplete = !0, g();
|
|
2294
2294
|
}).then(function() {
|
|
@@ -2297,10 +2297,10 @@ var Mr = { exports: {} };
|
|
|
2297
2297
|
p.schema.indexes.forEach(function(m) {
|
|
2298
2298
|
m.name && (w["idb://".concat(e.name, "/").concat(p.name, "/").concat(m.name)] = new oe(-1 / 0, [[[]]]));
|
|
2299
2299
|
}), w["idb://".concat(e.name, "/").concat(p.name, "/")] = w["idb://".concat(e.name, "/").concat(p.name, "/:dels")] = new oe(-1 / 0, [[[]]]);
|
|
2300
|
-
}), Re(gt).fire(w),
|
|
2300
|
+
}), Re(gt).fire(w), Tn(w, !0)), e;
|
|
2301
2301
|
});
|
|
2302
2302
|
}
|
|
2303
|
-
function
|
|
2303
|
+
function Mn(e) {
|
|
2304
2304
|
function t(o) {
|
|
2305
2305
|
return e.next(o);
|
|
2306
2306
|
}
|
|
@@ -2315,7 +2315,7 @@ var Mr = { exports: {} };
|
|
|
2315
2315
|
}
|
|
2316
2316
|
return a(t)();
|
|
2317
2317
|
}
|
|
2318
|
-
function
|
|
2318
|
+
function Qt(e, t, n) {
|
|
2319
2319
|
for (var i = B(e) ? e.slice() : [e], a = 0; a < n; ++a) i.push(t);
|
|
2320
2320
|
return i;
|
|
2321
2321
|
}
|
|
@@ -2323,7 +2323,7 @@ var Mr = { exports: {} };
|
|
|
2323
2323
|
return l(l({}, e), { table: function(t) {
|
|
2324
2324
|
var n = e.table(t), i = n.schema, a = {}, o = [];
|
|
2325
2325
|
function c(d, w, p) {
|
|
2326
|
-
var m = mt(d), v = a[m] = a[m] || [], y = d == null ? 0 : typeof d == "string" ? 1 : d.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:
|
|
2326
|
+
var m = mt(d), v = a[m] = a[m] || [], y = d == null ? 0 : typeof d == "string" ? 1 : d.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(d), unique: !S && p.unique });
|
|
2327
2327
|
return v.push(S), S.isPrimaryKey || o.push(S), 1 < y && c(y === 2 ? d[0] : d.slice(0, y - 1), w + 1, p), v.sort(function(E, O) {
|
|
2328
2328
|
return E.keyTail - O.keyTail;
|
|
2329
2329
|
}), S;
|
|
@@ -2335,7 +2335,7 @@ var Mr = { exports: {} };
|
|
|
2335
2335
|
}
|
|
2336
2336
|
function b(d) {
|
|
2337
2337
|
var w, p = d.query.index;
|
|
2338
|
-
return p.isVirtual ? l(l({}, d), { query: { index: p.lowLevelIndex, range: (w = d.query.range, p = p.keyTail, { type: w.type === 1 ? 2 : w.type, lower:
|
|
2338
|
+
return p.isVirtual ? l(l({}, d), { query: { index: p.lowLevelIndex, range: (w = d.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 }) } }) : d;
|
|
2339
2339
|
}
|
|
2340
2340
|
return l(l({}, n), { schema: l(l({}, i), { primaryKey: t, indexes: o, getIndexByKeyPath: function(d) {
|
|
2341
2341
|
return (d = a[mt(d)]) && d[0];
|
|
@@ -2350,9 +2350,9 @@ var Mr = { exports: {} };
|
|
|
2350
2350
|
}) : n.openCursor(d);
|
|
2351
2351
|
function y(S) {
|
|
2352
2352
|
return Object.create(S, { continue: { value: function(E) {
|
|
2353
|
-
E != null ? S.continue(
|
|
2353
|
+
E != null ? S.continue(Qt(E, d.reverse ? e.MAX_KEY : e.MIN_KEY, p)) : d.unique ? S.continue(S.key.slice(0, v).concat(d.reverse ? e.MIN_KEY : e.MAX_KEY, p)) : S.continue();
|
|
2354
2354
|
} }, continuePrimaryKey: { value: function(E, O) {
|
|
2355
|
-
S.continuePrimaryKey(
|
|
2355
|
+
S.continuePrimaryKey(Qt(E, e.MAX_KEY, p), O);
|
|
2356
2356
|
} }, primaryKey: { get: function() {
|
|
2357
2357
|
return S.primaryKey;
|
|
2358
2358
|
} }, key: { get: function() {
|
|
@@ -2365,15 +2365,15 @@ var Mr = { exports: {} };
|
|
|
2365
2365
|
} });
|
|
2366
2366
|
} });
|
|
2367
2367
|
} };
|
|
2368
|
-
function
|
|
2369
|
-
return n = n || {}, i = i || "",
|
|
2368
|
+
function jn(e, t, n, i) {
|
|
2369
|
+
return n = n || {}, i = i || "", R(e).forEach(function(a) {
|
|
2370
2370
|
var o, c, u;
|
|
2371
|
-
|
|
2372
|
-
}),
|
|
2373
|
-
|
|
2371
|
+
Z(t, a) ? (o = e[a], c = t[a], typeof o == "object" && typeof c == "object" && o && c ? (u = en(o)) !== en(c) ? n[i + a] = t[a] : u === "Object" ? jn(o, c, n, i + a + ".") : o !== c && (n[i + a] = t[a]) : o !== c && (n[i + a] = t[a])) : n[i + a] = void 0;
|
|
2372
|
+
}), R(t).forEach(function(a) {
|
|
2373
|
+
Z(e, a) || (n[i + a] = t[a]);
|
|
2374
2374
|
}), n;
|
|
2375
2375
|
}
|
|
2376
|
-
function
|
|
2376
|
+
function Kn(e, t) {
|
|
2377
2377
|
return t.type === "delete" ? t.keys : t.keys || t.values.map(e.extractKey);
|
|
2378
2378
|
}
|
|
2379
2379
|
var bi = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
@@ -2412,21 +2412,21 @@ var Mr = { exports: {} };
|
|
|
2412
2412
|
}
|
|
2413
2413
|
return n.mutate(a);
|
|
2414
2414
|
function b(d) {
|
|
2415
|
-
var w, p, m, v = G.trans, y = d.keys ||
|
|
2415
|
+
var w, p, m, v = G.trans, y = d.keys || Kn(i, d);
|
|
2416
2416
|
if (!y) throw new Error("Keys missing");
|
|
2417
|
-
return (d = d.type === "add" || d.type === "put" ? l(l({}, d), { keys: y }) : l({}, d)).type !== "delete" && (d.values =
|
|
2417
|
+
return (d = d.type === "add" || d.type === "put" ? l(l({}, d), { keys: y }) : l({}, d)).type !== "delete" && (d.values = k([], d.values)), d.keys && (d.keys = k([], d.keys)), w = n, m = y, ((p = d).type === "add" ? Promise.resolve([]) : w.getMany({ trans: p.trans, keys: m, cache: "immutable" })).then(function(S) {
|
|
2418
2418
|
var E = y.map(function(O, x) {
|
|
2419
|
-
var P,
|
|
2420
|
-
return d.type === "delete" ? u.fire.call(
|
|
2421
|
-
|
|
2422
|
-
}))),
|
|
2419
|
+
var P, M, I, C = S[x], j = { onerror: null, onsuccess: null };
|
|
2420
|
+
return d.type === "delete" ? u.fire.call(j, O, C, v) : d.type === "add" || C === void 0 ? (P = h.fire.call(j, O, d.values[x], v), O == null && P != null && (d.keys[x] = O = P, i.outbound || le(d.values[x], i.keyPath, O))) : (P = jn(C, d.values[x]), (M = g.fire.call(j, P, O, C, v)) && (I = d.values[x], Object.keys(M).forEach(function(T) {
|
|
2421
|
+
Z(I, T) ? I[T] = M[T] : le(I, T, M[T]);
|
|
2422
|
+
}))), j;
|
|
2423
2423
|
});
|
|
2424
2424
|
return n.mutate(d).then(function(O) {
|
|
2425
|
-
for (var x = O.failures, P = O.results,
|
|
2426
|
-
var C = (P || y)[I],
|
|
2427
|
-
C == null ?
|
|
2425
|
+
for (var x = O.failures, P = O.results, M = O.numFailures, O = O.lastResult, I = 0; I < y.length; ++I) {
|
|
2426
|
+
var C = (P || y)[I], j = E[I];
|
|
2427
|
+
C == null ? j.onerror && j.onerror(x[I]) : j.onsuccess && j.onsuccess(d.type === "put" && S[I] ? d.values[I] : C);
|
|
2428
2428
|
}
|
|
2429
|
-
return { failures: x, results: P, numFailures:
|
|
2429
|
+
return { failures: x, results: P, numFailures: M, lastResult: O };
|
|
2430
2430
|
}).catch(function(O) {
|
|
2431
2431
|
return E.forEach(function(x) {
|
|
2432
2432
|
return x.onerror && x.onerror(O);
|
|
@@ -2452,7 +2452,7 @@ var Mr = { exports: {} };
|
|
|
2452
2452
|
return l(l({}, n), { getMany: function(i) {
|
|
2453
2453
|
if (!i.cache) return n.getMany(i);
|
|
2454
2454
|
var a = Or(i.keys, i.trans._cache, i.cache === "clone");
|
|
2455
|
-
return a ?
|
|
2455
|
+
return a ? N.resolve(a) : n.getMany(i).then(function(o) {
|
|
2456
2456
|
return i.trans._cache = { keys: i.keys, values: i.cache === "clone" ? Me(o) : o }, o;
|
|
2457
2457
|
});
|
|
2458
2458
|
}, mutate: function(i) {
|
|
@@ -2483,37 +2483,37 @@ var Mr = { exports: {} };
|
|
|
2483
2483
|
var a = e.table(i), o = a.schema, c = o.primaryKey, d = o.indexes, u = c.extractKey, h = c.outbound, g = c.autoIncrement && d.filter(function(p) {
|
|
2484
2484
|
return p.compound && p.keyPath.includes(c.keyPath);
|
|
2485
2485
|
}), b = l(l({}, a), { mutate: function(p) {
|
|
2486
|
-
function m(
|
|
2487
|
-
return
|
|
2486
|
+
function m(T) {
|
|
2487
|
+
return T = "idb://".concat(t, "/").concat(i, "/").concat(T), O[T] || (O[T] = new oe());
|
|
2488
2488
|
}
|
|
2489
|
-
var v, y, S, E = p.trans, O = p.mutatedParts || (p.mutatedParts = {}), x = m(""), P = m(":dels"),
|
|
2490
|
-
return
|
|
2491
|
-
}), p.values] : [], I =
|
|
2492
|
-
return B(I) ? (x.addKeys(I), (
|
|
2493
|
-
var L = v(
|
|
2489
|
+
var v, y, S, E = p.trans, O = p.mutatedParts || (p.mutatedParts = {}), x = 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
|
+
return T;
|
|
2491
|
+
}), p.values] : [], I = j[0], C = j[1], j = p.trans._cache;
|
|
2492
|
+
return B(I) ? (x.addKeys(I), (j = M === "delete" || I.length === C.length ? Or(I, j) : null) || P.addKeys(I), (j || C) && (v = m, y = j, S = C, o.indexes.forEach(function(T) {
|
|
2493
|
+
var L = v(T.name || "");
|
|
2494
2494
|
function U(z) {
|
|
2495
|
-
return z != null ?
|
|
2495
|
+
return z != null ? T.extractKey(z) : null;
|
|
2496
2496
|
}
|
|
2497
2497
|
function W(z) {
|
|
2498
|
-
return
|
|
2499
|
-
return L.addKey(
|
|
2498
|
+
return T.multiEntry && B(z) ? z.forEach(function(fe) {
|
|
2499
|
+
return L.addKey(fe);
|
|
2500
2500
|
}) : L.addKey(z);
|
|
2501
2501
|
}
|
|
2502
2502
|
(y || S).forEach(function(z, se) {
|
|
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), x.add(C)) : (x.add(n), P.add(n), o.indexes.forEach(function(
|
|
2507
|
-
return m(
|
|
2508
|
-
})), a.mutate(p).then(function(
|
|
2509
|
-
return !I || p.type !== "add" && p.type !== "put" || (x.addKeys(
|
|
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), x.add(C)) : (x.add(n), P.add(n), o.indexes.forEach(function(T) {
|
|
2507
|
+
return m(T.name).add(n);
|
|
2508
|
+
})), a.mutate(p).then(function(T) {
|
|
2509
|
+
return !I || p.type !== "add" && p.type !== "put" || (x.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) {
|
|
2513
2513
|
return F === c.keyPath;
|
|
2514
|
-
}), z = 0,
|
|
2514
|
+
}), z = 0, fe = T.results.length; z < fe; ++z) U[z][W] = T.results[z];
|
|
2515
2515
|
m(L.name).addKeys(U);
|
|
2516
|
-
})), E.mutatedParts =
|
|
2516
|
+
})), E.mutatedParts = Ht(E.mutatedParts || {}, O), T;
|
|
2517
2517
|
});
|
|
2518
2518
|
} }), d = function(m) {
|
|
2519
2519
|
var v = m.query, m = v.index, v = v.range;
|
|
@@ -2523,7 +2523,7 @@ var Mr = { exports: {} };
|
|
|
2523
2523
|
}, getMany: function(p) {
|
|
2524
2524
|
return [c, new oe().addKeys(p.keys)];
|
|
2525
2525
|
}, count: d, query: d, openCursor: d };
|
|
2526
|
-
return
|
|
2526
|
+
return R(w).forEach(function(p) {
|
|
2527
2527
|
b[p] = function(m) {
|
|
2528
2528
|
var v = G.subscr, y = !!v, S = xr(G, a) && kr(p, m) ? m.obsSet = {} : v;
|
|
2529
2529
|
if (y) {
|
|
@@ -2538,17 +2538,17 @@ var Mr = { exports: {} };
|
|
|
2538
2538
|
if (h && m.values) return P.then(function(U) {
|
|
2539
2539
|
return U = U.result, O.addKeys(U), C;
|
|
2540
2540
|
});
|
|
2541
|
-
var
|
|
2542
|
-
(m.values ? O : x).addKeys(
|
|
2541
|
+
var j = m.values ? C.result.map(u) : C.result;
|
|
2542
|
+
(m.values ? O : x).addKeys(j);
|
|
2543
2543
|
} else if (p === "openCursor") {
|
|
2544
|
-
var
|
|
2545
|
-
return
|
|
2546
|
-
return x.addKey(
|
|
2544
|
+
var T = C, L = m.values;
|
|
2545
|
+
return T && Object.create(T, { key: { get: function() {
|
|
2546
|
+
return x.addKey(T.primaryKey), T.key;
|
|
2547
2547
|
} }, primaryKey: { get: function() {
|
|
2548
|
-
var U =
|
|
2548
|
+
var U = T.primaryKey;
|
|
2549
2549
|
return x.addKey(U), U;
|
|
2550
2550
|
} }, value: { get: function() {
|
|
2551
|
-
return L && O.addKey(
|
|
2551
|
+
return L && O.addKey(T.primaryKey), T.value;
|
|
2552
2552
|
} } });
|
|
2553
2553
|
}
|
|
2554
2554
|
return C;
|
|
@@ -2572,7 +2572,7 @@ var Mr = { exports: {} };
|
|
|
2572
2572
|
return !(o in n.failures);
|
|
2573
2573
|
})), t);
|
|
2574
2574
|
}
|
|
2575
|
-
function
|
|
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
|
}
|
|
@@ -2582,20 +2582,20 @@ var Mr = { exports: {} };
|
|
|
2582
2582
|
var v = p, y = [];
|
|
2583
2583
|
if (m.type === "add" || m.type === "put") for (var S = new oe(), E = m.values.length - 1; 0 <= E; --E) {
|
|
2584
2584
|
var O, x = m.values[E], P = g(x);
|
|
2585
|
-
S.hasKey(P) || (O = b(x), (u && B(O) ? O.some(function(
|
|
2586
|
-
return
|
|
2587
|
-
}) :
|
|
2585
|
+
S.hasKey(P) || (O = b(x), (u && B(O) ? O.some(function(T) {
|
|
2586
|
+
return Nn(T, h);
|
|
2587
|
+
}) : Nn(O, h)) && (S.addKey(P), y.push(x)));
|
|
2588
2588
|
}
|
|
2589
2589
|
switch (m.type) {
|
|
2590
2590
|
case "add":
|
|
2591
|
-
var
|
|
2591
|
+
var M = new oe().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
|
-
return L = g(L), !
|
|
2594
|
+
return L = g(L), !M.hasKey(L) && (M.addKey(L), !0);
|
|
2595
2595
|
}) : y.map(function(L) {
|
|
2596
2596
|
return g(L);
|
|
2597
2597
|
}).filter(function(L) {
|
|
2598
|
-
return !
|
|
2598
|
+
return !M.hasKey(L) && (M.addKey(L), !0);
|
|
2599
2599
|
}));
|
|
2600
2600
|
break;
|
|
2601
2601
|
case "put":
|
|
@@ -2615,9 +2615,9 @@ var Mr = { exports: {} };
|
|
|
2615
2615
|
});
|
|
2616
2616
|
break;
|
|
2617
2617
|
case "deleteRange":
|
|
2618
|
-
var
|
|
2618
|
+
var j = m.range;
|
|
2619
2619
|
v = p.filter(function(L) {
|
|
2620
|
-
return !
|
|
2620
|
+
return !Nn(g(L), j);
|
|
2621
2621
|
});
|
|
2622
2622
|
}
|
|
2623
2623
|
return v;
|
|
@@ -2671,16 +2671,16 @@ var Mr = { exports: {} };
|
|
|
2671
2671
|
var m = e.table(w), v = p.optimisticOps.filter(function(L) {
|
|
2672
2672
|
return L.trans === u;
|
|
2673
2673
|
});
|
|
2674
|
-
if (u._explicit && h && u.mutatedParts) for (var y = 0, S = Object.values(p.queries.query); y < S.length; y++) for (var E = 0, O = (
|
|
2674
|
+
if (u._explicit && h && u.mutatedParts) for (var y = 0, S = Object.values(p.queries.query); y < S.length; y++) for (var E = 0, O = (M = S[y]).slice(); E < O.length; E++) In((I = O[E]).obsSet, u.mutatedParts) && (je(M, I), I.subscribers.forEach(function(L) {
|
|
2675
2675
|
return g.add(L);
|
|
2676
2676
|
}));
|
|
2677
2677
|
else if (0 < v.length) {
|
|
2678
2678
|
p.optimisticOps = p.optimisticOps.filter(function(L) {
|
|
2679
2679
|
return L.trans !== u;
|
|
2680
2680
|
});
|
|
2681
|
-
for (var x = 0, P = Object.values(p.queries.query); x < P.length; x++) for (var
|
|
2681
|
+
for (var x = 0, P = Object.values(p.queries.query); x < P.length; x++) for (var M, I, C, j = 0, T = (M = P[x]).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
|
-
})) : C !== I.res && (I.res = C, I.promise =
|
|
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);
|
|
2685
2685
|
})));
|
|
2686
2686
|
}
|
|
@@ -2698,19 +2698,19 @@ var Mr = { exports: {} };
|
|
|
2698
2698
|
var c = G.trans;
|
|
2699
2699
|
if (a.outbound || c.db._options.cache === "disabled" || c.explicit || c.idbtrans.mode !== "readwrite") return i.mutate(o);
|
|
2700
2700
|
var u = Ue["idb://".concat(t, "/").concat(n)];
|
|
2701
|
-
return u ? (c = i.mutate(o), o.type !== "add" && o.type !== "put" || !(50 <= o.values.length ||
|
|
2701
|
+
return u ? (c = i.mutate(o), o.type !== "add" && o.type !== "put" || !(50 <= o.values.length || Kn(a, o).some(function(h) {
|
|
2702
2702
|
return h == null;
|
|
2703
|
-
})) ? (u.optimisticOps.push(o), o.mutatedParts &&
|
|
2704
|
-
0 < h.numFailures && (je(u.optimisticOps, o), (h = Ar(0, o, h)) && u.optimisticOps.push(h), o.mutatedParts &&
|
|
2703
|
+
})) ? (u.optimisticOps.push(o), o.mutatedParts && Yt(o.mutatedParts), c.then(function(h) {
|
|
2704
|
+
0 < h.numFailures && (je(u.optimisticOps, o), (h = Ar(0, o, h)) && u.optimisticOps.push(h), o.mutatedParts && Yt(o.mutatedParts));
|
|
2705
2705
|
}), c.catch(function() {
|
|
2706
|
-
je(u.optimisticOps, o), o.mutatedParts &&
|
|
2706
|
+
je(u.optimisticOps, o), o.mutatedParts && Yt(o.mutatedParts);
|
|
2707
2707
|
})) : c.then(function(h) {
|
|
2708
2708
|
var g = Ar(0, l(l({}, o), { values: o.values.map(function(b, d) {
|
|
2709
2709
|
var w;
|
|
2710
|
-
return h.failures[d] ? b : (b = (w = a.keyPath) !== null && w !== void 0 && w.includes(".") ? Me(b) : l({}, b),
|
|
2710
|
+
return h.failures[d] ? b : (b = (w = a.keyPath) !== null && w !== void 0 && w.includes(".") ? Me(b) : l({}, b), le(b, a.keyPath, h.results[d]), b);
|
|
2711
2711
|
}) }), h);
|
|
2712
2712
|
u.optimisticOps.push(g), queueMicrotask(function() {
|
|
2713
|
-
return o.mutatedParts &&
|
|
2713
|
+
return o.mutatedParts && Yt(o.mutatedParts);
|
|
2714
2714
|
});
|
|
2715
2715
|
}), c) : i.mutate(o);
|
|
2716
2716
|
}, query: function(o) {
|
|
@@ -2750,12 +2750,12 @@ var Mr = { exports: {} };
|
|
|
2750
2750
|
} });
|
|
2751
2751
|
} });
|
|
2752
2752
|
} };
|
|
2753
|
-
function
|
|
2753
|
+
function Xt(e, t) {
|
|
2754
2754
|
return new Proxy(e, { get: function(n, i, a) {
|
|
2755
2755
|
return i === "db" ? t : Reflect.get(n, i, a);
|
|
2756
2756
|
} });
|
|
2757
2757
|
}
|
|
2758
|
-
var Ee = (
|
|
2758
|
+
var Ee = (ne.prototype.version = function(e) {
|
|
2759
2759
|
if (isNaN(e) || e < 0.1) throw new $.Type("Given version is not a positive number");
|
|
2760
2760
|
if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened) throw new $.Schema("Cannot add version when database is open");
|
|
2761
2761
|
this.verno = Math.max(this.verno, e);
|
|
@@ -2763,9 +2763,9 @@ var Mr = { exports: {} };
|
|
|
2763
2763
|
return i._cfg.version === e;
|
|
2764
2764
|
})[0];
|
|
2765
2765
|
return n || (n = new this.Version(e), t.push(n), t.sort(fi), n.stores({}), this._state.autoSchema = !1, n);
|
|
2766
|
-
},
|
|
2766
|
+
}, ne.prototype._whenReady = function(e) {
|
|
2767
2767
|
var t = this;
|
|
2768
|
-
return this.idbdb && (this._state.openComplete || G.letThrough || this._vip) ? e() : new
|
|
2768
|
+
return this.idbdb && (this._state.openComplete || G.letThrough || this._vip) ? e() : new N(function(n, i) {
|
|
2769
2769
|
if (t._state.openComplete) return i(new $.DatabaseClosed(t._state.dbOpenError));
|
|
2770
2770
|
if (!t._state.isBeingOpened) {
|
|
2771
2771
|
if (!t._state.autoOpen) return void i(new $.DatabaseClosed());
|
|
@@ -2773,22 +2773,22 @@ var Mr = { exports: {} };
|
|
|
2773
2773
|
}
|
|
2774
2774
|
t._state.dbReadyPromise.then(n, i);
|
|
2775
2775
|
}).then(e);
|
|
2776
|
-
},
|
|
2776
|
+
}, ne.prototype.use = function(e) {
|
|
2777
2777
|
var t = e.stack, n = e.create, i = e.level, a = e.name;
|
|
2778
2778
|
return a && this.unuse({ stack: t, name: a }), e = this._middlewares[t] || (this._middlewares[t] = []), e.push({ stack: t, create: n, level: i ?? 10, name: a }), e.sort(function(o, c) {
|
|
2779
2779
|
return o.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
2783
|
return t && this._middlewares[t] && (this._middlewares[t] = this._middlewares[t].filter(function(a) {
|
|
2784
2784
|
return i ? a.create !== i : !!n && a.name !== n;
|
|
2785
2785
|
})), this;
|
|
2786
|
-
},
|
|
2786
|
+
}, ne.prototype.open = function() {
|
|
2787
2787
|
var e = this;
|
|
2788
2788
|
return Ge(Ae, function() {
|
|
2789
2789
|
return yi(e);
|
|
2790
2790
|
});
|
|
2791
|
-
},
|
|
2791
|
+
}, ne.prototype._close = function() {
|
|
2792
2792
|
var e = this._state, t = qe.indexOf(this);
|
|
2793
2793
|
if (0 <= t && qe.splice(t, 1), this.idbdb) {
|
|
2794
2794
|
try {
|
|
@@ -2797,47 +2797,47 @@ var Mr = { exports: {} };
|
|
|
2797
2797
|
}
|
|
2798
2798
|
this.idbdb = null;
|
|
2799
2799
|
}
|
|
2800
|
-
e.isBeingOpened || (e.dbReadyPromise = new
|
|
2800
|
+
e.isBeingOpened || (e.dbReadyPromise = new N(function(n) {
|
|
2801
2801
|
e.dbReadyResolve = n;
|
|
2802
|
-
}), e.openCanceller = new
|
|
2802
|
+
}), e.openCanceller = new N(function(n, i) {
|
|
2803
2803
|
e.cancelOpen = i;
|
|
2804
2804
|
}));
|
|
2805
|
-
},
|
|
2805
|
+
}, ne.prototype.close = function(n) {
|
|
2806
2806
|
var t = (n === void 0 ? { disableAutoOpen: !0 } : n).disableAutoOpen, n = this._state;
|
|
2807
2807
|
t ? (n.isBeingOpened && n.cancelOpen(new $.DatabaseClosed()), this._close(), n.autoOpen = !1, n.dbOpenError = new $.DatabaseClosed()) : (this._close(), n.autoOpen = this._options.autoOpen || n.isBeingOpened, n.openComplete = !1, n.dbOpenError = null);
|
|
2808
|
-
},
|
|
2808
|
+
}, ne.prototype.delete = function(e) {
|
|
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
|
|
2812
|
+
return new N(function(a, o) {
|
|
2813
2813
|
function c() {
|
|
2814
2814
|
t.close(e);
|
|
2815
2815
|
var u = t._deps.indexedDB.deleteDatabase(t.name);
|
|
2816
|
-
u.onsuccess =
|
|
2816
|
+
u.onsuccess = q(function() {
|
|
2817
2817
|
var h, g, b;
|
|
2818
|
-
h = t._deps, g = t.name, b = h.indexedDB, h = h.IDBKeyRange,
|
|
2818
|
+
h = t._deps, g = t.name, b = h.indexedDB, h = h.IDBKeyRange, An(b) || g === Mt || kn(b, h).delete(g).catch(X), a();
|
|
2819
2819
|
}), u.onerror = me(o), 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();
|
|
2823
2823
|
});
|
|
2824
|
-
},
|
|
2824
|
+
}, ne.prototype.backendDB = function() {
|
|
2825
2825
|
return this.idbdb;
|
|
2826
|
-
},
|
|
2826
|
+
}, ne.prototype.isOpen = function() {
|
|
2827
2827
|
return this.idbdb !== null;
|
|
2828
|
-
},
|
|
2828
|
+
}, ne.prototype.hasBeenClosed = function() {
|
|
2829
2829
|
var e = this._state.dbOpenError;
|
|
2830
2830
|
return e && e.name === "DatabaseClosed";
|
|
2831
|
-
},
|
|
2831
|
+
}, ne.prototype.hasFailed = function() {
|
|
2832
2832
|
return this._state.dbOpenError !== null;
|
|
2833
|
-
},
|
|
2833
|
+
}, ne.prototype.dynamicallyOpened = function() {
|
|
2834
2834
|
return this._state.autoSchema;
|
|
2835
|
-
}, Object.defineProperty(
|
|
2835
|
+
}, Object.defineProperty(ne.prototype, "tables", { get: function() {
|
|
2836
2836
|
var e = this;
|
|
2837
|
-
return
|
|
2837
|
+
return R(this._allTables).map(function(t) {
|
|
2838
2838
|
return e._allTables[t];
|
|
2839
2839
|
});
|
|
2840
|
-
}, enumerable: !1, configurable: !0 }),
|
|
2840
|
+
}, enumerable: !1, configurable: !0 }), ne.prototype.transaction = function() {
|
|
2841
2841
|
var e = (function(t, n, i) {
|
|
2842
2842
|
var a = arguments.length;
|
|
2843
2843
|
if (a < 2) throw new $.InvalidArgument("Too few arguments");
|
|
@@ -2845,7 +2845,7 @@ var Mr = { exports: {} };
|
|
|
2845
2845
|
return i = o.pop(), [t, Xn(o), i];
|
|
2846
2846
|
}).apply(this, arguments);
|
|
2847
2847
|
return this._transaction.apply(this, e);
|
|
2848
|
-
},
|
|
2848
|
+
}, ne.prototype._transaction = function(e, t, n) {
|
|
2849
2849
|
var i = this, a = G.trans;
|
|
2850
2850
|
a && a.db === this && e.indexOf("!") === -1 || (a = null);
|
|
2851
2851
|
var o, c, u = e.indexOf("?") !== -1;
|
|
@@ -2854,13 +2854,13 @@ var Mr = { exports: {} };
|
|
|
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 ===
|
|
2857
|
+
}), e == "r" || e === pn) o = pn;
|
|
2858
2858
|
else {
|
|
2859
|
-
if (e != "rw" && e !=
|
|
2860
|
-
o =
|
|
2859
|
+
if (e != "rw" && e != gn) throw new $.InvalidArgument("Invalid transaction mode: " + e);
|
|
2860
|
+
o = gn;
|
|
2861
2861
|
}
|
|
2862
2862
|
if (a) {
|
|
2863
|
-
if (a.mode ===
|
|
2863
|
+
if (a.mode === pn && o === gn) {
|
|
2864
2864
|
if (!u) throw new $.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
2865
2865
|
a = null;
|
|
2866
2866
|
}
|
|
@@ -2874,25 +2874,25 @@ var Mr = { exports: {} };
|
|
|
2874
2874
|
} catch (g) {
|
|
2875
2875
|
return a ? a._promise(null, function(b, d) {
|
|
2876
2876
|
d(g);
|
|
2877
|
-
}) :
|
|
2877
|
+
}) : te(g);
|
|
2878
2878
|
}
|
|
2879
2879
|
var h = (function g(b, d, w, p, m) {
|
|
2880
|
-
return
|
|
2880
|
+
return N.resolve().then(function() {
|
|
2881
2881
|
var v = G.transless || G, y = b._createTransaction(d, 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
|
-
return O.name ===
|
|
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
2887
|
return g(b, d, w, null, m);
|
|
2888
|
-
})) :
|
|
2888
|
+
})) : te(O);
|
|
2889
2889
|
}
|
|
2890
|
-
var S, E =
|
|
2891
|
-
return E && Ze(), v =
|
|
2890
|
+
var S, E = nn(m);
|
|
2891
|
+
return E && Ze(), v = N.follow(function() {
|
|
2892
2892
|
var O;
|
|
2893
|
-
(S = m.call(y, y)) && (E ? (O = Pe.bind(null, null), S.then(O, O)) : typeof S.next == "function" && typeof S.throw == "function" && (S =
|
|
2894
|
-
}, v), (S && typeof S.then == "function" ?
|
|
2895
|
-
return y.active ? O :
|
|
2893
|
+
(S = m.call(y, y)) && (E ? (O = Pe.bind(null, null), S.then(O, O)) : typeof S.next == "function" && typeof S.throw == "function" && (S = Mn(S)));
|
|
2894
|
+
}, v), (S && typeof S.then == "function" ? N.resolve(S).then(function(O) {
|
|
2895
|
+
return y.active ? O : te(new $.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
2896
2896
|
}) : v.then(function() {
|
|
2897
2897
|
return S;
|
|
2898
2898
|
})).then(function(O) {
|
|
@@ -2900,32 +2900,32 @@ var Mr = { exports: {} };
|
|
|
2900
2900
|
return O;
|
|
2901
2901
|
});
|
|
2902
2902
|
}).catch(function(O) {
|
|
2903
|
-
return y._reject(O),
|
|
2903
|
+
return y._reject(O), te(O);
|
|
2904
2904
|
});
|
|
2905
2905
|
});
|
|
2906
2906
|
}).bind(null, this, o, c, a, n);
|
|
2907
2907
|
return a ? a._promise(o, h, "lock") : G.trans ? Ge(G.transless, function() {
|
|
2908
2908
|
return i._whenReady(h);
|
|
2909
2909
|
}) : this._whenReady(h);
|
|
2910
|
-
},
|
|
2911
|
-
if (!
|
|
2910
|
+
}, ne.prototype.table = function(e) {
|
|
2911
|
+
if (!Z(this._allTables, e)) throw new $.InvalidTable("Table ".concat(e, " does not exist"));
|
|
2912
2912
|
return this._allTables[e];
|
|
2913
|
-
},
|
|
2914
|
-
function
|
|
2913
|
+
}, ne);
|
|
2914
|
+
function ne(e, t) {
|
|
2915
2915
|
var n = this;
|
|
2916
2916
|
this._middlewares = {}, this.verno = 0;
|
|
2917
|
-
var i =
|
|
2918
|
-
this._options = t = l({ addons:
|
|
2917
|
+
var i = ne.dependencies;
|
|
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
2919
|
var a, o, 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
|
|
2920
|
+
g.dbReadyPromise = new N(function(d) {
|
|
2921
2921
|
g.dbReadyResolve = d;
|
|
2922
|
-
}), g.openCanceller = new
|
|
2922
|
+
}), g.openCanceller = new N(function(d, 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: [an, X] }), this.on.ready.subscribe = Hn(this.on.ready.subscribe, function(d) {
|
|
2925
2925
|
return function(w, p) {
|
|
2926
|
-
|
|
2926
|
+
ne.vip(function() {
|
|
2927
2927
|
var m, v = n._state;
|
|
2928
|
-
v.openComplete ? (v.dbOpenError ||
|
|
2928
|
+
v.openComplete ? (v.dbOpenError || N.resolve().then(w), p && d(w)) : v.onReadyBeingFired ? (v.onReadyBeingFired.push(w), p && d(w)) : (d(w), m = n, p || d(function y() {
|
|
2929
2929
|
m.on.ready.unsubscribe(w), m.on.ready.unsubscribe(y);
|
|
2930
2930
|
}));
|
|
2931
2931
|
});
|
|
@@ -2944,13 +2944,13 @@ var Mr = { exports: {} };
|
|
|
2944
2944
|
this.db = o, this._tx = p, this.name = d, this.schema = w, this.hook = o._allTables[d] ? o._allTables[d].hook : dt(null, { creating: [Jr, X], reading: [Xr, ot], updating: [Zr, X], deleting: [Vr, X] });
|
|
2945
2945
|
})), this.Transaction = (c = this, ft(ci.prototype, function(d, w, p, m, v) {
|
|
2946
2946
|
var y = this;
|
|
2947
|
-
this.db = c, this.mode = d, this.storeNames = w, this.schema = p, this.chromeTransactionDurability = m, this.idbtrans = null, this.on = dt(this, "complete", "error", "abort"), this.parent = v || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new
|
|
2947
|
+
this.db = c, this.mode = d, 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();
|
|
2951
2951
|
}, function(S) {
|
|
2952
2952
|
var E = y.active;
|
|
2953
|
-
return y.active = !1, y.on.error.fire(S), y.parent ? y.parent._reject(S) : E && y.idbtrans && y.idbtrans.abort(),
|
|
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
2955
|
})), this.Version = (u = this, ft(gi.prototype, function(d) {
|
|
2956
2956
|
this.db = u, this._cfg = { version: d, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
@@ -2978,47 +2978,47 @@ var Mr = { exports: {} };
|
|
|
2978
2978
|
var b = new Proxy(this, { get: function(d, w, p) {
|
|
2979
2979
|
if (w === "_vip") return !0;
|
|
2980
2980
|
if (w === "table") return function(v) {
|
|
2981
|
-
return
|
|
2981
|
+
return Xt(n.table(v), b);
|
|
2982
2982
|
};
|
|
2983
2983
|
var m = Reflect.get(d, w, p);
|
|
2984
|
-
return m instanceof lr ?
|
|
2985
|
-
return
|
|
2984
|
+
return m instanceof lr ? Xt(m, b) : w === "tables" ? m.map(function(v) {
|
|
2985
|
+
return Xt(v, b);
|
|
2986
2986
|
}) : w === "_createTransaction" ? function() {
|
|
2987
|
-
return
|
|
2987
|
+
return Xt(m.apply(this, arguments), b);
|
|
2988
2988
|
} : m;
|
|
2989
2989
|
} });
|
|
2990
2990
|
this.vip = b, i.forEach(function(d) {
|
|
2991
2991
|
return d(n);
|
|
2992
2992
|
});
|
|
2993
2993
|
}
|
|
2994
|
-
var
|
|
2994
|
+
var Jt, he = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", Oi = (Bn.prototype.subscribe = function(e, t, n) {
|
|
2995
2995
|
return this._subscribe(e && typeof e != "function" ? e : { next: e, error: t, complete: n });
|
|
2996
|
-
},
|
|
2996
|
+
}, Bn.prototype[he] = function() {
|
|
2997
2997
|
return this;
|
|
2998
|
-
},
|
|
2999
|
-
function
|
|
2998
|
+
}, Bn);
|
|
2999
|
+
function Bn(e) {
|
|
3000
3000
|
this._subscribe = e;
|
|
3001
3001
|
}
|
|
3002
3002
|
try {
|
|
3003
|
-
|
|
3003
|
+
Jt = { indexedDB: D.indexedDB || D.mozIndexedDB || D.webkitIndexedDB || D.msIndexedDB, IDBKeyRange: D.IDBKeyRange || D.webkitIDBKeyRange };
|
|
3004
3004
|
} catch {
|
|
3005
|
-
|
|
3005
|
+
Jt = { indexedDB: null, IDBKeyRange: null };
|
|
3006
3006
|
}
|
|
3007
3007
|
function Ir(e) {
|
|
3008
3008
|
var t, n = !1, i = new Oi(function(a) {
|
|
3009
|
-
var o =
|
|
3009
|
+
var o = nn(e), c, u = !1, h = {}, g = {}, b = { get closed() {
|
|
3010
3010
|
return u;
|
|
3011
3011
|
}, unsubscribe: function() {
|
|
3012
3012
|
u || (u = !0, c && c.abort(), d && Re.storagemutated.unsubscribe(p));
|
|
3013
3013
|
} };
|
|
3014
3014
|
a.start && a.start(b);
|
|
3015
3015
|
var d = !1, w = function() {
|
|
3016
|
-
return
|
|
3016
|
+
return hn(m);
|
|
3017
3017
|
}, p = function(v) {
|
|
3018
|
-
|
|
3018
|
+
Ht(h, v), In(g, h) && w();
|
|
3019
3019
|
}, m = function() {
|
|
3020
3020
|
var v, y, S;
|
|
3021
|
-
!u &&
|
|
3021
|
+
!u && Jt.indexedDB && (h = {}, v = {}, c && c.abort(), c = new AbortController(), S = function(E) {
|
|
3022
3022
|
var O = Je();
|
|
3023
3023
|
try {
|
|
3024
3024
|
o && Ze();
|
|
@@ -3029,13 +3029,13 @@ var Mr = { exports: {} };
|
|
|
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 x in O) if (
|
|
3032
|
+
for (var x in O) if (Z(O, x)) return;
|
|
3033
3033
|
return 1;
|
|
3034
|
-
}(g = v) || d || (Re(gt, p), d = !0),
|
|
3034
|
+
}(g = v) || d || (Re(gt, p), d = !0), hn(function() {
|
|
3035
3035
|
return !u && a.next && a.next(E);
|
|
3036
3036
|
}));
|
|
3037
3037
|
}, function(E) {
|
|
3038
|
-
n = !1, ["DatabaseClosedError", "AbortError"].includes(E == null ? void 0 : E.name) || u ||
|
|
3038
|
+
n = !1, ["DatabaseClosedError", "AbortError"].includes(E == null ? void 0 : E.name) || u || hn(function() {
|
|
3039
3039
|
u || a.error && a.error(E);
|
|
3040
3040
|
});
|
|
3041
3041
|
}));
|
|
@@ -3049,15 +3049,15 @@ var Mr = { exports: {} };
|
|
|
3049
3049
|
}, i;
|
|
3050
3050
|
}
|
|
3051
3051
|
var We = Ee;
|
|
3052
|
-
function
|
|
3052
|
+
function Ln(e) {
|
|
3053
3053
|
var t = Te;
|
|
3054
3054
|
try {
|
|
3055
|
-
Te = !0, Re.storagemutated.fire(e),
|
|
3055
|
+
Te = !0, Re.storagemutated.fire(e), Tn(e, !0);
|
|
3056
3056
|
} finally {
|
|
3057
3057
|
Te = t;
|
|
3058
3058
|
}
|
|
3059
3059
|
}
|
|
3060
|
-
xe(We, l(l({},
|
|
3060
|
+
xe(We, l(l({}, xt), { delete: function(e) {
|
|
3061
3061
|
return new We(e, { addons: [] }).delete();
|
|
3062
3062
|
}, exists: function(e) {
|
|
3063
3063
|
return new We(e, { addons: [] }).open().then(function(t) {
|
|
@@ -3067,15 +3067,15 @@ var Mr = { exports: {} };
|
|
|
3067
3067
|
});
|
|
3068
3068
|
}, getDatabaseNames: function(e) {
|
|
3069
3069
|
try {
|
|
3070
|
-
return t = We.dependencies, n = t.indexedDB, t = t.IDBKeyRange, (
|
|
3070
|
+
return t = We.dependencies, n = t.indexedDB, t = t.IDBKeyRange, (An(n) ? Promise.resolve(n.databases()).then(function(i) {
|
|
3071
3071
|
return i.map(function(a) {
|
|
3072
3072
|
return a.name;
|
|
3073
3073
|
}).filter(function(a) {
|
|
3074
|
-
return a !==
|
|
3074
|
+
return a !== Mt;
|
|
3075
3075
|
});
|
|
3076
|
-
}) :
|
|
3076
|
+
}) : kn(n, t).toCollection().primaryKeys()).then(e);
|
|
3077
3077
|
} catch {
|
|
3078
|
-
return
|
|
3078
|
+
return te(new $.MissingAPI());
|
|
3079
3079
|
}
|
|
3080
3080
|
var t, n;
|
|
3081
3081
|
}, defineClass: function() {
|
|
@@ -3084,48 +3084,48 @@ var Mr = { exports: {} };
|
|
|
3084
3084
|
};
|
|
3085
3085
|
}, ignoreTransaction: function(e) {
|
|
3086
3086
|
return G.trans ? Ge(G.transless, e) : e();
|
|
3087
|
-
}, vip:
|
|
3087
|
+
}, vip: Dn, async: function(e) {
|
|
3088
3088
|
return function() {
|
|
3089
3089
|
try {
|
|
3090
|
-
var t =
|
|
3091
|
-
return t && typeof t.then == "function" ? t :
|
|
3090
|
+
var t = Mn(e.apply(this, arguments));
|
|
3091
|
+
return t && typeof t.then == "function" ? t : N.resolve(t);
|
|
3092
3092
|
} catch (n) {
|
|
3093
|
-
return
|
|
3093
|
+
return te(n);
|
|
3094
3094
|
}
|
|
3095
3095
|
};
|
|
3096
3096
|
}, spawn: function(e, t, n) {
|
|
3097
3097
|
try {
|
|
3098
|
-
var i =
|
|
3099
|
-
return i && typeof i.then == "function" ? i :
|
|
3098
|
+
var i = Mn(e.apply(n, t || []));
|
|
3099
|
+
return i && typeof i.then == "function" ? i : N.resolve(i);
|
|
3100
3100
|
} catch (a) {
|
|
3101
|
-
return
|
|
3101
|
+
return te(a);
|
|
3102
3102
|
}
|
|
3103
3103
|
}, currentTransaction: { get: function() {
|
|
3104
3104
|
return G.trans || null;
|
|
3105
3105
|
} }, waitFor: function(e, t) {
|
|
3106
|
-
return t =
|
|
3107
|
-
}, Promise:
|
|
3106
|
+
return t = N.resolve(typeof e == "function" ? We.ignoreTransaction(e) : e).timeout(t || 6e4), G.trans ? G.trans.waitFor(t) : t;
|
|
3107
|
+
}, Promise: N, debug: { get: function() {
|
|
3108
3108
|
return ye;
|
|
3109
3109
|
}, set: function(e) {
|
|
3110
3110
|
qn(e);
|
|
3111
|
-
} }, derive: He, extend: Q, props: xe, override: Hn, Events: dt, on: Re, liveQuery: Ir, extendObservabilitySet:
|
|
3112
|
-
typeof t == "string" ?
|
|
3113
|
-
|
|
3111
|
+
} }, derive: He, extend: Q, props: xe, override: Hn, Events: dt, on: Re, liveQuery: Ir, extendObservabilitySet: Ht, getByKeyPath: ve, setByKeyPath: le, delByKeyPath: function(e, t) {
|
|
3112
|
+
typeof t == "string" ? le(e, t, void 0) : "length" in t && [].map.call(t, function(n) {
|
|
3113
|
+
le(e, n, void 0);
|
|
3114
3114
|
});
|
|
3115
|
-
}, shallowClone: Qn, deepClone: Me, getObjectDiff:
|
|
3115
|
+
}, shallowClone: Qn, deepClone: Me, getObjectDiff: jn, cmp: H, asap: Yn, minKey: -1 / 0, addons: [], connections: qe, errnames: rn, dependencies: Jt, cache: Ue, semVer: "4.0.10", version: "4.0.10".split(".").map(function(e) {
|
|
3116
3116
|
return parseInt(e);
|
|
3117
3117
|
}).reduce(function(e, t, n) {
|
|
3118
3118
|
return e + t / Math.pow(10, 2 * n);
|
|
3119
3119
|
}) })), We.maxKey = yt(We.dependencies.IDBKeyRange), typeof dispatchEvent < "u" && typeof addEventListener < "u" && (Re(gt, function(e) {
|
|
3120
|
-
Te || (e = new CustomEvent(
|
|
3121
|
-
}), addEventListener(
|
|
3122
|
-
e = e.detail, Te ||
|
|
3120
|
+
Te || (e = new CustomEvent(vn, { detail: e }), Te = !0, dispatchEvent(e), Te = !1);
|
|
3121
|
+
}), addEventListener(vn, function(e) {
|
|
3122
|
+
e = e.detail, Te || Ln(e);
|
|
3123
3123
|
}));
|
|
3124
3124
|
var nt, Te = !1, Cr = function() {
|
|
3125
3125
|
};
|
|
3126
3126
|
return typeof BroadcastChannel < "u" && ((Cr = function() {
|
|
3127
|
-
(nt = new BroadcastChannel(
|
|
3128
|
-
return e.data &&
|
|
3127
|
+
(nt = new BroadcastChannel(vn)).onmessage = function(e) {
|
|
3128
|
+
return e.data && Ln(e.data);
|
|
3129
3129
|
};
|
|
3130
3130
|
})(), typeof nt.unref == "function" && nt.unref(), Re(gt, function(e) {
|
|
3131
3131
|
Te || nt.postMessage(e);
|
|
@@ -3135,8 +3135,8 @@ 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(),
|
|
3139
|
-
})),
|
|
3138
|
+
!Ee.disableBfCache && e.persisted && (ye && console.debug("Dexie: handling persisted pageshow"), Cr(), Ln({ all: new oe(-1 / 0, [[]]) }));
|
|
3139
|
+
})), N.rejectionMapper = function(e, t) {
|
|
3140
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 && ke(t, "stack", { get: function() {
|
|
3141
3141
|
return this.inner.stack;
|
|
3142
3142
|
} }), t);
|
|
@@ -3150,9 +3150,9 @@ var Mr = { exports: {} };
|
|
|
3150
3150
|
});
|
|
3151
3151
|
})(Mr);
|
|
3152
3152
|
var Ii = Mr.exports;
|
|
3153
|
-
const
|
|
3154
|
-
if (
|
|
3155
|
-
throw new Error(`Two different versions of Dexie loaded in the same app: ${
|
|
3153
|
+
const Un = /* @__PURE__ */ Pi(Ii), Tr = Symbol.for("Dexie"), Wn = globalThis[Tr] || (globalThis[Tr] = Un);
|
|
3154
|
+
if (Un.semVer !== Wn.semVer)
|
|
3155
|
+
throw new Error(`Two different versions of Dexie loaded in the same app: ${Un.semVer} and ${Wn.semVer}`);
|
|
3156
3156
|
function J(f) {
|
|
3157
3157
|
let r = `${f.type}.${f.topics}`;
|
|
3158
3158
|
return f.order && (r += `.${f.order}`), f.period && (r += `.${f.period}`), r;
|
|
@@ -3167,15 +3167,15 @@ function rt(f) {
|
|
|
3167
3167
|
}
|
|
3168
3168
|
function _t(f, r) {
|
|
3169
3169
|
var B;
|
|
3170
|
-
let s, l,
|
|
3170
|
+
let s, l, k, D, R;
|
|
3171
3171
|
switch (f.moderation) {
|
|
3172
|
-
case
|
|
3173
|
-
s = /* @__PURE__ */ new Date(), l = (B = f.beforeTime) == null ? void 0 : B.split(":"),
|
|
3172
|
+
case qt.BEFORE:
|
|
3173
|
+
s = /* @__PURE__ */ new Date(), l = (B = f.beforeTime) == null ? void 0 : B.split(":"), k = Number.parseInt(l ? l[0] : "00"), D = Number.parseInt(l ? l[1] : "00"), R = Number.parseInt(l ? l[2] : "00"), r.before = s.setHours(k, D, R, 0) / 1e3, r.period || (r.period = s.getDay() === 1 ? 72 : 24);
|
|
3174
3174
|
break;
|
|
3175
|
-
case
|
|
3175
|
+
case qt.DELAYED:
|
|
3176
3176
|
f.delay && f.delay > 0 && (r.delay = `${f.delay}`);
|
|
3177
3177
|
break;
|
|
3178
|
-
case
|
|
3178
|
+
case qt.APPROVED:
|
|
3179
3179
|
r.approved = "1";
|
|
3180
3180
|
break;
|
|
3181
3181
|
default:
|
|
@@ -3185,16 +3185,16 @@ function _t(f, r) {
|
|
|
3185
3185
|
}
|
|
3186
3186
|
class jr {
|
|
3187
3187
|
constructor(r) {
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3188
|
+
A(this, "db");
|
|
3189
|
+
A(this, "subscribers", []);
|
|
3190
|
+
A(this, "options");
|
|
3191
3191
|
/**
|
|
3192
3192
|
* Retrieve Cloud Data
|
|
3193
3193
|
* @param query IQuery
|
|
3194
3194
|
* @returns IResponse
|
|
3195
3195
|
*/
|
|
3196
|
-
|
|
3197
|
-
const s = await this.db.table(
|
|
3196
|
+
A(this, "getCloud", async (r) => {
|
|
3197
|
+
const s = await this.db.table(K.CLOUD).where({ id: r.widget }).last().catch(() => {
|
|
3198
3198
|
console.warn(
|
|
3199
3199
|
"%capi%C %ccloud",
|
|
3200
3200
|
_.API,
|
|
@@ -3211,8 +3211,8 @@ class jr {
|
|
|
3211
3211
|
* @param query IQuery
|
|
3212
3212
|
* @returns IResponse
|
|
3213
3213
|
*/
|
|
3214
|
-
|
|
3215
|
-
const s = await this.db.table(
|
|
3214
|
+
A(this, "getSeries", async (r) => {
|
|
3215
|
+
const s = await this.db.table(K.SERIES).where({ id: r.widget }).last().catch(() => {
|
|
3216
3216
|
console.warn(
|
|
3217
3217
|
"%capi%c %cseries",
|
|
3218
3218
|
_.API,
|
|
@@ -3229,10 +3229,10 @@ class jr {
|
|
|
3229
3229
|
* @param query IQuery
|
|
3230
3230
|
* @returns IResponse
|
|
3231
3231
|
*/
|
|
3232
|
-
|
|
3233
|
-
const s = (
|
|
3232
|
+
A(this, "getMessages", async (r) => {
|
|
3233
|
+
const s = (R) => R.widget_id === r.widget, l = (R) => R.utc > ((r == null ? void 0 : r.since) || 0), k = (R) => (R == null ? void 0 : R.visible) !== 0, D = r.order ?? "utc";
|
|
3234
3234
|
try {
|
|
3235
|
-
const
|
|
3235
|
+
const R = await this.db.table(K.TOPICS).orderBy(D).reverse().filter(s).filter(l).filter(k).limit((r == null ? void 0 : r.limit) ?? 25).toArray().catch(() => {
|
|
3236
3236
|
console.warn(
|
|
3237
3237
|
"%capi%c %cmessages",
|
|
3238
3238
|
_.API,
|
|
@@ -3242,19 +3242,19 @@ class jr {
|
|
|
3242
3242
|
r.widget
|
|
3243
3243
|
);
|
|
3244
3244
|
});
|
|
3245
|
-
if (
|
|
3245
|
+
if (R.length === 0)
|
|
3246
3246
|
return { data: null, message: "No Messages error", success: !1 };
|
|
3247
|
-
const
|
|
3248
|
-
(
|
|
3249
|
-
),
|
|
3250
|
-
(
|
|
3247
|
+
const B = R[0] ? R[0].title : "No title", Q = R.map(
|
|
3248
|
+
(Z) => Z.message_id
|
|
3249
|
+
), ge = (await this.db.table(K.MESSAGES).where("id").anyOf(Q).toArray().then((Z) => Z.sort((xe, St) => St.utc - xe.utc))).map(
|
|
3250
|
+
(Z) => Z.data
|
|
3251
3251
|
);
|
|
3252
3252
|
return {
|
|
3253
3253
|
data: {
|
|
3254
3254
|
presentation: (r == null ? void 0 : r.presentation) || "not set",
|
|
3255
3255
|
slide: (r == null ? void 0 : r.slide) || "not set",
|
|
3256
|
-
messages:
|
|
3257
|
-
title:
|
|
3256
|
+
messages: ge,
|
|
3257
|
+
title: B,
|
|
3258
3258
|
dashboard: r.dashboard,
|
|
3259
3259
|
widget: r.widget,
|
|
3260
3260
|
topics: [r.dashboard, r.widget].join("-"),
|
|
@@ -3263,8 +3263,8 @@ class jr {
|
|
|
3263
3263
|
message: "Messages retrieved successfully",
|
|
3264
3264
|
success: !0
|
|
3265
3265
|
};
|
|
3266
|
-
} catch (
|
|
3267
|
-
return console.error("%cstorage", _.STORAGE, "set", r,
|
|
3266
|
+
} catch (R) {
|
|
3267
|
+
return console.error("%cstorage", _.STORAGE, "set", r, R), { data: null, message: "Messages Data error", success: !1 };
|
|
3268
3268
|
}
|
|
3269
3269
|
});
|
|
3270
3270
|
/**
|
|
@@ -3273,7 +3273,7 @@ class jr {
|
|
|
3273
3273
|
* @param data
|
|
3274
3274
|
* @returns number
|
|
3275
3275
|
*/
|
|
3276
|
-
|
|
3276
|
+
A(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
|
+
A(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,83 +3295,83 @@ class jr {
|
|
|
3295
3295
|
* @param data any
|
|
3296
3296
|
* @returns number
|
|
3297
3297
|
*/
|
|
3298
|
-
|
|
3299
|
-
if (r.type !==
|
|
3298
|
+
A(this, "setMessages", async (r, s) => {
|
|
3299
|
+
if (r.type !== K.MESSAGES)
|
|
3300
3300
|
return 400;
|
|
3301
3301
|
const l = s.data.title;
|
|
3302
|
-
let
|
|
3303
|
-
return s.data.messages.forEach(async (
|
|
3304
|
-
var
|
|
3305
|
-
|
|
3306
|
-
id:
|
|
3307
|
-
utc:
|
|
3308
|
-
data:
|
|
3309
|
-
expires:
|
|
3310
|
-
}).catch((
|
|
3311
|
-
|
|
3302
|
+
let k = 0;
|
|
3303
|
+
return s.data.messages.forEach(async (D) => {
|
|
3304
|
+
var R, B, Q, ee;
|
|
3305
|
+
D.id !== null && (await this.db.table(K.MESSAGES).put({
|
|
3306
|
+
id: D.id,
|
|
3307
|
+
utc: D.utc,
|
|
3308
|
+
data: D,
|
|
3309
|
+
expires: D.expires
|
|
3310
|
+
}).catch((ge) => {
|
|
3311
|
+
k++, console.error(
|
|
3312
3312
|
"%cstorage",
|
|
3313
3313
|
_.STORAGE,
|
|
3314
3314
|
"set message",
|
|
3315
3315
|
`title: ${l}`,
|
|
3316
|
-
|
|
3317
|
-
|
|
3316
|
+
D,
|
|
3317
|
+
ge.message
|
|
3318
3318
|
);
|
|
3319
|
-
}), await this.db.table(
|
|
3319
|
+
}), await this.db.table(K.TOPICS).put({
|
|
3320
3320
|
title: l,
|
|
3321
3321
|
widget_id: r.widget,
|
|
3322
|
-
message_id:
|
|
3322
|
+
message_id: D.id,
|
|
3323
3323
|
dashboard_id: r.dashboard,
|
|
3324
|
-
engagement: (
|
|
3325
|
-
impressions: (B =
|
|
3326
|
-
reach: (Q =
|
|
3327
|
-
sentiment: ((
|
|
3328
|
-
utc:
|
|
3329
|
-
expires:
|
|
3330
|
-
}).catch((
|
|
3331
|
-
|
|
3324
|
+
engagement: (R = D.dynamics) == null ? void 0 : R.engagement,
|
|
3325
|
+
impressions: (B = D.dynamics) == null ? void 0 : B.semrush_visits,
|
|
3326
|
+
reach: (Q = D.dynamics) == null ? void 0 : Q.potential_reach,
|
|
3327
|
+
sentiment: ((ee = D.topics[0]) == null ? void 0 : ee.sentiment) || 0,
|
|
3328
|
+
utc: D.utc,
|
|
3329
|
+
expires: D.expires
|
|
3330
|
+
}).catch((ge) => {
|
|
3331
|
+
k++, console.error(
|
|
3332
3332
|
"%cstorage",
|
|
3333
3333
|
_.STORAGE,
|
|
3334
3334
|
"set topic",
|
|
3335
3335
|
`title: ${l}`,
|
|
3336
|
-
|
|
3337
|
-
|
|
3336
|
+
D,
|
|
3337
|
+
ge.message
|
|
3338
3338
|
);
|
|
3339
3339
|
}));
|
|
3340
|
-
}), s.data.topics.forEach(async (
|
|
3341
|
-
const
|
|
3342
|
-
await this.db.table(
|
|
3343
|
-
|
|
3340
|
+
}), s.data.topics.forEach(async (D) => {
|
|
3341
|
+
const R = D.message_id, B = D.visible ? 1 : 0, Q = D.title;
|
|
3342
|
+
await this.db.table(K.TOPICS).where("message_id").equals(R).modify({ visible: B }).catch((ee) => {
|
|
3343
|
+
k++, console.error(
|
|
3344
3344
|
"%cstorage",
|
|
3345
3345
|
_.STORAGE,
|
|
3346
3346
|
"update message visibility",
|
|
3347
3347
|
`title: ${Q}`,
|
|
3348
|
-
`widget: ${
|
|
3349
|
-
|
|
3348
|
+
`widget: ${D.widget_id}`,
|
|
3349
|
+
ee.message
|
|
3350
3350
|
);
|
|
3351
3351
|
});
|
|
3352
|
-
}),
|
|
3352
|
+
}), k === 0 ? 201 : 400;
|
|
3353
3353
|
});
|
|
3354
3354
|
/**
|
|
3355
3355
|
* Wipe Message data after expires timestamp
|
|
3356
3356
|
*/
|
|
3357
|
-
|
|
3358
|
-
const r = Date.now() / 1e3, s = (
|
|
3359
|
-
return await this.db.table(
|
|
3357
|
+
A(this, "cleanMessages", async () => {
|
|
3358
|
+
const r = Date.now() / 1e3, s = (D) => D.expires < r, l = (D) => D.expires < r;
|
|
3359
|
+
return await this.db.table(K.TOPICS).orderBy("expires").filter(s).delete().catch((D) => (console.error(
|
|
3360
3360
|
"%cstorage%c %cclean",
|
|
3361
3361
|
_.STORAGE,
|
|
3362
3362
|
_.NONE,
|
|
3363
3363
|
_.MESSAGES,
|
|
3364
|
-
|
|
3365
|
-
), 0)), await this.db.table(
|
|
3364
|
+
D.message
|
|
3365
|
+
), 0)), await this.db.table(K.MESSAGES).orderBy("expires").filter(l).delete().catch((D) => (console.error(
|
|
3366
3366
|
"%cstorage%c %clean",
|
|
3367
3367
|
_.STORAGE,
|
|
3368
3368
|
_.NONE,
|
|
3369
3369
|
_.MESSAGES,
|
|
3370
|
-
|
|
3370
|
+
D.message
|
|
3371
3371
|
), 0));
|
|
3372
3372
|
});
|
|
3373
|
-
|
|
3374
|
-
await this.db.table(
|
|
3373
|
+
A(this, "hideMessage", async (r, s) => {
|
|
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,
|
|
3377
3377
|
_.NONE,
|
|
@@ -3384,14 +3384,14 @@ class jr {
|
|
|
3384
3384
|
* @param query IQuery
|
|
3385
3385
|
* @returns number
|
|
3386
3386
|
*/
|
|
3387
|
-
|
|
3387
|
+
A(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
|
|
3391
3391
|
}).then(() => 201).catch((s) => (console.error(
|
|
3392
3392
|
"%cstorage",
|
|
3393
3393
|
_.STORAGE,
|
|
3394
|
-
|
|
3394
|
+
K.WIDGET,
|
|
3395
3395
|
r,
|
|
3396
3396
|
s.message
|
|
3397
3397
|
), 400)));
|
|
@@ -3400,9 +3400,9 @@ class jr {
|
|
|
3400
3400
|
* @param query IQuery
|
|
3401
3401
|
* @returns null
|
|
3402
3402
|
*/
|
|
3403
|
-
|
|
3403
|
+
A(this, "subscribe", (r) => (r = rt(r), this.subscribers.filter(
|
|
3404
3404
|
(l) => l.widget === r.widget
|
|
3405
|
-
).length > 0 || (r.type ===
|
|
3405
|
+
).length > 0 || (r.type === K.MESSAGES && (r = _t(this.options, r)), console.debug(
|
|
3406
3406
|
"%cstorage%c %csubscribe",
|
|
3407
3407
|
_.STORAGE,
|
|
3408
3408
|
_.NONE,
|
|
@@ -3414,14 +3414,14 @@ class jr {
|
|
|
3414
3414
|
* Get current subscribers
|
|
3415
3415
|
* @returns IQuery[]
|
|
3416
3416
|
*/
|
|
3417
|
-
|
|
3417
|
+
A(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
|
-
|
|
3424
|
-
const s = await this.db.table(
|
|
3423
|
+
A(this, "loadSlide", async (r) => {
|
|
3424
|
+
const s = await this.db.table(K.SLIDE).where({ id: r.id }).last().catch(() => {
|
|
3425
3425
|
console.warn(
|
|
3426
3426
|
"%capi%c %cseries",
|
|
3427
3427
|
_.API,
|
|
@@ -3437,7 +3437,7 @@ class jr {
|
|
|
3437
3437
|
* @param query IQuery
|
|
3438
3438
|
* @returns number
|
|
3439
3439
|
*/
|
|
3440
|
-
|
|
3440
|
+
A(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 || {},
|
|
@@ -3450,7 +3450,7 @@ class jr {
|
|
|
3450
3450
|
r,
|
|
3451
3451
|
s.message
|
|
3452
3452
|
), 422)) : 422);
|
|
3453
|
-
this.options = r, this.db = new
|
|
3453
|
+
this.options = r, this.db = new Wn(r.app), this.db.version(6).stores({
|
|
3454
3454
|
player: "id,title,name,location",
|
|
3455
3455
|
monitor: "id,player_id,cols,rows,order,width,height,physicalwidth,physicalheight,devicePixelRatio,screenLeft,screenTop,orientation,monitor",
|
|
3456
3456
|
display: "id,monitor_id,presentation_id,colstart,colend,rowstart,rowend",
|
|
@@ -3465,7 +3465,7 @@ class jr {
|
|
|
3465
3465
|
}), this.db.open();
|
|
3466
3466
|
}
|
|
3467
3467
|
}
|
|
3468
|
-
function
|
|
3468
|
+
function zn(f) {
|
|
3469
3469
|
return new Promise((r, s) => {
|
|
3470
3470
|
f.oncomplete = f.onsuccess = () => r(f.result), f.onabort = f.onerror = () => s(f.error);
|
|
3471
3471
|
});
|
|
@@ -3473,34 +3473,34 @@ function Wn(f) {
|
|
|
3473
3473
|
function Ci(f, r) {
|
|
3474
3474
|
const s = indexedDB.open(f);
|
|
3475
3475
|
s.onupgradeneeded = () => s.result.createObjectStore(r);
|
|
3476
|
-
const l =
|
|
3477
|
-
return (
|
|
3476
|
+
const l = zn(s);
|
|
3477
|
+
return (k, D) => l.then((R) => D(R.transaction(r, k).objectStore(r)));
|
|
3478
3478
|
}
|
|
3479
|
-
let
|
|
3479
|
+
let $n;
|
|
3480
3480
|
function Kr() {
|
|
3481
|
-
return
|
|
3481
|
+
return $n || ($n = Ci("keyval-store", "keyval")), $n;
|
|
3482
3482
|
}
|
|
3483
|
-
function
|
|
3484
|
-
return r("readonly", (s) =>
|
|
3483
|
+
function Zt(f, r = Kr()) {
|
|
3484
|
+
return r("readonly", (s) => zn(s.get(f)));
|
|
3485
3485
|
}
|
|
3486
3486
|
function wt(f, r, s = Kr()) {
|
|
3487
|
-
return s("readwrite", (l) => (l.put(r, f),
|
|
3487
|
+
return s("readwrite", (l) => (l.put(r, f), zn(l.transaction)));
|
|
3488
3488
|
}
|
|
3489
3489
|
class Nr {
|
|
3490
3490
|
constructor(r) {
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3491
|
+
A(this, "subscribers", []);
|
|
3492
|
+
A(this, "options");
|
|
3493
|
+
A(this, "getCloud", async (r) => {
|
|
3494
3494
|
const s = J(r);
|
|
3495
|
-
return await
|
|
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
|
+
A(this, "getSeries", async (r) => {
|
|
3498
3498
|
const s = J(r);
|
|
3499
|
-
return await
|
|
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
|
+
A(this, "getMessages", async (r) => {
|
|
3502
3502
|
const s = J(r);
|
|
3503
|
-
return await
|
|
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
|
});
|
|
3505
3505
|
/**
|
|
3506
3506
|
* Update Cloud
|
|
@@ -3508,11 +3508,11 @@ class Nr {
|
|
|
3508
3508
|
* @param data
|
|
3509
3509
|
* @returns number
|
|
3510
3510
|
*/
|
|
3511
|
-
|
|
3511
|
+
A(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((k) => (console.error("%cstorage", _.STORAGE, K.CLOUD, r, k.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
|
+
A(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((k) => (console.error("%cstorage", _.STORAGE, K.SERIES, r, k.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
|
+
A(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((k) => (console.error("%cstorage", _.STORAGE, K.MESSAGES, r, k.message), 400));
|
|
3540
3540
|
});
|
|
3541
|
-
|
|
3542
|
-
|
|
3541
|
+
A(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0))));
|
|
3542
|
+
A(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
|
+
A(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((k) => (console.error("%cstorage", _.STORAGE, K.WIDGET, r, k.message), 400));
|
|
3559
3559
|
});
|
|
3560
3560
|
/**
|
|
3561
3561
|
* Add component subscriber
|
|
3562
3562
|
* @param query IQuery
|
|
3563
3563
|
* @returns null
|
|
3564
3564
|
*/
|
|
3565
|
-
|
|
3565
|
+
A(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,17 +3576,17 @@ class Nr {
|
|
|
3576
3576
|
* Get current subscribers
|
|
3577
3577
|
* @returns IQuery[]
|
|
3578
3578
|
*/
|
|
3579
|
-
|
|
3580
|
-
|
|
3579
|
+
A(this, "getSubscribers", async () => await new Promise((r) => r(this.subscribers)));
|
|
3580
|
+
A(this, "loadSlide", async (r) => {
|
|
3581
3581
|
const s = J(r);
|
|
3582
|
-
return await
|
|
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
|
});
|
|
3584
3584
|
/**
|
|
3585
3585
|
* Update Slide
|
|
3586
3586
|
* @param query IQuery
|
|
3587
3587
|
* @returns number
|
|
3588
3588
|
*/
|
|
3589
|
-
|
|
3589
|
+
A(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,37 +3594,37 @@ 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((k) => (console.error("%cstorage", _.STORAGE, K.SLIDE, r, k.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
|
+
A(this, "subscribers", []);
|
|
3605
|
+
A(this, "options");
|
|
3606
|
+
A(this, "getCloud", async (r) => {
|
|
3607
3607
|
const s = J(r);
|
|
3608
3608
|
try {
|
|
3609
3609
|
return localStorage.getObject(s);
|
|
3610
3610
|
} catch (l) {
|
|
3611
|
-
return console.warn("%capi", _.API,
|
|
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
|
+
A(this, "getSeries", async (r) => {
|
|
3615
3615
|
const s = J(r);
|
|
3616
3616
|
try {
|
|
3617
3617
|
return localStorage.getObject(s);
|
|
3618
3618
|
} catch (l) {
|
|
3619
|
-
return console.warn("%capi", _.API,
|
|
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
|
+
A(this, "getMessages", async (r) => {
|
|
3623
3623
|
const s = J(r);
|
|
3624
3624
|
try {
|
|
3625
3625
|
return localStorage.getObject(s);
|
|
3626
3626
|
} catch (l) {
|
|
3627
|
-
return console.warn("%capi", _.API,
|
|
3627
|
+
return console.warn("%capi", _.API, K.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3628
3628
|
}
|
|
3629
3629
|
});
|
|
3630
3630
|
/**
|
|
@@ -3633,12 +3633,12 @@ class Br {
|
|
|
3633
3633
|
* @param data
|
|
3634
3634
|
* @returns number
|
|
3635
3635
|
*/
|
|
3636
|
-
|
|
3636
|
+
A(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,
|
|
3640
|
+
} catch (k) {
|
|
3641
|
+
return console.error("%cstorage", _.STORAGE, K.CLOUD, r, k), 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
|
+
A(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,
|
|
3654
|
+
} catch (k) {
|
|
3655
|
+
return console.error("%cstorage", _.STORAGE, K.SERIES, r, k), 400;
|
|
3656
3656
|
}
|
|
3657
3657
|
});
|
|
3658
3658
|
/**
|
|
@@ -3661,24 +3661,24 @@ class Br {
|
|
|
3661
3661
|
* @param data
|
|
3662
3662
|
* @returns number
|
|
3663
3663
|
*/
|
|
3664
|
-
|
|
3664
|
+
A(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,
|
|
3668
|
+
} catch (k) {
|
|
3669
|
+
return console.error("%cstorage", _.STORAGE, K.MESSAGES, r, k), 400;
|
|
3670
3670
|
}
|
|
3671
3671
|
});
|
|
3672
|
-
|
|
3673
|
-
|
|
3672
|
+
A(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0))));
|
|
3673
|
+
A(this, "hideMessage", async (r, s) => {
|
|
3674
3674
|
console.debug(`hideMessage ${r} ${s} not implemented for ${this.options.storage}`);
|
|
3675
3675
|
});
|
|
3676
|
-
|
|
3676
|
+
A(this, "setWidget", async (r) => {
|
|
3677
3677
|
const s = `widget.${r.widget}`;
|
|
3678
3678
|
try {
|
|
3679
3679
|
return localStorage.setObject(s, r), 201;
|
|
3680
3680
|
} catch (l) {
|
|
3681
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3681
|
+
return console.error("%cstorage", _.STORAGE, K.WIDGET, r, l), 400;
|
|
3682
3682
|
}
|
|
3683
3683
|
});
|
|
3684
3684
|
/**
|
|
@@ -3686,7 +3686,7 @@ class Br {
|
|
|
3686
3686
|
* @param query IQuery
|
|
3687
3687
|
* @returns null
|
|
3688
3688
|
*/
|
|
3689
|
-
|
|
3689
|
+
A(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
|
+
A(this, "getSubscribers", async () => await new Promise((r) => r(this.subscribers)));
|
|
3704
|
+
A(this, "loadSlide", async (r) => {
|
|
3705
3705
|
try {
|
|
3706
3706
|
return localStorage.getObject(`${r.type}.${r.id}`);
|
|
3707
3707
|
} catch (s) {
|
|
3708
|
-
return console.warn("%capi", _.API,
|
|
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
|
+
A(this, "storeSlide", async (r) => {
|
|
3712
3712
|
try {
|
|
3713
3713
|
return localStorage.setObject(`${r.type}.${r.id}`, {
|
|
3714
3714
|
id: r.id,
|
|
@@ -3718,7 +3718,7 @@ class Br {
|
|
|
3718
3718
|
css: r.data.css || ""
|
|
3719
3719
|
}), 201;
|
|
3720
3720
|
} catch (s) {
|
|
3721
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3721
|
+
return console.error("%cstorage", _.STORAGE, K.SLIDE, r, s), 400;
|
|
3722
3722
|
}
|
|
3723
3723
|
});
|
|
3724
3724
|
this.options = r, Storage.prototype.setObject = function(s, l) {
|
|
@@ -3731,30 +3731,30 @@ class Br {
|
|
|
3731
3731
|
}
|
|
3732
3732
|
class Lr {
|
|
3733
3733
|
constructor(r) {
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3734
|
+
A(this, "subscribers", []);
|
|
3735
|
+
A(this, "options");
|
|
3736
|
+
A(this, "getCloud", async (r) => {
|
|
3737
3737
|
const s = J(r);
|
|
3738
3738
|
try {
|
|
3739
3739
|
return sessionStorage.getObject(s);
|
|
3740
3740
|
} catch (l) {
|
|
3741
|
-
return console.warn("%capi", _.API,
|
|
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
|
+
A(this, "getSeries", async (r) => {
|
|
3745
3745
|
const s = J(r);
|
|
3746
3746
|
try {
|
|
3747
3747
|
return sessionStorage.getObject(s);
|
|
3748
3748
|
} catch (l) {
|
|
3749
|
-
return console.warn("%capi", _.API,
|
|
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
|
+
A(this, "getMessages", async (r) => {
|
|
3753
3753
|
const s = J(r);
|
|
3754
3754
|
try {
|
|
3755
3755
|
return sessionStorage.getObject(s);
|
|
3756
3756
|
} catch (l) {
|
|
3757
|
-
return console.warn("%capi", _.API,
|
|
3757
|
+
return console.warn("%capi", _.API, K.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3758
3758
|
}
|
|
3759
3759
|
});
|
|
3760
3760
|
/**
|
|
@@ -3763,12 +3763,12 @@ class Lr {
|
|
|
3763
3763
|
* @param data
|
|
3764
3764
|
* @returns number
|
|
3765
3765
|
*/
|
|
3766
|
-
|
|
3766
|
+
A(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,
|
|
3770
|
+
} catch (k) {
|
|
3771
|
+
return console.error("%cstorage", _.STORAGE, K.CLOUD, r, k), 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
|
+
A(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,
|
|
3784
|
+
} catch (k) {
|
|
3785
|
+
return console.error("%cstorage", _.STORAGE, K.SERIES, r, k), 400;
|
|
3786
3786
|
}
|
|
3787
3787
|
});
|
|
3788
3788
|
/**
|
|
@@ -3791,24 +3791,24 @@ class Lr {
|
|
|
3791
3791
|
* @param data
|
|
3792
3792
|
* @returns number
|
|
3793
3793
|
*/
|
|
3794
|
-
|
|
3794
|
+
A(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,
|
|
3798
|
+
} catch (k) {
|
|
3799
|
+
return console.error("%cstorage", _.STORAGE, K.MESSAGES, r, k), 400;
|
|
3800
3800
|
}
|
|
3801
3801
|
});
|
|
3802
|
-
|
|
3803
|
-
|
|
3802
|
+
A(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0))));
|
|
3803
|
+
A(this, "hideMessage", async (r, s) => {
|
|
3804
3804
|
console.debug(`hideMessage ${r} ${s} not implemented for ${this.options.storage}`);
|
|
3805
3805
|
});
|
|
3806
|
-
|
|
3806
|
+
A(this, "setWidget", async (r) => {
|
|
3807
3807
|
const s = `widget.${r.widget}`;
|
|
3808
3808
|
try {
|
|
3809
3809
|
return sessionStorage.setObject(s, r), 201;
|
|
3810
3810
|
} catch (l) {
|
|
3811
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3811
|
+
return console.error("%cstorage", _.STORAGE, K.WIDGET, r, l), 400;
|
|
3812
3812
|
}
|
|
3813
3813
|
});
|
|
3814
3814
|
/**
|
|
@@ -3816,7 +3816,7 @@ class Lr {
|
|
|
3816
3816
|
* @param query IQuery
|
|
3817
3817
|
* @returns null
|
|
3818
3818
|
*/
|
|
3819
|
-
|
|
3819
|
+
A(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,12 +3830,12 @@ class Lr {
|
|
|
3830
3830
|
* Get current subscribers
|
|
3831
3831
|
* @returns IQuery[]
|
|
3832
3832
|
*/
|
|
3833
|
-
|
|
3834
|
-
|
|
3833
|
+
A(this, "getSubscribers", async () => await new Promise((r) => r(this.subscribers)));
|
|
3834
|
+
A(this, "loadSlide", async (r) => {
|
|
3835
3835
|
try {
|
|
3836
3836
|
return sessionStorage.getObject(`${r.type}.${r.id}`);
|
|
3837
3837
|
} catch (s) {
|
|
3838
|
-
return console.warn("%capi", _.API,
|
|
3838
|
+
return console.warn("%capi", _.API, K.SLIDE, r.id, s), { data: null, message: "Store Load error", success: !1 };
|
|
3839
3839
|
}
|
|
3840
3840
|
});
|
|
3841
3841
|
/**
|
|
@@ -3843,7 +3843,7 @@ class Lr {
|
|
|
3843
3843
|
* @param query IQuery
|
|
3844
3844
|
* @returns number
|
|
3845
3845
|
*/
|
|
3846
|
-
|
|
3846
|
+
A(this, "storeSlide", async (r) => {
|
|
3847
3847
|
try {
|
|
3848
3848
|
return sessionStorage.setObject(`${r.type}.${r.id}`, {
|
|
3849
3849
|
id: r.id,
|
|
@@ -3853,7 +3853,7 @@ class Lr {
|
|
|
3853
3853
|
css: r.data.css || ""
|
|
3854
3854
|
}), 200;
|
|
3855
3855
|
} catch (s) {
|
|
3856
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3856
|
+
return console.error("%cstorage", _.STORAGE, K.SLIDE, r, s), 400;
|
|
3857
3857
|
}
|
|
3858
3858
|
});
|
|
3859
3859
|
this.options = r, Storage.prototype.setObject = function(s, l) {
|
|
@@ -3866,30 +3866,30 @@ class Lr {
|
|
|
3866
3866
|
}
|
|
3867
3867
|
class Gr {
|
|
3868
3868
|
constructor(r) {
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3869
|
+
A(this, "subscribers", []);
|
|
3870
|
+
A(this, "options");
|
|
3871
|
+
A(this, "getCloud", async (r) => {
|
|
3872
3872
|
const s = J(r);
|
|
3873
3873
|
try {
|
|
3874
3874
|
return window.BuzzCasting.WidgetData[s];
|
|
3875
3875
|
} catch (l) {
|
|
3876
|
-
return console.warn("%capi", _.API,
|
|
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
|
+
A(this, "getSeries", async (r) => {
|
|
3880
3880
|
const s = J(r);
|
|
3881
3881
|
try {
|
|
3882
3882
|
return window.BuzzCasting.WidgetData[s];
|
|
3883
3883
|
} catch (l) {
|
|
3884
|
-
return console.warn("%capi", _.API,
|
|
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
|
+
A(this, "getMessages", async (r) => {
|
|
3888
3888
|
const s = J(r);
|
|
3889
3889
|
try {
|
|
3890
3890
|
return window.BuzzCasting.WidgetData[s];
|
|
3891
3891
|
} catch (l) {
|
|
3892
|
-
return console.warn("%capi", _.API,
|
|
3892
|
+
return console.warn("%capi", _.API, K.MESSAGES, r.slide, r.widget, l), { data: null, message: "Messages Data error", success: !1 };
|
|
3893
3893
|
}
|
|
3894
3894
|
});
|
|
3895
3895
|
/**
|
|
@@ -3898,12 +3898,12 @@ class Gr {
|
|
|
3898
3898
|
* @param data
|
|
3899
3899
|
* @returns number
|
|
3900
3900
|
*/
|
|
3901
|
-
|
|
3901
|
+
A(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 (k) {
|
|
3906
|
+
return console.error("%cstorage", _.STORAGE, "set", r, k), 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
|
+
A(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 (k) {
|
|
3920
|
+
return console.error("%cstorage", _.STORAGE, "set", r, k), 400;
|
|
3921
3921
|
}
|
|
3922
3922
|
});
|
|
3923
3923
|
/**
|
|
@@ -3926,24 +3926,24 @@ class Gr {
|
|
|
3926
3926
|
* @param data
|
|
3927
3927
|
* @returns number
|
|
3928
3928
|
*/
|
|
3929
|
-
|
|
3929
|
+
A(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 (k) {
|
|
3934
|
+
return console.error("%cstorage", _.STORAGE, "set", r, k), 400;
|
|
3935
3935
|
}
|
|
3936
3936
|
});
|
|
3937
|
-
|
|
3938
|
-
|
|
3937
|
+
A(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0))));
|
|
3938
|
+
A(this, "hideMessage", async (r, s) => {
|
|
3939
3939
|
console.debug(`hideMessage ${r} ${s} not implemented for ${this.options.storage}`);
|
|
3940
3940
|
});
|
|
3941
|
-
|
|
3941
|
+
A(this, "setWidget", async (r) => {
|
|
3942
3942
|
const s = `widget.${r.widget}`;
|
|
3943
3943
|
try {
|
|
3944
3944
|
return window.BuzzCasting.WidgetData[s] = r, 201;
|
|
3945
3945
|
} catch (l) {
|
|
3946
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3946
|
+
return console.error("%cstorage", _.STORAGE, K.WIDGET, r, l), 400;
|
|
3947
3947
|
}
|
|
3948
3948
|
});
|
|
3949
3949
|
/**
|
|
@@ -3951,7 +3951,7 @@ class Gr {
|
|
|
3951
3951
|
* @param query IQuery
|
|
3952
3952
|
* @returns null
|
|
3953
3953
|
*/
|
|
3954
|
-
|
|
3954
|
+
A(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
|
+
A(this, "getSubscribers", async () => await new Promise((r) => r(this.subscribers)));
|
|
3969
|
+
A(this, "loadSlide", async (r) => {
|
|
3970
3970
|
try {
|
|
3971
3971
|
return window.BuzzCasting.SlideData[r.id];
|
|
3972
3972
|
} catch (s) {
|
|
3973
|
-
return console.warn("%capi", _.API,
|
|
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
|
+
A(this, "storeSlide", async (r) => {
|
|
3977
3977
|
try {
|
|
3978
3978
|
return window.BuzzCasting.SlideData[r.id] = {
|
|
3979
3979
|
id: r.slide,
|
|
@@ -3983,7 +3983,7 @@ class Gr {
|
|
|
3983
3983
|
css: r.data.css || ""
|
|
3984
3984
|
}, 201;
|
|
3985
3985
|
} catch (s) {
|
|
3986
|
-
return console.error("%cstorage", _.STORAGE,
|
|
3986
|
+
return console.error("%cstorage", _.STORAGE, K.SLIDE, r, s), 400;
|
|
3987
3987
|
}
|
|
3988
3988
|
});
|
|
3989
3989
|
this.options = r, window.BuzzCasting.WidgetData = /* @__PURE__ */ new Set();
|
|
@@ -3999,10 +3999,10 @@ function Gi(f) {
|
|
|
3999
3999
|
let r = "", s = "", l = {
|
|
4000
4000
|
backgroundImage: ""
|
|
4001
4001
|
};
|
|
4002
|
-
return typeof f.media < "u" && f.media.forEach((
|
|
4003
|
-
(
|
|
4004
|
-
backgroundImage: `url(${
|
|
4005
|
-
}, s =
|
|
4002
|
+
return typeof f.media < "u" && f.media.forEach((k) => {
|
|
4003
|
+
(k.type === "photo" || k.type === "image") && (l = {
|
|
4004
|
+
backgroundImage: `url(${k.url})`
|
|
4005
|
+
}, s = k.url), k.type === "video" && (r = k.url);
|
|
4006
4006
|
}), {
|
|
4007
4007
|
image: s,
|
|
4008
4008
|
background: l || null,
|
|
@@ -4087,44 +4087,44 @@ function Mi(f, r) {
|
|
|
4087
4087
|
return f;
|
|
4088
4088
|
}
|
|
4089
4089
|
function Oe(f, r) {
|
|
4090
|
-
let s, l,
|
|
4090
|
+
let s, l, k;
|
|
4091
4091
|
if (r.length === 0)
|
|
4092
4092
|
return f;
|
|
4093
|
-
for (s = 0,
|
|
4093
|
+
for (s = 0, k = r.length; s < k; s++)
|
|
4094
4094
|
l = r.charCodeAt(s), f = (f << 5) - f + l, f |= 0;
|
|
4095
4095
|
return f < 0 ? f * -2 : f;
|
|
4096
4096
|
}
|
|
4097
4097
|
function ji(f, r, s) {
|
|
4098
4098
|
return Object.keys(r).sort().reduce(l, f);
|
|
4099
|
-
function l(
|
|
4100
|
-
return $r(
|
|
4099
|
+
function l(k, D) {
|
|
4100
|
+
return $r(k, r[D], D, s);
|
|
4101
4101
|
}
|
|
4102
4102
|
}
|
|
4103
4103
|
function $r(f, r, s, l) {
|
|
4104
|
-
const
|
|
4104
|
+
const k = Oe(Oe(Oe(f, s), Ki(r)), typeof r);
|
|
4105
4105
|
if (r === null)
|
|
4106
|
-
return Oe(
|
|
4106
|
+
return Oe(k, "null");
|
|
4107
4107
|
if (r === void 0)
|
|
4108
|
-
return Oe(
|
|
4108
|
+
return Oe(k, "undefined");
|
|
4109
4109
|
if (typeof r == "object" || typeof r == "function") {
|
|
4110
4110
|
if (l.includes(r))
|
|
4111
|
-
return Oe(
|
|
4111
|
+
return Oe(k, `[Circular]${s}`);
|
|
4112
4112
|
l.push(r);
|
|
4113
|
-
const
|
|
4113
|
+
const D = ji(k, r, l);
|
|
4114
4114
|
if (!("valueOf" in r) || typeof r.valueOf != "function")
|
|
4115
|
-
return
|
|
4115
|
+
return D;
|
|
4116
4116
|
try {
|
|
4117
|
-
return Oe(
|
|
4118
|
-
} catch (
|
|
4119
|
-
return Oe(
|
|
4117
|
+
return Oe(D, String(r.valueOf()));
|
|
4118
|
+
} catch (R) {
|
|
4119
|
+
return Oe(D, `[valueOf exception]${R.stack || R.message}`);
|
|
4120
4120
|
}
|
|
4121
4121
|
}
|
|
4122
|
-
return Oe(
|
|
4122
|
+
return Oe(k, r.toString());
|
|
4123
4123
|
}
|
|
4124
4124
|
function Ki(f) {
|
|
4125
4125
|
return Object.prototype.toString.call(f);
|
|
4126
4126
|
}
|
|
4127
|
-
function
|
|
4127
|
+
function Fn(f) {
|
|
4128
4128
|
return Mi($r(0, f, "", []).toString(16), 8);
|
|
4129
4129
|
}
|
|
4130
4130
|
function Hi(f, r) {
|
|
@@ -4153,10 +4153,10 @@ function Yi(f, r) {
|
|
|
4153
4153
|
{ value: 1e15, symbol: "P" },
|
|
4154
4154
|
{ value: 1e18, symbol: "E" }
|
|
4155
4155
|
], l = /\.0+$|(\.\d*[1-9])0+$/;
|
|
4156
|
-
let
|
|
4157
|
-
for (
|
|
4156
|
+
let k;
|
|
4157
|
+
for (k = s.length - 1; k > 0 && !(f >= s[k].value); k--)
|
|
4158
4158
|
;
|
|
4159
|
-
return (f / s[
|
|
4159
|
+
return (f / s[k].value).toFixed(r).replace(l, "$1") + s[k].symbol;
|
|
4160
4160
|
}
|
|
4161
4161
|
function Qi(f) {
|
|
4162
4162
|
switch (f.language) {
|
|
@@ -4172,8 +4172,8 @@ function Qi(f) {
|
|
|
4172
4172
|
function Xi(f) {
|
|
4173
4173
|
const r = window.BuzzCasting.getOptions().suspended ?? !1;
|
|
4174
4174
|
return f.forEach((s) => {
|
|
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 ? ((((
|
|
4175
|
+
var l, k, D, R, B;
|
|
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 ? ((((k = s.sender) == null ? void 0 : k.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
4177
|
const Q = new URL(s.link);
|
|
4178
4178
|
s.sender.title = Q.hostname.replace("www.", "");
|
|
4179
4179
|
}
|
|
@@ -4189,66 +4189,66 @@ function Ji(f) {
|
|
|
4189
4189
|
}
|
|
4190
4190
|
class Vi {
|
|
4191
4191
|
constructor(r) {
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4192
|
+
A(this, "sm");
|
|
4193
|
+
A(this, "api");
|
|
4194
|
+
A(this, "bc");
|
|
4195
|
+
A(this, "options");
|
|
4196
|
+
A(this, "update", async (r) => {
|
|
4197
4197
|
if (this.sm === null)
|
|
4198
4198
|
return;
|
|
4199
4199
|
const s = await this.sm.getSubscribers();
|
|
4200
4200
|
if (s.length === 0)
|
|
4201
4201
|
return;
|
|
4202
4202
|
const l = [];
|
|
4203
|
-
r ? l.push(this.api.get(r)) : s == null || s.forEach((
|
|
4204
|
-
l.push(this.api.get(
|
|
4203
|
+
r ? l.push(this.api.get(r)) : s == null || s.forEach((k) => {
|
|
4204
|
+
l.push(this.api.get(k));
|
|
4205
4205
|
}), await Promise.allSettled(l).then(
|
|
4206
|
-
(
|
|
4207
|
-
let
|
|
4208
|
-
if (
|
|
4209
|
-
const B =
|
|
4206
|
+
(k) => k.forEach(async (D) => {
|
|
4207
|
+
let R = 400;
|
|
4208
|
+
if (D.status === "fulfilled") {
|
|
4209
|
+
const B = D.value;
|
|
4210
4210
|
if (this.sm === null)
|
|
4211
4211
|
return 400;
|
|
4212
4212
|
if (B.success === !0) {
|
|
4213
4213
|
const Q = this.sm.subscribers.filter(
|
|
4214
|
-
(
|
|
4214
|
+
(Z) => Z.widget === B.query.widget
|
|
4215
4215
|
)[0];
|
|
4216
|
-
let
|
|
4216
|
+
let ee = "", ge;
|
|
4217
4217
|
switch (B.query.type) {
|
|
4218
|
-
case
|
|
4219
|
-
if (
|
|
4218
|
+
case K.MESSAGES:
|
|
4219
|
+
if (ge = B.data.messages.filter((Z) => Z.id !== null), B.data.messages = ge, ee = Fn(B.data.messages), Q.hash === ee)
|
|
4220
4220
|
return console.debug(
|
|
4221
4221
|
"%capi%c %cno updates",
|
|
4222
4222
|
_.API,
|
|
4223
4223
|
_.NONE,
|
|
4224
4224
|
_.NO_UPDATES,
|
|
4225
|
-
|
|
4225
|
+
K.MESSAGES,
|
|
4226
4226
|
B.query.slide,
|
|
4227
4227
|
B.query.widget
|
|
4228
4228
|
), 204;
|
|
4229
|
-
Q.hash =
|
|
4229
|
+
Q.hash = ee, R = await this.sm.setMessages(B.query, B);
|
|
4230
4230
|
break;
|
|
4231
|
-
case
|
|
4232
|
-
|
|
4231
|
+
case K.CLOUD:
|
|
4232
|
+
ee = Fn(B.data), Q.hash === ee ? (console.debug(
|
|
4233
4233
|
"%capi%c %cno updates",
|
|
4234
4234
|
_.API,
|
|
4235
4235
|
_.NONE,
|
|
4236
4236
|
_.NO_UPDATES,
|
|
4237
|
-
|
|
4237
|
+
K.CLOUD,
|
|
4238
4238
|
B.query.slide,
|
|
4239
4239
|
B.query.widget
|
|
4240
|
-
),
|
|
4240
|
+
), R = 204) : (Q.hash = ee, R = await this.sm.setCloud(B.query, B));
|
|
4241
4241
|
break;
|
|
4242
|
-
case
|
|
4243
|
-
|
|
4242
|
+
case K.SERIES:
|
|
4243
|
+
ee = Fn(B.data), Q.hash === ee ? (console.debug(
|
|
4244
4244
|
"%capi%c %cno updates",
|
|
4245
4245
|
_.API,
|
|
4246
4246
|
_.NONE,
|
|
4247
4247
|
_.NO_UPDATES,
|
|
4248
|
-
|
|
4248
|
+
K.SERIES,
|
|
4249
4249
|
B.query.slide,
|
|
4250
4250
|
B.query.widget
|
|
4251
|
-
),
|
|
4251
|
+
), R = 204) : (Q.hash = ee, R = await this.sm.setSeries(B.query, B));
|
|
4252
4252
|
break;
|
|
4253
4253
|
default:
|
|
4254
4254
|
console.warn(
|
|
@@ -4261,8 +4261,8 @@ class Vi {
|
|
|
4261
4261
|
);
|
|
4262
4262
|
}
|
|
4263
4263
|
} else
|
|
4264
|
-
|
|
4265
|
-
switch (
|
|
4264
|
+
R = 401;
|
|
4265
|
+
switch (R) {
|
|
4266
4266
|
case 201:
|
|
4267
4267
|
console.info(
|
|
4268
4268
|
"%capp%c %cbroadcast",
|
|
@@ -4284,7 +4284,7 @@ class Vi {
|
|
|
4284
4284
|
);
|
|
4285
4285
|
break;
|
|
4286
4286
|
}
|
|
4287
|
-
return
|
|
4287
|
+
return R;
|
|
4288
4288
|
} else
|
|
4289
4289
|
return console.warn(
|
|
4290
4290
|
"%capi%c %cstorage",
|
|
@@ -4296,10 +4296,10 @@ class Vi {
|
|
|
4296
4296
|
})
|
|
4297
4297
|
);
|
|
4298
4298
|
});
|
|
4299
|
-
|
|
4299
|
+
A(this, "hide", (r) => {
|
|
4300
4300
|
this.api.hideMessage(r);
|
|
4301
4301
|
});
|
|
4302
|
-
|
|
4302
|
+
A(this, "actions", async (r) => {
|
|
4303
4303
|
var s;
|
|
4304
4304
|
switch (r.data.event) {
|
|
4305
4305
|
case re.SUBSCRIBE:
|
|
@@ -4317,9 +4317,9 @@ class Vi {
|
|
|
4317
4317
|
break;
|
|
4318
4318
|
}
|
|
4319
4319
|
});
|
|
4320
|
-
|
|
4321
|
-
var l,
|
|
4322
|
-
const r = ((l = this.options) == null ? void 0 : l.retention) || 345600, s = await ((
|
|
4320
|
+
A(this, "cleanMessages", async () => {
|
|
4321
|
+
var l, k;
|
|
4322
|
+
const r = ((l = this.options) == null ? void 0 : l.retention) || 345600, s = await ((k = this.sm) == null ? void 0 : k.cleanMessages(
|
|
4323
4323
|
r
|
|
4324
4324
|
));
|
|
4325
4325
|
console.info(
|
|
@@ -4330,7 +4330,7 @@ class Vi {
|
|
|
4330
4330
|
`${s} messages deleted`
|
|
4331
4331
|
);
|
|
4332
4332
|
});
|
|
4333
|
-
|
|
4333
|
+
A(this, "hideMessage", async (r) => {
|
|
4334
4334
|
var l;
|
|
4335
4335
|
const s = await ((l = this.sm) == null ? void 0 : l.hideMessage(r.id, 0));
|
|
4336
4336
|
return console.info(
|
|
@@ -4341,15 +4341,15 @@ class Vi {
|
|
|
4341
4341
|
`${s} messages hidden`
|
|
4342
4342
|
), await this.api.hideMessage(r);
|
|
4343
4343
|
});
|
|
4344
|
-
|
|
4345
|
-
|
|
4344
|
+
A(this, "hideLabels", async (r) => await this.api.hideLabels(r));
|
|
4345
|
+
A(this, "getSubscribers", async () => {
|
|
4346
4346
|
var r;
|
|
4347
4347
|
return await ((r = this.sm) == null ? void 0 : r.getSubscribers());
|
|
4348
4348
|
});
|
|
4349
|
-
|
|
4350
|
-
|
|
4349
|
+
A(this, "loadSlide", async (r) => await this.api.loadSlide(r));
|
|
4350
|
+
A(this, "storeSlide", async (r) => {
|
|
4351
4351
|
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,
|
|
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, k) => {
|
|
4353
4353
|
l(201);
|
|
4354
4354
|
})));
|
|
4355
4355
|
});
|
|
@@ -4373,19 +4373,19 @@ class Vi {
|
|
|
4373
4373
|
), this.bc.onmessage = (l) => {
|
|
4374
4374
|
this.actions(l);
|
|
4375
4375
|
}, this.bc.postMessage({ event: re.STORAGE_INIT, data: {} }), this.api = new Di(r), r.storage) {
|
|
4376
|
-
case
|
|
4376
|
+
case pe.DEXIE:
|
|
4377
4377
|
this.sm = new jr(r);
|
|
4378
4378
|
break;
|
|
4379
|
-
case
|
|
4379
|
+
case pe.LOCAL:
|
|
4380
4380
|
this.sm = new Lr(r);
|
|
4381
4381
|
break;
|
|
4382
|
-
case
|
|
4382
|
+
case pe.SESSION:
|
|
4383
4383
|
this.sm = new Br(r);
|
|
4384
4384
|
break;
|
|
4385
|
-
case
|
|
4385
|
+
case pe.KEYVAL:
|
|
4386
4386
|
this.sm = new Nr(r);
|
|
4387
4387
|
break;
|
|
4388
|
-
case
|
|
4388
|
+
case pe.WINDOW:
|
|
4389
4389
|
this.sm = new Gr(r);
|
|
4390
4390
|
break;
|
|
4391
4391
|
}
|
|
@@ -4393,15 +4393,15 @@ class Vi {
|
|
|
4393
4393
|
}
|
|
4394
4394
|
class Ni {
|
|
4395
4395
|
constructor(r) {
|
|
4396
|
-
|
|
4396
|
+
A(this, "sm");
|
|
4397
4397
|
/**
|
|
4398
4398
|
* Retieve Cloud Data
|
|
4399
4399
|
* @param query Widgets parameters, type "cloud"
|
|
4400
4400
|
* @returns IResponse
|
|
4401
4401
|
*/
|
|
4402
|
-
|
|
4402
|
+
A(this, "getCloud", async (r) => {
|
|
4403
4403
|
var s;
|
|
4404
|
-
return r.type !==
|
|
4404
|
+
return r.type !== K.CLOUD ? (console.warn(
|
|
4405
4405
|
"%capp%c %get",
|
|
4406
4406
|
_.APP,
|
|
4407
4407
|
_.NONE,
|
|
@@ -4420,9 +4420,9 @@ class Ni {
|
|
|
4420
4420
|
* @param query Widgets parameters, type "messages"
|
|
4421
4421
|
* @returns IResponse
|
|
4422
4422
|
*/
|
|
4423
|
-
|
|
4423
|
+
A(this, "getMessages", async (r) => {
|
|
4424
4424
|
var s;
|
|
4425
|
-
return r.type !==
|
|
4425
|
+
return r.type !== K.MESSAGES ? (console.warn(
|
|
4426
4426
|
"%capp%c %get",
|
|
4427
4427
|
_.APP,
|
|
4428
4428
|
_.NONE,
|
|
@@ -4441,9 +4441,9 @@ class Ni {
|
|
|
4441
4441
|
* @param query Widgets parameters, type "series"
|
|
4442
4442
|
* @returns IResponse
|
|
4443
4443
|
*/
|
|
4444
|
-
|
|
4444
|
+
A(this, "getSeries", async (r) => {
|
|
4445
4445
|
var s;
|
|
4446
|
-
return r.type !==
|
|
4446
|
+
return r.type !== K.SERIES ? (console.warn(
|
|
4447
4447
|
"%capp%c %get",
|
|
4448
4448
|
_.APP,
|
|
4449
4449
|
_.NONE,
|
|
@@ -4458,19 +4458,19 @@ class Ni {
|
|
|
4458
4458
|
}) : await ((s = this.sm) == null ? void 0 : s.getSeries(r));
|
|
4459
4459
|
});
|
|
4460
4460
|
switch (this.sm = null, r.storage) {
|
|
4461
|
-
case
|
|
4461
|
+
case pe.DEXIE:
|
|
4462
4462
|
this.sm = new jr(r);
|
|
4463
4463
|
break;
|
|
4464
|
-
case
|
|
4464
|
+
case pe.LOCAL:
|
|
4465
4465
|
this.sm = new Lr(r);
|
|
4466
4466
|
break;
|
|
4467
|
-
case
|
|
4467
|
+
case pe.SESSION:
|
|
4468
4468
|
this.sm = new Br(r);
|
|
4469
4469
|
break;
|
|
4470
|
-
case
|
|
4470
|
+
case pe.KEYVAL:
|
|
4471
4471
|
this.sm = new Nr(r);
|
|
4472
4472
|
break;
|
|
4473
|
-
case
|
|
4473
|
+
case pe.WINDOW:
|
|
4474
4474
|
this.sm = new Gr(r);
|
|
4475
4475
|
break;
|
|
4476
4476
|
}
|
|
@@ -4485,23 +4485,23 @@ class Zi {
|
|
|
4485
4485
|
* @param selector container for the element - by default buzzcasting-slide (optional)
|
|
4486
4486
|
*/
|
|
4487
4487
|
constructor(r, s, l) {
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4488
|
+
A(this, "storageReader");
|
|
4489
|
+
A(this, "broadcastChannel");
|
|
4490
|
+
A(this, "element");
|
|
4491
|
+
A(this, "query");
|
|
4492
|
+
A(this, "listeners");
|
|
4493
4493
|
/**
|
|
4494
4494
|
* Generic call to any query type
|
|
4495
4495
|
*
|
|
4496
4496
|
* @returns IResponse
|
|
4497
4497
|
*/
|
|
4498
|
-
|
|
4498
|
+
A(this, "getData", async () => {
|
|
4499
4499
|
switch (this.query.type) {
|
|
4500
|
-
case
|
|
4500
|
+
case K.CLOUD:
|
|
4501
4501
|
return await this.getCloud();
|
|
4502
|
-
case
|
|
4502
|
+
case K.MESSAGES:
|
|
4503
4503
|
return await this.getMessages();
|
|
4504
|
-
case
|
|
4504
|
+
case K.SERIES:
|
|
4505
4505
|
return await this.getSeries();
|
|
4506
4506
|
}
|
|
4507
4507
|
return {
|
|
@@ -4515,7 +4515,7 @@ class Zi {
|
|
|
4515
4515
|
*
|
|
4516
4516
|
* @returns IResponse
|
|
4517
4517
|
*/
|
|
4518
|
-
|
|
4518
|
+
A(this, "getCloud", async () => this.query.type !== K.CLOUD ? (console.warn(
|
|
4519
4519
|
"%cstorage%c %cwidget",
|
|
4520
4520
|
_.STORAGE,
|
|
4521
4521
|
_.NONE,
|
|
@@ -4533,7 +4533,7 @@ class Zi {
|
|
|
4533
4533
|
*
|
|
4534
4534
|
* @returns IResponse
|
|
4535
4535
|
*/
|
|
4536
|
-
|
|
4536
|
+
A(this, "getMessages", async () => this.query.type !== K.MESSAGES ? (console.warn(
|
|
4537
4537
|
"%cstorage%c %cwidget",
|
|
4538
4538
|
_.STORAGE,
|
|
4539
4539
|
_.NONE,
|
|
@@ -4551,7 +4551,7 @@ class Zi {
|
|
|
4551
4551
|
*
|
|
4552
4552
|
* @returns IResponse
|
|
4553
4553
|
*/
|
|
4554
|
-
|
|
4554
|
+
A(this, "getSeries", async () => this.query.type !== K.SERIES ? (console.warn(
|
|
4555
4555
|
"%cstorage%c %cwidget",
|
|
4556
4556
|
_.STORAGE,
|
|
4557
4557
|
_.NONE,
|
|
@@ -4570,11 +4570,11 @@ class Zi {
|
|
|
4570
4570
|
*
|
|
4571
4571
|
* @param modal IModal
|
|
4572
4572
|
*/
|
|
4573
|
-
|
|
4573
|
+
A(this, "showModal", (r) => {
|
|
4574
4574
|
const s = Ri(this.element.attributes);
|
|
4575
4575
|
if (Object.prototype.hasOwnProperty.call(s, "data-topics")) {
|
|
4576
|
-
const
|
|
4577
|
-
|
|
4576
|
+
const D = s["data-topics"].split("-");
|
|
4577
|
+
D.length > 1 ? (s["data-widget"] = D[1], s["data-dashboard"] = D[0]) : (s["data-widget"] = D[0], s["data-dashboard"] = this.query.slide);
|
|
4578
4578
|
}
|
|
4579
4579
|
const l = { ...r.props, ...s };
|
|
4580
4580
|
console.debug(
|
|
@@ -4585,7 +4585,7 @@ class Zi {
|
|
|
4585
4585
|
// @ts-expect-error cannot get string type out of IFilteredAttributes props
|
|
4586
4586
|
s["data-widget"]
|
|
4587
4587
|
);
|
|
4588
|
-
const
|
|
4588
|
+
const k = new CustomEvent(re.SHOW_MODAL, {
|
|
4589
4589
|
detail: {
|
|
4590
4590
|
component: r.showComponent,
|
|
4591
4591
|
props: l,
|
|
@@ -4595,14 +4595,14 @@ class Zi {
|
|
|
4595
4595
|
cancelable: !0,
|
|
4596
4596
|
composed: !0
|
|
4597
4597
|
});
|
|
4598
|
-
window.dispatchEvent(
|
|
4598
|
+
window.dispatchEvent(k);
|
|
4599
4599
|
});
|
|
4600
|
-
var
|
|
4600
|
+
var R;
|
|
4601
4601
|
this.element = r, this.listeners = s, l = typeof l < "u" ? l : "buzzcasting-slide";
|
|
4602
|
-
let
|
|
4603
|
-
|
|
4604
|
-
const
|
|
4605
|
-
this.storageReader = new Ni(
|
|
4602
|
+
let k;
|
|
4603
|
+
k = { ...r.dataset }, delete k.hmr, k.slide = ((R = r.closest(l.toUpperCase())) == null ? void 0 : R.id) ?? `${l} not found`, k = rt(k), this.query = k, Ti(r);
|
|
4604
|
+
const D = window.BuzzCasting.getOptions();
|
|
4605
|
+
this.storageReader = new Ni(D), this.broadcastChannel = new BroadcastChannel(k.slide), this.startListener();
|
|
4606
4606
|
}
|
|
4607
4607
|
addListener(r) {
|
|
4608
4608
|
this.listeners.push(r);
|
|
@@ -4616,8 +4616,8 @@ class Zi {
|
|
|
4616
4616
|
const l = s.data.data;
|
|
4617
4617
|
switch (s.data.event) {
|
|
4618
4618
|
case re.WIDGET_UPDATE:
|
|
4619
|
-
l.query.slide === r.slide && l.query.widget === r.widget && this.listeners.forEach((
|
|
4620
|
-
|
|
4619
|
+
l.query.slide === r.slide && l.query.widget === r.widget && this.listeners.forEach((k) => {
|
|
4620
|
+
k(s.data.data);
|
|
4621
4621
|
});
|
|
4622
4622
|
break;
|
|
4623
4623
|
case re.SLIDE_READY:
|
|
@@ -4648,13 +4648,13 @@ class Zi {
|
|
|
4648
4648
|
}
|
|
4649
4649
|
}
|
|
4650
4650
|
export {
|
|
4651
|
-
|
|
4651
|
+
K as API,
|
|
4652
4652
|
Vi as BuzzcastingStorageManager,
|
|
4653
4653
|
Ni as BuzzcastingStorageReader,
|
|
4654
4654
|
_ as CSS,
|
|
4655
4655
|
re as EVENTS,
|
|
4656
|
-
|
|
4657
|
-
|
|
4656
|
+
qt as MODERATION,
|
|
4657
|
+
pe as STORAGE,
|
|
4658
4658
|
Zi as Widget,
|
|
4659
4659
|
Li as anonymize,
|
|
4660
4660
|
Gi as attachedMedia,
|