tsviewer 1.0.30 → 1.0.32

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,12 +1,12 @@
1
- import { ref as g, computed as B, defineAsyncComponent as Z, watch as Te, nextTick as ne, onMounted as Ut, onBeforeUnmount as jt, createElementBlock as Ie, openBlock as de, normalizeClass as Se, createVNode as re, createElementVNode as ce, createBlock as Rt, createCommentVNode as Mt, unref as J, Fragment as Vt, renderList as $t, toDisplayString as je } from "vue";
2
- import { defineStore as Ft, storeToRefs as He } from "pinia";
3
- import { fetchAuthSession as xt } from "aws-amplify/auth";
4
- function T(t) {
1
+ import { ref as y, computed as z, defineAsyncComponent as Z, watch as Te, nextTick as ne, onMounted as Vt, onBeforeUnmount as Wt, createElementBlock as Ie, openBlock as de, normalizeClass as _e, createVNode as re, createElementVNode as ue, createBlock as $t, createCommentVNode as Ft, unref as J, Fragment as xt, renderList as qt, toDisplayString as je } from "vue";
2
+ import { defineStore as Bt, storeToRefs as Ze } from "pinia";
3
+ import { fetchAuthSession as zt } from "aws-amplify/auth";
4
+ function S(t) {
5
5
  return t != null && typeof t == "object" && t["@@functional/placeholder"] === !0;
6
6
  }
7
- function L(t) {
7
+ function D(t) {
8
8
  return function e(n) {
9
- return arguments.length === 0 || T(n) ? e : t.apply(this, arguments);
9
+ return arguments.length === 0 || S(n) ? e : t.apply(this, arguments);
10
10
  };
11
11
  }
12
12
  function N(t) {
@@ -15,19 +15,19 @@ function N(t) {
15
15
  case 0:
16
16
  return e;
17
17
  case 1:
18
- return T(n) ? e : L(function(i) {
18
+ return S(n) ? e : D(function(i) {
19
19
  return t(n, i);
20
20
  });
21
21
  default:
22
- return T(n) && T(o) ? e : T(n) ? L(function(i) {
22
+ return S(n) && S(o) ? e : S(n) ? D(function(i) {
23
23
  return t(i, o);
24
- }) : T(o) ? L(function(i) {
24
+ }) : S(o) ? D(function(i) {
25
25
  return t(n, i);
26
26
  }) : t(n, o);
27
27
  }
28
28
  };
29
29
  }
30
- function Wt(t, e) {
30
+ function Xt(t, e) {
31
31
  t = t || [], e = e || [];
32
32
  var n, o = t.length, i = e.length, u = [];
33
33
  for (n = 0; n < o; )
@@ -36,7 +36,7 @@ function Wt(t, e) {
36
36
  u[u.length] = e[n], n += 1;
37
37
  return u;
38
38
  }
39
- function Ce(t, e) {
39
+ function Ee(t, e) {
40
40
  switch (t) {
41
41
  case 0:
42
42
  return function() {
@@ -59,27 +59,27 @@ function Ce(t, e) {
59
59
  return e.apply(this, arguments);
60
60
  };
61
61
  case 5:
62
- return function(n, o, i, u, h) {
62
+ return function(n, o, i, u, g) {
63
63
  return e.apply(this, arguments);
64
64
  };
65
65
  case 6:
66
- return function(n, o, i, u, h, w) {
66
+ return function(n, o, i, u, g, A) {
67
67
  return e.apply(this, arguments);
68
68
  };
69
69
  case 7:
70
- return function(n, o, i, u, h, w, l) {
70
+ return function(n, o, i, u, g, A, l) {
71
71
  return e.apply(this, arguments);
72
72
  };
73
73
  case 8:
74
- return function(n, o, i, u, h, w, l, s) {
74
+ return function(n, o, i, u, g, A, l, s) {
75
75
  return e.apply(this, arguments);
76
76
  };
77
77
  case 9:
78
- return function(n, o, i, u, h, w, l, s, A) {
78
+ return function(n, o, i, u, g, A, l, s, m) {
79
79
  return e.apply(this, arguments);
80
80
  };
81
81
  case 10:
82
- return function(n, o, i, u, h, w, l, s, A, m) {
82
+ return function(n, o, i, u, g, A, l, s, m, h) {
83
83
  return e.apply(this, arguments);
84
84
  };
85
85
  default:
@@ -92,29 +92,29 @@ function ge(t) {
92
92
  case 0:
93
93
  return e;
94
94
  case 1:
95
- return T(n) ? e : N(function(u, h) {
96
- return t(n, u, h);
95
+ return S(n) ? e : N(function(u, g) {
96
+ return t(n, u, g);
97
97
  });
98
98
  case 2:
99
- return T(n) && T(o) ? e : T(n) ? N(function(u, h) {
100
- return t(u, o, h);
101
- }) : T(o) ? N(function(u, h) {
102
- return t(n, u, h);
103
- }) : L(function(u) {
99
+ return S(n) && S(o) ? e : S(n) ? N(function(u, g) {
100
+ return t(u, o, g);
101
+ }) : S(o) ? N(function(u, g) {
102
+ return t(n, u, g);
103
+ }) : D(function(u) {
104
104
  return t(n, o, u);
105
105
  });
106
106
  default:
107
- return T(n) && T(o) && T(i) ? e : T(n) && T(o) ? N(function(u, h) {
108
- return t(u, h, i);
109
- }) : T(n) && T(i) ? N(function(u, h) {
110
- return t(u, o, h);
111
- }) : T(o) && T(i) ? N(function(u, h) {
112
- return t(n, u, h);
113
- }) : T(n) ? L(function(u) {
107
+ return S(n) && S(o) && S(i) ? e : S(n) && S(o) ? N(function(u, g) {
108
+ return t(u, g, i);
109
+ }) : S(n) && S(i) ? N(function(u, g) {
110
+ return t(u, o, g);
111
+ }) : S(o) && S(i) ? N(function(u, g) {
112
+ return t(n, u, g);
113
+ }) : S(n) ? D(function(u) {
114
114
  return t(u, o, i);
115
- }) : T(o) ? L(function(u) {
115
+ }) : S(o) ? D(function(u) {
116
116
  return t(n, u, i);
117
- }) : T(i) ? L(function(u) {
117
+ }) : S(i) ? D(function(u) {
118
118
  return t(n, o, u);
119
119
  }) : t(n, o, i);
120
120
  }
@@ -123,10 +123,10 @@ function ge(t) {
123
123
  const ye = Array.isArray || function(e) {
124
124
  return e != null && e.length >= 0 && Object.prototype.toString.call(e) === "[object Array]";
125
125
  };
126
- function qt(t) {
126
+ function Gt(t) {
127
127
  return t != null && typeof t["@@transducer/step"] == "function";
128
128
  }
129
- function Bt(t, e, n) {
129
+ function Ht(t, e, n) {
130
130
  return function() {
131
131
  if (arguments.length === 0)
132
132
  return n();
@@ -137,7 +137,7 @@ function Bt(t, e, n) {
137
137
  return o[t[i]].apply(o, Array.prototype.slice.call(arguments, 0, -1));
138
138
  i += 1;
139
139
  }
140
- if (qt(o)) {
140
+ if (Gt(o)) {
141
141
  var u = e.apply(null, Array.prototype.slice.call(arguments, 0, -1));
142
142
  return u(o);
143
143
  }
@@ -145,13 +145,13 @@ function Bt(t, e, n) {
145
145
  return n.apply(this, arguments);
146
146
  };
147
147
  }
148
- function zt(t) {
148
+ function Zt(t) {
149
149
  return t && t["@@transducer/reduced"] ? t : {
150
150
  "@@transducer/value": t,
151
151
  "@@transducer/reduced": !0
152
152
  };
153
153
  }
154
- const Xt = {
154
+ const Jt = {
155
155
  init: function() {
156
156
  return this.xf["@@transducer/init"]();
157
157
  },
@@ -162,9 +162,9 @@ const Xt = {
162
162
  function me(t) {
163
163
  return Object.prototype.toString.call(t) === "[object String]";
164
164
  }
165
- var Gt = /* @__PURE__ */ L(function(e) {
165
+ var Yt = /* @__PURE__ */ D(function(e) {
166
166
  return ye(e) ? !0 : !e || typeof e != "object" || me(e) ? !1 : e.length === 0 ? !0 : e.length > 0 ? e.hasOwnProperty(0) && e.hasOwnProperty(e.length - 1) : !1;
167
- }), Ht = /* @__PURE__ */ function() {
167
+ }), Kt = /* @__PURE__ */ function() {
168
168
  function t(e) {
169
169
  this.f = e;
170
170
  }
@@ -176,15 +176,15 @@ var Gt = /* @__PURE__ */ L(function(e) {
176
176
  return this.f(e, n);
177
177
  }, t;
178
178
  }();
179
- function Zt(t) {
180
- return new Ht(t);
179
+ function Qt(t) {
180
+ return new Kt(t);
181
181
  }
182
- var Jt = /* @__PURE__ */ N(function(e, n) {
183
- return Ce(e.length, function() {
182
+ var en = /* @__PURE__ */ N(function(e, n) {
183
+ return Ee(e.length, function() {
184
184
  return e.apply(n, arguments);
185
185
  });
186
186
  });
187
- function Yt(t, e, n) {
187
+ function tn(t, e, n) {
188
188
  for (var o = 0, i = n.length; o < i; ) {
189
189
  if (e = t["@@transducer/step"](e, n[o]), e && e["@@transducer/reduced"]) {
190
190
  e = e["@@transducer/value"];
@@ -194,7 +194,7 @@ function Yt(t, e, n) {
194
194
  }
195
195
  return t["@@transducer/result"](e);
196
196
  }
197
- function Re(t, e, n) {
197
+ function Me(t, e, n) {
198
198
  for (var o = n.next(); !o.done; ) {
199
199
  if (e = t["@@transducer/step"](e, o.value), e && e["@@transducer/reduced"]) {
200
200
  e = e["@@transducer/value"];
@@ -204,74 +204,74 @@ function Re(t, e, n) {
204
204
  }
205
205
  return t["@@transducer/result"](e);
206
206
  }
207
- function Me(t, e, n, o) {
208
- return t["@@transducer/result"](n[o](Jt(t["@@transducer/step"], t), e));
207
+ function Ve(t, e, n, o) {
208
+ return t["@@transducer/result"](n[o](en(t["@@transducer/step"], t), e));
209
209
  }
210
- var Ve = typeof Symbol < "u" ? Symbol.iterator : "@@iterator";
211
- function Kt(t, e, n) {
212
- if (typeof t == "function" && (t = Zt(t)), Gt(n))
213
- return Yt(t, e, n);
210
+ var We = typeof Symbol < "u" ? Symbol.iterator : "@@iterator";
211
+ function nn(t, e, n) {
212
+ if (typeof t == "function" && (t = Qt(t)), Yt(n))
213
+ return tn(t, e, n);
214
214
  if (typeof n["fantasy-land/reduce"] == "function")
215
- return Me(t, e, n, "fantasy-land/reduce");
216
- if (n[Ve] != null)
217
- return Re(t, e, n[Ve]());
215
+ return Ve(t, e, n, "fantasy-land/reduce");
216
+ if (n[We] != null)
217
+ return Me(t, e, n[We]());
218
218
  if (typeof n.next == "function")
219
- return Re(t, e, n);
219
+ return Me(t, e, n);
220
220
  if (typeof n.reduce == "function")
221
- return Me(t, e, n, "reduce");
221
+ return Ve(t, e, n, "reduce");
222
222
  throw new TypeError("reduce: list must be array or iterable");
223
223
  }
224
224
  function ve(t, e) {
225
225
  return Object.prototype.hasOwnProperty.call(e, t);
226
226
  }
227
- var $e = Object.prototype.toString, Ze = /* @__PURE__ */ function() {
227
+ var $e = Object.prototype.toString, Je = /* @__PURE__ */ function() {
228
228
  return $e.call(arguments) === "[object Arguments]" ? function(e) {
229
229
  return $e.call(e) === "[object Arguments]";
230
230
  } : function(e) {
231
231
  return ve("callee", e);
232
232
  };
233
- }(), Qt = !/* @__PURE__ */ {
233
+ }(), rn = !/* @__PURE__ */ {
234
234
  toString: null
235
235
  }.propertyIsEnumerable("toString"), Fe = ["constructor", "valueOf", "isPrototypeOf", "toString", "propertyIsEnumerable", "hasOwnProperty", "toLocaleString"], xe = /* @__PURE__ */ function() {
236
236
  return arguments.propertyIsEnumerable("length");
237
- }(), en = function(e, n) {
237
+ }(), on = function(e, n) {
238
238
  for (var o = 0; o < e.length; ) {
239
239
  if (e[o] === n)
240
240
  return !0;
241
241
  o += 1;
242
242
  }
243
243
  return !1;
244
- }, We = /* @__PURE__ */ L(typeof Object.keys == "function" && !xe ? function(e) {
244
+ }, qe = /* @__PURE__ */ D(typeof Object.keys == "function" && !xe ? function(e) {
245
245
  return Object(e) !== e ? [] : Object.keys(e);
246
246
  } : function(e) {
247
247
  if (Object(e) !== e)
248
248
  return [];
249
- var n, o, i = [], u = xe && Ze(e);
249
+ var n, o, i = [], u = xe && Je(e);
250
250
  for (n in e)
251
251
  ve(n, e) && (!u || n !== "length") && (i[i.length] = n);
252
- if (Qt)
252
+ if (rn)
253
253
  for (o = Fe.length - 1; o >= 0; )
254
- n = Fe[o], ve(n, e) && !en(i, n) && (i[i.length] = n), o -= 1;
254
+ n = Fe[o], ve(n, e) && !on(i, n) && (i[i.length] = n), o -= 1;
255
255
  return i;
256
256
  });
257
- const tn = Number.isInteger || function(e) {
257
+ const an = Number.isInteger || function(e) {
258
258
  return e << 0 === e;
259
259
  };
260
- var nn = /* @__PURE__ */ N(function(e, n) {
260
+ var sn = /* @__PURE__ */ N(function(e, n) {
261
261
  var o = e < 0 ? n.length + e : e;
262
262
  return me(n) ? n.charAt(o) : n[o];
263
263
  }), Y = /* @__PURE__ */ N(function(e, n) {
264
264
  if (n != null)
265
- return tn(e) ? nn(e, n) : n[e];
266
- }), rn = /* @__PURE__ */ ge(Kt), qe = /* @__PURE__ */ L(function(e) {
265
+ return an(e) ? sn(e, n) : n[e];
266
+ }), ln = /* @__PURE__ */ ge(nn), Be = /* @__PURE__ */ D(function(e) {
267
267
  return e === null ? "Null" : e === void 0 ? "Undefined" : Object.prototype.toString.call(e).slice(8, -1);
268
268
  });
269
- function on(t, e) {
269
+ function un(t, e) {
270
270
  return function() {
271
271
  return e.call(this, t.apply(this, arguments));
272
272
  };
273
273
  }
274
- function Je(t, e) {
274
+ function Ye(t, e) {
275
275
  return function() {
276
276
  var n = arguments.length;
277
277
  if (n === 0)
@@ -280,35 +280,35 @@ function Je(t, e) {
280
280
  return ye(o) || typeof o[t] != "function" ? e.apply(this, arguments) : o[t].apply(o, Array.prototype.slice.call(arguments, 0, n - 1));
281
281
  };
282
282
  }
283
- var an = /* @__PURE__ */ ge(
284
- /* @__PURE__ */ Je("slice", function(e, n, o) {
283
+ var cn = /* @__PURE__ */ ge(
284
+ /* @__PURE__ */ Ye("slice", function(e, n, o) {
285
285
  return Array.prototype.slice.call(o, e, n);
286
286
  })
287
- ), sn = /* @__PURE__ */ L(
288
- /* @__PURE__ */ Je(
287
+ ), dn = /* @__PURE__ */ D(
288
+ /* @__PURE__ */ Ye(
289
289
  "tail",
290
- /* @__PURE__ */ an(1, 1 / 0)
290
+ /* @__PURE__ */ cn(1, 1 / 0)
291
291
  )
292
292
  );
293
- function ln() {
293
+ function fn() {
294
294
  if (arguments.length === 0)
295
295
  throw new Error("pipe requires at least one argument");
296
- return Ce(arguments[0].length, rn(on, arguments[0], sn(arguments)));
296
+ return Ee(arguments[0].length, ln(un, arguments[0], dn(arguments)));
297
297
  }
298
- var un = /* @__PURE__ */ L(function(e) {
298
+ var vn = /* @__PURE__ */ D(function(e) {
299
299
  return me(e) ? e.split("").reverse().join("") : Array.prototype.slice.call(e, 0).reverse();
300
300
  });
301
- function Be() {
301
+ function ze() {
302
302
  if (arguments.length === 0)
303
303
  throw new Error("compose requires at least one argument");
304
- return ln.apply(this, un(arguments));
304
+ return fn.apply(this, vn(arguments));
305
305
  }
306
- function ze(t) {
306
+ function Xe(t) {
307
307
  for (var e = [], n; !(n = t.next()).done; )
308
308
  e.push(n.value);
309
309
  return e;
310
310
  }
311
- function Xe(t, e, n) {
311
+ function Ge(t, e, n) {
312
312
  for (var o = 0, i = n.length; o < i; ) {
313
313
  if (t(e, n[o]))
314
314
  return !0;
@@ -316,28 +316,28 @@ function Xe(t, e, n) {
316
316
  }
317
317
  return !1;
318
318
  }
319
- function cn(t) {
319
+ function pn(t) {
320
320
  var e = String(t).match(/^function (\w*)/);
321
321
  return e == null ? "" : e[1];
322
322
  }
323
- function dn(t, e) {
323
+ function hn(t, e) {
324
324
  return t === e ? t !== 0 || 1 / t === 1 / e : t !== t && e !== e;
325
325
  }
326
- const _e = typeof Object.is == "function" ? Object.is : dn;
327
- function Ge(t, e, n, o) {
328
- var i = ze(t), u = ze(e);
329
- function h(w, l) {
330
- return Ee(w, l, n.slice(), o.slice());
326
+ const be = typeof Object.is == "function" ? Object.is : hn;
327
+ function He(t, e, n, o) {
328
+ var i = Xe(t), u = Xe(e);
329
+ function g(A, l) {
330
+ return Oe(A, l, n.slice(), o.slice());
331
331
  }
332
- return !Xe(function(w, l) {
333
- return !Xe(h, l, w);
332
+ return !Ge(function(A, l) {
333
+ return !Ge(g, l, A);
334
334
  }, u, i);
335
335
  }
336
- function Ee(t, e, n, o) {
337
- if (_e(t, e))
336
+ function Oe(t, e, n, o) {
337
+ if (be(t, e))
338
338
  return !0;
339
- var i = qe(t);
340
- if (i !== qe(e))
339
+ var i = Be(t);
340
+ if (i !== Be(e))
341
341
  return !1;
342
342
  if (typeof t["fantasy-land/equals"] == "function" || typeof e["fantasy-land/equals"] == "function")
343
343
  return typeof t["fantasy-land/equals"] == "function" && t["fantasy-land/equals"](e) && typeof e["fantasy-land/equals"] == "function" && e["fantasy-land/equals"](t);
@@ -347,17 +347,17 @@ function Ee(t, e, n, o) {
347
347
  case "Arguments":
348
348
  case "Array":
349
349
  case "Object":
350
- if (typeof t.constructor == "function" && cn(t.constructor) === "Promise")
350
+ if (typeof t.constructor == "function" && pn(t.constructor) === "Promise")
351
351
  return t === e;
352
352
  break;
353
353
  case "Boolean":
354
354
  case "Number":
355
355
  case "String":
356
- if (!(typeof t == typeof e && _e(t.valueOf(), e.valueOf())))
356
+ if (!(typeof t == typeof e && be(t.valueOf(), e.valueOf())))
357
357
  return !1;
358
358
  break;
359
359
  case "Date":
360
- if (!_e(t.valueOf(), e.valueOf()))
360
+ if (!be(t.valueOf(), e.valueOf()))
361
361
  return !1;
362
362
  break;
363
363
  case "Error":
@@ -374,9 +374,9 @@ function Ee(t, e, n, o) {
374
374
  }
375
375
  switch (i) {
376
376
  case "Map":
377
- return t.size !== e.size ? !1 : Ge(t.entries(), e.entries(), n.concat([t]), o.concat([e]));
377
+ return t.size !== e.size ? !1 : He(t.entries(), e.entries(), n.concat([t]), o.concat([e]));
378
378
  case "Set":
379
- return t.size !== e.size ? !1 : Ge(t.values(), e.values(), n.concat([t]), o.concat([e]));
379
+ return t.size !== e.size ? !1 : He(t.values(), e.values(), n.concat([t]), o.concat([e]));
380
380
  case "Arguments":
381
381
  case "Array":
382
382
  case "Object":
@@ -400,48 +400,48 @@ function Ee(t, e, n, o) {
400
400
  default:
401
401
  return !1;
402
402
  }
403
- var h = We(t);
404
- if (h.length !== We(e).length)
403
+ var g = qe(t);
404
+ if (g.length !== qe(e).length)
405
405
  return !1;
406
- var w = n.concat([t]), l = o.concat([e]);
407
- for (u = h.length - 1; u >= 0; ) {
408
- var s = h[u];
409
- if (!(ve(s, e) && Ee(e[s], t[s], w, l)))
406
+ var A = n.concat([t]), l = o.concat([e]);
407
+ for (u = g.length - 1; u >= 0; ) {
408
+ var s = g[u];
409
+ if (!(ve(s, e) && Oe(e[s], t[s], A, l)))
410
410
  return !1;
411
411
  u -= 1;
412
412
  }
413
413
  return !0;
414
414
  }
415
- var Ye = /* @__PURE__ */ N(function(e, n) {
416
- return Ee(e, n, [], []);
415
+ var Ke = /* @__PURE__ */ N(function(e, n) {
416
+ return Oe(e, n, [], []);
417
417
  });
418
- function fn(t) {
418
+ function gn(t) {
419
419
  return Object.prototype.toString.call(t) === "[object Object]";
420
420
  }
421
421
  var pe = /* @__PURE__ */ N(function(e, n) {
422
422
  return n == null || n !== n ? e : n;
423
423
  });
424
- function vn(t) {
424
+ function yn(t) {
425
425
  var e = Object.prototype.toString.call(t);
426
426
  return e === "[object Uint8ClampedArray]" || e === "[object Int8Array]" || e === "[object Uint8Array]" || e === "[object Int16Array]" || e === "[object Uint16Array]" || e === "[object Int32Array]" || e === "[object Uint32Array]" || e === "[object Float32Array]" || e === "[object Float64Array]" || e === "[object BigInt64Array]" || e === "[object BigUint64Array]";
427
427
  }
428
- var pn = /* @__PURE__ */ L(function(e) {
429
- return e != null && typeof e["fantasy-land/empty"] == "function" ? e["fantasy-land/empty"]() : e != null && e.constructor != null && typeof e.constructor["fantasy-land/empty"] == "function" ? e.constructor["fantasy-land/empty"]() : e != null && typeof e.empty == "function" ? e.empty() : e != null && e.constructor != null && typeof e.constructor.empty == "function" ? e.constructor.empty() : ye(e) ? [] : me(e) ? "" : fn(e) ? {} : Ze(e) ? /* @__PURE__ */ function() {
428
+ var mn = /* @__PURE__ */ D(function(e) {
429
+ return e != null && typeof e["fantasy-land/empty"] == "function" ? e["fantasy-land/empty"]() : e != null && e.constructor != null && typeof e.constructor["fantasy-land/empty"] == "function" ? e.constructor["fantasy-land/empty"]() : e != null && typeof e.empty == "function" ? e.empty() : e != null && e.constructor != null && typeof e.constructor.empty == "function" ? e.constructor.empty() : ye(e) ? [] : me(e) ? "" : gn(e) ? {} : Je(e) ? /* @__PURE__ */ function() {
430
430
  return arguments;
431
- }() : vn(e) ? e.constructor.from("") : void 0;
432
- }), hn = /* @__PURE__ */ function() {
431
+ }() : yn(e) ? e.constructor.from("") : void 0;
432
+ }), wn = /* @__PURE__ */ function() {
433
433
  function t(e, n) {
434
434
  this.xf = n, this.f = e, this.idx = -1, this.found = !1;
435
435
  }
436
- return t.prototype["@@transducer/init"] = Xt.init, t.prototype["@@transducer/result"] = function(e) {
436
+ return t.prototype["@@transducer/init"] = Jt.init, t.prototype["@@transducer/result"] = function(e) {
437
437
  return this.found || (e = this.xf["@@transducer/step"](e, -1)), this.xf["@@transducer/result"](e);
438
438
  }, t.prototype["@@transducer/step"] = function(e, n) {
439
- return this.idx += 1, this.f(n) && (this.found = !0, e = zt(this.xf["@@transducer/step"](e, this.idx))), e;
439
+ return this.idx += 1, this.f(n) && (this.found = !0, e = Zt(this.xf["@@transducer/step"](e, this.idx))), e;
440
440
  }, t;
441
- }(), gn = /* @__PURE__ */ N(function(e, n) {
442
- return new hn(e, n);
443
- }), F = /* @__PURE__ */ N(
444
- /* @__PURE__ */ Bt([], gn, function(e, n) {
441
+ }(), An = /* @__PURE__ */ N(function(e, n) {
442
+ return new wn(e, n);
443
+ }), $ = /* @__PURE__ */ N(
444
+ /* @__PURE__ */ Ht([], An, function(e, n) {
445
445
  for (var o = 0, i = n.length; o < i; ) {
446
446
  if (e(n[o]))
447
447
  return o;
@@ -449,37 +449,45 @@ var pn = /* @__PURE__ */ L(function(e) {
449
449
  }
450
450
  return -1;
451
451
  })
452
- ), yn = /* @__PURE__ */ L(function(e) {
453
- return e != null && Ye(e, pn(e));
454
- }), x = /* @__PURE__ */ ge(function(e, n, o) {
455
- return Ye(n, Y(e, o));
452
+ ), Sn = /* @__PURE__ */ D(function(e) {
453
+ return e != null && Ke(e, mn(e));
454
+ }), F = /* @__PURE__ */ ge(function(e, n, o) {
455
+ return Ke(n, Y(e, o));
456
456
  }), he = /* @__PURE__ */ ge(function(e, n, o) {
457
457
  return pe(e, Y(n, o));
458
- }), mn = /* @__PURE__ */ N(function(e, n) {
459
- return Ce(e.length, function() {
458
+ }), Tn = /* @__PURE__ */ N(function(e, n) {
459
+ return Ee(e.length, function() {
460
460
  try {
461
461
  return e.apply(this, arguments);
462
462
  } catch (o) {
463
- return n.apply(this, Wt([o], arguments));
463
+ return n.apply(this, Xt([o], arguments));
464
464
  }
465
465
  });
466
466
  });
467
- const Ke = "https://api.pennsieve.net", Qe = "https://api2.pennsieve.net", et = "wss://api.pennsieve.net/streaming/ts/query", tt = "https://api.pennsieve.net/streaming", wn = {
468
- apiUrl: Ke,
469
- api2Url: Qe,
470
- timeSeriesUrl: et,
471
- timeSeriesApi: tt
472
- }, An = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
467
+ const Qe = "https://api.pennsieve.io", et = "https://api.pennsieve.net", tt = "https://api2.pennsieve.io", nt = "https://api2.pennsieve.net", rt = "wss://api.pennsieve.io/streaming/discover/ts/query", ot = "wss://api.pennsieve.net/streaming/discover/ts/query", at = "https://api.pennsieve.io/streaming", st = "https://api.pennsieve.net/streaming", In = {
468
+ pennsieveApiUrl: Qe,
469
+ pennsieveApiUrlDev: et,
470
+ pennsieveApi2Url: tt,
471
+ pennsieveApi2UrlDev: nt,
472
+ timeSeriesPublicUrl: rt,
473
+ timeSeriesPublicUrlDev: ot,
474
+ timeSeriesApi: at,
475
+ timeSeriesApiDev: st
476
+ }, _n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
473
477
  __proto__: null,
474
- api2Url: Qe,
475
- apiUrl: Ke,
476
- default: wn,
477
- timeSeriesApi: tt,
478
- timeSeriesUrl: et
478
+ default: In,
479
+ pennsieveApi2Url: tt,
480
+ pennsieveApi2UrlDev: nt,
481
+ pennsieveApiUrl: Qe,
482
+ pennsieveApiUrlDev: et,
483
+ timeSeriesApi: at,
484
+ timeSeriesApiDev: st,
485
+ timeSeriesPublicUrl: rt,
486
+ timeSeriesPublicUrlDev: ot
479
487
  }, Symbol.toStringTag, { value: "Module" }));
480
488
  async function fe() {
481
489
  try {
482
- return xt().then(
490
+ return zt().then(
483
491
  (t) => {
484
492
  var e;
485
493
  return (e = t == null ? void 0 : t.tokens) == null ? void 0 : e.accessToken.toString();
@@ -489,105 +497,82 @@ async function fe() {
489
497
  console.error(t);
490
498
  }
491
499
  }
492
- function Tn(t) {
493
- if (useRoute().name === "docs-login")
494
- return;
495
- pe(!1, Y("shouldShowToast", t));
496
- const n = pe(!1, Y("shouldRedirect", t));
497
- this.clearState(), n && this.$route.fullPath;
498
- }
499
- const In = (t) => Object.prototype.toString.call(t) === "[object String]", Sn = (t) => {
500
- Object.keys(t).forEach((e) => {
501
- In(t[e]) && (t[e] = t[e].trim());
502
- });
503
- };
504
- function _n(t, e) {
505
- if (!t)
506
- return Promise.reject({ status: 400, message: "Url is missing!" });
507
- const n = he("GET", "method", e), o = he({}, "header", e), i = Object.assign({}, { "Content-type": "application/json" }, o), u = Y("body", e);
508
- let h = { headers: i, method: n };
509
- if (u) {
510
- typeof u == "object" && Sn(u);
511
- const w = JSON.stringify(u);
512
- h = Object.assign({}, h, { body: w });
513
- }
514
- return fetch(t, h).then((w) => w.status >= 400 ? Promise.reject(w) : w.json().catch(() => w));
515
- }
516
- function be(t) {
517
- const e = Y("status", t);
518
- let n;
519
- if (e === void 0) {
520
- console.log(t);
521
- return;
522
- } else
523
- n = t.status;
524
- if (n === 400 && t.body)
525
- t.body.getReader().read().then(({ done: o, value: i }) => {
526
- const u = i instanceof Uint8Array ? String.fromCharCode.apply(null, i) : i;
527
- Be(pe(u), mn(Be(Y("message"), JSON.parse), (h, w) => w))(u);
528
- });
529
- else if (n === 401)
530
- return Tn();
531
- }
532
- const nt = Ft("tsviewer", () => {
533
- const t = An, e = g([]), n = g("NOT_MONTAGED"), o = g({}), i = g([]), u = g(null), h = g(null), w = g({}), l = g([]), s = g({}), A = g({}), m = g("POINTER"), b = B(() => (a) => i.value.find((c) => c.name === a)), M = B(() => e.value.filter((a) => a.selected)), R = B(() => () => {
500
+ const bn = () => ({
501
+ openConnection: async (e, n, o) => await new Promise((g, A) => {
502
+ const l = e + "?session=" + o + "&package=" + n;
503
+ console.log("Opening WebSocket connection to:", l);
504
+ let s = null;
505
+ const m = new WebSocket(l);
506
+ m.onopen = () => {
507
+ console.log("🔗 WebSocket opened for package:", n);
508
+ const h = { montage: "NOT_MONTAGED", packageId: n };
509
+ console.log("🎛️ Sending message payload"), m.send(JSON.stringify(h));
510
+ }, m.onclose = () => {
511
+ console.log("🔌 WebSocket closed for package:", n), s && s.channelDetails ? g({ res: s.channelDetails, status: "websocket closed" }) : (console.warn("No channel details received"), g({ res: null, status: "websocket closed without data" }));
512
+ }, m.onmessage = (h) => {
513
+ console.log("WebSocket message received:", h.data), s = JSON.parse(h.data), m.close();
514
+ }, m.onerror = (h) => {
515
+ console.error("WebSocket error:", h), A(h);
516
+ };
517
+ })
518
+ }), it = Bt("tsviewer", () => {
519
+ const t = _n, e = y([]), n = y("NOT_MONTAGED"), o = y({}), i = y([]), u = y(null), g = y(null), A = y({}), l = y([]), s = y({}), m = y({}), h = y("POINTER"), { openConnection: b } = bn(), M = z(() => (a) => i.value.find((c) => c.name === a)), R = z(() => e.value.filter((a) => a.selected)), _ = z(() => () => {
534
520
  const a = l.value.find((c) => c.selected);
535
521
  return a || (console.warn("No active layer found, available layers:", l.value), l.value.length > 0 ? l.value[0] : null);
536
- }), _ = () => {
522
+ }), V = () => {
537
523
  let a = !1;
538
- return l.value.forEach((c, v) => {
539
- !c.id && c.id !== 0 && (console.error(`Layer at index ${v} missing ID:`, c), a = !0), c.annotations || (console.warn(`Layer at index ${v} missing annotations array:`, c), c.annotations = []);
524
+ return l.value.forEach((c, p) => {
525
+ !c.id && c.id !== 0 && (console.error(`Layer at index ${p} missing ID:`, c), a = !0), c.annotations || (console.warn(`Layer at index ${p} missing annotations array:`, c), c.annotations = []);
540
526
  }), a && console.error("Annotation layer validation failed. Layers:", l.value), !a;
541
- }, V = B(() => (a) => l.value.flatMap((v) => v.annotations || []).find((v) => v.id === a)), E = (a) => {
542
- w.value = a;
543
- }, P = (a) => {
527
+ }, P = z(() => (a) => l.value.flatMap((p) => p.annotations || []).find((p) => p.id === a)), E = (a) => {
528
+ A.value = a;
529
+ }, I = (a) => {
544
530
  e.value = a;
545
- }, S = (a) => {
531
+ }, v = (a) => {
546
532
  n.value = a;
547
- }, p = (a) => {
533
+ }, T = (a) => {
548
534
  o.value = a;
549
- }, I = (a) => {
535
+ }, W = (a) => {
550
536
  i.value = a;
551
- }, $ = (a) => {
552
- u.value = a;
553
537
  }, O = (a) => {
554
- h.value = a;
555
- }, C = async (a) => {
556
- const c = a.packageId, v = await fe(), D = `https://api.pennsieve.net/packages/${c}?api_key=${v}`, ee = await _n(D);
557
- if (z())
558
- return E(ee), Promise.resolve(ee);
559
- throw new Error("Timeseries viewer is not available, since the file is not processed");
560
- }, z = () => (a) => {
561
- var v;
562
- return ((v = a == null ? void 0 : a.content) == null ? void 0 : v.state) === "READY";
563
- }, X = (a) => {
564
- const c = a.map((v) => (!v.id && v.id !== 0 && (console.warn("Annotation layer missing ID:", v), v.id = Math.random().toString(36).substr(2, 9)), v.annotations || (v.annotations = []), v.name || (v.name = `Layer ${v.id}`), v));
565
- l.value = c, console.log("Set annotations with validated structure:", c);
538
+ u.value = a;
539
+ }, C = (a) => {
540
+ g.value = a;
541
+ }, G = async (a) => {
542
+ const c = a.packageId, p = await fe();
543
+ let L = t.timeSeriesPublicUrl, ee = null;
544
+ ee = await b(L, c, p), E({ channels: ee.res, content: { id: c } });
545
+ }, H = () => (a) => {
546
+ var p;
547
+ return ((p = a == null ? void 0 : a.content) == null ? void 0 : p.state) === "READY";
566
548
  }, k = (a) => {
549
+ const c = a.map((p) => (!p.id && p.id !== 0 && (console.warn("Annotation layer missing ID:", p), p.id = Math.random().toString(36).substr(2, 9)), p.annotations || (p.annotations = []), p.name || (p.name = `Layer ${p.id}`), p));
550
+ l.value = c, console.log("Set annotations with validated structure:", c);
551
+ }, j = (a) => {
567
552
  if (!a && a !== 0) {
568
553
  console.error("setActiveAnnotationLayer called with invalid layerId:", a);
569
554
  return;
570
555
  }
571
- s.value = a, l.value.forEach((v) => v.selected = !1);
572
- const c = F(x("id", a), l.value);
556
+ s.value = a, l.value.forEach((p) => p.selected = !1);
557
+ const c = $(F("id", a), l.value);
573
558
  c >= 0 ? (l.value[c].selected = !0, console.log("Successfully set active layer:", l.value[c])) : console.error("Layer with ID not found:", a, "Available layers:", l.value);
574
- }, U = (a) => {
559
+ }, X = (a) => {
575
560
  if (l.value.forEach(
576
561
  (c) => {
577
- var v;
578
- return (v = c.annotations) == null ? void 0 : v.forEach((D) => D.selected = !1);
562
+ var p;
563
+ return (p = c.annotations) == null ? void 0 : p.forEach((L) => L.selected = !1);
579
564
  }
580
565
  ), a.id) {
581
- const c = F(x("id", a.layer_id), l.value);
566
+ const c = $(F("id", a.layer_id), l.value);
582
567
  if (c >= 0) {
583
- const v = F(x("id", a.id), l.value[c].annotations);
584
- v >= 0 && (l.value[c].annotations[v].selected = !0);
568
+ const p = $(F("id", a.id), l.value[c].annotations);
569
+ p >= 0 && (l.value[c].annotations[p].selected = !0);
585
570
  }
586
571
  }
587
- A.value = a;
588
- }, G = (a) => {
589
572
  m.value = a;
590
573
  }, K = (a) => {
574
+ h.value = a;
575
+ }, oe = (a) => {
591
576
  if (!a.id && a.id !== 0) {
592
577
  console.error("Cannot create layer without ID:", a);
593
578
  return;
@@ -608,33 +593,33 @@ const nt = Ft("tsviewer", () => {
608
593
  // Spread any additional properties
609
594
  };
610
595
  l.value.push(c), console.log("Created layer with validated structure:", c);
611
- }, oe = (a) => {
612
- const c = F(x("id", a.id), l.value);
596
+ }, x = (a) => {
597
+ const c = $(F("id", a.id), l.value);
613
598
  if (c >= 0) {
614
- const v = Object.assign(l.value[c], a);
615
- l.value[c] = v;
599
+ const p = Object.assign(l.value[c], a);
600
+ l.value[c] = p;
616
601
  }
617
- }, W = (a) => {
618
- const c = F(x("id", a.id), l.value);
619
- c >= 0 && l.value.splice(c, 1);
620
602
  }, Q = (a) => {
621
- const c = F(x("id", a.layer_id), l.value);
622
- c >= 0 && (l.value[c].annotations || (l.value[c].annotations = []), l.value[c].annotations.push(a), U(a));
603
+ const c = $(F("id", a.id), l.value);
604
+ c >= 0 && l.value.splice(c, 1);
623
605
  }, q = (a) => {
624
- const c = F(x("id", a.layer_id), l.value);
606
+ const c = $(F("id", a.layer_id), l.value);
607
+ c >= 0 && (l.value[c].annotations || (l.value[c].annotations = []), l.value[c].annotations.push(a), X(a));
608
+ }, ae = (a) => {
609
+ const c = $(F("id", a.layer_id), l.value);
625
610
  if (c >= 0) {
626
- const v = l.value[c].annotations, D = F(x("id", a.id), v);
627
- D >= 0 && (v[D] = a);
611
+ const p = l.value[c].annotations, L = $(F("id", a.id), p);
612
+ L >= 0 && (p[L] = a);
628
613
  }
629
- }, ae = (a) => {
630
- const c = F(x("id", a.layer_id), l.value);
614
+ }, ce = (a) => {
615
+ const c = $(F("id", a.layer_id), l.value);
631
616
  if (c >= 0) {
632
- const v = l.value[c].annotations, D = F(x("id", a.id), v);
633
- D >= 0 && v.splice(D, 1);
617
+ const p = l.value[c].annotations, L = $(F("id", a.id), p);
618
+ L >= 0 && p.splice(L, 1);
634
619
  }
635
- }, H = (a, c, v) => {
636
- const D = e.value.find((ee) => ee.id === a);
637
- D && (D[c] = v);
620
+ }, B = (a, c, p) => {
621
+ const L = e.value.find((ee) => ee.id === a);
622
+ L && (L[c] = p);
638
623
  };
639
624
  return {
640
625
  // State
@@ -643,66 +628,106 @@ const nt = Ft("tsviewer", () => {
643
628
  customMontageMap: o,
644
629
  workspaceMontages: i,
645
630
  viewerErrors: u,
646
- needsRerender: h,
631
+ needsRerender: g,
647
632
  viewerAnnotations: l,
648
633
  activeAnnotationLayer: s,
649
- activeAnnotation: A,
650
- activeViewer: w,
651
- viewerActiveTool: m,
634
+ activeAnnotation: m,
635
+ activeViewer: A,
636
+ viewerActiveTool: h,
652
637
  config: t,
653
638
  // Getters
654
- getMontageMessageByName: b,
655
- viewerSelectedChannels: M,
656
- getViewerActiveLayer: R,
657
- getAnnotationById: V,
639
+ getMontageMessageByName: M,
640
+ viewerSelectedChannels: R,
641
+ getViewerActiveLayer: _,
642
+ getAnnotationById: P,
658
643
  // Actions
659
- setChannels: P,
660
- setViewerMontageScheme: S,
661
- setCustomMontageMap: p,
662
- setWorkspaceMontages: I,
663
- setViewerErrors: $,
664
- setAnnotations: X,
665
- setActiveAnnotationLayer: k,
666
- setActiveAnnotation: U,
667
- setActiveTool: G,
668
- createLayer: K,
669
- updateLayer: oe,
670
- deleteLayer: W,
671
- createAnnotation: Q,
672
- updateAnnotation: q,
673
- deleteAnnotation: ae,
674
- updateChannelProperty: H,
644
+ setChannels: I,
645
+ setViewerMontageScheme: v,
646
+ setCustomMontageMap: T,
647
+ setWorkspaceMontages: W,
648
+ setViewerErrors: O,
649
+ setAnnotations: k,
650
+ setActiveAnnotationLayer: j,
651
+ setActiveAnnotation: X,
652
+ setActiveTool: K,
653
+ createLayer: oe,
654
+ updateLayer: x,
655
+ deleteLayer: Q,
656
+ createAnnotation: q,
657
+ updateAnnotation: ae,
658
+ deleteAnnotation: ce,
659
+ updateChannelProperty: B,
675
660
  updateChannelVisibility: (a, c) => {
676
- H(a, "visible", c);
661
+ B(a, "visible", c);
677
662
  },
678
663
  updateChannelSelection: (a, c) => {
679
- H(a, "selected", c);
664
+ B(a, "selected", c);
680
665
  },
681
666
  updateChannelFilter: (a, c) => {
682
- H(a, "filter", c);
667
+ B(a, "filter", c);
683
668
  },
684
- validateAnnotationLayers: _,
669
+ validateAnnotationLayers: V,
685
670
  resetViewer: () => {
686
- e.value = [], n.value = "NOT_MONTAGED", o.value = {}, i.value = [], u.value = null, l.value = [], s.value = {}, A.value = {}, m.value = "POINTER", w.value = {};
671
+ e.value = [], n.value = "NOT_MONTAGED", o.value = {}, i.value = [], u.value = null, l.value = [], s.value = {}, m.value = {}, h.value = "POINTER", A.value = {};
687
672
  },
688
673
  triggerRerender: (a) => {
689
- O({
674
+ C({
690
675
  timestamp: Date.now(),
691
676
  cause: a
692
677
  });
693
678
  },
694
679
  resetRerenderTrigger: () => {
695
- h.value = null;
680
+ g.value = null;
696
681
  },
697
- isTSFileProcessed: z,
698
- fetchAndSetActiveViewer: C,
682
+ isTSFileProcessed: H,
683
+ fetchAndSetActiveViewer: G,
699
684
  setActiveViewer: E
700
685
  };
701
686
  });
702
- function bn() {
703
- const t = nt(), { viewerChannels: e, viewerAnnotations: n } = He(t), o = (l) => l.id || "", i = (l) => {
704
- l.sort(function(A, m) {
705
- return A.start < m.start ? -1 : A.start > m.start ? 1 : 0;
687
+ function Cn(t) {
688
+ if (useRoute().name === "docs-login")
689
+ return;
690
+ pe(!1, Y("shouldShowToast", t));
691
+ const n = pe(!1, Y("shouldRedirect", t));
692
+ this.clearState(), n && this.$route.fullPath;
693
+ }
694
+ const En = (t) => Object.prototype.toString.call(t) === "[object String]", On = (t) => {
695
+ Object.keys(t).forEach((e) => {
696
+ En(t[e]) && (t[e] = t[e].trim());
697
+ });
698
+ };
699
+ function $n(t, e) {
700
+ if (!t)
701
+ return Promise.reject({ status: 400, message: "Url is missing!" });
702
+ const n = he("GET", "method", e), o = he({}, "header", e), i = Object.assign({}, { "Content-type": "application/json" }, o), u = Y("body", e);
703
+ let g = { headers: i, method: n };
704
+ if (u) {
705
+ typeof u == "object" && On(u);
706
+ const A = JSON.stringify(u);
707
+ g = Object.assign({}, g, { body: A });
708
+ }
709
+ return fetch(t, g).then((A) => A.status >= 400 ? Promise.reject(A) : A.json().catch(() => A));
710
+ }
711
+ function Ce(t) {
712
+ const e = Y("status", t);
713
+ let n;
714
+ if (e === void 0) {
715
+ console.log(t);
716
+ return;
717
+ } else
718
+ n = t.status;
719
+ if (n === 400 && t.body)
720
+ t.body.getReader().read().then(({ done: o, value: i }) => {
721
+ const u = i instanceof Uint8Array ? String.fromCharCode.apply(null, i) : i;
722
+ ze(pe(u), Tn(ze(Y("message"), JSON.parse), (g, A) => A))(u);
723
+ });
724
+ else if (n === 401)
725
+ return Cn();
726
+ }
727
+ function Pn() {
728
+ const t = it(), { viewerChannels: e, viewerAnnotations: n } = Ze(t), o = (l) => l.id || "", i = (l) => {
729
+ l.sort(function(m, h) {
730
+ return m.start < h.start ? -1 : m.start > h.start ? 1 : 0;
706
731
  });
707
732
  };
708
733
  return {
@@ -718,13 +743,13 @@ function bn() {
718
743
  throw new TypeError("Missing annotation data or layer_id", s);
719
744
  if (s.id)
720
745
  throw new TypeError("Trying to create an annotation that already exists", s.id);
721
- let A = s.start, m = s.duration || s.end - s.start;
746
+ let m = s.start, h = s.duration || s.end - s.start;
722
747
  const b = s.label, M = s.description, R = s.layer_id;
723
748
  if (!b)
724
749
  throw new Error("Annotation label is required");
725
- if (A == null)
750
+ if (m == null)
726
751
  throw new Error("Annotation start time is required");
727
- m < 0 && (m = -m, A = A - m);
752
+ h < 0 && (h = -h, m = m - h);
728
753
  let _ = [];
729
754
  if (console.log("🔧 useTsAnnotation: Processing channelIds...", {
730
755
  hasChannelIds: s.channelIds && Array.isArray(s.channelIds),
@@ -734,20 +759,20 @@ function bn() {
734
759
  // Now from Pinia
735
760
  }), s.allChannels) {
736
761
  console.log("🔧 useTsAnnotation: allChannels=true, adding all visible channels");
737
- const S = t.activeViewer.value.channels;
738
- for (let p = 0; p < S.length; p++) {
739
- const $ = S[p].content.id;
740
- _.push($), console.log("🔧 useTsAnnotation: Added channel ID:", $);
762
+ const I = t.activeViewer.value.channels;
763
+ for (let v = 0; v < I.length; v++) {
764
+ const W = I[v].content.id;
765
+ _.push(W), console.log("🔧 useTsAnnotation: Added channel ID:", W);
741
766
  }
742
767
  } else if (s.channelIds && Array.isArray(s.channelIds) && s.channelIds.length > 0)
743
768
  _ = s.channelIds, console.log("🔧 useTsAnnotation: Using provided channelIds:", _);
744
769
  else {
745
770
  console.log("🔧 useTsAnnotation: Computing from selected channels");
746
- for (let S = 0; S < e.value.length; S++) {
747
- const p = e.value[S];
748
- if (p.selected && p.visible) {
749
- const I = o(p);
750
- _.push(I), console.log("🔧 useTsAnnotation: Added selected channel ID:", I);
771
+ for (let I = 0; I < e.value.length; I++) {
772
+ const v = e.value[I];
773
+ if (v.selected && v.visible) {
774
+ const T = o(v);
775
+ _.push(T), console.log("🔧 useTsAnnotation: Added selected channel ID:", T);
751
776
  }
752
777
  }
753
778
  }
@@ -756,15 +781,15 @@ function bn() {
756
781
  label: b,
757
782
  name: b,
758
783
  description: M || "",
759
- start: Math.floor(A),
760
- end: Math.floor(A + m),
784
+ start: Math.floor(m),
785
+ end: Math.floor(m + h),
761
786
  channelIds: _
762
787
  };
763
788
  console.log("🔧 useTsAnnotation: API payload:", V);
764
- const E = t.activeViewer.value.content.id, P = `${t.config.apiUrl}/timeseries/${E}/layers/${R}/annotations`;
765
- console.log("🔧 useTsAnnotation: API URL:", P);
789
+ const P = t.activeViewer.value.content.id, E = `${t.config.apiUrl}/timeseries/${P}/layers/${R}/annotations`;
790
+ console.log("🔧 useTsAnnotation: API URL:", E);
766
791
  try {
767
- const S = await fe(), p = await fetch(`${P}?api_key=${S}`, {
792
+ const I = await fe(), v = await fetch(`${E}?api_key=${I}`, {
768
793
  method: "POST",
769
794
  headers: {
770
795
  "Content-Type": "application/json",
@@ -772,39 +797,39 @@ function bn() {
772
797
  },
773
798
  body: JSON.stringify(V)
774
799
  });
775
- if (!p.ok) {
776
- const C = await p.text();
777
- throw new Error(`HTTP ${p.status}: ${C}`);
800
+ if (!v.ok) {
801
+ const C = await v.text();
802
+ throw new Error(`HTTP ${v.status}: ${C}`);
778
803
  }
779
- const I = await p.json();
780
- console.log("🔧 useTsAnnotation: API success:", I);
781
- const $ = {
804
+ const T = await v.json();
805
+ console.log("🔧 useTsAnnotation: API success:", T);
806
+ const W = {
782
807
  name: "",
783
- id: I.id,
784
- label: I.label,
785
- description: I.description,
786
- start: I.start,
787
- duration: I.end - I.start,
788
- end: I.end,
808
+ id: T.id,
809
+ label: T.label,
810
+ description: T.description,
811
+ start: T.start,
812
+ duration: T.end - T.start,
813
+ end: T.end,
789
814
  cStart: null,
790
815
  cEnd: null,
791
816
  selected: !0,
792
- channelIds: I.channelIds || _,
817
+ channelIds: T.channelIds || _,
793
818
  allChannels: _.length === 0 || _.length >= e.value.length,
794
819
  // Use Pinia
795
820
  layer_id: R,
796
- userId: I.userId
821
+ userId: T.userId
797
822
  };
798
- I.linkedPackage && ($.linkedPackage = I.linkedPackage);
823
+ T.linkedPackage && (W.linkedPackage = T.linkedPackage);
799
824
  let O = 0;
800
825
  for (let C = 0; C < n.value.length; C++)
801
826
  if (n.value[C].id === R) {
802
827
  O = C;
803
828
  break;
804
829
  }
805
- return t.createAnnotation($), n.value[O] && n.value[O].annotations && i(n.value[O].annotations), $;
806
- } catch (S) {
807
- throw console.error("🔧 useTsAnnotation: Error creating annotation:", S), be(S), S;
830
+ return t.createAnnotation(W), n.value[O] && n.value[O].annotations && i(n.value[O].annotations), W;
831
+ } catch (I) {
832
+ throw console.error("🔧 useTsAnnotation: Error creating annotation:", I), Ce(I), I;
808
833
  }
809
834
  },
810
835
  updateAnnotation: async (l = null) => {
@@ -813,13 +838,13 @@ function bn() {
813
838
  throw new TypeError("Trying to update an annotation that doesn't exist on server", s.id);
814
839
  if (!s.layer_id)
815
840
  throw new TypeError("Missing layer_id for annotation update", s);
816
- let A = s.start, m = s.duration || s.end - s.start;
817
- m < 0 && (m = -m, A = A - m);
841
+ let m = s.start, h = s.duration || s.end - s.start;
842
+ h < 0 && (h = -h, m = m - h);
818
843
  const b = {
819
844
  label: s.label,
820
845
  description: s.description || "",
821
- start: Math.floor(A),
822
- end: Math.floor(A + m),
846
+ start: Math.floor(m),
847
+ end: Math.floor(m + h),
823
848
  channelIds: s.channelIds || []
824
849
  };
825
850
  console.log("🔧 useTsAnnotation: Update API payload:", b);
@@ -835,19 +860,19 @@ function bn() {
835
860
  body: JSON.stringify(b)
836
861
  });
837
862
  if (!V.ok) {
838
- const S = await V.text();
839
- throw new Error(`HTTP ${V.status}: ${S}`);
863
+ const I = await V.text();
864
+ throw new Error(`HTTP ${V.status}: ${I}`);
840
865
  }
841
- const E = await V.json();
842
- console.log("🔧 useTsAnnotation: Update API success:", E);
843
- const P = {
866
+ const P = await V.json();
867
+ console.log("🔧 useTsAnnotation: Update API success:", P);
868
+ const E = {
844
869
  ...s,
845
- ...E,
846
- duration: E.end - E.start
870
+ ...P,
871
+ duration: P.end - P.start
847
872
  };
848
- return t.updateAnnotation(P), E;
873
+ return t.updateAnnotation(E), P;
849
874
  } catch (_) {
850
- throw console.error("🔧 useTsAnnotation: Error updating annotation:", _), be(_), _;
875
+ throw console.error("🔧 useTsAnnotation: Error updating annotation:", _), Ce(_), _;
851
876
  }
852
877
  },
853
878
  removeAnnotation: async (l) => {
@@ -856,10 +881,10 @@ function bn() {
856
881
  let s = "";
857
882
  if (l.layer ? s = l.layer.id : s = l.layer_id, !s)
858
883
  throw new TypeError("Missing layer_id for annotation deletion", l);
859
- const A = t.activeViewer.value.content.id, m = `${t.config.apiUrl}/timeseries/${A}/layers/${s}/annotations/${l.id}`;
860
- console.log("🔧 useTsAnnotation: Delete API URL:", m);
884
+ const m = t.activeViewer.value.content.id, h = `${t.config.apiUrl}/timeseries/${m}/layers/${s}/annotations/${l.id}`;
885
+ console.log("🔧 useTsAnnotation: Delete API URL:", h);
861
886
  try {
862
- const b = await fe(), M = await fetch(`${m}?api_key=${b}`, {
887
+ const b = await fe(), M = await fetch(`${h}?api_key=${b}`, {
863
888
  method: "DELETE",
864
889
  headers: {
865
890
  Accept: "application/json"
@@ -871,19 +896,19 @@ function bn() {
871
896
  }
872
897
  return console.log("🔧 useTsAnnotation: Delete API success"), t.deleteAnnotation(l), !0;
873
898
  } catch (b) {
874
- throw console.error("🔧 useTsAnnotation: Error deleting annotation:", b), be(b), b;
899
+ throw console.error("🔧 useTsAnnotation: Error deleting annotation:", b), Ce(b), b;
875
900
  }
876
901
  },
877
902
  sortAnns: i,
878
903
  getChannelId: o
879
904
  };
880
905
  }
881
- const Cn = (t, e) => {
906
+ const Dn = (t, e) => {
882
907
  const n = t.__vccOpts || t;
883
908
  for (const [o, i] of e)
884
909
  n[o] = i;
885
910
  return n;
886
- }, En = { id: "channelCanvas" }, On = ["data-id"], Pn = ["hidden"], Ln = ["hidden"], kn = {
911
+ }, kn = { id: "channelCanvas" }, Ln = ["data-id"], Nn = ["hidden"], Un = ["hidden"], Rn = {
887
912
  __name: "TSViewer",
888
913
  props: {
889
914
  pkg: {
@@ -901,7 +926,7 @@ const Cn = (t, e) => {
901
926
  }
902
927
  },
903
928
  setup(t, { expose: e }) {
904
- const n = Z(() => import("./TSScrubber-BHyiFEEN.mjs")), o = Z(() => import("./TSViewerCanvas-bkWRtQiL.mjs").then((r) => r.T)), i = Z(() => import("./TSViewerToolbar-Difc8d0T.mjs")), u = Z(() => import("./TSFilterModal-CJH8zXyp.mjs")), h = Z(() => import("./TSAnnotationModal-EjnPa9Zo.mjs")), w = Z(() => import("./TsAnnotationDeleteDialog-DxKI_m1a.mjs")), l = Z(() => import("./TSViewerLayerWindow-BQ94kN9H.mjs")), s = {
929
+ const n = Z(() => import("./TSScrubber-CfI0H_CE.mjs")), o = Z(() => import("./TSViewerCanvas-BZitVLGc.mjs").then((r) => r.T)), i = Z(() => import("./TSViewerToolbar-BwtRehDx.mjs")), u = Z(() => import("./TSFilterModal-ZewnIuXD.mjs")), g = Z(() => import("./TSAnnotationModal-B-OHQVza.mjs")), A = Z(() => import("./TsAnnotationDeleteDialog-Ce9pB5DQ.mjs")), l = Z(() => import("./TSViewerLayerWindow-U3NyH3nc.mjs")), s = {
905
930
  TIMEUNIT: "microSeconds",
906
931
  // Basis for time
907
932
  XOFFSET: 0,
@@ -938,39 +963,39 @@ const Cn = (t, e) => {
938
963
  // Maximum duration window (5min)
939
964
  INITDURATION: 15e6
940
965
  // Initial duration window (15sec)
941
- }, A = t, m = nt(), { viewerChannels: b, needsRerender: M } = He(m), {
966
+ }, m = t, h = it(), { viewerChannels: b, needsRerender: M } = Ze(h), {
942
967
  addAnnotation: R,
943
968
  updateAnnotation: _,
944
969
  removeAnnotation: V
945
- } = bn(), E = g(null), P = g(null), S = g(null), p = g(null), I = g(null), $ = g(null), O = g(null), C = g(null), z = g(0), X = g(0), k = g(0), U = g(0), G = g(0), K = g(0), oe = g(0), W = g(1), Q = g(1 / 10), q = g(!1), ae = g(!1), H = g(null), ie = g(!1), se = g(!1), le = B(() => m.activeViewer), Oe = B(() => b.value.map((r) => ({
970
+ } = Pn(), P = y(null), E = y(null), I = y(null), v = y(null), T = y(null), W = y(null), O = y(null), C = y(null), G = y(0), H = y(0), k = y(0), j = y(0), X = y(0), K = y(0), oe = y(0), x = y(1), Q = y(1 / 10), q = y(!1), ae = y(!1), ce = y(null), B = y(!1), se = y(!1), ie = z(() => h.activeViewer), Pe = z(() => b.value.map((r) => ({
946
971
  ...r,
947
972
  selected: !!r.selected
948
- }))), we = B(() => Oe.value.filter((r) => r.visible)), Ae = B(() => {
973
+ }))), we = z(() => Pe.value.filter((r) => r.visible)), Ae = z(() => {
949
974
  let r = !1;
950
- return K.value / a.value < 30 && (r = !0), r;
951
- }), a = B(() => we.value.length), c = async () => {
952
- if (console.log("onresize..."), !E.value)
975
+ return K.value / Se.value < 30 && (r = !0), r;
976
+ }), Se = z(() => we.value.length), a = async () => {
977
+ if (console.log("onresize..."), !P.value)
953
978
  return;
954
979
  const r = document.getElementById("ts_viewer");
955
980
  if (!r)
956
981
  return;
957
- const f = window.getComputedStyle(r, null), d = parseInt(f.getPropertyValue("height")), y = A.isPreview ? 0 : 100;
958
- z.value = d - y, await ne(), X.value = E.value.offsetWidth;
959
- const j = S.value;
960
- j && (oe.value = j.clientWidth, G.value = X.value - j.clientWidth - 16, K.value = z.value - 40);
982
+ const f = window.getComputedStyle(r, null), d = parseInt(f.getPropertyValue("height")), w = m.isPreview ? 0 : 100;
983
+ G.value = d - w, await ne(), H.value = P.value.offsetWidth;
984
+ const U = I.value;
985
+ U && (oe.value = U.clientWidth, X.value = H.value - U.clientWidth - 16, K.value = G.value - 40);
961
986
  };
962
- Te(() => le.value, async (r, f) => {
963
- var d, y, j;
964
- (d = P.value) != null && d.resetComponentState && P.value.resetComponentState(), r && r.channels && r.channels.length > 0 && De(), Ne(), await ne(), (y = P.value) != null && y.initSegmentSpans && P.value.initSegmentSpans(), (j = P.value) != null && j.getAnnotations && P.value.getAnnotations();
965
- }, { immediate: !1, deep: !0 }), Te(a, (r, f) => {
987
+ Te(() => ie.value, async (r, f) => {
988
+ var d, w, U;
989
+ (d = E.value) != null && d.resetComponentState && E.value.resetComponentState(), r && r.channels && r.channels.length > 0 && Ne(), Ue(), await ne(), (w = E.value) != null && w.initSegmentSpans && E.value.initSegmentSpans(), (U = E.value) != null && U.getAnnotations && E.value.getAnnotations();
990
+ }, { immediate: !1, deep: !0 }), Te(Se, (r, f) => {
966
991
  f !== void 0 && r !== f && (console.log(`Number of visible channels changed from ${f} to ${r}`), setTimeout(() => {
967
992
  var d;
968
- c(), (d = p.value) != null && d.renderAll && p.value.renderAll();
993
+ a(), (d = v.value) != null && d.renderAll && v.value.renderAll();
969
994
  }, 20));
970
995
  });
971
- const v = (r) => {
996
+ const c = (r) => {
972
997
  store.dispatch("viewerModule/setActiveAnnotation", r).then(() => {
973
- p.value.renderAnnotationCanvas(), q.value = !0;
998
+ v.value.renderAnnotationCanvas(), q.value = !0;
974
999
  });
975
1000
  };
976
1001
  Te(M, (r) => {
@@ -978,13 +1003,13 @@ const Cn = (t, e) => {
978
1003
  var f;
979
1004
  r.cause === "channel-visibility" ? setTimeout(() => {
980
1005
  var d;
981
- c(), (d = p.value) != null && d.renderAll && p.value.renderAll();
982
- }, 10) : (f = p.value) != null && f.renderAll && p.value.renderAll();
983
- }), m.resetRerenderTrigger(null));
1006
+ a(), (d = v.value) != null && d.renderAll && v.value.renderAll();
1007
+ }, 10) : (f = v.value) != null && f.renderAll && v.value.renderAll();
1008
+ }), h.resetRerenderTrigger(null));
984
1009
  }, { deep: !0 });
985
- const D = (r) => {
986
- v(r);
987
- }, ee = async (r) => {
1010
+ const p = (r) => {
1011
+ c(r);
1012
+ }, L = async (r) => {
988
1013
  if (console.log("📍 TSViewer: onCreateUpdateAnnotation received:", r), !r || Object.keys(r).length === 0) {
989
1014
  console.error("🚨 TSViewer: Received empty annotation!");
990
1015
  return;
@@ -995,314 +1020,314 @@ const Cn = (t, e) => {
995
1020
  }
996
1021
  q.value = !1;
997
1022
  try {
998
- r.id ? (console.log("📍 TSViewer: Updating annotation via composable"), await _(r), rt()) : (console.log("📍 TSViewer: Creating annotation via composable"), await R(r), lt()), console.log("📍 TSViewer: Annotation operation completed successfully");
1023
+ r.id ? (console.log("📍 TSViewer: Updating annotation via composable"), await _(r), ee()) : (console.log("📍 TSViewer: Creating annotation via composable"), await R(r), ft()), console.log("📍 TSViewer: Annotation operation completed successfully");
999
1024
  } catch (f) {
1000
1025
  console.error("📍 TSViewer: Error creating/updating annotation:", f), q.value = !0;
1001
1026
  }
1002
- }, rt = () => {
1003
- p.value.renderAnnotationCanvas();
1004
- }, ot = (r) => {
1005
- H.value = r, ie.value = !0;
1006
- }, at = async (r) => {
1007
- ie.value = !1;
1027
+ }, ee = () => {
1028
+ v.value.renderAnnotationCanvas();
1029
+ }, lt = (r) => {
1030
+ ce.value = r, B.value = !0;
1031
+ }, ut = async (r) => {
1032
+ B.value = !1;
1008
1033
  try {
1009
- await V(r), it(), console.log("📍 TSViewer: Annotation deleted successfully");
1034
+ await V(r), ct(), console.log("📍 TSViewer: Annotation deleted successfully");
1010
1035
  } catch (f) {
1011
1036
  console.error("📍 TSViewer: Error deleting annotation:", f);
1012
1037
  }
1013
- }, it = () => {
1014
- p.value.renderAnnotationCanvas();
1015
- }, st = (r, f, d, y, j, ue) => {
1038
+ }, ct = () => {
1039
+ v.value.renderAnnotationCanvas();
1040
+ }, dt = (r, f, d, w, U, le) => {
1016
1041
  if (console.log("📍 TSViewer: onAddAnnotation called with:", {
1017
1042
  startTime: r,
1018
1043
  duration: f,
1019
1044
  allChannels: d,
1020
- label: y,
1021
- description: j,
1022
- layer: ue
1023
- }), !ue || !ue.id) {
1024
- console.error("Invalid layer provided to onAddAnnotation:", ue);
1045
+ label: w,
1046
+ description: U,
1047
+ layer: le
1048
+ }), !le || !le.id) {
1049
+ console.error("Invalid layer provided to onAddAnnotation:", le);
1025
1050
  return;
1026
1051
  }
1027
- const kt = m.viewerSelectedChannels || [], Dt = d ? [] : kt.map((Nt) => Nt.id), Ue = {
1052
+ const Rt = h.viewerSelectedChannels || [], jt = d ? [] : Rt.map((Mt) => Mt.id), Re = {
1028
1053
  id: null,
1029
- label: y || "Event",
1030
- description: j || "",
1054
+ label: w || "Event",
1055
+ description: U || "",
1031
1056
  start: Math.floor(r),
1032
1057
  end: Math.floor(r + f),
1033
1058
  duration: Math.floor(f),
1034
- channelIds: Dt,
1059
+ channelIds: jt,
1035
1060
  allChannels: d,
1036
- layer_id: ue.id,
1061
+ layer_id: le.id,
1037
1062
  selected: !0,
1038
1063
  userId: null
1039
1064
  };
1040
- console.log("📍 TSViewer: Created annotation object:", Ue), m.setActiveAnnotation(Ue), console.log("📍 TSViewer: Store now contains:", m.activeAnnotation), q.value = !0, console.log("📍 TSViewer: Modal opened with annotation data");
1041
- }, lt = () => {
1042
- p.value.renderAnnotationCanvas();
1043
- }, ut = (r) => {
1044
- p.value.createAnnotationLayer(r);
1045
- }, Pe = () => {
1065
+ console.log("📍 TSViewer: Created annotation object:", Re), h.setActiveAnnotation(Re), console.log("📍 TSViewer: Store now contains:", h.activeAnnotation), q.value = !0, console.log("📍 TSViewer: Modal opened with annotation data");
1066
+ }, ft = () => {
1067
+ v.value.renderAnnotationCanvas();
1068
+ }, vt = (r) => {
1069
+ v.value.createAnnotationLayer(r);
1070
+ }, De = () => {
1046
1071
  ae.value = !1;
1047
- }, ct = () => {
1048
- p.value.resetFocusedAnnotation(), p.value.renderAnnotationCanvas(), q.value = !1;
1049
- }, dt = () => {
1072
+ }, pt = () => {
1073
+ v.value.resetFocusedAnnotation(), v.value.renderAnnotationCanvas(), q.value = !1;
1074
+ }, ht = () => {
1050
1075
  se.value = !1;
1051
- }, ft = (r) => {
1076
+ }, gt = (r) => {
1052
1077
  r.stopPropagation(), r.preventDefault();
1053
1078
  const f = r.detail.sourceEvent.metaKey;
1054
- Le({ channelId: r.currentTarget.dataset.id, append: f }), p.value.renderAll();
1055
- }, vt = () => {
1056
- k.value = p.value.getNextAnnotation();
1057
- }, pt = () => {
1058
- k.value = p.value.getPreviousAnnotation();
1059
- }, ht = (r) => {
1060
- ke(r * 1e6);
1061
- }, gt = () => {
1062
- W.value = W.value * 1.25;
1079
+ ke({ channelId: r.currentTarget.dataset.id, append: f }), v.value.renderAll();
1063
1080
  }, yt = () => {
1064
- W.value = W.value * 0.8;
1081
+ k.value = v.value.getNextAnnotation();
1065
1082
  }, mt = () => {
1066
- P.value.getAnnotations();
1067
- }, wt = () => {
1083
+ k.value = v.value.getPreviousAnnotation();
1084
+ }, wt = (r) => {
1085
+ Le(r * 1e6);
1068
1086
  }, At = () => {
1087
+ x.value = x.value * 1.25;
1088
+ }, St = () => {
1089
+ x.value = x.value * 0.8;
1090
+ }, Tt = () => {
1091
+ E.value.getAnnotations();
1092
+ }, It = () => {
1093
+ }, _t = () => {
1069
1094
  console.log("Page forward triggered from toolbar");
1070
1095
  const r = Math.max(
1071
- k.value - 3 / 4 * U.value,
1096
+ k.value - 3 / 4 * j.value,
1072
1097
  O.value
1073
1098
  );
1074
1099
  te(r), ne(() => {
1075
1100
  var f;
1076
- (f = p.value) == null || f.renderAll();
1101
+ (f = v.value) == null || f.renderAll();
1077
1102
  });
1078
- }, Tt = () => {
1103
+ }, bt = () => {
1079
1104
  console.log("Page forward triggered from toolbar");
1080
1105
  const r = Math.min(
1081
- k.value + 3 / 4 * U.value,
1082
- C.value - U.value
1106
+ k.value + 3 / 4 * j.value,
1107
+ C.value - j.value
1083
1108
  );
1084
1109
  console.log(`Moving from ${k.value} to ${r}`), te(r), ne(() => {
1085
1110
  var f, d;
1086
- (f = p.value) != null && f.invalidate && p.value.invalidate(), (d = p.value) != null && d.renderAll && p.value.renderAll();
1111
+ (f = v.value) != null && f.invalidate && v.value.invalidate(), (d = v.value) != null && d.renderAll && v.value.renderAll();
1087
1112
  });
1088
- }, It = (r) => {
1089
- let f = p.value.rsPeriod;
1090
- te(r.annotation.start - (Q.value * G.value - s.CURSOROFFSET) * f), ne(() => {
1113
+ }, Ct = (r) => {
1114
+ let f = v.value.rsPeriod;
1115
+ te(r.annotation.start - (Q.value * X.value - s.CURSOROFFSET) * f), ne(() => {
1091
1116
  var d;
1092
- (d = p.value) == null || d.renderAll();
1117
+ (d = v.value) == null || d.renderAll();
1093
1118
  });
1094
- }, Le = (r) => {
1119
+ }, ke = (r) => {
1095
1120
  const f = b.value.map((d) => {
1096
- const y = d.selected;
1097
- return r.append === !1 && (d.selected = !1), r.channelId === d.id && (d.selected = !y), d;
1121
+ const w = d.selected;
1122
+ return r.append === !1 && (d.selected = !1), r.channelId === d.id && (d.selected = !w), d;
1098
1123
  });
1099
- m.setChannels(f);
1100
- }, St = (r, f) => {
1101
- const d = b.value.map((y) => (f === !1 && (y.selected = !1), y.id in r && (y.selected = !0), y));
1102
- m.setChannels(d);
1124
+ h.setChannels(f);
1125
+ }, Et = (r, f) => {
1126
+ const d = b.value.map((w) => (f === !1 && (w.selected = !1), w.id in r && (w.selected = !0), w));
1127
+ h.setChannels(d);
1103
1128
  }, te = (r) => {
1104
1129
  k.value = r;
1105
- }, _t = (r) => {
1130
+ }, Ot = (r) => {
1106
1131
  Q.value = r;
1107
- }, bt = (r) => {
1108
- W.value = r;
1109
- }, ke = (r) => {
1110
- r > s.MAXDURATION ? U.value = s.MAXDURATION : U.value = r;
1111
- }, Ct = (r, f, d) => (s.DEFAULTDPI * window.devicePixelRatio / (f * d) / 25.4).toFixed(1) + " " + r.unit + "/mm", De = () => {
1132
+ }, Pt = (r) => {
1133
+ x.value = r;
1134
+ }, Le = (r) => {
1135
+ r > s.MAXDURATION ? j.value = s.MAXDURATION : j.value = r;
1136
+ }, Dt = (r, f, d) => (s.DEFAULTDPI * window.devicePixelRatio / (f * d) / 25.4).toFixed(1) + " " + r.unit + "/mm", Ne = () => {
1112
1137
  var f;
1113
- const r = (f = le.value) == null ? void 0 : f.channels;
1138
+ const r = (f = ie.value) == null ? void 0 : f.channels;
1114
1139
  if (console.log("🔄 initTimeRange called with channels:", (r == null ? void 0 : r.length) || 0), r && r.length > 0) {
1115
- O.value = r[0].content.start, C.value = r[0].content.end;
1116
- for (let y = 1; y < r.length; y++)
1117
- r[y].content.start < O.value && (O.value = r[y].content.start), r[y].content.end > C.value && (C.value = r[y].content.end);
1140
+ O.value = r[0].start, C.value = r[0].end;
1141
+ for (let w = 1; w < r.length; w++)
1142
+ r[w].start < O.value && (O.value = r[w].start), r[w].end > C.value && (C.value = r[w].end);
1118
1143
  const d = k.value;
1119
1144
  k.value = O.value, console.log("📅 Time range initialized:", {
1120
1145
  ts_start: O.value,
1121
1146
  ts_end: C.value,
1122
1147
  oldStart: d,
1123
1148
  newStart: k.value,
1124
- duration: U.value,
1149
+ duration: j.value,
1125
1150
  startDate: new Date(O.value / 1e3).toISOString(),
1126
1151
  endDate: new Date(C.value / 1e3).toISOString()
1127
1152
  });
1128
1153
  } else
1129
1154
  console.warn("⚠️ initTimeRange: No channels found in activeViewer");
1130
- }, Et = () => {
1131
- De();
1132
- }, Ot = (r) => {
1133
- ae.value = !0;
1134
- }, Pt = (r) => {
1135
- const f = he([], "channels", r), d = he("", "filter", r), y = I.value;
1136
- y.onChannels = f, yn(d) ? (y.input0 = NaN, y.input1 = NaN, y.selectedFilter = null, y.selectedNotch = null) : (y.input0 = d.input0, y.input1 = d.input1), se.value = !0;
1155
+ }, kt = () => {
1156
+ Ne();
1137
1157
  }, Lt = (r) => {
1138
- p.value.setFilters(r);
1139
- }, Ne = () => {
1158
+ ae.value = !0;
1159
+ }, Nt = (r) => {
1160
+ const f = he([], "channels", r), d = he("", "filter", r), w = T.value;
1161
+ w.onChannels = f, Sn(d) ? (w.input0 = NaN, w.input1 = NaN, w.selectedFilter = null, w.selectedNotch = null) : (w.input0 = d.input0, w.input1 = d.input1), se.value = !0;
1162
+ }, Ut = (r) => {
1163
+ v.value.setFilters(r);
1164
+ }, Ue = () => {
1140
1165
  var r, f;
1141
- (r = p.value) == null || r.initViewerCanvas(), (f = p.value) == null || f.renderAll();
1166
+ (r = v.value) == null || r.initViewerCanvas(), (f = v.value) == null || f.renderAll();
1142
1167
  };
1143
- return Ut(() => {
1144
- Et();
1168
+ return Vt(() => {
1169
+ kt();
1145
1170
  const r = document.getElementById("ts_viewer");
1146
1171
  if (!r) {
1147
1172
  console.warn("ts_viewer element not found");
1148
1173
  return;
1149
1174
  }
1150
1175
  var f = window.getComputedStyle(r, null);
1151
- const d = parseInt(f.getPropertyValue("height")), y = A.isPreview ? 0 : 100;
1152
- z.value = d - y, E.value && (X.value = E.value.offsetWidth), window.addEventListener("resize", c);
1153
- const j = S.value;
1154
- j && (oe.value = j.clientWidth, G.value = X.value - j.clientWidth - 5 - 10, K.value = z.value - 88), U.value = s.INITDURATION, Ne();
1155
- }), jt(() => {
1156
- window.removeEventListener("resize", c);
1176
+ const d = parseInt(f.getPropertyValue("height")), w = m.isPreview ? 0 : 100;
1177
+ G.value = d - w, P.value && (H.value = P.value.offsetWidth), window.addEventListener("resize", a);
1178
+ const U = I.value;
1179
+ U && (oe.value = U.clientWidth, X.value = H.value - U.clientWidth - 5 - 10, K.value = G.value - 88), j.value = s.INITDURATION, Ue();
1180
+ }), Wt(() => {
1181
+ window.removeEventListener("resize", a);
1157
1182
  }), e({
1158
- openEditAnnotationDialog: v,
1159
- confirmDeleteAnnotation: ot,
1160
- selectAnnotation: It,
1161
- selectChannel: Le,
1162
- selectChannels: St,
1163
- openLayerWindow: Ot,
1164
- openFilterWindow: Pt,
1165
- setTimeseriesFilters: Lt
1183
+ openEditAnnotationDialog: c,
1184
+ confirmDeleteAnnotation: lt,
1185
+ selectAnnotation: Ct,
1186
+ selectChannel: ke,
1187
+ selectChannels: Et,
1188
+ openLayerWindow: Lt,
1189
+ openFilterWindow: Nt,
1190
+ setTimeseriesFilters: Ut
1166
1191
  }), (r, f) => (de(), Ie("div", {
1167
1192
  id: "ts_viewer",
1168
1193
  ref_key: "ts_viewer",
1169
- ref: E,
1170
- class: Se([t.isPreview ? "timeseries-viewer preview" : "timeseries-viewer"])
1194
+ ref: P,
1195
+ class: _e([t.isPreview ? "timeseries-viewer preview" : "timeseries-viewer"])
1171
1196
  }, [
1172
1197
  re(J(n), {
1173
1198
  ref_key: "scrubber",
1174
- ref: P,
1199
+ ref: E,
1175
1200
  ts_start: O.value,
1176
1201
  ts_end: C.value,
1177
- "c-width": G.value,
1202
+ "c-width": X.value,
1178
1203
  "label-width": oe.value,
1179
1204
  "cursor-loc": Q.value,
1180
1205
  start: k.value,
1181
- duration: U.value,
1206
+ duration: j.value,
1182
1207
  constants: s,
1183
- "active-viewer": le.value,
1208
+ "active-viewer": ie.value,
1184
1209
  onSetStart: te
1185
1210
  }, null, 8, ["ts_start", "ts_end", "c-width", "label-width", "cursor-loc", "start", "duration", "active-viewer"]),
1186
- ce("div", En, [
1187
- ce("div", {
1211
+ ue("div", kn, [
1212
+ ue("div", {
1188
1213
  id: "channelLabels",
1189
1214
  ref_key: "channelLabels",
1190
- ref: S
1215
+ ref: I
1191
1216
  }, [
1192
- (de(!0), Ie(Vt, null, $t(we.value, (d) => (de(), Ie("div", {
1217
+ (de(!0), Ie(xt, null, qt(we.value, (d) => (de(), Ie("div", {
1193
1218
  key: d.displayName,
1194
1219
  class: "chLabelWrap",
1195
1220
  "data-id": d.id,
1196
- onTap: ft
1221
+ onTap: gt
1197
1222
  }, [
1198
- ce("div", {
1199
- class: Se([d.selected ? "labelDiv selected" : "labelDiv"])
1223
+ ue("div", {
1224
+ class: _e([d.selected ? "labelDiv selected" : "labelDiv"])
1200
1225
  }, je(d.displayName), 3),
1201
- ce("div", {
1202
- class: Se(["chLabelIndWrap", [d.selected ? "selected" : ""]]),
1226
+ ue("div", {
1227
+ class: _e(["chLabelIndWrap", [d.selected ? "selected" : ""]]),
1203
1228
  hidden: Ae.value
1204
1229
  }, [
1205
- ce("div", {
1230
+ ue("div", {
1206
1231
  class: "chLabelInd",
1207
1232
  hidden: Ae.value
1208
- }, je(Ct(d, W.value, d.rowScale)), 9, Ln)
1209
- ], 10, Pn)
1210
- ], 40, On))), 128))
1233
+ }, je(Dt(d, x.value, d.rowScale)), 9, Un)
1234
+ ], 10, Nn)
1235
+ ], 40, Ln))), 128))
1211
1236
  ], 512),
1212
1237
  re(J(o), {
1213
1238
  ref_key: "viewerCanvas",
1214
- ref: p,
1215
- window_height: z.value,
1216
- window_width: X.value,
1217
- duration: U.value,
1239
+ ref: v,
1240
+ window_height: G.value,
1241
+ window_width: H.value,
1242
+ duration: j.value,
1218
1243
  start: k.value,
1219
- "c-width": G.value,
1244
+ "c-width": X.value,
1220
1245
  "c-height": K.value,
1221
1246
  constants: s,
1222
1247
  "ts-start": O.value,
1223
1248
  "ts-end": C.value,
1224
1249
  "cursor-loc": Q.value,
1225
- "global-zoom-mult": W.value,
1226
- "active-viewer": le.value,
1250
+ "global-zoom-mult": x.value,
1251
+ "active-viewer": ie.value,
1227
1252
  onSetStart: te,
1228
- onSetCursor: _t,
1229
- onSetGlobalZoom: bt,
1230
- onSetDuration: ke,
1231
- onChannelsInitialized: wt,
1232
- onAnnLayersInitialized: mt,
1233
- onCloseAnnotationLayerWindow: Pe,
1234
- onAddAnnotation: st,
1235
- onUpdateAnnotation: D
1253
+ onSetCursor: Ot,
1254
+ onSetGlobalZoom: Pt,
1255
+ onSetDuration: Le,
1256
+ onChannelsInitialized: It,
1257
+ onAnnLayersInitialized: Tt,
1258
+ onCloseAnnotationLayerWindow: De,
1259
+ onAddAnnotation: dt,
1260
+ onUpdateAnnotation: p
1236
1261
  }, null, 8, ["window_height", "window_width", "duration", "start", "c-width", "c-height", "ts-start", "ts-end", "cursor-loc", "global-zoom-mult", "active-viewer"])
1237
1262
  ]),
1238
- t.isPreview ? Mt("", !0) : (de(), Rt(J(i), {
1263
+ t.isPreview ? Ft("", !0) : (de(), $t(J(i), {
1239
1264
  key: 0,
1240
1265
  constants: s,
1241
- duration: U.value,
1266
+ duration: j.value,
1242
1267
  start: k.value,
1243
- onPageBack: At,
1244
- onPageForward: Tt,
1245
- onIncrementZoom: gt,
1246
- onDecrementZoom: yt,
1247
- onUpdateDuration: ht,
1248
- onNextAnnotation: vt,
1249
- onPreviousAnnotation: pt,
1268
+ onPageBack: _t,
1269
+ onPageForward: bt,
1270
+ onIncrementZoom: At,
1271
+ onDecrementZoom: St,
1272
+ onUpdateDuration: wt,
1273
+ onNextAnnotation: yt,
1274
+ onPreviousAnnotation: mt,
1250
1275
  onSetStart: te
1251
1276
  }, null, 8, ["duration", "start"])),
1252
1277
  re(J(u), {
1253
1278
  ref_key: "filterWindow",
1254
- ref: I,
1279
+ ref: T,
1255
1280
  visible: se.value,
1256
1281
  "onUpdate:visible": f[0] || (f[0] = (d) => se.value = d),
1257
- onCloseWindow: dt
1282
+ onCloseWindow: ht
1258
1283
  }, null, 8, ["visible"]),
1259
- re(J(h), {
1284
+ re(J(g), {
1260
1285
  ref_key: "annotationModal",
1261
- ref: $,
1286
+ ref: W,
1262
1287
  visible: q.value,
1263
1288
  "onUpdate:visible": f[1] || (f[1] = (d) => q.value = d),
1264
- onCloseWindow: ct,
1265
- onCreateUpdateAnnotation: ee
1289
+ onCloseWindow: pt,
1290
+ onCreateUpdateAnnotation: L
1266
1291
  }, null, 8, ["visible"]),
1267
- re(J(w), {
1268
- visible: ie.value,
1269
- "delete-annotation": H.value,
1270
- "onUpdate:visible": f[2] || (f[2] = (d) => ie.value = d),
1271
- onDelete: at
1292
+ re(J(A), {
1293
+ visible: B.value,
1294
+ "delete-annotation": ce.value,
1295
+ "onUpdate:visible": f[2] || (f[2] = (d) => B.value = d),
1296
+ onDelete: ut
1272
1297
  }, null, 8, ["visible", "delete-annotation"]),
1273
1298
  re(J(l), {
1274
1299
  visible: ae.value,
1275
- onCloseWindow: Pe,
1276
- onCreateLayer: ut
1300
+ onCloseWindow: De,
1301
+ onCreateLayer: vt
1277
1302
  }, null, 8, ["visible"])
1278
1303
  ], 2));
1279
1304
  }
1280
- }, Dn = /* @__PURE__ */ Cn(kn, [["__scopeId", "data-v-dfcd02cc"]]), Rn = {
1305
+ }, jn = /* @__PURE__ */ Dn(Rn, [["__scopeId", "data-v-d5eda6cd"]]), Fn = {
1281
1306
  install(t) {
1282
- t.component("TSViewer", Dn);
1307
+ t.component("TSViewer", jn);
1283
1308
  }
1284
1309
  };
1285
1310
  export {
1286
- Dn as T,
1287
- T as _,
1288
- Ce as a,
1311
+ jn as T,
1312
+ S as _,
1313
+ Ee as a,
1289
1314
  N as b,
1290
- L as c,
1291
- Xt as d,
1292
- Bt as e,
1293
- Kt as f,
1294
- Cn as g,
1315
+ D as c,
1316
+ Jt as d,
1317
+ Ht as e,
1318
+ nn as f,
1319
+ Dn as g,
1295
1320
  fe as h,
1296
- _n as i,
1297
- be as j,
1298
- We as k,
1299
- zt as l,
1300
- x as m,
1301
- nn as n,
1321
+ $n as i,
1322
+ Ce as j,
1323
+ qe as k,
1324
+ Zt as l,
1325
+ F as m,
1326
+ sn as n,
1302
1327
  pe as o,
1303
1328
  he as p,
1304
- tn as q,
1329
+ an as q,
1305
1330
  ge as r,
1306
- Rn as s,
1307
- nt as u
1331
+ Fn as s,
1332
+ it as u
1308
1333
  };