buzzcasting-storage 3.7.6 → 3.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/buzzcasting-storage.d.ts +6 -5
- package/dist/buzzcasting-storage.esm.js +920 -891
- package/package.json +1 -1
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
var Aa = Object.defineProperty;
|
|
2
2
|
var Pa = (d, t, s) => t in d ? Aa(d, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : d[t] = s;
|
|
3
3
|
var b = (d, t, s) => Pa(d, typeof t != "symbol" ? t + "" : t, s);
|
|
4
|
-
var _ = /* @__PURE__ */ ((d) => (d.MESSAGES = "messages", d.CLOUD = "cloud", d.SERIES = "series", d.TOPICS = "topics", d.WIDGET = "widget", d.WIDGETS = "widgets", d.DASHBOARD = "dashboard", d.DASHBOARDS = "dashboards", d.SLIDE = "slide", d.SLIDES = "slides", d.PRESENTATION = "presentation", d.PRESENTATIONS = "presentations", d.PREFERENCE = "preference", d.PREFERENCES = "preferences", d))(_ || {}),
|
|
5
|
-
const Da = "3.7.
|
|
4
|
+
var _ = /* @__PURE__ */ ((d) => (d.MESSAGES = "messages", d.CLOUD = "cloud", d.SERIES = "series", d.TOPICS = "topics", d.WIDGET = "widget", d.WIDGETS = "widgets", d.DASHBOARD = "dashboard", d.DASHBOARDS = "dashboards", d.SLIDE = "slide", d.SLIDES = "slides", d.PRESENTATION = "presentation", d.PRESENTATIONS = "presentations", d.PREFERENCE = "preference", d.PREFERENCES = "preferences", d))(_ || {}), c = /* @__PURE__ */ ((d) => (d.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", d.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", d.BROADCAST = "color:navy;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", d.CLOUD = "color:purple;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", d.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", d.ERROR = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", d.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", d.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", d.MESSAGES = "color:white;background-color:darkslateblue;padding:0 4px 0 4px;border-radius:5px;", d.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", d.NONE = "color:transparent;background-color:transparent;", d.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", d.SERIES = "color:purple;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", d.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", d.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", d.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", d.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", d.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", d))(c || {}), q = /* @__PURE__ */ ((d) => (d.ADD_SLIDE = "addSlide", d.APP_READY = "appReady", d.API_UPDATE = "apiUpdate", d.WS_API_REQUEST = "wsApiRequest", d.WS_API_RESPONSE = "wsApiResponse", d.WS_API_UPDATE = "wsApiRUpdate", d.APPROVE_MESSAGE = "approveMessage", d.CHANNEL = "channel", d.CLEAN_MESSAGES = "cleanMessages", d.CLOSE_MODAL = "closeModal", d.CLOSE_BUILDER_MODAL = "closeBuilderModal", d.DASHBOARD_LOAD = "loadDashboard", d.DASHBOARD_STORE = "storeDashboard", d.ERROR = "error", d.HIDE_MESSAGE = "hideMessage", d.HIDE_LABELS = "hideLabels", d.MAUPPUT_UPDATE = "layoutUpdate", d.PREV_SLIDE = "prevSlide", d.RELOAD_PRESENTATION = "reloadPresentation", d.SHOW_MODAL = "showModal", d.STAR_MESSAGE = "starMessage", d.GOTO_SLIDE = "gotoSlide", d.NEXT_SLIDE = "nextSlide", d.PREFERENCE_LOAD = "loadPreference", d.PREFERENCE_STORE = "storePreference", d.PAUSE_PRESENTATION = "pausePresentation", d.PRESENTATION_READY = "presentationReady", d.PRESENTATION_LOAD = "loadPresentation", d.PRESENTATION_STORE = "storePresentation", d.SHOW_BUILDER_MODAL = "showBuilderModal", d.SLIDE_DID_LOAD = "slideDidLoad", d.SLIDE_GOTO = "slideGoto", d.SLIDE_READY = "slideReady", d.SLIDE_LOAD = "loadSlide", d.SLIDE_STORE = "storeSlide", d.SLIDE_TRANSITIONER = "slideTransitioner", d.START_TRANSITIONER = "startTransitioner", d.STORAGE_INIT = "storageInit", d.SUBSCRIBE = "subscribe", d.SUSPEND_ACCOUNT = "suspendAccount", d.SWITCH_PRESENTATION = "switchPresentation", d.REMOVE_CLOUD = "removeCloud", d.UPDATE = "update", d.VERSION = "version", d.WIDGET_LOAD = "widgetLoad", d.WIDGET_STORE = "widgetStore", d.WIDGET_UPDATE = "widgetUpdate", d))(q || {}), an = /* @__PURE__ */ ((d) => (d.APPROVED = "approved", d.BEFORE = "before", d.DELAYED = "delayed", d.NONE = "none", d.REALTIME = "realtime", d))(an || {}), we = /* @__PURE__ */ ((d) => (d.KEYVAL = "keyval", d.LOCAL = "local", d.SESSION = "session", d.DEXIE = "dexie", d.WINDOW = "window", d))(we || {});
|
|
5
|
+
const Da = "3.7.7";
|
|
6
6
|
function Ua(d) {
|
|
7
7
|
const t = d.toUpperCase().split(/[\s_-]+/);
|
|
8
|
-
return t.length > 0 ? (t.forEach((s,
|
|
9
|
-
t[
|
|
8
|
+
return t.length > 0 ? (t.forEach((s, u) => {
|
|
9
|
+
t[u] = `${s.charAt(0)}.`;
|
|
10
10
|
}), t.join(" ")) : "";
|
|
11
11
|
}
|
|
12
12
|
function za(d) {
|
|
13
|
-
let t = "", s = "",
|
|
13
|
+
let t = "", s = "", u = {
|
|
14
14
|
backgroundImage: ""
|
|
15
15
|
};
|
|
16
|
-
return typeof d.media < "u" && d.media.forEach((
|
|
17
|
-
(
|
|
18
|
-
backgroundImage: `url(${
|
|
19
|
-
}, s =
|
|
16
|
+
return typeof d.media < "u" && d.media.forEach((y) => {
|
|
17
|
+
(y.type === "photo" || y.type === "image") && (u = {
|
|
18
|
+
backgroundImage: `url(${y.url})`
|
|
19
|
+
}, s = y.url), y.type === "video" && (t = y.url);
|
|
20
20
|
}), {
|
|
21
21
|
image: s,
|
|
22
|
-
background:
|
|
22
|
+
background: u || null,
|
|
23
23
|
video: t
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
function Ra(d) {
|
|
27
27
|
const t = {};
|
|
28
28
|
for (let s = 0; s < d.length; s++) {
|
|
29
|
-
const
|
|
30
|
-
|
|
29
|
+
const u = d.item(s);
|
|
30
|
+
u != null && u.name && (t[u.name] = u.value);
|
|
31
31
|
}
|
|
32
32
|
return t;
|
|
33
33
|
}
|
|
34
34
|
function Ha(d) {
|
|
35
35
|
const t = {};
|
|
36
36
|
for (let s = 0; s < d.length; s++) {
|
|
37
|
-
const
|
|
38
|
-
|
|
37
|
+
const u = d[s];
|
|
38
|
+
u.name !== "class" && !u.name.includes("data") && (t[u.name] = u.value);
|
|
39
39
|
}
|
|
40
40
|
return t;
|
|
41
41
|
}
|
|
@@ -97,9 +97,9 @@ function xa(d) {
|
|
|
97
97
|
function Ia(d) {
|
|
98
98
|
d.reduce(
|
|
99
99
|
(t, s) => Object.keys(s).reduce(
|
|
100
|
-
(
|
|
101
|
-
...
|
|
102
|
-
[
|
|
100
|
+
(u, y) => ({
|
|
101
|
+
...u,
|
|
102
|
+
[y]: y in t && typeof t[y] == "object" && t[y] !== null && typeof s[y] == "object" && s[y] !== null ? Ia([t[y], s[y]]) : s[y]
|
|
103
103
|
}),
|
|
104
104
|
t
|
|
105
105
|
),
|
|
@@ -116,30 +116,30 @@ function ka(d, t) {
|
|
|
116
116
|
return d;
|
|
117
117
|
}
|
|
118
118
|
function Re(d, t) {
|
|
119
|
-
let s,
|
|
119
|
+
let s, u, y;
|
|
120
120
|
if (t.length === 0)
|
|
121
121
|
return d;
|
|
122
|
-
for (s = 0,
|
|
123
|
-
|
|
122
|
+
for (s = 0, y = t.length; s < y; s++)
|
|
123
|
+
u = t.charCodeAt(s), d = (d << 5) - d + u, d |= 0;
|
|
124
124
|
return d < 0 ? d * -2 : d;
|
|
125
125
|
}
|
|
126
126
|
function Ta(d, t, s) {
|
|
127
|
-
return Object.keys(t).sort().reduce(
|
|
128
|
-
function
|
|
129
|
-
return Mr(
|
|
127
|
+
return Object.keys(t).sort().reduce(u, d);
|
|
128
|
+
function u(y, A) {
|
|
129
|
+
return Mr(y, t[A], A, s);
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
function Mr(d, t, s,
|
|
133
|
-
const
|
|
132
|
+
function Mr(d, t, s, u) {
|
|
133
|
+
const y = Re(Re(Re(d, s), Na(t)), typeof t);
|
|
134
134
|
if (t === null)
|
|
135
|
-
return Re(
|
|
135
|
+
return Re(y, "null");
|
|
136
136
|
if (t === void 0)
|
|
137
|
-
return Re(
|
|
137
|
+
return Re(y, "undefined");
|
|
138
138
|
if (typeof t == "object" || typeof t == "function") {
|
|
139
|
-
if (
|
|
140
|
-
return Re(
|
|
141
|
-
|
|
142
|
-
const A = Ta(
|
|
139
|
+
if (u.includes(t))
|
|
140
|
+
return Re(y, `[Circular]${s}`);
|
|
141
|
+
u.push(t);
|
|
142
|
+
const A = Ta(y, t, u);
|
|
143
143
|
if (!("valueOf" in t) || typeof t.valueOf != "function")
|
|
144
144
|
return A;
|
|
145
145
|
try {
|
|
@@ -148,7 +148,7 @@ function Mr(d, t, s, c) {
|
|
|
148
148
|
return Re(A, `[valueOf exception]${I.stack || I.message}`);
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
return Re(
|
|
151
|
+
return Re(y, t.toString());
|
|
152
152
|
}
|
|
153
153
|
function Na(d) {
|
|
154
154
|
return Object.prototype.toString.call(d);
|
|
@@ -167,10 +167,10 @@ function Va(d, t) {
|
|
|
167
167
|
{ v: 1e15, s: "P" },
|
|
168
168
|
{ v: 1e18, s: "E" }
|
|
169
169
|
];
|
|
170
|
-
let
|
|
171
|
-
for (
|
|
170
|
+
let u;
|
|
171
|
+
for (u = s.length - 1; u > 0 && !(d >= s[u].v); u--)
|
|
172
172
|
;
|
|
173
|
-
return (d / s[
|
|
173
|
+
return (d / s[u].v).toFixed(t).replace(/\.0+$|(\.\d*[1-9])0+$/, "$1") + s[u].s;
|
|
174
174
|
}
|
|
175
175
|
const L = (d = 0, t) => {
|
|
176
176
|
switch (!0) {
|
|
@@ -197,11 +197,11 @@ function qa(d, t) {
|
|
|
197
197
|
{ value: 1e12, symbol: "T" },
|
|
198
198
|
{ value: 1e15, symbol: "P" },
|
|
199
199
|
{ value: 1e18, symbol: "E" }
|
|
200
|
-
],
|
|
201
|
-
let
|
|
202
|
-
for (
|
|
200
|
+
], u = /\.0+$|(\.\d*[1-9])0+$/;
|
|
201
|
+
let y;
|
|
202
|
+
for (y = s.length - 1; y > 0 && !(d >= s[y].value); y--)
|
|
203
203
|
;
|
|
204
|
-
return (d / s[
|
|
204
|
+
return (d / s[y].value).toFixed(t).replace(u, "$1") + s[y].symbol;
|
|
205
205
|
}
|
|
206
206
|
function es(d) {
|
|
207
207
|
switch (d.language) {
|
|
@@ -217,8 +217,8 @@ function es(d) {
|
|
|
217
217
|
function ts(d) {
|
|
218
218
|
const t = window.BuzzCasting.getOptions().suspended ?? !1;
|
|
219
219
|
return d.forEach((s) => {
|
|
220
|
-
var
|
|
221
|
-
if (t ? s.content = "License suspended, please contact your Sales Representative to restore service" : s.content = ((
|
|
220
|
+
var u;
|
|
221
|
+
if (t ? s.content = "License suspended, please contact your Sales Representative to restore service" : s.content = ((u = s.content) == null ? void 0 : u.replace(
|
|
222
222
|
/(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)((\?.*)?)/g,
|
|
223
223
|
""
|
|
224
224
|
)) || "", s.sender !== null)
|
|
@@ -250,22 +250,22 @@ function ts(d) {
|
|
|
250
250
|
influence: 0
|
|
251
251
|
};
|
|
252
252
|
if (s.sender.title === "" && s.link !== "") {
|
|
253
|
-
const
|
|
254
|
-
s.sender.title =
|
|
253
|
+
const y = new URL(s.link);
|
|
254
|
+
s.sender.title = y.hostname.replace("www.", "");
|
|
255
255
|
}
|
|
256
256
|
}), d;
|
|
257
257
|
}
|
|
258
|
-
function ns(d, t, s,
|
|
258
|
+
function ns(d, t, s, u) {
|
|
259
259
|
d.stopPropagation(), t.showModal({
|
|
260
260
|
showComponent: "card-modal",
|
|
261
|
-
props: { data: s, options:
|
|
261
|
+
props: { data: s, options: u }
|
|
262
262
|
});
|
|
263
263
|
}
|
|
264
264
|
function rs(d) {
|
|
265
265
|
const t = [...d];
|
|
266
266
|
for (let s = t.length - 1; s > 0; s--) {
|
|
267
|
-
const
|
|
268
|
-
[t[s], t[
|
|
267
|
+
const u = Math.floor(Math.random() * (s + 1));
|
|
268
|
+
[t[s], t[u]] = [t[u], t[s]];
|
|
269
269
|
}
|
|
270
270
|
return t;
|
|
271
271
|
}
|
|
@@ -302,10 +302,10 @@ function Ca(d) {
|
|
|
302
302
|
}
|
|
303
303
|
function At(d, t) {
|
|
304
304
|
var Y;
|
|
305
|
-
let s,
|
|
305
|
+
let s, u, y, A, I;
|
|
306
306
|
switch (d.moderation) {
|
|
307
307
|
case an.BEFORE:
|
|
308
|
-
s = /* @__PURE__ */ new Date(),
|
|
308
|
+
s = /* @__PURE__ */ new Date(), u = (Y = d.beforeTime) == null ? void 0 : Y.split(":"), y = Number.parseInt(u ? u[0] : "00"), A = Number.parseInt(u ? u[1] : "00"), I = Number.parseInt(u ? u[2] : "00"), t.before = s.setHours(y, A, I, 0) / 1e3, t.period || (t.period = s.getDay() === 1 ? 72 : 24);
|
|
309
309
|
break;
|
|
310
310
|
case an.DELAYED:
|
|
311
311
|
d.delay && d.delay > 0 && (t.delay = `${d.delay}`);
|
|
@@ -347,26 +347,26 @@ class $a {
|
|
|
347
347
|
this.options = t, this.url = `https://${t.app}.buzzcasting.net`;
|
|
348
348
|
}
|
|
349
349
|
async get(t) {
|
|
350
|
-
const { version: s } = this.options,
|
|
351
|
-
delete
|
|
352
|
-
const A = Object.keys(
|
|
350
|
+
const { version: s } = this.options, u = this.headers(), y = Object.assign({}, t);
|
|
351
|
+
delete y.type, delete y.hash, delete y.order, y.topics = `${y.dashboard}-${y.widget}`, delete y.presentation;
|
|
352
|
+
const A = Object.keys(y).length > 0 ? `?${new URLSearchParams(y).toString()}` : "";
|
|
353
353
|
return L(3, [
|
|
354
|
-
"%capi%c %
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
354
|
+
"%capi%c %cload",
|
|
355
|
+
c.API,
|
|
356
|
+
c.NONE,
|
|
357
|
+
c.GET_DATA,
|
|
358
358
|
t.type,
|
|
359
359
|
t.widget
|
|
360
360
|
]), L(4, [
|
|
361
|
-
"%capi%c %
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
361
|
+
"%capi%c %cload",
|
|
362
|
+
c.API,
|
|
363
|
+
c.NONE,
|
|
364
|
+
c.GET_DATA,
|
|
365
365
|
t.type,
|
|
366
|
-
|
|
366
|
+
y
|
|
367
367
|
]), await fetch(
|
|
368
368
|
[this.url, "api", s, t.type].join("/") + A,
|
|
369
|
-
{ ...
|
|
369
|
+
{ ...u, method: "get" }
|
|
370
370
|
).then(async (I) => {
|
|
371
371
|
if (!I.ok)
|
|
372
372
|
throw new Error(`${I.status}`);
|
|
@@ -374,18 +374,18 @@ class $a {
|
|
|
374
374
|
}).then((I) => I.json()).then((I) => (I.query = t, I)).catch((I) => ({ success: !1, message: `${I}`, data: null, query: t }));
|
|
375
375
|
}
|
|
376
376
|
async hideMessage(t) {
|
|
377
|
-
const { version: s } = this.options,
|
|
377
|
+
const { version: s } = this.options, u = this.headers(), y = "?action=visible";
|
|
378
378
|
return console.info(
|
|
379
379
|
"%capi%c %cput",
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
380
|
+
c.API,
|
|
381
|
+
c.NONE,
|
|
382
|
+
c.GET_DATA,
|
|
383
383
|
q.HIDE_MESSAGE,
|
|
384
384
|
t.widget,
|
|
385
385
|
t.id
|
|
386
386
|
), await fetch(
|
|
387
|
-
[this.url, "api", s, "messages", t.id].join("/") +
|
|
388
|
-
{ ...
|
|
387
|
+
[this.url, "api", s, "messages", t.id].join("/") + y,
|
|
388
|
+
{ ...u, method: "put" }
|
|
389
389
|
).then((A) => {
|
|
390
390
|
if (!A.ok)
|
|
391
391
|
throw new Error(A.statusText);
|
|
@@ -393,20 +393,20 @@ class $a {
|
|
|
393
393
|
}).then((A) => A.json()).catch((A) => ({ succes: !1, message: A, data: [] }));
|
|
394
394
|
}
|
|
395
395
|
async hideLabels(t) {
|
|
396
|
-
const { version: s } = this.options,
|
|
396
|
+
const { version: s } = this.options, u = this.formHeaders(), y = new URLSearchParams(), A = t.labels || [];
|
|
397
397
|
for (const [I, Y] of A.entries())
|
|
398
|
-
|
|
398
|
+
y.append(`custom_filters[${I}]`, Y);
|
|
399
399
|
return console.info(
|
|
400
400
|
"%capi%c %cput",
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
401
|
+
c.API,
|
|
402
|
+
c.NONE,
|
|
403
|
+
c.GET_DATA,
|
|
404
404
|
q.HIDE_LABELS,
|
|
405
405
|
t.widget,
|
|
406
406
|
A
|
|
407
407
|
), await fetch(
|
|
408
408
|
[this.url, "api", s, t.type, t.widget].join("/"),
|
|
409
|
-
{ ...
|
|
409
|
+
{ ...u, body: y, method: "put" }
|
|
410
410
|
).then((I) => {
|
|
411
411
|
if (!I.ok)
|
|
412
412
|
throw new Error(I.statusText);
|
|
@@ -414,10 +414,10 @@ class $a {
|
|
|
414
414
|
}).then((I) => I.json()).catch((I) => ({ succes: !1, message: I, data: [] }));
|
|
415
415
|
}
|
|
416
416
|
async loadSlide(t) {
|
|
417
|
-
const { version: s } = this.options,
|
|
418
|
-
return delete
|
|
417
|
+
const { version: s } = this.options, u = this.headers(), y = Object.assign({}, t);
|
|
418
|
+
return delete y.type, delete y.hash, L(3, ["%capi%c %cloadSlide", c.API, c.NONE, c.SLIDE, t.id]), await fetch(
|
|
419
419
|
[this.url, "api", s, "slides", t.id].join("/"),
|
|
420
|
-
{ ...
|
|
420
|
+
{ ...u, method: "get" }
|
|
421
421
|
).then(async (A) => {
|
|
422
422
|
if (!A.ok)
|
|
423
423
|
throw new Error(`${A.status}`);
|
|
@@ -432,19 +432,19 @@ class $a {
|
|
|
432
432
|
* @returns
|
|
433
433
|
*/
|
|
434
434
|
async storeSlide(t) {
|
|
435
|
-
const { version: s } = this.options,
|
|
435
|
+
const { version: s } = this.options, u = this.formHeaders();
|
|
436
436
|
delete t.update, delete t.type;
|
|
437
|
-
const
|
|
437
|
+
const y = JSON.stringify(t);
|
|
438
438
|
return console.info(
|
|
439
439
|
"%capi%c %cput",
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
440
|
+
c.API,
|
|
441
|
+
c.NONE,
|
|
442
|
+
c.SLIDE,
|
|
443
443
|
q.SLIDE_STORE,
|
|
444
444
|
t.id
|
|
445
445
|
), await fetch(
|
|
446
446
|
[this.url, "api", s, "slides", t.id].join("/"),
|
|
447
|
-
{ ...
|
|
447
|
+
{ ...u, body: y, method: "put" }
|
|
448
448
|
).then((A) => {
|
|
449
449
|
if (!A.ok)
|
|
450
450
|
throw new Error(A.statusText);
|
|
@@ -452,21 +452,21 @@ class $a {
|
|
|
452
452
|
}).then((A) => A.json()).catch((A) => ({ succes: !1, message: A, data: [] }));
|
|
453
453
|
}
|
|
454
454
|
async loadPresentation(t) {
|
|
455
|
-
const { version: s } = this.options,
|
|
455
|
+
const { version: s } = this.options, u = this.headers();
|
|
456
456
|
return delete t.update, L(3, [
|
|
457
457
|
"%capi%c %cloadPresentation",
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
458
|
+
c.API,
|
|
459
|
+
c.NONE,
|
|
460
|
+
c.PRESENTATION,
|
|
461
461
|
t.id
|
|
462
462
|
]), await fetch(
|
|
463
463
|
[this.url, "api", s, _.PRESENTATIONS, t.id].join("/"),
|
|
464
|
-
{ ...
|
|
465
|
-
).then(async (
|
|
466
|
-
if (!
|
|
467
|
-
throw new Error(`${
|
|
468
|
-
return
|
|
469
|
-
}).then((
|
|
464
|
+
{ ...u, method: "get" }
|
|
465
|
+
).then(async (y) => {
|
|
466
|
+
if (!y.ok)
|
|
467
|
+
throw new Error(`${y.status}`);
|
|
468
|
+
return y;
|
|
469
|
+
}).then((y) => y.json()).then((y) => (y.query = t, y)).catch((y) => ({ success: !1, message: `${y}`, data: null }));
|
|
470
470
|
}
|
|
471
471
|
/**
|
|
472
472
|
* Store slide definition
|
|
@@ -476,12 +476,12 @@ class $a {
|
|
|
476
476
|
* @returns
|
|
477
477
|
*/
|
|
478
478
|
async storePresentation(t) {
|
|
479
|
-
const { version: s } = this.options,
|
|
479
|
+
const { version: s } = this.options, u = this.formHeaders();
|
|
480
480
|
delete t.update;
|
|
481
|
-
const
|
|
482
|
-
return L(2, ["%capi%c %cput",
|
|
481
|
+
const y = JSON.stringify(t);
|
|
482
|
+
return L(2, ["%capi%c %cput", c.API, c.NONE, c.PRESENTATION, t.name]), await fetch(
|
|
483
483
|
[this.url, "api", s, _.PRESENTATIONS, t.id].join("/"),
|
|
484
|
-
{ ...
|
|
484
|
+
{ ...u, body: y, method: "put" }
|
|
485
485
|
).then((A) => {
|
|
486
486
|
if (!A.ok)
|
|
487
487
|
throw new Error(A.statusText);
|
|
@@ -489,35 +489,35 @@ class $a {
|
|
|
489
489
|
}).then((A) => A.json()).catch((A) => ({ succes: !1, message: A, data: [] }));
|
|
490
490
|
}
|
|
491
491
|
async loadPreference(t) {
|
|
492
|
-
const { version: s } = this.options,
|
|
492
|
+
const { version: s } = this.options, u = this.headers();
|
|
493
493
|
return L(3, [
|
|
494
494
|
"%capi%c %cloadPreference",
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
495
|
+
c.API,
|
|
496
|
+
c.NONE,
|
|
497
|
+
c.APP,
|
|
498
498
|
t.id
|
|
499
499
|
]), await fetch(
|
|
500
500
|
[this.url, "api", s, _.PREFERENCES, t.id].join("/"),
|
|
501
|
-
{ ...
|
|
502
|
-
).then(async (
|
|
503
|
-
if (!
|
|
504
|
-
throw new Error(`${
|
|
505
|
-
return
|
|
506
|
-
}).then((
|
|
501
|
+
{ ...u, method: "get" }
|
|
502
|
+
).then(async (y) => {
|
|
503
|
+
if (!y.ok)
|
|
504
|
+
throw new Error(`${y.status}`);
|
|
505
|
+
return y;
|
|
506
|
+
}).then((y) => y.json()).then((y) => y).catch((y) => ({ success: !1, message: `${y}`, data: null }));
|
|
507
507
|
}
|
|
508
508
|
async storePreference(t) {
|
|
509
|
-
const { version: s } = this.options,
|
|
509
|
+
const { version: s } = this.options, u = this.formHeaders();
|
|
510
510
|
delete t.update;
|
|
511
|
-
const
|
|
511
|
+
const y = JSON.stringify({ data: t });
|
|
512
512
|
return console.info(
|
|
513
513
|
"%capi%c %cstorePreference",
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
514
|
+
c.API,
|
|
515
|
+
c.NONE,
|
|
516
|
+
c.APP,
|
|
517
517
|
t.id
|
|
518
518
|
), await fetch(
|
|
519
519
|
[this.url, "api", s, _.PREFERENCES, t.id].join("/"),
|
|
520
|
-
{ ...
|
|
520
|
+
{ ...u, body: y, method: "put" }
|
|
521
521
|
).then((A) => {
|
|
522
522
|
if (!A.ok)
|
|
523
523
|
throw new Error(A.statusText);
|
|
@@ -562,22 +562,22 @@ class $a {
|
|
|
562
562
|
});
|
|
563
563
|
}*/
|
|
564
564
|
async loadDashboards(t) {
|
|
565
|
-
const { version: s } = this.options,
|
|
566
|
-
return L(3, ["%capi%c %dashboards",
|
|
565
|
+
const { version: s } = this.options, u = this.headers();
|
|
566
|
+
return L(3, ["%capi%c %dashboards", c.API, c.NONE, c.WIDGET]), await fetch(
|
|
567
567
|
[this.url, "api", s, _.WIDGETS, (t == null ? void 0 : t.id) || ""].join("/"),
|
|
568
568
|
{
|
|
569
|
-
...
|
|
569
|
+
...u,
|
|
570
570
|
method: "get"
|
|
571
571
|
}
|
|
572
|
-
).then(async (
|
|
573
|
-
if (!
|
|
574
|
-
throw new Error(`${
|
|
575
|
-
return
|
|
576
|
-
}).then((
|
|
577
|
-
data: { dashboards:
|
|
572
|
+
).then(async (y) => {
|
|
573
|
+
if (!y.ok)
|
|
574
|
+
throw new Error(`${y.status}`);
|
|
575
|
+
return y;
|
|
576
|
+
}).then((y) => y.json()).then((y) => ({
|
|
577
|
+
data: { dashboards: y },
|
|
578
578
|
message: "Dashboard Widgets loaded from api",
|
|
579
579
|
success: !0
|
|
580
|
-
})).catch((
|
|
580
|
+
})).catch((y) => ({ success: !1, message: `${y}`, data: null }));
|
|
581
581
|
}
|
|
582
582
|
}
|
|
583
583
|
var ja = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
@@ -587,8 +587,8 @@ function Ma(d) {
|
|
|
587
587
|
var sn = { exports: {} }, Ba = sn.exports, $r;
|
|
588
588
|
function Ga() {
|
|
589
589
|
return $r || ($r = 1, function(d, t) {
|
|
590
|
-
(function(s,
|
|
591
|
-
d.exports =
|
|
590
|
+
(function(s, u) {
|
|
591
|
+
d.exports = u();
|
|
592
592
|
})(Ba, function() {
|
|
593
593
|
var s = function(e, n) {
|
|
594
594
|
return (s = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, a) {
|
|
@@ -596,13 +596,13 @@ function Ga() {
|
|
|
596
596
|
} || function(r, a) {
|
|
597
597
|
for (var i in a) Object.prototype.hasOwnProperty.call(a, i) && (r[i] = a[i]);
|
|
598
598
|
})(e, n);
|
|
599
|
-
},
|
|
600
|
-
return (
|
|
599
|
+
}, u = function() {
|
|
600
|
+
return (u = Object.assign || function(e) {
|
|
601
601
|
for (var n, r = 1, a = arguments.length; r < a; r++) for (var i in n = arguments[r]) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
|
|
602
602
|
return e;
|
|
603
603
|
}).apply(this, arguments);
|
|
604
604
|
};
|
|
605
|
-
function
|
|
605
|
+
function y(e, n, r) {
|
|
606
606
|
for (var a, i = 0, o = n.length; i < o; i++) !a && i in n || ((a = a || Array.prototype.slice.call(n, 0, i))[i] = n[i]);
|
|
607
607
|
return e.concat(a || Array.prototype.slice.call(n));
|
|
608
608
|
}
|
|
@@ -654,10 +654,10 @@ function Ga() {
|
|
|
654
654
|
}
|
|
655
655
|
return r;
|
|
656
656
|
}
|
|
657
|
-
var
|
|
658
|
-
if (
|
|
659
|
-
var f = e[n.substr(0,
|
|
660
|
-
return f == null ? void 0 : ve(f, n.substr(
|
|
657
|
+
var l = n.indexOf(".");
|
|
658
|
+
if (l !== -1) {
|
|
659
|
+
var f = e[n.substr(0, l)];
|
|
660
|
+
return f == null ? void 0 : ve(f, n.substr(l + 1));
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
663
|
function he(e, n, r) {
|
|
@@ -665,8 +665,8 @@ function Ga() {
|
|
|
665
665
|
ge(typeof r != "string" && "length" in r);
|
|
666
666
|
for (var a = 0, i = n.length; a < i; ++a) he(e, n[a], r[a]);
|
|
667
667
|
} else {
|
|
668
|
-
var o,
|
|
669
|
-
f !== -1 ? (o = n.substr(0, f), (
|
|
668
|
+
var o, l, f = n.indexOf(".");
|
|
669
|
+
f !== -1 ? (o = n.substr(0, f), (l = n.substr(f + 1)) === "" ? r === void 0 ? Y(e) && !isNaN(parseInt(o)) ? e.splice(o, 1) : delete e[o] : e[o] = r : he(f = !(f = e[o]) || !Q(e, o) ? e[o] = {} : f, l, r)) : r === void 0 ? Y(e) && !isNaN(parseInt(n)) ? e.splice(n, 1) : delete e[n] : e[n] = r;
|
|
670
670
|
}
|
|
671
671
|
}
|
|
672
672
|
function xt(e) {
|
|
@@ -697,8 +697,8 @@ function Ga() {
|
|
|
697
697
|
for (var i = 0, o = r.length; i < o; ++i) a.push(n(r[i]));
|
|
698
698
|
} else if (qn.has(r.constructor)) a = r;
|
|
699
699
|
else {
|
|
700
|
-
var
|
|
701
|
-
for (
|
|
700
|
+
var l, f = ue(r);
|
|
701
|
+
for (l in a = f === Object.prototype ? {} : Object.create(f), lt.set(r, a), r) Q(r, l) && (a[l] = n(r[l]));
|
|
702
702
|
}
|
|
703
703
|
return a;
|
|
704
704
|
}(e), lt = null, e;
|
|
@@ -860,10 +860,10 @@ function Ga() {
|
|
|
860
860
|
i(function(o) {
|
|
861
861
|
if (a._state === null) {
|
|
862
862
|
if (o === a) throw new TypeError("A promise cannot be resolved with itself.");
|
|
863
|
-
var
|
|
863
|
+
var l = a._lib && nt();
|
|
864
864
|
o && typeof o.then == "function" ? r(a, function(f, p) {
|
|
865
865
|
o instanceof M ? o._then(f, p) : o.then(f, p);
|
|
866
|
-
}) : (a._state = !0, a._value = o, sr(a)),
|
|
866
|
+
}) : (a._state = !0, a._value = o, sr(a)), l && rt();
|
|
867
867
|
}
|
|
868
868
|
}, bn.bind(null, a));
|
|
869
869
|
} catch (o) {
|
|
@@ -874,8 +874,8 @@ function Ga() {
|
|
|
874
874
|
var mn = { get: function() {
|
|
875
875
|
var e = G, n = Bt;
|
|
876
876
|
function r(a, i) {
|
|
877
|
-
var o = this,
|
|
878
|
-
yn(o, new ar(or(a, e,
|
|
877
|
+
var o = this, l = !e.global && (e !== G || n !== Bt), f = l && !Ne(), p = new M(function(m, E) {
|
|
878
|
+
yn(o, new ar(or(a, e, l, f), or(i, e, l, f), m, E, e));
|
|
879
879
|
});
|
|
880
880
|
return this._consoleTask && (p._consoleTask = this._consoleTask), p;
|
|
881
881
|
}
|
|
@@ -916,7 +916,7 @@ function Ga() {
|
|
|
916
916
|
!n._state && Nt.length && (Nt = []), a = Ee && n._consoleTask ? n._consoleTask.run(function() {
|
|
917
917
|
return e(i);
|
|
918
918
|
}) : e(i), n._state || Nt.indexOf(i) !== -1 || function(o) {
|
|
919
|
-
for (var
|
|
919
|
+
for (var l = ze.length; l; ) if (ze[--l]._value === o._value) return ze.splice(l, 1);
|
|
920
920
|
}(n), r.resolve(a);
|
|
921
921
|
} catch (o) {
|
|
922
922
|
r.reject(o);
|
|
@@ -1000,8 +1000,8 @@ function Ga() {
|
|
|
1000
1000
|
e.length === 0 && n([]);
|
|
1001
1001
|
var a = e.length;
|
|
1002
1002
|
e.forEach(function(i, o) {
|
|
1003
|
-
return M.resolve(i).then(function(
|
|
1004
|
-
e[o] =
|
|
1003
|
+
return M.resolve(i).then(function(l) {
|
|
1004
|
+
e[o] = l, --a || n(e);
|
|
1005
1005
|
}, r);
|
|
1006
1006
|
});
|
|
1007
1007
|
});
|
|
@@ -1033,8 +1033,8 @@ function Ga() {
|
|
|
1033
1033
|
} }, follow: function(e, n) {
|
|
1034
1034
|
return new M(function(r, a) {
|
|
1035
1035
|
return Te(function(i, o) {
|
|
1036
|
-
var
|
|
1037
|
-
|
|
1036
|
+
var l = G;
|
|
1037
|
+
l.unhandleds = [], l.onunhandled = o, l.finalize = Fe(function() {
|
|
1038
1038
|
var f, p = this;
|
|
1039
1039
|
f = function() {
|
|
1040
1040
|
p.unhandleds.length === 0 ? i() : o(p.unhandleds[0]);
|
|
@@ -1043,7 +1043,7 @@ function Ga() {
|
|
|
1043
1043
|
}), ++He, pt(function() {
|
|
1044
1044
|
--He == 0 && vn();
|
|
1045
1045
|
}, []);
|
|
1046
|
-
},
|
|
1046
|
+
}, l.finalize), e();
|
|
1047
1047
|
}, n, r, a);
|
|
1048
1048
|
});
|
|
1049
1049
|
} }), Ue && (Ue.allSettled && ae(M, "allSettled", function() {
|
|
@@ -1052,10 +1052,10 @@ function Ga() {
|
|
|
1052
1052
|
e.length === 0 && n([]);
|
|
1053
1053
|
var r = e.length, a = new Array(r);
|
|
1054
1054
|
e.forEach(function(i, o) {
|
|
1055
|
-
return M.resolve(i).then(function(
|
|
1056
|
-
return a[o] = { status: "fulfilled", value:
|
|
1057
|
-
}, function(
|
|
1058
|
-
return a[o] = { status: "rejected", reason:
|
|
1055
|
+
return M.resolve(i).then(function(l) {
|
|
1056
|
+
return a[o] = { status: "fulfilled", value: l };
|
|
1057
|
+
}, function(l) {
|
|
1058
|
+
return a[o] = { status: "rejected", reason: l };
|
|
1059
1059
|
}).then(function() {
|
|
1060
1060
|
return --r || n(a);
|
|
1061
1061
|
});
|
|
@@ -1066,11 +1066,11 @@ function Ga() {
|
|
|
1066
1066
|
return new M(function(n, r) {
|
|
1067
1067
|
e.length === 0 && r(new AggregateError([]));
|
|
1068
1068
|
var a = e.length, i = new Array(a);
|
|
1069
|
-
e.forEach(function(o,
|
|
1069
|
+
e.forEach(function(o, l) {
|
|
1070
1070
|
return M.resolve(o).then(function(f) {
|
|
1071
1071
|
return n(f);
|
|
1072
1072
|
}, function(f) {
|
|
1073
|
-
i[
|
|
1073
|
+
i[l] = f, --a || r(new AggregateError(i));
|
|
1074
1074
|
});
|
|
1075
1075
|
});
|
|
1076
1076
|
});
|
|
@@ -1160,16 +1160,16 @@ function Ga() {
|
|
|
1160
1160
|
return n < e ? 1 : e < n ? -1 : 0;
|
|
1161
1161
|
case "binary":
|
|
1162
1162
|
return function(i, o) {
|
|
1163
|
-
for (var
|
|
1164
|
-
return
|
|
1163
|
+
for (var l = i.length, f = o.length, p = l < f ? l : f, m = 0; m < p; ++m) if (i[m] !== o[m]) return i[m] < o[m] ? -1 : 1;
|
|
1164
|
+
return l === f ? 0 : l < f ? -1 : 1;
|
|
1165
1165
|
}(fr(e), fr(n));
|
|
1166
1166
|
case "Array":
|
|
1167
1167
|
return function(i, o) {
|
|
1168
|
-
for (var
|
|
1168
|
+
for (var l = i.length, f = o.length, p = l < f ? l : f, m = 0; m < p; ++m) {
|
|
1169
1169
|
var E = X(i[m], o[m]);
|
|
1170
1170
|
if (E !== 0) return E;
|
|
1171
1171
|
}
|
|
1172
|
-
return
|
|
1172
|
+
return l === f ? 0 : l < f ? -1 : 1;
|
|
1173
1173
|
}(e, n);
|
|
1174
1174
|
}
|
|
1175
1175
|
} catch {
|
|
@@ -1185,14 +1185,14 @@ function Ga() {
|
|
|
1185
1185
|
}
|
|
1186
1186
|
var hr = (ee.prototype._trans = function(e, n, r) {
|
|
1187
1187
|
var a = this._tx || G.trans, i = this.name, o = Ee && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
1188
|
-
function
|
|
1188
|
+
function l(m, E, h) {
|
|
1189
1189
|
if (!h.schema[i]) throw new K.NotFound("Table " + i + " not part of transaction");
|
|
1190
1190
|
return n(h.idbtrans, h);
|
|
1191
1191
|
}
|
|
1192
1192
|
var f = nt();
|
|
1193
1193
|
try {
|
|
1194
|
-
var p = a && a.db._novip === this.db._novip ? a === G.trans ? a._promise(e,
|
|
1195
|
-
return a._promise(e,
|
|
1194
|
+
var p = a && a.db._novip === this.db._novip ? a === G.trans ? a._promise(e, l, r) : Te(function() {
|
|
1195
|
+
return a._promise(e, l, r);
|
|
1196
1196
|
}, { trans: a, transless: G.transless || G }) : function m(E, h, O, g) {
|
|
1197
1197
|
if (E.idbdb && (E._state.openComplete || G.letThrough || E._vip)) {
|
|
1198
1198
|
var w = E._createTransaction(h, O, E._dbSchema);
|
|
@@ -1203,9 +1203,9 @@ function Ga() {
|
|
|
1203
1203
|
return m(E, h, O, g);
|
|
1204
1204
|
})) : se(S);
|
|
1205
1205
|
}
|
|
1206
|
-
return w._promise(h, function(S,
|
|
1206
|
+
return w._promise(h, function(S, v) {
|
|
1207
1207
|
return Te(function() {
|
|
1208
|
-
return G.trans = w, g(S,
|
|
1208
|
+
return G.trans = w, g(S, v, w);
|
|
1209
1209
|
});
|
|
1210
1210
|
}).then(function(S) {
|
|
1211
1211
|
if (h === "readwrite") try {
|
|
@@ -1225,7 +1225,7 @@ function Ga() {
|
|
|
1225
1225
|
return E._state.dbReadyPromise.then(function() {
|
|
1226
1226
|
return m(E, h, O, g);
|
|
1227
1227
|
});
|
|
1228
|
-
}(this.db, e, [this.name],
|
|
1228
|
+
}(this.db, e, [this.name], l);
|
|
1229
1229
|
return o && (p._consoleTask = o, p = p.catch(function(m) {
|
|
1230
1230
|
return console.trace(m), se(m);
|
|
1231
1231
|
})), p;
|
|
@@ -1266,7 +1266,7 @@ function Ga() {
|
|
|
1266
1266
|
function i(f, p) {
|
|
1267
1267
|
return X(f, p) === 0;
|
|
1268
1268
|
}
|
|
1269
|
-
var
|
|
1269
|
+
var l = n.reduce(function(h, p) {
|
|
1270
1270
|
var m = h[0], E = h[1], h = a[p], O = e[p];
|
|
1271
1271
|
return [m || h, m || !h ? Xe(E, h && h.multi ? function(g) {
|
|
1272
1272
|
return g = ve(g, p), Y(g) && g.some(function(w) {
|
|
@@ -1275,8 +1275,8 @@ function Ga() {
|
|
|
1275
1275
|
} : function(g) {
|
|
1276
1276
|
return i(O, ve(g, p));
|
|
1277
1277
|
}) : E];
|
|
1278
|
-
}, [null, null]), o =
|
|
1279
|
-
return o ? this.where(o.name).equals(e[o.keyPath]).filter(
|
|
1278
|
+
}, [null, null]), o = l[0], l = l[1];
|
|
1279
|
+
return o ? this.where(o.name).equals(e[o.keyPath]).filter(l) : r ? this.filter(l) : this.where(n).equals("");
|
|
1280
1280
|
}, ee.prototype.filter = function(e) {
|
|
1281
1281
|
return this.toCollection().and(e);
|
|
1282
1282
|
}, ee.prototype.count = function(e) {
|
|
@@ -1311,7 +1311,7 @@ function Ga() {
|
|
|
1311
1311
|
}, enumerable: !1, configurable: !0 }), i.prototype.table = function() {
|
|
1312
1312
|
return a;
|
|
1313
1313
|
}, e = i);
|
|
1314
|
-
for (var o = /* @__PURE__ */ new Set(),
|
|
1314
|
+
for (var o = /* @__PURE__ */ new Set(), l = e.prototype; l; l = ue(l)) Object.getOwnPropertyNames(l).forEach(function(p) {
|
|
1315
1315
|
return o.add(p);
|
|
1316
1316
|
});
|
|
1317
1317
|
function f(p) {
|
|
@@ -1329,9 +1329,9 @@ function Ga() {
|
|
|
1329
1329
|
ne(this, e);
|
|
1330
1330
|
});
|
|
1331
1331
|
}, ee.prototype.add = function(e, n) {
|
|
1332
|
-
var r = this, a = this.schema.primKey, i = a.auto, o = a.keyPath,
|
|
1333
|
-
return o && i && (
|
|
1334
|
-
return r.core.mutate({ trans: f, type: "add", keys: n != null ? [n] : null, values: [
|
|
1332
|
+
var r = this, a = this.schema.primKey, i = a.auto, o = a.keyPath, l = e;
|
|
1333
|
+
return o && i && (l = Lt(o)(e)), this._trans("readwrite", function(f) {
|
|
1334
|
+
return r.core.mutate({ trans: f, type: "add", keys: n != null ? [n] : null, values: [l] });
|
|
1335
1335
|
}).then(function(f) {
|
|
1336
1336
|
return f.numFailures ? M.reject(f.failures[0]) : f.lastResult;
|
|
1337
1337
|
}).then(function(f) {
|
|
@@ -1344,9 +1344,9 @@ function Ga() {
|
|
|
1344
1344
|
}, ee.prototype.update = function(e, n) {
|
|
1345
1345
|
return typeof e != "object" || Y(e) ? this.where(":id").equals(e).modify(n) : (e = ve(e, this.schema.primKey.keyPath), e === void 0 ? se(new K.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(n));
|
|
1346
1346
|
}, ee.prototype.put = function(e, n) {
|
|
1347
|
-
var r = this, a = this.schema.primKey, i = a.auto, o = a.keyPath,
|
|
1348
|
-
return o && i && (
|
|
1349
|
-
return r.core.mutate({ trans: f, type: "put", values: [
|
|
1347
|
+
var r = this, a = this.schema.primKey, i = a.auto, o = a.keyPath, l = e;
|
|
1348
|
+
return o && i && (l = Lt(o)(e)), this._trans("readwrite", function(f) {
|
|
1349
|
+
return r.core.mutate({ trans: f, type: "put", values: [l], keys: n != null ? [n] : null });
|
|
1350
1350
|
}).then(function(f) {
|
|
1351
1351
|
return f.numFailures ? M.reject(f.failures[0]) : f.lastResult;
|
|
1352
1352
|
}).then(function(f) {
|
|
@@ -1381,12 +1381,12 @@ function Ga() {
|
|
|
1381
1381
|
});
|
|
1382
1382
|
}, ee.prototype.bulkAdd = function(e, n, r) {
|
|
1383
1383
|
var a = this, i = Array.isArray(n) ? n : void 0, o = (r = r || (i ? void 0 : n)) ? r.allKeys : void 0;
|
|
1384
|
-
return this._trans("readwrite", function(
|
|
1384
|
+
return this._trans("readwrite", function(l) {
|
|
1385
1385
|
var m = a.schema.primKey, f = m.auto, m = m.keyPath;
|
|
1386
1386
|
if (m && i) throw new K.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
1387
1387
|
if (i && i.length !== e.length) throw new K.InvalidArgument("Arguments objects and keys must have the same length");
|
|
1388
1388
|
var p = e.length, m = m && f ? e.map(Lt(m)) : e;
|
|
1389
|
-
return a.core.mutate({ trans:
|
|
1389
|
+
return a.core.mutate({ trans: l, type: "add", keys: i, values: m, wantResults: o }).then(function(w) {
|
|
1390
1390
|
var h = w.numFailures, O = w.results, g = w.lastResult, w = w.failures;
|
|
1391
1391
|
if (h === 0) return o ? O : g;
|
|
1392
1392
|
throw new tt("".concat(a.name, ".bulkAdd(): ").concat(h, " of ").concat(p, " operations failed"), w);
|
|
@@ -1394,31 +1394,31 @@ function Ga() {
|
|
|
1394
1394
|
});
|
|
1395
1395
|
}, ee.prototype.bulkPut = function(e, n, r) {
|
|
1396
1396
|
var a = this, i = Array.isArray(n) ? n : void 0, o = (r = r || (i ? void 0 : n)) ? r.allKeys : void 0;
|
|
1397
|
-
return this._trans("readwrite", function(
|
|
1397
|
+
return this._trans("readwrite", function(l) {
|
|
1398
1398
|
var m = a.schema.primKey, f = m.auto, m = m.keyPath;
|
|
1399
1399
|
if (m && i) throw new K.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
1400
1400
|
if (i && i.length !== e.length) throw new K.InvalidArgument("Arguments objects and keys must have the same length");
|
|
1401
1401
|
var p = e.length, m = m && f ? e.map(Lt(m)) : e;
|
|
1402
|
-
return a.core.mutate({ trans:
|
|
1402
|
+
return a.core.mutate({ trans: l, type: "put", keys: i, values: m, wantResults: o }).then(function(w) {
|
|
1403
1403
|
var h = w.numFailures, O = w.results, g = w.lastResult, w = w.failures;
|
|
1404
1404
|
if (h === 0) return o ? O : g;
|
|
1405
1405
|
throw new tt("".concat(a.name, ".bulkPut(): ").concat(h, " of ").concat(p, " operations failed"), w);
|
|
1406
1406
|
});
|
|
1407
1407
|
});
|
|
1408
1408
|
}, ee.prototype.bulkUpdate = function(e) {
|
|
1409
|
-
var n = this, r = this.core, a = e.map(function(
|
|
1410
|
-
return
|
|
1411
|
-
}), i = e.map(function(
|
|
1412
|
-
return
|
|
1409
|
+
var n = this, r = this.core, a = e.map(function(l) {
|
|
1410
|
+
return l.key;
|
|
1411
|
+
}), i = e.map(function(l) {
|
|
1412
|
+
return l.changes;
|
|
1413
1413
|
}), o = [];
|
|
1414
|
-
return this._trans("readwrite", function(
|
|
1415
|
-
return r.getMany({ trans:
|
|
1414
|
+
return this._trans("readwrite", function(l) {
|
|
1415
|
+
return r.getMany({ trans: l, keys: a, cache: "clone" }).then(function(f) {
|
|
1416
1416
|
var p = [], m = [];
|
|
1417
1417
|
e.forEach(function(h, O) {
|
|
1418
1418
|
var g = h.key, w = h.changes, S = f[O];
|
|
1419
1419
|
if (S) {
|
|
1420
|
-
for (var
|
|
1421
|
-
var D = P[
|
|
1420
|
+
for (var v = 0, P = Object.keys(w); v < P.length; v++) {
|
|
1421
|
+
var D = P[v], R = w[D];
|
|
1422
1422
|
if (D === n.schema.primKey.keyPath) {
|
|
1423
1423
|
if (X(R, g) !== 0) throw new K.Constraint("Cannot update primary key in bulkUpdate()");
|
|
1424
1424
|
} else he(S, D, R);
|
|
@@ -1427,12 +1427,12 @@ function Ga() {
|
|
|
1427
1427
|
}
|
|
1428
1428
|
});
|
|
1429
1429
|
var E = p.length;
|
|
1430
|
-
return r.mutate({ trans:
|
|
1430
|
+
return r.mutate({ trans: l, type: "put", keys: p, values: m, updates: { keys: a, changeSpecs: i } }).then(function(h) {
|
|
1431
1431
|
var O = h.numFailures, g = h.failures;
|
|
1432
1432
|
if (O === 0) return E;
|
|
1433
1433
|
for (var w = 0, S = Object.keys(g); w < S.length; w++) {
|
|
1434
|
-
var
|
|
1435
|
-
D != null && (
|
|
1434
|
+
var v, P = S[w], D = o[Number(P)];
|
|
1435
|
+
D != null && (v = g[P], delete g[P], g[D] = v);
|
|
1436
1436
|
}
|
|
1437
1437
|
throw new tt("".concat(n.name, ".bulkUpdate(): ").concat(O, " of ").concat(E, " operations failed"), g);
|
|
1438
1438
|
});
|
|
@@ -1442,28 +1442,28 @@ function Ga() {
|
|
|
1442
1442
|
var n = this, r = e.length;
|
|
1443
1443
|
return this._trans("readwrite", function(a) {
|
|
1444
1444
|
return n.core.mutate({ trans: a, type: "delete", keys: e });
|
|
1445
|
-
}).then(function(
|
|
1446
|
-
var i =
|
|
1445
|
+
}).then(function(l) {
|
|
1446
|
+
var i = l.numFailures, o = l.lastResult, l = l.failures;
|
|
1447
1447
|
if (i === 0) return o;
|
|
1448
|
-
throw new tt("".concat(n.name, ".bulkDelete(): ").concat(i, " of ").concat(r, " operations failed"),
|
|
1448
|
+
throw new tt("".concat(n.name, ".bulkDelete(): ").concat(i, " of ").concat(r, " operations failed"), l);
|
|
1449
1449
|
});
|
|
1450
1450
|
}, ee);
|
|
1451
1451
|
function ee() {
|
|
1452
1452
|
}
|
|
1453
1453
|
function mt(e) {
|
|
1454
|
-
function n(
|
|
1454
|
+
function n(l, f) {
|
|
1455
1455
|
if (f) {
|
|
1456
1456
|
for (var p = arguments.length, m = new Array(p - 1); --p; ) m[p - 1] = arguments[p];
|
|
1457
|
-
return r[
|
|
1457
|
+
return r[l].subscribe.apply(null, m), e;
|
|
1458
1458
|
}
|
|
1459
|
-
if (typeof
|
|
1459
|
+
if (typeof l == "string") return r[l];
|
|
1460
1460
|
}
|
|
1461
1461
|
var r = {};
|
|
1462
1462
|
n.addEventType = o;
|
|
1463
1463
|
for (var a = 1, i = arguments.length; a < i; ++a) o(arguments[a]);
|
|
1464
1464
|
return n;
|
|
1465
|
-
function o(
|
|
1466
|
-
if (typeof
|
|
1465
|
+
function o(l, f, p) {
|
|
1466
|
+
if (typeof l != "object") {
|
|
1467
1467
|
var m;
|
|
1468
1468
|
f = f || qr;
|
|
1469
1469
|
var E = { subscribers: [], fire: p = p || V, subscribe: function(h) {
|
|
@@ -1473,18 +1473,18 @@ function Ga() {
|
|
|
1473
1473
|
return O !== h;
|
|
1474
1474
|
}), E.fire = E.subscribers.reduce(f, p);
|
|
1475
1475
|
} };
|
|
1476
|
-
return r[
|
|
1476
|
+
return r[l] = n[l] = E;
|
|
1477
1477
|
}
|
|
1478
|
-
I(m =
|
|
1478
|
+
I(m = l).forEach(function(h) {
|
|
1479
1479
|
var O = m[h];
|
|
1480
1480
|
if (Y(O)) o(h, m[h][0], m[h][1]);
|
|
1481
1481
|
else {
|
|
1482
1482
|
if (O !== "asap") throw new K.InvalidArgument("Invalid event config");
|
|
1483
1483
|
var g = o(h, dt, function() {
|
|
1484
1484
|
for (var w = arguments.length, S = new Array(w); w--; ) S[w] = arguments[w];
|
|
1485
|
-
g.subscribers.forEach(function(
|
|
1485
|
+
g.subscribers.forEach(function(v) {
|
|
1486
1486
|
Rt(function() {
|
|
1487
|
-
|
|
1487
|
+
v.apply(null, S);
|
|
1488
1488
|
});
|
|
1489
1489
|
});
|
|
1490
1490
|
});
|
|
@@ -1520,7 +1520,7 @@ function Ga() {
|
|
|
1520
1520
|
function Wt(e, n, r, a) {
|
|
1521
1521
|
var i = e.replayFilter ? Xe(e.filter, e.replayFilter()) : e.filter;
|
|
1522
1522
|
if (e.or) {
|
|
1523
|
-
var o = {},
|
|
1523
|
+
var o = {}, l = function(f, p, m) {
|
|
1524
1524
|
var E, h;
|
|
1525
1525
|
i && !i(p, m, function(O) {
|
|
1526
1526
|
return p.stop(O);
|
|
@@ -1528,28 +1528,28 @@ function Ga() {
|
|
|
1528
1528
|
return p.fail(O);
|
|
1529
1529
|
}) || ((h = "" + (E = p.primaryKey)) == "[object ArrayBuffer]" && (h = "" + new Uint8Array(E)), Q(o, h) || (o[h] = !0, n(f, p, m)));
|
|
1530
1530
|
};
|
|
1531
|
-
return Promise.all([e.or._iterate(
|
|
1531
|
+
return Promise.all([e.or._iterate(l, r), gr(pr(e, a, r), e.algorithm, l, !e.keysOnly && e.valueMapper)]);
|
|
1532
1532
|
}
|
|
1533
1533
|
return gr(pr(e, a, r), Xe(e.algorithm, i), n, !e.keysOnly && e.valueMapper);
|
|
1534
1534
|
}
|
|
1535
1535
|
function gr(e, n, r, a) {
|
|
1536
|
-
var i = te(a ? function(o,
|
|
1537
|
-
return r(a(o),
|
|
1536
|
+
var i = te(a ? function(o, l, f) {
|
|
1537
|
+
return r(a(o), l, f);
|
|
1538
1538
|
} : r);
|
|
1539
1539
|
return e.then(function(o) {
|
|
1540
1540
|
if (o) return o.start(function() {
|
|
1541
|
-
var
|
|
1541
|
+
var l = function() {
|
|
1542
1542
|
return o.continue();
|
|
1543
1543
|
};
|
|
1544
1544
|
n && !n(o, function(f) {
|
|
1545
|
-
return
|
|
1545
|
+
return l = f;
|
|
1546
1546
|
}, function(f) {
|
|
1547
|
-
o.stop(f),
|
|
1547
|
+
o.stop(f), l = V;
|
|
1548
1548
|
}, function(f) {
|
|
1549
|
-
o.fail(f),
|
|
1549
|
+
o.fail(f), l = V;
|
|
1550
1550
|
}) || i(o.value, o, function(f) {
|
|
1551
|
-
return
|
|
1552
|
-
}),
|
|
1551
|
+
return l = f;
|
|
1552
|
+
}), l();
|
|
1553
1553
|
});
|
|
1554
1554
|
});
|
|
1555
1555
|
}
|
|
@@ -1557,7 +1557,7 @@ function Ga() {
|
|
|
1557
1557
|
var n = this["@@propmod"];
|
|
1558
1558
|
if (n.add !== void 0) {
|
|
1559
1559
|
var r = n.add;
|
|
1560
|
-
if (Y(r)) return
|
|
1560
|
+
if (Y(r)) return y(y([], Y(e) ? e : [], !0), r).sort();
|
|
1561
1561
|
if (typeof r == "number") return (Number(e) || 0) + r;
|
|
1562
1562
|
if (typeof r == "bigint") try {
|
|
1563
1563
|
return BigInt(e) + r;
|
|
@@ -1609,8 +1609,8 @@ function Ga() {
|
|
|
1609
1609
|
var n = this;
|
|
1610
1610
|
return this._read(function(r) {
|
|
1611
1611
|
var a = n._ctx, i = a.table.core;
|
|
1612
|
-
if (it(a, !0)) return i.count({ trans: r, query: { index: Ft(a, i.schema), range: a.range } }).then(function(
|
|
1613
|
-
return Math.min(
|
|
1612
|
+
if (it(a, !0)) return i.count({ trans: r, query: { index: Ft(a, i.schema), range: a.range } }).then(function(l) {
|
|
1613
|
+
return Math.min(l, a.limit);
|
|
1614
1614
|
});
|
|
1615
1615
|
var o = 0;
|
|
1616
1616
|
return Wt(a, function() {
|
|
@@ -1624,9 +1624,9 @@ function Ga() {
|
|
|
1624
1624
|
function o(p, m) {
|
|
1625
1625
|
return m ? o(p[r[m]], m - 1) : p[a];
|
|
1626
1626
|
}
|
|
1627
|
-
var
|
|
1627
|
+
var l = this._ctx.dir === "next" ? 1 : -1;
|
|
1628
1628
|
function f(p, m) {
|
|
1629
|
-
return X(o(p, i), o(m, i)) *
|
|
1629
|
+
return X(o(p, i), o(m, i)) * l;
|
|
1630
1630
|
}
|
|
1631
1631
|
return this.toArray(function(p) {
|
|
1632
1632
|
return p.sort(f);
|
|
@@ -1641,11 +1641,11 @@ function Ga() {
|
|
|
1641
1641
|
return f = f.result, i ? f.map(i) : f;
|
|
1642
1642
|
});
|
|
1643
1643
|
}
|
|
1644
|
-
var
|
|
1644
|
+
var l = [];
|
|
1645
1645
|
return Wt(a, function(f) {
|
|
1646
|
-
return
|
|
1646
|
+
return l.push(f);
|
|
1647
1647
|
}, r, a.table.core).then(function() {
|
|
1648
|
-
return
|
|
1648
|
+
return l;
|
|
1649
1649
|
});
|
|
1650
1650
|
}, e);
|
|
1651
1651
|
}, J.prototype.offset = function(e) {
|
|
@@ -1748,32 +1748,32 @@ function Ga() {
|
|
|
1748
1748
|
}, J.prototype.modify = function(e) {
|
|
1749
1749
|
var n = this, r = this._ctx;
|
|
1750
1750
|
return this._write(function(a) {
|
|
1751
|
-
var i, o,
|
|
1752
|
-
|
|
1751
|
+
var i, o, l;
|
|
1752
|
+
l = typeof e == "function" ? e : (i = I(e), o = i.length, function(v) {
|
|
1753
1753
|
for (var P = !1, D = 0; D < o; ++D) {
|
|
1754
|
-
var R = i[D], x = e[R], k = ve(
|
|
1755
|
-
x instanceof yt ? (he(
|
|
1754
|
+
var R = i[D], x = e[R], k = ve(v, R);
|
|
1755
|
+
x instanceof yt ? (he(v, R, x.execute(k)), P = !0) : k !== x && (he(v, R, x), P = !0);
|
|
1756
1756
|
}
|
|
1757
1757
|
return P;
|
|
1758
1758
|
});
|
|
1759
1759
|
var f = r.table.core, h = f.schema.primaryKey, p = h.outbound, m = h.extractKey, E = 200, h = n.db._options.modifyChunkSize;
|
|
1760
1760
|
h && (E = typeof h == "object" ? h[f.name] || h["*"] || 200 : h);
|
|
1761
|
-
function O(
|
|
1761
|
+
function O(v, R) {
|
|
1762
1762
|
var D = R.failures, R = R.numFailures;
|
|
1763
|
-
w +=
|
|
1763
|
+
w += v - R;
|
|
1764
1764
|
for (var x = 0, k = I(D); x < k.length; x++) {
|
|
1765
1765
|
var $ = k[x];
|
|
1766
1766
|
g.push(D[$]);
|
|
1767
1767
|
}
|
|
1768
1768
|
}
|
|
1769
1769
|
var g = [], w = 0, S = [];
|
|
1770
|
-
return n.clone().primaryKeys().then(function(
|
|
1770
|
+
return n.clone().primaryKeys().then(function(v) {
|
|
1771
1771
|
function P(R) {
|
|
1772
|
-
var x = Math.min(E,
|
|
1773
|
-
return f.getMany({ trans: a, keys:
|
|
1772
|
+
var x = Math.min(E, v.length - R);
|
|
1773
|
+
return f.getMany({ trans: a, keys: v.slice(R, R + x), cache: "immutable" }).then(function(k) {
|
|
1774
1774
|
for (var $ = [], T = [], N = p ? [] : null, j = [], C = 0; C < x; ++C) {
|
|
1775
|
-
var B = k[C], W = { value: Ke(B), primKey:
|
|
1776
|
-
|
|
1775
|
+
var B = k[C], W = { value: Ke(B), primKey: v[R + C] };
|
|
1776
|
+
l.call(W, W.value, W) !== !1 && (W.value == null ? j.push(v[R + C]) : p || X(m(B), m(W.value)) === 0 ? (T.push(W.value), p && N.push(v[R + C])) : (j.push(v[R + C]), $.push(W.value)));
|
|
1777
1777
|
}
|
|
1778
1778
|
return Promise.resolve(0 < $.length && f.mutate({ trans: a, type: "add", values: $ }).then(function(z) {
|
|
1779
1779
|
for (var H in z.failures) j.splice(parseInt(H), 1);
|
|
@@ -1787,14 +1787,14 @@ function Ga() {
|
|
|
1787
1787
|
return O(j.length, z);
|
|
1788
1788
|
});
|
|
1789
1789
|
}).then(function() {
|
|
1790
|
-
return
|
|
1790
|
+
return v.length > R + x && P(R + E);
|
|
1791
1791
|
});
|
|
1792
1792
|
});
|
|
1793
1793
|
}
|
|
1794
1794
|
var D = it(r) && r.limit === 1 / 0 && (typeof e != "function" || e === An) && { index: r.index, range: r.range };
|
|
1795
1795
|
return P(0).then(function() {
|
|
1796
1796
|
if (0 < g.length) throw new It("Error modifying one or more objects", g, w, S);
|
|
1797
|
-
return
|
|
1797
|
+
return v.length;
|
|
1798
1798
|
});
|
|
1799
1799
|
});
|
|
1800
1800
|
});
|
|
@@ -1803,12 +1803,12 @@ function Ga() {
|
|
|
1803
1803
|
return it(e) && (e.isPrimKey || n.type === 3) ? this._write(function(r) {
|
|
1804
1804
|
var a = e.table.core.schema.primaryKey, i = n;
|
|
1805
1805
|
return e.table.core.count({ trans: r, query: { index: a, range: i } }).then(function(o) {
|
|
1806
|
-
return e.table.core.mutate({ trans: r, type: "deleteRange", range: i }).then(function(
|
|
1807
|
-
var f =
|
|
1808
|
-
if (
|
|
1806
|
+
return e.table.core.mutate({ trans: r, type: "deleteRange", range: i }).then(function(l) {
|
|
1807
|
+
var f = l.failures;
|
|
1808
|
+
if (l.lastResult, l.results, l = l.numFailures, l) throw new It("Could not delete some values", Object.keys(f).map(function(p) {
|
|
1809
1809
|
return f[p];
|
|
1810
|
-
}), o -
|
|
1811
|
-
return o -
|
|
1810
|
+
}), o - l);
|
|
1811
|
+
return o - l;
|
|
1812
1812
|
});
|
|
1813
1813
|
});
|
|
1814
1814
|
}) : this.modify(An);
|
|
@@ -1833,29 +1833,29 @@ function Ga() {
|
|
|
1833
1833
|
}).limit(0);
|
|
1834
1834
|
}
|
|
1835
1835
|
function Ut(e, n, r, a) {
|
|
1836
|
-
var i, o,
|
|
1836
|
+
var i, o, l, f, p, m, E, h = r.length;
|
|
1837
1837
|
if (!r.every(function(w) {
|
|
1838
1838
|
return typeof w == "string";
|
|
1839
1839
|
})) return me(e, cr);
|
|
1840
1840
|
function O(w) {
|
|
1841
|
-
i = w === "next" ? function(
|
|
1842
|
-
return
|
|
1843
|
-
} : function(
|
|
1844
|
-
return
|
|
1845
|
-
}, o = w === "next" ? function(
|
|
1846
|
-
return
|
|
1847
|
-
} : function(
|
|
1848
|
-
return
|
|
1849
|
-
},
|
|
1850
|
-
var S = r.map(function(
|
|
1851
|
-
return { lower: o(
|
|
1852
|
-
}).sort(function(
|
|
1853
|
-
return
|
|
1841
|
+
i = w === "next" ? function(v) {
|
|
1842
|
+
return v.toUpperCase();
|
|
1843
|
+
} : function(v) {
|
|
1844
|
+
return v.toLowerCase();
|
|
1845
|
+
}, o = w === "next" ? function(v) {
|
|
1846
|
+
return v.toLowerCase();
|
|
1847
|
+
} : function(v) {
|
|
1848
|
+
return v.toUpperCase();
|
|
1849
|
+
}, l = w === "next" ? ia : oa;
|
|
1850
|
+
var S = r.map(function(v) {
|
|
1851
|
+
return { lower: o(v), upper: i(v) };
|
|
1852
|
+
}).sort(function(v, P) {
|
|
1853
|
+
return l(v.lower, P.lower);
|
|
1854
1854
|
});
|
|
1855
|
-
f = S.map(function(
|
|
1856
|
-
return
|
|
1857
|
-
}), p = S.map(function(
|
|
1858
|
-
return
|
|
1855
|
+
f = S.map(function(v) {
|
|
1856
|
+
return v.upper;
|
|
1857
|
+
}), p = S.map(function(v) {
|
|
1858
|
+
return v.lower;
|
|
1859
1859
|
}), E = (m = w) === "next" ? "" : a;
|
|
1860
1860
|
}
|
|
1861
1861
|
O("next"), e = new e.Collection(e, function() {
|
|
@@ -1864,7 +1864,7 @@ function Ga() {
|
|
|
1864
1864
|
O(w);
|
|
1865
1865
|
};
|
|
1866
1866
|
var g = 0;
|
|
1867
|
-
return e._addAlgorithm(function(w, S,
|
|
1867
|
+
return e._addAlgorithm(function(w, S, v) {
|
|
1868
1868
|
var P = w.key;
|
|
1869
1869
|
if (typeof P != "string") return !1;
|
|
1870
1870
|
var D = o(P);
|
|
@@ -1877,12 +1877,12 @@ function Ga() {
|
|
|
1877
1877
|
C($[H], be) < 0 && (z = H);
|
|
1878
1878
|
}
|
|
1879
1879
|
return W < j.length && B === "next" ? $ + N.substr($.length) : W < $.length && B === "prev" ? $.substr(0, N.length) : z < 0 ? null : $.substr(0, z) + j[z] + N.substr(z + 1);
|
|
1880
|
-
}(P, D, f[x], p[x],
|
|
1881
|
-
k === null && R === null ? g = x + 1 : (R === null || 0 <
|
|
1880
|
+
}(P, D, f[x], p[x], l, m);
|
|
1881
|
+
k === null && R === null ? g = x + 1 : (R === null || 0 < l(R, k)) && (R = k);
|
|
1882
1882
|
}
|
|
1883
1883
|
return S(R !== null ? function() {
|
|
1884
1884
|
w.continue(R + E);
|
|
1885
|
-
} :
|
|
1885
|
+
} : v), !1;
|
|
1886
1886
|
}), e;
|
|
1887
1887
|
}
|
|
1888
1888
|
function $e(e, n, r, a) {
|
|
@@ -1959,9 +1959,9 @@ function Ga() {
|
|
|
1959
1959
|
r = o === "next" ? e._ascending : e._descending, n.sort(r);
|
|
1960
1960
|
};
|
|
1961
1961
|
var i = 0;
|
|
1962
|
-
return a._addAlgorithm(function(o,
|
|
1963
|
-
for (var p = o.key; 0 < r(p, n[i]); ) if (++i === n.length) return
|
|
1964
|
-
return r(p, n[i]) === 0 || (
|
|
1962
|
+
return a._addAlgorithm(function(o, l, f) {
|
|
1963
|
+
for (var p = o.key; 0 < r(p, n[i]); ) if (++i === n.length) return l(f), !1;
|
|
1964
|
+
return r(p, n[i]) === 0 || (l(function() {
|
|
1965
1965
|
o.continue(n[i]);
|
|
1966
1966
|
}), !1);
|
|
1967
1967
|
}), a;
|
|
@@ -1980,7 +1980,7 @@ function Ga() {
|
|
|
1980
1980
|
}, null);
|
|
1981
1981
|
return n.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(n, { includeLowers: !1, includeUppers: !1 });
|
|
1982
1982
|
}, ce.prototype.inAnyRange = function(P, n) {
|
|
1983
|
-
var r = this, a = this._cmp, i = this._ascending, o = this._descending,
|
|
1983
|
+
var r = this, a = this._cmp, i = this._ascending, o = this._descending, l = this._min, f = this._max;
|
|
1984
1984
|
if (P.length === 0) return ot(this);
|
|
1985
1985
|
if (!P.every(function(D) {
|
|
1986
1986
|
return D[0] !== void 0 && D[1] !== void 0 && i(D[0], D[1]) <= 0;
|
|
@@ -1994,7 +1994,7 @@ function Ga() {
|
|
|
1994
1994
|
for (var x = 0, k = D.length; x < k; ++x) {
|
|
1995
1995
|
var $ = D[x];
|
|
1996
1996
|
if (a(R[0], $[1]) < 0 && 0 < a(R[1], $[0])) {
|
|
1997
|
-
$[0] =
|
|
1997
|
+
$[0] = l($[0], R[0]), $[1] = f($[1], R[1]);
|
|
1998
1998
|
break;
|
|
1999
1999
|
}
|
|
2000
2000
|
}
|
|
@@ -2011,13 +2011,13 @@ function Ga() {
|
|
|
2011
2011
|
return 0 < o(D, E[g][0]);
|
|
2012
2012
|
} : function(D) {
|
|
2013
2013
|
return 0 <= o(D, E[g][0]);
|
|
2014
|
-
},
|
|
2014
|
+
}, v = w, P = new this.Collection(this, function() {
|
|
2015
2015
|
return $e(E[0][0], E[E.length - 1][1], !p, !m);
|
|
2016
2016
|
});
|
|
2017
2017
|
return P._ondirectionchange = function(D) {
|
|
2018
|
-
h = D === "next" ? (
|
|
2018
|
+
h = D === "next" ? (v = w, i) : (v = S, o), E.sort(O);
|
|
2019
2019
|
}, P._addAlgorithm(function(D, R, x) {
|
|
2020
|
-
for (var k, $ = D.key;
|
|
2020
|
+
for (var k, $ = D.key; v($); ) if (++g === E.length) return R(x), !1;
|
|
2021
2021
|
return !w(k = $) && !S(k) || (r._cmp($, E[g][1]) === 0 || r._cmp($, E[g][0]) === 0 || R(function() {
|
|
2022
2022
|
h === i ? D.continue(E[g][0]) : D.continue(E[g][1]);
|
|
2023
2023
|
}), !1);
|
|
@@ -2077,24 +2077,24 @@ function Ga() {
|
|
|
2077
2077
|
var a = this;
|
|
2078
2078
|
if (e === "readwrite" && this.mode !== "readwrite") return se(new K.ReadOnly("Transaction is readonly"));
|
|
2079
2079
|
if (!this.active) return se(new K.TransactionInactive());
|
|
2080
|
-
if (this._locked()) return new M(function(o,
|
|
2080
|
+
if (this._locked()) return new M(function(o, l) {
|
|
2081
2081
|
a._blockedFuncs.push([function() {
|
|
2082
|
-
a._promise(e, n, r).then(o,
|
|
2082
|
+
a._promise(e, n, r).then(o, l);
|
|
2083
2083
|
}, G]);
|
|
2084
2084
|
});
|
|
2085
2085
|
if (r) return Te(function() {
|
|
2086
|
-
var o = new M(function(
|
|
2086
|
+
var o = new M(function(l, f) {
|
|
2087
2087
|
a._lock();
|
|
2088
|
-
var p = n(
|
|
2089
|
-
p && p.then && p.then(
|
|
2088
|
+
var p = n(l, f, a);
|
|
2089
|
+
p && p.then && p.then(l, f);
|
|
2090
2090
|
});
|
|
2091
2091
|
return o.finally(function() {
|
|
2092
2092
|
return a._unlock();
|
|
2093
2093
|
}), o._lib = !0, o;
|
|
2094
2094
|
});
|
|
2095
|
-
var i = new M(function(o,
|
|
2096
|
-
var f = n(o,
|
|
2097
|
-
f && f.then && f.then(o,
|
|
2095
|
+
var i = new M(function(o, l) {
|
|
2096
|
+
var f = n(o, l, a);
|
|
2097
|
+
f && f.then && f.then(o, l);
|
|
2098
2098
|
});
|
|
2099
2099
|
return i._lib = !0, i;
|
|
2100
2100
|
}, Oe.prototype._root = function() {
|
|
@@ -2108,11 +2108,11 @@ function Ga() {
|
|
|
2108
2108
|
r._waitingFor && (n.get(-1 / 0).onsuccess = o);
|
|
2109
2109
|
}());
|
|
2110
2110
|
var i = r._waitingFor;
|
|
2111
|
-
return new M(function(o,
|
|
2111
|
+
return new M(function(o, l) {
|
|
2112
2112
|
a.then(function(f) {
|
|
2113
2113
|
return r._waitingQueue.push(te(o.bind(null, f)));
|
|
2114
2114
|
}, function(f) {
|
|
2115
|
-
return r._waitingQueue.push(te(
|
|
2115
|
+
return r._waitingQueue.push(te(l.bind(null, f)));
|
|
2116
2116
|
}).finally(function() {
|
|
2117
2117
|
r._waitingFor === i && (r._waitingFor = null);
|
|
2118
2118
|
});
|
|
@@ -2128,8 +2128,8 @@ function Ga() {
|
|
|
2128
2128
|
}, Oe);
|
|
2129
2129
|
function Oe() {
|
|
2130
2130
|
}
|
|
2131
|
-
function Dn(e, n, r, a, i, o,
|
|
2132
|
-
return { name: e, keyPath: n, unique: r, multi: a, auto: i, compound: o, src: (r && !
|
|
2131
|
+
function Dn(e, n, r, a, i, o, l) {
|
|
2132
|
+
return { name: e, keyPath: n, unique: r, multi: a, auto: i, compound: o, src: (r && !l ? "&" : "") + (a ? "*" : "") + (i ? "++" : "") + vr(n) };
|
|
2133
2133
|
}
|
|
2134
2134
|
function vr(e) {
|
|
2135
2135
|
return typeof e == "string" ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
|
|
@@ -2137,8 +2137,8 @@ function Ga() {
|
|
|
2137
2137
|
function Rn(e, n, r) {
|
|
2138
2138
|
return { name: e, primKey: n, indexes: r, mappedClass: null, idxByName: (a = function(i) {
|
|
2139
2139
|
return [i.name, i];
|
|
2140
|
-
}, r.reduce(function(i, o,
|
|
2141
|
-
return
|
|
2140
|
+
}, r.reduce(function(i, o, l) {
|
|
2141
|
+
return l = a(o, l), l && (i[l[0]] = l[1]), i;
|
|
2142
2142
|
}, {})) };
|
|
2143
2143
|
var a;
|
|
2144
2144
|
}
|
|
@@ -2172,19 +2172,19 @@ function Ga() {
|
|
|
2172
2172
|
return e == null ? ":id" : typeof e == "string" ? e : "[".concat(e.join("+"), "]");
|
|
2173
2173
|
}
|
|
2174
2174
|
function la(e, n, p) {
|
|
2175
|
-
function a(
|
|
2176
|
-
if (
|
|
2177
|
-
if (
|
|
2178
|
-
var g =
|
|
2179
|
-
return g === void 0 ? w === void 0 ? null : n.upperBound(w, !!
|
|
2175
|
+
function a(v) {
|
|
2176
|
+
if (v.type === 3) return null;
|
|
2177
|
+
if (v.type === 4) throw new Error("Cannot convert never type to IDBKeyRange");
|
|
2178
|
+
var g = v.lower, w = v.upper, S = v.lowerOpen, v = v.upperOpen;
|
|
2179
|
+
return g === void 0 ? w === void 0 ? null : n.upperBound(w, !!v) : w === void 0 ? n.lowerBound(g, !!S) : n.bound(g, w, !!S, !!v);
|
|
2180
2180
|
}
|
|
2181
2181
|
function i(O) {
|
|
2182
2182
|
var g, w = O.name;
|
|
2183
2183
|
return { name: w, schema: O, mutate: function(S) {
|
|
2184
|
-
var
|
|
2184
|
+
var v = S.trans, P = S.type, D = S.keys, R = S.values, x = S.range;
|
|
2185
2185
|
return new Promise(function(k, $) {
|
|
2186
2186
|
k = te(k);
|
|
2187
|
-
var T =
|
|
2187
|
+
var T = v.objectStore(w), N = T.keyPath == null, j = P === "put" || P === "add";
|
|
2188
2188
|
if (!j && P !== "delete" && P !== "deleteRange") throw new Error("Invalid operation type: " + P);
|
|
2189
2189
|
var C, B = (D || R || { length: 1 }).length;
|
|
2190
2190
|
if (D && R && D.length !== R.length) throw new Error("Given keys array must have same length as given values array.");
|
|
@@ -2213,45 +2213,45 @@ function Ga() {
|
|
|
2213
2213
|
}, C.onsuccess = rn;
|
|
2214
2214
|
});
|
|
2215
2215
|
}, getMany: function(S) {
|
|
2216
|
-
var
|
|
2216
|
+
var v = S.trans, P = S.keys;
|
|
2217
2217
|
return new Promise(function(D, R) {
|
|
2218
2218
|
D = te(D);
|
|
2219
|
-
for (var x, k =
|
|
2219
|
+
for (var x, k = v.objectStore(w), $ = P.length, T = new Array($), N = 0, j = 0, C = function(z) {
|
|
2220
2220
|
z = z.target, T[z._pos] = z.result, ++j === N && D(T);
|
|
2221
2221
|
}, B = Se(R), W = 0; W < $; ++W) P[W] != null && ((x = k.get(P[W]))._pos = W, x.onsuccess = C, x.onerror = B, ++N);
|
|
2222
2222
|
N === 0 && D(T);
|
|
2223
2223
|
});
|
|
2224
2224
|
}, get: function(S) {
|
|
2225
|
-
var
|
|
2225
|
+
var v = S.trans, P = S.key;
|
|
2226
2226
|
return new Promise(function(D, R) {
|
|
2227
2227
|
D = te(D);
|
|
2228
|
-
var x =
|
|
2228
|
+
var x = v.objectStore(w).get(P);
|
|
2229
2229
|
x.onsuccess = function(k) {
|
|
2230
2230
|
return D(k.target.result);
|
|
2231
2231
|
}, x.onerror = Se(R);
|
|
2232
2232
|
});
|
|
2233
2233
|
}, query: (g = m, function(S) {
|
|
2234
|
-
return new Promise(function(
|
|
2235
|
-
|
|
2234
|
+
return new Promise(function(v, P) {
|
|
2235
|
+
v = te(v);
|
|
2236
2236
|
var D, R, x, N = S.trans, k = S.values, $ = S.limit, C = S.query, T = $ === 1 / 0 ? void 0 : $, j = C.index, C = C.range, N = N.objectStore(w), j = j.isPrimaryKey ? N : N.index(j.name), C = a(C);
|
|
2237
|
-
if ($ === 0) return
|
|
2237
|
+
if ($ === 0) return v({ result: [] });
|
|
2238
2238
|
g ? ((T = k ? j.getAll(C, T) : j.getAllKeys(C, T)).onsuccess = function(B) {
|
|
2239
|
-
return
|
|
2239
|
+
return v({ result: B.target.result });
|
|
2240
2240
|
}, T.onerror = Se(P)) : (D = 0, R = !k && "openKeyCursor" in j ? j.openKeyCursor(C) : j.openCursor(C), x = [], R.onsuccess = function(B) {
|
|
2241
2241
|
var W = R.result;
|
|
2242
|
-
return W ? (x.push(k ? W.value : W.primaryKey), ++D === $ ?
|
|
2242
|
+
return W ? (x.push(k ? W.value : W.primaryKey), ++D === $ ? v({ result: x }) : void W.continue()) : v({ result: x });
|
|
2243
2243
|
}, R.onerror = Se(P));
|
|
2244
2244
|
});
|
|
2245
2245
|
}), openCursor: function(S) {
|
|
2246
|
-
var
|
|
2246
|
+
var v = S.trans, P = S.values, D = S.query, R = S.reverse, x = S.unique;
|
|
2247
2247
|
return new Promise(function(k, $) {
|
|
2248
2248
|
k = te(k);
|
|
2249
|
-
var j = D.index, T = D.range, N =
|
|
2249
|
+
var j = D.index, T = D.range, N = v.objectStore(w), N = j.isPrimaryKey ? N : N.index(j.name), j = R ? x ? "prevunique" : "prev" : x ? "nextunique" : "next", C = !P && "openKeyCursor" in N ? N.openKeyCursor(a(T), j) : N.openCursor(a(T), j);
|
|
2250
2250
|
C.onerror = Se($), C.onsuccess = te(function(B) {
|
|
2251
2251
|
var W, z, H, be, F = C.result;
|
|
2252
2252
|
F ? (F.___id = ++ua, F.done = !1, W = F.continue.bind(F), z = (z = F.continuePrimaryKey) && z.bind(F), H = F.advance.bind(F), be = function() {
|
|
2253
2253
|
throw new Error("Cursor not stopped");
|
|
2254
|
-
}, F.trans =
|
|
2254
|
+
}, F.trans = v, F.stop = F.continue = F.continuePrimaryKey = F.advance = function() {
|
|
2255
2255
|
throw new Error("Cursor not started");
|
|
2256
2256
|
}, F.fail = te($), F.next = function() {
|
|
2257
2257
|
var de = this, fe = 1;
|
|
@@ -2283,7 +2283,7 @@ function Ga() {
|
|
|
2283
2283
|
}, $);
|
|
2284
2284
|
});
|
|
2285
2285
|
}, count: function(S) {
|
|
2286
|
-
var
|
|
2286
|
+
var v = S.query, P = S.trans, D = v.index, R = v.range;
|
|
2287
2287
|
return new Promise(function(x, k) {
|
|
2288
2288
|
var $ = P.objectStore(w), T = D.isPrimaryKey ? $ : $.index(D.name), $ = a(R), T = $ ? T.count($) : T.count();
|
|
2289
2289
|
T.onsuccess = te(function(N) {
|
|
@@ -2292,10 +2292,10 @@ function Ga() {
|
|
|
2292
2292
|
});
|
|
2293
2293
|
} };
|
|
2294
2294
|
}
|
|
2295
|
-
var o,
|
|
2296
|
-
return
|
|
2295
|
+
var o, l, f, E = (l = p, f = wr((o = e).objectStoreNames), { schema: { name: o.name, tables: f.map(function(O) {
|
|
2296
|
+
return l.objectStore(O);
|
|
2297
2297
|
}).map(function(O) {
|
|
2298
|
-
var g = O.keyPath,
|
|
2298
|
+
var g = O.keyPath, v = O.autoIncrement, w = Y(g), S = {}, v = { name: O.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: g == null, compound: w, keyPath: g, autoIncrement: v, unique: !0, extractKey: xn(g) }, indexes: wr(O.indexNames).map(function(P) {
|
|
2299
2299
|
return O.index(P);
|
|
2300
2300
|
}).map(function(x) {
|
|
2301
2301
|
var D = x.name, R = x.unique, k = x.multiEntry, x = x.keyPath, k = { name: D, compound: Y(x), keyPath: x, unique: R, multiEntry: k, extractKey: xn(x) };
|
|
@@ -2303,8 +2303,8 @@ function Ga() {
|
|
|
2303
2303
|
}), getIndexByKeyPath: function(P) {
|
|
2304
2304
|
return S[St(P)];
|
|
2305
2305
|
} };
|
|
2306
|
-
return S[":id"] =
|
|
2307
|
-
}) }, hasGetAll: 0 < f.length && "getAll" in
|
|
2306
|
+
return S[":id"] = v.primaryKey, g != null && (S[St(g)] = v.primaryKey), v;
|
|
2307
|
+
}) }, hasGetAll: 0 < f.length && "getAll" in l.objectStore(f[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), p = E.schema, m = E.hasGetAll, E = p.tables.map(i), h = {};
|
|
2308
2308
|
return E.forEach(function(O) {
|
|
2309
2309
|
return h[O.name] = O;
|
|
2310
2310
|
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(O) {
|
|
@@ -2314,31 +2314,31 @@ function Ga() {
|
|
|
2314
2314
|
}
|
|
2315
2315
|
function da(e, n, r, a) {
|
|
2316
2316
|
var i = r.IDBKeyRange;
|
|
2317
|
-
return r.indexedDB, { dbcore: (a = la(n, i, a), e.dbcore.reduce(function(o,
|
|
2318
|
-
return
|
|
2317
|
+
return r.indexedDB, { dbcore: (a = la(n, i, a), e.dbcore.reduce(function(o, l) {
|
|
2318
|
+
return l = l.create, u(u({}, o), l(o));
|
|
2319
2319
|
}, a)) };
|
|
2320
2320
|
}
|
|
2321
2321
|
function zt(e, a) {
|
|
2322
2322
|
var r = a.db, a = da(e._middlewares, r, e._deps, a);
|
|
2323
2323
|
e.core = a.dbcore, e.tables.forEach(function(i) {
|
|
2324
2324
|
var o = i.name;
|
|
2325
|
-
e.core.schema.tables.some(function(
|
|
2326
|
-
return
|
|
2325
|
+
e.core.schema.tables.some(function(l) {
|
|
2326
|
+
return l.name === o;
|
|
2327
2327
|
}) && (i.core = e.core.table(o), e[o] instanceof e.Table && (e[o].core = i.core));
|
|
2328
2328
|
});
|
|
2329
2329
|
}
|
|
2330
2330
|
function Ht(e, n, r, a) {
|
|
2331
2331
|
r.forEach(function(i) {
|
|
2332
2332
|
var o = a[i];
|
|
2333
|
-
n.forEach(function(
|
|
2333
|
+
n.forEach(function(l) {
|
|
2334
2334
|
var f = function p(m, E) {
|
|
2335
2335
|
return Pt(m, E) || (m = ue(m)) && p(m, E);
|
|
2336
|
-
}(
|
|
2337
|
-
(!f || "value" in f && f.value === void 0) && (
|
|
2336
|
+
}(l, i);
|
|
2337
|
+
(!f || "value" in f && f.value === void 0) && (l === e.Transaction.prototype || l instanceof e.Transaction ? ae(l, i, { get: function() {
|
|
2338
2338
|
return this.table(i);
|
|
2339
2339
|
}, set: function(p) {
|
|
2340
2340
|
Ie(this, i, { value: p, writable: !0, configurable: !0, enumerable: !0 });
|
|
2341
|
-
} }) :
|
|
2341
|
+
} }) : l[i] = new e.Table(i, o));
|
|
2342
2342
|
});
|
|
2343
2343
|
});
|
|
2344
2344
|
}
|
|
@@ -2355,17 +2355,17 @@ function Ga() {
|
|
|
2355
2355
|
r.objectStoreNames.contains("$meta") && !i.$meta && (i.$meta = Rn("$meta", Sr("")[0], []), e._storeNames.push("$meta"));
|
|
2356
2356
|
var o = e._createTransaction("readwrite", e._storeNames, i);
|
|
2357
2357
|
o.create(r), o._completion.catch(a);
|
|
2358
|
-
var
|
|
2358
|
+
var l = o._reject.bind(o), f = G.transless || G;
|
|
2359
2359
|
Te(function() {
|
|
2360
2360
|
return G.trans = o, G.transless = f, n !== 0 ? (zt(e, r), m = n, ((p = o).storeNames.includes("$meta") ? p.table("$meta").get("version").then(function(E) {
|
|
2361
2361
|
return E ?? m;
|
|
2362
2362
|
}) : M.resolve(m)).then(function(E) {
|
|
2363
|
-
return O = E, g = o, w = r, S = [], E = (h = e)._versions,
|
|
2363
|
+
return O = E, g = o, w = r, S = [], E = (h = e)._versions, v = h._dbSchema = Qt(0, h.idbdb, w), (E = E.filter(function(P) {
|
|
2364
2364
|
return P._cfg.version >= O;
|
|
2365
2365
|
})).length !== 0 ? (E.forEach(function(P) {
|
|
2366
2366
|
S.push(function() {
|
|
2367
|
-
var D =
|
|
2368
|
-
Xt(h, D, w), Xt(h, R, w),
|
|
2367
|
+
var D = v, R = P._cfg.dbschema;
|
|
2368
|
+
Xt(h, D, w), Xt(h, R, w), v = h._dbSchema = R;
|
|
2369
2369
|
var x = kn(D, R);
|
|
2370
2370
|
x.add.forEach(function(j) {
|
|
2371
2371
|
Tn(w, j[0], j[1].primKey, j[1].indexes);
|
|
@@ -2408,14 +2408,14 @@ function Ga() {
|
|
|
2408
2408
|
}), function P() {
|
|
2409
2409
|
return S.length ? M.resolve(S.shift()(g.idbtrans)).then(P) : M.resolve();
|
|
2410
2410
|
}().then(function() {
|
|
2411
|
-
Er(
|
|
2411
|
+
Er(v, w);
|
|
2412
2412
|
})) : M.resolve();
|
|
2413
|
-
var h, O, g, w, S,
|
|
2414
|
-
}).catch(
|
|
2413
|
+
var h, O, g, w, S, v;
|
|
2414
|
+
}).catch(l)) : (I(i).forEach(function(E) {
|
|
2415
2415
|
Tn(r, E, i[E].primKey, i[E].indexes);
|
|
2416
2416
|
}), zt(e, r), void M.follow(function() {
|
|
2417
2417
|
return e.on.populate.fire(o);
|
|
2418
|
-
}).catch(
|
|
2418
|
+
}).catch(l));
|
|
2419
2419
|
var p, m;
|
|
2420
2420
|
});
|
|
2421
2421
|
}
|
|
@@ -2424,11 +2424,11 @@ function Ga() {
|
|
|
2424
2424
|
var r = Qt(0, e.idbdb, n);
|
|
2425
2425
|
Xt(e, e._dbSchema, n);
|
|
2426
2426
|
for (var a = 0, i = kn(r, e._dbSchema).change; a < i.length; a++) {
|
|
2427
|
-
var o = function(
|
|
2428
|
-
if (
|
|
2429
|
-
var f = n.objectStore(
|
|
2430
|
-
|
|
2431
|
-
Ee && console.debug("Dexie upgrade patch: Creating missing index ".concat(
|
|
2427
|
+
var o = function(l) {
|
|
2428
|
+
if (l.change.length || l.recreate) return console.warn("Unable to patch indexes of table ".concat(l.name, " because it has changes on the type of index or primary key.")), { value: void 0 };
|
|
2429
|
+
var f = n.objectStore(l.name);
|
|
2430
|
+
l.add.forEach(function(p) {
|
|
2431
|
+
Ee && console.debug("Dexie upgrade patch: Creating missing index ".concat(l.name, ".").concat(p.src)), Yt(f, p);
|
|
2432
2432
|
});
|
|
2433
2433
|
}(i[a]);
|
|
2434
2434
|
if (typeof o == "object") return o.value;
|
|
@@ -2440,16 +2440,16 @@ function Ga() {
|
|
|
2440
2440
|
for (r in n) {
|
|
2441
2441
|
var i = e[r], o = n[r];
|
|
2442
2442
|
if (i) {
|
|
2443
|
-
var
|
|
2444
|
-
if ("" + (i.primKey.keyPath || "") != "" + (o.primKey.keyPath || "") || i.primKey.auto !== o.primKey.auto)
|
|
2443
|
+
var l = { name: r, def: o, recreate: !1, del: [], add: [], change: [] };
|
|
2444
|
+
if ("" + (i.primKey.keyPath || "") != "" + (o.primKey.keyPath || "") || i.primKey.auto !== o.primKey.auto) l.recreate = !0, a.change.push(l);
|
|
2445
2445
|
else {
|
|
2446
2446
|
var f = i.idxByName, p = o.idxByName, m = void 0;
|
|
2447
|
-
for (m in f) p[m] ||
|
|
2447
|
+
for (m in f) p[m] || l.del.push(m);
|
|
2448
2448
|
for (m in p) {
|
|
2449
2449
|
var E = f[m], h = p[m];
|
|
2450
|
-
E ? E.src !== h.src &&
|
|
2450
|
+
E ? E.src !== h.src && l.change.push(h) : l.add.push(h);
|
|
2451
2451
|
}
|
|
2452
|
-
(0 <
|
|
2452
|
+
(0 < l.del.length || 0 < l.add.length || 0 < l.change.length) && a.change.push(l);
|
|
2453
2453
|
}
|
|
2454
2454
|
} else a.add.push([r, o]);
|
|
2455
2455
|
}
|
|
@@ -2472,19 +2472,19 @@ function Ga() {
|
|
|
2472
2472
|
function Qt(e, n, r) {
|
|
2473
2473
|
var a = {};
|
|
2474
2474
|
return Ge(n.objectStoreNames, 0).forEach(function(i) {
|
|
2475
|
-
for (var o = r.objectStore(i),
|
|
2475
|
+
for (var o = r.objectStore(i), l = Dn(vr(m = o.keyPath), m || "", !0, !1, !!o.autoIncrement, m && typeof m != "string", !0), f = [], p = 0; p < o.indexNames.length; ++p) {
|
|
2476
2476
|
var E = o.index(o.indexNames[p]), m = E.keyPath, E = Dn(E.name, m, !!E.unique, !!E.multiEntry, !1, m && typeof m != "string", !1);
|
|
2477
2477
|
f.push(E);
|
|
2478
2478
|
}
|
|
2479
|
-
a[i] = Rn(i,
|
|
2479
|
+
a[i] = Rn(i, l, f);
|
|
2480
2480
|
}), a;
|
|
2481
2481
|
}
|
|
2482
2482
|
function Xt(e, n, r) {
|
|
2483
2483
|
for (var a = r.db.objectStoreNames, i = 0; i < a.length; ++i) {
|
|
2484
|
-
var o = a[i],
|
|
2485
|
-
e._hasGetAll = "getAll" in
|
|
2486
|
-
for (var f = 0; f <
|
|
2487
|
-
var p =
|
|
2484
|
+
var o = a[i], l = r.objectStore(o);
|
|
2485
|
+
e._hasGetAll = "getAll" in l;
|
|
2486
|
+
for (var f = 0; f < l.indexNames.length; ++f) {
|
|
2487
|
+
var p = l.indexNames[f], m = l.index(p).keyPath, E = typeof m == "string" ? m : "[" + Ge(m).join("+") + "]";
|
|
2488
2488
|
!n[o] || (m = n[o].idxByName[E]) && (m.name = p, delete n[o].idxByName[E], n[o].idxByName[p] = m);
|
|
2489
2489
|
}
|
|
2490
2490
|
}
|
|
@@ -2554,16 +2554,16 @@ function Ga() {
|
|
|
2554
2554
|
}
|
|
2555
2555
|
function _t(e, n) {
|
|
2556
2556
|
jn(n) || function r(a, p) {
|
|
2557
|
-
var o = p.from,
|
|
2558
|
-
Ot(a, o,
|
|
2557
|
+
var o = p.from, l = p.to, f = p.l, p = p.r;
|
|
2558
|
+
Ot(a, o, l), f && r(a, f), p && r(a, p);
|
|
2559
2559
|
}(e, n);
|
|
2560
2560
|
}
|
|
2561
2561
|
function Or(e, n) {
|
|
2562
2562
|
var r = Zt(n), a = r.next();
|
|
2563
2563
|
if (a.done) return !1;
|
|
2564
|
-
for (var i = a.value, o = Zt(e),
|
|
2564
|
+
for (var i = a.value, o = Zt(e), l = o.next(i.from), f = l.value; !a.done && !l.done; ) {
|
|
2565
2565
|
if (X(f.from, i.to) <= 0 && 0 <= X(f.to, i.from)) return !0;
|
|
2566
|
-
X(i.from, f.from) < 0 ? i = (a = r.next(f.from)).value : f = (
|
|
2566
|
+
X(i.from, f.from) < 0 ? i = (a = r.next(f.from)).value : f = (l = o.next(i.from)).value;
|
|
2567
2567
|
}
|
|
2568
2568
|
return !1;
|
|
2569
2569
|
}
|
|
@@ -2589,7 +2589,7 @@ function Ga() {
|
|
|
2589
2589
|
}
|
|
2590
2590
|
function _r(e) {
|
|
2591
2591
|
var n, r, a = (((n = e.r) === null || n === void 0 ? void 0 : n.d) || 0) - (((r = e.l) === null || r === void 0 ? void 0 : r.d) || 0), i = 1 < a ? "r" : a < -1 ? "l" : "";
|
|
2592
|
-
i && (n = i == "r" ? "l" : "r", r =
|
|
2592
|
+
i && (n = i == "r" ? "l" : "r", r = u({}, e), a = e[i], e.from = a.from, e.to = a.to, e[i] = a[i], r[i] = a[n], (e[n] = r).d = Ar(r)), e.d = Ar(e);
|
|
2593
2593
|
}
|
|
2594
2594
|
function Ar(r) {
|
|
2595
2595
|
var n = r.r, r = r.l;
|
|
@@ -2598,8 +2598,8 @@ function Ga() {
|
|
|
2598
2598
|
function Vt(e, n) {
|
|
2599
2599
|
return I(n).forEach(function(r) {
|
|
2600
2600
|
e[r] ? _t(e[r], n[r]) : e[r] = function a(i) {
|
|
2601
|
-
var o,
|
|
2602
|
-
for (o in i) Q(i, o) && (
|
|
2601
|
+
var o, l, f = {};
|
|
2602
|
+
for (o in i) Q(i, o) && (l = i[o], f[o] = !l || typeof l != "object" || qn.has(l.constructor) ? l : a(l));
|
|
2603
2603
|
return f;
|
|
2604
2604
|
}(n[r]);
|
|
2605
2605
|
}), e;
|
|
@@ -2633,21 +2633,21 @@ function Ga() {
|
|
|
2633
2633
|
function Kn(e, n) {
|
|
2634
2634
|
n === void 0 && (n = !1);
|
|
2635
2635
|
var r = /* @__PURE__ */ new Set();
|
|
2636
|
-
if (e.all) for (var a = 0, i = Object.values(Je); a < i.length; a++) Pr(
|
|
2636
|
+
if (e.all) for (var a = 0, i = Object.values(Je); a < i.length; a++) Pr(l = i[a], e, r, n);
|
|
2637
2637
|
else for (var o in e) {
|
|
2638
|
-
var
|
|
2639
|
-
f && (o = f[1], f = f[2], (
|
|
2638
|
+
var l, f = /^idb\:\/\/(.*)\/(.*)\//.exec(o);
|
|
2639
|
+
f && (o = f[1], f = f[2], (l = Je["idb://".concat(o, "/").concat(f)]) && Pr(l, e, r, n));
|
|
2640
2640
|
}
|
|
2641
2641
|
r.forEach(function(p) {
|
|
2642
2642
|
return p();
|
|
2643
2643
|
});
|
|
2644
2644
|
}
|
|
2645
2645
|
function Pr(e, n, r, a) {
|
|
2646
|
-
for (var i = [], o = 0,
|
|
2647
|
-
for (var f =
|
|
2646
|
+
for (var i = [], o = 0, l = Object.entries(e.queries.query); o < l.length; o++) {
|
|
2647
|
+
for (var f = l[o], p = f[0], m = [], E = 0, h = f[1]; E < h.length; E++) {
|
|
2648
2648
|
var O = h[E];
|
|
2649
|
-
Mn(n, O.obsSet) ? O.subscribers.forEach(function(
|
|
2650
|
-
return r.add(
|
|
2649
|
+
Mn(n, O.obsSet) ? O.subscribers.forEach(function(v) {
|
|
2650
|
+
return r.add(v);
|
|
2651
2651
|
}) : a && m.push(O);
|
|
2652
2652
|
}
|
|
2653
2653
|
a && i.push([p, m]);
|
|
@@ -2664,25 +2664,25 @@ function Ga() {
|
|
|
2664
2664
|
});
|
|
2665
2665
|
n.isBeingOpened = !0, n.dbOpenError = null, n.openComplete = !1;
|
|
2666
2666
|
var a = n.openCanceller, i = Math.round(10 * e.verno), o = !1;
|
|
2667
|
-
function
|
|
2667
|
+
function l() {
|
|
2668
2668
|
if (n.openCanceller !== a) throw new K.DatabaseClosed("db.open() was cancelled");
|
|
2669
2669
|
}
|
|
2670
2670
|
function f() {
|
|
2671
2671
|
return new M(function(O, g) {
|
|
2672
|
-
if (
|
|
2672
|
+
if (l(), !r) throw new K.MissingAPI();
|
|
2673
2673
|
var w = e.name, S = n.autoSchema || !i ? r.open(w) : r.open(w, i);
|
|
2674
2674
|
if (!S) throw new K.MissingAPI();
|
|
2675
|
-
S.onerror = Se(g), S.onblocked = te(e._fireOnBlocked), S.onupgradeneeded = te(function(
|
|
2675
|
+
S.onerror = Se(g), S.onblocked = te(e._fireOnBlocked), S.onupgradeneeded = te(function(v) {
|
|
2676
2676
|
var P;
|
|
2677
2677
|
E = S.transaction, n.autoSchema && !e._options.allowEmptyDB ? (S.onerror = vt, E.abort(), S.result.close(), (P = r.deleteDatabase(w)).onsuccess = P.onerror = te(function() {
|
|
2678
2678
|
g(new K.NoSuchDatabase("Database ".concat(w, " doesnt exist")));
|
|
2679
|
-
})) : (E.onerror = Se(g),
|
|
2679
|
+
})) : (E.onerror = Se(g), v = v.oldVersion > Math.pow(2, 62) ? 0 : v.oldVersion, h = v < 1, e.idbdb = S.result, o && pa(e, E), ha(e, v / 10, E, g));
|
|
2680
2680
|
}, g), S.onsuccess = te(function() {
|
|
2681
2681
|
E = null;
|
|
2682
|
-
var
|
|
2682
|
+
var v, P, D, R, x, k = e.idbdb = S.result, $ = Ge(k.objectStoreNames);
|
|
2683
2683
|
if (0 < $.length) try {
|
|
2684
2684
|
var T = k.transaction((R = $).length === 1 ? R[0] : R, "readonly");
|
|
2685
|
-
if (n.autoSchema) P = k, D = T, (
|
|
2685
|
+
if (n.autoSchema) P = k, D = T, (v = e).verno = P.version / 10, D = v._dbSchema = Qt(0, P, D), v._storeNames = Ge(P.objectStoreNames, 0), Ht(v, [v._allTables], I(D), D);
|
|
2686
2686
|
else if (Xt(e, e._dbSchema, T), ((x = kn(Qt(0, (x = e).idbdb, T), x._dbSchema)).add.length || x.change.some(function(N) {
|
|
2687
2687
|
return N.add.length || N.change.length;
|
|
2688
2688
|
})) && !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."), k.close(), i = k.version + 1, o = !0, O(f());
|
|
@@ -2715,7 +2715,7 @@ function Ga() {
|
|
|
2715
2715
|
}).finally(function() {
|
|
2716
2716
|
return clearInterval(p);
|
|
2717
2717
|
}) : Promise.resolve()).then(f)]).then(function() {
|
|
2718
|
-
return
|
|
2718
|
+
return l(), n.onReadyBeingFired = [], M.resolve($n(function() {
|
|
2719
2719
|
return e.on.ready.fire(e.vip);
|
|
2720
2720
|
})).then(function O() {
|
|
2721
2721
|
if (0 < n.onReadyBeingFired.length) {
|
|
@@ -2765,24 +2765,24 @@ function Ga() {
|
|
|
2765
2765
|
return a;
|
|
2766
2766
|
}
|
|
2767
2767
|
var ba = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2768
|
-
return
|
|
2768
|
+
return u(u({}, e), { table: function(n) {
|
|
2769
2769
|
var r = e.table(n), a = r.schema, i = {}, o = [];
|
|
2770
|
-
function
|
|
2771
|
-
var w = St(h), S = i[w] = i[w] || [],
|
|
2772
|
-
return S.push(P), P.isPrimaryKey || o.push(P), 1 <
|
|
2770
|
+
function l(h, O, g) {
|
|
2771
|
+
var w = St(h), S = i[w] = i[w] || [], v = h == null ? 0 : typeof h == "string" ? 1 : h.length, P = 0 < O, P = u(u({}, g), { name: P ? "".concat(w, "(virtual-from:").concat(g.name, ")") : g.name, lowLevelIndex: g, isVirtual: P, keyTail: O, keyLength: v, extractKey: xn(h), unique: !P && g.unique });
|
|
2772
|
+
return S.push(P), P.isPrimaryKey || o.push(P), 1 < v && l(v === 2 ? h[0] : h.slice(0, v - 1), O + 1, g), S.sort(function(D, R) {
|
|
2773
2773
|
return D.keyTail - R.keyTail;
|
|
2774
2774
|
}), P;
|
|
2775
2775
|
}
|
|
2776
|
-
n =
|
|
2776
|
+
n = l(a.primaryKey.keyPath, 0, a.primaryKey), i[":id"] = [n];
|
|
2777
2777
|
for (var f = 0, p = a.indexes; f < p.length; f++) {
|
|
2778
2778
|
var m = p[f];
|
|
2779
|
-
|
|
2779
|
+
l(m.keyPath, 0, m);
|
|
2780
2780
|
}
|
|
2781
2781
|
function E(h) {
|
|
2782
2782
|
var O, g = h.query.index;
|
|
2783
|
-
return g.isVirtual ?
|
|
2783
|
+
return g.isVirtual ? u(u({}, h), { query: { index: g.lowLevelIndex, range: (O = h.query.range, g = g.keyTail, { type: O.type === 1 ? 2 : O.type, lower: en(O.lower, O.lowerOpen ? e.MAX_KEY : e.MIN_KEY, g), lowerOpen: !0, upper: en(O.upper, O.upperOpen ? e.MIN_KEY : e.MAX_KEY, g), upperOpen: !0 }) } }) : h;
|
|
2784
2784
|
}
|
|
2785
|
-
return
|
|
2785
|
+
return u(u({}, r), { schema: u(u({}, a), { primaryKey: n, indexes: o, getIndexByKeyPath: function(h) {
|
|
2786
2786
|
return (h = i[St(h)]) && h[0];
|
|
2787
2787
|
} }), count: function(h) {
|
|
2788
2788
|
return r.count(E(h));
|
|
@@ -2791,9 +2791,9 @@ function Ga() {
|
|
|
2791
2791
|
}, openCursor: function(h) {
|
|
2792
2792
|
var O = h.query.index, g = O.keyTail, w = O.isVirtual, S = O.keyLength;
|
|
2793
2793
|
return w ? r.openCursor(E(h)).then(function(P) {
|
|
2794
|
-
return P &&
|
|
2794
|
+
return P && v(P);
|
|
2795
2795
|
}) : r.openCursor(h);
|
|
2796
|
-
function
|
|
2796
|
+
function v(P) {
|
|
2797
2797
|
return Object.create(P, { continue: { value: function(D) {
|
|
2798
2798
|
D != null ? P.continue(en(D, h.reverse ? e.MAX_KEY : e.MIN_KEY, g)) : h.unique ? P.continue(P.key.slice(0, S).concat(h.reverse ? e.MIN_KEY : e.MAX_KEY, g)) : P.continue();
|
|
2799
2799
|
} }, continuePrimaryKey: { value: function(D, R) {
|
|
@@ -2812,8 +2812,8 @@ function Ga() {
|
|
|
2812
2812
|
} };
|
|
2813
2813
|
function Fn(e, n, r, a) {
|
|
2814
2814
|
return r = r || {}, a = a || "", I(e).forEach(function(i) {
|
|
2815
|
-
var o,
|
|
2816
|
-
Q(n, i) ? (o = e[i],
|
|
2815
|
+
var o, l, f;
|
|
2816
|
+
Q(n, i) ? (o = e[i], l = n[i], typeof o == "object" && typeof l == "object" && o && l ? (f = cn(o)) !== cn(l) ? r[a + i] = n[i] : f === "Object" ? Fn(o, l, r, a + i + ".") : o !== l && (r[a + i] = n[i]) : o !== l && (r[a + i] = n[i])) : r[a + i] = void 0;
|
|
2817
2817
|
}), I(n).forEach(function(i) {
|
|
2818
2818
|
Q(e, i) || (r[a + i] = n[i]);
|
|
2819
2819
|
}), r;
|
|
@@ -2822,10 +2822,10 @@ function Ga() {
|
|
|
2822
2822
|
return n.type === "delete" ? n.keys : n.keys || n.values.map(e.extractKey);
|
|
2823
2823
|
}
|
|
2824
2824
|
var ya = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
2825
|
-
return
|
|
2825
|
+
return u(u({}, e), { table: function(n) {
|
|
2826
2826
|
var r = e.table(n), a = r.schema.primaryKey;
|
|
2827
|
-
return
|
|
2828
|
-
var o = G.trans,
|
|
2827
|
+
return u(u({}, r), { mutate: function(i) {
|
|
2828
|
+
var o = G.trans, l = o.table(n).hook, f = l.deleting, p = l.creating, m = l.updating;
|
|
2829
2829
|
switch (i.type) {
|
|
2830
2830
|
case "add":
|
|
2831
2831
|
if (p.fire === V) break;
|
|
@@ -2847,9 +2847,9 @@ function Ga() {
|
|
|
2847
2847
|
return o._promise("readwrite", function() {
|
|
2848
2848
|
return function h(O, g, w) {
|
|
2849
2849
|
return r.query({ trans: O, values: !1, query: { index: a, range: g }, limit: w }).then(function(S) {
|
|
2850
|
-
var
|
|
2851
|
-
return E({ type: "delete", keys:
|
|
2852
|
-
return 0 < P.numFailures ? Promise.reject(P.failures[0]) :
|
|
2850
|
+
var v = S.result;
|
|
2851
|
+
return E({ type: "delete", keys: v, trans: O }).then(function(P) {
|
|
2852
|
+
return 0 < P.numFailures ? Promise.reject(P.failures[0]) : v.length < w ? { failures: [], numFailures: 0, lastResult: void 0 } : h(O, u(u({}, g), { lower: v[v.length - 1], lowerOpen: !0 }), w);
|
|
2853
2853
|
});
|
|
2854
2854
|
});
|
|
2855
2855
|
}(i.trans, i.range, 1e4);
|
|
@@ -2857,18 +2857,18 @@ function Ga() {
|
|
|
2857
2857
|
}
|
|
2858
2858
|
return r.mutate(i);
|
|
2859
2859
|
function E(h) {
|
|
2860
|
-
var O, g, w, S = G.trans,
|
|
2861
|
-
if (!
|
|
2862
|
-
return (h = h.type === "add" || h.type === "put" ?
|
|
2863
|
-
var D =
|
|
2860
|
+
var O, g, w, S = G.trans, v = h.keys || Wn(a, h);
|
|
2861
|
+
if (!v) throw new Error("Keys missing");
|
|
2862
|
+
return (h = h.type === "add" || h.type === "put" ? u(u({}, h), { keys: v }) : u({}, h)).type !== "delete" && (h.values = y([], h.values)), h.keys && (h.keys = y([], h.keys)), O = r, w = v, ((g = h).type === "add" ? Promise.resolve([]) : O.getMany({ trans: g.trans, keys: w, cache: "immutable" })).then(function(P) {
|
|
2863
|
+
var D = v.map(function(R, x) {
|
|
2864
2864
|
var k, $, T, N = P[x], j = { onerror: null, onsuccess: null };
|
|
2865
2865
|
return h.type === "delete" ? f.fire.call(j, R, N, S) : h.type === "add" || N === void 0 ? (k = p.fire.call(j, R, h.values[x], S), R == null && k != null && (h.keys[x] = R = k, a.outbound || he(h.values[x], a.keyPath, R))) : (k = Fn(N, h.values[x]), ($ = m.fire.call(j, k, R, N, S)) && (T = h.values[x], Object.keys($).forEach(function(C) {
|
|
2866
2866
|
Q(T, C) ? T[C] = $[C] : he(T, C, $[C]);
|
|
2867
2867
|
}))), j;
|
|
2868
2868
|
});
|
|
2869
2869
|
return r.mutate(h).then(function(R) {
|
|
2870
|
-
for (var x = R.failures, k = R.results, $ = R.numFailures, R = R.lastResult, T = 0; T <
|
|
2871
|
-
var N = (k ||
|
|
2870
|
+
for (var x = R.failures, k = R.results, $ = R.numFailures, R = R.lastResult, T = 0; T < v.length; ++T) {
|
|
2871
|
+
var N = (k || v)[T], j = D[T];
|
|
2872
2872
|
N == null ? j.onerror && j.onerror(x[T]) : j.onsuccess && j.onsuccess(h.type === "put" && P[T] ? h.values[T] : N);
|
|
2873
2873
|
}
|
|
2874
2874
|
return { failures: x, results: k, numFailures: $, lastResult: R };
|
|
@@ -2894,7 +2894,7 @@ function Ga() {
|
|
|
2894
2894
|
var va = { stack: "dbcore", level: -1, create: function(e) {
|
|
2895
2895
|
return { table: function(n) {
|
|
2896
2896
|
var r = e.table(n);
|
|
2897
|
-
return
|
|
2897
|
+
return u(u({}, r), { getMany: function(a) {
|
|
2898
2898
|
if (!a.cache) return r.getMany(a);
|
|
2899
2899
|
var i = Dr(a.keys, a.trans._cache, a.cache === "clone");
|
|
2900
2900
|
return i ? M.resolve(i) : r.getMany(a).then(function(o) {
|
|
@@ -2921,20 +2921,20 @@ function Ga() {
|
|
|
2921
2921
|
}
|
|
2922
2922
|
var wa = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2923
2923
|
var n = e.schema.name, r = new le(e.MIN_KEY, e.MAX_KEY);
|
|
2924
|
-
return
|
|
2924
|
+
return u(u({}, e), { transaction: function(a, i, o) {
|
|
2925
2925
|
if (G.subscr && i !== "readonly") throw new K.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(G.querier));
|
|
2926
2926
|
return e.transaction(a, i, o);
|
|
2927
2927
|
}, table: function(a) {
|
|
2928
|
-
var i = e.table(a), o = i.schema,
|
|
2929
|
-
return g.compound && g.keyPath.includes(
|
|
2930
|
-
}), E =
|
|
2928
|
+
var i = e.table(a), o = i.schema, l = o.primaryKey, h = o.indexes, f = l.extractKey, p = l.outbound, m = l.autoIncrement && h.filter(function(g) {
|
|
2929
|
+
return g.compound && g.keyPath.includes(l.keyPath);
|
|
2930
|
+
}), E = u(u({}, i), { mutate: function(g) {
|
|
2931
2931
|
function w(C) {
|
|
2932
2932
|
return C = "idb://".concat(n, "/").concat(a, "/").concat(C), R[C] || (R[C] = new le());
|
|
2933
2933
|
}
|
|
2934
|
-
var S,
|
|
2934
|
+
var S, v, P, D = g.trans, R = g.mutatedParts || (g.mutatedParts = {}), x = w(""), k = w(":dels"), $ = g.type, j = g.type === "deleteRange" ? [g.range] : g.type === "delete" ? [g.keys] : g.values.length < 50 ? [Wn(l, g).filter(function(C) {
|
|
2935
2935
|
return C;
|
|
2936
2936
|
}), g.values] : [], T = j[0], N = j[1], j = g.trans._cache;
|
|
2937
|
-
return Y(T) ? (x.addKeys(T), (j = $ === "delete" || T.length === N.length ? Dr(T, j) : null) || k.addKeys(T), (j || N) && (S = w,
|
|
2937
|
+
return Y(T) ? (x.addKeys(T), (j = $ === "delete" || T.length === N.length ? Dr(T, j) : null) || k.addKeys(T), (j || N) && (S = w, v = j, P = N, o.indexes.forEach(function(C) {
|
|
2938
2938
|
var B = S(C.name || "");
|
|
2939
2939
|
function W(H) {
|
|
2940
2940
|
return H != null ? C.extractKey(H) : null;
|
|
@@ -2944,8 +2944,8 @@ function Ga() {
|
|
|
2944
2944
|
return B.addKey(be);
|
|
2945
2945
|
}) : B.addKey(H);
|
|
2946
2946
|
}
|
|
2947
|
-
(
|
|
2948
|
-
var F =
|
|
2947
|
+
(v || P).forEach(function(H, de) {
|
|
2948
|
+
var F = v && W(v[de]), de = P && W(P[de]);
|
|
2949
2949
|
X(F, de) !== 0 && (F != null && z(F), de != null && z(de));
|
|
2950
2950
|
});
|
|
2951
2951
|
}))) : T ? (N = { from: (N = T.lower) !== null && N !== void 0 ? N : e.MIN_KEY, to: (N = T.upper) !== null && N !== void 0 ? N : e.MAX_KEY }, k.add(N), x.add(N)) : (x.add(r), k.add(r), o.indexes.forEach(function(C) {
|
|
@@ -2955,7 +2955,7 @@ function Ga() {
|
|
|
2955
2955
|
for (var W = g.values.map(function(F) {
|
|
2956
2956
|
return B.extractKey(F);
|
|
2957
2957
|
}), z = B.keyPath.findIndex(function(F) {
|
|
2958
|
-
return F ===
|
|
2958
|
+
return F === l.keyPath;
|
|
2959
2959
|
}), H = 0, be = C.results.length; H < be; ++H) W[H][z] = C.results[H];
|
|
2960
2960
|
w(B.name).addKeys(W);
|
|
2961
2961
|
})), D.mutatedParts = Vt(D.mutatedParts || {}, R), C;
|
|
@@ -2964,20 +2964,20 @@ function Ga() {
|
|
|
2964
2964
|
var S = w.query, w = S.index, S = S.range;
|
|
2965
2965
|
return [w, new le((w = S.lower) !== null && w !== void 0 ? w : e.MIN_KEY, (S = S.upper) !== null && S !== void 0 ? S : e.MAX_KEY)];
|
|
2966
2966
|
}, O = { get: function(g) {
|
|
2967
|
-
return [
|
|
2967
|
+
return [l, new le(g.key)];
|
|
2968
2968
|
}, getMany: function(g) {
|
|
2969
|
-
return [
|
|
2969
|
+
return [l, new le().addKeys(g.keys)];
|
|
2970
2970
|
}, count: h, query: h, openCursor: h };
|
|
2971
2971
|
return I(O).forEach(function(g) {
|
|
2972
2972
|
E[g] = function(w) {
|
|
2973
|
-
var S = G.subscr,
|
|
2974
|
-
if (
|
|
2973
|
+
var S = G.subscr, v = !!S, P = Rr(G, i) && xr(g, w) ? w.obsSet = {} : S;
|
|
2974
|
+
if (v) {
|
|
2975
2975
|
var D = function(N) {
|
|
2976
2976
|
return N = "idb://".concat(n, "/").concat(a, "/").concat(N), P[N] || (P[N] = new le());
|
|
2977
|
-
}, R = D(""), x = D(":dels"), S = O[g](w),
|
|
2978
|
-
if ((g === "query" &&
|
|
2977
|
+
}, R = D(""), x = D(":dels"), S = O[g](w), v = S[0], S = S[1];
|
|
2978
|
+
if ((g === "query" && v.isPrimaryKey && !w.values ? x : D(v.name || "")).add(S), !v.isPrimaryKey) {
|
|
2979
2979
|
if (g !== "count") {
|
|
2980
|
-
var k = g === "query" && p && w.values && i.query(
|
|
2980
|
+
var k = g === "query" && p && w.values && i.query(u(u({}, w), { values: !1 }));
|
|
2981
2981
|
return i[g].apply(this, arguments).then(function(N) {
|
|
2982
2982
|
if (g === "query") {
|
|
2983
2983
|
if (p && w.values) return k.then(function(W) {
|
|
@@ -3011,7 +3011,7 @@ function Ga() {
|
|
|
3011
3011
|
if (r.numFailures === 0) return n;
|
|
3012
3012
|
if (n.type === "deleteRange") return null;
|
|
3013
3013
|
var a = n.keys ? n.keys.length : "values" in n && n.values ? n.values.length : 1;
|
|
3014
|
-
return r.numFailures === a ? null : (n =
|
|
3014
|
+
return r.numFailures === a ? null : (n = u({}, n), Y(n.keys) && (n.keys = n.keys.filter(function(i, o) {
|
|
3015
3015
|
return !(o in r.failures);
|
|
3016
3016
|
})), "values" in n && Y(n.values) && (n.values = n.values.filter(function(i, o) {
|
|
3017
3017
|
return !(o in r.failures);
|
|
@@ -3023,21 +3023,21 @@ function Ga() {
|
|
|
3023
3023
|
}
|
|
3024
3024
|
function kr(e, n, O, a, i, o) {
|
|
3025
3025
|
if (!O || O.length === 0) return e;
|
|
3026
|
-
var
|
|
3027
|
-
var S = g,
|
|
3026
|
+
var l = n.query.index, f = l.multiEntry, p = n.query.range, m = a.schema.primaryKey.extractKey, E = l.extractKey, h = (l.lowLevelIndex || l).extractKey, O = O.reduce(function(g, w) {
|
|
3027
|
+
var S = g, v = [];
|
|
3028
3028
|
if (w.type === "add" || w.type === "put") for (var P = new le(), D = w.values.length - 1; 0 <= D; --D) {
|
|
3029
3029
|
var R, x = w.values[D], k = m(x);
|
|
3030
3030
|
P.hasKey(k) || (R = E(x), (f && Y(R) ? R.some(function(C) {
|
|
3031
3031
|
return Un(C, p);
|
|
3032
|
-
}) : Un(R, p)) && (P.addKey(k),
|
|
3032
|
+
}) : Un(R, p)) && (P.addKey(k), v.push(x)));
|
|
3033
3033
|
}
|
|
3034
3034
|
switch (w.type) {
|
|
3035
3035
|
case "add":
|
|
3036
3036
|
var $ = new le().addKeys(n.values ? g.map(function(B) {
|
|
3037
3037
|
return m(B);
|
|
3038
|
-
}) : g), S = g.concat(n.values ?
|
|
3038
|
+
}) : g), S = g.concat(n.values ? v.filter(function(B) {
|
|
3039
3039
|
return B = m(B), !$.hasKey(B) && ($.addKey(B), !0);
|
|
3040
|
-
}) :
|
|
3040
|
+
}) : v.map(function(B) {
|
|
3041
3041
|
return m(B);
|
|
3042
3042
|
}).filter(function(B) {
|
|
3043
3043
|
return !$.hasKey(B) && ($.addKey(B), !0);
|
|
@@ -3049,7 +3049,7 @@ function Ga() {
|
|
|
3049
3049
|
}));
|
|
3050
3050
|
S = g.filter(function(B) {
|
|
3051
3051
|
return !T.hasKey(n.values ? m(B) : B);
|
|
3052
|
-
}).concat(n.values ?
|
|
3052
|
+
}).concat(n.values ? v : v.map(function(B) {
|
|
3053
3053
|
return m(B);
|
|
3054
3054
|
}));
|
|
3055
3055
|
break;
|
|
@@ -3105,9 +3105,9 @@ function Ga() {
|
|
|
3105
3105
|
}
|
|
3106
3106
|
var Oa = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
|
|
3107
3107
|
var n = e.schema.name;
|
|
3108
|
-
return
|
|
3109
|
-
var o,
|
|
3110
|
-
return a === "readwrite" && (
|
|
3108
|
+
return u(u({}, e), { transaction: function(r, a, i) {
|
|
3109
|
+
var o, l, f = e.transaction(r, a, i);
|
|
3110
|
+
return a === "readwrite" && (l = (o = new AbortController()).signal, i = function(p) {
|
|
3111
3111
|
return function() {
|
|
3112
3112
|
if (o.abort(), a === "readwrite") {
|
|
3113
3113
|
for (var m = /* @__PURE__ */ new Set(), E = 0, h = r; E < h.length; E++) {
|
|
@@ -3116,7 +3116,7 @@ function Ga() {
|
|
|
3116
3116
|
var w = e.table(O), S = g.optimisticOps.filter(function(B) {
|
|
3117
3117
|
return B.trans === f;
|
|
3118
3118
|
});
|
|
3119
|
-
if (f._explicit && p && f.mutatedParts) for (var
|
|
3119
|
+
if (f._explicit && p && f.mutatedParts) for (var v = 0, P = Object.values(g.queries.query); v < P.length; v++) for (var D = 0, R = ($ = P[v]).slice(); D < R.length; D++) Mn((T = R[D]).obsSet, f.mutatedParts) && (Le($, T), T.subscribers.forEach(function(B) {
|
|
3120
3120
|
return m.add(B);
|
|
3121
3121
|
}));
|
|
3122
3122
|
else if (0 < S.length) {
|
|
@@ -3136,37 +3136,37 @@ function Ga() {
|
|
|
3136
3136
|
});
|
|
3137
3137
|
}
|
|
3138
3138
|
};
|
|
3139
|
-
}, f.addEventListener("abort", i(!1), { signal:
|
|
3139
|
+
}, f.addEventListener("abort", i(!1), { signal: l }), f.addEventListener("error", i(!1), { signal: l }), f.addEventListener("complete", i(!0), { signal: l })), f;
|
|
3140
3140
|
}, table: function(r) {
|
|
3141
3141
|
var a = e.table(r), i = a.schema.primaryKey;
|
|
3142
|
-
return
|
|
3143
|
-
var
|
|
3144
|
-
if (i.outbound ||
|
|
3142
|
+
return u(u({}, a), { mutate: function(o) {
|
|
3143
|
+
var l = G.trans;
|
|
3144
|
+
if (i.outbound || l.db._options.cache === "disabled" || l.explicit || l.idbtrans.mode !== "readwrite") return a.mutate(o);
|
|
3145
3145
|
var f = Je["idb://".concat(n, "/").concat(r)];
|
|
3146
|
-
return f ? (
|
|
3146
|
+
return f ? (l = a.mutate(o), o.type !== "add" && o.type !== "put" || !(50 <= o.values.length || Wn(i, o).some(function(p) {
|
|
3147
3147
|
return p == null;
|
|
3148
|
-
})) ? (f.optimisticOps.push(o), o.mutatedParts && qt(o.mutatedParts),
|
|
3148
|
+
})) ? (f.optimisticOps.push(o), o.mutatedParts && qt(o.mutatedParts), l.then(function(p) {
|
|
3149
3149
|
0 < p.numFailures && (Le(f.optimisticOps, o), (p = Ir(0, o, p)) && f.optimisticOps.push(p), o.mutatedParts && qt(o.mutatedParts));
|
|
3150
|
-
}),
|
|
3150
|
+
}), l.catch(function() {
|
|
3151
3151
|
Le(f.optimisticOps, o), o.mutatedParts && qt(o.mutatedParts);
|
|
3152
|
-
})) :
|
|
3153
|
-
var m = Ir(0,
|
|
3152
|
+
})) : l.then(function(p) {
|
|
3153
|
+
var m = Ir(0, u(u({}, o), { values: o.values.map(function(E, h) {
|
|
3154
3154
|
var O;
|
|
3155
|
-
return p.failures[h] ? E : (E = (O = i.keyPath) !== null && O !== void 0 && O.includes(".") ? Ke(E) :
|
|
3155
|
+
return p.failures[h] ? E : (E = (O = i.keyPath) !== null && O !== void 0 && O.includes(".") ? Ke(E) : u({}, E), he(E, i.keyPath, p.results[h]), E);
|
|
3156
3156
|
}) }), p);
|
|
3157
3157
|
f.optimisticOps.push(m), queueMicrotask(function() {
|
|
3158
3158
|
return o.mutatedParts && qt(o.mutatedParts);
|
|
3159
3159
|
});
|
|
3160
|
-
}),
|
|
3160
|
+
}), l) : a.mutate(o);
|
|
3161
3161
|
}, query: function(o) {
|
|
3162
3162
|
if (!Rr(G, a) || !xr("query", o)) return a.query(o);
|
|
3163
|
-
var
|
|
3163
|
+
var l = ((m = G.trans) === null || m === void 0 ? void 0 : m.db._options.cache) === "immutable", h = G, f = h.requery, p = h.signal, m = function(w, S, v, P) {
|
|
3164
3164
|
var D = Je["idb://".concat(w, "/").concat(S)];
|
|
3165
3165
|
if (!D) return [];
|
|
3166
|
-
if (!(S = D.queries[
|
|
3166
|
+
if (!(S = D.queries[v])) return [null, !1, D, null];
|
|
3167
3167
|
var R = S[(P.query ? P.query.index.name : null) || ""];
|
|
3168
3168
|
if (!R) return [null, !1, D, null];
|
|
3169
|
-
switch (
|
|
3169
|
+
switch (v) {
|
|
3170
3170
|
case "query":
|
|
3171
3171
|
var x = R.find(function(k) {
|
|
3172
3172
|
return k.req.limit === P.limit && k.req.values === P.values && Tr(k.req.query.range, P.query.range);
|
|
@@ -3182,15 +3182,15 @@ function Ga() {
|
|
|
3182
3182
|
}(n, r, "query", o), E = m[0], h = m[1], O = m[2], g = m[3];
|
|
3183
3183
|
return E && h ? E.obsSet = o.obsSet : (h = a.query(o).then(function(w) {
|
|
3184
3184
|
var S = w.result;
|
|
3185
|
-
if (E && (E.res = S),
|
|
3186
|
-
for (var
|
|
3185
|
+
if (E && (E.res = S), l) {
|
|
3186
|
+
for (var v = 0, P = S.length; v < P; ++v) Object.freeze(S[v]);
|
|
3187
3187
|
Object.freeze(S);
|
|
3188
3188
|
} else w.result = Ke(S);
|
|
3189
3189
|
return w;
|
|
3190
3190
|
}).catch(function(w) {
|
|
3191
3191
|
return g && E && Le(g, E), Promise.reject(w);
|
|
3192
3192
|
}), E = { obsSet: o.obsSet, promise: h, subscribers: /* @__PURE__ */ new Set(), type: "query", req: o, dirty: !1 }, g ? g.push(E) : (g = [E], (O = O || (Je["idb://".concat(n, "/").concat(r)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[o.query.index.name || ""] = g)), Sa(E, g, f, p), E.promise.then(function(w) {
|
|
3193
|
-
return { result: kr(w.result, o, O == null ? void 0 : O.optimisticOps, a, E,
|
|
3193
|
+
return { result: kr(w.result, o, O == null ? void 0 : O.optimisticOps, a, E, l) };
|
|
3194
3194
|
});
|
|
3195
3195
|
} });
|
|
3196
3196
|
} });
|
|
@@ -3220,8 +3220,8 @@ function Ga() {
|
|
|
3220
3220
|
}).then(e);
|
|
3221
3221
|
}, ie.prototype.use = function(e) {
|
|
3222
3222
|
var n = e.stack, r = e.create, a = e.level, i = e.name;
|
|
3223
|
-
return i && this.unuse({ stack: n, name: i }), e = this._middlewares[n] || (this._middlewares[n] = []), e.push({ stack: n, create: r, level: a ?? 10, name: i }), e.sort(function(o,
|
|
3224
|
-
return o.level -
|
|
3223
|
+
return i && this.unuse({ stack: n, name: i }), e = this._middlewares[n] || (this._middlewares[n] = []), e.push({ stack: n, create: r, level: a ?? 10, name: i }), e.sort(function(o, l) {
|
|
3224
|
+
return o.level - l.level;
|
|
3225
3225
|
}), this;
|
|
3226
3226
|
}, ie.prototype.unuse = function(e) {
|
|
3227
3227
|
var n = e.stack, r = e.name, a = e.create;
|
|
@@ -3255,7 +3255,7 @@ function Ga() {
|
|
|
3255
3255
|
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
3256
3256
|
var r = 0 < arguments.length && typeof arguments[0] != "object", a = this._state;
|
|
3257
3257
|
return new M(function(i, o) {
|
|
3258
|
-
function
|
|
3258
|
+
function l() {
|
|
3259
3259
|
n.close(e);
|
|
3260
3260
|
var f = n._deps.indexedDB.deleteDatabase(n.name);
|
|
3261
3261
|
f.onsuccess = te(function() {
|
|
@@ -3264,7 +3264,7 @@ function Ga() {
|
|
|
3264
3264
|
}), f.onerror = Se(o), f.onblocked = n._fireOnBlocked;
|
|
3265
3265
|
}
|
|
3266
3266
|
if (r) throw new K.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
3267
|
-
a.isBeingOpened ? a.dbReadyPromise.then(
|
|
3267
|
+
a.isBeingOpened ? a.dbReadyPromise.then(l) : l();
|
|
3268
3268
|
});
|
|
3269
3269
|
}, ie.prototype.backendDB = function() {
|
|
3270
3270
|
return this.idbdb;
|
|
@@ -3293,10 +3293,10 @@ function Ga() {
|
|
|
3293
3293
|
}, ie.prototype._transaction = function(e, n, r) {
|
|
3294
3294
|
var a = this, i = G.trans;
|
|
3295
3295
|
i && i.db === this && e.indexOf("!") === -1 || (i = null);
|
|
3296
|
-
var o,
|
|
3296
|
+
var o, l, f = e.indexOf("?") !== -1;
|
|
3297
3297
|
e = e.replace("!", "").replace("?", "");
|
|
3298
3298
|
try {
|
|
3299
|
-
if (
|
|
3299
|
+
if (l = n.map(function(m) {
|
|
3300
3300
|
if (m = m instanceof a.Table ? m.name : m, typeof m != "string") throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
|
|
3301
3301
|
return m;
|
|
3302
3302
|
}), e == "r" || e === En) o = En;
|
|
@@ -3309,7 +3309,7 @@ function Ga() {
|
|
|
3309
3309
|
if (!f) throw new K.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
3310
3310
|
i = null;
|
|
3311
3311
|
}
|
|
3312
|
-
i &&
|
|
3312
|
+
i && l.forEach(function(m) {
|
|
3313
3313
|
if (i && i.storeNames.indexOf(m) === -1) {
|
|
3314
3314
|
if (!f) throw new K.SubTransaction("Table " + m + " not included in parent transaction.");
|
|
3315
3315
|
i = null;
|
|
@@ -3323,10 +3323,10 @@ function Ga() {
|
|
|
3323
3323
|
}
|
|
3324
3324
|
var p = (function m(E, h, O, g, w) {
|
|
3325
3325
|
return M.resolve().then(function() {
|
|
3326
|
-
var S = G.transless || G,
|
|
3327
|
-
if (
|
|
3326
|
+
var S = G.transless || G, v = E._createTransaction(h, O, E._dbSchema, g);
|
|
3327
|
+
if (v.explicit = !0, S = { trans: v, transless: S }, g) v.idbtrans = g.idbtrans;
|
|
3328
3328
|
else try {
|
|
3329
|
-
|
|
3329
|
+
v.create(), v.idbtrans._explicit = !0, E._state.PR1398_maxLoop = 3;
|
|
3330
3330
|
} catch (R) {
|
|
3331
3331
|
return R.name === dn.InvalidState && E.isOpen() && 0 < --E._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), E.close({ disableAutoOpen: !1 }), E.open().then(function() {
|
|
3332
3332
|
return m(E, h, O, null, w);
|
|
@@ -3335,20 +3335,20 @@ function Ga() {
|
|
|
3335
3335
|
var P, D = ln(w);
|
|
3336
3336
|
return D && at(), S = M.follow(function() {
|
|
3337
3337
|
var R;
|
|
3338
|
-
(P = w.call(
|
|
3338
|
+
(P = w.call(v, v)) && (D ? (R = Ne.bind(null, null), P.then(R, R)) : typeof P.next == "function" && typeof P.throw == "function" && (P = Ln(P)));
|
|
3339
3339
|
}, S), (P && typeof P.then == "function" ? M.resolve(P).then(function(R) {
|
|
3340
|
-
return
|
|
3340
|
+
return v.active ? R : se(new K.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
3341
3341
|
}) : S.then(function() {
|
|
3342
3342
|
return P;
|
|
3343
3343
|
})).then(function(R) {
|
|
3344
|
-
return g &&
|
|
3344
|
+
return g && v._resolve(), v._completion.then(function() {
|
|
3345
3345
|
return R;
|
|
3346
3346
|
});
|
|
3347
3347
|
}).catch(function(R) {
|
|
3348
|
-
return
|
|
3348
|
+
return v._reject(R), se(R);
|
|
3349
3349
|
});
|
|
3350
3350
|
});
|
|
3351
|
-
}).bind(null, this, o,
|
|
3351
|
+
}).bind(null, this, o, l, i, r);
|
|
3352
3352
|
return i ? i._promise(o, p, "lock") : G.trans ? Ye(G.transless, function() {
|
|
3353
3353
|
return a._whenReady(p);
|
|
3354
3354
|
}) : this._whenReady(p);
|
|
@@ -3360,8 +3360,8 @@ function Ga() {
|
|
|
3360
3360
|
var r = this;
|
|
3361
3361
|
this._middlewares = {}, this.verno = 0;
|
|
3362
3362
|
var a = ie.dependencies;
|
|
3363
|
-
this._options = n =
|
|
3364
|
-
var i, o,
|
|
3363
|
+
this._options = n = u({ addons: ie.addons, autoOpen: !0, indexedDB: a.indexedDB, IDBKeyRange: a.IDBKeyRange, cache: "cloned" }, n), this._deps = { indexedDB: n.indexedDB, IDBKeyRange: n.IDBKeyRange }, a = n.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
3364
|
+
var i, o, l, f, p, m = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: V, dbReadyPromise: null, cancelOpen: V, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: n.autoOpen };
|
|
3365
3365
|
m.dbReadyPromise = new M(function(h) {
|
|
3366
3366
|
m.dbReadyResolve = h;
|
|
3367
3367
|
}), m.openCanceller = new M(function(h, O) {
|
|
@@ -3370,32 +3370,32 @@ function Ga() {
|
|
|
3370
3370
|
return function(O, g) {
|
|
3371
3371
|
ie.vip(function() {
|
|
3372
3372
|
var w, S = r._state;
|
|
3373
|
-
S.openComplete ? (S.dbOpenError || M.resolve().then(O), g && h(O)) : S.onReadyBeingFired ? (S.onReadyBeingFired.push(O), g && h(O)) : (h(O), w = r, g || h(function
|
|
3374
|
-
w.on.ready.unsubscribe(O), w.on.ready.unsubscribe(
|
|
3373
|
+
S.openComplete ? (S.dbOpenError || M.resolve().then(O), g && h(O)) : S.onReadyBeingFired ? (S.onReadyBeingFired.push(O), g && h(O)) : (h(O), w = r, g || h(function v() {
|
|
3374
|
+
w.on.ready.unsubscribe(O), w.on.ready.unsubscribe(v);
|
|
3375
3375
|
}));
|
|
3376
3376
|
});
|
|
3377
3377
|
};
|
|
3378
|
-
}), this.Collection = (i = this, bt(sa.prototype, function(P,
|
|
3378
|
+
}), this.Collection = (i = this, bt(sa.prototype, function(P, v) {
|
|
3379
3379
|
this.db = i;
|
|
3380
3380
|
var g = ur, w = null;
|
|
3381
|
-
if (
|
|
3382
|
-
g =
|
|
3381
|
+
if (v) try {
|
|
3382
|
+
g = v();
|
|
3383
3383
|
} catch (D) {
|
|
3384
3384
|
w = D;
|
|
3385
3385
|
}
|
|
3386
|
-
var S = P._ctx,
|
|
3387
|
-
this._ctx = { table:
|
|
3386
|
+
var S = P._ctx, v = S.table, P = v.hook.reading.fire;
|
|
3387
|
+
this._ctx = { table: v, index: S.index, isPrimKey: !S.index || v.schema.primKey.keyPath && S.index === v.schema.primKey.name, range: g, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: w, or: S.or, valueMapper: P !== dt ? P : null };
|
|
3388
3388
|
})), this.Table = (o = this, bt(hr.prototype, function(h, O, g) {
|
|
3389
3389
|
this.db = o, this._tx = g, this.name = h, this.schema = O, this.hook = o._allTables[h] ? o._allTables[h].hook : mt(null, { creating: [Jr, V], reading: [Xr, dt], updating: [Vr, V], deleting: [Zr, V] });
|
|
3390
|
-
})), this.Transaction = (
|
|
3391
|
-
var
|
|
3392
|
-
this.db =
|
|
3393
|
-
|
|
3390
|
+
})), this.Transaction = (l = this, bt(ca.prototype, function(h, O, g, w, S) {
|
|
3391
|
+
var v = this;
|
|
3392
|
+
this.db = l, this.mode = h, this.storeNames = O, this.schema = g, this.chromeTransactionDurability = w, this.idbtrans = null, this.on = mt(this, "complete", "error", "abort"), this.parent = S || 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 M(function(P, D) {
|
|
3393
|
+
v._resolve = P, v._reject = D;
|
|
3394
3394
|
}), this._completion.then(function() {
|
|
3395
|
-
|
|
3395
|
+
v.active = !1, v.on.complete.fire();
|
|
3396
3396
|
}, function(P) {
|
|
3397
|
-
var D =
|
|
3398
|
-
return
|
|
3397
|
+
var D = v.active;
|
|
3398
|
+
return v.active = !1, v.on.error.fire(P), v.parent ? v.parent._reject(P) : D && v.idbtrans && v.idbtrans.abort(), se(P);
|
|
3399
3399
|
});
|
|
3400
3400
|
})), this.Version = (f = this, bt(ga.prototype, function(h) {
|
|
3401
3401
|
this.db = f, this._cfg = { version: h, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
@@ -3451,10 +3451,10 @@ function Ga() {
|
|
|
3451
3451
|
}
|
|
3452
3452
|
function Nr(e) {
|
|
3453
3453
|
var n, r = !1, a = new _a(function(i) {
|
|
3454
|
-
var o = ln(e),
|
|
3454
|
+
var o = ln(e), l, f = !1, p = {}, m = {}, E = { get closed() {
|
|
3455
3455
|
return f;
|
|
3456
3456
|
}, unsubscribe: function() {
|
|
3457
|
-
f || (f = !0,
|
|
3457
|
+
f || (f = !0, l && l.abort(), h && je.storagemutated.unsubscribe(g));
|
|
3458
3458
|
} };
|
|
3459
3459
|
i.start && i.start(E);
|
|
3460
3460
|
var h = !1, O = function() {
|
|
@@ -3462,8 +3462,8 @@ function Ga() {
|
|
|
3462
3462
|
}, g = function(S) {
|
|
3463
3463
|
Vt(p, S), Mn(m, p) && O();
|
|
3464
3464
|
}, w = function() {
|
|
3465
|
-
var S,
|
|
3466
|
-
!f && nn.indexedDB && (p = {}, S = {},
|
|
3465
|
+
var S, v, P;
|
|
3466
|
+
!f && nn.indexedDB && (p = {}, S = {}, l && l.abort(), l = new AbortController(), P = function(D) {
|
|
3467
3467
|
var R = nt();
|
|
3468
3468
|
try {
|
|
3469
3469
|
o && at();
|
|
@@ -3472,8 +3472,8 @@ function Ga() {
|
|
|
3472
3472
|
} finally {
|
|
3473
3473
|
R && rt();
|
|
3474
3474
|
}
|
|
3475
|
-
}(
|
|
3476
|
-
r = !0, n = D, f ||
|
|
3475
|
+
}(v = { subscr: S, signal: l.signal, requery: O, querier: e, trans: null }), Promise.resolve(P).then(function(D) {
|
|
3476
|
+
r = !0, n = D, f || v.signal.aborted || (p = {}, function(R) {
|
|
3477
3477
|
for (var x in R) if (Q(R, x)) return;
|
|
3478
3478
|
return 1;
|
|
3479
3479
|
}(m = S) || h || (je(wt, g), h = !0), wn(function() {
|
|
@@ -3502,7 +3502,7 @@ function Ga() {
|
|
|
3502
3502
|
Me = n;
|
|
3503
3503
|
}
|
|
3504
3504
|
}
|
|
3505
|
-
re(Ze,
|
|
3505
|
+
re(Ze, u(u({}, kt), { delete: function(e) {
|
|
3506
3506
|
return new Ze(e, { addons: [] }).delete();
|
|
3507
3507
|
}, exists: function(e) {
|
|
3508
3508
|
return new Ze(e, { addons: [] }).open().then(function(n) {
|
|
@@ -3585,7 +3585,7 @@ function Ga() {
|
|
|
3585
3585
|
return !e || e instanceof et || e instanceof TypeError || e instanceof SyntaxError || !e.name || !tr[e.name] ? e : (n = new tr[e.name](n || e.message, e), "stack" in e && ae(n, "stack", { get: function() {
|
|
3586
3586
|
return this.inner.stack;
|
|
3587
3587
|
} }), n);
|
|
3588
|
-
}, nr(Ee),
|
|
3588
|
+
}, nr(Ee), u(De, Object.freeze({ __proto__: null, Dexie: De, liveQuery: Nr, Entity: lr, cmp: X, PropModification: yt, replacePrefix: function(e, n) {
|
|
3589
3589
|
return new yt({ replacePrefix: [e, n] });
|
|
3590
3590
|
}, add: function(e) {
|
|
3591
3591
|
return new yt({ add: e });
|
|
@@ -3611,24 +3611,25 @@ class Br {
|
|
|
3611
3611
|
*/
|
|
3612
3612
|
b(this, "getCloud", async (t) => {
|
|
3613
3613
|
const s = await this.db.table(_.CLOUD).where({ id: t.widget }).last().catch(() => {
|
|
3614
|
-
L(2, ["%capi%C %ccloud",
|
|
3614
|
+
L(2, ["%capi%C %ccloud", c.API, c.NONE, c.CLOUD, t.widget]);
|
|
3615
3615
|
});
|
|
3616
3616
|
if (typeof s > "u")
|
|
3617
3617
|
return { data: null, message: "Cloud Data error", success: !1, query: t };
|
|
3618
|
-
const
|
|
3618
|
+
const u = {
|
|
3619
3619
|
data: s.data,
|
|
3620
3620
|
message: s !== void 0 ? "Series retrieved successfully" : "Series Data error",
|
|
3621
3621
|
success: s !== void 0,
|
|
3622
3622
|
query: t
|
|
3623
3623
|
};
|
|
3624
3624
|
return L(3, [
|
|
3625
|
-
"%cstorage%c %ccloud",
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
c
|
|
3631
|
-
|
|
3625
|
+
"%cstorage%c %ccloud%c %cget",
|
|
3626
|
+
c.STORAGE,
|
|
3627
|
+
c.NONE,
|
|
3628
|
+
c.CLOUD,
|
|
3629
|
+
c.NONE,
|
|
3630
|
+
c.GET_DATA,
|
|
3631
|
+
u
|
|
3632
|
+
]), u;
|
|
3632
3633
|
});
|
|
3633
3634
|
/**
|
|
3634
3635
|
* Update Cloud
|
|
@@ -3641,10 +3642,10 @@ class Br {
|
|
|
3641
3642
|
dashboard_id: t.dashboard,
|
|
3642
3643
|
//data: data.data,
|
|
3643
3644
|
data: s
|
|
3644
|
-
}).then(() => 201).catch((
|
|
3645
|
+
}).then(() => 201).catch((u) => (L(2, ["%cstorage%c %ccloud%c %cset", c.STORAGE, c.NONE, c.CLOUD, c.NONE, c.NO_UPDATES, t, u.message]), console.error("%cstorage", c.STORAGE, "set", t, u.message), 400)) : 400);
|
|
3645
3646
|
b(this, "getDashboard", async (t) => {
|
|
3646
3647
|
const s = await this.db.table(_.DASHBOARD).where({ id: t.id }).last().catch(() => {
|
|
3647
|
-
L(2, ["%cstorage",
|
|
3648
|
+
L(2, ["%cstorage", c.STORAGE, q.DASHBOARD_LOAD, t.id]);
|
|
3648
3649
|
});
|
|
3649
3650
|
return s === void 0 ? {
|
|
3650
3651
|
data: null,
|
|
@@ -3653,21 +3654,21 @@ class Br {
|
|
|
3653
3654
|
} : (s.message = `Dashboard ${t.id} retrieved from storage`, s.success = !0, s);
|
|
3654
3655
|
});
|
|
3655
3656
|
b(this, "getDashboards", async (t) => {
|
|
3656
|
-
const s = (A) => (t == null ? void 0 : t.id) === A.id,
|
|
3657
|
-
let
|
|
3658
|
-
L(2, ["%cstorage",
|
|
3657
|
+
const s = (A) => (t == null ? void 0 : t.id) === A.id, u = (A) => t != null && t.name ? A.name.includes(t == null ? void 0 : t.name) : !1;
|
|
3658
|
+
let y = await this.db.table(_.DASHBOARD).toArray().then((A) => t != null && t.id ? A.filter(s) : A).then((A) => t != null && t.name ? A.filter(u) : A).catch(() => {
|
|
3659
|
+
L(2, ["%cstorage", c.STORAGE, q.DASHBOARD_LOAD, t]);
|
|
3659
3660
|
});
|
|
3660
|
-
return
|
|
3661
|
+
return y !== void 0 && L(3, [
|
|
3661
3662
|
"%cstorage%c %cdashboards",
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3663
|
+
c.STORAGE,
|
|
3664
|
+
c.NONE,
|
|
3665
|
+
c.WIDGET,
|
|
3665
3666
|
t
|
|
3666
3667
|
]), {
|
|
3667
3668
|
// @ts-ignore
|
|
3668
|
-
data:
|
|
3669
|
-
message:
|
|
3670
|
-
success:
|
|
3669
|
+
data: y !== void 0 ? { dashboards: y, query: t } : null,
|
|
3670
|
+
message: y !== void 0 ? "Dashboards loaded from storage" : "Dashboards load error",
|
|
3671
|
+
success: y !== void 0
|
|
3671
3672
|
};
|
|
3672
3673
|
});
|
|
3673
3674
|
/**
|
|
@@ -3686,15 +3687,15 @@ class Br {
|
|
|
3686
3687
|
data: null,
|
|
3687
3688
|
message: `Dashboard ${s.data.id} saved to storage`,
|
|
3688
3689
|
success: !0
|
|
3689
|
-
})).catch((
|
|
3690
|
+
})).catch((u) => (console.error(
|
|
3690
3691
|
"%cstorage",
|
|
3691
|
-
|
|
3692
|
+
c.STORAGE,
|
|
3692
3693
|
_.WIDGET,
|
|
3693
3694
|
t,
|
|
3694
|
-
|
|
3695
|
+
u.message
|
|
3695
3696
|
), {
|
|
3696
3697
|
data: null,
|
|
3697
|
-
message: `Dashboard ${s.data.id} save error: ${
|
|
3698
|
+
message: `Dashboard ${s.data.id} save error: ${u.message}`,
|
|
3698
3699
|
success: !1
|
|
3699
3700
|
}));
|
|
3700
3701
|
});
|
|
@@ -3702,18 +3703,18 @@ class Br {
|
|
|
3702
3703
|
* Wipe Message data after expires timestamp
|
|
3703
3704
|
*/
|
|
3704
3705
|
b(this, "cleanMessages", async () => {
|
|
3705
|
-
const t = Date.now() / 1e3, s = (A) => A.expires < t,
|
|
3706
|
+
const t = Date.now() / 1e3, s = (A) => A.expires < t, u = (A) => A.expires < t;
|
|
3706
3707
|
return await this.db.table(_.TOPICS).orderBy("expires").filter(s).delete().catch((A) => (console.error(
|
|
3707
3708
|
"%cstorage%c %cclean",
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3709
|
+
c.STORAGE,
|
|
3710
|
+
c.NONE,
|
|
3711
|
+
c.MESSAGES,
|
|
3711
3712
|
A.message
|
|
3712
|
-
), 0)), await this.db.table(_.MESSAGES).orderBy("expires").filter(
|
|
3713
|
+
), 0)), await this.db.table(_.MESSAGES).orderBy("expires").filter(u).delete().catch((A) => (console.error(
|
|
3713
3714
|
"%cstorage%c %clean",
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3715
|
+
c.STORAGE,
|
|
3716
|
+
c.NONE,
|
|
3717
|
+
c.MESSAGES,
|
|
3717
3718
|
A.message
|
|
3718
3719
|
), 0));
|
|
3719
3720
|
});
|
|
@@ -3725,9 +3726,9 @@ class Br {
|
|
|
3725
3726
|
b(this, "getMessages", async (t) => {
|
|
3726
3727
|
const s = (t == null ? void 0 : t.order) ?? "utc";
|
|
3727
3728
|
s !== "utc" && (t.since = Math.floor(Date.now() / 1e3) - 60 * 60 * 24 * 7), this.options.delay != 0 ? t.before = Math.floor(Date.now() / 1e3) - (this.options.delay || 0) : t.before = Math.floor(Date.now() / 1e3);
|
|
3728
|
-
const
|
|
3729
|
+
const u = (I) => I.utc > ((t == null ? void 0 : t.since) || 0), y = (I) => I.utc < ((t == null ? void 0 : t.before) || Date.now() / 1e3), A = (I) => (I == null ? void 0 : I.visible) !== 0;
|
|
3729
3730
|
try {
|
|
3730
|
-
const Y = await this.db.table(_.TOPICS).where("widget_id").equals(t.widget).filter(A).filter(
|
|
3731
|
+
const Y = await this.db.table(_.TOPICS).where("widget_id").equals(t.widget).filter(A).filter(u).filter(y).reverse().limit((t == null ? void 0 : t.limit) ?? 25).sortBy(s);
|
|
3731
3732
|
if (Y.length === 0)
|
|
3732
3733
|
return {
|
|
3733
3734
|
data: null,
|
|
@@ -3745,33 +3746,36 @@ class Br {
|
|
|
3745
3746
|
message: "Messages retrieved successfully",
|
|
3746
3747
|
success: !0
|
|
3747
3748
|
};
|
|
3748
|
-
return L(
|
|
3749
|
-
"%cstorage%c %cmessages",
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3749
|
+
return L(3, [
|
|
3750
|
+
"%cstorage%c %cmessages%c %cget",
|
|
3751
|
+
c.STORAGE,
|
|
3752
|
+
c.NONE,
|
|
3753
|
+
c.MESSAGES,
|
|
3754
|
+
c.NONE,
|
|
3755
|
+
c.GET_DATA,
|
|
3754
3756
|
Q
|
|
3755
3757
|
]), Q;
|
|
3756
3758
|
});
|
|
3757
3759
|
} catch (I) {
|
|
3758
|
-
return
|
|
3759
|
-
"%cstorage%c %cmessages",
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3760
|
+
return L(2, [
|
|
3761
|
+
"%cstorage%c %cmessages%c %cget",
|
|
3762
|
+
c.STORAGE,
|
|
3763
|
+
c.NONE,
|
|
3764
|
+
c.MESSAGES,
|
|
3765
|
+
c.NONE,
|
|
3766
|
+
c.NO_UPDATES,
|
|
3763
3767
|
t,
|
|
3764
|
-
I
|
|
3765
|
-
), { data: null, message: "Messages Data error", success: !1 };
|
|
3768
|
+
I.message
|
|
3769
|
+
]), { data: null, message: "Messages Data error", success: !1 };
|
|
3766
3770
|
}
|
|
3767
3771
|
});
|
|
3768
3772
|
b(this, "hideMessage", async (t, s) => {
|
|
3769
|
-
await this.db.table(_.TOPICS).where("message_id").equals(t).modify({ visible: s ? 1 : 0 }).catch((
|
|
3773
|
+
await this.db.table(_.TOPICS).where("message_id").equals(t).modify({ visible: s ? 1 : 0 }).catch((u) => (console.error(
|
|
3770
3774
|
"%cstorage%c %chide",
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
+
c.STORAGE,
|
|
3776
|
+
c.NONE,
|
|
3777
|
+
c.HIDE,
|
|
3778
|
+
u.message
|
|
3775
3779
|
), 0));
|
|
3776
3780
|
});
|
|
3777
3781
|
/**
|
|
@@ -3783,8 +3787,8 @@ class Br {
|
|
|
3783
3787
|
b(this, "setMessages", async (t, s) => {
|
|
3784
3788
|
if (t.type !== _.MESSAGES)
|
|
3785
3789
|
return 400;
|
|
3786
|
-
const
|
|
3787
|
-
let
|
|
3790
|
+
const u = s.data.title;
|
|
3791
|
+
let y = 0;
|
|
3788
3792
|
return await s.data.messages.forEach(async (A) => {
|
|
3789
3793
|
var I, Y, ne, ue, U, Q, re, Ie, ae, _e, Pt, Dt, Ge, ut;
|
|
3790
3794
|
A.id !== null && (A.topics[0] = {
|
|
@@ -3799,16 +3803,16 @@ class Br {
|
|
|
3799
3803
|
data: A,
|
|
3800
3804
|
expires: A.expires
|
|
3801
3805
|
}).catch((ge) => {
|
|
3802
|
-
|
|
3806
|
+
y++, console.error(
|
|
3803
3807
|
"%cstorage",
|
|
3804
|
-
|
|
3808
|
+
c.STORAGE,
|
|
3805
3809
|
"set message",
|
|
3806
|
-
`title: ${
|
|
3810
|
+
`title: ${u}`,
|
|
3807
3811
|
A,
|
|
3808
3812
|
ge.message
|
|
3809
3813
|
);
|
|
3810
3814
|
}), await this.db.table(_.TOPICS).put({
|
|
3811
|
-
title:
|
|
3815
|
+
title: u,
|
|
3812
3816
|
widget_id: t.widget,
|
|
3813
3817
|
message_id: A.id,
|
|
3814
3818
|
dashboard_id: t.dashboard,
|
|
@@ -3819,20 +3823,20 @@ class Br {
|
|
|
3819
3823
|
utc: A.utc,
|
|
3820
3824
|
expires: A.expires
|
|
3821
3825
|
}).catch((ge) => {
|
|
3822
|
-
|
|
3826
|
+
y++, console.error(
|
|
3823
3827
|
"%cstorage",
|
|
3824
|
-
|
|
3828
|
+
c.STORAGE,
|
|
3825
3829
|
"set topic",
|
|
3826
|
-
`title: ${
|
|
3830
|
+
`title: ${u}`,
|
|
3827
3831
|
A,
|
|
3828
3832
|
ge.message
|
|
3829
3833
|
);
|
|
3830
3834
|
}), await s.data.topics.forEach(async (ge) => {
|
|
3831
3835
|
const Rt = ge.message_id, ve = ge.visible ? 1 : 0, he = ge.title;
|
|
3832
3836
|
await this.db.table(_.TOPICS).where("message_id").equals(Rt).modify({ visible: ve }).catch((xt) => {
|
|
3833
|
-
|
|
3837
|
+
y++, console.error(
|
|
3834
3838
|
"%cstorage",
|
|
3835
|
-
|
|
3839
|
+
c.STORAGE,
|
|
3836
3840
|
"update message visibility",
|
|
3837
3841
|
`title: ${he}`,
|
|
3838
3842
|
`widget: ${ge.widget_id}`,
|
|
@@ -3840,7 +3844,7 @@ class Br {
|
|
|
3840
3844
|
);
|
|
3841
3845
|
});
|
|
3842
3846
|
}));
|
|
3843
|
-
}),
|
|
3847
|
+
}), y === 0 ? 201 : 400;
|
|
3844
3848
|
});
|
|
3845
3849
|
/**
|
|
3846
3850
|
* Retrieve Series Data
|
|
@@ -3851,18 +3855,26 @@ class Br {
|
|
|
3851
3855
|
const s = await this.db.table(_.SERIES).where({ id: t.widget }).last().catch(() => {
|
|
3852
3856
|
console.warn(
|
|
3853
3857
|
"%storage%c %cseries",
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3858
|
+
c.STORAGE,
|
|
3859
|
+
c.NONE,
|
|
3860
|
+
c.SERIES,
|
|
3857
3861
|
t.widget
|
|
3858
3862
|
);
|
|
3859
|
-
}),
|
|
3863
|
+
}), u = {
|
|
3860
3864
|
data: s.data,
|
|
3861
|
-
message: s !== void 0 ? "Series
|
|
3865
|
+
message: s !== void 0 ? "Get Series success" : "Get Series error",
|
|
3862
3866
|
success: s !== void 0,
|
|
3863
3867
|
query: t
|
|
3864
3868
|
};
|
|
3865
|
-
return L(3, [
|
|
3869
|
+
return L(3, [
|
|
3870
|
+
"%cstorage%c %cseries%c %cget",
|
|
3871
|
+
c.STORAGE,
|
|
3872
|
+
c.NONE,
|
|
3873
|
+
c.SERIES,
|
|
3874
|
+
c.NONE,
|
|
3875
|
+
c.GET_DATA,
|
|
3876
|
+
u
|
|
3877
|
+
]), u;
|
|
3866
3878
|
});
|
|
3867
3879
|
/**
|
|
3868
3880
|
* Update Series
|
|
@@ -3875,7 +3887,16 @@ class Br {
|
|
|
3875
3887
|
dashboard_id: t.dashboard,
|
|
3876
3888
|
//data: data.data,
|
|
3877
3889
|
data: s
|
|
3878
|
-
}).then(() => 201).catch((
|
|
3890
|
+
}).then(() => 201).catch((u) => (L(2, [
|
|
3891
|
+
"%cstorage%c %cseries%c %cset",
|
|
3892
|
+
c.STORAGE,
|
|
3893
|
+
c.NONE,
|
|
3894
|
+
c.SERIES,
|
|
3895
|
+
c.NONE,
|
|
3896
|
+
c.NO_UPDATES,
|
|
3897
|
+
t,
|
|
3898
|
+
u.message
|
|
3899
|
+
]), 400)) : 400));
|
|
3879
3900
|
/**
|
|
3880
3901
|
* Retrieve Widget from Storage
|
|
3881
3902
|
* @param query IQuery
|
|
@@ -3883,7 +3904,7 @@ class Br {
|
|
|
3883
3904
|
*/
|
|
3884
3905
|
b(this, "getWidget", async (t) => {
|
|
3885
3906
|
const s = await this.db.table(_.WIDGET).where({ id: t.id }).last().catch(() => {
|
|
3886
|
-
console.warn("%cstorage",
|
|
3907
|
+
console.warn("%cstorage", c.STORAGE, q.WIDGET_LOAD, t.id);
|
|
3887
3908
|
});
|
|
3888
3909
|
return s === void 0 ? {
|
|
3889
3910
|
data: null,
|
|
@@ -3897,15 +3918,15 @@ class Br {
|
|
|
3897
3918
|
* @returns IResponse
|
|
3898
3919
|
*/
|
|
3899
3920
|
b(this, "getWidgets", async (t) => {
|
|
3900
|
-
const s = (I) => (t == null ? void 0 : t.dashboard) === I.dashboard_id,
|
|
3901
|
-
let A = await this.db.table(_.WIDGET).toArray().then((I) => t != null && t.dashboard ? I.filter(s) : I).then((I) => t != null && t.type ? I.filter(
|
|
3902
|
-
L(2, ["%cstorage",
|
|
3921
|
+
const s = (I) => (t == null ? void 0 : t.dashboard) === I.dashboard_id, u = (I) => (t == null ? void 0 : t.type) === I.type, y = (I) => t != null && t.name ? I.name.includes(t == null ? void 0 : t.name) : !1;
|
|
3922
|
+
let A = await this.db.table(_.WIDGET).toArray().then((I) => t != null && t.dashboard ? I.filter(s) : I).then((I) => t != null && t.type ? I.filter(u) : I).then((I) => t != null && t.name ? I.filter(y) : I).catch(() => {
|
|
3923
|
+
L(2, ["%cstorage", c.STORAGE, q.WIDGET_LOAD, t]);
|
|
3903
3924
|
});
|
|
3904
3925
|
return A !== void 0 && L(3, [
|
|
3905
3926
|
"%cstorage%c %cwidgets",
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3927
|
+
c.STORAGE,
|
|
3928
|
+
c.NONE,
|
|
3929
|
+
c.MESSAGES,
|
|
3909
3930
|
t
|
|
3910
3931
|
]), {
|
|
3911
3932
|
// @ts-ignore
|
|
@@ -3931,7 +3952,7 @@ class Br {
|
|
|
3931
3952
|
success: !0
|
|
3932
3953
|
})).catch((s) => (console.error(
|
|
3933
3954
|
"%cstorage",
|
|
3934
|
-
|
|
3955
|
+
c.STORAGE,
|
|
3935
3956
|
_.WIDGET,
|
|
3936
3957
|
t,
|
|
3937
3958
|
s.message
|
|
@@ -3946,19 +3967,19 @@ class Br {
|
|
|
3946
3967
|
* @returns null
|
|
3947
3968
|
*/
|
|
3948
3969
|
b(this, "subscribe", (t) => (t = Ca(t), this.subscribers.filter(
|
|
3949
|
-
(
|
|
3970
|
+
(u) => u.widget === t.widget
|
|
3950
3971
|
).length > 0 || (t.type === _.MESSAGES && (t = At(this.options, t)), console.info(
|
|
3951
3972
|
"%cstorage%c %csubscribe",
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3973
|
+
c.STORAGE,
|
|
3974
|
+
c.NONE,
|
|
3975
|
+
c.SUBSCRIBE,
|
|
3955
3976
|
t.slide,
|
|
3956
3977
|
t.widget
|
|
3957
3978
|
), console.debug(
|
|
3958
3979
|
"%cstorage%c %csubscribe",
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3980
|
+
c.STORAGE,
|
|
3981
|
+
c.NONE,
|
|
3982
|
+
c.SUBSCRIBE,
|
|
3962
3983
|
t
|
|
3963
3984
|
), this.subscribers.push(t)), null));
|
|
3964
3985
|
/**
|
|
@@ -3973,7 +3994,7 @@ class Br {
|
|
|
3973
3994
|
*/
|
|
3974
3995
|
b(this, "getSlide", async (t) => {
|
|
3975
3996
|
const s = await this.db.table(_.SLIDE).where({ id: t.id }).last().catch(() => {
|
|
3976
|
-
L(2, ["%cstorage",
|
|
3997
|
+
L(2, ["%cstorage", c.STORAGE, q.SLIDE_LOAD, t.id]);
|
|
3977
3998
|
});
|
|
3978
3999
|
return {
|
|
3979
4000
|
// @ts-ignore
|
|
@@ -3988,8 +4009,8 @@ class Br {
|
|
|
3988
4009
|
* @returns IResponse
|
|
3989
4010
|
*/
|
|
3990
4011
|
b(this, "getSlides", async (t) => {
|
|
3991
|
-
const s = (I) => t != null && t.id ? t.id = I.id : !1,
|
|
3992
|
-
return A !== void 0 && L(3, ["%cstorage%c %cslides",
|
|
4012
|
+
const s = (I) => t != null && t.id ? t.id = I.id : !1, u = (I) => t != null && t.name ? I.name.includes(t == null ? void 0 : t.name) : !1, A = await this.db.table(_.SLIDE).toArray().then((I) => t != null && t.id ? I.filter(s) : I).then((I) => t != null && t.name ? I.filter(u) : I);
|
|
4013
|
+
return A !== void 0 && L(3, ["%cstorage%c %cslides", c.STORAGE, c.NONE, c.SLIDE, t]), {
|
|
3993
4014
|
// @ts-ignore
|
|
3994
4015
|
data: A !== void 0 ? { slides: A, query: t } : null,
|
|
3995
4016
|
message: A !== void 0 ? "Slides loaded from storage" : "Slides load error",
|
|
@@ -4015,7 +4036,7 @@ class Br {
|
|
|
4015
4036
|
success: !0
|
|
4016
4037
|
})).catch((s) => (console.error(
|
|
4017
4038
|
"%cstorage",
|
|
4018
|
-
|
|
4039
|
+
c.STORAGE,
|
|
4019
4040
|
q.SLIDE_STORE,
|
|
4020
4041
|
t,
|
|
4021
4042
|
s.message
|
|
@@ -4033,7 +4054,7 @@ class Br {
|
|
|
4033
4054
|
const s = await this.db.table(_.PRESENTATION).where({ id: t.id }).last().catch(() => {
|
|
4034
4055
|
console.warn(
|
|
4035
4056
|
"%cstorage ",
|
|
4036
|
-
|
|
4057
|
+
c.STORAGE,
|
|
4037
4058
|
q.PRESENTATION_LOAD,
|
|
4038
4059
|
t.id
|
|
4039
4060
|
);
|
|
@@ -4050,18 +4071,18 @@ class Br {
|
|
|
4050
4071
|
* @returns IResponse
|
|
4051
4072
|
*/
|
|
4052
4073
|
b(this, "getPresentations", async (t) => {
|
|
4053
|
-
const s = (A) => t != null && t.name ? A.name.includes(t == null ? void 0 : t.name) : !1,
|
|
4054
|
-
return
|
|
4074
|
+
const s = (A) => t != null && t.name ? A.name.includes(t == null ? void 0 : t.name) : !1, y = await this.db.table(_.PRESENTATION).toArray().then((A) => t != null && t.name ? A.filter(s) : A);
|
|
4075
|
+
return y !== void 0 && L(3, [
|
|
4055
4076
|
"%cstorage%c %cpresentations",
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4077
|
+
c.STORAGE,
|
|
4078
|
+
c.NONE,
|
|
4079
|
+
c.PRESENTATION,
|
|
4059
4080
|
t
|
|
4060
4081
|
]), {
|
|
4061
4082
|
// @ts-ignore
|
|
4062
|
-
data:
|
|
4063
|
-
message:
|
|
4064
|
-
success:
|
|
4083
|
+
data: y !== void 0 ? { presentations: y, query: t } : null,
|
|
4084
|
+
message: y !== void 0 ? "Presentations loaded from storage" : "Presentations load error",
|
|
4085
|
+
success: y !== void 0
|
|
4065
4086
|
};
|
|
4066
4087
|
});
|
|
4067
4088
|
/**
|
|
@@ -4080,7 +4101,7 @@ class Br {
|
|
|
4080
4101
|
success: !0
|
|
4081
4102
|
})).catch((s) => (console.error(
|
|
4082
4103
|
"%cstorage",
|
|
4083
|
-
|
|
4104
|
+
c.STORAGE,
|
|
4084
4105
|
q.PRESENTATION_STORE,
|
|
4085
4106
|
t,
|
|
4086
4107
|
s.message
|
|
@@ -4098,7 +4119,7 @@ class Br {
|
|
|
4098
4119
|
const s = await this.db.table(_.PREFERENCE).where({ id: t.id }).last().catch(() => {
|
|
4099
4120
|
L(2, [
|
|
4100
4121
|
"%cstorage",
|
|
4101
|
-
|
|
4122
|
+
c.STORAGE,
|
|
4102
4123
|
q.PREFERENCE_LOAD,
|
|
4103
4124
|
t.id
|
|
4104
4125
|
]);
|
|
@@ -4116,18 +4137,18 @@ class Br {
|
|
|
4116
4137
|
* @returns IResponse
|
|
4117
4138
|
*/
|
|
4118
4139
|
b(this, "getPreferences", async (t) => {
|
|
4119
|
-
const s = (A) => t != null && t.id ? t.id = A.id : !1,
|
|
4120
|
-
return
|
|
4140
|
+
const s = (A) => t != null && t.id ? t.id = A.id : !1, y = await this.db.table(_.SLIDE).toArray().then((A) => t != null && t.id ? A.filter(s) : A);
|
|
4141
|
+
return y !== void 0 && L(3, [
|
|
4121
4142
|
"%cstorage%c %cpreferences",
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4143
|
+
c.STORAGE,
|
|
4144
|
+
c.NONE,
|
|
4145
|
+
c.PRESENTATION,
|
|
4125
4146
|
t
|
|
4126
4147
|
]), {
|
|
4127
4148
|
// @ts-ignore
|
|
4128
|
-
data:
|
|
4129
|
-
message:
|
|
4130
|
-
success:
|
|
4149
|
+
data: y !== void 0 ? { prefrences: y, query: t } : null,
|
|
4150
|
+
message: y !== void 0 ? "Preferences loaded from storage" : "Preferences load error",
|
|
4151
|
+
success: y !== void 0
|
|
4131
4152
|
};
|
|
4132
4153
|
});
|
|
4133
4154
|
/**
|
|
@@ -4144,7 +4165,7 @@ class Br {
|
|
|
4144
4165
|
success: !0
|
|
4145
4166
|
})).catch((s) => (console.error(
|
|
4146
4167
|
"%cstorage",
|
|
4147
|
-
|
|
4168
|
+
c.STORAGE,
|
|
4148
4169
|
q.PREFERENCE_STORE,
|
|
4149
4170
|
t,
|
|
4150
4171
|
s.message
|
|
@@ -4178,8 +4199,8 @@ function Zn(d) {
|
|
|
4178
4199
|
function La(d, t) {
|
|
4179
4200
|
const s = indexedDB.open(d);
|
|
4180
4201
|
s.onupgradeneeded = () => s.result.createObjectStore(t);
|
|
4181
|
-
const
|
|
4182
|
-
return (
|
|
4202
|
+
const u = Zn(s);
|
|
4203
|
+
return (y, A) => u.then((I) => A(I.transaction(t, y).objectStore(t)));
|
|
4183
4204
|
}
|
|
4184
4205
|
let Xn;
|
|
4185
4206
|
function Gr() {
|
|
@@ -4189,7 +4210,7 @@ function xe(d, t = Gr()) {
|
|
|
4189
4210
|
return t("readonly", (s) => Zn(s.get(d)));
|
|
4190
4211
|
}
|
|
4191
4212
|
function Be(d, t, s = Gr()) {
|
|
4192
|
-
return s("readwrite", (
|
|
4213
|
+
return s("readwrite", (u) => (u.put(t, d), Zn(u.transaction)));
|
|
4193
4214
|
}
|
|
4194
4215
|
class Kr {
|
|
4195
4216
|
constructor(t) {
|
|
@@ -4197,15 +4218,15 @@ class Kr {
|
|
|
4197
4218
|
b(this, "options");
|
|
4198
4219
|
b(this, "getCloud", async (t) => {
|
|
4199
4220
|
const s = Z(t);
|
|
4200
|
-
return await xe(s).then((
|
|
4221
|
+
return await xe(s).then((u) => u).catch(() => (console.warn("%capi", c.API, _.CLOUD, t.slide, t.widget), { data: null, message: "Cloud Data error", success: !1 }));
|
|
4201
4222
|
});
|
|
4202
4223
|
b(this, "getSeries", async (t) => {
|
|
4203
4224
|
const s = Z(t);
|
|
4204
|
-
return await xe(s).then((
|
|
4225
|
+
return await xe(s).then((u) => u).catch(() => (console.warn("%capi", c.API, _.SERIES, t.slide, t.widget), { data: null, message: "Series Data error", success: !1 }));
|
|
4205
4226
|
});
|
|
4206
4227
|
b(this, "getMessages", async (t) => {
|
|
4207
4228
|
const s = Z(t);
|
|
4208
|
-
return await xe(s).then((
|
|
4229
|
+
return await xe(s).then((u) => u).catch(() => (console.warn("%capi", c.API, _.MESSAGES, t.slide, t.widget), { data: null, message: "Messages Data error", success: !1 }));
|
|
4209
4230
|
});
|
|
4210
4231
|
/**
|
|
4211
4232
|
* Update Cloud
|
|
@@ -4216,13 +4237,13 @@ class Kr {
|
|
|
4216
4237
|
b(this, "setCloud", async (t, s) => {
|
|
4217
4238
|
if (!s.success)
|
|
4218
4239
|
return 400;
|
|
4219
|
-
const
|
|
4220
|
-
return delete s.success, delete s.message, await Be(
|
|
4240
|
+
const u = Z(t);
|
|
4241
|
+
return delete s.success, delete s.message, await Be(u, s).then(() => 201).catch((y) => (console.error(
|
|
4221
4242
|
"%cstorage",
|
|
4222
|
-
|
|
4243
|
+
c.STORAGE,
|
|
4223
4244
|
_.CLOUD,
|
|
4224
4245
|
t,
|
|
4225
|
-
|
|
4246
|
+
y.message
|
|
4226
4247
|
), 400));
|
|
4227
4248
|
});
|
|
4228
4249
|
/**
|
|
@@ -4234,13 +4255,13 @@ class Kr {
|
|
|
4234
4255
|
b(this, "setSeries", async (t, s) => {
|
|
4235
4256
|
if (!s.success)
|
|
4236
4257
|
return 400;
|
|
4237
|
-
const
|
|
4238
|
-
return delete s.success, delete s.message, await Be(
|
|
4258
|
+
const u = Z(t);
|
|
4259
|
+
return delete s.success, delete s.message, await Be(u, s).then(() => 201).catch((y) => (console.error(
|
|
4239
4260
|
"%cstorage",
|
|
4240
|
-
|
|
4261
|
+
c.STORAGE,
|
|
4241
4262
|
_.SERIES,
|
|
4242
4263
|
t,
|
|
4243
|
-
|
|
4264
|
+
y.message
|
|
4244
4265
|
), 400));
|
|
4245
4266
|
});
|
|
4246
4267
|
/**
|
|
@@ -4252,13 +4273,13 @@ class Kr {
|
|
|
4252
4273
|
b(this, "setMessages", async (t, s) => {
|
|
4253
4274
|
if (!s.success)
|
|
4254
4275
|
return 400;
|
|
4255
|
-
const
|
|
4256
|
-
return delete s.success, delete s.message, await Be(
|
|
4276
|
+
const u = Z(t);
|
|
4277
|
+
return delete s.success, delete s.message, await Be(u, s).then(() => 201).catch((y) => (console.error(
|
|
4257
4278
|
"%cstorage",
|
|
4258
|
-
|
|
4279
|
+
c.STORAGE,
|
|
4259
4280
|
_.MESSAGES,
|
|
4260
4281
|
t,
|
|
4261
|
-
|
|
4282
|
+
y.message
|
|
4262
4283
|
), 400));
|
|
4263
4284
|
});
|
|
4264
4285
|
b(this, "cleanMessages", async (t) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0))));
|
|
@@ -4269,9 +4290,9 @@ class Kr {
|
|
|
4269
4290
|
});
|
|
4270
4291
|
b(this, "getDashboard", async (t) => {
|
|
4271
4292
|
const s = Z(t);
|
|
4272
|
-
return await xe(s).then((
|
|
4293
|
+
return await xe(s).then((u) => u).catch((u) => (console.warn("%capi", c.API, _.SLIDE, t.id), {
|
|
4273
4294
|
data: null,
|
|
4274
|
-
message: `Widget ${t.data.id} load error: ${
|
|
4295
|
+
message: `Widget ${t.data.id} load error: ${u.message}`,
|
|
4275
4296
|
success: !1
|
|
4276
4297
|
}));
|
|
4277
4298
|
});
|
|
@@ -4286,35 +4307,35 @@ class Kr {
|
|
|
4286
4307
|
* @returns number
|
|
4287
4308
|
*/
|
|
4288
4309
|
b(this, "setDashboard", async (t) => {
|
|
4289
|
-
const s = Z(t),
|
|
4310
|
+
const s = Z(t), u = {
|
|
4290
4311
|
id: t.dashboard,
|
|
4291
4312
|
name: t.name
|
|
4292
4313
|
};
|
|
4293
|
-
return await Be(s,
|
|
4314
|
+
return await Be(s, u).then(() => ({
|
|
4294
4315
|
data: null,
|
|
4295
4316
|
message: `Dashboard ${t.data.id} saved to storage`,
|
|
4296
4317
|
success: !0
|
|
4297
|
-
})).catch((
|
|
4318
|
+
})).catch((y) => (console.error(
|
|
4298
4319
|
"%cstorage",
|
|
4299
|
-
|
|
4320
|
+
c.STORAGE,
|
|
4300
4321
|
_.WIDGET,
|
|
4301
4322
|
t,
|
|
4302
|
-
|
|
4323
|
+
y.message
|
|
4303
4324
|
), {
|
|
4304
4325
|
data: null,
|
|
4305
|
-
message: `Slide ${t.data.id} save error: ${
|
|
4326
|
+
message: `Slide ${t.data.id} save error: ${y.message}`,
|
|
4306
4327
|
success: !1
|
|
4307
4328
|
}));
|
|
4308
4329
|
});
|
|
4309
4330
|
b(this, "getWidget", async (t) => {
|
|
4310
4331
|
const s = Z(t);
|
|
4311
|
-
return await xe(s).then((
|
|
4332
|
+
return await xe(s).then((u) => u).catch((u) => (console.warn("%capi", c.API, _.SLIDE, t.id), {
|
|
4312
4333
|
data: null,
|
|
4313
|
-
message: `Widget ${t.data.id} load error: ${
|
|
4334
|
+
message: `Widget ${t.data.id} load error: ${u.message}`,
|
|
4314
4335
|
success: !1
|
|
4315
4336
|
}));
|
|
4316
4337
|
});
|
|
4317
|
-
b(this, "getWidgets", async (t) => (console.warn("%capi",
|
|
4338
|
+
b(this, "getWidgets", async (t) => (console.warn("%capi", c.API, _.SLIDE, t == null ? void 0 : t.presentation), {
|
|
4318
4339
|
data: null,
|
|
4319
4340
|
message: "Widgets load error: ",
|
|
4320
4341
|
success: !1
|
|
@@ -4325,25 +4346,25 @@ class Kr {
|
|
|
4325
4346
|
* @returns number
|
|
4326
4347
|
*/
|
|
4327
4348
|
b(this, "setWidget", async (t) => {
|
|
4328
|
-
const s = Z(t),
|
|
4349
|
+
const s = Z(t), u = {
|
|
4329
4350
|
id: t.widget,
|
|
4330
4351
|
name: t.name,
|
|
4331
4352
|
dashboard_id: t.dashboard,
|
|
4332
4353
|
type: t.type
|
|
4333
4354
|
};
|
|
4334
|
-
return await Be(s,
|
|
4355
|
+
return await Be(s, u).then(() => ({
|
|
4335
4356
|
data: null,
|
|
4336
4357
|
message: `Widget ${t.data.id} saved to storage`,
|
|
4337
4358
|
success: !0
|
|
4338
|
-
})).catch((
|
|
4359
|
+
})).catch((y) => (console.error(
|
|
4339
4360
|
"%cstorage",
|
|
4340
|
-
|
|
4361
|
+
c.STORAGE,
|
|
4341
4362
|
_.WIDGET,
|
|
4342
4363
|
t,
|
|
4343
|
-
|
|
4364
|
+
y.message
|
|
4344
4365
|
), {
|
|
4345
4366
|
data: null,
|
|
4346
|
-
message: `Slide ${t.data.id} save error: ${
|
|
4367
|
+
message: `Slide ${t.data.id} save error: ${y.message}`,
|
|
4347
4368
|
success: !1
|
|
4348
4369
|
}));
|
|
4349
4370
|
});
|
|
@@ -4353,12 +4374,12 @@ class Kr {
|
|
|
4353
4374
|
* @returns null
|
|
4354
4375
|
*/
|
|
4355
4376
|
b(this, "subscribe", (t) => (t.type === _.MESSAGES && (t = At(this.options, t)), this.subscribers.filter(
|
|
4356
|
-
(
|
|
4377
|
+
(u) => u.widget === t.widget
|
|
4357
4378
|
).length > 0 || (console.debug(
|
|
4358
4379
|
"%cstorage%c %csubscribe",
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4380
|
+
c.STORAGE,
|
|
4381
|
+
c.NONE,
|
|
4382
|
+
c.SUBSCRIBE,
|
|
4362
4383
|
t.slide,
|
|
4363
4384
|
t.widget
|
|
4364
4385
|
), this.subscribers.push(t)), null));
|
|
@@ -4369,13 +4390,13 @@ class Kr {
|
|
|
4369
4390
|
b(this, "getSubscribers", async () => await new Promise((t) => t(this.subscribers)));
|
|
4370
4391
|
b(this, "getSlide", async (t) => {
|
|
4371
4392
|
const s = Z(t);
|
|
4372
|
-
return await xe(s).then((
|
|
4393
|
+
return await xe(s).then((u) => u).catch((u) => (console.warn("%capi", c.API, _.SLIDE, t.id), {
|
|
4373
4394
|
data: null,
|
|
4374
|
-
message: `Slide ${t.data.id} load error: ${
|
|
4395
|
+
message: `Slide ${t.data.id} load error: ${u.message}`,
|
|
4375
4396
|
success: !1
|
|
4376
4397
|
}));
|
|
4377
4398
|
});
|
|
4378
|
-
b(this, "getSlides", async (t) => (console.warn("%capi",
|
|
4399
|
+
b(this, "getSlides", async (t) => (console.warn("%capi", c.API, _.SLIDE, t.presentation), {
|
|
4379
4400
|
data: null,
|
|
4380
4401
|
message: `Slided ${t.presentation} load error: `,
|
|
4381
4402
|
success: !1
|
|
@@ -4386,33 +4407,33 @@ class Kr {
|
|
|
4386
4407
|
* @returns number
|
|
4387
4408
|
*/
|
|
4388
4409
|
b(this, "setSlide", async (t) => {
|
|
4389
|
-
const s = Z(t),
|
|
4410
|
+
const s = Z(t), u = {
|
|
4390
4411
|
id: t.data.id,
|
|
4391
4412
|
title: t.data.title || "Not set",
|
|
4392
4413
|
json: t.data.json || {},
|
|
4393
4414
|
html: t.data.html || ""
|
|
4394
4415
|
};
|
|
4395
|
-
return await Be(s,
|
|
4416
|
+
return await Be(s, u).then(() => ({
|
|
4396
4417
|
data: null,
|
|
4397
4418
|
message: `Slide ${t.data.id} saved to storage`,
|
|
4398
4419
|
success: !0
|
|
4399
|
-
})).catch((
|
|
4420
|
+
})).catch((y) => (console.error(
|
|
4400
4421
|
"%cstorage",
|
|
4401
|
-
|
|
4422
|
+
c.STORAGE,
|
|
4402
4423
|
_.SLIDE,
|
|
4403
4424
|
t,
|
|
4404
|
-
|
|
4425
|
+
y.message
|
|
4405
4426
|
), {
|
|
4406
4427
|
data: null,
|
|
4407
|
-
message: `Slide ${t.data.id} save error: ${
|
|
4428
|
+
message: `Slide ${t.data.id} save error: ${y.message}`,
|
|
4408
4429
|
success: !1
|
|
4409
4430
|
}));
|
|
4410
4431
|
});
|
|
4411
4432
|
b(this, "getPresentation", async (t) => {
|
|
4412
4433
|
const s = Z(t);
|
|
4413
|
-
return await xe(s).then((
|
|
4434
|
+
return await xe(s).then((u) => u).catch((u) => (console.warn("%capi", c.API, _.PRESENTATION, t.id), {
|
|
4414
4435
|
data: null,
|
|
4415
|
-
message: `Slide ${t.data.id} load error: ${
|
|
4436
|
+
message: `Slide ${t.data.id} load error: ${u.message}`,
|
|
4416
4437
|
success: !1
|
|
4417
4438
|
}));
|
|
4418
4439
|
});
|
|
@@ -4427,29 +4448,29 @@ class Kr {
|
|
|
4427
4448
|
* @returns number
|
|
4428
4449
|
*/
|
|
4429
4450
|
b(this, "setPresentation", async (t) => {
|
|
4430
|
-
const s = Z(t),
|
|
4431
|
-
return await Be(s,
|
|
4451
|
+
const s = Z(t), u = t.data;
|
|
4452
|
+
return await Be(s, u).then(() => ({
|
|
4432
4453
|
data: null,
|
|
4433
4454
|
message: `Presentation ${t.data.id} saved to storage`,
|
|
4434
4455
|
success: !0
|
|
4435
|
-
})).catch((
|
|
4456
|
+
})).catch((y) => (console.error(
|
|
4436
4457
|
"%cstorage",
|
|
4437
|
-
|
|
4458
|
+
c.STORAGE,
|
|
4438
4459
|
_.PRESENTATION,
|
|
4439
4460
|
t,
|
|
4440
|
-
|
|
4461
|
+
y.message
|
|
4441
4462
|
), {
|
|
4442
4463
|
data: null,
|
|
4443
|
-
message: `Presentation ${t.data.id} save error: ${
|
|
4464
|
+
message: `Presentation ${t.data.id} save error: ${y.message}`,
|
|
4444
4465
|
success: !1
|
|
4445
4466
|
}));
|
|
4446
4467
|
});
|
|
4447
|
-
b(this, "getPreference", async (t) => await xe(`${_.PREFERENCE}.${t.id}`).then((s) => s).catch((s) => (console.warn("%capi",
|
|
4468
|
+
b(this, "getPreference", async (t) => await xe(`${_.PREFERENCE}.${t.id}`).then((s) => s).catch((s) => (console.warn("%capi", c.API, _.PREFERENCE, t.id), {
|
|
4448
4469
|
data: null,
|
|
4449
4470
|
message: `Preference ${t.id} get error: ${s.message}`,
|
|
4450
4471
|
success: !1
|
|
4451
4472
|
})));
|
|
4452
|
-
b(this, "getPreferences", async () => await xe(`${_.PREFERENCE}`).then((t) => t).catch((t) => (console.warn("%capi",
|
|
4473
|
+
b(this, "getPreferences", async () => await xe(`${_.PREFERENCE}`).then((t) => t).catch((t) => (console.warn("%capi", c.API, _.PREFERENCE), {
|
|
4453
4474
|
data: null,
|
|
4454
4475
|
message: `Preferences get error: ${t.message}`,
|
|
4455
4476
|
success: !1
|
|
@@ -4465,7 +4486,7 @@ class Kr {
|
|
|
4465
4486
|
success: !0
|
|
4466
4487
|
})).catch((s) => (console.error(
|
|
4467
4488
|
"%cstorage",
|
|
4468
|
-
|
|
4489
|
+
c.STORAGE,
|
|
4469
4490
|
_.PREFERENCE,
|
|
4470
4491
|
t,
|
|
4471
4492
|
s.message
|
|
@@ -4485,14 +4506,14 @@ class Lr {
|
|
|
4485
4506
|
const s = Z(t);
|
|
4486
4507
|
try {
|
|
4487
4508
|
return localStorage.getObject(s);
|
|
4488
|
-
} catch (
|
|
4509
|
+
} catch (u) {
|
|
4489
4510
|
return console.warn(
|
|
4490
4511
|
"%capi",
|
|
4491
|
-
|
|
4512
|
+
c.API,
|
|
4492
4513
|
_.CLOUD,
|
|
4493
4514
|
t.slide,
|
|
4494
4515
|
t.widget,
|
|
4495
|
-
|
|
4516
|
+
u
|
|
4496
4517
|
), { data: null, message: "Messages Data error", success: !1 };
|
|
4497
4518
|
}
|
|
4498
4519
|
});
|
|
@@ -4500,14 +4521,14 @@ class Lr {
|
|
|
4500
4521
|
const s = Z(t);
|
|
4501
4522
|
try {
|
|
4502
4523
|
return localStorage.getObject(s);
|
|
4503
|
-
} catch (
|
|
4524
|
+
} catch (u) {
|
|
4504
4525
|
return console.warn(
|
|
4505
4526
|
"%capi",
|
|
4506
|
-
|
|
4527
|
+
c.API,
|
|
4507
4528
|
_.SERIES,
|
|
4508
4529
|
t.slide,
|
|
4509
4530
|
t.widget,
|
|
4510
|
-
|
|
4531
|
+
u
|
|
4511
4532
|
), { data: null, message: "Messages Data error", success: !1 };
|
|
4512
4533
|
}
|
|
4513
4534
|
});
|
|
@@ -4515,14 +4536,14 @@ class Lr {
|
|
|
4515
4536
|
const s = Z(t);
|
|
4516
4537
|
try {
|
|
4517
4538
|
return localStorage.getObject(s);
|
|
4518
|
-
} catch (
|
|
4539
|
+
} catch (u) {
|
|
4519
4540
|
return console.warn(
|
|
4520
4541
|
"%capi",
|
|
4521
|
-
|
|
4542
|
+
c.API,
|
|
4522
4543
|
_.MESSAGES,
|
|
4523
4544
|
t.slide,
|
|
4524
4545
|
t.widget,
|
|
4525
|
-
|
|
4546
|
+
u
|
|
4526
4547
|
), { data: null, message: "Messages Data error", success: !1 };
|
|
4527
4548
|
}
|
|
4528
4549
|
});
|
|
@@ -4533,11 +4554,11 @@ class Lr {
|
|
|
4533
4554
|
* @returns number
|
|
4534
4555
|
*/
|
|
4535
4556
|
b(this, "setCloud", async (t, s) => {
|
|
4536
|
-
const
|
|
4557
|
+
const u = Z(t);
|
|
4537
4558
|
try {
|
|
4538
|
-
return localStorage.setObject(
|
|
4539
|
-
} catch (
|
|
4540
|
-
return console.error("%cstorage",
|
|
4559
|
+
return localStorage.setObject(u, s), 201;
|
|
4560
|
+
} catch (y) {
|
|
4561
|
+
return console.error("%cstorage", c.STORAGE, _.CLOUD, t, y), 400;
|
|
4541
4562
|
}
|
|
4542
4563
|
});
|
|
4543
4564
|
/**
|
|
@@ -4547,11 +4568,11 @@ class Lr {
|
|
|
4547
4568
|
* @returns number
|
|
4548
4569
|
*/
|
|
4549
4570
|
b(this, "setSeries", async (t, s) => {
|
|
4550
|
-
const
|
|
4571
|
+
const u = Z(t);
|
|
4551
4572
|
try {
|
|
4552
|
-
return localStorage.setObject(
|
|
4553
|
-
} catch (
|
|
4554
|
-
return console.error("%cstorage",
|
|
4573
|
+
return localStorage.setObject(u, s), 201;
|
|
4574
|
+
} catch (y) {
|
|
4575
|
+
return console.error("%cstorage", c.STORAGE, _.SERIES, t, y), 400;
|
|
4555
4576
|
}
|
|
4556
4577
|
});
|
|
4557
4578
|
/**
|
|
@@ -4561,11 +4582,11 @@ class Lr {
|
|
|
4561
4582
|
* @returns number
|
|
4562
4583
|
*/
|
|
4563
4584
|
b(this, "setMessages", async (t, s) => {
|
|
4564
|
-
const
|
|
4585
|
+
const u = Z(t);
|
|
4565
4586
|
try {
|
|
4566
|
-
return localStorage.setObject(
|
|
4567
|
-
} catch (
|
|
4568
|
-
return console.error("%cstorage",
|
|
4587
|
+
return localStorage.setObject(u, s), 200;
|
|
4588
|
+
} catch (y) {
|
|
4589
|
+
return console.error("%cstorage", c.STORAGE, _.MESSAGES, t, y), 400;
|
|
4569
4590
|
}
|
|
4570
4591
|
});
|
|
4571
4592
|
b(this, "cleanMessages", async (t) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0))));
|
|
@@ -4578,7 +4599,7 @@ class Lr {
|
|
|
4578
4599
|
try {
|
|
4579
4600
|
return localStorage.getObject(`${_.DASHBOARD}.${t.id}`);
|
|
4580
4601
|
} catch (s) {
|
|
4581
|
-
return console.warn("%capi",
|
|
4602
|
+
return console.warn("%capi", c.API, _.SLIDE, t.id, s), {
|
|
4582
4603
|
data: null,
|
|
4583
4604
|
message: `Dashboard ${t.id} load error: ${s.message}`,
|
|
4584
4605
|
success: !1
|
|
@@ -4598,10 +4619,10 @@ class Lr {
|
|
|
4598
4619
|
message: `Dashboard ${t.data.id} saved to storage`,
|
|
4599
4620
|
success: !0
|
|
4600
4621
|
};
|
|
4601
|
-
} catch (
|
|
4602
|
-
return console.error("%cstorage",
|
|
4622
|
+
} catch (u) {
|
|
4623
|
+
return console.error("%cstorage", c.STORAGE, _.WIDGET, t, u), {
|
|
4603
4624
|
data: null,
|
|
4604
|
-
message: `Dashboard ${t.data.id} save error: ${
|
|
4625
|
+
message: `Dashboard ${t.data.id} save error: ${u.message}`,
|
|
4605
4626
|
success: !1
|
|
4606
4627
|
};
|
|
4607
4628
|
}
|
|
@@ -4610,7 +4631,7 @@ class Lr {
|
|
|
4610
4631
|
try {
|
|
4611
4632
|
return localStorage.getObject(`${_.WIDGET}.${t.id}`);
|
|
4612
4633
|
} catch (s) {
|
|
4613
|
-
return console.warn("%capi",
|
|
4634
|
+
return console.warn("%capi", c.API, _.SLIDE, t.id, s), {
|
|
4614
4635
|
data: null,
|
|
4615
4636
|
message: `Widget ${t.id} load error: ${s.message}`,
|
|
4616
4637
|
success: !1
|
|
@@ -4630,10 +4651,10 @@ class Lr {
|
|
|
4630
4651
|
message: `Widget ${t.data.id} saved to storage`,
|
|
4631
4652
|
success: !0
|
|
4632
4653
|
};
|
|
4633
|
-
} catch (
|
|
4634
|
-
return console.error("%cstorage",
|
|
4654
|
+
} catch (u) {
|
|
4655
|
+
return console.error("%cstorage", c.STORAGE, _.WIDGET, t, u), {
|
|
4635
4656
|
data: null,
|
|
4636
|
-
message: `Widget ${t.data.id} save error: ${
|
|
4657
|
+
message: `Widget ${t.data.id} save error: ${u.message}`,
|
|
4637
4658
|
success: !1
|
|
4638
4659
|
};
|
|
4639
4660
|
}
|
|
@@ -4644,12 +4665,12 @@ class Lr {
|
|
|
4644
4665
|
* @returns null
|
|
4645
4666
|
*/
|
|
4646
4667
|
b(this, "subscribe", (t) => (t.type === _.MESSAGES && (t = At(this.options, t)), this.subscribers.filter(
|
|
4647
|
-
(
|
|
4668
|
+
(u) => u.widget === t.widget
|
|
4648
4669
|
).length || (console.debug(
|
|
4649
4670
|
"%cstorage%c %csubscribe",
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4671
|
+
c.STORAGE,
|
|
4672
|
+
c.NONE,
|
|
4673
|
+
c.SUBSCRIBE,
|
|
4653
4674
|
t.slide,
|
|
4654
4675
|
t.widget
|
|
4655
4676
|
), this.subscribers.push(t)), null));
|
|
@@ -4662,7 +4683,7 @@ class Lr {
|
|
|
4662
4683
|
try {
|
|
4663
4684
|
return localStorage.getObject(`${_.SLIDE}.${t.id}`);
|
|
4664
4685
|
} catch (s) {
|
|
4665
|
-
return console.warn("%capi",
|
|
4686
|
+
return console.warn("%capi", c.API, _.SLIDE, t.id, s), {
|
|
4666
4687
|
data: null,
|
|
4667
4688
|
message: `Slide ${t.id} load error: ${s.message}`,
|
|
4668
4689
|
success: !1
|
|
@@ -4673,7 +4694,7 @@ class Lr {
|
|
|
4673
4694
|
try {
|
|
4674
4695
|
return localStorage.getObject(`${_.SLIDE}.${t.id}`);
|
|
4675
4696
|
} catch (s) {
|
|
4676
|
-
return console.warn("%capi",
|
|
4697
|
+
return console.warn("%capi", c.API, _.SLIDE, t.id, s), {
|
|
4677
4698
|
data: null,
|
|
4678
4699
|
message: `Slide ${t.id} load error: ${s.message}`,
|
|
4679
4700
|
success: !1
|
|
@@ -4693,7 +4714,7 @@ class Lr {
|
|
|
4693
4714
|
success: !0
|
|
4694
4715
|
};
|
|
4695
4716
|
} catch (s) {
|
|
4696
|
-
return console.error("%cstorage",
|
|
4717
|
+
return console.error("%cstorage", c.STORAGE, _.SLIDE, t, s), {
|
|
4697
4718
|
data: null,
|
|
4698
4719
|
message: `Slide ${t.data.id} save error: ${s.message}`,
|
|
4699
4720
|
success: !1
|
|
@@ -4704,7 +4725,7 @@ class Lr {
|
|
|
4704
4725
|
try {
|
|
4705
4726
|
return localStorage.getObject(`${_.PRESENTATION}.${t.presentation}`);
|
|
4706
4727
|
} catch (s) {
|
|
4707
|
-
return console.warn("%capi",
|
|
4728
|
+
return console.warn("%capi", c.API, _.PRESENTATION, t.presentation, s), {
|
|
4708
4729
|
data: null,
|
|
4709
4730
|
message: `Presentations ${t.id} load error: ${s.message}`,
|
|
4710
4731
|
success: !1
|
|
@@ -4715,7 +4736,7 @@ class Lr {
|
|
|
4715
4736
|
try {
|
|
4716
4737
|
return localStorage.getObject(`${_.PRESENTATION}.`);
|
|
4717
4738
|
} catch (t) {
|
|
4718
|
-
return console.warn("%capi",
|
|
4739
|
+
return console.warn("%capi", c.API, _.PRESENTATION, t), {
|
|
4719
4740
|
data: null,
|
|
4720
4741
|
message: `Presentations get error: ${t.message}`,
|
|
4721
4742
|
success: !1
|
|
@@ -4730,7 +4751,7 @@ class Lr {
|
|
|
4730
4751
|
success: !0
|
|
4731
4752
|
};
|
|
4732
4753
|
} catch (s) {
|
|
4733
|
-
return console.error("%cstorage",
|
|
4754
|
+
return console.error("%cstorage", c.STORAGE, _.PRESENTATION, t, s), {
|
|
4734
4755
|
data: null,
|
|
4735
4756
|
message: `Presentation ${t.data.id} save error: ${s.message}`,
|
|
4736
4757
|
success: !1
|
|
@@ -4741,7 +4762,7 @@ class Lr {
|
|
|
4741
4762
|
try {
|
|
4742
4763
|
return localStorage.getObject(`${_.PREFERENCE}.${t.id}`);
|
|
4743
4764
|
} catch (s) {
|
|
4744
|
-
return console.warn("%capi",
|
|
4765
|
+
return console.warn("%capi", c.API, _.PREFERENCE, t.id, s), {
|
|
4745
4766
|
data: null,
|
|
4746
4767
|
message: `Preference ${t.id} load error: ${s.message}`,
|
|
4747
4768
|
success: !1
|
|
@@ -4752,7 +4773,7 @@ class Lr {
|
|
|
4752
4773
|
try {
|
|
4753
4774
|
return localStorage.getObject(`${_.PREFERENCE}.`);
|
|
4754
4775
|
} catch (t) {
|
|
4755
|
-
return console.warn("%capi",
|
|
4776
|
+
return console.warn("%capi", c.API, _.PREFERENCE, t), {
|
|
4756
4777
|
data: null,
|
|
4757
4778
|
message: `Preference get error: ${t.message}`,
|
|
4758
4779
|
success: !1
|
|
@@ -4772,7 +4793,7 @@ class Lr {
|
|
|
4772
4793
|
} catch (s) {
|
|
4773
4794
|
return console.error(
|
|
4774
4795
|
"%cstorage",
|
|
4775
|
-
|
|
4796
|
+
c.STORAGE,
|
|
4776
4797
|
_.PREFERENCE,
|
|
4777
4798
|
t,
|
|
4778
4799
|
s
|
|
@@ -4783,11 +4804,11 @@ class Lr {
|
|
|
4783
4804
|
};
|
|
4784
4805
|
}
|
|
4785
4806
|
});
|
|
4786
|
-
this.options = t, Storage.prototype.setObject = function(s,
|
|
4787
|
-
this.setObject(s, JSON.stringify(
|
|
4807
|
+
this.options = t, Storage.prototype.setObject = function(s, u) {
|
|
4808
|
+
this.setObject(s, JSON.stringify(u));
|
|
4788
4809
|
}, Storage.prototype.getObject = function(s) {
|
|
4789
|
-
const
|
|
4790
|
-
return
|
|
4810
|
+
const u = this.getObject(s);
|
|
4811
|
+
return u && JSON.parse(u);
|
|
4791
4812
|
};
|
|
4792
4813
|
}
|
|
4793
4814
|
}
|
|
@@ -4799,14 +4820,14 @@ class Fr {
|
|
|
4799
4820
|
const s = Z(t);
|
|
4800
4821
|
try {
|
|
4801
4822
|
return sessionStorage.getObject(s);
|
|
4802
|
-
} catch (
|
|
4823
|
+
} catch (u) {
|
|
4803
4824
|
return console.warn(
|
|
4804
4825
|
"%capi",
|
|
4805
|
-
|
|
4826
|
+
c.API,
|
|
4806
4827
|
_.CLOUD,
|
|
4807
4828
|
t.slide,
|
|
4808
4829
|
t.widget,
|
|
4809
|
-
|
|
4830
|
+
u
|
|
4810
4831
|
), { data: null, message: "Messages Data error", success: !1 };
|
|
4811
4832
|
}
|
|
4812
4833
|
});
|
|
@@ -4814,14 +4835,14 @@ class Fr {
|
|
|
4814
4835
|
const s = Z(t);
|
|
4815
4836
|
try {
|
|
4816
4837
|
return sessionStorage.getObject(s);
|
|
4817
|
-
} catch (
|
|
4838
|
+
} catch (u) {
|
|
4818
4839
|
return console.warn(
|
|
4819
4840
|
"%capi",
|
|
4820
|
-
|
|
4841
|
+
c.API,
|
|
4821
4842
|
_.SERIES,
|
|
4822
4843
|
t.slide,
|
|
4823
4844
|
t.widget,
|
|
4824
|
-
|
|
4845
|
+
u
|
|
4825
4846
|
), { data: null, message: "Messages Data error", success: !1 };
|
|
4826
4847
|
}
|
|
4827
4848
|
});
|
|
@@ -4829,14 +4850,14 @@ class Fr {
|
|
|
4829
4850
|
const s = Z(t);
|
|
4830
4851
|
try {
|
|
4831
4852
|
return sessionStorage.getObject(s);
|
|
4832
|
-
} catch (
|
|
4853
|
+
} catch (u) {
|
|
4833
4854
|
return console.warn(
|
|
4834
4855
|
"%capi",
|
|
4835
|
-
|
|
4856
|
+
c.API,
|
|
4836
4857
|
_.MESSAGES,
|
|
4837
4858
|
t.slide,
|
|
4838
4859
|
t.widget,
|
|
4839
|
-
|
|
4860
|
+
u
|
|
4840
4861
|
), { data: null, message: "Messages Data error", success: !1 };
|
|
4841
4862
|
}
|
|
4842
4863
|
});
|
|
@@ -4847,11 +4868,11 @@ class Fr {
|
|
|
4847
4868
|
* @returns number
|
|
4848
4869
|
*/
|
|
4849
4870
|
b(this, "setCloud", async (t, s) => {
|
|
4850
|
-
const
|
|
4871
|
+
const u = Z(t);
|
|
4851
4872
|
try {
|
|
4852
|
-
return sessionStorage.setObject(
|
|
4853
|
-
} catch (
|
|
4854
|
-
return console.error("%cstorage",
|
|
4873
|
+
return sessionStorage.setObject(u, s), 201;
|
|
4874
|
+
} catch (y) {
|
|
4875
|
+
return console.error("%cstorage", c.STORAGE, _.CLOUD, t, y), 400;
|
|
4855
4876
|
}
|
|
4856
4877
|
});
|
|
4857
4878
|
/**
|
|
@@ -4861,11 +4882,11 @@ class Fr {
|
|
|
4861
4882
|
* @returns number
|
|
4862
4883
|
*/
|
|
4863
4884
|
b(this, "setSeries", async (t, s) => {
|
|
4864
|
-
const
|
|
4885
|
+
const u = Z(t);
|
|
4865
4886
|
try {
|
|
4866
|
-
return sessionStorage.setObject(
|
|
4867
|
-
} catch (
|
|
4868
|
-
return console.error("%cstorage",
|
|
4887
|
+
return sessionStorage.setObject(u, s), 201;
|
|
4888
|
+
} catch (y) {
|
|
4889
|
+
return console.error("%cstorage", c.STORAGE, _.SERIES, t, y), 400;
|
|
4869
4890
|
}
|
|
4870
4891
|
});
|
|
4871
4892
|
/**
|
|
@@ -4875,11 +4896,11 @@ class Fr {
|
|
|
4875
4896
|
* @returns number
|
|
4876
4897
|
*/
|
|
4877
4898
|
b(this, "setMessages", async (t, s) => {
|
|
4878
|
-
const
|
|
4899
|
+
const u = Z(t);
|
|
4879
4900
|
try {
|
|
4880
|
-
return sessionStorage.setObject(
|
|
4881
|
-
} catch (
|
|
4882
|
-
return console.error("%cstorage",
|
|
4901
|
+
return sessionStorage.setObject(u, s), 200;
|
|
4902
|
+
} catch (y) {
|
|
4903
|
+
return console.error("%cstorage", c.STORAGE, _.MESSAGES, t, y), 400;
|
|
4883
4904
|
}
|
|
4884
4905
|
});
|
|
4885
4906
|
b(this, "cleanMessages", async (t) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0))));
|
|
@@ -4892,7 +4913,7 @@ class Fr {
|
|
|
4892
4913
|
try {
|
|
4893
4914
|
return sessionStorage.getObject(`${_.DASHBOARD}.${t.id}`);
|
|
4894
4915
|
} catch (s) {
|
|
4895
|
-
return console.warn("%capi",
|
|
4916
|
+
return console.warn("%capi", c.API, _.SLIDE, t.id, s), {
|
|
4896
4917
|
data: null,
|
|
4897
4918
|
message: `Dashboard ${t.id} load error: ${s.message}`,
|
|
4898
4919
|
success: !1
|
|
@@ -4912,10 +4933,10 @@ class Fr {
|
|
|
4912
4933
|
message: `Dashboard ${t.data.id} saved to storage`,
|
|
4913
4934
|
success: !0
|
|
4914
4935
|
};
|
|
4915
|
-
} catch (
|
|
4916
|
-
return console.error("%cstorage",
|
|
4936
|
+
} catch (u) {
|
|
4937
|
+
return console.error("%cstorage", c.STORAGE, _.WIDGET, t, u), {
|
|
4917
4938
|
data: null,
|
|
4918
|
-
message: `Dashboard ${t.data.id} save error: ${
|
|
4939
|
+
message: `Dashboard ${t.data.id} save error: ${u.message}`,
|
|
4919
4940
|
success: !1
|
|
4920
4941
|
};
|
|
4921
4942
|
}
|
|
@@ -4924,7 +4945,7 @@ class Fr {
|
|
|
4924
4945
|
try {
|
|
4925
4946
|
return sessionStorage.getObject(`${_.WIDGET}.${t.id}`);
|
|
4926
4947
|
} catch (s) {
|
|
4927
|
-
return console.warn("%capi",
|
|
4948
|
+
return console.warn("%capi", c.API, _.SLIDE, t.id, s), {
|
|
4928
4949
|
data: null,
|
|
4929
4950
|
message: `Widget ${t.id} load error: ${s.message}`,
|
|
4930
4951
|
success: !1
|
|
@@ -4944,10 +4965,10 @@ class Fr {
|
|
|
4944
4965
|
message: `Widget ${t.data.id} saved to storage`,
|
|
4945
4966
|
success: !0
|
|
4946
4967
|
};
|
|
4947
|
-
} catch (
|
|
4948
|
-
return console.error("%cstorage",
|
|
4968
|
+
} catch (u) {
|
|
4969
|
+
return console.error("%cstorage", c.STORAGE, _.WIDGET, t, u), {
|
|
4949
4970
|
data: null,
|
|
4950
|
-
message: `Slide ${t.data.id} save error: ${
|
|
4971
|
+
message: `Slide ${t.data.id} save error: ${u.message}`,
|
|
4951
4972
|
success: !1
|
|
4952
4973
|
};
|
|
4953
4974
|
}
|
|
@@ -4958,12 +4979,12 @@ class Fr {
|
|
|
4958
4979
|
* @returns null
|
|
4959
4980
|
*/
|
|
4960
4981
|
b(this, "subscribe", (t) => (t.type === _.MESSAGES && (t = At(this.options, t)), this.subscribers.filter(
|
|
4961
|
-
(
|
|
4982
|
+
(u) => u.widget === t.widget
|
|
4962
4983
|
).length || (console.debug(
|
|
4963
4984
|
"%cstorage%c %csubscribe",
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4985
|
+
c.STORAGE,
|
|
4986
|
+
c.NONE,
|
|
4987
|
+
c.SUBSCRIBE,
|
|
4967
4988
|
t.slide,
|
|
4968
4989
|
t.widget
|
|
4969
4990
|
), this.subscribers.push(t)), null));
|
|
@@ -4976,7 +4997,7 @@ class Fr {
|
|
|
4976
4997
|
try {
|
|
4977
4998
|
return sessionStorage.getObject(`${_.SLIDE}.${t.id}`);
|
|
4978
4999
|
} catch (s) {
|
|
4979
|
-
return console.warn("%capi",
|
|
5000
|
+
return console.warn("%capi", c.API, _.SLIDE, t.id, s), {
|
|
4980
5001
|
data: null,
|
|
4981
5002
|
message: `Slide ${t.id} load error: ${s.message}`,
|
|
4982
5003
|
success: !1
|
|
@@ -4987,7 +5008,7 @@ class Fr {
|
|
|
4987
5008
|
try {
|
|
4988
5009
|
return sessionStorage.getObject(`${_.SLIDE}.${t.id}`);
|
|
4989
5010
|
} catch (s) {
|
|
4990
|
-
return console.warn("%capi",
|
|
5011
|
+
return console.warn("%capi", c.API, _.SLIDE, t.id, s), {
|
|
4991
5012
|
data: null,
|
|
4992
5013
|
message: `Slide ${t.id} load error: ${s.message}`,
|
|
4993
5014
|
success: !1
|
|
@@ -5012,7 +5033,7 @@ class Fr {
|
|
|
5012
5033
|
success: !0
|
|
5013
5034
|
};
|
|
5014
5035
|
} catch (s) {
|
|
5015
|
-
return console.error("%cstorage",
|
|
5036
|
+
return console.error("%cstorage", c.STORAGE, _.SLIDE, t, s), {
|
|
5016
5037
|
data: null,
|
|
5017
5038
|
message: `Slide ${t.data.id} save error: ${s.message}`,
|
|
5018
5039
|
success: !1
|
|
@@ -5023,7 +5044,7 @@ class Fr {
|
|
|
5023
5044
|
try {
|
|
5024
5045
|
return sessionStorage.getObject(`${_.PRESENTATION}.${t.presentation}`);
|
|
5025
5046
|
} catch (s) {
|
|
5026
|
-
return console.warn("%capi",
|
|
5047
|
+
return console.warn("%capi", c.API, _.PRESENTATION, t.presentation, s), {
|
|
5027
5048
|
data: null,
|
|
5028
5049
|
message: `Presentation ${t.presentation} load error: ${s.message}`,
|
|
5029
5050
|
success: !1
|
|
@@ -5034,7 +5055,7 @@ class Fr {
|
|
|
5034
5055
|
try {
|
|
5035
5056
|
return sessionStorage.getObject(`${_.PRESENTATION}.`);
|
|
5036
5057
|
} catch (t) {
|
|
5037
|
-
return console.warn("%capi",
|
|
5058
|
+
return console.warn("%capi", c.API, _.PRESENTATION, t), {
|
|
5038
5059
|
data: null,
|
|
5039
5060
|
message: `Presentations get error: ${t.message}`,
|
|
5040
5061
|
success: !1
|
|
@@ -5049,7 +5070,7 @@ class Fr {
|
|
|
5049
5070
|
success: !0
|
|
5050
5071
|
};
|
|
5051
5072
|
} catch (s) {
|
|
5052
|
-
return console.error("%cstorage",
|
|
5073
|
+
return console.error("%cstorage", c.STORAGE, _.PRESENTATION, t, s), {
|
|
5053
5074
|
data: null,
|
|
5054
5075
|
message: `Presentation ${t.data.id} save error: ${s.message}`,
|
|
5055
5076
|
success: !1
|
|
@@ -5060,7 +5081,7 @@ class Fr {
|
|
|
5060
5081
|
try {
|
|
5061
5082
|
return sessionStorage.getObject(`${_.PREFERENCE}.${t.id}`);
|
|
5062
5083
|
} catch (s) {
|
|
5063
|
-
return console.warn("%capi",
|
|
5084
|
+
return console.warn("%capi", c.API, _.PREFERENCE, t.id, s), {
|
|
5064
5085
|
data: null,
|
|
5065
5086
|
message: `Preference ${t.id} load error: ${s.message}`,
|
|
5066
5087
|
success: !1
|
|
@@ -5071,7 +5092,7 @@ class Fr {
|
|
|
5071
5092
|
try {
|
|
5072
5093
|
return sessionStorage.getObject(`${_.PREFERENCE}`);
|
|
5073
5094
|
} catch (t) {
|
|
5074
|
-
return console.warn("%capi",
|
|
5095
|
+
return console.warn("%capi", c.API, _.PREFERENCE, t), {
|
|
5075
5096
|
data: null,
|
|
5076
5097
|
message: `Preferences get error: ${t.message}`,
|
|
5077
5098
|
success: !1
|
|
@@ -5091,7 +5112,7 @@ class Fr {
|
|
|
5091
5112
|
} catch (s) {
|
|
5092
5113
|
return console.error(
|
|
5093
5114
|
"%cstorage",
|
|
5094
|
-
|
|
5115
|
+
c.STORAGE,
|
|
5095
5116
|
_.PREFERENCE,
|
|
5096
5117
|
t,
|
|
5097
5118
|
s
|
|
@@ -5102,11 +5123,11 @@ class Fr {
|
|
|
5102
5123
|
};
|
|
5103
5124
|
}
|
|
5104
5125
|
});
|
|
5105
|
-
this.options = t, Storage.prototype.setObject = function(s,
|
|
5106
|
-
this.setItem(s, JSON.stringify(
|
|
5126
|
+
this.options = t, Storage.prototype.setObject = function(s, u) {
|
|
5127
|
+
this.setItem(s, JSON.stringify(u));
|
|
5107
5128
|
}, Storage.prototype.getObject = function(s) {
|
|
5108
|
-
const
|
|
5109
|
-
return
|
|
5129
|
+
const u = this.getItem(s);
|
|
5130
|
+
return u && JSON.parse(u);
|
|
5110
5131
|
};
|
|
5111
5132
|
}
|
|
5112
5133
|
}
|
|
@@ -5118,14 +5139,14 @@ class Wr {
|
|
|
5118
5139
|
const s = Z(t);
|
|
5119
5140
|
try {
|
|
5120
5141
|
return window.BuzzCasting.WidgetData[s];
|
|
5121
|
-
} catch (
|
|
5142
|
+
} catch (u) {
|
|
5122
5143
|
return console.warn(
|
|
5123
5144
|
"%capi",
|
|
5124
|
-
|
|
5145
|
+
c.API,
|
|
5125
5146
|
_.CLOUD,
|
|
5126
5147
|
t.slide,
|
|
5127
5148
|
t.widget,
|
|
5128
|
-
|
|
5149
|
+
u
|
|
5129
5150
|
), { data: null, message: "Cloud Data error", success: !1 };
|
|
5130
5151
|
}
|
|
5131
5152
|
});
|
|
@@ -5133,14 +5154,14 @@ class Wr {
|
|
|
5133
5154
|
const s = Z(t);
|
|
5134
5155
|
try {
|
|
5135
5156
|
return window.BuzzCasting.WidgetData[s];
|
|
5136
|
-
} catch (
|
|
5157
|
+
} catch (u) {
|
|
5137
5158
|
return console.warn(
|
|
5138
5159
|
"%capi",
|
|
5139
|
-
|
|
5160
|
+
c.API,
|
|
5140
5161
|
_.SERIES,
|
|
5141
5162
|
t.slide,
|
|
5142
5163
|
t.widget,
|
|
5143
|
-
|
|
5164
|
+
u
|
|
5144
5165
|
), { data: null, message: "Series Data error", success: !1 };
|
|
5145
5166
|
}
|
|
5146
5167
|
});
|
|
@@ -5148,14 +5169,14 @@ class Wr {
|
|
|
5148
5169
|
const s = Z(t);
|
|
5149
5170
|
try {
|
|
5150
5171
|
return window.BuzzCasting.WidgetData[s];
|
|
5151
|
-
} catch (
|
|
5172
|
+
} catch (u) {
|
|
5152
5173
|
return console.warn(
|
|
5153
5174
|
"%capi",
|
|
5154
|
-
|
|
5175
|
+
c.API,
|
|
5155
5176
|
_.MESSAGES,
|
|
5156
5177
|
t.slide,
|
|
5157
5178
|
t.widget,
|
|
5158
|
-
|
|
5179
|
+
u
|
|
5159
5180
|
), { data: null, message: "Messages Data error", success: !1 };
|
|
5160
5181
|
}
|
|
5161
5182
|
});
|
|
@@ -5166,11 +5187,11 @@ class Wr {
|
|
|
5166
5187
|
* @returns number
|
|
5167
5188
|
*/
|
|
5168
5189
|
b(this, "setCloud", async (t, s) => {
|
|
5169
|
-
const
|
|
5190
|
+
const u = Z(t);
|
|
5170
5191
|
try {
|
|
5171
|
-
return window.BuzzCasting.WidgetData[
|
|
5172
|
-
} catch (
|
|
5173
|
-
return console.error("%cstorage",
|
|
5192
|
+
return window.BuzzCasting.WidgetData[u] = s, 201;
|
|
5193
|
+
} catch (y) {
|
|
5194
|
+
return console.error("%cstorage", c.STORAGE, "set", t, y), 400;
|
|
5174
5195
|
}
|
|
5175
5196
|
});
|
|
5176
5197
|
/**
|
|
@@ -5180,11 +5201,11 @@ class Wr {
|
|
|
5180
5201
|
* @returns number
|
|
5181
5202
|
*/
|
|
5182
5203
|
b(this, "setSeries", async (t, s) => {
|
|
5183
|
-
const
|
|
5204
|
+
const u = Z(t);
|
|
5184
5205
|
try {
|
|
5185
|
-
return window.BuzzCasting.WidgetData[
|
|
5186
|
-
} catch (
|
|
5187
|
-
return console.error("%cstorage",
|
|
5206
|
+
return window.BuzzCasting.WidgetData[u] = s, 201;
|
|
5207
|
+
} catch (y) {
|
|
5208
|
+
return console.error("%cstorage", c.STORAGE, "set", t, y), 400;
|
|
5188
5209
|
}
|
|
5189
5210
|
});
|
|
5190
5211
|
/**
|
|
@@ -5194,11 +5215,11 @@ class Wr {
|
|
|
5194
5215
|
* @returns number
|
|
5195
5216
|
*/
|
|
5196
5217
|
b(this, "setMessages", async (t, s) => {
|
|
5197
|
-
const
|
|
5218
|
+
const u = Z(t);
|
|
5198
5219
|
try {
|
|
5199
|
-
return window.BuzzCasting.WidgetData[
|
|
5200
|
-
} catch (
|
|
5201
|
-
return console.error("%cstorage",
|
|
5220
|
+
return window.BuzzCasting.WidgetData[u] = s, 201;
|
|
5221
|
+
} catch (y) {
|
|
5222
|
+
return console.error("%cstorage", c.STORAGE, "set", t, y), 400;
|
|
5202
5223
|
}
|
|
5203
5224
|
});
|
|
5204
5225
|
b(this, "cleanMessages", async (t) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((s) => s(0))));
|
|
@@ -5211,7 +5232,7 @@ class Wr {
|
|
|
5211
5232
|
try {
|
|
5212
5233
|
return window.BuzzCasting.DashboardData[t.id];
|
|
5213
5234
|
} catch (s) {
|
|
5214
|
-
return console.warn("%capi",
|
|
5235
|
+
return console.warn("%capi", c.API, _.DASHBOARD, t.id, s), {
|
|
5215
5236
|
data: null,
|
|
5216
5237
|
message: `Dashboard ${t.id} load error: ${s.message}`,
|
|
5217
5238
|
success: !1
|
|
@@ -5231,10 +5252,10 @@ class Wr {
|
|
|
5231
5252
|
message: `Dashboard ${t.data.id} saved to storage`,
|
|
5232
5253
|
success: !0
|
|
5233
5254
|
};
|
|
5234
|
-
} catch (
|
|
5235
|
-
return console.error("%cstorage",
|
|
5255
|
+
} catch (u) {
|
|
5256
|
+
return console.error("%cstorage", c.STORAGE, _.DASHBOARD, t, u), {
|
|
5236
5257
|
data: null,
|
|
5237
|
-
message: `Dashboard ${t.data.id} save error: ${
|
|
5258
|
+
message: `Dashboard ${t.data.id} save error: ${u.message}`,
|
|
5238
5259
|
success: !1
|
|
5239
5260
|
};
|
|
5240
5261
|
}
|
|
@@ -5243,7 +5264,7 @@ class Wr {
|
|
|
5243
5264
|
try {
|
|
5244
5265
|
return window.BuzzCasting.WidgetData[t.id];
|
|
5245
5266
|
} catch (s) {
|
|
5246
|
-
return console.warn("%capi",
|
|
5267
|
+
return console.warn("%capi", c.API, _.WIDGET, t.id, s), {
|
|
5247
5268
|
data: null,
|
|
5248
5269
|
message: `Widget ${t.id} load error: ${s.message}`,
|
|
5249
5270
|
success: !1
|
|
@@ -5263,10 +5284,10 @@ class Wr {
|
|
|
5263
5284
|
message: `Widget ${t.data.id} saved to storage`,
|
|
5264
5285
|
success: !0
|
|
5265
5286
|
};
|
|
5266
|
-
} catch (
|
|
5267
|
-
return console.error("%cstorage",
|
|
5287
|
+
} catch (u) {
|
|
5288
|
+
return console.error("%cstorage", c.STORAGE, _.WIDGET, t, u), {
|
|
5268
5289
|
data: null,
|
|
5269
|
-
message: `Slide ${t.data.id} save error: ${
|
|
5290
|
+
message: `Slide ${t.data.id} save error: ${u.message}`,
|
|
5270
5291
|
success: !1
|
|
5271
5292
|
};
|
|
5272
5293
|
}
|
|
@@ -5277,12 +5298,12 @@ class Wr {
|
|
|
5277
5298
|
* @returns null
|
|
5278
5299
|
*/
|
|
5279
5300
|
b(this, "subscribe", (t) => (t.type === _.MESSAGES && (t = At(this.options, t)), this.subscribers.filter(
|
|
5280
|
-
(
|
|
5301
|
+
(u) => u.widget === t.widget
|
|
5281
5302
|
).length || (console.debug(
|
|
5282
5303
|
"%cstorage%c %csubscribe",
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5304
|
+
c.STORAGE,
|
|
5305
|
+
c.NONE,
|
|
5306
|
+
c.SUBSCRIBE,
|
|
5286
5307
|
t.slide,
|
|
5287
5308
|
t.widget
|
|
5288
5309
|
), this.subscribers.push(t)), null));
|
|
@@ -5295,7 +5316,7 @@ class Wr {
|
|
|
5295
5316
|
try {
|
|
5296
5317
|
return window.BuzzCasting.SlideData[t.id];
|
|
5297
5318
|
} catch (s) {
|
|
5298
|
-
return console.warn("%capi",
|
|
5319
|
+
return console.warn("%capi", c.API, _.SLIDE, t.id, s), {
|
|
5299
5320
|
data: null,
|
|
5300
5321
|
message: `Slide ${t.id} load error: ${s.message}`,
|
|
5301
5322
|
success: !1
|
|
@@ -5306,7 +5327,7 @@ class Wr {
|
|
|
5306
5327
|
try {
|
|
5307
5328
|
return window.BuzzCasting.SlideData.filter((s) => s.presentation_id === t.presentation);
|
|
5308
5329
|
} catch (s) {
|
|
5309
|
-
return console.warn("%capi",
|
|
5330
|
+
return console.warn("%capi", c.API, _.PRESENTATION, t.presentation_id, s), {
|
|
5310
5331
|
data: null,
|
|
5311
5332
|
message: `Slides for presentation ${t.presentation} load error: ${s.message}`,
|
|
5312
5333
|
success: !1
|
|
@@ -5326,7 +5347,7 @@ class Wr {
|
|
|
5326
5347
|
success: !0
|
|
5327
5348
|
};
|
|
5328
5349
|
} catch (s) {
|
|
5329
|
-
return console.error("%cstorage",
|
|
5350
|
+
return console.error("%cstorage", c.STORAGE, _.SLIDE, t, s), {
|
|
5330
5351
|
data: null,
|
|
5331
5352
|
message: `Slide ${t.data.id} save error: ${s.message}`,
|
|
5332
5353
|
success: !1
|
|
@@ -5338,7 +5359,7 @@ class Wr {
|
|
|
5338
5359
|
const s = t.presentation || "none";
|
|
5339
5360
|
return window.BuzzCasting.PresentationData[s];
|
|
5340
5361
|
} catch (s) {
|
|
5341
|
-
return console.warn("%capi",
|
|
5362
|
+
return console.warn("%capi", c.API, _.PRESENTATION, t.presentation, s), {
|
|
5342
5363
|
data: null,
|
|
5343
5364
|
message: `Presentation ${t.presentation} load error: ${s.message}`,
|
|
5344
5365
|
success: !1
|
|
@@ -5349,7 +5370,7 @@ class Wr {
|
|
|
5349
5370
|
try {
|
|
5350
5371
|
return window.BuzzCasting.PresentationData;
|
|
5351
5372
|
} catch (t) {
|
|
5352
|
-
return console.warn("%capi",
|
|
5373
|
+
return console.warn("%capi", c.API, _.PRESENTATION, t), {
|
|
5353
5374
|
data: null,
|
|
5354
5375
|
message: `Presentations get error: ${t.message}`,
|
|
5355
5376
|
success: !1
|
|
@@ -5364,7 +5385,7 @@ class Wr {
|
|
|
5364
5385
|
success: !0
|
|
5365
5386
|
};
|
|
5366
5387
|
} catch (s) {
|
|
5367
|
-
return console.error("%cstorage",
|
|
5388
|
+
return console.error("%cstorage", c.STORAGE, _.PRESENTATION, t, s), {
|
|
5368
5389
|
data: null,
|
|
5369
5390
|
message: `Presentation ${t.data.id} save error: ${s.message}`,
|
|
5370
5391
|
success: !1
|
|
@@ -5375,7 +5396,7 @@ class Wr {
|
|
|
5375
5396
|
try {
|
|
5376
5397
|
return window.BuzzCasting.Preferences[t.id];
|
|
5377
5398
|
} catch (s) {
|
|
5378
|
-
return console.warn("%capi",
|
|
5399
|
+
return console.warn("%capi", c.API, _.PREFERENCE, t.id, s), {
|
|
5379
5400
|
data: null,
|
|
5380
5401
|
message: `Preference ${t.id} load error: ${s.message}`,
|
|
5381
5402
|
success: !1
|
|
@@ -5386,7 +5407,7 @@ class Wr {
|
|
|
5386
5407
|
try {
|
|
5387
5408
|
return window.BuzzCasting.Preferences;
|
|
5388
5409
|
} catch (t) {
|
|
5389
|
-
return console.warn("%capi",
|
|
5410
|
+
return console.warn("%capi", c.API, _.PREFERENCE, t), {
|
|
5390
5411
|
data: null,
|
|
5391
5412
|
message: `Preferences get error: ${t.message}`,
|
|
5392
5413
|
success: !1
|
|
@@ -5403,7 +5424,7 @@ class Wr {
|
|
|
5403
5424
|
} catch (s) {
|
|
5404
5425
|
return console.error(
|
|
5405
5426
|
"%cstorage",
|
|
5406
|
-
|
|
5427
|
+
c.STORAGE,
|
|
5407
5428
|
_.PREFERENCE,
|
|
5408
5429
|
t,
|
|
5409
5430
|
s
|
|
@@ -5429,14 +5450,14 @@ class os {
|
|
|
5429
5450
|
if (this.sm === null || Object.keys(this.subscribers).length === 0)
|
|
5430
5451
|
return;
|
|
5431
5452
|
const s = [];
|
|
5432
|
-
Object.values(this.subscribers).forEach((
|
|
5433
|
-
s.push(this.api.get(
|
|
5453
|
+
Object.values(this.subscribers).forEach((u) => {
|
|
5454
|
+
s.push(this.api.get(u));
|
|
5434
5455
|
}), await Promise.allSettled(s).then(
|
|
5435
|
-
(
|
|
5456
|
+
(u) => u.forEach(async (y) => {
|
|
5436
5457
|
var Y, ne, ue;
|
|
5437
5458
|
let A, I = 400;
|
|
5438
|
-
if (
|
|
5439
|
-
let U =
|
|
5459
|
+
if (y.status === "fulfilled") {
|
|
5460
|
+
let U = y.value;
|
|
5440
5461
|
if (U.success === !0) {
|
|
5441
5462
|
const Q = this.subscribers[U.query.widget];
|
|
5442
5463
|
let re = "";
|
|
@@ -5447,16 +5468,16 @@ class os {
|
|
|
5447
5468
|
(ae) => ae.id !== null
|
|
5448
5469
|
), U.data.messages = Ie, re = Qn(U.data.messages), Q != null && Q.hash && Q.hash === re ? (L(3, [
|
|
5449
5470
|
"%capi%c %cno updates",
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5471
|
+
c.API,
|
|
5472
|
+
c.NONE,
|
|
5473
|
+
c.NO_UPDATES,
|
|
5453
5474
|
_.MESSAGES,
|
|
5454
5475
|
U.query.widget
|
|
5455
5476
|
]), L(4, [
|
|
5456
5477
|
"%capi%c %cno updates",
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5478
|
+
c.API,
|
|
5479
|
+
c.NONE,
|
|
5480
|
+
c.NO_UPDATES,
|
|
5460
5481
|
_.MESSAGES,
|
|
5461
5482
|
U
|
|
5462
5483
|
]), I = 204) : (A = U, Q.hash = re, I = await ((Y = this.sm) == null ? void 0 : Y.setMessages(U.query, U).then((ae) => {
|
|
@@ -5466,16 +5487,16 @@ class os {
|
|
|
5466
5487
|
case _.CLOUD:
|
|
5467
5488
|
re = Qn(U.data.cloud), Q != null && Q.hash && Q.hash === re ? (L(3, [
|
|
5468
5489
|
"%capi%c %cno updates",
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5490
|
+
c.API,
|
|
5491
|
+
c.NONE,
|
|
5492
|
+
c.NO_UPDATES,
|
|
5472
5493
|
_.CLOUD,
|
|
5473
5494
|
U.query.widget
|
|
5474
5495
|
]), L(4, [
|
|
5475
5496
|
"%capi%c %cno updates",
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5497
|
+
c.API,
|
|
5498
|
+
c.NONE,
|
|
5499
|
+
c.NO_UPDATES,
|
|
5479
5500
|
_.CLOUD,
|
|
5480
5501
|
U
|
|
5481
5502
|
]), I = 204) : (Q.hash = re, A = {
|
|
@@ -5490,16 +5511,16 @@ class os {
|
|
|
5490
5511
|
case _.SERIES:
|
|
5491
5512
|
re = Qn(U.data.series), Q != null && Q.hash && Q.hash === re ? (L(3, [
|
|
5492
5513
|
"%capi%c %cno updates",
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5514
|
+
c.API,
|
|
5515
|
+
c.NONE,
|
|
5516
|
+
c.NO_UPDATES,
|
|
5496
5517
|
_.SERIES,
|
|
5497
5518
|
U.query.widget
|
|
5498
5519
|
]), L(4, [
|
|
5499
5520
|
"%capi%c %cno updates",
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5521
|
+
c.API,
|
|
5522
|
+
c.NONE,
|
|
5523
|
+
c.NO_UPDATES,
|
|
5503
5524
|
_.SERIES,
|
|
5504
5525
|
U
|
|
5505
5526
|
]), I = 204) : (Q.hash = re, A = {
|
|
@@ -5512,9 +5533,9 @@ class os {
|
|
|
5512
5533
|
default:
|
|
5513
5534
|
L(4, [
|
|
5514
5535
|
"%capi%c %cstorage",
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5536
|
+
c.API,
|
|
5537
|
+
c.NONE,
|
|
5538
|
+
c.STORAGE,
|
|
5518
5539
|
"error",
|
|
5519
5540
|
`Bad request: type ${U.query.type} unknown`
|
|
5520
5541
|
]), I = 400;
|
|
@@ -5525,27 +5546,27 @@ class os {
|
|
|
5525
5546
|
} else
|
|
5526
5547
|
return L(2, [
|
|
5527
5548
|
"%capp%c %cstorage",
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5549
|
+
c.APP,
|
|
5550
|
+
c.NONE,
|
|
5551
|
+
c.STORAGE,
|
|
5531
5552
|
q.ERROR,
|
|
5532
|
-
|
|
5553
|
+
y.status
|
|
5533
5554
|
]), 400;
|
|
5534
5555
|
})
|
|
5535
5556
|
);
|
|
5536
5557
|
});
|
|
5537
5558
|
b(this, "broadcastUpdate", (t, s) => {
|
|
5538
|
-
var
|
|
5559
|
+
var u;
|
|
5539
5560
|
switch (t) {
|
|
5540
5561
|
case 201:
|
|
5541
5562
|
L(3, [
|
|
5542
5563
|
"%capp%c %cbroadcast",
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5564
|
+
c.APP,
|
|
5565
|
+
c.NONE,
|
|
5566
|
+
c.BROADCAST,
|
|
5546
5567
|
//@ts-ignore
|
|
5547
|
-
((
|
|
5548
|
-
]), L(4, ["%capp%c %cbroadcast",
|
|
5568
|
+
((u = s.data) == null ? void 0 : u.title) ?? s.query.widget
|
|
5569
|
+
]), L(4, ["%capp%c %cbroadcast", c.APP, c.NONE, c.BROADCAST, s]), this.bc.postMessage({
|
|
5549
5570
|
event: q.WIDGET_UPDATE,
|
|
5550
5571
|
data: s.query
|
|
5551
5572
|
});
|
|
@@ -5555,9 +5576,9 @@ class os {
|
|
|
5555
5576
|
default:
|
|
5556
5577
|
L(2, [
|
|
5557
5578
|
"%capp%c %cbroadcast",
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5579
|
+
c.APP,
|
|
5580
|
+
c.NONE,
|
|
5581
|
+
c.BROADCAST,
|
|
5561
5582
|
"Fetch error",
|
|
5562
5583
|
// @ts-ignore
|
|
5563
5584
|
s.data.title ?? s.query.widget
|
|
@@ -5577,9 +5598,9 @@ class os {
|
|
|
5577
5598
|
case q.UPDATE:
|
|
5578
5599
|
L(3, [
|
|
5579
5600
|
"%capi%c %cstorage",
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5601
|
+
c.API,
|
|
5602
|
+
c.NONE,
|
|
5603
|
+
c.STORAGE,
|
|
5583
5604
|
q.UPDATE,
|
|
5584
5605
|
t.data
|
|
5585
5606
|
]), await this.update(t.data.data);
|
|
@@ -5587,36 +5608,36 @@ class os {
|
|
|
5587
5608
|
}
|
|
5588
5609
|
});
|
|
5589
5610
|
b(this, "cleanMessages", async () => {
|
|
5590
|
-
var
|
|
5591
|
-
if ((
|
|
5611
|
+
var u, y, A;
|
|
5612
|
+
if ((u = this.options) != null && u.suspended) {
|
|
5592
5613
|
L(2, [
|
|
5593
5614
|
"%cstorage%c %cstorage",
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5615
|
+
c.STORAGE,
|
|
5616
|
+
c.NONE,
|
|
5617
|
+
c.MESSAGES,
|
|
5597
5618
|
"Account suspended"
|
|
5598
5619
|
]);
|
|
5599
5620
|
return;
|
|
5600
5621
|
}
|
|
5601
|
-
const t = ((
|
|
5622
|
+
const t = ((y = this.options) == null ? void 0 : y.retention) || 86400 * 4, s = await ((A = this.sm) == null ? void 0 : A.cleanMessages(
|
|
5602
5623
|
t
|
|
5603
5624
|
));
|
|
5604
5625
|
L(2, [
|
|
5605
5626
|
"%cstorage%c %cstorage",
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5627
|
+
c.STORAGE,
|
|
5628
|
+
c.NONE,
|
|
5629
|
+
c.MESSAGES,
|
|
5609
5630
|
`${s} messages deleted`
|
|
5610
5631
|
]);
|
|
5611
5632
|
});
|
|
5612
5633
|
b(this, "hideMessage", async (t) => {
|
|
5613
|
-
var
|
|
5614
|
-
const s = await ((
|
|
5634
|
+
var u;
|
|
5635
|
+
const s = await ((u = this.sm) == null ? void 0 : u.hideMessage(t.id, 0));
|
|
5615
5636
|
return L(2, [
|
|
5616
5637
|
"%cstorage%c %cstorage",
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5638
|
+
c.STORAGE,
|
|
5639
|
+
c.NONE,
|
|
5640
|
+
c.HIDE,
|
|
5620
5641
|
`${s} messages hidden`
|
|
5621
5642
|
]), await this.api.hideMessage(t);
|
|
5622
5643
|
});
|
|
@@ -5667,7 +5688,6 @@ class os {
|
|
|
5667
5688
|
/*public loadDashboardWidgets = async (query: IQuery): Promise<Number> => {
|
|
5668
5689
|
return await this.api.loadDashboardWidgets(query);
|
|
5669
5690
|
};*/
|
|
5670
|
-
b(this, "loadDashboards", async (t) => await this.api.loadDashboards(t));
|
|
5671
5691
|
b(this, "getWidget", async (t) => {
|
|
5672
5692
|
var s;
|
|
5673
5693
|
return await ((s = this.sm) == null ? void 0 : s.getWidget(t));
|
|
@@ -5680,6 +5700,7 @@ class os {
|
|
|
5680
5700
|
var s;
|
|
5681
5701
|
return await ((s = this.sm) == null ? void 0 : s.setWidget(t));
|
|
5682
5702
|
});
|
|
5703
|
+
b(this, "loadDashboards", async (t) => await this.api.loadDashboards(t));
|
|
5683
5704
|
b(this, "getDashboard", async (t) => {
|
|
5684
5705
|
var s;
|
|
5685
5706
|
return await ((s = this.sm) == null ? void 0 : s.getDashboard(t));
|
|
@@ -5694,9 +5715,9 @@ class os {
|
|
|
5694
5715
|
});
|
|
5695
5716
|
L(3, [
|
|
5696
5717
|
"%cstorage%c %cpresentation",
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5718
|
+
c.STORAGE,
|
|
5719
|
+
c.NONE,
|
|
5720
|
+
c.PRESENTATION,
|
|
5700
5721
|
t.presentation,
|
|
5701
5722
|
q.VERSION,
|
|
5702
5723
|
Da
|
|
@@ -5704,13 +5725,13 @@ class os {
|
|
|
5704
5725
|
const s = t.presentation;
|
|
5705
5726
|
switch (this.bc = new BroadcastChannel(s), L(3, [
|
|
5706
5727
|
"%capi%c %cbroadcast",
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5728
|
+
c.API,
|
|
5729
|
+
c.NONE,
|
|
5730
|
+
c.BROADCAST,
|
|
5710
5731
|
q.CHANNEL,
|
|
5711
5732
|
s
|
|
5712
|
-
]), this.bc.onmessage = (
|
|
5713
|
-
this.actions(
|
|
5733
|
+
]), this.bc.onmessage = (u) => {
|
|
5734
|
+
this.actions(u);
|
|
5714
5735
|
}, this.bc.postMessage({ event: q.STORAGE_INIT, data: {} }), this.api = new $a(t), t.storage) {
|
|
5715
5736
|
case we.DEXIE:
|
|
5716
5737
|
this.sm = new Br(t);
|
|
@@ -5745,9 +5766,9 @@ class Fa {
|
|
|
5745
5766
|
var s;
|
|
5746
5767
|
return t.type !== _.CLOUD ? (console.warn(
|
|
5747
5768
|
"%capp%c %get",
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5769
|
+
c.APP,
|
|
5770
|
+
c.NONE,
|
|
5771
|
+
c.GET_DATA,
|
|
5751
5772
|
t.widget,
|
|
5752
5773
|
"wrong method call for getMessages, type used is",
|
|
5753
5774
|
t.type
|
|
@@ -5765,10 +5786,12 @@ class Fa {
|
|
|
5765
5786
|
b(this, "getMessages", async (t) => {
|
|
5766
5787
|
var s;
|
|
5767
5788
|
return t.type !== _.MESSAGES ? (console.warn(
|
|
5768
|
-
"%capp%c %
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5789
|
+
"%capp%c %cmessages%c %cget",
|
|
5790
|
+
c.APP,
|
|
5791
|
+
c.NONE,
|
|
5792
|
+
c.MESSAGES,
|
|
5793
|
+
c.NONE,
|
|
5794
|
+
c.GET_DATA,
|
|
5772
5795
|
t.widget,
|
|
5773
5796
|
"wrong method call for getMessages, type used is",
|
|
5774
5797
|
t.type
|
|
@@ -5787,9 +5810,9 @@ class Fa {
|
|
|
5787
5810
|
var s;
|
|
5788
5811
|
return t.type !== _.SERIES ? (console.warn(
|
|
5789
5812
|
"%capp%c %get",
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5813
|
+
c.APP,
|
|
5814
|
+
c.NONE,
|
|
5815
|
+
c.GET_DATA,
|
|
5793
5816
|
t.widget,
|
|
5794
5817
|
"wrong method call for getMessages, type used is",
|
|
5795
5818
|
t.type
|
|
@@ -5826,7 +5849,7 @@ class cs {
|
|
|
5826
5849
|
* @param callbacks functions in the widget that will receive the update
|
|
5827
5850
|
* @param selector container for the element - by default buzzcasting-app (optional)
|
|
5828
5851
|
*/
|
|
5829
|
-
constructor(t, s,
|
|
5852
|
+
constructor(t, s, u) {
|
|
5830
5853
|
b(this, "storageReader");
|
|
5831
5854
|
b(this, "broadcastChannel");
|
|
5832
5855
|
b(this, "element");
|
|
@@ -5849,7 +5872,8 @@ class cs {
|
|
|
5849
5872
|
return {
|
|
5850
5873
|
data: null,
|
|
5851
5874
|
message: `wrong method call, '${this.query.type}' is unknown`,
|
|
5852
|
-
success: !1
|
|
5875
|
+
success: !1,
|
|
5876
|
+
query: this.query
|
|
5853
5877
|
};
|
|
5854
5878
|
});
|
|
5855
5879
|
/**
|
|
@@ -5859,22 +5883,23 @@ class cs {
|
|
|
5859
5883
|
*/
|
|
5860
5884
|
b(this, "getCloud", async () => this.query.type !== _.CLOUD ? (L(4, [
|
|
5861
5885
|
"%cstorage%c %cwidget",
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5886
|
+
c.STORAGE,
|
|
5887
|
+
c.NONE,
|
|
5888
|
+
c.WIDGET,
|
|
5865
5889
|
this.query.widget,
|
|
5866
5890
|
"Wrong method call for getCloud, expected type is",
|
|
5867
5891
|
this.query.type
|
|
5868
5892
|
]), L(3, [
|
|
5869
5893
|
"%cstorage%c %cwidget",
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
5894
|
+
c.API,
|
|
5895
|
+
c.NONE,
|
|
5896
|
+
c.CLOUD,
|
|
5873
5897
|
this.query
|
|
5874
5898
|
]), {
|
|
5875
5899
|
data: null,
|
|
5876
5900
|
message: `wrong method call for getCloud, expected type is '${this.query.type}'`,
|
|
5877
|
-
success: !1
|
|
5901
|
+
success: !1,
|
|
5902
|
+
query: this.query
|
|
5878
5903
|
}) : await this.storageReader.getCloud(this.query));
|
|
5879
5904
|
/**
|
|
5880
5905
|
* Get Widget Messages Data
|
|
@@ -5883,9 +5908,9 @@ class cs {
|
|
|
5883
5908
|
*/
|
|
5884
5909
|
b(this, "getMessages", async () => this.query.type !== _.MESSAGES ? (L(4, [
|
|
5885
5910
|
"%cstorage%c %cwidget",
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
|
|
5911
|
+
c.STORAGE,
|
|
5912
|
+
c.NONE,
|
|
5913
|
+
c.WIDGET,
|
|
5889
5914
|
this.query.widget,
|
|
5890
5915
|
"Wrong method call for getMessages, expected type is",
|
|
5891
5916
|
this.query.type
|
|
@@ -5895,9 +5920,9 @@ class cs {
|
|
|
5895
5920
|
success: !1
|
|
5896
5921
|
}) : (L(3, [
|
|
5897
5922
|
"%cstorage%c %cwidget",
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5923
|
+
c.API,
|
|
5924
|
+
c.NONE,
|
|
5925
|
+
c.MESSAGES,
|
|
5901
5926
|
this.query
|
|
5902
5927
|
]), await this.storageReader.getMessages(this.query)));
|
|
5903
5928
|
/**
|
|
@@ -5907,22 +5932,23 @@ class cs {
|
|
|
5907
5932
|
*/
|
|
5908
5933
|
b(this, "getSeries", async () => this.query.type !== _.SERIES ? (L(3, [
|
|
5909
5934
|
"%cstorage%c %cwidget",
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5935
|
+
c.STORAGE,
|
|
5936
|
+
c.NONE,
|
|
5937
|
+
c.WIDGET,
|
|
5913
5938
|
this.query.widget,
|
|
5914
5939
|
"Wrong method call for getSeries, expected type is",
|
|
5915
5940
|
this.query.type
|
|
5916
5941
|
]), L(2, [
|
|
5917
5942
|
"%cstorage%c %cwidget",
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5943
|
+
c.STORAGE,
|
|
5944
|
+
c.NONE,
|
|
5945
|
+
c.MESSAGES,
|
|
5921
5946
|
this.query
|
|
5922
5947
|
]), {
|
|
5923
5948
|
data: null,
|
|
5924
5949
|
message: `wrong method call for getSeries, expected type is '${this.query.type}'`,
|
|
5925
|
-
success: !1
|
|
5950
|
+
success: !1,
|
|
5951
|
+
query: this.query
|
|
5926
5952
|
}) : await this.storageReader.getSeries(this.query));
|
|
5927
5953
|
/**
|
|
5928
5954
|
* Emit a show modal event using the element's attributes
|
|
@@ -5933,7 +5959,7 @@ class cs {
|
|
|
5933
5959
|
b(this, "showModal", (t) => {
|
|
5934
5960
|
L(3, [
|
|
5935
5961
|
"%cwidget",
|
|
5936
|
-
|
|
5962
|
+
c.WIDGET,
|
|
5937
5963
|
q.SHOW_MODAL,
|
|
5938
5964
|
t.showComponent,
|
|
5939
5965
|
// @ts-ignore
|
|
@@ -5954,11 +5980,11 @@ class cs {
|
|
|
5954
5980
|
window.dispatchEvent(s);
|
|
5955
5981
|
});
|
|
5956
5982
|
var I;
|
|
5957
|
-
this.element = t, this.callbacks = s,
|
|
5958
|
-
let
|
|
5959
|
-
|
|
5983
|
+
this.element = t, this.callbacks = s, u = typeof u < "u" ? u : "buzzcasting-app";
|
|
5984
|
+
let y;
|
|
5985
|
+
y = { ...t.dataset }, delete y.hmr, y.presentation = ((I = t.closest(u.toUpperCase())) == null ? void 0 : I.presentation) ?? `${u} not found`, this.query = y, xa(t);
|
|
5960
5986
|
const A = window.BuzzCasting.getOptions();
|
|
5961
|
-
this.storageReader = new Fa(A), this.broadcastChannel = new BroadcastChannel(
|
|
5987
|
+
this.storageReader = new Fa(A), this.broadcastChannel = new BroadcastChannel(y.presentation), this.broadcastListener();
|
|
5962
5988
|
}
|
|
5963
5989
|
addCallbackListener(t) {
|
|
5964
5990
|
this.callbacks.push(t);
|
|
@@ -5970,23 +5996,26 @@ class cs {
|
|
|
5970
5996
|
broadcastListener() {
|
|
5971
5997
|
const t = this.query;
|
|
5972
5998
|
this.broadcastChannel.onmessage = async (s) => {
|
|
5973
|
-
const
|
|
5999
|
+
const u = s.data.data;
|
|
5974
6000
|
switch (s.data.event) {
|
|
5975
6001
|
case q.WIDGET_UPDATE:
|
|
5976
6002
|
try {
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
6003
|
+
if (u.dashboard === t.dashboard && u.widget === t.widget) {
|
|
6004
|
+
const y = await this.getData();
|
|
6005
|
+
y != null && y.success && (L(4, [
|
|
6006
|
+
"%cwidget%c %cbroadcast%c %cset",
|
|
6007
|
+
c.BROADCAST,
|
|
6008
|
+
c.NONE,
|
|
6009
|
+
c.WIDGET,
|
|
6010
|
+
c.NONE,
|
|
6011
|
+
c.GET_DATA,
|
|
6012
|
+
this.query
|
|
6013
|
+
]), this.callbacks.forEach(async (A) => {
|
|
6014
|
+
A(y);
|
|
6015
|
+
}));
|
|
6016
|
+
}
|
|
5988
6017
|
} catch {
|
|
5989
|
-
L(4, [q.WIDGET_UPDATE,
|
|
6018
|
+
L(4, [q.WIDGET_UPDATE, u]);
|
|
5990
6019
|
}
|
|
5991
6020
|
break;
|
|
5992
6021
|
case q.APP_READY:
|
|
@@ -6002,16 +6031,16 @@ class cs {
|
|
|
6002
6031
|
subscribe() {
|
|
6003
6032
|
L(3, [
|
|
6004
6033
|
"%cwidget%c %csubscribe",
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6034
|
+
c.WIDGET,
|
|
6035
|
+
c.NONE,
|
|
6036
|
+
c.SUBSCRIBE,
|
|
6008
6037
|
this.query.presentation,
|
|
6009
6038
|
this.query.widget
|
|
6010
6039
|
]), L(4, [
|
|
6011
6040
|
"%cwidget%c %csubscribe",
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6041
|
+
c.WIDGET,
|
|
6042
|
+
c.NONE,
|
|
6043
|
+
c.SUBSCRIBE,
|
|
6015
6044
|
this.query
|
|
6016
6045
|
]), this.broadcastChannel.postMessage({
|
|
6017
6046
|
event: q.SUBSCRIBE,
|
|
@@ -6026,7 +6055,7 @@ export {
|
|
|
6026
6055
|
_ as API,
|
|
6027
6056
|
os as BuzzcastingStorageManager,
|
|
6028
6057
|
Fa as BuzzcastingStorageReader,
|
|
6029
|
-
|
|
6058
|
+
c as CSS,
|
|
6030
6059
|
q as EVENTS,
|
|
6031
6060
|
an as MODERATION,
|
|
6032
6061
|
we as STORAGE,
|