buzzcasting-storage 2.5.7 → 2.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,7 @@
1
1
  export declare const API_CSS = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;";
2
2
 
3
+ export declare type ApiData = ISeries & IMessages & ICloud;
4
+
3
5
  export declare const APP_CSS = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;";
4
6
 
5
7
  export declare const BROADCAST_CSS = "color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;";
@@ -40,11 +42,6 @@ export declare class BuzzcastingStorageReader {
40
42
  getSeries: (query: IQuery) => Promise<IResponse>;
41
43
  }
42
44
 
43
- export declare interface Category {
44
- type: string;
45
- data: string[];
46
- }
47
-
48
45
  export declare const CLOUD = "cloud";
49
46
 
50
47
  export declare const CLOUD_CSS = "color:grey;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;";
@@ -53,6 +50,11 @@ export declare const GET_DATA = "color:black;background-color:lime;padding:0 4px
53
50
 
54
51
  export declare const HIDE_CSS = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;";
55
52
 
53
+ export declare interface ICategory {
54
+ type: string;
55
+ data: string[];
56
+ }
57
+
56
58
  /**
57
59
  * Cloud
58
60
  */
@@ -99,6 +101,10 @@ export declare interface IGeo {
99
101
  country: string;
100
102
  }
101
103
 
104
+ export declare interface IIndicators {
105
+ value: number;
106
+ }
107
+
102
108
  export declare interface ILabel {
103
109
  label: string;
104
110
  count: number;
@@ -130,8 +136,8 @@ export declare interface IMessage {
130
136
  content: string;
131
137
  sentiment: number;
132
138
  link: string;
133
- language: string;
134
- region: string;
139
+ language?: string;
140
+ region?: string;
135
141
  topics: ITopic[];
136
142
  dynamics?: IDynamics;
137
143
  geo?: IGeo;
@@ -147,8 +153,10 @@ export declare interface IMessages {
147
153
  query: IQuery;
148
154
  }
149
155
 
150
- export declare interface Indicators {
151
- value: number;
156
+ export declare interface IMetrics {
157
+ doc?: number;
158
+ previous?: number;
159
+ change?: number;
152
160
  }
153
161
 
154
162
  /**
@@ -189,19 +197,20 @@ export declare interface IResponse {
189
197
  * Messages
190
198
  */
191
199
  export declare interface ISender {
192
- id: string;
193
- title: string;
194
- name: string;
195
- avatar: string;
196
- bio: string;
197
- location: string;
198
- verified: number;
199
- following: number;
200
- followers: number;
201
- listed: number;
202
- favourites: number;
203
- messages: number;
204
- influence: number;
200
+ id?: string;
201
+ channel?: string;
202
+ title?: string;
203
+ name?: string;
204
+ avatar?: string;
205
+ bio?: string;
206
+ location?: string;
207
+ verified?: number;
208
+ following?: number;
209
+ followers?: number;
210
+ listed?: number;
211
+ favourites?: number;
212
+ messages?: number;
213
+ influence?: number;
205
214
  }
206
215
 
207
216
  /**
@@ -210,13 +219,24 @@ export declare interface ISender {
210
219
  export declare interface ISeries {
211
220
  topic: string;
212
221
  title: string;
213
- series: Series[];
214
- category: Category;
215
- metrics: Metrics;
216
- indicators: Indicators;
222
+ series: ISeriesData[];
223
+ category: ICategory;
224
+ metrics: IMetrics;
225
+ indicators: IIndicators;
217
226
  timestamp: number;
218
227
  }
219
228
 
229
+ export declare interface ISeriesData {
230
+ name: string;
231
+ label: string;
232
+ current: number[];
233
+ current_total: number;
234
+ previous_total: number;
235
+ previous: number[];
236
+ current_category: number;
237
+ previous_category: number;
238
+ }
239
+
220
240
  /**
221
241
  * Storage Options
222
242
  */
@@ -252,12 +272,6 @@ export declare const MESSAGES = "messages";
252
272
 
253
273
  export declare const MESSAGES_CSS = "color:grey;background-color:tan;padding:0 4px 0 4px;border-radius:5px;";
254
274
 
255
- export declare interface Metrics {
256
- doc: number;
257
- previous: number;
258
- change: number;
259
- }
260
-
261
275
  export declare const NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;";
262
276
 
263
277
  export declare const NONE = "color:transparent;background-color:transparent;";
@@ -266,17 +280,6 @@ export declare const PRESENTATION_CSS = "color:white;background-color:darkred;pa
266
280
 
267
281
  export declare const SERIES = "series";
268
282
 
269
- export declare interface Series {
270
- name: string;
271
- label: string;
272
- current: number[];
273
- current_total: number;
274
- previous_total: number;
275
- previous: number[];
276
- current_category: number;
277
- previous_category: number;
278
- }
279
-
280
283
  export declare const SERIES_CSS = "color:grey;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;";
281
284
 
282
285
  export declare const SLIDE_CSS = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;";
@@ -1,12 +1,12 @@
1
1
  var Ri = Object.defineProperty;
2
- var Ni = (j, o, h) => o in j ? Ri(j, o, { enumerable: !0, configurable: !0, writable: !0, value: h }) : j[o] = h;
3
- var C = (j, o, h) => (Ni(j, typeof o != "symbol" ? o + "" : o, h), h);
4
- const Fi = "2.5.6";
2
+ var Ni = (C, o, h) => o in C ? Ri(C, o, { enumerable: !0, configurable: !0, writable: !0, value: h }) : C[o] = h;
3
+ var P = (C, o, h) => (Ni(C, typeof o != "symbol" ? o + "" : o, h), h);
4
+ const Fi = "2.5.8";
5
5
  class $i {
6
6
  constructor(o) {
7
- C(this, "options");
8
- C(this, "url");
9
- C(this, "headers", () => {
7
+ P(this, "options");
8
+ P(this, "url");
9
+ P(this, "headers", () => {
10
10
  const o = `Bearer ${this.options.bearer}`;
11
11
  return {
12
12
  headers: new Headers({
@@ -59,13 +59,13 @@ class $i {
59
59
  }
60
60
  }
61
61
  var Fr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
62
- function zi(j) {
63
- return j && j.__esModule && Object.prototype.hasOwnProperty.call(j, "default") ? j.default : j;
62
+ function zi(C) {
63
+ return C && C.__esModule && Object.prototype.hasOwnProperty.call(C, "default") ? C.default : C;
64
64
  }
65
65
  var zr = { exports: {} };
66
- (function(j, o) {
66
+ (function(C, o) {
67
67
  (function(h, v) {
68
- j.exports = v();
68
+ C.exports = v();
69
69
  })(Fr, function() {
70
70
  var h = function(e, t) {
71
71
  return (h = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) {
@@ -1284,8 +1284,8 @@ var zr = { exports: {} };
1284
1284
  var _ = k.failures, k = k.numFailures;
1285
1285
  y += g - k;
1286
1286
  for (var x = 0, S = A(_); x < S.length; x++) {
1287
- var P = S[x];
1288
- p.push(_[P]);
1287
+ var j = S[x];
1288
+ p.push(_[j]);
1289
1289
  }
1290
1290
  }
1291
1291
  var d = n.table.core, l = d.schema.primaryKey, m = l.outbound, c = l.extractKey, f = t.db._options.modifyChunkSize || 200, p = [], y = 0, b = [];
@@ -1293,9 +1293,9 @@ var zr = { exports: {} };
1293
1293
  function w(_) {
1294
1294
  var k = Math.min(f, g.length - _);
1295
1295
  return d.getMany({ trans: r, keys: g.slice(_, _ + k), cache: "immutable" }).then(function(x) {
1296
- for (var S = [], P = [], O = m ? [] : null, K = [], E = 0; E < k; ++E) {
1296
+ for (var S = [], j = [], O = m ? [] : null, K = [], E = 0; E < k; ++E) {
1297
1297
  var I = x[E], N = { value: je(I), primKey: g[_ + E] };
1298
- s.call(N, N.value, N) !== !1 && (N.value == null ? K.push(g[_ + E]) : m || U(c(I), c(N.value)) === 0 ? (P.push(N.value), m && O.push(g[_ + E])) : (K.push(g[_ + E]), S.push(N.value)));
1298
+ s.call(N, N.value, N) !== !1 && (N.value == null ? K.push(g[_ + E]) : m || U(c(I), c(N.value)) === 0 ? (j.push(N.value), m && O.push(g[_ + E])) : (K.push(g[_ + E]), S.push(N.value)));
1299
1299
  }
1300
1300
  var V = nt(n) && n.limit === 1 / 0 && (typeof e != "function" || e === _n) && { index: n.index, range: n.range };
1301
1301
  return Promise.resolve(0 < S.length && d.mutate({ trans: r, type: "add", values: S }).then(function($) {
@@ -1303,8 +1303,8 @@ var zr = { exports: {} };
1303
1303
  K.splice(parseInt(Y), 1);
1304
1304
  u(S.length, $);
1305
1305
  })).then(function() {
1306
- return (0 < P.length || V && typeof e == "object") && d.mutate({ trans: r, type: "put", keys: O, values: P, criteria: V, changeSpec: typeof e != "function" && e }).then(function($) {
1307
- return u(P.length, $);
1306
+ return (0 < j.length || V && typeof e == "object") && d.mutate({ trans: r, type: "put", keys: O, values: j, criteria: V, changeSpec: typeof e != "function" && e }).then(function($) {
1307
+ return u(j.length, $);
1308
1308
  });
1309
1309
  }).then(function() {
1310
1310
  return (0 < K.length || V && e === _n) && d.mutate({ trans: r, type: "delete", keys: K, criteria: V }).then(function($) {
@@ -1398,14 +1398,14 @@ var zr = { exports: {} };
1398
1398
  if (t(_, d, p))
1399
1399
  return !0;
1400
1400
  for (var k = null, x = p; x < c; ++x) {
1401
- var S = function(P, O, K, E, I, N) {
1402
- for (var V = Math.min(P.length, E.length), $ = -1, Y = 0; Y < V; ++Y) {
1401
+ var S = function(j, O, K, E, I, N) {
1402
+ for (var V = Math.min(j.length, E.length), $ = -1, Y = 0; Y < V; ++Y) {
1403
1403
  var he = O[Y];
1404
1404
  if (he !== E[Y])
1405
- return I(P[Y], K[Y]) < 0 ? P.substr(0, Y) + K[Y] + K.substr(Y + 1) : I(P[Y], E[Y]) < 0 ? P.substr(0, Y) + E[Y] + K.substr(Y + 1) : 0 <= $ ? P.substr(0, $) + O[$] + K.substr($ + 1) : null;
1406
- I(P[Y], he) < 0 && ($ = Y);
1405
+ return I(j[Y], K[Y]) < 0 ? j.substr(0, Y) + K[Y] + K.substr(Y + 1) : I(j[Y], E[Y]) < 0 ? j.substr(0, Y) + E[Y] + K.substr(Y + 1) : 0 <= $ ? j.substr(0, $) + O[$] + K.substr($ + 1) : null;
1406
+ I(j[Y], he) < 0 && ($ = Y);
1407
1407
  }
1408
- return V < E.length && N === "next" ? P + K.substr(P.length) : V < P.length && N === "prev" ? P.substr(0, K.length) : $ < 0 ? null : P.substr(0, $) + E[$] + K.substr($ + 1);
1408
+ return V < E.length && N === "next" ? j + K.substr(j.length) : V < j.length && N === "prev" ? j.substr(0, K.length) : $ < 0 ? null : j.substr(0, $) + E[$] + K.substr($ + 1);
1409
1409
  }(w, _, u[x], d[x], s, l);
1410
1410
  S === null && k === null ? p = x + 1 : (k === null || 0 < s(k, S)) && (k = S);
1411
1411
  }
@@ -1527,9 +1527,9 @@ var zr = { exports: {} };
1527
1527
  try {
1528
1528
  (m = w.reduce(function(_, k) {
1529
1529
  for (var x = 0, S = _.length; x < S; ++x) {
1530
- var P = _[x];
1531
- if (r(k[0], P[1]) < 0 && 0 < r(k[1], P[0])) {
1532
- P[0] = s(P[0], k[0]), P[1] = u(P[1], k[1]);
1530
+ var j = _[x];
1531
+ if (r(k[0], j[1]) < 0 && 0 < r(k[1], j[0])) {
1532
+ j[0] = s(j[0], k[0]), j[1] = u(j[1], k[1]);
1533
1533
  break;
1534
1534
  }
1535
1535
  }
@@ -1552,10 +1552,10 @@ var zr = { exports: {} };
1552
1552
  return w._ondirectionchange = function(_) {
1553
1553
  c = _ === "next" ? (g = y, i) : (g = b, a), m.sort(f);
1554
1554
  }, w._addAlgorithm(function(_, k, x) {
1555
- for (var S, P = _.key; g(P); )
1555
+ for (var S, j = _.key; g(j); )
1556
1556
  if (++p === m.length)
1557
1557
  return k(x), !1;
1558
- return !y(S = P) && !b(S) || (n._cmp(P, m[p][1]) === 0 || n._cmp(P, m[p][0]) === 0 || k(function() {
1558
+ return !y(S = j) && !b(S) || (n._cmp(j, m[p][1]) === 0 || n._cmp(j, m[p][0]) === 0 || k(function() {
1559
1559
  c === i ? _.continue(m[p][0]) : _.continue(m[p][1]);
1560
1560
  }), !1);
1561
1561
  }), w;
@@ -1732,7 +1732,7 @@ var zr = { exports: {} };
1732
1732
  var p, y = f.name;
1733
1733
  return { name: y, schema: f, mutate: function(b) {
1734
1734
  var g = b.trans, w = b.type, _ = b.keys, k = b.values, x = b.range;
1735
- return new Promise(function(S, P) {
1735
+ return new Promise(function(S, j) {
1736
1736
  S = q(S);
1737
1737
  var O = g.objectStore(y), K = O.keyPath == null, E = w === "put" || w === "add";
1738
1738
  if (!E && w !== "delete" && w !== "deleteRange")
@@ -1774,9 +1774,9 @@ var zr = { exports: {} };
1774
1774
  var g = b.trans, w = b.keys;
1775
1775
  return new Promise(function(_, k) {
1776
1776
  _ = q(_);
1777
- for (var x, S = g.objectStore(y), P = w.length, O = new Array(P), K = 0, E = 0, I = function($) {
1777
+ for (var x, S = g.objectStore(y), j = w.length, O = new Array(j), K = 0, E = 0, I = function($) {
1778
1778
  $ = $.target, O[$._pos] = $.result, ++E === K && _(O);
1779
- }, N = ve(k), V = 0; V < P; ++V)
1779
+ }, N = ve(k), V = 0; V < j; ++V)
1780
1780
  w[V] != null && ((x = S.get(w[V]))._pos = V, x.onsuccess = I, x.onerror = N, ++K);
1781
1781
  K === 0 && _(O);
1782
1782
  });
@@ -1792,28 +1792,28 @@ var zr = { exports: {} };
1792
1792
  }, query: (p = l, function(b) {
1793
1793
  return new Promise(function(g, w) {
1794
1794
  g = q(g);
1795
- var _, k, x, K = b.trans, S = b.values, P = b.limit, I = b.query, O = P === 1 / 0 ? void 0 : P, E = I.index, I = I.range, K = K.objectStore(y), E = E.isPrimaryKey ? K : K.index(E.name), I = r(I);
1796
- if (P === 0)
1795
+ var _, k, x, K = b.trans, S = b.values, j = b.limit, I = b.query, O = j === 1 / 0 ? void 0 : j, E = I.index, I = I.range, K = K.objectStore(y), E = E.isPrimaryKey ? K : K.index(E.name), I = r(I);
1796
+ if (j === 0)
1797
1797
  return g({ result: [] });
1798
1798
  p ? ((O = S ? E.getAll(I, O) : E.getAllKeys(I, O)).onsuccess = function(N) {
1799
1799
  return g({ result: N.target.result });
1800
1800
  }, O.onerror = ve(w)) : (_ = 0, k = !S && "openKeyCursor" in E ? E.openKeyCursor(I) : E.openCursor(I), x = [], k.onsuccess = function(N) {
1801
1801
  var V = k.result;
1802
- return V ? (x.push(S ? V.value : V.primaryKey), ++_ === P ? g({ result: x }) : void V.continue()) : g({ result: x });
1802
+ return V ? (x.push(S ? V.value : V.primaryKey), ++_ === j ? g({ result: x }) : void V.continue()) : g({ result: x });
1803
1803
  }, k.onerror = ve(w));
1804
1804
  });
1805
1805
  }), openCursor: function(b) {
1806
1806
  var g = b.trans, w = b.values, _ = b.query, k = b.reverse, x = b.unique;
1807
- return new Promise(function(S, P) {
1807
+ return new Promise(function(S, j) {
1808
1808
  S = q(S);
1809
1809
  var E = _.index, O = _.range, K = g.objectStore(y), K = E.isPrimaryKey ? K : K.index(E.name), E = k ? x ? "prevunique" : "prev" : x ? "nextunique" : "next", I = !w && "openKeyCursor" in K ? K.openKeyCursor(r(O), E) : K.openCursor(r(O), E);
1810
- I.onerror = ve(P), I.onsuccess = q(function(N) {
1810
+ I.onerror = ve(j), I.onsuccess = q(function(N) {
1811
1811
  var V, $, Y, he, F = I.result;
1812
1812
  F ? (F.___id = ++_i, F.done = !1, V = F.continue.bind(F), $ = ($ = F.continuePrimaryKey) && $.bind(F), Y = F.advance.bind(F), he = function() {
1813
1813
  throw new Error("Cursor not stopped");
1814
1814
  }, F.trans = g, F.stop = F.continue = F.continuePrimaryKey = F.advance = function() {
1815
1815
  throw new Error("Cursor not started");
1816
- }, F.fail = q(P), F.next = function() {
1816
+ }, F.fail = q(j), F.next = function() {
1817
1817
  var Oe = this, se = 1;
1818
1818
  return this.start(function() {
1819
1819
  return se-- ? Oe.continue() : Oe.stop();
@@ -1842,12 +1842,12 @@ var zr = { exports: {} };
1842
1842
  I.onsuccess = se, se();
1843
1843
  }), F.continue = V, F.continuePrimaryKey = $, F.advance = Y, se(), en;
1844
1844
  }, S(F)) : S(null);
1845
- }, P);
1845
+ }, j);
1846
1846
  });
1847
1847
  }, count: function(b) {
1848
1848
  var g = b.query, w = b.trans, _ = g.index, k = g.range;
1849
1849
  return new Promise(function(x, S) {
1850
- var P = w.objectStore(y), O = _.isPrimaryKey ? P : P.index(_.name), P = r(k), O = P ? O.count(P) : O.count();
1850
+ var j = w.objectStore(y), O = _.isPrimaryKey ? j : j.index(_.name), j = r(k), O = j ? O.count(j) : O.count();
1851
1851
  O.onsuccess = q(function(K) {
1852
1852
  return x(K.target.result);
1853
1853
  }), O.onerror = ve(S);
@@ -1948,10 +1948,10 @@ var zr = { exports: {} };
1948
1948
  var S = w._cfg.contentUpgrade;
1949
1949
  if (S && w._cfg.version > f) {
1950
1950
  Lt(c, y), p._memoizedTables = {};
1951
- var P = rr(k);
1951
+ var j = rr(k);
1952
1952
  x.del.forEach(function(E) {
1953
- P[E] = _[E];
1954
- }), En(c, [c.Transaction.prototype]), Wt(c, [c.Transaction.prototype], A(P), P), p.schema = P;
1953
+ j[E] = _[E];
1954
+ }), En(c, [c.Transaction.prototype]), Wt(c, [c.Transaction.prototype], A(j), j), p.schema = j;
1955
1955
  var O, K = an(S);
1956
1956
  return K && et(), x = T.follow(function() {
1957
1957
  var E;
@@ -1962,8 +1962,8 @@ var zr = { exports: {} };
1962
1962
  }
1963
1963
  }), b.push(function(_) {
1964
1964
  var k, x, S = w._cfg.dbschema;
1965
- k = S, x = _, [].slice.call(x.db.objectStoreNames).forEach(function(P) {
1966
- return k[P] == null && x.db.deleteObjectStore(P);
1965
+ k = S, x = _, [].slice.call(x.db.objectStoreNames).forEach(function(j) {
1966
+ return k[j] == null && x.db.deleteObjectStore(j);
1967
1967
  }), En(c, [c.Transaction.prototype]), Wt(c, [c.Transaction.prototype], c._storeNames, c._dbSchema), p.schema = c._dbSchema;
1968
1968
  }), b.push(function(_) {
1969
1969
  c.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(c.idbdb.version / 10) === w._cfg.version ? (c.idbdb.deleteObjectStore("$meta"), delete c._dbSchema.$meta, c._storeNames = c._storeNames.filter(function(k) {
@@ -2271,10 +2271,10 @@ var zr = { exports: {} };
2271
2271
  })) : (m.onerror = ve(p), g = g.oldVersion > Math.pow(2, 62) ? 0 : g.oldVersion, c = g < 1, e.idbdb = b.result, a && Ei(e, m), Oi(e, g / 10, m, p));
2272
2272
  }, p), b.onsuccess = q(function() {
2273
2273
  m = null;
2274
- var g, w, _, k, x, S = e.idbdb = b.result, P = Et(S.objectStoreNames);
2275
- if (0 < P.length)
2274
+ var g, w, _, k, x, S = e.idbdb = b.result, j = Et(S.objectStoreNames);
2275
+ if (0 < j.length)
2276
2276
  try {
2277
- var O = S.transaction((k = P).length === 1 ? k[0] : k, "readonly");
2277
+ var O = S.transaction((k = j).length === 1 ? k[0] : k, "readonly");
2278
2278
  if (t.autoSchema)
2279
2279
  w = S, _ = O, (g = e).verno = w.version / 10, _ = g._dbSchema = Vt(0, w, _), g._storeNames = Et(w.objectStoreNames, 0), Wt(g, [g._allTables], A(_), _);
2280
2280
  else if (Gt(e, e._dbSchema, O), ((x = Cn(Vt(0, (x = e).idbdb, O), x._dbSchema)).add.length || x.change.some(function(K) {
@@ -2464,17 +2464,17 @@ var zr = { exports: {} };
2464
2464
  throw new Error("Keys missing");
2465
2465
  return (c = c.type === "add" || c.type === "put" ? v(v({}, c), { keys: g }) : v({}, c)).type !== "delete" && (c.values = D([], c.values, !0)), c.keys && (c.keys = D([], c.keys, !0)), f = n, y = g, ((p = c).type === "add" ? Promise.resolve([]) : f.getMany({ trans: p.trans, keys: y, cache: "immutable" })).then(function(w) {
2466
2466
  var _ = g.map(function(k, x) {
2467
- var S, P, O, K = w[x], E = { onerror: null, onsuccess: null };
2468
- return c.type === "delete" ? u.fire.call(E, k, K, b) : c.type === "add" || K === void 0 ? (S = d.fire.call(E, k, c.values[x], b), k == null && S != null && (c.keys[x] = k = S, r.outbound || pe(c.values[x], r.keyPath, k))) : (S = Fn(K, c.values[x]), (P = l.fire.call(E, S, k, K, b)) && (O = c.values[x], Object.keys(P).forEach(function(I) {
2469
- oe(O, I) ? O[I] = P[I] : pe(O, I, P[I]);
2467
+ var S, j, O, K = w[x], E = { onerror: null, onsuccess: null };
2468
+ return c.type === "delete" ? u.fire.call(E, k, K, b) : c.type === "add" || K === void 0 ? (S = d.fire.call(E, k, c.values[x], b), k == null && S != null && (c.keys[x] = k = S, r.outbound || pe(c.values[x], r.keyPath, k))) : (S = Fn(K, c.values[x]), (j = l.fire.call(E, S, k, K, b)) && (O = c.values[x], Object.keys(j).forEach(function(I) {
2469
+ oe(O, I) ? O[I] = j[I] : pe(O, I, j[I]);
2470
2470
  }))), E;
2471
2471
  });
2472
2472
  return n.mutate(c).then(function(k) {
2473
- for (var x = k.failures, S = k.results, P = k.numFailures, k = k.lastResult, O = 0; O < g.length; ++O) {
2473
+ for (var x = k.failures, S = k.results, j = k.numFailures, k = k.lastResult, O = 0; O < g.length; ++O) {
2474
2474
  var K = (S || g)[O], E = _[O];
2475
2475
  K == null ? E.onerror && E.onerror(x[O]) : E.onsuccess && E.onsuccess(c.type === "put" && w[O] ? c.values[O] : K);
2476
2476
  }
2477
- return { failures: x, results: S, numFailures: P, lastResult: k };
2477
+ return { failures: x, results: S, numFailures: j, lastResult: k };
2478
2478
  }).catch(function(k) {
2479
2479
  return _.forEach(function(x) {
2480
2480
  return x.onerror && x.onerror(k);
@@ -2542,8 +2542,8 @@ var zr = { exports: {} };
2542
2542
  }
2543
2543
  var y, b, g, w = f.trans, _ = f.mutatedParts || (f.mutatedParts = {}), k = p(""), x = p(":dels"), S = f.type, K = f.type === "deleteRange" ? [f.range] : f.type === "delete" ? [f.keys] : f.values.length < 50 ? [$n(u, f).filter(function(E) {
2544
2544
  return E;
2545
- }), f.values] : [], P = K[0], O = K[1], K = f.trans._cache;
2546
- return z(P) ? (k.addKeys(P), (K = S === "delete" || P.length === O.length ? Ar(P, K) : null) || x.addKeys(P), (K || O) && (y = p, b = K, g = O, s.indexes.forEach(function(E) {
2545
+ }), f.values] : [], j = K[0], O = K[1], K = f.trans._cache;
2546
+ return z(j) ? (k.addKeys(j), (K = S === "delete" || j.length === O.length ? Ar(j, K) : null) || x.addKeys(j), (K || O) && (y = p, b = K, g = O, s.indexes.forEach(function(E) {
2547
2547
  var I = y(E.name || "");
2548
2548
  function N($) {
2549
2549
  return $ != null ? E.extractKey($) : null;
@@ -2557,10 +2557,10 @@ var zr = { exports: {} };
2557
2557
  var he = b && N(b[F]), F = g && N(g[F]);
2558
2558
  U(he, F) !== 0 && (he != null && V(he), F != null && V(F));
2559
2559
  });
2560
- }))) : P ? (O = { from: P.lower, to: P.upper }, x.add(O), k.add(O)) : (k.add(n), x.add(n), s.indexes.forEach(function(E) {
2560
+ }))) : j ? (O = { from: j.lower, to: j.upper }, x.add(O), k.add(O)) : (k.add(n), x.add(n), s.indexes.forEach(function(E) {
2561
2561
  return p(E.name).add(n);
2562
2562
  })), a.mutate(f).then(function(E) {
2563
- return !P || f.type !== "add" && f.type !== "put" || k.addKeys(E.results), w.mutatedParts = Qt(w.mutatedParts || {}, _), E;
2563
+ return !j || f.type !== "add" && f.type !== "put" || k.addKeys(E.results), w.mutatedParts = Qt(w.mutatedParts || {}, _), E;
2564
2564
  });
2565
2565
  } }), c = { get: function(f) {
2566
2566
  return [u, new ae(f.key)];
@@ -2724,8 +2724,8 @@ var zr = { exports: {} };
2724
2724
  });
2725
2725
  if (u._explicit && d && u.mutatedParts)
2726
2726
  for (var g = 0, w = Object.values(p.queries.query); g < w.length; g++)
2727
- for (var _ = 0, k = (P = w[g]).slice(); _ < k.length; _++)
2728
- Mn((O = k[_]).obsSet, u.mutatedParts) && (Ne(P, O), O.subscribers.forEach(function(N) {
2727
+ for (var _ = 0, k = (j = w[g]).slice(); _ < k.length; _++)
2728
+ Mn((O = k[_]).obsSet, u.mutatedParts) && (Ne(j, O), O.subscribers.forEach(function(N) {
2729
2729
  return l.add(N);
2730
2730
  }));
2731
2731
  else if (0 < b.length) {
@@ -2733,10 +2733,10 @@ var zr = { exports: {} };
2733
2733
  return N.trans !== u;
2734
2734
  });
2735
2735
  for (var x = 0, S = Object.values(p.queries.query); x < S.length; x++)
2736
- for (var P, O, K, E = 0, I = (P = S[x]).slice(); E < I.length; E++)
2737
- (O = I[E]).res != null && u.mutatedParts && (d && !O.dirty ? (K = Object.isFrozen(O.res), K = Br(O.res, O.req, b, y, O, K), O.dirty ? (Ne(P, O), O.subscribers.forEach(function(N) {
2736
+ for (var j, O, K, E = 0, I = (j = S[x]).slice(); E < I.length; E++)
2737
+ (O = I[E]).res != null && u.mutatedParts && (d && !O.dirty ? (K = Object.isFrozen(O.res), K = Br(O.res, O.req, b, y, O, K), O.dirty ? (Ne(j, O), O.subscribers.forEach(function(N) {
2738
2738
  return l.add(N);
2739
- })) : K !== O.res && (O.res = K, O.promise = T.resolve({ result: K }))) : (O.dirty && Ne(P, O), O.subscribers.forEach(function(N) {
2739
+ })) : K !== O.res && (O.res = K, O.promise = T.resolve({ result: K }))) : (O.dirty && Ne(j, O), O.subscribers.forEach(function(N) {
2740
2740
  return l.add(N);
2741
2741
  })));
2742
2742
  }
@@ -3232,47 +3232,47 @@ var Li = zr.exports;
3232
3232
  const Jn = /* @__PURE__ */ zi(Li), $r = Symbol.for("Dexie"), Zn = globalThis[$r] || (globalThis[$r] = Jn);
3233
3233
  if (Jn.semVer !== Zn.semVer)
3234
3234
  throw new Error(`Two different versions of Dexie loaded in the same app: ${Jn.semVer} and ${Zn.semVer}`);
3235
- function J(j) {
3236
- let o = `${j.type}.${j.topics}`;
3237
- return j.order && (o += `.${j.order}`), j.period && (o += `.${j.period}`), o;
3235
+ function J(C) {
3236
+ let o = `${C.type}.${C.topics}`;
3237
+ return C.order && (o += `.${C.order}`), C.period && (o += `.${C.period}`), o;
3238
3238
  }
3239
- function ot(j) {
3239
+ function ot(C) {
3240
3240
  var o;
3241
- if (j.widget === void 0) {
3242
- const h = (o = j.topics) == null ? void 0 : o.split("-");
3243
- j.dashboard = h ? h[0] : "", j.widget = h ? h[1] : "";
3241
+ if (C.widget === void 0) {
3242
+ const h = (o = C.topics) == null ? void 0 : o.split("-");
3243
+ h && h.length > 1 ? (C.dashboard = h ? h[0] : "", C.widget = h ? h[1] : "") : (C.widget = C.topics, C.dashboard = C.slide);
3244
3244
  }
3245
- return j.topics === void 0 && (j.topics = `${j.dashboard}-${j.widget}`), j;
3245
+ return C.topics === void 0 && (C.topics = `${C.dashboard}-${C.widget}`), C;
3246
3246
  }
3247
- function St(j, o) {
3247
+ function St(C, o) {
3248
3248
  var z;
3249
3249
  let h, v, D, M, A;
3250
- switch (j.moderation) {
3250
+ switch (C.moderation) {
3251
3251
  case "before":
3252
- h = /* @__PURE__ */ new Date(), v = (z = j.beforeTime) == null ? void 0 : z.split(":"), D = Number.parseInt(v ? v[0] : "00"), M = Number.parseInt(v ? v[1] : "00"), A = Number.parseInt(v ? v[2] : "00"), o.before = h.setHours(D, M, A, 0) / 1e3, o.period || (o.period = h.getDay() === 1 ? 72 : 24);
3252
+ h = /* @__PURE__ */ new Date(), v = (z = C.beforeTime) == null ? void 0 : z.split(":"), D = Number.parseInt(v ? v[0] : "00"), M = Number.parseInt(v ? v[1] : "00"), A = Number.parseInt(v ? v[2] : "00"), o.before = h.setHours(D, M, A, 0) / 1e3, o.period || (o.period = h.getDay() === 1 ? 72 : 24);
3253
3253
  break;
3254
3254
  case "delayed":
3255
- j.delay && j.delay > 0 && (o.delay = `${j.delay}`);
3255
+ C.delay && C.delay > 0 && (o.delay = `${C.delay}`);
3256
3256
  break;
3257
3257
  case "approved":
3258
3258
  o.approved = "1";
3259
3259
  break;
3260
3260
  default:
3261
- j.period !== 0 && (o.period = j.period);
3261
+ C.period !== 0 && (o.period = C.period);
3262
3262
  }
3263
3263
  return o;
3264
3264
  }
3265
3265
  class Lr {
3266
3266
  constructor(o) {
3267
- C(this, "db");
3268
- C(this, "subscribers", []);
3269
- C(this, "options");
3267
+ P(this, "db");
3268
+ P(this, "subscribers", []);
3269
+ P(this, "options");
3270
3270
  /**
3271
3271
  * Retrieve Cloud Data
3272
3272
  * @param query IQuery
3273
3273
  * @returns IResponse
3274
3274
  */
3275
- C(this, "getCloud", async (o) => {
3275
+ P(this, "getCloud", async (o) => {
3276
3276
  const h = await this.db.table(le).where({ id: o.widget }).last().catch(() => (console.warn(
3277
3277
  "%capi%C %ccloud",
3278
3278
  Q,
@@ -3288,7 +3288,7 @@ class Lr {
3288
3288
  * @param query IQuery
3289
3289
  * @returns IResponse
3290
3290
  */
3291
- C(this, "getSeries", async (o) => {
3291
+ P(this, "getSeries", async (o) => {
3292
3292
  const h = await this.db.table(fe).where({ id: o.widget }).last().catch(() => (console.warn(
3293
3293
  "%capi%c %cseries",
3294
3294
  Q,
@@ -3304,7 +3304,7 @@ class Lr {
3304
3304
  * @param query IQuery
3305
3305
  * @returns IResponse
3306
3306
  */
3307
- C(this, "getMessages", async (o) => {
3307
+ P(this, "getMessages", async (o) => {
3308
3308
  const h = (M) => M.widget_id === o.widget, v = (M) => M.utc > ((o == null ? void 0 : o.since) || 0), D = (M) => (M == null ? void 0 : M.visible) !== 0;
3309
3309
  try {
3310
3310
  const M = await this.db.table("topics").orderBy("utc").reverse().filter(h).filter(v).filter(D).limit((o == null ? void 0 : o.limit) ?? 25).toArray().catch(() => (console.warn(
@@ -3341,7 +3341,7 @@ class Lr {
3341
3341
  * @param data
3342
3342
  * @returns number
3343
3343
  */
3344
- C(this, "setCloud", async (o, h) => o.type === le && h !== "" ? await this.db.table(le).put({
3344
+ P(this, "setCloud", async (o, h) => o.type === le && h !== "" ? await this.db.table(le).put({
3345
3345
  id: o.widget,
3346
3346
  dashboard_id: o.dashboard,
3347
3347
  data: h.data
@@ -3352,7 +3352,7 @@ class Lr {
3352
3352
  * @param data
3353
3353
  * @returns number
3354
3354
  */
3355
- C(this, "setSeries", async (o, h) => o.type === fe && h !== "" ? await this.db.table(fe).put({
3355
+ P(this, "setSeries", async (o, h) => o.type === fe && h !== "" ? await this.db.table(fe).put({
3356
3356
  id: o.widget,
3357
3357
  dashboard_id: o.dashboard,
3358
3358
  data: h.data
@@ -3366,7 +3366,7 @@ class Lr {
3366
3366
  * @param data.data.messages IMessages
3367
3367
  * @returns number
3368
3368
  */
3369
- C(this, "setMessages", async (o, h) => {
3369
+ P(this, "setMessages", async (o, h) => {
3370
3370
  if (o.type !== ie)
3371
3371
  return 400;
3372
3372
  const v = h.title;
@@ -3393,7 +3393,7 @@ class Lr {
3393
3393
  * Wipe Message data after number of seconds
3394
3394
  * @param retentionDuration
3395
3395
  */
3396
- C(this, "cleanMessages", async (o) => {
3396
+ P(this, "cleanMessages", async (o) => {
3397
3397
  const h = Date.now() / 1e3, v = (D) => D.utc < o - h;
3398
3398
  await this.db.table("topics").orderBy("utc").filter(v).modify((D, M) => {
3399
3399
  delete M.value;
@@ -3404,7 +3404,7 @@ class Lr {
3404
3404
  * @param query IQuery
3405
3405
  * @returns number
3406
3406
  */
3407
- C(this, "setWidget", async (o) => await this.db.table(Qi).put({
3407
+ P(this, "setWidget", async (o) => await this.db.table(Qi).put({
3408
3408
  id: o.widget,
3409
3409
  dashboard_id: o.dashboard,
3410
3410
  type: o.type
@@ -3414,7 +3414,7 @@ class Lr {
3414
3414
  * @param query IQuery
3415
3415
  * @returns null
3416
3416
  */
3417
- C(this, "subscribe", (o) => (o = ot(o), this.subscribers.filter(
3417
+ P(this, "subscribe", (o) => (o = ot(o), this.subscribers.filter(
3418
3418
  (v) => v.widget === o.widget
3419
3419
  ).length > 0 || (o.type === ie && (o = St(this.options, o)), console.debug(
3420
3420
  "%cstorage%c %csubscribe",
@@ -3428,7 +3428,7 @@ class Lr {
3428
3428
  * Get current subscribers
3429
3429
  * @returns IQuery[]
3430
3430
  */
3431
- C(this, "getSubscribers", async () => await new Promise((o) => o(this.subscribers)));
3431
+ P(this, "getSubscribers", async () => await new Promise((o) => o(this.subscribers)));
3432
3432
  this.options = o, this.db = new Zn(o.app), this.db.version(2).stores({
3433
3433
  player: "id,title,name,location",
3434
3434
  monitor: "id,player_id,cols,rows,order,width,height,physicalwidth,physicalheight,devicePixelRatio,screenLeft,screenTop,orientation,monitor",
@@ -3443,13 +3443,13 @@ class Lr {
3443
3443
  }), this.db.open();
3444
3444
  }
3445
3445
  }
3446
- function qn(j) {
3446
+ function qn(C) {
3447
3447
  return new Promise((o, h) => {
3448
- j.oncomplete = j.onsuccess = () => o(j.result), j.onabort = j.onerror = () => h(j.error);
3448
+ C.oncomplete = C.onsuccess = () => o(C.result), C.onabort = C.onerror = () => h(C.error);
3449
3449
  });
3450
3450
  }
3451
- function Wi(j, o) {
3452
- const h = indexedDB.open(j);
3451
+ function Wi(C, o) {
3452
+ const h = indexedDB.open(C);
3453
3453
  h.onupgradeneeded = () => h.result.createObjectStore(o);
3454
3454
  const v = qn(h);
3455
3455
  return (D, M) => v.then((A) => M(A.transaction(o, D).objectStore(o)));
@@ -3458,25 +3458,25 @@ let Vn;
3458
3458
  function Wr() {
3459
3459
  return Vn || (Vn = Wi("keyval-store", "keyval")), Vn;
3460
3460
  }
3461
- function Gn(j, o = Wr()) {
3462
- return o("readonly", (h) => qn(h.get(j)));
3461
+ function Gn(C, o = Wr()) {
3462
+ return o("readonly", (h) => qn(h.get(C)));
3463
3463
  }
3464
- function tn(j, o, h = Wr()) {
3465
- return h("readwrite", (v) => (v.put(o, j), qn(v.transaction)));
3464
+ function tn(C, o, h = Wr()) {
3465
+ return h("readwrite", (v) => (v.put(o, C), qn(v.transaction)));
3466
3466
  }
3467
3467
  class Ur {
3468
3468
  constructor(o) {
3469
- C(this, "subscribers", []);
3470
- C(this, "options");
3471
- C(this, "getCloud", async (o) => {
3469
+ P(this, "subscribers", []);
3470
+ P(this, "options");
3471
+ P(this, "getCloud", async (o) => {
3472
3472
  const h = J(o);
3473
3473
  return await Gn(h).then((v) => v).catch(() => (console.warn("%capi", Q, le, o.slide, o.widget), { data: null, message: "Cloud Data error", success: !1 }));
3474
3474
  });
3475
- C(this, "getSeries", async (o) => {
3475
+ P(this, "getSeries", async (o) => {
3476
3476
  const h = J(o);
3477
3477
  return await Gn(h).then((v) => v).catch(() => (console.warn("%capi", Q, fe, o.slide, o.widget), { data: null, message: "Series Data error", success: !1 }));
3478
3478
  });
3479
- C(this, "getMessages", async (o) => {
3479
+ P(this, "getMessages", async (o) => {
3480
3480
  const h = J(o);
3481
3481
  return await Gn(h).then((v) => v).catch(() => (console.warn("%capi", Q, ie, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 }));
3482
3482
  });
@@ -3486,7 +3486,7 @@ class Ur {
3486
3486
  * @param data
3487
3487
  * @returns number
3488
3488
  */
3489
- C(this, "setCloud", async (o, h) => {
3489
+ P(this, "setCloud", async (o, h) => {
3490
3490
  if (!h.success)
3491
3491
  return 400;
3492
3492
  const v = J(o);
@@ -3498,7 +3498,7 @@ class Ur {
3498
3498
  * @param data
3499
3499
  * @returns bumber
3500
3500
  */
3501
- C(this, "setSeries", async (o, h) => {
3501
+ P(this, "setSeries", async (o, h) => {
3502
3502
  if (!h.success)
3503
3503
  return 400;
3504
3504
  const v = J(o);
@@ -3510,19 +3510,19 @@ class Ur {
3510
3510
  * @param data
3511
3511
  * @returns number
3512
3512
  */
3513
- C(this, "setMessages", async (o, h) => {
3513
+ P(this, "setMessages", async (o, h) => {
3514
3514
  if (!h.success)
3515
3515
  return 400;
3516
3516
  const v = J(o);
3517
3517
  return delete h.success, delete h.message, await tn(v, h).then(() => 201).catch((D) => (console.error("%cstorage", W, ie, o, D), 400));
3518
3518
  });
3519
- C(this, "cleanMessages", async (o) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((h) => h())));
3519
+ P(this, "cleanMessages", async (o) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((h) => h())));
3520
3520
  /**
3521
3521
  * Update Cloud
3522
3522
  * @param query IQuery
3523
3523
  * @returns number
3524
3524
  */
3525
- C(this, "setWidget", async (o) => {
3525
+ P(this, "setWidget", async (o) => {
3526
3526
  const h = J(o), v = {
3527
3527
  id: o.widget,
3528
3528
  dashboard_id: o.dashboard,
@@ -3535,7 +3535,7 @@ class Ur {
3535
3535
  * @param query IQuery
3536
3536
  * @returns null
3537
3537
  */
3538
- C(this, "subscribe", (o) => (o = ot(o), o.type === ie && (o = St(this.options, o)), this.subscribers.filter(
3538
+ P(this, "subscribe", (o) => (o = ot(o), o.type === ie && (o = St(this.options, o)), this.subscribers.filter(
3539
3539
  (v) => v.widget === o.widget
3540
3540
  ).length > 0 || (console.debug(
3541
3541
  "%cstorage%c %csubscribe",
@@ -3549,15 +3549,15 @@ class Ur {
3549
3549
  * Get current subscribers
3550
3550
  * @returns IQuery[]
3551
3551
  */
3552
- C(this, "getSubscribers", async () => await new Promise((o) => o(this.subscribers)));
3552
+ P(this, "getSubscribers", async () => await new Promise((o) => o(this.subscribers)));
3553
3553
  this.options = o;
3554
3554
  }
3555
3555
  }
3556
3556
  class Vr {
3557
3557
  constructor(o) {
3558
- C(this, "subscribers", []);
3559
- C(this, "options");
3560
- C(this, "getCloud", async (o) => {
3558
+ P(this, "subscribers", []);
3559
+ P(this, "options");
3560
+ P(this, "getCloud", async (o) => {
3561
3561
  const h = J(o);
3562
3562
  try {
3563
3563
  return localStorage.getObject(h);
@@ -3565,7 +3565,7 @@ class Vr {
3565
3565
  return console.warn("%capi", Q, le, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
3566
3566
  }
3567
3567
  });
3568
- C(this, "getSeries", async (o) => {
3568
+ P(this, "getSeries", async (o) => {
3569
3569
  const h = J(o);
3570
3570
  try {
3571
3571
  return localStorage.getObject(h);
@@ -3573,7 +3573,7 @@ class Vr {
3573
3573
  return console.warn("%capi", Q, fe, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
3574
3574
  }
3575
3575
  });
3576
- C(this, "getMessages", async (o) => {
3576
+ P(this, "getMessages", async (o) => {
3577
3577
  const h = J(o);
3578
3578
  try {
3579
3579
  return localStorage.getObject(h);
@@ -3587,7 +3587,7 @@ class Vr {
3587
3587
  * @param data
3588
3588
  * @returns number
3589
3589
  */
3590
- C(this, "setCloud", async (o, h) => {
3590
+ P(this, "setCloud", async (o, h) => {
3591
3591
  const v = J(o);
3592
3592
  try {
3593
3593
  return localStorage.setObject(v, h), 201;
@@ -3601,7 +3601,7 @@ class Vr {
3601
3601
  * @param data
3602
3602
  * @returns number
3603
3603
  */
3604
- C(this, "setSeries", async (o, h) => {
3604
+ P(this, "setSeries", async (o, h) => {
3605
3605
  const v = J(o);
3606
3606
  try {
3607
3607
  return localStorage.setObject(v, h), 201;
@@ -3615,7 +3615,7 @@ class Vr {
3615
3615
  * @param data
3616
3616
  * @returns number
3617
3617
  */
3618
- C(this, "setMessages", async (o, h) => {
3618
+ P(this, "setMessages", async (o, h) => {
3619
3619
  const v = J(o);
3620
3620
  try {
3621
3621
  return localStorage.setObject(v, h), 200;
@@ -3623,10 +3623,10 @@ class Vr {
3623
3623
  return console.error("%cstorage", W, ie, o, D), 400;
3624
3624
  }
3625
3625
  });
3626
- C(this, "cleanMessages", async (o) => {
3626
+ P(this, "cleanMessages", async (o) => {
3627
3627
  console.log("cleanMessages not implemented for ", this.options.storage);
3628
3628
  });
3629
- C(this, "setWidget", async (o) => {
3629
+ P(this, "setWidget", async (o) => {
3630
3630
  const h = `widget.${o.widget}`;
3631
3631
  try {
3632
3632
  return localStorage.setObject(h, o), 201;
@@ -3639,7 +3639,7 @@ class Vr {
3639
3639
  * @param query IQuery
3640
3640
  * @returns null
3641
3641
  */
3642
- C(this, "subscribe", (o) => (o = ot(o), o.type === ie && (o = St(this.options, o)), this.subscribers.filter(
3642
+ P(this, "subscribe", (o) => (o = ot(o), o.type === ie && (o = St(this.options, o)), this.subscribers.filter(
3643
3643
  (v) => v.widget === o.widget
3644
3644
  ).length || (console.debug(
3645
3645
  "%cstorage%c %csubscribe",
@@ -3653,7 +3653,7 @@ class Vr {
3653
3653
  * Get current subscribers
3654
3654
  * @returns IQuery[]
3655
3655
  */
3656
- C(this, "getSubscribers", async () => await new Promise((o) => o(this.subscribers)));
3656
+ P(this, "getSubscribers", async () => await new Promise((o) => o(this.subscribers)));
3657
3657
  this.options = o, Storage.prototype.setObject = function(h, v) {
3658
3658
  this.setObject(h, JSON.stringify(v));
3659
3659
  }, Storage.prototype.getObject = function(h) {
@@ -3664,9 +3664,9 @@ class Vr {
3664
3664
  }
3665
3665
  class Gr {
3666
3666
  constructor(o) {
3667
- C(this, "subscribers", []);
3668
- C(this, "options");
3669
- C(this, "getCloud", async (o) => {
3667
+ P(this, "subscribers", []);
3668
+ P(this, "options");
3669
+ P(this, "getCloud", async (o) => {
3670
3670
  const h = J(o);
3671
3671
  try {
3672
3672
  return sessionStorage.getObject(h);
@@ -3674,7 +3674,7 @@ class Gr {
3674
3674
  return console.warn("%capi", Q, le, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
3675
3675
  }
3676
3676
  });
3677
- C(this, "getSeries", async (o) => {
3677
+ P(this, "getSeries", async (o) => {
3678
3678
  const h = J(o);
3679
3679
  try {
3680
3680
  return sessionStorage.getObject(h);
@@ -3682,7 +3682,7 @@ class Gr {
3682
3682
  return console.warn("%capi", Q, fe, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
3683
3683
  }
3684
3684
  });
3685
- C(this, "getMessages", async (o) => {
3685
+ P(this, "getMessages", async (o) => {
3686
3686
  const h = J(o);
3687
3687
  try {
3688
3688
  return sessionStorage.getObject(h);
@@ -3696,7 +3696,7 @@ class Gr {
3696
3696
  * @param data
3697
3697
  * @returns number
3698
3698
  */
3699
- C(this, "setCloud", async (o, h) => {
3699
+ P(this, "setCloud", async (o, h) => {
3700
3700
  const v = J(o);
3701
3701
  try {
3702
3702
  return sessionStorage.setObject(v, h), 201;
@@ -3710,7 +3710,7 @@ class Gr {
3710
3710
  * @param data
3711
3711
  * @returns number
3712
3712
  */
3713
- C(this, "setSeries", async (o, h) => {
3713
+ P(this, "setSeries", async (o, h) => {
3714
3714
  const v = J(o);
3715
3715
  try {
3716
3716
  return sessionStorage.setObject(v, h), 201;
@@ -3724,7 +3724,7 @@ class Gr {
3724
3724
  * @param data
3725
3725
  * @returns number
3726
3726
  */
3727
- C(this, "setMessages", async (o, h) => {
3727
+ P(this, "setMessages", async (o, h) => {
3728
3728
  const v = J(o);
3729
3729
  try {
3730
3730
  return sessionStorage.setObject(v, h), 201;
@@ -3732,10 +3732,10 @@ class Gr {
3732
3732
  return console.error("%cstorage", W, ie, o, D), 400;
3733
3733
  }
3734
3734
  });
3735
- C(this, "cleanMessages", async (o) => {
3735
+ P(this, "cleanMessages", async (o) => {
3736
3736
  console.log("cleanMessages not implemented for ", this.options.storage);
3737
3737
  });
3738
- C(this, "setWidget", async (o) => {
3738
+ P(this, "setWidget", async (o) => {
3739
3739
  const h = `widget.${o.widget}`;
3740
3740
  try {
3741
3741
  return sessionStorage.setObject(h, o), 201;
@@ -3748,7 +3748,7 @@ class Gr {
3748
3748
  * @param query IQuery
3749
3749
  * @returns null
3750
3750
  */
3751
- C(this, "subscribe", (o) => (o = ot(o), o.type === ie && (o = St(this.options, o)), this.subscribers.filter(
3751
+ P(this, "subscribe", (o) => (o = ot(o), o.type === ie && (o = St(this.options, o)), this.subscribers.filter(
3752
3752
  (v) => v.widget === o.widget
3753
3753
  ).length || (console.debug(
3754
3754
  "%cstorage%c %csubscribe",
@@ -3762,7 +3762,7 @@ class Gr {
3762
3762
  * Get current subscribers
3763
3763
  * @returns IQuery[]
3764
3764
  */
3765
- C(this, "getSubscribers", async () => await new Promise((o) => o(this.subscribers)));
3765
+ P(this, "getSubscribers", async () => await new Promise((o) => o(this.subscribers)));
3766
3766
  this.options = o, Storage.prototype.setObject = function(h, v) {
3767
3767
  this.setItem(h, JSON.stringify(v));
3768
3768
  }, Storage.prototype.getObject = function(h) {
@@ -3773,9 +3773,9 @@ class Gr {
3773
3773
  }
3774
3774
  class Yr {
3775
3775
  constructor(o) {
3776
- C(this, "subscribers", []);
3777
- C(this, "options");
3778
- C(this, "getCloud", async (o) => {
3776
+ P(this, "subscribers", []);
3777
+ P(this, "options");
3778
+ P(this, "getCloud", async (o) => {
3779
3779
  const h = J(o);
3780
3780
  try {
3781
3781
  return window.BuzzCasting.WidgetData[h];
@@ -3783,7 +3783,7 @@ class Yr {
3783
3783
  return console.warn("%capi", Q, le, o.slide, o.widget), { data: null, message: "Cloud Data error", success: !1 };
3784
3784
  }
3785
3785
  });
3786
- C(this, "getSeries", async (o) => {
3786
+ P(this, "getSeries", async (o) => {
3787
3787
  const h = J(o);
3788
3788
  try {
3789
3789
  return window.BuzzCasting.WidgetData[h];
@@ -3791,7 +3791,7 @@ class Yr {
3791
3791
  return console.warn("%capi", Q, fe, o.slide, o.widget), { data: null, message: "Series Data error", success: !1 };
3792
3792
  }
3793
3793
  });
3794
- C(this, "getMessages", async (o) => {
3794
+ P(this, "getMessages", async (o) => {
3795
3795
  const h = J(o);
3796
3796
  try {
3797
3797
  return window.BuzzCasting.WidgetData[h];
@@ -3805,7 +3805,7 @@ class Yr {
3805
3805
  * @param data
3806
3806
  * @returns number
3807
3807
  */
3808
- C(this, "setCloud", async (o, h) => {
3808
+ P(this, "setCloud", async (o, h) => {
3809
3809
  const v = J(o);
3810
3810
  try {
3811
3811
  return window.BuzzCasting.WidgetData[v] = h, 201;
@@ -3819,7 +3819,7 @@ class Yr {
3819
3819
  * @param data
3820
3820
  * @returns number
3821
3821
  */
3822
- C(this, "setSeries", async (o, h) => {
3822
+ P(this, "setSeries", async (o, h) => {
3823
3823
  const v = J(o);
3824
3824
  try {
3825
3825
  return window.BuzzCasting.WidgetData[v] = h, 201;
@@ -3833,7 +3833,7 @@ class Yr {
3833
3833
  * @param data
3834
3834
  * @returns number
3835
3835
  */
3836
- C(this, "setMessages", async (o, h) => {
3836
+ P(this, "setMessages", async (o, h) => {
3837
3837
  const v = J(o);
3838
3838
  try {
3839
3839
  return window.BuzzCasting.WidgetData[v] = h, 201;
@@ -3841,10 +3841,10 @@ class Yr {
3841
3841
  return console.error("%cstorage", W, "set", o, D), 400;
3842
3842
  }
3843
3843
  });
3844
- C(this, "cleanMessages", async (o) => {
3844
+ P(this, "cleanMessages", async (o) => {
3845
3845
  console.log("cleanMessages not implemented for ", this.options.storage);
3846
3846
  });
3847
- C(this, "setWidget", async (o) => {
3847
+ P(this, "setWidget", async (o) => {
3848
3848
  const h = `widget.${o.widget}`;
3849
3849
  try {
3850
3850
  return window.BuzzCasting.WidgetData[h] = o, 201;
@@ -3857,7 +3857,7 @@ class Yr {
3857
3857
  * @param query IQuery
3858
3858
  * @returns null
3859
3859
  */
3860
- C(this, "subscribe", (o) => (o = ot(o), o.type === ie && (o = St(this.options, o)), this.subscribers.filter(
3860
+ P(this, "subscribe", (o) => (o = ot(o), o.type === ie && (o = St(this.options, o)), this.subscribers.filter(
3861
3861
  (v) => v.widget === o.widget
3862
3862
  ).length || (console.debug(
3863
3863
  "%cstorage%c %csubscribe",
@@ -3871,31 +3871,31 @@ class Yr {
3871
3871
  * Get current subscribers
3872
3872
  * @returns IQuery[]
3873
3873
  */
3874
- C(this, "getSubscribers", async () => await new Promise((o) => o(this.subscribers)));
3874
+ P(this, "getSubscribers", async () => await new Promise((o) => o(this.subscribers)));
3875
3875
  this.options = o, window.BuzzCasting.WidgetData = /* @__PURE__ */ new Set();
3876
3876
  }
3877
3877
  }
3878
- function Ui(j, o) {
3879
- for (; j.length < o; )
3880
- j = `0${j}`;
3881
- return j;
3878
+ function Ui(C, o) {
3879
+ for (; C.length < o; )
3880
+ C = `0${C}`;
3881
+ return C;
3882
3882
  }
3883
- function Ee(j, o) {
3883
+ function Ee(C, o) {
3884
3884
  let h, v, D;
3885
3885
  if (o.length === 0)
3886
- return j;
3886
+ return C;
3887
3887
  for (h = 0, D = o.length; h < D; h++)
3888
- v = o.charCodeAt(h), j = (j << 5) - j + v, j |= 0;
3889
- return j < 0 ? j * -2 : j;
3888
+ v = o.charCodeAt(h), C = (C << 5) - C + v, C |= 0;
3889
+ return C < 0 ? C * -2 : C;
3890
3890
  }
3891
- function Vi(j, o, h) {
3892
- return Object.keys(o).sort().reduce(v, j);
3891
+ function Vi(C, o, h) {
3892
+ return Object.keys(o).sort().reduce(v, C);
3893
3893
  function v(D, M) {
3894
3894
  return Hr(D, o[M], M, h);
3895
3895
  }
3896
3896
  }
3897
- function Hr(j, o, h, v) {
3898
- const D = Ee(Ee(Ee(j, h), Gi(o)), typeof o);
3897
+ function Hr(C, o, h, v) {
3898
+ const D = Ee(Ee(Ee(C, h), Gi(o)), typeof o);
3899
3899
  if (o === null)
3900
3900
  return Ee(D, "null");
3901
3901
  if (o === void 0)
@@ -3915,19 +3915,19 @@ function Hr(j, o, h, v) {
3915
3915
  }
3916
3916
  return Ee(D, o.toString());
3917
3917
  }
3918
- function Gi(j) {
3919
- return Object.prototype.toString.call(j);
3918
+ function Gi(C) {
3919
+ return Object.prototype.toString.call(C);
3920
3920
  }
3921
- function Yn(j) {
3922
- return Ui(Hr(0, j, "", []).toString(16), 8);
3921
+ function Yn(C) {
3922
+ return Ui(Hr(0, C, "", []).toString(16), 8);
3923
3923
  }
3924
3924
  class to {
3925
3925
  constructor(o) {
3926
- C(this, "sm");
3927
- C(this, "api");
3928
- C(this, "bc");
3929
- C(this, "options");
3930
- C(this, "update", async () => {
3926
+ P(this, "sm");
3927
+ P(this, "api");
3928
+ P(this, "bc");
3929
+ P(this, "options");
3930
+ P(this, "update", async () => {
3931
3931
  if (this.sm === null)
3932
3932
  return;
3933
3933
  const o = await this.sm.getSubscribers();
@@ -4030,10 +4030,10 @@ class to {
4030
4030
  })
4031
4031
  );
4032
4032
  });
4033
- C(this, "hide", (o) => {
4033
+ P(this, "hide", (o) => {
4034
4034
  this.api.hideMessage(o);
4035
4035
  });
4036
- C(this, "actions", async (o) => {
4036
+ P(this, "actions", async (o) => {
4037
4037
  var h;
4038
4038
  switch (o.data.event) {
4039
4039
  case "subscribe":
@@ -4051,7 +4051,7 @@ class to {
4051
4051
  break;
4052
4052
  }
4053
4053
  });
4054
- C(this, "cleanMessages", async () => {
4054
+ P(this, "cleanMessages", async () => {
4055
4055
  var h, v;
4056
4056
  const o = ((h = this.options) == null ? void 0 : h.retention) || 345600;
4057
4057
  return await ((v = this.sm) == null ? void 0 : v.cleanMessages(o));
@@ -4059,7 +4059,7 @@ class to {
4059
4059
  // TODO: add checksum to avoid broadcasting update
4060
4060
  // private setHash(widget: string) {
4061
4061
  // }
4062
- C(this, "getSubscribers", async () => {
4062
+ P(this, "getSubscribers", async () => {
4063
4063
  var o;
4064
4064
  return await ((o = this.sm) == null ? void 0 : o.getSubscribers());
4065
4065
  });
@@ -4103,13 +4103,13 @@ class to {
4103
4103
  }
4104
4104
  class Yi {
4105
4105
  constructor(o) {
4106
- C(this, "sm");
4106
+ P(this, "sm");
4107
4107
  /**
4108
4108
  * Retieve Cloud Data
4109
4109
  * @param query Widgets parameters, type "cloud"
4110
4110
  * @returns IResponse
4111
4111
  */
4112
- C(this, "getCloud", async (o) => {
4112
+ P(this, "getCloud", async (o) => {
4113
4113
  var h;
4114
4114
  return o.type !== le ? (console.warn(
4115
4115
  "%capp%c %get",
@@ -4130,7 +4130,7 @@ class Yi {
4130
4130
  * @param query Widgets parameters, type "messages"
4131
4131
  * @returns IResponse
4132
4132
  */
4133
- C(this, "getMessages", async (o) => {
4133
+ P(this, "getMessages", async (o) => {
4134
4134
  var h;
4135
4135
  return o.type !== ie ? (console.warn(
4136
4136
  "%capp%c %get",
@@ -4151,7 +4151,7 @@ class Yi {
4151
4151
  * @param query Widgets parameters, type "series"
4152
4152
  * @returns IResponse
4153
4153
  */
4154
- C(this, "getSeries", async (o) => {
4154
+ P(this, "getSeries", async (o) => {
4155
4155
  var h;
4156
4156
  return o.type !== fe ? (console.warn(
4157
4157
  "%capp%c %get",
@@ -4194,13 +4194,49 @@ class ao {
4194
4194
  * @param query
4195
4195
  */
4196
4196
  constructor(o, h) {
4197
- C(this, "storageReader");
4198
- C(this, "broadcastChannel");
4199
- C(this, "query");
4200
- C(this, "listeners");
4201
- C(this, "getCloud", async () => this.query.type !== le ? (console.warn("%cstorage%c %cwidget", W, H, nn, this.query.widget, "wrong method call for getCloud, expected type is", this.query.type), { data: null, message: `wrong method call for getMessages, expected type is ${this.query.type}`, success: !1 }) : await this.storageReader.getCloud(this.query));
4202
- C(this, "getMessages", async () => this.query.type !== ie ? (console.warn("%cstorage%c %cwidget", W, H, nn, this.query.widget, "wrong method call for getMessages, expected type is", this.query.type), { data: null, message: `wrong method call for getMessages, expected type is ${this.query.type}`, success: !1 }) : await this.storageReader.getMessages(this.query));
4203
- C(this, "getSeries", async () => this.query.type !== fe ? (console.warn("%cstorage%c %cwidget", W, H, nn, this.query.widget, "wrong method call for getSeries, expected type is", this.query.type), { data: null, message: `wrong method call for getMessages, expected type is ${this.query.type}`, success: !1 }) : await this.storageReader.getSeries(this.query));
4197
+ P(this, "storageReader");
4198
+ P(this, "broadcastChannel");
4199
+ P(this, "query");
4200
+ P(this, "listeners");
4201
+ P(this, "getCloud", async () => this.query.type !== le ? (console.warn(
4202
+ "%cstorage%c %cwidget",
4203
+ W,
4204
+ H,
4205
+ nn,
4206
+ this.query.widget,
4207
+ "Wrong method call for getCloud, expected type is",
4208
+ this.query.type
4209
+ ), {
4210
+ data: null,
4211
+ message: `wrong method call for getMessages, expected type is ${this.query.type}`,
4212
+ success: !1
4213
+ }) : await this.storageReader.getCloud(this.query));
4214
+ P(this, "getMessages", async () => this.query.type !== ie ? (console.warn(
4215
+ "%cstorage%c %cwidget",
4216
+ W,
4217
+ H,
4218
+ nn,
4219
+ this.query.widget,
4220
+ "Wrong method call for getMessages, expected type is",
4221
+ this.query.type
4222
+ ), {
4223
+ data: null,
4224
+ message: `wrong method call for getMessages, expected type is ${this.query.type}`,
4225
+ success: !1
4226
+ }) : await this.storageReader.getMessages(this.query));
4227
+ P(this, "getSeries", async () => this.query.type !== fe ? (console.warn(
4228
+ "%cstorage%c %cwidget",
4229
+ W,
4230
+ H,
4231
+ nn,
4232
+ this.query.widget,
4233
+ "Wrong method call for getSeries, expected type is",
4234
+ this.query.type
4235
+ ), {
4236
+ data: null,
4237
+ message: `wrong method call for getMessages, expected type is ${this.query.type}`,
4238
+ success: !1
4239
+ }) : await this.storageReader.getSeries(this.query));
4204
4240
  var D;
4205
4241
  if (this.listeners = o, h = ot(h), h.widget === void 0) {
4206
4242
  const M = (D = h.topics) == null ? void 0 : D.split("-");
@@ -4234,7 +4270,7 @@ class ao {
4234
4270
  }
4235
4271
  subscribe() {
4236
4272
  console.debug(
4237
- "%widget%c %csubscribe",
4273
+ "%cwidget%c %csubscribe",
4238
4274
  nn,
4239
4275
  H,
4240
4276
  at,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "buzzcasting-storage",
3
3
  "type": "module",
4
- "version": "2.5.7",
4
+ "version": "2.5.9",
5
5
  "private": false,
6
6
  "author": {
7
7
  "name": "Mark Tamis, TouchFlows SAS",