buzzcasting-storage 3.21.4 → 3.21.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/README.md +38 -41
- package/dist/buzzcasting-storage.d.ts +10 -0
- package/dist/buzzcasting-storage.esm.js +325 -328
- package/package.json +13 -13
|
@@ -5,15 +5,15 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
5
5
|
enumerable: !(s = n(i, d)) || s.enumerable
|
|
6
6
|
});
|
|
7
7
|
return e;
|
|
8
|
-
}, c = (n, r,
|
|
8
|
+
}, c = (n, r, o) => (o = n == null ? {} : e(i(n)), s(r || !n || !n.__esModule || !a.call(n, "default") ? t(o, "default", {
|
|
9
9
|
value: n,
|
|
10
10
|
enumerable: !0
|
|
11
|
-
}) :
|
|
11
|
+
}) : o, n)), l = function(e) {
|
|
12
12
|
return e.CARDS = "cards", e.CLOUD = "cloud", e.DASHBOARD = "dashboard", e.DASHBOARDS = "dashboards", e.IMAGES = "images", e.MESSAGES = "messages", e.PREFERENCE = "preference", e.PREFERENCES = "preferences", e.PRESENTATION = "presentation", e.PRESENTATIONS = "presentations", e.SERIES = "series", e.SLIDE = "slide", e.SLIDES = "slides", e.TEMPLATES = "templates", e.TOPICS = "topics", e.WIDGET = "widget", e.WIDGETS = "widgets", e;
|
|
13
13
|
}({}), u = function(e) {
|
|
14
14
|
return e.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", e.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", e.BROADCAST = "color:navy;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", e.CLOUD = "color:purple;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", e.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", e.ERROR = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", e.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", e.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", e.KO = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", e.MESSAGES = "color:white;background-color:darkslateblue;padding:0 4px 0 4px;border-radius:5px;", e.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", e.NONE = "color:transparent;background-color:transparent;", e.OK = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", e.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", e.SERIES = "color:purple;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", e.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", e.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", e.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", e.WIDGET = "color:black;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", e.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", e;
|
|
15
15
|
}({}), d = function(e) {
|
|
16
|
-
return e.ADD_SLIDE = "addSlide", e.APP_READY = "appReady", e.API_UPDATE = "apiUpdate", e.BACKGROUND_UPDATE = "backgroundUpdate", e.BUILDER_PREVIEW = "builderPreview", e.COMPONENT_UPDATE = "componentUpdate", e.APPROVE_MESSAGE = "approveMessage", e.CHANNEL = "channel", e.CLEAN_MESSAGES = "cleanMessages", e.CLOSE_BUILDER_DIALOG = "closeBuilderDialog", e.CLOSE_BUILDER_MODAL = "closeBuilderModal", e.CLOSE_MODAL = "closeModal", e.COLOR_UPDATE = "colorUpdate", e.COMPONENT_INDEX = "componentIndex", e.CSS_SET = "setCss", e.CSS_STORE = "storeCss", e.DASHBOARD_LOAD = "loadDashboard", e.DASHBOARD_STORE = "storeDashboard", e.DASHBOARD_UPDATED = "dashboardUpdated", e.ERROR = "error", e.HIDE_MESSAGE = "hideMessage", e.
|
|
16
|
+
return e.ADD_SLIDE = "addSlide", e.APP_READY = "appReady", e.API_UPDATE = "apiUpdate", e.BACKGROUND_UPDATE = "backgroundUpdate", e.BUILDER_PREVIEW = "builderPreview", e.COMPONENT_UPDATE = "componentUpdate", e.APPROVE_MESSAGE = "approveMessage", e.CHANNEL = "channel", e.CLEAN_MESSAGES = "cleanMessages", e.CLOSE_BUILDER_DIALOG = "closeBuilderDialog", e.CLOSE_BUILDER_MODAL = "closeBuilderModal", e.CLOSE_MODAL = "closeModal", e.COLOR_UPDATE = "colorUpdate", e.COMPONENT_INDEX = "componentIndex", e.CSS_SET = "setCss", e.CSS_STORE = "storeCss", e.DASHBOARD_LOAD = "loadDashboard", e.DASHBOARD_STORE = "storeDashboard", e.DASHBOARD_UPDATED = "dashboardUpdated", e.ERROR = "error", e.HIDE_MESSAGE = "hideMessage", e.IMAGE_GET = "getImage", e.IMAGE_SET = "setImage", e.IMAGE_STORED = "imageStored", e.LAYOUT_UPDATE = "layoutUpdate", e.PREV_SLIDE = "prevSlide", e.RELOAD_PRESENTATION = "reloadPresentation", e.STAR_MESSAGE = "starMessage", e.GOTO_SLIDE = "gotoSlide", e.NEXT_SLIDE = "nextSlide", e.PREFERENCE_LOAD = "loadPreference", e.PREFERENCE_STORE = "storePreference", e.PREFERENCE_UPDATED = "preferenceUpdated", e.PAUSE_PRESENTATION = "pausePresentation", e.PRESENTATION_READY = "presentationReady", e.PRESENTATION_LOAD = "loadPresentation", e.PRESENTATION_STORE = "storePresentation", e.PRESENTATION_UPDATED = "presentationUpdated", e.ROW_COL_UPDATE = "rowcolupdate", e.SCREENSHOT_TAKE = "takeScreenshot", e.SCREENSHOT_STORE = "storeScreenshot", e.SECTION_UPDATE = "sectionUpdate", e.SHOW_BUILDER_DIALOG = "showBuilderDialog", e.SHOW_BUILDER_MODAL = "showBuilderModal", e.SHOW_MODAL = "showModal", e.SLIDE_DID_LOAD = "slideDidLoad", e.SLIDE_GET = "getSlide", e.SLIDE_GOTO = "slideGoto", e.SLIDE_LOAD = "loadSlide", e.SLIDE_READY = "slideReady", e.SLIDE_SAVED = "slideSaved", e.SLIDE_SET = "setSlide", e.SLIDE_STORE = "storeSlide", e.SLIDE_STORED = "slideStored", e.SLIDE_TRANSITIONER = "slideTransitioner", e.SLIDE_UPDATED = "slideUpdated", e.START_TRANSITIONER = "startTransitioner", e.STORAGE_INIT = "storageInit", e.STREAM = "stream", e.SUBSCRIBE = "subscribe", e.UNSUBSCRIBE = "unsubscribe", e.SUSPEND_ACCOUNT = "suspendAccount", e.SWITCH_PRESENTATION = "switchPresentation", e.REMOVE_CLOUD = "removeCloud", e.UPDATE = "update", e.UPLOAD_COMPLETED = "uploadCompleted", e.VERSION = "version", e.WIDGETS_CLEAR = "widgetsClear", e.WIDGET_DID_LOAD = "widgetDidLoad", e.WIDGET_DID_UPDATE = "widgetDidUpdate", e.WIDGET_LOAD = "widgetLoad", e.WIDGET_STORE = "widgetStore", e.WIDGET_UPDATE = "widgetUpdate", e.WS_API_REQUEST = "wsApiRequest", e.WS_API_RESPONSE = "wsApiResponse", e.WS_API_UPDATE = "wsApiUpdate", e;
|
|
17
17
|
}({}), f = function(e) {
|
|
18
18
|
return e.APPROVED = "approved", e.BEFORE = "before", e.DELAYED = "delayed", e.NONE = "none", e.REALTIME = "realtime", e;
|
|
19
19
|
}({}), p = function(e) {
|
|
@@ -76,44 +76,8 @@ var S = (e) => {
|
|
|
76
76
|
return t;
|
|
77
77
|
};
|
|
78
78
|
S("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr"), S("a,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video"), S("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"), S("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"), S("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"), S("script,style");
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
var ee = (e) => {
|
|
83
|
-
let t = [
|
|
84
|
-
"area",
|
|
85
|
-
"base",
|
|
86
|
-
"basefont",
|
|
87
|
-
"br",
|
|
88
|
-
"col",
|
|
89
|
-
"frame",
|
|
90
|
-
"hr",
|
|
91
|
-
"img",
|
|
92
|
-
"input",
|
|
93
|
-
"isindex",
|
|
94
|
-
"link",
|
|
95
|
-
"meta",
|
|
96
|
-
"param",
|
|
97
|
-
"embed"
|
|
98
|
-
], n = "";
|
|
99
|
-
e.child && (n = e.child.map(function(e) {
|
|
100
|
-
return ee(e);
|
|
101
|
-
}).join(""));
|
|
102
|
-
let r = "";
|
|
103
|
-
if (e.attr && (r = Object.keys(e.attr).map(function(t) {
|
|
104
|
-
let n = e.attr[t];
|
|
105
|
-
return Array.isArray(n) && (n = n.join(" ")), `${t}=${C(n)}`;
|
|
106
|
-
}).join(" "), r !== "" && (r = ` ${r}`)), e.node === "element") {
|
|
107
|
-
let i = e.tag;
|
|
108
|
-
if (t.indexOf(i) > -1) return `<${e.tag}${r}/>`;
|
|
109
|
-
let a = `<${e.tag}${r}>`, o = `</${e.tag}>`;
|
|
110
|
-
return `${a}${n}${o}`;
|
|
111
|
-
}
|
|
112
|
-
if (e.node === "text") return e.text;
|
|
113
|
-
if (e.node === "comment") return `<!-- ${e.text} -->`;
|
|
114
|
-
if (e.node === "root") return n;
|
|
115
|
-
}, w = new BroadcastChannel("logging"), T = async (e = 0, t) => {
|
|
116
|
-
w.postMessage({
|
|
79
|
+
var C = new BroadcastChannel("logging"), w = async (e = 0, t) => {
|
|
80
|
+
C.postMessage({
|
|
117
81
|
action: "log",
|
|
118
82
|
level: e,
|
|
119
83
|
message: t
|
|
@@ -153,7 +117,7 @@ var ee = (e) => {
|
|
|
153
117
|
return t.length < 64 ? "0000000000000000000000000000000000000000000000000000000000000000".substring(0, 64 - t.length) + t : t;
|
|
154
118
|
}
|
|
155
119
|
});
|
|
156
|
-
var
|
|
120
|
+
var T = (e) => {
|
|
157
121
|
switch (e?.type) {
|
|
158
122
|
case l.MESSAGES: return u.MESSAGES;
|
|
159
123
|
case l.SERIES: return u.SERIES;
|
|
@@ -161,18 +125,18 @@ var E = (e) => {
|
|
|
161
125
|
default: return u.NO_UPDATES;
|
|
162
126
|
}
|
|
163
127
|
};
|
|
164
|
-
function
|
|
128
|
+
function E(e) {
|
|
165
129
|
let t = `${e.type}.${e.topics}`;
|
|
166
130
|
return e.order && (t += `.${e.order}`), e.period && (t += `.${e.period}`), t;
|
|
167
131
|
}
|
|
168
|
-
function
|
|
132
|
+
function ee(e) {
|
|
169
133
|
if (e.widget === void 0) {
|
|
170
134
|
let t = e.topics?.split("-");
|
|
171
135
|
t && t.length > 1 ? (e.dashboard = t ? t[0] : "", e.widget = t ? t[1] : "") : (e.widget = e.topics, e.dashboard = e.slide);
|
|
172
136
|
}
|
|
173
137
|
return e;
|
|
174
138
|
}
|
|
175
|
-
function
|
|
139
|
+
function D(e, t) {
|
|
176
140
|
let n, r, i, a, o;
|
|
177
141
|
switch (e.moderation) {
|
|
178
142
|
case f.BEFORE:
|
|
@@ -195,7 +159,7 @@ function ne(e, t) {
|
|
|
195
159
|
}({});
|
|
196
160
|
//#endregion
|
|
197
161
|
//#region package.json
|
|
198
|
-
var
|
|
162
|
+
var te = "3.21.7", ne = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
199
163
|
(function(n, r) {
|
|
200
164
|
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self, n.readNDJSONStream = r());
|
|
201
165
|
})(e, (function() {
|
|
@@ -211,7 +175,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
211
175
|
}
|
|
212
176
|
return e;
|
|
213
177
|
}));
|
|
214
|
-
})))(), 1),
|
|
178
|
+
})))(), 1), re = class {
|
|
215
179
|
options;
|
|
216
180
|
url;
|
|
217
181
|
constructor(e) {
|
|
@@ -247,11 +211,9 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
247
211
|
case l.SERIES:
|
|
248
212
|
a = u.SERIES;
|
|
249
213
|
break;
|
|
250
|
-
case l.CLOUD:
|
|
251
|
-
a = u.CLOUD;
|
|
252
|
-
break;
|
|
214
|
+
case l.CLOUD: a = u.CLOUD;
|
|
253
215
|
}
|
|
254
|
-
return
|
|
216
|
+
return w(3, [
|
|
255
217
|
`%cfetch%c %capi%c %c${e.type}`,
|
|
256
218
|
u.OK,
|
|
257
219
|
u.NONE,
|
|
@@ -289,11 +251,11 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
289
251
|
body: JSON.stringify({ data: e }),
|
|
290
252
|
method: "post"
|
|
291
253
|
});
|
|
292
|
-
for await (let e of (0,
|
|
254
|
+
for await (let e of (0, ne.default)(r.body)) console.log("Received", e);
|
|
293
255
|
}
|
|
294
256
|
async hideMessage(e) {
|
|
295
257
|
let { version: t } = this.options, n = this.headers();
|
|
296
|
-
return
|
|
258
|
+
return w(3, [
|
|
297
259
|
"%capi%c %cput",
|
|
298
260
|
u.API,
|
|
299
261
|
u.NONE,
|
|
@@ -322,7 +284,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
322
284
|
async hideLabels(e) {
|
|
323
285
|
let { version: t } = this.options, n = this.formHeaders(), r = new URLSearchParams(), i = e.labels || [];
|
|
324
286
|
for (let [e, t] of i.entries()) r.append(`custom_filters[${e}]`, t);
|
|
325
|
-
return console.info("%capi%c %cput", u.API, u.NONE, u.GET_DATA, d.
|
|
287
|
+
return console.info("%capi%c %cput", u.API, u.NONE, u.GET_DATA, d.REMOVE_CLOUD, e.widget, i), await fetch([
|
|
326
288
|
this.url,
|
|
327
289
|
"api",
|
|
328
290
|
t,
|
|
@@ -343,7 +305,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
343
305
|
}
|
|
344
306
|
async loadSlide(e) {
|
|
345
307
|
let { version: t } = this.options, n = this.headers(), r = Object.assign({}, e);
|
|
346
|
-
return delete r.type, delete r.hash,
|
|
308
|
+
return delete r.type, delete r.hash, w(3, [
|
|
347
309
|
"%cload%c %capi%c %cslide",
|
|
348
310
|
u.OK,
|
|
349
311
|
u.NONE,
|
|
@@ -378,7 +340,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
378
340
|
let { version: t } = this.options, n = this.formHeaders();
|
|
379
341
|
delete e.update, delete e.type;
|
|
380
342
|
let r = JSON.stringify(e);
|
|
381
|
-
return
|
|
343
|
+
return w(3, [
|
|
382
344
|
"%cput%c %capi%c %cslide",
|
|
383
345
|
u.OK,
|
|
384
346
|
u.NONE,
|
|
@@ -408,7 +370,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
408
370
|
}
|
|
409
371
|
async loadPresentation(e) {
|
|
410
372
|
let { version: t } = this.options, n = this.headers();
|
|
411
|
-
return delete e.update,
|
|
373
|
+
return delete e.update, w(3, [
|
|
412
374
|
"%cload%c %capi%c %cpresentation",
|
|
413
375
|
u.OK,
|
|
414
376
|
u.NONE,
|
|
@@ -441,7 +403,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
441
403
|
let { version: t } = this.options, n = this.formHeaders();
|
|
442
404
|
delete e.update;
|
|
443
405
|
let r = JSON.stringify(e);
|
|
444
|
-
return
|
|
406
|
+
return w(2, [
|
|
445
407
|
"%capi%c %cput",
|
|
446
408
|
u.API,
|
|
447
409
|
u.NONE,
|
|
@@ -468,7 +430,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
468
430
|
}
|
|
469
431
|
async loadPreference(e) {
|
|
470
432
|
let { version: t } = this.options, n = this.headers();
|
|
471
|
-
return
|
|
433
|
+
return w(3, [
|
|
472
434
|
"%cload%c %capi%c %cpreference",
|
|
473
435
|
u.OK,
|
|
474
436
|
u.NONE,
|
|
@@ -495,10 +457,14 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
495
457
|
}));
|
|
496
458
|
}
|
|
497
459
|
async storePreference(e) {
|
|
498
|
-
let { version: t } = this.options, n = this.
|
|
460
|
+
let { version: t } = this.options, n = `Bearer ${this.options.bearer}`, r = { headers: new Headers({
|
|
461
|
+
Authorization: n,
|
|
462
|
+
"Content-Type": "application/json",
|
|
463
|
+
Accept: "application/json"
|
|
464
|
+
}) };
|
|
499
465
|
delete e.update;
|
|
500
|
-
let
|
|
501
|
-
return
|
|
466
|
+
let i = JSON.stringify({ data: e });
|
|
467
|
+
return w(3, [
|
|
502
468
|
"%capi%c %cstorePreference",
|
|
503
469
|
u.API,
|
|
504
470
|
u.NONE,
|
|
@@ -508,11 +474,10 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
508
474
|
this.url,
|
|
509
475
|
"api",
|
|
510
476
|
t,
|
|
511
|
-
l.PREFERENCES
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
body: r,
|
|
477
|
+
l.PREFERENCES
|
|
478
|
+
].join("/") + "/", {
|
|
479
|
+
...r,
|
|
480
|
+
body: i,
|
|
516
481
|
method: "post"
|
|
517
482
|
}).then((e) => {
|
|
518
483
|
if (!e.ok) throw Error(e.statusText);
|
|
@@ -525,7 +490,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
525
490
|
}
|
|
526
491
|
async loadDashboards(e) {
|
|
527
492
|
let { version: t } = this.options, n = this.headers();
|
|
528
|
-
return
|
|
493
|
+
return w(3, [
|
|
529
494
|
"%capi%c %cdashboards",
|
|
530
495
|
u.API,
|
|
531
496
|
u.NONE,
|
|
@@ -554,7 +519,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
554
519
|
}
|
|
555
520
|
async loadImages(e) {
|
|
556
521
|
let { version: t } = this.options, n = this.headers();
|
|
557
|
-
return
|
|
522
|
+
return w(3, [
|
|
558
523
|
"%cload%c %capi%c %cimage",
|
|
559
524
|
u.OK,
|
|
560
525
|
u.NONE,
|
|
@@ -622,7 +587,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
622
587
|
data: []
|
|
623
588
|
}));
|
|
624
589
|
}
|
|
625
|
-
},
|
|
590
|
+
}, ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
626
591
|
((n, r) => {
|
|
627
592
|
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).Dexie = r();
|
|
628
593
|
})(e, function() {
|
|
@@ -702,12 +667,14 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
702
667
|
return s === -1 || (o = e[t.substr(0, s)]) == null ? void 0 : b(o, t.substr(s + 1));
|
|
703
668
|
}
|
|
704
669
|
function x(e, t, n) {
|
|
705
|
-
if (e && t !== void 0 && !("isFrozen" in Object && Object.isFrozen(e)))
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
670
|
+
if (e && t !== void 0 && !("isFrozen" in Object && Object.isFrozen(e))) {
|
|
671
|
+
if (typeof t != "string" && "length" in t) {
|
|
672
|
+
v(typeof n != "string" && "length" in n);
|
|
673
|
+
for (var r = 0, i = t.length; r < i; ++r) x(e, t[r], n[r]);
|
|
674
|
+
} else {
|
|
675
|
+
var o, s, c = t.indexOf(".");
|
|
676
|
+
c === -1 ? n === void 0 ? a(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n : (o = t.substr(0, c), (c = t.substr(c + 1)) === "" ? n === void 0 ? a(e) && !isNaN(parseInt(o)) ? e.splice(o, 1) : delete e[o] : e[o] = n : x(s = (s = e[o]) && l(e, o) ? s : e[o] = {}, c, n));
|
|
677
|
+
}
|
|
711
678
|
}
|
|
712
679
|
}
|
|
713
680
|
function S(e) {
|
|
@@ -716,10 +683,10 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
716
683
|
return n;
|
|
717
684
|
}
|
|
718
685
|
var C = [].concat;
|
|
719
|
-
function
|
|
686
|
+
function w(e) {
|
|
720
687
|
return C.apply([], e);
|
|
721
688
|
}
|
|
722
|
-
var
|
|
689
|
+
var T = "BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(w([
|
|
723
690
|
8,
|
|
724
691
|
16,
|
|
725
692
|
32,
|
|
@@ -734,24 +701,24 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
734
701
|
});
|
|
735
702
|
}))).filter(function(e) {
|
|
736
703
|
return r[e];
|
|
737
|
-
}),
|
|
704
|
+
}), E = new Set(T.map(function(e) {
|
|
738
705
|
return r[e];
|
|
739
|
-
})),
|
|
706
|
+
})), ee = null;
|
|
740
707
|
function D(e) {
|
|
741
|
-
return
|
|
708
|
+
return ee = /* @__PURE__ */ new WeakMap(), e = function e(t) {
|
|
742
709
|
if (!t || typeof t != "object") return t;
|
|
743
|
-
var n =
|
|
710
|
+
var n = ee.get(t);
|
|
744
711
|
if (n) return n;
|
|
745
712
|
if (a(t)) {
|
|
746
|
-
n = [],
|
|
713
|
+
n = [], ee.set(t, n);
|
|
747
714
|
for (var r = 0, i = t.length; r < i; ++r) n.push(e(t[r]));
|
|
748
|
-
} else if (
|
|
715
|
+
} else if (E.has(t.constructor)) n = t;
|
|
749
716
|
else {
|
|
750
717
|
var o, c = s(t);
|
|
751
|
-
for (o in n = c === Object.prototype ? {} : Object.create(c),
|
|
718
|
+
for (o in n = c === Object.prototype ? {} : Object.create(c), ee.set(t, n), t) l(t, o) && (n[o] = e(t[o]));
|
|
752
719
|
}
|
|
753
720
|
return n;
|
|
754
|
-
}(e),
|
|
721
|
+
}(e), ee = null, e;
|
|
755
722
|
}
|
|
756
723
|
var te = {}.toString;
|
|
757
724
|
function ne(e) {
|
|
@@ -763,15 +730,15 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
763
730
|
} : function() {
|
|
764
731
|
return null;
|
|
765
732
|
};
|
|
766
|
-
function
|
|
733
|
+
function O(e, t) {
|
|
767
734
|
t = e.indexOf(t), 0 <= t && e.splice(t, 1);
|
|
768
735
|
}
|
|
769
|
-
var
|
|
770
|
-
function
|
|
736
|
+
var k = {};
|
|
737
|
+
function A(e) {
|
|
771
738
|
var t, n, r, i;
|
|
772
739
|
if (arguments.length === 1) {
|
|
773
740
|
if (a(e)) return e.slice();
|
|
774
|
-
if (this ===
|
|
741
|
+
if (this === k && typeof e == "string") return [e];
|
|
775
742
|
if (i = ie(e)) for (n = []; !(r = i.next()).done;) n.push(r.value);
|
|
776
743
|
else {
|
|
777
744
|
if (e == null || typeof (t = e.length) != "number") return [e];
|
|
@@ -780,11 +747,11 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
780
747
|
} else for (t = arguments.length, n = Array(t); t--;) n[t] = arguments[t];
|
|
781
748
|
return n;
|
|
782
749
|
}
|
|
783
|
-
var
|
|
750
|
+
var ae = typeof Symbol < "u" ? function(e) {
|
|
784
751
|
return e[Symbol.toStringTag] === "AsyncFunction";
|
|
785
752
|
} : function() {
|
|
786
753
|
return !1;
|
|
787
|
-
},
|
|
754
|
+
}, T = [
|
|
788
755
|
"Unknown",
|
|
789
756
|
"Constraint",
|
|
790
757
|
"Data",
|
|
@@ -816,7 +783,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
816
783
|
"DatabaseClosed",
|
|
817
784
|
"PrematureCommit",
|
|
818
785
|
"ForeignAwait"
|
|
819
|
-
].concat(
|
|
786
|
+
].concat(T), oe = {
|
|
820
787
|
VersionChanged: "Database version changed by other database connection",
|
|
821
788
|
DatabaseClosed: "Database has been closed",
|
|
822
789
|
Abort: "Transaction aborted",
|
|
@@ -852,10 +819,10 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
852
819
|
this.name = n, e ? typeof e == "string" ? (this.message = `${e}${r ? "\n " + r : ""}`, this.inner = r || null) : typeof e == "object" && (this.message = `${e.name} ${e.message}`, this.inner = e) : (this.message = oe[t] || n, this.inner = null);
|
|
853
820
|
}
|
|
854
821
|
return p(r).from(fe), e[t] = r, e;
|
|
855
|
-
}, {}), pe = (M.Syntax = SyntaxError, M.Type = TypeError, M.Range = RangeError,
|
|
822
|
+
}, {}), pe = (M.Syntax = SyntaxError, M.Type = TypeError, M.Range = RangeError, T.reduce(function(e, t) {
|
|
856
823
|
return e[t + "Error"] = M[t], e;
|
|
857
824
|
}, {}));
|
|
858
|
-
|
|
825
|
+
T = j.reduce(function(e, t) {
|
|
859
826
|
return [
|
|
860
827
|
"Syntax",
|
|
861
828
|
"Type",
|
|
@@ -876,26 +843,26 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
876
843
|
e.apply(this, arguments), t.apply(this, arguments);
|
|
877
844
|
};
|
|
878
845
|
}
|
|
879
|
-
function
|
|
846
|
+
function F(e, t) {
|
|
880
847
|
return e === N ? t : function() {
|
|
881
848
|
var n = e.apply(this, arguments), r = (n !== void 0 && (arguments[0] = n), this.onsuccess), i = this.onerror, a = (this.onsuccess = null, this.onerror = null, t.apply(this, arguments));
|
|
882
849
|
return r && (this.onsuccess = this.onsuccess ? P(r, this.onsuccess) : r), i && (this.onerror = this.onerror ? P(i, this.onerror) : i), a === void 0 ? n : a;
|
|
883
850
|
};
|
|
884
851
|
}
|
|
885
|
-
function
|
|
852
|
+
function I(e, t) {
|
|
886
853
|
return e === N ? t : function() {
|
|
887
854
|
e.apply(this, arguments);
|
|
888
855
|
var n = this.onsuccess, r = this.onerror;
|
|
889
856
|
this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? P(n, this.onsuccess) : n), r && (this.onerror = this.onerror ? P(r, this.onerror) : r);
|
|
890
857
|
};
|
|
891
858
|
}
|
|
892
|
-
function
|
|
859
|
+
function ge(e, t) {
|
|
893
860
|
return e === N ? t : function(n) {
|
|
894
861
|
var r = e.apply(this, arguments), n = (o(n, r), this.onsuccess), i = this.onerror, a = (this.onsuccess = null, this.onerror = null, t.apply(this, arguments));
|
|
895
862
|
return n && (this.onsuccess = this.onsuccess ? P(n, this.onsuccess) : n), i && (this.onerror = this.onerror ? P(i, this.onerror) : i), r === void 0 ? a === void 0 ? void 0 : a : o(r, a);
|
|
896
863
|
};
|
|
897
864
|
}
|
|
898
|
-
function
|
|
865
|
+
function _e(e, t) {
|
|
899
866
|
return e === N ? t : function() {
|
|
900
867
|
return !1 !== t.apply(this, arguments) && e.apply(this, arguments);
|
|
901
868
|
};
|
|
@@ -912,7 +879,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
912
879
|
return t.apply(this, arguments);
|
|
913
880
|
};
|
|
914
881
|
}
|
|
915
|
-
|
|
882
|
+
T.ModifyError = le, T.DexieError = se, T.BulkError = ue;
|
|
916
883
|
var L = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
|
|
917
884
|
function ye(e) {
|
|
918
885
|
L = e;
|
|
@@ -1090,7 +1057,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1090
1057
|
},
|
|
1091
1058
|
timeout: function(e, t) {
|
|
1092
1059
|
var n = this;
|
|
1093
|
-
return e <
|
|
1060
|
+
return e < 1 / 0 ? new z(function(r, i) {
|
|
1094
1061
|
var a = setTimeout(function() {
|
|
1095
1062
|
return i(new M.Timeout(t));
|
|
1096
1063
|
}, e);
|
|
@@ -1099,7 +1066,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1099
1066
|
}
|
|
1100
1067
|
}), typeof Symbol < "u" && Symbol.toStringTag && f(z.prototype, Symbol.toStringTag, "Dexie.Promise"), Me.env = it(), u(z, {
|
|
1101
1068
|
all: function() {
|
|
1102
|
-
var e =
|
|
1069
|
+
var e = A.apply(null, arguments).map(tt);
|
|
1103
1070
|
return new z(function(t, n) {
|
|
1104
1071
|
e.length === 0 && t([]);
|
|
1105
1072
|
var r = e.length;
|
|
@@ -1117,7 +1084,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1117
1084
|
},
|
|
1118
1085
|
reject: Ke,
|
|
1119
1086
|
race: function() {
|
|
1120
|
-
var e =
|
|
1087
|
+
var e = A.apply(null, arguments).map(tt);
|
|
1121
1088
|
return new z(function(t, n) {
|
|
1122
1089
|
e.map(function(e) {
|
|
1123
1090
|
return z.resolve(e).then(t, n);
|
|
@@ -1171,7 +1138,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1171
1138
|
});
|
|
1172
1139
|
}
|
|
1173
1140
|
}), we && (we.allSettled && f(z, "allSettled", function() {
|
|
1174
|
-
var e =
|
|
1141
|
+
var e = A.apply(null, arguments).map(tt);
|
|
1175
1142
|
return new z(function(t) {
|
|
1176
1143
|
e.length === 0 && t([]);
|
|
1177
1144
|
var n = e.length, r = Array(n);
|
|
@@ -1192,7 +1159,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1192
1159
|
});
|
|
1193
1160
|
});
|
|
1194
1161
|
}), we.any && typeof AggregateError < "u" && f(z, "any", function() {
|
|
1195
|
-
var e =
|
|
1162
|
+
var e = A.apply(null, arguments).map(tt);
|
|
1196
1163
|
return new z(function(t, n) {
|
|
1197
1164
|
e.length === 0 && n(/* @__PURE__ */ AggregateError([]));
|
|
1198
1165
|
var r = e.length, i = Array(r);
|
|
@@ -1296,7 +1263,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1296
1263
|
}
|
|
1297
1264
|
var ht = {
|
|
1298
1265
|
type: 3,
|
|
1299
|
-
lower: -
|
|
1266
|
+
lower: -1 / 0,
|
|
1300
1267
|
lowerOpen: !1,
|
|
1301
1268
|
upper: [[]],
|
|
1302
1269
|
upperOpen: !1
|
|
@@ -1748,7 +1715,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
1748
1715
|
return t;
|
|
1749
1716
|
function s(e, r, o) {
|
|
1750
1717
|
var c, l;
|
|
1751
|
-
if (typeof e != "object") return r ||=
|
|
1718
|
+
if (typeof e != "object") return r ||= _e, l = {
|
|
1752
1719
|
subscribers: [],
|
|
1753
1720
|
fire: o ||= N,
|
|
1754
1721
|
subscribe: function(e) {
|
|
@@ -2081,7 +2048,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
2081
2048
|
});
|
|
2082
2049
|
});
|
|
2083
2050
|
}
|
|
2084
|
-
var c = Dt(n) && n.limit ===
|
|
2051
|
+
var c = Dt(n) && n.limit === 1 / 0 && (typeof e != "function" || h) && {
|
|
2085
2052
|
index: n.index,
|
|
2086
2053
|
range: n.range
|
|
2087
2054
|
};
|
|
@@ -2255,19 +2222,19 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
2255
2222
|
return e === t[0];
|
|
2256
2223
|
}, [e], "");
|
|
2257
2224
|
}, J.prototype.anyOfIgnoreCase = function() {
|
|
2258
|
-
var e =
|
|
2225
|
+
var e = A.apply(k, arguments);
|
|
2259
2226
|
return e.length === 0 ? Rt(this) : zt(this, function(e, t) {
|
|
2260
2227
|
return t.indexOf(e) !== -1;
|
|
2261
2228
|
}, e, "");
|
|
2262
2229
|
}, J.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
2263
|
-
var e =
|
|
2230
|
+
var e = A.apply(k, arguments);
|
|
2264
2231
|
return e.length === 0 ? Rt(this) : zt(this, function(e, t) {
|
|
2265
2232
|
return t.some(function(t) {
|
|
2266
2233
|
return e.indexOf(t) === 0;
|
|
2267
2234
|
});
|
|
2268
2235
|
}, e, ct);
|
|
2269
2236
|
}, J.prototype.anyOf = function() {
|
|
2270
|
-
var e, t, n = this, r =
|
|
2237
|
+
var e, t, n = this, r = A.apply(k, arguments), i = this._cmp;
|
|
2271
2238
|
try {
|
|
2272
2239
|
r.sort(i);
|
|
2273
2240
|
} catch {
|
|
@@ -2284,12 +2251,12 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
2284
2251
|
}), !1);
|
|
2285
2252
|
}), e);
|
|
2286
2253
|
}, J.prototype.notEqual = function(e) {
|
|
2287
|
-
return this.inAnyRange([[-
|
|
2254
|
+
return this.inAnyRange([[-1 / 0, e], [e, this.db._maxKey]], {
|
|
2288
2255
|
includeLowers: !1,
|
|
2289
2256
|
includeUppers: !1
|
|
2290
2257
|
});
|
|
2291
2258
|
}, J.prototype.noneOf = function() {
|
|
2292
|
-
var e =
|
|
2259
|
+
var e = A.apply(k, arguments);
|
|
2293
2260
|
if (e.length === 0) return new this.Collection(this);
|
|
2294
2261
|
try {
|
|
2295
2262
|
e.sort(this._ascending);
|
|
@@ -2297,7 +2264,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
2297
2264
|
return q(this, U);
|
|
2298
2265
|
}
|
|
2299
2266
|
var t = e.reduce(function(e, t) {
|
|
2300
|
-
return e ? e.concat([[e[e.length - 1][1], t]]) : [[-
|
|
2267
|
+
return e ? e.concat([[e[e.length - 1][1], t]]) : [[-1 / 0, t]];
|
|
2301
2268
|
}, null);
|
|
2302
2269
|
return t.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(t, {
|
|
2303
2270
|
includeLowers: !1,
|
|
@@ -2347,7 +2314,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
2347
2314
|
}), !1);
|
|
2348
2315
|
}), t;
|
|
2349
2316
|
}, J.prototype.startsWithAnyOf = function() {
|
|
2350
|
-
var e =
|
|
2317
|
+
var e = A.apply(k, arguments);
|
|
2351
2318
|
return e.every(function(e) {
|
|
2352
2319
|
return typeof e == "string";
|
|
2353
2320
|
}) ? e.length === 0 ? Rt(this) : this.inAnyRange(e.map(function(e) {
|
|
@@ -2421,7 +2388,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
2421
2388
|
return r;
|
|
2422
2389
|
}) : (n._waitingFor = r, n._waitingQueue = [], t = n.idbtrans.objectStore(n.storeNames[0]), function e() {
|
|
2423
2390
|
for (++n._spinCount; n._waitingQueue.length;) n._waitingQueue.shift()();
|
|
2424
|
-
n._waitingFor && (t.get(-
|
|
2391
|
+
n._waitingFor && (t.get(-1 / 0).onsuccess = e);
|
|
2425
2392
|
}()), n._waitingFor);
|
|
2426
2393
|
return new z(function(e, t) {
|
|
2427
2394
|
r.then(function(t) {
|
|
@@ -2582,7 +2549,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
2582
2549
|
query: (t = c, function(e) {
|
|
2583
2550
|
return new Promise(function(i, a) {
|
|
2584
2551
|
i = B(i);
|
|
2585
|
-
var o, s, c, l = e.trans, u = e.values, d = e.limit, f = e.query, p = d ===
|
|
2552
|
+
var o, s, c, l = e.trans, u = e.values, d = e.limit, f = e.query, p = d === 1 / 0 ? void 0 : d, m = f.index, f = f.range, l = l.objectStore(n), l = m.isPrimaryKey ? l : l.index(m.name), m = r(f);
|
|
2586
2553
|
if (d === 0) return i({ result: [] });
|
|
2587
2554
|
t ? ((f = u ? l.getAll(m, p) : l.getAllKeys(m, p)).onsuccess = function(e) {
|
|
2588
2555
|
return i({ result: e.target.result });
|
|
@@ -2694,7 +2661,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
2694
2661
|
if (l[e]) return l[e];
|
|
2695
2662
|
throw Error(`Table '${e}' not found`);
|
|
2696
2663
|
},
|
|
2697
|
-
MIN_KEY: -
|
|
2664
|
+
MIN_KEY: -1 / 0,
|
|
2698
2665
|
MAX_KEY: Zt(t),
|
|
2699
2666
|
schema: s
|
|
2700
2667
|
};
|
|
@@ -2770,7 +2737,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
2770
2737
|
}), e._cfg.contentUpgrade);
|
|
2771
2738
|
if (p && e._cfg.version > a) return an(r, c), s._memoizedTables = {}, t = S(d), f.del.forEach(function(e) {
|
|
2772
2739
|
t[e] = l[e];
|
|
2773
|
-
}), sn(r, [r.Transaction.prototype]), on(r, [r.Transaction.prototype], i(t), t), s.schema = t, (n =
|
|
2740
|
+
}), sn(r, [r.Transaction.prototype]), on(r, [r.Transaction.prototype], i(t), t), s.schema = t, (n = ae(p)) && $e(), d = z.follow(function() {
|
|
2774
2741
|
var e;
|
|
2775
2742
|
(o = p(s)) && n && (e = et.bind(null, null), o.then(e, e));
|
|
2776
2743
|
}), o && typeof o.then == "function" ? z.resolve(o) : d.then(function() {
|
|
@@ -3041,7 +3008,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
3041
3008
|
return i(t).forEach(function(n) {
|
|
3042
3009
|
e[n] ? Tn(e[n], t[n]) : e[n] = function e(t) {
|
|
3043
3010
|
var n, r, i = {};
|
|
3044
|
-
for (n in t) l(t, n) && (r = t[n], i[n] = !r || typeof r != "object" ||
|
|
3011
|
+
for (n in t) l(t, n) && (r = t[n], i[n] = !r || typeof r != "object" || E.has(r.constructor) ? r : e(r));
|
|
3045
3012
|
return i;
|
|
3046
3013
|
}(t[n]);
|
|
3047
3014
|
}), e;
|
|
@@ -3182,8 +3149,8 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
3182
3149
|
var t;
|
|
3183
3150
|
return f && (t = {}, e.tables.forEach(function(n) {
|
|
3184
3151
|
n.schema.indexes.forEach(function(r) {
|
|
3185
|
-
r.name && (t[`idb://${e.name}/${n.name}/${r.name}`] = new Z(-
|
|
3186
|
-
}), t[`idb://${e.name}/${n.name}/`] = t[`idb://${e.name}/${n.name}/:dels`] = new Z(-
|
|
3152
|
+
r.name && (t[`idb://${e.name}/${n.name}/${r.name}`] = new Z(-1 / 0, [[[]]]));
|
|
3153
|
+
}), t[`idb://${e.name}/${n.name}/`] = t[`idb://${e.name}/${n.name}/:dels`] = new Z(-1 / 0, [[[]]]);
|
|
3187
3154
|
}), Kt(Wt).fire(t), In(t, !0)), e;
|
|
3188
3155
|
});
|
|
3189
3156
|
}
|
|
@@ -3361,7 +3328,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
3361
3328
|
return i.mutate(e);
|
|
3362
3329
|
function f(e) {
|
|
3363
3330
|
var r, o, s, f = R.trans, p = e.keys || Un(a, e);
|
|
3364
|
-
if (p) return (e = e.type === "add" || e.type === "put" ? t(t({}, e), { keys: p }) : t({}, e)).type !== "delete" && (e.values = n([], e.values, !0)), e.keys
|
|
3331
|
+
if (p) return (e = e.type === "add" || e.type === "put" ? t(t({}, e), { keys: p }) : t({}, e)).type !== "delete" && (e.values = n([], e.values, !0)), e.keys && (e.keys = n([], e.keys, !0)), r = i, s = p, ((o = e).type === "add" ? Promise.resolve([]) : r.getMany({
|
|
3365
3332
|
trans: o.trans,
|
|
3366
3333
|
keys: s,
|
|
3367
3334
|
cache: "immutable"
|
|
@@ -3608,7 +3575,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
3608
3575
|
return r;
|
|
3609
3576
|
}, e)) === e) ? e : (r.sort(function(e, t) {
|
|
3610
3577
|
return W(f(e), f(t)) || W(u(e), u(t));
|
|
3611
|
-
}), t.limit && t.limit <
|
|
3578
|
+
}), t.limit && t.limit < 1 / 0 && (r.length > t.limit ? r.length = t.limit : e.length === t.limit && r.length < t.limit && (i.dirty = !0)), o ? Object.freeze(r) : r);
|
|
3612
3579
|
}
|
|
3613
3580
|
function $n(e, t) {
|
|
3614
3581
|
return W(e.lower, t.lower) === 0 && W(e.upper, t.upper) === 0 && !!e.lowerOpen == !!t.lowerOpen && !!e.upperOpen == !!t.upperOpen;
|
|
@@ -3638,7 +3605,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
3638
3605
|
e.subscribers.add(n), r.addEventListener("abort", function() {
|
|
3639
3606
|
var r, i;
|
|
3640
3607
|
e.subscribers.delete(n), e.subscribers.size === 0 && (r = e, i = t, setTimeout(function() {
|
|
3641
|
-
r.subscribers.size === 0 &&
|
|
3608
|
+
r.subscribers.size === 0 && O(i, r);
|
|
3642
3609
|
}, 3e3));
|
|
3643
3610
|
});
|
|
3644
3611
|
}
|
|
@@ -3660,16 +3627,16 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
3660
3627
|
var f = e.table(u), p = d.optimisticOps.filter(function(e) {
|
|
3661
3628
|
return e.trans === s;
|
|
3662
3629
|
});
|
|
3663
|
-
if (s._explicit && i && s.mutatedParts) for (var m = 0, h = Object.values(d.queries.query); m < h.length; m++) for (var g = 0, _ = (b = h[m]).slice(); g < _.length; g++) jn((x = _[g]).obsSet, s.mutatedParts) && (
|
|
3630
|
+
if (s._explicit && i && s.mutatedParts) for (var m = 0, h = Object.values(d.queries.query); m < h.length; m++) for (var g = 0, _ = (b = h[m]).slice(); g < _.length; g++) jn((x = _[g]).obsSet, s.mutatedParts) && (O(b, x), x.subscribers.forEach(function(e) {
|
|
3664
3631
|
return o.add(e);
|
|
3665
3632
|
}));
|
|
3666
3633
|
else if (0 < p.length) {
|
|
3667
3634
|
d.optimisticOps = d.optimisticOps.filter(function(e) {
|
|
3668
3635
|
return e.trans !== s;
|
|
3669
3636
|
});
|
|
3670
|
-
for (var v = 0, y = Object.values(d.queries.query); v < y.length; v++) for (var b, x, S, C = 0,
|
|
3637
|
+
for (var v = 0, y = Object.values(d.queries.query); v < y.length; v++) for (var b, x, S, C = 0, w = (b = y[v]).slice(); C < w.length; C++) (x = w[C]).res != null && s.mutatedParts && (i && !x.dirty ? (S = Object.isFrozen(x.res), S = Qn(x.res, x.req, p, f, x, S), x.dirty ? (O(b, x), x.subscribers.forEach(function(e) {
|
|
3671
3638
|
return o.add(e);
|
|
3672
|
-
})) : S !== x.res && (x.res = S, x.promise = z.resolve({ result: S }))) : (x.dirty &&
|
|
3639
|
+
})) : S !== x.res && (x.res = S, x.promise = z.resolve({ result: S }))) : (x.dirty && O(b, x), x.subscribers.forEach(function(e) {
|
|
3673
3640
|
return o.add(e);
|
|
3674
3641
|
})));
|
|
3675
3642
|
}
|
|
@@ -3690,9 +3657,9 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
3690
3657
|
return !a.outbound && s.db._options.cache !== "disabled" && !s.explicit && s.idbtrans.mode === "readwrite" && (o = Mn[`idb://${n}/${r}`]) ? (s = i.mutate(e), e.type !== "add" && e.type !== "put" || !(50 <= e.values.length || Un(a, e).some(function(e) {
|
|
3691
3658
|
return e == null;
|
|
3692
3659
|
})) ? (o.optimisticOps.push(e), e.mutatedParts && Fn(e.mutatedParts), s.then(function(t) {
|
|
3693
|
-
0 < t.numFailures && (
|
|
3660
|
+
0 < t.numFailures && (O(o.optimisticOps, e), (t = Xn(0, e, t)) && o.optimisticOps.push(t), e.mutatedParts) && Fn(e.mutatedParts);
|
|
3694
3661
|
}), s.catch(function() {
|
|
3695
|
-
|
|
3662
|
+
O(o.optimisticOps, e), e.mutatedParts && Fn(e.mutatedParts);
|
|
3696
3663
|
})) : s.then(function(n) {
|
|
3697
3664
|
var r = Xn(0, t(t({}, e), { values: e.values.map(function(e, r) {
|
|
3698
3665
|
var i;
|
|
@@ -3733,7 +3700,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
3733
3700
|
a
|
|
3734
3701
|
] : [
|
|
3735
3702
|
a.find(function(e) {
|
|
3736
|
-
return ("limit" in e.req ? e.req.limit :
|
|
3703
|
+
return ("limit" in e.req ? e.req.limit : 1 / 0) >= r.limit && (!r.values || e.req.values) && er(e.req.query.range, r.query.range);
|
|
3737
3704
|
}),
|
|
3738
3705
|
!1,
|
|
3739
3706
|
i,
|
|
@@ -3756,7 +3723,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
3756
3723
|
} else e.result = D(n);
|
|
3757
3724
|
return e;
|
|
3758
3725
|
}).catch(function(e) {
|
|
3759
|
-
return c && u &&
|
|
3726
|
+
return c && u && O(c, u), Promise.reject(e);
|
|
3760
3727
|
}), u = {
|
|
3761
3728
|
obsSet: e.obsSet,
|
|
3762
3729
|
promise: l,
|
|
@@ -3885,7 +3852,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
3885
3852
|
for (var i = Array(r - 1); --r;) i[r - 1] = arguments[r];
|
|
3886
3853
|
return n = i.pop(), [
|
|
3887
3854
|
e,
|
|
3888
|
-
|
|
3855
|
+
w(i),
|
|
3889
3856
|
n
|
|
3890
3857
|
];
|
|
3891
3858
|
}.apply(this, arguments);
|
|
@@ -3933,7 +3900,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
3933
3900
|
return e(t, n, r, null, a);
|
|
3934
3901
|
})) : H(i);
|
|
3935
3902
|
}
|
|
3936
|
-
var c, l =
|
|
3903
|
+
var c, l = ae(a), o = (l && $e(), z.follow(function() {
|
|
3937
3904
|
var e;
|
|
3938
3905
|
(c = a.call(s, s)) && (l ? (e = et.bind(null, null), c.then(e, e)) : typeof c.next == "function" && typeof c.throw == "function" && (c = zn(c)));
|
|
3939
3906
|
}, o));
|
|
@@ -4022,17 +3989,17 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
4022
3989
|
justLimit: !0,
|
|
4023
3990
|
isMatch: null,
|
|
4024
3991
|
offset: 0,
|
|
4025
|
-
limit:
|
|
3992
|
+
limit: 1 / 0,
|
|
4026
3993
|
error: i,
|
|
4027
3994
|
or: t.or,
|
|
4028
3995
|
valueMapper: a === me ? null : a
|
|
4029
3996
|
};
|
|
4030
3997
|
})), this.Table = (i = this, Et(wt.prototype, function(e, t, n) {
|
|
4031
3998
|
this.db = i, this._tx = n, this.name = e, this.schema = t, this.hook = i._allTables[e] ? i._allTables[e].hook : Tt(null, {
|
|
4032
|
-
creating: [
|
|
3999
|
+
creating: [F, N],
|
|
4033
4000
|
reading: [he, me],
|
|
4034
|
-
updating: [
|
|
4035
|
-
deleting: [
|
|
4001
|
+
updating: [ge, N],
|
|
4002
|
+
deleting: [I, N]
|
|
4036
4003
|
});
|
|
4037
4004
|
})), this.Transaction = (a = this, Et(qt.prototype, function(e, t, n, r, i) {
|
|
4038
4005
|
var o = this;
|
|
@@ -4119,7 +4086,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
4119
4086
|
}
|
|
4120
4087
|
function sr(e) {
|
|
4121
4088
|
var t, n = !1, r = new ar(function(r) {
|
|
4122
|
-
var i =
|
|
4089
|
+
var i = ae(e), a, o = !1, s = {}, c = {}, u = {
|
|
4123
4090
|
get closed() {
|
|
4124
4091
|
return o;
|
|
4125
4092
|
},
|
|
@@ -4177,7 +4144,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
4177
4144
|
dr = t;
|
|
4178
4145
|
}
|
|
4179
4146
|
}
|
|
4180
|
-
u(cr, t(t({},
|
|
4147
|
+
u(cr, t(t({}, T), {
|
|
4181
4148
|
delete: function(e) {
|
|
4182
4149
|
return new cr(e, { addons: [] }).delete();
|
|
4183
4150
|
},
|
|
@@ -4264,7 +4231,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
4264
4231
|
getObjectDiff: Hn,
|
|
4265
4232
|
cmp: W,
|
|
4266
4233
|
asap: y,
|
|
4267
|
-
minKey: -
|
|
4234
|
+
minKey: -1 / 0,
|
|
4268
4235
|
addons: [],
|
|
4269
4236
|
connections: ut,
|
|
4270
4237
|
errnames: de,
|
|
@@ -4294,7 +4261,7 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
4294
4261
|
for (var t = 0, n = ut; t < n.length; t++) n[t].close({ disableAutoOpen: !1 });
|
|
4295
4262
|
}
|
|
4296
4263
|
}), addEventListener("pageshow", function(e) {
|
|
4297
|
-
!Q.disableBfCache && e.persisted && (L && console.debug("Dexie: handling persisted pageshow"), fr(), lr({ all: new Z(-
|
|
4264
|
+
!Q.disableBfCache && e.persisted && (L && console.debug("Dexie: handling persisted pageshow"), fr(), lr({ all: new Z(-1 / 0, [[]]) }));
|
|
4298
4265
|
})), z.rejectionMapper = function(e, t) {
|
|
4299
4266
|
return !e || e instanceof se || e instanceof TypeError || e instanceof SyntaxError || !e.name || !pe[e.name] ? e : (t = new pe[e.name](t || e.message, e), "stack" in e && f(t, "stack", { get: function() {
|
|
4300
4267
|
return this.inner.stack;
|
|
@@ -4321,14 +4288,14 @@ var re = "3.21.3", ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
4321
4288
|
}
|
|
4322
4289
|
}), { default: Q }), Q;
|
|
4323
4290
|
});
|
|
4324
|
-
})))(), 1),
|
|
4325
|
-
if (
|
|
4326
|
-
var { liveQuery:
|
|
4291
|
+
})))(), 1), O = Symbol.for("Dexie"), k = globalThis[O] || (globalThis[O] = ie.default);
|
|
4292
|
+
if (ie.default.semVer !== k.semVer) throw Error(`Two different versions of Dexie loaded in the same app: ${ie.default.semVer} and ${k.semVer}`);
|
|
4293
|
+
var { liveQuery: A, mergeRanges: ae, rangesOverlap: j, RangeSet: oe, cmp: se, Entity: ce, PropModification: le, replacePrefix: ue, add: de, remove: fe, DexieYProvider: M } = k, pe = class {
|
|
4327
4294
|
db;
|
|
4328
4295
|
subscribers = [];
|
|
4329
4296
|
options;
|
|
4330
4297
|
constructor(e) {
|
|
4331
|
-
this.options = e, this.db = new
|
|
4298
|
+
this.options = e, this.db = new k(e.app), this.db.version(19).stores({
|
|
4332
4299
|
channel: "id,slide_index",
|
|
4333
4300
|
cloud: "id,dashboard_id",
|
|
4334
4301
|
dashboard: "id,name,update",
|
|
@@ -4349,14 +4316,14 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4349
4316
|
}
|
|
4350
4317
|
getHash = async (e) => {
|
|
4351
4318
|
let t = await this.db.table("hashtable").where({ id: e.widget }).last().catch(() => {
|
|
4352
|
-
|
|
4319
|
+
w(2, [
|
|
4353
4320
|
"%chash%c %capi%C %chash",
|
|
4354
4321
|
u.API,
|
|
4355
4322
|
u.NONE,
|
|
4356
4323
|
u.APP
|
|
4357
4324
|
]);
|
|
4358
4325
|
});
|
|
4359
|
-
return
|
|
4326
|
+
return w(3, [
|
|
4360
4327
|
"%cget%c %chash%c %chash",
|
|
4361
4328
|
u.OK,
|
|
4362
4329
|
u.NONE,
|
|
@@ -4366,7 +4333,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4366
4333
|
e
|
|
4367
4334
|
]), t?.hash ?? "none";
|
|
4368
4335
|
};
|
|
4369
|
-
setHash = async (e) => await this.db.table("hashtable").where({ id: e.widget }).modify({ hash: e.hash }).then(() => (
|
|
4336
|
+
setHash = async (e) => await this.db.table("hashtable").where({ id: e.widget }).modify({ hash: e.hash }).then(() => (w(3, [
|
|
4370
4337
|
"%cset%c %chash%c %chash}",
|
|
4371
4338
|
u.OK,
|
|
4372
4339
|
u.NONE,
|
|
@@ -4374,7 +4341,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4374
4341
|
u.NONE,
|
|
4375
4342
|
u.WIDGET,
|
|
4376
4343
|
e
|
|
4377
|
-
]), 201)).catch((t) => (
|
|
4344
|
+
]), 201)).catch((t) => (w(2, [
|
|
4378
4345
|
"%cget%c %chash%c %chash",
|
|
4379
4346
|
u.OK,
|
|
4380
4347
|
u.NONE,
|
|
@@ -4384,7 +4351,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4384
4351
|
e,
|
|
4385
4352
|
t.message
|
|
4386
4353
|
]), 400));
|
|
4387
|
-
clearHash = async () => await this.db.table("hashtable").clear().then(() => 201).catch((e) => (
|
|
4354
|
+
clearHash = async () => await this.db.table("hashtable").clear().then(() => 201).catch((e) => (w(2, [
|
|
4388
4355
|
"%cclear%c %cstorage%c %chash",
|
|
4389
4356
|
u.KO,
|
|
4390
4357
|
u.NONE,
|
|
@@ -4393,7 +4360,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4393
4360
|
u.WIDGET,
|
|
4394
4361
|
"clear hashes"
|
|
4395
4362
|
]), 400));
|
|
4396
|
-
deleteHash = async (e) => await this.db.table("hashtable").where({ id: e.widget }).delete().then(() => 201).catch((t) => (
|
|
4363
|
+
deleteHash = async (e) => await this.db.table("hashtable").where({ id: e.widget }).delete().then(() => 201).catch((t) => (w(2, [
|
|
4397
4364
|
"%cdelete%c %cstorage%c %chash",
|
|
4398
4365
|
u.KO,
|
|
4399
4366
|
u.NONE,
|
|
@@ -4406,7 +4373,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4406
4373
|
createHash = async (e) => await this.db.table("hashtable").put({
|
|
4407
4374
|
id: e.widget,
|
|
4408
4375
|
hash: e.hash
|
|
4409
|
-
}).then(() => 201).catch((t) => (
|
|
4376
|
+
}).then(() => 201).catch((t) => (w(2, [
|
|
4410
4377
|
"%cset%c %cstorage%c %chash",
|
|
4411
4378
|
u.KO,
|
|
4412
4379
|
u.NONE,
|
|
@@ -4417,7 +4384,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4417
4384
|
t.message
|
|
4418
4385
|
]), 400));
|
|
4419
4386
|
getCloud = async (e) => {
|
|
4420
|
-
if (e.widget === "") return
|
|
4387
|
+
if (e.widget === "") return w(3, [
|
|
4421
4388
|
"%cget%c %cstorage%c %ccloud",
|
|
4422
4389
|
u.NO_UPDATES,
|
|
4423
4390
|
u.NONE,
|
|
@@ -4432,7 +4399,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4432
4399
|
query: e
|
|
4433
4400
|
};
|
|
4434
4401
|
let t = await this.db.table(l.CLOUD).where({ id: e.widget }).last().catch(() => {
|
|
4435
|
-
|
|
4402
|
+
w(2, [
|
|
4436
4403
|
"%capi%C %ccloud",
|
|
4437
4404
|
u.API,
|
|
4438
4405
|
u.NONE,
|
|
@@ -4452,7 +4419,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4452
4419
|
success: t !== void 0,
|
|
4453
4420
|
query: e
|
|
4454
4421
|
};
|
|
4455
|
-
return
|
|
4422
|
+
return w(3, [
|
|
4456
4423
|
"%cget%c %cstorage%c %ccloud",
|
|
4457
4424
|
u.OK,
|
|
4458
4425
|
u.NONE,
|
|
@@ -4462,7 +4429,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4462
4429
|
n
|
|
4463
4430
|
]), n;
|
|
4464
4431
|
};
|
|
4465
|
-
setCloud = async (e, t) => e.type === l.CLOUD && t !== "" ? (
|
|
4432
|
+
setCloud = async (e, t) => e.type === l.CLOUD && t !== "" ? (w(3, [
|
|
4466
4433
|
"%cset%c %cstorage%c %ccloud",
|
|
4467
4434
|
u.OK,
|
|
4468
4435
|
u.NONE,
|
|
@@ -4475,7 +4442,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4475
4442
|
dashboard_id: e.dashboard,
|
|
4476
4443
|
hash: e.hash,
|
|
4477
4444
|
data: t
|
|
4478
|
-
}).then(() => 201).catch((t) => (
|
|
4445
|
+
}).then(() => 201).catch((t) => (w(2, [
|
|
4479
4446
|
"%cset%c %cstorage%c %ccloud",
|
|
4480
4447
|
u.KO,
|
|
4481
4448
|
u.NONE,
|
|
@@ -4489,7 +4456,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4489
4456
|
data: null,
|
|
4490
4457
|
message: `Bulk add ${t.length} items to ${e}`,
|
|
4491
4458
|
success: !0
|
|
4492
|
-
})).catch((n) => (
|
|
4459
|
+
})).catch((n) => (w(4, [
|
|
4493
4460
|
"%cstorage",
|
|
4494
4461
|
u.STORAGE,
|
|
4495
4462
|
e,
|
|
@@ -4502,7 +4469,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4502
4469
|
}));
|
|
4503
4470
|
get = async (e, t) => {
|
|
4504
4471
|
let n = await this.db.table(e).where({ id: t.id }).last().catch(() => {
|
|
4505
|
-
|
|
4472
|
+
w(2, [
|
|
4506
4473
|
"%cstorage",
|
|
4507
4474
|
u.STORAGE,
|
|
4508
4475
|
`loading ${e}`,
|
|
@@ -4519,7 +4486,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4519
4486
|
data: null,
|
|
4520
4487
|
message: `${e} ${t.id} saved to storage`,
|
|
4521
4488
|
success: !0
|
|
4522
|
-
})).catch((n) => (
|
|
4489
|
+
})).catch((n) => (w(4, [
|
|
4523
4490
|
"%cstorage",
|
|
4524
4491
|
u.STORAGE,
|
|
4525
4492
|
e,
|
|
@@ -4532,7 +4499,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4532
4499
|
}));
|
|
4533
4500
|
getDashboard = async (e) => {
|
|
4534
4501
|
let t = await this.db.table(l.DASHBOARD).where({ id: e.id }).last().catch(() => {
|
|
4535
|
-
|
|
4502
|
+
w(2, [
|
|
4536
4503
|
"%cstorage",
|
|
4537
4504
|
u.STORAGE,
|
|
4538
4505
|
d.DASHBOARD_LOAD,
|
|
@@ -4547,14 +4514,14 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4547
4514
|
};
|
|
4548
4515
|
getDashboards = async (e) => {
|
|
4549
4516
|
let t = (t) => e?.id === t.id, n = (t) => e?.name ? t.name.includes(e?.name) : !1, r = await this.db.table(l.DASHBOARD).toArray().then((n) => e?.id ? n.filter(t) : n).then((t) => e?.name ? t.filter(n) : t).catch(() => {
|
|
4550
|
-
|
|
4517
|
+
w(2, [
|
|
4551
4518
|
"%cstorage",
|
|
4552
4519
|
u.STORAGE,
|
|
4553
4520
|
d.DASHBOARD_LOAD,
|
|
4554
4521
|
e
|
|
4555
4522
|
]);
|
|
4556
4523
|
});
|
|
4557
|
-
return r !== void 0 &&
|
|
4524
|
+
return r !== void 0 && w(3, [
|
|
4558
4525
|
"%cstorage%c %cdashboards",
|
|
4559
4526
|
u.STORAGE,
|
|
4560
4527
|
u.NONE,
|
|
@@ -4580,7 +4547,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4580
4547
|
data: null,
|
|
4581
4548
|
message: `Dashboard ${t.data.id} saved to storage`,
|
|
4582
4549
|
success: !0
|
|
4583
|
-
})).catch((n) => (
|
|
4550
|
+
})).catch((n) => (w(4, [
|
|
4584
4551
|
"%cstorage",
|
|
4585
4552
|
u.STORAGE,
|
|
4586
4553
|
l.WIDGET,
|
|
@@ -4596,7 +4563,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4596
4563
|
data: null,
|
|
4597
4564
|
message: `Dashboard ${e.id} deleted`,
|
|
4598
4565
|
success: !0
|
|
4599
|
-
})).catch((t) => (
|
|
4566
|
+
})).catch((t) => (w(4, [
|
|
4600
4567
|
"%cstorage",
|
|
4601
4568
|
u.STORAGE,
|
|
4602
4569
|
l.DASHBOARD,
|
|
@@ -4621,7 +4588,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4621
4588
|
return await this.db.table(l.TOPICS).orderBy("expires").filter((t) => t.expires < e).delete().catch((e) => (console.error("%cstorage%c %cclean", u.STORAGE, u.NONE, u.MESSAGES, e.message), 0)), await this.db.table(l.MESSAGES).orderBy("expires").filter((t) => t.expires < e).delete().catch((e) => (console.error("%clean%c %cstorage%c %cmessages", u.OK, u.NONE, u.STORAGE, u.NONE, u.MESSAGES, e.message), 0));
|
|
4622
4589
|
};
|
|
4623
4590
|
getMessages = async (e) => {
|
|
4624
|
-
if (e.widget === "") return
|
|
4591
|
+
if (e.widget === "") return w(3, [
|
|
4625
4592
|
"%cget%c %cstorage%c %cmessages",
|
|
4626
4593
|
u.NO_UPDATES,
|
|
4627
4594
|
u.NONE,
|
|
@@ -4636,11 +4603,11 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4636
4603
|
query: e
|
|
4637
4604
|
};
|
|
4638
4605
|
let t = e?.order ?? "utc", n = Math.floor(Date.now() / 1e3), r = e?.period ?? 0;
|
|
4639
|
-
e.since = r === 0 ? n -
|
|
4606
|
+
e.since = r === 0 ? n - 2592e3 : n - r, e.before = this.options.moderation === f.DELAYED && this.options.delay ? n - this.options.delay : n;
|
|
4640
4607
|
let i = (t) => t.utc > (e?.since || 0), a = (t) => t.utc < (e?.before || n);
|
|
4641
4608
|
try {
|
|
4642
4609
|
let n = this.db.table(l.TOPICS).where("widget_id").equals(e.widget).filter(i).filter(a);
|
|
4643
|
-
|
|
4610
|
+
this.options.moderation === f.APPROVED ? n.and((e) => e.approved === 1) : n.and((e) => e.visible === 1), n.reverse();
|
|
4644
4611
|
let r = await n.limit(e?.limit ?? 25).sortBy(t);
|
|
4645
4612
|
if (r.length === 0) return {
|
|
4646
4613
|
data: null,
|
|
@@ -4649,7 +4616,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4649
4616
|
query: e
|
|
4650
4617
|
};
|
|
4651
4618
|
let o = r.map((e) => this.db.table(l.MESSAGES).get({ id: e.message_id }));
|
|
4652
|
-
return
|
|
4619
|
+
return k.Promise.all(o).then(async (t) => {
|
|
4653
4620
|
let n = {
|
|
4654
4621
|
data: { messages: t.map((e) => {
|
|
4655
4622
|
if (e !== void 0) return e.data;
|
|
@@ -4658,7 +4625,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4658
4625
|
message: "Messages retrieved successfully",
|
|
4659
4626
|
success: !0
|
|
4660
4627
|
};
|
|
4661
|
-
return
|
|
4628
|
+
return w(3, [
|
|
4662
4629
|
"%cget%c %cstorage%c %cmessages",
|
|
4663
4630
|
u.OK,
|
|
4664
4631
|
u.NONE,
|
|
@@ -4669,7 +4636,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4669
4636
|
]), n;
|
|
4670
4637
|
});
|
|
4671
4638
|
} catch (t) {
|
|
4672
|
-
return
|
|
4639
|
+
return w(2, [
|
|
4673
4640
|
"%cget%c %cstorage%c %cmessages",
|
|
4674
4641
|
u.OK,
|
|
4675
4642
|
u.NONE,
|
|
@@ -4688,10 +4655,13 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4688
4655
|
hideMessage = async (e, t) => {
|
|
4689
4656
|
await this.db.table(l.TOPICS).where("message_id").equals(e).modify({ visible: +!!t }).catch((e) => (console.error("%chide%c %cstorage%c %cmessage", u.KO, u.NONE, u.STORAGE, u.NONE, u.HIDE, e.message), 0));
|
|
4690
4657
|
};
|
|
4658
|
+
approveMessage = async (e, t) => {
|
|
4659
|
+
await this.db.table(l.TOPICS).where("message_id").equals(e).modify({ approved: +!!t }).catch((e) => (console.error("%capprove%c %cstorage%c %cmessage", u.KO, u.NONE, u.STORAGE, u.NONE, u.OK, e.message), 0));
|
|
4660
|
+
};
|
|
4691
4661
|
setMessages = async (e, t) => {
|
|
4692
4662
|
if (e.type !== l.MESSAGES) return 400;
|
|
4693
4663
|
let n = t.data.title, r = 0;
|
|
4694
|
-
return
|
|
4664
|
+
return w(3, [
|
|
4695
4665
|
"%cset%c %cstorage%c %cmessages",
|
|
4696
4666
|
u.OK,
|
|
4697
4667
|
u.NONE,
|
|
@@ -4714,7 +4684,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4714
4684
|
data: i,
|
|
4715
4685
|
expires: i.expires
|
|
4716
4686
|
}).catch((e) => {
|
|
4717
|
-
r++,
|
|
4687
|
+
r++, w(4, [
|
|
4718
4688
|
"%cset%c %cstorage",
|
|
4719
4689
|
u.KO,
|
|
4720
4690
|
u.NONE,
|
|
@@ -4740,7 +4710,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4740
4710
|
expires: i.expires
|
|
4741
4711
|
};
|
|
4742
4712
|
await this.db.table(l.TOPICS).put(a).catch((e) => {
|
|
4743
|
-
r++,
|
|
4713
|
+
r++, w(4, [
|
|
4744
4714
|
"%cset%c %cstorage",
|
|
4745
4715
|
u.KO,
|
|
4746
4716
|
u.NONE,
|
|
@@ -4756,7 +4726,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4756
4726
|
visible: n,
|
|
4757
4727
|
approve: i
|
|
4758
4728
|
}).catch((t) => {
|
|
4759
|
-
r++,
|
|
4729
|
+
r++, w(4, [
|
|
4760
4730
|
"%cset%c %cstorage",
|
|
4761
4731
|
u.KO,
|
|
4762
4732
|
u.NONE,
|
|
@@ -4772,7 +4742,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4772
4742
|
}), r === 0 ? 201 : 400;
|
|
4773
4743
|
};
|
|
4774
4744
|
getSeries = async (e) => {
|
|
4775
|
-
if (e.widget === "") return
|
|
4745
|
+
if (e.widget === "") return w(3, [
|
|
4776
4746
|
"%cget%c %cstorage%c %cseries",
|
|
4777
4747
|
u.NO_UPDATES,
|
|
4778
4748
|
u.NONE,
|
|
@@ -4787,7 +4757,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4787
4757
|
query: e
|
|
4788
4758
|
};
|
|
4789
4759
|
let t = await this.db.table(l.SERIES).where({ id: e.widget }).last().catch(() => {
|
|
4790
|
-
|
|
4760
|
+
w(2, [
|
|
4791
4761
|
"%cget%c %cstorage%c %cseries",
|
|
4792
4762
|
u.KO,
|
|
4793
4763
|
u.NONE,
|
|
@@ -4802,7 +4772,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4802
4772
|
success: t !== void 0,
|
|
4803
4773
|
query: e
|
|
4804
4774
|
};
|
|
4805
|
-
return
|
|
4775
|
+
return w(3, [
|
|
4806
4776
|
"%cget%c %cstorage%c %cseries",
|
|
4807
4777
|
u.OK,
|
|
4808
4778
|
u.NONE,
|
|
@@ -4812,7 +4782,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4812
4782
|
n
|
|
4813
4783
|
]), n;
|
|
4814
4784
|
};
|
|
4815
|
-
setSeries = async (e, t) => (delete t?.query, e.type === l.SERIES && t !== "" ? (
|
|
4785
|
+
setSeries = async (e, t) => (delete t?.query, e.type === l.SERIES && t !== "" ? (w(3, [
|
|
4816
4786
|
"%cset%c %cstorage%c %cseries",
|
|
4817
4787
|
u.OK,
|
|
4818
4788
|
u.NONE,
|
|
@@ -4825,7 +4795,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4825
4795
|
dashboard_id: e.dashboard,
|
|
4826
4796
|
hash: e.hash,
|
|
4827
4797
|
data: t
|
|
4828
|
-
}).then(() => 201).catch((t) => (
|
|
4798
|
+
}).then(() => 201).catch((t) => (w(2, [
|
|
4829
4799
|
"%cset%c %cstorage%c %cseries",
|
|
4830
4800
|
u.KO,
|
|
4831
4801
|
u.NONE,
|
|
@@ -4836,7 +4806,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4836
4806
|
t.message
|
|
4837
4807
|
]), 400))) : 400);
|
|
4838
4808
|
getWidget = async (e) => {
|
|
4839
|
-
if (e.id === "") return
|
|
4809
|
+
if (e.id === "") return w(3, [
|
|
4840
4810
|
"%cget%c %cstorage%c %cwidget",
|
|
4841
4811
|
u.KO,
|
|
4842
4812
|
u.NONE,
|
|
@@ -4861,14 +4831,14 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4861
4831
|
};
|
|
4862
4832
|
getWidgets = async (e) => {
|
|
4863
4833
|
let t = (t) => e?.dashboard === t.dashboard_id, n = (t) => e?.type === t.type, r = (t) => e?.name ? t.name.includes(e?.name) : !1, i = await this.db.table(l.WIDGET).toArray().then((n) => e?.dashboard ? n.filter(t) : n).then((t) => e?.type ? t.filter(n) : t).then((t) => e?.name ? t.filter(r) : t).catch(() => {
|
|
4864
|
-
|
|
4834
|
+
w(2, [
|
|
4865
4835
|
"%cstorage",
|
|
4866
4836
|
u.STORAGE,
|
|
4867
4837
|
d.WIDGET_LOAD,
|
|
4868
4838
|
e
|
|
4869
4839
|
]);
|
|
4870
4840
|
});
|
|
4871
|
-
return i !== void 0 &&
|
|
4841
|
+
return i !== void 0 && w(3, [
|
|
4872
4842
|
"%cstorage%c %cwidgets",
|
|
4873
4843
|
u.STORAGE,
|
|
4874
4844
|
u.NONE,
|
|
@@ -4916,11 +4886,11 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4916
4886
|
message: `Widgets table deleted error: ${e.message}`,
|
|
4917
4887
|
success: !1
|
|
4918
4888
|
}));
|
|
4919
|
-
subscribe = (e) => (e =
|
|
4889
|
+
subscribe = (e) => (e = ee(e), this.subscribers.filter((t) => t.widget === e.widget).length > 0 ? null : (e.type === l.MESSAGES && (e = D(this.options, e)), console.info("%cstorage%c %csubscribe", u.STORAGE, u.NONE, u.SUBSCRIBE, e.slide, e.widget), console.debug("%cstorage%c %csubscribe", u.STORAGE, u.NONE, u.SUBSCRIBE, e), this.subscribers.push(e), null));
|
|
4920
4890
|
getSubscribers = async () => await new Promise((e) => e(this.subscribers));
|
|
4921
4891
|
getSlide = async (e) => {
|
|
4922
4892
|
let t = await this.db.table(l.SLIDE).where({ id: e.id }).last().catch(() => {
|
|
4923
|
-
|
|
4893
|
+
w(2, [
|
|
4924
4894
|
"%cstorage",
|
|
4925
4895
|
u.STORAGE,
|
|
4926
4896
|
d.SLIDE_LOAD,
|
|
@@ -4936,7 +4906,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4936
4906
|
};
|
|
4937
4907
|
getSlides = async (e) => {
|
|
4938
4908
|
let t = (t) => e?.id ? t.id === e.id : !1, n = (t) => e?.name ? t.name.includes(e?.name) : !1, r = (t) => e?.presentation_id ? t.presentation_id === e.presentation_id : !1, i = await this.db.table(l.SLIDE).toArray().then((t) => e?.presentation_id ? t.filter(r) : t).then((n) => e?.id ? n.filter(t) : n).then((t) => e?.name ? t.filter(n) : t);
|
|
4939
|
-
return i && i.sort((e, t) => e.order_index - t.order_index), i !== void 0 &&
|
|
4909
|
+
return i && i.sort((e, t) => e.order_index - t.order_index), i !== void 0 && w(3, [
|
|
4940
4910
|
"%cstorage%c %cslides",
|
|
4941
4911
|
u.STORAGE,
|
|
4942
4912
|
u.NONE,
|
|
@@ -4996,7 +4966,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
4996
4966
|
};
|
|
4997
4967
|
getPresentations = async (e) => {
|
|
4998
4968
|
let t = (t) => e?.name ? t.name.includes(e?.name) : !1, n = await this.db.table(l.PRESENTATION).toArray().then((n) => e?.name ? n.filter(t) : n);
|
|
4999
|
-
return n !== void 0 &&
|
|
4969
|
+
return n !== void 0 && w(3, [
|
|
5000
4970
|
"%cstorage%c %cpresentations",
|
|
5001
4971
|
u.STORAGE,
|
|
5002
4972
|
u.NONE,
|
|
@@ -5045,7 +5015,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
5045
5015
|
}));
|
|
5046
5016
|
getPreference = async (e) => {
|
|
5047
5017
|
let t = await this.db.table(l.PREFERENCE).where({ id: e.id }).last().catch(() => {
|
|
5048
|
-
|
|
5018
|
+
w(2, [
|
|
5049
5019
|
"%cstorage",
|
|
5050
5020
|
u.STORAGE,
|
|
5051
5021
|
d.PREFERENCE_LOAD,
|
|
@@ -5064,7 +5034,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
5064
5034
|
};
|
|
5065
5035
|
getPreferences = async (e) => {
|
|
5066
5036
|
let t = (t) => e?.id ? e.id = t.id : !1, n = await this.db.table(l.PREFERENCE).toArray().then((n) => e?.id ? n.filter(t) : n);
|
|
5067
|
-
return n !== void 0 &&
|
|
5037
|
+
return n !== void 0 && w(3, [
|
|
5068
5038
|
"%cstorage%c %cpreferences",
|
|
5069
5039
|
u.STORAGE,
|
|
5070
5040
|
u.NONE,
|
|
@@ -5103,7 +5073,7 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
5103
5073
|
}));
|
|
5104
5074
|
getImages = async (e) => {
|
|
5105
5075
|
let t = (t) => e?.id ? t.includes(e.id) : !1, n = await this.db.table(l.IMAGES).toArray().then((n) => e?.id ? n.filter(t) : n);
|
|
5106
|
-
return n !== void 0 &&
|
|
5076
|
+
return n !== void 0 && w(3, [
|
|
5107
5077
|
"%cstorage%c %cimages",
|
|
5108
5078
|
u.STORAGE,
|
|
5109
5079
|
u.NONE,
|
|
@@ -5137,34 +5107,34 @@ var { liveQuery: j, mergeRanges: oe, rangesOverlap: se, RangeSet: ce, cmp: le, E
|
|
|
5137
5107
|
};
|
|
5138
5108
|
//#endregion
|
|
5139
5109
|
//#region node_modules/idb-keyval/dist/index.js
|
|
5140
|
-
function
|
|
5110
|
+
function N(e) {
|
|
5141
5111
|
return new Promise((t, n) => {
|
|
5142
5112
|
e.oncomplete = e.onsuccess = () => t(e.result), e.onabort = e.onerror = () => n(e.error);
|
|
5143
5113
|
});
|
|
5144
5114
|
}
|
|
5145
|
-
function
|
|
5115
|
+
function me(e, t) {
|
|
5146
5116
|
let n, r = () => {
|
|
5147
5117
|
if (n) return n;
|
|
5148
5118
|
let r = indexedDB.open(e);
|
|
5149
|
-
return r.onupgradeneeded = () => r.result.createObjectStore(t), n =
|
|
5119
|
+
return r.onupgradeneeded = () => r.result.createObjectStore(t), n = N(r), n.then((e) => {
|
|
5150
5120
|
e.onclose = () => n = void 0;
|
|
5151
5121
|
}, () => {}), n;
|
|
5152
5122
|
};
|
|
5153
5123
|
return (e, n) => r().then((r) => n(r.transaction(t, e).objectStore(t)));
|
|
5154
5124
|
}
|
|
5155
|
-
var
|
|
5156
|
-
function
|
|
5157
|
-
return
|
|
5125
|
+
var he;
|
|
5126
|
+
function P() {
|
|
5127
|
+
return he ||= me("keyval-store", "keyval"), he;
|
|
5158
5128
|
}
|
|
5159
|
-
function F(e, t =
|
|
5160
|
-
return t("readonly", (t) =>
|
|
5129
|
+
function F(e, t = P()) {
|
|
5130
|
+
return t("readonly", (t) => N(t.get(e)));
|
|
5161
5131
|
}
|
|
5162
|
-
function I(e, t, n =
|
|
5163
|
-
return n("readwrite", (n) => (n.put(t, e),
|
|
5132
|
+
function I(e, t, n = P()) {
|
|
5133
|
+
return n("readwrite", (n) => (n.put(t, e), N(n.transaction)));
|
|
5164
5134
|
}
|
|
5165
5135
|
//#endregion
|
|
5166
5136
|
//#region src/storage/keyval.ts
|
|
5167
|
-
var
|
|
5137
|
+
var ge = class {
|
|
5168
5138
|
subscribers = [];
|
|
5169
5139
|
options;
|
|
5170
5140
|
constructor(e) {
|
|
@@ -5175,41 +5145,44 @@ var ve = class {
|
|
|
5175
5145
|
createHash = async (e) => 404;
|
|
5176
5146
|
clearHash = async () => 404;
|
|
5177
5147
|
deleteHash = async (e) => 404;
|
|
5178
|
-
getCloud = async (e) => await F(
|
|
5148
|
+
getCloud = async (e) => await F(E(e)).then((e) => e).catch(() => (console.warn("%capi", u.API, l.CLOUD, e.slide, e.widget), {
|
|
5179
5149
|
data: null,
|
|
5180
5150
|
message: "Cloud Data error",
|
|
5181
5151
|
success: !1
|
|
5182
5152
|
}));
|
|
5183
|
-
getSeries = async (e) => await F(
|
|
5153
|
+
getSeries = async (e) => await F(E(e)).then((e) => e).catch(() => (console.warn("%capi", u.API, l.SERIES, e.slide, e.widget), {
|
|
5184
5154
|
data: null,
|
|
5185
5155
|
message: "Series Data error",
|
|
5186
5156
|
success: !1
|
|
5187
5157
|
}));
|
|
5188
|
-
getMessages = async (e) => await F(
|
|
5158
|
+
getMessages = async (e) => await F(E(e)).then((e) => e).catch(() => (console.warn("%capi", u.API, l.MESSAGES, e.slide, e.widget), {
|
|
5189
5159
|
data: null,
|
|
5190
5160
|
message: "Messages Data error",
|
|
5191
5161
|
success: !1
|
|
5192
5162
|
}));
|
|
5193
5163
|
setCloud = async (e, t) => {
|
|
5194
5164
|
if (!t.success) return 400;
|
|
5195
|
-
let n =
|
|
5165
|
+
let n = E(e);
|
|
5196
5166
|
return delete t.success, delete t.message, await I(n, t).then(() => 201).catch((t) => (console.error("%cstorage", u.STORAGE, l.CLOUD, e, t.message), 400));
|
|
5197
5167
|
};
|
|
5198
5168
|
setSeries = async (e, t) => {
|
|
5199
5169
|
if (!t.success) return 400;
|
|
5200
|
-
let n =
|
|
5170
|
+
let n = E(e);
|
|
5201
5171
|
return delete t.success, delete t.message, await I(n, t).then(() => 201).catch((t) => (console.error("%cstorage", u.STORAGE, l.SERIES, e, t.message), 400));
|
|
5202
5172
|
};
|
|
5203
5173
|
setMessages = async (e, t) => {
|
|
5204
5174
|
if (!t.success) return 400;
|
|
5205
|
-
let n =
|
|
5175
|
+
let n = E(e);
|
|
5206
5176
|
return delete t.success, delete t.message, await I(n, t).then(() => 201).catch((t) => (console.error("%cstorage", u.STORAGE, l.MESSAGES, e, t.message), 400));
|
|
5207
5177
|
};
|
|
5208
5178
|
cleanMessages = async (e) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((e) => e(0)));
|
|
5209
5179
|
hideMessage = async (e, t) => {
|
|
5210
5180
|
console.debug(`hideMessage ${e} ${t} not implemented for ${this.options.storage}`);
|
|
5211
5181
|
};
|
|
5212
|
-
|
|
5182
|
+
approveMessage = async (e, t) => {
|
|
5183
|
+
console.debug(`approveMessage ${e} ${t} not implemented for ${this.options.storage}`);
|
|
5184
|
+
};
|
|
5185
|
+
getDashboard = async (e) => await F(E(e)).then((e) => e).catch((t) => (console.warn("%capi", u.API, l.SLIDE, e.id), {
|
|
5213
5186
|
data: null,
|
|
5214
5187
|
message: `Widget ${e.data.id} load error: ${t.message}`,
|
|
5215
5188
|
success: !1
|
|
@@ -5219,7 +5192,7 @@ var ve = class {
|
|
|
5219
5192
|
message: "Dashboards get error: ",
|
|
5220
5193
|
success: !1
|
|
5221
5194
|
});
|
|
5222
|
-
setDashboard = async (e) => await I(
|
|
5195
|
+
setDashboard = async (e) => await I(E(e), {
|
|
5223
5196
|
id: e.dashboard,
|
|
5224
5197
|
name: e.name
|
|
5225
5198
|
}).then(() => ({
|
|
@@ -5231,7 +5204,7 @@ var ve = class {
|
|
|
5231
5204
|
message: `Slide ${e.data.id} save error: ${t.message}`,
|
|
5232
5205
|
success: !1
|
|
5233
5206
|
}));
|
|
5234
|
-
getWidget = async (e) => await F(
|
|
5207
|
+
getWidget = async (e) => await F(E(e)).then((e) => e).catch((t) => (console.warn("%capi", u.API, l.SLIDE, e.id), {
|
|
5235
5208
|
data: null,
|
|
5236
5209
|
message: `Widget ${e.data.id} load error: ${t.message}`,
|
|
5237
5210
|
success: !1
|
|
@@ -5241,7 +5214,7 @@ var ve = class {
|
|
|
5241
5214
|
message: "Widgets load error: ",
|
|
5242
5215
|
success: !1
|
|
5243
5216
|
});
|
|
5244
|
-
setWidget = async (e) => await I(
|
|
5217
|
+
setWidget = async (e) => await I(E(e), {
|
|
5245
5218
|
id: e.widget,
|
|
5246
5219
|
name: e.name,
|
|
5247
5220
|
dashboard_id: e.dashboard,
|
|
@@ -5274,9 +5247,9 @@ var ve = class {
|
|
|
5274
5247
|
deleteSlides = async () => 404;
|
|
5275
5248
|
deletePresentation = async (e) => 404;
|
|
5276
5249
|
deletePresentations = async () => 404;
|
|
5277
|
-
subscribe = (e) => (e.type === l.MESSAGES && (e =
|
|
5250
|
+
subscribe = (e) => (e.type === l.MESSAGES && (e = D(this.options, e)), this.subscribers.filter((t) => t.widget === e.widget).length > 0 ? null : (console.debug("%cstorage%c %csubscribe", u.STORAGE, u.NONE, u.SUBSCRIBE, e.slide, e.widget), this.subscribers.push(e), null));
|
|
5278
5251
|
getSubscribers = async () => await new Promise((e) => e(this.subscribers));
|
|
5279
|
-
getSlide = async (e) => await F(
|
|
5252
|
+
getSlide = async (e) => await F(E(e)).then((e) => e).catch((t) => (console.warn("%capi", u.API, l.SLIDE, e.id), {
|
|
5280
5253
|
data: null,
|
|
5281
5254
|
message: `Slide ${e.data.id} load error: ${t.message}`,
|
|
5282
5255
|
success: !1
|
|
@@ -5286,7 +5259,7 @@ var ve = class {
|
|
|
5286
5259
|
message: `Slided ${e.presentation} load error: `,
|
|
5287
5260
|
success: !1
|
|
5288
5261
|
});
|
|
5289
|
-
setSlide = async (e) => await I(
|
|
5262
|
+
setSlide = async (e) => await I(E(e), {
|
|
5290
5263
|
id: e.data.id,
|
|
5291
5264
|
title: e.data.title || "Not set",
|
|
5292
5265
|
json: e.data.json || {},
|
|
@@ -5300,7 +5273,7 @@ var ve = class {
|
|
|
5300
5273
|
message: `Slide ${e.data.id} save error: ${t.message}`,
|
|
5301
5274
|
success: !1
|
|
5302
5275
|
}));
|
|
5303
|
-
getPresentation = async (e) => await F(
|
|
5276
|
+
getPresentation = async (e) => await F(E(e)).then((e) => e).catch((t) => (console.warn("%capi", u.API, l.PRESENTATION, e.id), {
|
|
5304
5277
|
data: null,
|
|
5305
5278
|
message: `Slide ${e.data.id} load error: ${t.message}`,
|
|
5306
5279
|
success: !1
|
|
@@ -5311,7 +5284,7 @@ var ve = class {
|
|
|
5311
5284
|
success: !1
|
|
5312
5285
|
});
|
|
5313
5286
|
setPresentation = async (e) => {
|
|
5314
|
-
let t =
|
|
5287
|
+
let t = E(e), n = e.data;
|
|
5315
5288
|
return await I(t, n).then(() => ({
|
|
5316
5289
|
data: null,
|
|
5317
5290
|
message: `Presentation ${e.data.id} saved to storage`,
|
|
@@ -5351,14 +5324,14 @@ var ve = class {
|
|
|
5351
5324
|
message: `Image ${e.id} saved`,
|
|
5352
5325
|
success: !1
|
|
5353
5326
|
});
|
|
5354
|
-
},
|
|
5327
|
+
}, _e = class {
|
|
5355
5328
|
subscribers = [];
|
|
5356
5329
|
options;
|
|
5357
5330
|
constructor(e) {
|
|
5358
5331
|
this.options = e, Storage.prototype.setObject = function(e, t) {
|
|
5359
|
-
this.
|
|
5332
|
+
this.setItem(e, JSON.stringify(t));
|
|
5360
5333
|
}, Storage.prototype.getObject = function(e) {
|
|
5361
|
-
let t = this.
|
|
5334
|
+
let t = this.getItem(e);
|
|
5362
5335
|
return t && JSON.parse(t);
|
|
5363
5336
|
};
|
|
5364
5337
|
}
|
|
@@ -5368,7 +5341,7 @@ var ve = class {
|
|
|
5368
5341
|
clearHash = async () => 404;
|
|
5369
5342
|
deleteHash = async (e) => 404;
|
|
5370
5343
|
getCloud = async (e) => {
|
|
5371
|
-
let t =
|
|
5344
|
+
let t = E(e);
|
|
5372
5345
|
try {
|
|
5373
5346
|
return localStorage.getObject(t);
|
|
5374
5347
|
} catch (t) {
|
|
@@ -5380,7 +5353,7 @@ var ve = class {
|
|
|
5380
5353
|
}
|
|
5381
5354
|
};
|
|
5382
5355
|
getSeries = async (e) => {
|
|
5383
|
-
let t =
|
|
5356
|
+
let t = E(e);
|
|
5384
5357
|
try {
|
|
5385
5358
|
return localStorage.getObject(t);
|
|
5386
5359
|
} catch (t) {
|
|
@@ -5392,7 +5365,7 @@ var ve = class {
|
|
|
5392
5365
|
}
|
|
5393
5366
|
};
|
|
5394
5367
|
getMessages = async (e) => {
|
|
5395
|
-
let t =
|
|
5368
|
+
let t = E(e);
|
|
5396
5369
|
try {
|
|
5397
5370
|
return localStorage.getObject(t);
|
|
5398
5371
|
} catch (t) {
|
|
@@ -5407,7 +5380,7 @@ var ve = class {
|
|
|
5407
5380
|
get = async (e, t) => 404;
|
|
5408
5381
|
set = async (e, t) => 404;
|
|
5409
5382
|
setCloud = async (e, t) => {
|
|
5410
|
-
let n =
|
|
5383
|
+
let n = E(e);
|
|
5411
5384
|
try {
|
|
5412
5385
|
return localStorage.setObject(n, t), 201;
|
|
5413
5386
|
} catch (t) {
|
|
@@ -5415,7 +5388,7 @@ var ve = class {
|
|
|
5415
5388
|
}
|
|
5416
5389
|
};
|
|
5417
5390
|
setSeries = async (e, t) => {
|
|
5418
|
-
let n =
|
|
5391
|
+
let n = E(e);
|
|
5419
5392
|
try {
|
|
5420
5393
|
return localStorage.setObject(n, t), 201;
|
|
5421
5394
|
} catch (t) {
|
|
@@ -5423,7 +5396,7 @@ var ve = class {
|
|
|
5423
5396
|
}
|
|
5424
5397
|
};
|
|
5425
5398
|
setMessages = async (e, t) => {
|
|
5426
|
-
let n =
|
|
5399
|
+
let n = E(e);
|
|
5427
5400
|
try {
|
|
5428
5401
|
return localStorage.setObject(n, t), 200;
|
|
5429
5402
|
} catch (t) {
|
|
@@ -5434,6 +5407,9 @@ var ve = class {
|
|
|
5434
5407
|
hideMessage = async (e, t) => {
|
|
5435
5408
|
console.debug(`hideMessage ${e} ${t} not implemented for ${this.options.storage}`);
|
|
5436
5409
|
};
|
|
5410
|
+
approveMessage = async (e, t) => {
|
|
5411
|
+
console.debug(`approveMessage ${e} ${t} not implemented for ${this.options.storage}`);
|
|
5412
|
+
};
|
|
5437
5413
|
getDashboard = async (e) => {
|
|
5438
5414
|
try {
|
|
5439
5415
|
return localStorage.getObject(`${l.DASHBOARD}.${e.id}`);
|
|
@@ -5506,7 +5482,7 @@ var ve = class {
|
|
|
5506
5482
|
deleteSlides = async () => 404;
|
|
5507
5483
|
deletePresentation = async (e) => 404;
|
|
5508
5484
|
deletePresentations = async () => 404;
|
|
5509
|
-
subscribe = (e) => (e.type === l.MESSAGES && (e =
|
|
5485
|
+
subscribe = (e) => (e.type === l.MESSAGES && (e = D(this.options, e)), this.subscribers.filter((t) => t.widget === e.widget).length ? null : (console.debug("%cstorage%c %csubscribe", u.STORAGE, u.NONE, u.SUBSCRIBE, e.slide, e.widget), this.subscribers.push(e), null));
|
|
5510
5486
|
getSubscribers = async () => await new Promise((e) => e(this.subscribers));
|
|
5511
5487
|
getSlide = async (e) => {
|
|
5512
5488
|
try {
|
|
@@ -5634,7 +5610,7 @@ var ve = class {
|
|
|
5634
5610
|
message: `Image ${e.id} saved `,
|
|
5635
5611
|
success: !1
|
|
5636
5612
|
});
|
|
5637
|
-
},
|
|
5613
|
+
}, ve = class {
|
|
5638
5614
|
subscribers = [];
|
|
5639
5615
|
options;
|
|
5640
5616
|
constructor(e) {
|
|
@@ -5651,7 +5627,7 @@ var ve = class {
|
|
|
5651
5627
|
clearHash = async () => 404;
|
|
5652
5628
|
deleteHash = async (e) => 404;
|
|
5653
5629
|
getCloud = async (e) => {
|
|
5654
|
-
let t =
|
|
5630
|
+
let t = E(e);
|
|
5655
5631
|
try {
|
|
5656
5632
|
return sessionStorage.getObject(t);
|
|
5657
5633
|
} catch (t) {
|
|
@@ -5663,7 +5639,7 @@ var ve = class {
|
|
|
5663
5639
|
}
|
|
5664
5640
|
};
|
|
5665
5641
|
getSeries = async (e) => {
|
|
5666
|
-
let t =
|
|
5642
|
+
let t = E(e);
|
|
5667
5643
|
try {
|
|
5668
5644
|
return sessionStorage.getObject(t);
|
|
5669
5645
|
} catch (t) {
|
|
@@ -5675,7 +5651,7 @@ var ve = class {
|
|
|
5675
5651
|
}
|
|
5676
5652
|
};
|
|
5677
5653
|
getMessages = async (e) => {
|
|
5678
|
-
let t =
|
|
5654
|
+
let t = E(e);
|
|
5679
5655
|
try {
|
|
5680
5656
|
return sessionStorage.getObject(t);
|
|
5681
5657
|
} catch (t) {
|
|
@@ -5687,7 +5663,7 @@ var ve = class {
|
|
|
5687
5663
|
}
|
|
5688
5664
|
};
|
|
5689
5665
|
setCloud = async (e, t) => {
|
|
5690
|
-
let n =
|
|
5666
|
+
let n = E(e);
|
|
5691
5667
|
try {
|
|
5692
5668
|
return sessionStorage.setObject(n, t), 201;
|
|
5693
5669
|
} catch (t) {
|
|
@@ -5695,7 +5671,7 @@ var ve = class {
|
|
|
5695
5671
|
}
|
|
5696
5672
|
};
|
|
5697
5673
|
setSeries = async (e, t) => {
|
|
5698
|
-
let n =
|
|
5674
|
+
let n = E(e);
|
|
5699
5675
|
try {
|
|
5700
5676
|
return sessionStorage.setObject(n, t), 201;
|
|
5701
5677
|
} catch (t) {
|
|
@@ -5703,7 +5679,7 @@ var ve = class {
|
|
|
5703
5679
|
}
|
|
5704
5680
|
};
|
|
5705
5681
|
setMessages = async (e, t) => {
|
|
5706
|
-
let n =
|
|
5682
|
+
let n = E(e);
|
|
5707
5683
|
try {
|
|
5708
5684
|
return sessionStorage.setObject(n, t), 200;
|
|
5709
5685
|
} catch (t) {
|
|
@@ -5714,6 +5690,9 @@ var ve = class {
|
|
|
5714
5690
|
hideMessage = async (e, t) => {
|
|
5715
5691
|
console.debug(`hideMessage ${e} ${t} not implemented for ${this.options.storage}`);
|
|
5716
5692
|
};
|
|
5693
|
+
approveMessage = async (e, t) => {
|
|
5694
|
+
console.debug(`approveMessage ${e} ${t} not implemented for ${this.options.storage}`);
|
|
5695
|
+
};
|
|
5717
5696
|
bulk = async (e, t) => 404;
|
|
5718
5697
|
get = async (e, t) => 404;
|
|
5719
5698
|
set = async (e, t) => 404;
|
|
@@ -5789,7 +5768,7 @@ var ve = class {
|
|
|
5789
5768
|
deleteSlides = async () => 404;
|
|
5790
5769
|
deletePresentation = async (e) => 404;
|
|
5791
5770
|
deletePresentations = async () => 404;
|
|
5792
|
-
subscribe = (e) => (e.type === l.MESSAGES && (e =
|
|
5771
|
+
subscribe = (e) => (e.type === l.MESSAGES && (e = D(this.options, e)), this.subscribers.filter((t) => t.widget === e.widget).length ? null : (console.debug("%cstorage%c %csubscribe", u.STORAGE, u.NONE, u.SUBSCRIBE, e.slide, e.widget), this.subscribers.push(e), null));
|
|
5793
5772
|
getSubscribers = async () => await new Promise((e) => e(this.subscribers));
|
|
5794
5773
|
getSlide = async (e) => {
|
|
5795
5774
|
try {
|
|
@@ -5917,7 +5896,7 @@ var ve = class {
|
|
|
5917
5896
|
message: `Image ${e.id} saved`,
|
|
5918
5897
|
success: !1
|
|
5919
5898
|
});
|
|
5920
|
-
},
|
|
5899
|
+
}, L = class {
|
|
5921
5900
|
subscribers = [];
|
|
5922
5901
|
options;
|
|
5923
5902
|
constructor(e) {
|
|
@@ -5929,7 +5908,7 @@ var ve = class {
|
|
|
5929
5908
|
clearHash = async () => 404;
|
|
5930
5909
|
deleteHash = async (e) => 404;
|
|
5931
5910
|
getCloud = async (e) => {
|
|
5932
|
-
let t =
|
|
5911
|
+
let t = E(e);
|
|
5933
5912
|
try {
|
|
5934
5913
|
return window.__bc.WidgetData[t];
|
|
5935
5914
|
} catch (t) {
|
|
@@ -5941,7 +5920,7 @@ var ve = class {
|
|
|
5941
5920
|
}
|
|
5942
5921
|
};
|
|
5943
5922
|
getSeries = async (e) => {
|
|
5944
|
-
let t =
|
|
5923
|
+
let t = E(e);
|
|
5945
5924
|
try {
|
|
5946
5925
|
return window.__bc.WidgetData[t];
|
|
5947
5926
|
} catch (t) {
|
|
@@ -5953,7 +5932,7 @@ var ve = class {
|
|
|
5953
5932
|
}
|
|
5954
5933
|
};
|
|
5955
5934
|
getMessages = async (e) => {
|
|
5956
|
-
let t =
|
|
5935
|
+
let t = E(e);
|
|
5957
5936
|
try {
|
|
5958
5937
|
return window.__bc.WidgetData[t];
|
|
5959
5938
|
} catch (t) {
|
|
@@ -5965,7 +5944,7 @@ var ve = class {
|
|
|
5965
5944
|
}
|
|
5966
5945
|
};
|
|
5967
5946
|
setCloud = async (e, t) => {
|
|
5968
|
-
let n =
|
|
5947
|
+
let n = E(e);
|
|
5969
5948
|
try {
|
|
5970
5949
|
return window.__bc.WidgetData[n] = t, 201;
|
|
5971
5950
|
} catch (t) {
|
|
@@ -5973,7 +5952,7 @@ var ve = class {
|
|
|
5973
5952
|
}
|
|
5974
5953
|
};
|
|
5975
5954
|
setSeries = async (e, t) => {
|
|
5976
|
-
let n =
|
|
5955
|
+
let n = E(e);
|
|
5977
5956
|
try {
|
|
5978
5957
|
return window.__bc.WidgetData[n] = t, 201;
|
|
5979
5958
|
} catch (t) {
|
|
@@ -5981,7 +5960,7 @@ var ve = class {
|
|
|
5981
5960
|
}
|
|
5982
5961
|
};
|
|
5983
5962
|
setMessages = async (e, t) => {
|
|
5984
|
-
let n =
|
|
5963
|
+
let n = E(e);
|
|
5985
5964
|
try {
|
|
5986
5965
|
return window.__bc.WidgetData[n] = t, 201;
|
|
5987
5966
|
} catch (t) {
|
|
@@ -5992,6 +5971,9 @@ var ve = class {
|
|
|
5992
5971
|
hideMessage = async (e, t) => {
|
|
5993
5972
|
console.debug(`hideMessage ${e} ${t} not implemented for ${this.options.storage}`);
|
|
5994
5973
|
};
|
|
5974
|
+
approveMessage = async (e, t) => {
|
|
5975
|
+
console.debug(`approveMessage ${e} ${t} not implemented for ${this.options.storage}`);
|
|
5976
|
+
};
|
|
5995
5977
|
bulk = async (e, t) => 404;
|
|
5996
5978
|
get = async (e, t) => 404;
|
|
5997
5979
|
set = async (e, t) => 404;
|
|
@@ -6067,7 +6049,7 @@ var ve = class {
|
|
|
6067
6049
|
deleteSlides = async () => 404;
|
|
6068
6050
|
deletePresentation = async (e) => 404;
|
|
6069
6051
|
deletePresentations = async () => 404;
|
|
6070
|
-
subscribe = (e) => (e.type === l.MESSAGES && (e =
|
|
6052
|
+
subscribe = (e) => (e.type === l.MESSAGES && (e = D(this.options, e)), this.subscribers.filter((t) => t.widget === e.widget).length ? null : (console.debug("%cstorage%c %csubscribe", u.STORAGE, u.NONE, u.SUBSCRIBE, e.slide, e.widget), this.subscribers.push(e), null));
|
|
6071
6053
|
getSubscribers = async () => await new Promise((e) => e(this.subscribers));
|
|
6072
6054
|
getSlide = async (e) => {
|
|
6073
6055
|
try {
|
|
@@ -6196,36 +6178,33 @@ var ve = class {
|
|
|
6196
6178
|
message: `Image ${e.name} saved`,
|
|
6197
6179
|
success: !1
|
|
6198
6180
|
});
|
|
6199
|
-
},
|
|
6181
|
+
}, ye = class {
|
|
6200
6182
|
sm;
|
|
6201
6183
|
api;
|
|
6202
6184
|
bc;
|
|
6203
6185
|
options;
|
|
6204
6186
|
subscribers = [];
|
|
6205
6187
|
constructor(e) {
|
|
6206
|
-
switch (
|
|
6188
|
+
switch (w(3, [
|
|
6207
6189
|
"%cpresentation",
|
|
6208
6190
|
u.PRESENTATION,
|
|
6209
6191
|
e.presentation,
|
|
6210
6192
|
d.VERSION,
|
|
6211
|
-
|
|
6212
|
-
]), this.options = e, this.sm = null, this.bc = new BroadcastChannel(this.options.presentation), this.api = new
|
|
6193
|
+
te
|
|
6194
|
+
]), this.options = e, this.sm = null, this.bc = new BroadcastChannel(this.options.presentation), this.api = new re(e), e.storage) {
|
|
6213
6195
|
case p.DEXIE:
|
|
6214
|
-
this.sm = new
|
|
6196
|
+
this.sm = new pe(e);
|
|
6215
6197
|
break;
|
|
6216
6198
|
case p.LOCAL:
|
|
6217
|
-
this.sm = new
|
|
6199
|
+
this.sm = new _e(e);
|
|
6218
6200
|
break;
|
|
6219
6201
|
case p.SESSION:
|
|
6220
|
-
this.sm = new L(e);
|
|
6221
|
-
break;
|
|
6222
|
-
case p.KEYVAL:
|
|
6223
6202
|
this.sm = new ve(e);
|
|
6224
6203
|
break;
|
|
6225
|
-
case p.
|
|
6226
|
-
this.sm = new
|
|
6204
|
+
case p.KEYVAL:
|
|
6205
|
+
this.sm = new ge(e);
|
|
6227
6206
|
break;
|
|
6228
|
-
|
|
6207
|
+
case p.WINDOW: this.sm = new L(e);
|
|
6229
6208
|
}
|
|
6230
6209
|
}
|
|
6231
6210
|
addSubscriber(e) {
|
|
@@ -6235,7 +6214,7 @@ var ve = class {
|
|
|
6235
6214
|
delete this.subscribers[e.widget];
|
|
6236
6215
|
}
|
|
6237
6216
|
update = async (e) => {
|
|
6238
|
-
if (
|
|
6217
|
+
if (w(3, [
|
|
6239
6218
|
"%cupdate%c %cdata",
|
|
6240
6219
|
u.NO_UPDATES,
|
|
6241
6220
|
u.NONE,
|
|
@@ -6268,7 +6247,7 @@ var ve = class {
|
|
|
6268
6247
|
let o = e.query;
|
|
6269
6248
|
switch (o.type) {
|
|
6270
6249
|
case l.MESSAGES:
|
|
6271
|
-
a = await this.sm?.getHash(o), a === "none" && (o.hash = "temp", await this.sm?.createHash(o)), e.data.messages = e.data.messages.filter((e) => e.id !== null), i = e.data.messages.length > 0 ? x(e.data.messages[0].utc) : "none", a === i && t.refresh === !1 ? (
|
|
6250
|
+
a = await this.sm?.getHash(o), a === "none" && (o.hash = "temp", await this.sm?.createHash(o)), e.data.messages = e.data.messages.filter((e) => e.id !== null), i = e.data.messages.length > 0 ? x(e.data.messages[0].utc) : "none", a === i && t.refresh === !1 ? (w(3, [
|
|
6272
6251
|
"%cset%c %cstorage%c %cmessages",
|
|
6273
6252
|
u.NO_UPDATES,
|
|
6274
6253
|
u.NONE,
|
|
@@ -6280,7 +6259,7 @@ var ve = class {
|
|
|
6280
6259
|
]), r.code = 204) : this.sm === null ? r.code = 500 : (o.hash = i, await this.sm?.setHash(o), r.code = await this.sm.setMessages(e.query, e).then(async (n) => (t.refresh && n === 204 && (n = 201), this.broadcastUpdate(n, e), n)).catch((e) => 500));
|
|
6281
6260
|
break;
|
|
6282
6261
|
case l.CLOUD:
|
|
6283
|
-
a = await this.sm?.getHash(o), a === "none" && (o.hash = "temp", await this.sm?.createHash(o)), i = x(e.data.cloud), a === i && t.refresh === !1 ? (
|
|
6262
|
+
a = await this.sm?.getHash(o), a === "none" && (o.hash = "temp", await this.sm?.createHash(o)), i = x(e.data.cloud), a === i && t.refresh === !1 ? (w(3, [
|
|
6284
6263
|
"%cset%c %cstorage%c %ccloud",
|
|
6285
6264
|
u.NO_UPDATES,
|
|
6286
6265
|
u.NONE,
|
|
@@ -6289,7 +6268,7 @@ var ve = class {
|
|
|
6289
6268
|
u.CLOUD,
|
|
6290
6269
|
e.data?.title ?? o.widget,
|
|
6291
6270
|
`same hash:${i}`
|
|
6292
|
-
]),
|
|
6271
|
+
]), w(4, [
|
|
6293
6272
|
"%cdebug%c %ccloud",
|
|
6294
6273
|
u.NO_UPDATES,
|
|
6295
6274
|
u.NONE,
|
|
@@ -6306,7 +6285,7 @@ var ve = class {
|
|
|
6306
6285
|
}, this.sm === null ? r.code = 500 : r.code = await this.sm.setCloud(e.query, n.data).then((n) => (t.refresh && n === 204 && (n = 201), this.broadcastUpdate(n, e), n)).catch((e) => 500));
|
|
6307
6286
|
break;
|
|
6308
6287
|
case l.SERIES:
|
|
6309
|
-
a = await this.sm?.getHash(o), a === "none" && (o.hash = "temp", await this.sm?.createHash(o)), i = x(e.data.series), a === i && t.refresh === !1 ? (
|
|
6288
|
+
a = await this.sm?.getHash(o), a === "none" && (o.hash = "temp", await this.sm?.createHash(o)), i = x(e.data.series), a === i && t.refresh === !1 ? (w(3, [
|
|
6310
6289
|
"%cset%c %cstorage%c %cseries",
|
|
6311
6290
|
u.NO_UPDATES,
|
|
6312
6291
|
u.NONE,
|
|
@@ -6315,7 +6294,7 @@ var ve = class {
|
|
|
6315
6294
|
u.SERIES,
|
|
6316
6295
|
e.data?.title ?? e.query.widget,
|
|
6317
6296
|
`same hash:${i}`
|
|
6318
|
-
]),
|
|
6297
|
+
]), w(4, [
|
|
6319
6298
|
"%cdebug%c %cseries",
|
|
6320
6299
|
u.NO_UPDATES,
|
|
6321
6300
|
u.NONE,
|
|
@@ -6331,7 +6310,7 @@ var ve = class {
|
|
|
6331
6310
|
query: e.query
|
|
6332
6311
|
}, this.sm === null ? r.code = 500 : r.code = await this.sm.setSeries(o, e.data).then((n) => (t.refresh && n === 204 && (n = 201), this.broadcastUpdate(n, e), n)).catch((e) => 500));
|
|
6333
6312
|
break;
|
|
6334
|
-
default:
|
|
6313
|
+
default: w(3, [
|
|
6335
6314
|
`%cfetch%c %capi% %c${o.type} `,
|
|
6336
6315
|
u.KO,
|
|
6337
6316
|
u.NONE,
|
|
@@ -6344,7 +6323,7 @@ var ve = class {
|
|
|
6344
6323
|
hash: i
|
|
6345
6324
|
};
|
|
6346
6325
|
}
|
|
6347
|
-
} else switch (
|
|
6326
|
+
} else switch (w(3, [
|
|
6348
6327
|
`%cset%c %c${e.query.type}%c %cunauthorized`,
|
|
6349
6328
|
u.KO,
|
|
6350
6329
|
u.NONE,
|
|
@@ -6379,7 +6358,7 @@ var ve = class {
|
|
|
6379
6358
|
};
|
|
6380
6359
|
startBroadcastListener = () => {
|
|
6381
6360
|
let e = this.options.presentation;
|
|
6382
|
-
|
|
6361
|
+
w(3, [
|
|
6383
6362
|
"%cchannel%c %capi",
|
|
6384
6363
|
u.BROADCAST,
|
|
6385
6364
|
u.NONE,
|
|
@@ -6401,15 +6380,15 @@ var ve = class {
|
|
|
6401
6380
|
broadcastUpdate = (e, t) => {
|
|
6402
6381
|
switch (e) {
|
|
6403
6382
|
case 201:
|
|
6404
|
-
|
|
6383
|
+
w(3, [
|
|
6405
6384
|
`%cupdate%c %cwidget%c %c${t.query?.type}`,
|
|
6406
6385
|
u.BROADCAST,
|
|
6407
6386
|
u.NONE,
|
|
6408
6387
|
u.WIDGET,
|
|
6409
6388
|
u.NONE,
|
|
6410
|
-
|
|
6389
|
+
T(t.query),
|
|
6411
6390
|
`${t?.data?.title ?? ""} ${t.query.widget}`
|
|
6412
|
-
]),
|
|
6391
|
+
]), w(4, [
|
|
6413
6392
|
"%cdebug%c %cevent",
|
|
6414
6393
|
u.NO_UPDATES,
|
|
6415
6394
|
u.NONE,
|
|
@@ -6421,18 +6400,16 @@ var ve = class {
|
|
|
6421
6400
|
});
|
|
6422
6401
|
break;
|
|
6423
6402
|
case 204: break;
|
|
6424
|
-
default:
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
]);
|
|
6435
|
-
break;
|
|
6403
|
+
default: w(2, [
|
|
6404
|
+
`%cupdate%c %cwidget%c %c${t.query?.type}`,
|
|
6405
|
+
u.KO,
|
|
6406
|
+
u.NONE,
|
|
6407
|
+
u.WIDGET,
|
|
6408
|
+
u.NONE,
|
|
6409
|
+
T(t.query),
|
|
6410
|
+
"Fetch error",
|
|
6411
|
+
t.query
|
|
6412
|
+
]);
|
|
6436
6413
|
}
|
|
6437
6414
|
};
|
|
6438
6415
|
hide = (e) => {
|
|
@@ -6442,18 +6419,21 @@ var ve = class {
|
|
|
6442
6419
|
switch (e.data.event) {
|
|
6443
6420
|
case d.SUBSCRIBE:
|
|
6444
6421
|
let t = e.data.data;
|
|
6445
|
-
t.widget !== void 0 && (
|
|
6422
|
+
t.widget !== void 0 && (w(3, [
|
|
6446
6423
|
`%csubscribe%c %cwidget%c %c${e.data.data.type}`,
|
|
6447
6424
|
u.BROADCAST,
|
|
6448
6425
|
u.NONE,
|
|
6449
6426
|
u.WIDGET,
|
|
6450
6427
|
u.NONE,
|
|
6451
|
-
|
|
6428
|
+
T(t),
|
|
6452
6429
|
t
|
|
6453
6430
|
]), this.addSubscriber(t));
|
|
6454
6431
|
break;
|
|
6432
|
+
case d.UNSUBSCRIBE:
|
|
6433
|
+
e.data.data.widget !== void 0 && this.deleteSubscriber(e.data.data);
|
|
6434
|
+
break;
|
|
6455
6435
|
case d.UPDATE:
|
|
6456
|
-
|
|
6436
|
+
w(3, [
|
|
6457
6437
|
"%cupdate%c %capi%c %cstorage",
|
|
6458
6438
|
u.BROADCAST,
|
|
6459
6439
|
u.NONE,
|
|
@@ -6463,23 +6443,20 @@ var ve = class {
|
|
|
6463
6443
|
e.data
|
|
6464
6444
|
]), await this.update(e.data.data);
|
|
6465
6445
|
break;
|
|
6466
|
-
case "stream":
|
|
6467
|
-
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
|
|
6474
|
-
|
|
6475
|
-
]), await this.stream();
|
|
6476
|
-
break;
|
|
6477
|
-
default:
|
|
6446
|
+
case "stream": w(3, [
|
|
6447
|
+
"%cupdate%c %capi%c %cstorage",
|
|
6448
|
+
u.BROADCAST,
|
|
6449
|
+
u.NONE,
|
|
6450
|
+
u.API,
|
|
6451
|
+
u.NONE,
|
|
6452
|
+
u.STORAGE,
|
|
6453
|
+
e.data
|
|
6454
|
+
]), await this.stream();
|
|
6478
6455
|
}
|
|
6479
6456
|
};
|
|
6480
6457
|
cleanMessages = async () => {
|
|
6481
6458
|
if (this.options?.suspended) {
|
|
6482
|
-
|
|
6459
|
+
w(2, [
|
|
6483
6460
|
"%cclean%c %cstorage%c %cmessages",
|
|
6484
6461
|
u.KO,
|
|
6485
6462
|
u.NONE,
|
|
@@ -6490,8 +6467,8 @@ var ve = class {
|
|
|
6490
6467
|
]);
|
|
6491
6468
|
return;
|
|
6492
6469
|
}
|
|
6493
|
-
let e = this.options?.retention ||
|
|
6494
|
-
|
|
6470
|
+
let e = this.options?.retention || 3456e3, t = await this.sm?.cleanMessages(e);
|
|
6471
|
+
w(3, [
|
|
6495
6472
|
"%cclean%c %cstorage%c %cmessages",
|
|
6496
6473
|
u.OK,
|
|
6497
6474
|
u.NONE,
|
|
@@ -6503,7 +6480,7 @@ var ve = class {
|
|
|
6503
6480
|
};
|
|
6504
6481
|
hideMessage = async (e) => {
|
|
6505
6482
|
let t = await this.sm?.hideMessage(e.id, 0);
|
|
6506
|
-
return
|
|
6483
|
+
return w(3, [
|
|
6507
6484
|
"%chide%c %cstorage%c %cmessages",
|
|
6508
6485
|
u.OK,
|
|
6509
6486
|
u.NONE,
|
|
@@ -6514,6 +6491,18 @@ var ve = class {
|
|
|
6514
6491
|
]), await this.api.hideMessage(e);
|
|
6515
6492
|
};
|
|
6516
6493
|
hideLabels = async (e) => await this.api.hideLabels(e);
|
|
6494
|
+
approveMessage = async (e) => {
|
|
6495
|
+
let t = await this.sm?.approveMessage(e.id, +!!e.approved);
|
|
6496
|
+
w(3, [
|
|
6497
|
+
"%capprove%c %cstorage%c %cmessages",
|
|
6498
|
+
u.OK,
|
|
6499
|
+
u.NONE,
|
|
6500
|
+
u.STORAGE,
|
|
6501
|
+
u.NONE,
|
|
6502
|
+
u.MESSAGES,
|
|
6503
|
+
`${t} messages approved`
|
|
6504
|
+
]);
|
|
6505
|
+
};
|
|
6517
6506
|
getSubscribers = async () => await new Promise((e) => e(this.subscribers));
|
|
6518
6507
|
deleteSubscribers = async () => (this.subscribers = [], await new Promise((e) => e(this.subscribers)));
|
|
6519
6508
|
bulk = async (e, t) => await this.sm?.bulk(e, t);
|
|
@@ -6557,26 +6546,23 @@ var ve = class {
|
|
|
6557
6546
|
getHash = async (e, t) => await this.sm?.getHash(t);
|
|
6558
6547
|
setHash = async (e, t) => await this.sm?.setHash(t) ?? 400;
|
|
6559
6548
|
clearHash = async () => await this.sm?.clearHash() ?? 400;
|
|
6560
|
-
},
|
|
6549
|
+
}, be = class {
|
|
6561
6550
|
sm;
|
|
6562
6551
|
constructor(e) {
|
|
6563
6552
|
switch (this.sm = null, e.storage) {
|
|
6564
6553
|
case p.DEXIE:
|
|
6565
|
-
this.sm = new
|
|
6554
|
+
this.sm = new pe(e);
|
|
6566
6555
|
break;
|
|
6567
6556
|
case p.LOCAL:
|
|
6568
|
-
this.sm = new
|
|
6557
|
+
this.sm = new _e(e);
|
|
6569
6558
|
break;
|
|
6570
6559
|
case p.SESSION:
|
|
6571
|
-
this.sm = new L(e);
|
|
6572
|
-
break;
|
|
6573
|
-
case p.KEYVAL:
|
|
6574
6560
|
this.sm = new ve(e);
|
|
6575
6561
|
break;
|
|
6576
|
-
case p.
|
|
6577
|
-
this.sm = new
|
|
6562
|
+
case p.KEYVAL:
|
|
6563
|
+
this.sm = new ge(e);
|
|
6578
6564
|
break;
|
|
6579
|
-
|
|
6565
|
+
case p.WINDOW: this.sm = new L(e);
|
|
6580
6566
|
}
|
|
6581
6567
|
}
|
|
6582
6568
|
getCloud = async (e) => e.type === l.CLOUD ? await this.sm?.getCloud(e) : (console.warn("%cget%c %cstorage%c %ccloud", u.KO, u.NONE, u.STORAGE, u.NONE, u.CLOUD, e.widget, "wrong method call for getCloud, type used is", e.type), {
|
|
@@ -6594,7 +6580,7 @@ var ve = class {
|
|
|
6594
6580
|
message: `'wrong method call for getSeries, type used is ${e.type}`,
|
|
6595
6581
|
success: !1
|
|
6596
6582
|
});
|
|
6597
|
-
},
|
|
6583
|
+
}, xe = class {
|
|
6598
6584
|
storageReader;
|
|
6599
6585
|
broadcastChannel;
|
|
6600
6586
|
element;
|
|
@@ -6605,7 +6591,7 @@ var ve = class {
|
|
|
6605
6591
|
let r = { ...e.dataset };
|
|
6606
6592
|
delete r.hmr;
|
|
6607
6593
|
let i = window.__bc.opts;
|
|
6608
|
-
r.presentation = i?.presentation ?? `${n} not found`, this.query = r, h(e), this.storageReader = new
|
|
6594
|
+
r.presentation = i?.presentation ?? `${n} not found`, this.query = r, h(e), this.storageReader = new be(i), this.broadcastChannel = new BroadcastChannel(r.presentation), this.broadcastListener();
|
|
6609
6595
|
}
|
|
6610
6596
|
addCallbackListener(e) {
|
|
6611
6597
|
this.callbacks.push(e);
|
|
@@ -6619,20 +6605,20 @@ var ve = class {
|
|
|
6619
6605
|
try {
|
|
6620
6606
|
if (n.dashboard === e.dashboard && n.widget === e.widget) {
|
|
6621
6607
|
let e = await this.getData();
|
|
6622
|
-
e?.success && (
|
|
6608
|
+
e?.success && (w(4, [
|
|
6623
6609
|
`%cset%c %cwidget%c %c${this.query.type}`,
|
|
6624
6610
|
u.OK,
|
|
6625
6611
|
u.NONE,
|
|
6626
6612
|
u.WIDGET,
|
|
6627
6613
|
u.NONE,
|
|
6628
|
-
|
|
6614
|
+
T(this.query),
|
|
6629
6615
|
this.query
|
|
6630
6616
|
]), this.callbacks.forEach(async (t) => {
|
|
6631
6617
|
t(e);
|
|
6632
6618
|
}));
|
|
6633
6619
|
}
|
|
6634
6620
|
} catch (e) {
|
|
6635
|
-
|
|
6621
|
+
w(4, [
|
|
6636
6622
|
d.WIDGET_UPDATE,
|
|
6637
6623
|
n,
|
|
6638
6624
|
e.message,
|
|
@@ -6640,10 +6626,7 @@ var ve = class {
|
|
|
6640
6626
|
]);
|
|
6641
6627
|
}
|
|
6642
6628
|
break;
|
|
6643
|
-
case d.APP_READY:
|
|
6644
|
-
this.subscribe();
|
|
6645
|
-
break;
|
|
6646
|
-
default:
|
|
6629
|
+
case d.APP_READY: this.subscribe();
|
|
6647
6630
|
}
|
|
6648
6631
|
};
|
|
6649
6632
|
}
|
|
@@ -6651,15 +6634,15 @@ var ve = class {
|
|
|
6651
6634
|
this.query.dashboard?.length && this.query.widget?.length && this.query.type?.length && (this.broadcastChannel.postMessage({
|
|
6652
6635
|
event: d.SUBSCRIBE,
|
|
6653
6636
|
data: this.query
|
|
6654
|
-
}),
|
|
6637
|
+
}), w(3, [
|
|
6655
6638
|
`%csubscribe%c %cwidget%c %c${this.query.type}`,
|
|
6656
6639
|
u.SUBSCRIBE,
|
|
6657
6640
|
u.NONE,
|
|
6658
6641
|
u.WIDGET,
|
|
6659
6642
|
u.NONE,
|
|
6660
|
-
|
|
6643
|
+
T(this.query),
|
|
6661
6644
|
this.query.widget
|
|
6662
|
-
]),
|
|
6645
|
+
]), w(4, [
|
|
6663
6646
|
"%cdebug%c %cwidget",
|
|
6664
6647
|
u.NO_UPDATES,
|
|
6665
6648
|
u.NONE,
|
|
@@ -6667,6 +6650,20 @@ var ve = class {
|
|
|
6667
6650
|
this.query
|
|
6668
6651
|
]));
|
|
6669
6652
|
}
|
|
6653
|
+
unsubscribe() {
|
|
6654
|
+
this.query.widget?.length && (this.broadcastChannel.postMessage({
|
|
6655
|
+
event: d.UNSUBSCRIBE,
|
|
6656
|
+
data: this.query
|
|
6657
|
+
}), w(3, [
|
|
6658
|
+
`%cunsubscribe%c %cwidget%c %c${this.query.type}`,
|
|
6659
|
+
u.SUBSCRIBE,
|
|
6660
|
+
u.NONE,
|
|
6661
|
+
u.WIDGET,
|
|
6662
|
+
u.NONE,
|
|
6663
|
+
T(this.query),
|
|
6664
|
+
this.query.widget
|
|
6665
|
+
]));
|
|
6666
|
+
}
|
|
6670
6667
|
getData = async () => {
|
|
6671
6668
|
switch (this.query.type) {
|
|
6672
6669
|
case l.CLOUD: return await this.getCloud();
|
|
@@ -6680,7 +6677,7 @@ var ve = class {
|
|
|
6680
6677
|
query: this.query
|
|
6681
6678
|
};
|
|
6682
6679
|
};
|
|
6683
|
-
getCloud = async () => this.query.type === l.CLOUD ? await this.storageReader.getCloud(this.query) : (
|
|
6680
|
+
getCloud = async () => this.query.type === l.CLOUD ? await this.storageReader.getCloud(this.query) : (w(3, [
|
|
6684
6681
|
"%cget%c %cstorage%c %cwidget",
|
|
6685
6682
|
u.KO,
|
|
6686
6683
|
u.NONE,
|
|
@@ -6690,7 +6687,7 @@ var ve = class {
|
|
|
6690
6687
|
this.query.widget,
|
|
6691
6688
|
"Wrong method call for getCloud, expected type is",
|
|
6692
6689
|
this.query.type
|
|
6693
|
-
]),
|
|
6690
|
+
]), w(4, [
|
|
6694
6691
|
"%cdebug%c %ccloud",
|
|
6695
6692
|
u.NO_UPDATES,
|
|
6696
6693
|
u.NONE,
|
|
@@ -6702,7 +6699,7 @@ var ve = class {
|
|
|
6702
6699
|
success: !1,
|
|
6703
6700
|
query: this.query
|
|
6704
6701
|
});
|
|
6705
|
-
getMessages = async () => this.query.type === l.MESSAGES ? await this.storageReader.getMessages(this.query) : (
|
|
6702
|
+
getMessages = async () => this.query.type === l.MESSAGES ? await this.storageReader.getMessages(this.query) : (w(3, [
|
|
6706
6703
|
"%cget%c %cstorage%c %cwidget",
|
|
6707
6704
|
u.KO,
|
|
6708
6705
|
u.NONE,
|
|
@@ -6712,7 +6709,7 @@ var ve = class {
|
|
|
6712
6709
|
this.query.widget,
|
|
6713
6710
|
"Wrong method call for getMessages, expected type is",
|
|
6714
6711
|
this.query.type
|
|
6715
|
-
]),
|
|
6712
|
+
]), w(4, [
|
|
6716
6713
|
"%debug%c %cmessages",
|
|
6717
6714
|
u.NO_UPDATES,
|
|
6718
6715
|
u.NONE,
|
|
@@ -6723,7 +6720,7 @@ var ve = class {
|
|
|
6723
6720
|
message: `wrong method call for getMessages, expected type is '${this.query.type}'`,
|
|
6724
6721
|
success: !1
|
|
6725
6722
|
});
|
|
6726
|
-
getSeries = async () => this.query.type === l.SERIES ? await this.storageReader.getSeries(this.query) : (
|
|
6723
|
+
getSeries = async () => this.query.type === l.SERIES ? await this.storageReader.getSeries(this.query) : (w(3, [
|
|
6727
6724
|
"%cget%c %cstorage%c %cwidget",
|
|
6728
6725
|
u.KO,
|
|
6729
6726
|
u.NONE,
|
|
@@ -6733,7 +6730,7 @@ var ve = class {
|
|
|
6733
6730
|
this.query.widget,
|
|
6734
6731
|
"Wrong method call for getSeries, expected type is",
|
|
6735
6732
|
this.query.type
|
|
6736
|
-
]),
|
|
6733
|
+
]), w(4, [
|
|
6737
6734
|
"%cdebug%c %cseries",
|
|
6738
6735
|
u.NO_UPDATES,
|
|
6739
6736
|
u.NONE,
|
|
@@ -6746,7 +6743,7 @@ var ve = class {
|
|
|
6746
6743
|
query: this.query
|
|
6747
6744
|
});
|
|
6748
6745
|
showModal = (e) => {
|
|
6749
|
-
|
|
6746
|
+
w(3, [
|
|
6750
6747
|
"%cmodal%c %cwidget",
|
|
6751
6748
|
u.OK,
|
|
6752
6749
|
u.NONE,
|
|
@@ -6768,8 +6765,8 @@ var ve = class {
|
|
|
6768
6765
|
window.dispatchEvent(t);
|
|
6769
6766
|
};
|
|
6770
6767
|
destroy() {
|
|
6771
|
-
this.broadcastChannel.close();
|
|
6768
|
+
this.unsubscribe(), this.broadcastChannel.close();
|
|
6772
6769
|
}
|
|
6773
6770
|
};
|
|
6774
6771
|
//#endregion
|
|
6775
|
-
export {
|
|
6772
|
+
export { ye as BuzzcastingStorageManager, be as BuzzcastingStorageReader, xe as Widget };
|