tsviewer 1.0.30 → 1.0.31

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,7 +1,7 @@
1
- import { createElementBlock as t, openBlock as s, normalizeClass as i, createCommentVNode as n, renderSlot as a, Fragment as f, createTextVNode as r, toDisplayString as d } from "vue";
2
- import { g as l } from "./index-knEI45_O.mjs";
1
+ import { createElementBlock as t, openBlock as s, normalizeClass as i, createCommentVNode as n, renderSlot as a, Fragment as f, createTextVNode as u, toDisplayString as l } from "vue";
2
+ import { g as d } from "./index-BXlfFRwy.mjs";
3
3
  const c = {
4
- name: "BfButton",
4
+ name: "BfLibraryButton",
5
5
  props: {
6
6
  type: {
7
7
  type: String,
@@ -38,35 +38,35 @@ const c = {
38
38
  }, y = ["disabled", "autofocus", "type"], x = {
39
39
  key: 0,
40
40
  class: "prefix"
41
- }, h = {
41
+ }, b = {
42
42
  key: 3,
43
43
  class: "suffix"
44
44
  };
45
- function m(o, g, e, p, _, u) {
45
+ function h(o, m, e, g, p, r) {
46
46
  return s(), t("button", {
47
- class: i(["bf-button", [
48
- e.type ? "bf-button--" + e.type : "",
49
- u.hasPrefixSlot ? "hasPrefix" : ""
47
+ class: i(["bf-library-button", [
48
+ e.type ? "bf-library-button--" + e.type : "",
49
+ r.hasPrefixSlot ? "hasPrefix" : ""
50
50
  ]]),
51
51
  disabled: e.disabled || e.processing,
52
52
  autofocus: e.autofocus,
53
53
  type: e.type
54
54
  }, [
55
- u.hasPrefixSlot ? (s(), t("span", x, [
55
+ r.hasPrefixSlot ? (s(), t("span", x, [
56
56
  a(o.$slots, "prefix", {}, void 0, !0)
57
57
  ])) : n("", !0),
58
58
  e.processing ? (s(), t(f, { key: 1 }, [
59
59
  e.processingText ? (s(), t(f, { key: 0 }, [
60
- r(d(e.processingText), 1)
60
+ u(l(e.processingText), 1)
61
61
  ], 64)) : a(o.$slots, "default", { key: 1 }, void 0, !0)
62
62
  ], 64)) : n("", !0),
63
63
  e.processing ? n("", !0) : a(o.$slots, "default", { key: 2 }, void 0, !0),
64
- u.hasSuffixSlot ? (s(), t("span", h, [
64
+ r.hasSuffixSlot ? (s(), t("span", b, [
65
65
  a(o.$slots, "suffix", {}, void 0, !0)
66
66
  ])) : n("", !0)
67
67
  ], 10, y);
68
68
  }
69
- const B = /* @__PURE__ */ l(c, [["render", m], ["__scopeId", "data-v-6ad8939b"]]);
69
+ const B = /* @__PURE__ */ d(c, [["render", h], ["__scopeId", "data-v-2e183fe2"]]);
70
70
  export {
71
71
  B as default
72
72
  };
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as o, openBlock as h, createElementVNode as n } from "vue";
2
- import { g as r } from "./index-knEI45_O.mjs";
2
+ import { g as r } from "./index-BXlfFRwy.mjs";
3
3
  const i = {
4
4
  name: "IconSelection",
5
5
  props: {
@@ -1,8 +1,8 @@
1
1
  import { ref as C, computed as W, watch as ee, onMounted as te, createElementBlock as ne, openBlock as oe, normalizeStyle as ae, unref as q, nextTick as ie } from "vue";
2
- import { o as re, m as se, u as _, p as V, h as N, j as H, i as P, g as le } from "./index-knEI45_O.mjs";
2
+ import { o as re, m as se, u as _, p as V, h as N, j as H, i as P, g as le } from "./index-BXlfFRwy.mjs";
3
3
  import { storeToRefs as x } from "pinia";
4
- import { f as ce, h as ue } from "./TSViewerCanvas-bkWRtQiL.mjs";
5
- import { p as z } from "./pathOr-DBQF4FRd.mjs";
4
+ import { f as ce, h as ue } from "./TSViewerCanvas-7tyEpUbF.mjs";
5
+ import { p as z } from "./pathOr-1B5szOyh.mjs";
6
6
  import { g as de } from "./_commonjsHelpers-DaMA6jEr.mjs";
7
7
  const I = (t, u) => {
8
8
  let c;
@@ -3,9 +3,9 @@ import { E as yn } from "./el-overlay-_Fd7WVZL.mjs";
3
3
  import { u as Ha, h as bn, i as gn, c as kn, j as wn, k as za, d as ja, l as Sn, e as qa, m as Dn, o as Cn, E as Mn, g as rt, n as $n, p as Pn, q as Vn, r as _n, T as Tn, C as ca, s as On, t as Yn, f as In, a as Rn, b as xn } from "./el-input-DNjlHApm.mjs";
4
4
  import { a as Zt } from "./el-button-B2d_HO4x.mjs";
5
5
  import { defineComponent as $e, ref as X, createElementBlock as Q, openBlock as I, normalizeStyle as Gt, normalizeClass as $, unref as e, renderSlot as me, createElementVNode as j, mergeProps as Jt, useAttrs as ha, inject as Re, computed as K, watch as De, nextTick as Ie, onBeforeUnmount as Za, provide as Nt, createBlock as ce, withCtx as le, withModifiers as He, createCommentVNode as se, resolveDynamicComponent as Qe, toDisplayString as fe, onMounted as Ga, Fragment as we, renderList as Pe, createTextVNode as Ge, withDirectives as Ye, createVNode as Z, Transition as An, withKeys as ze, useSlots as ya, toRef as je, vShow as Ze, getCurrentInstance as Ja, reactive as Nn, defineAsyncComponent as Fn } from "vue";
6
- import { g as En, u as Ln, p as Pa } from "./index-knEI45_O.mjs";
6
+ import { g as En, u as Ln, p as Pa } from "./index-BXlfFRwy.mjs";
7
7
  import { storeToRefs as Bn } from "pinia";
8
- import { I as Un } from "./IconSelection-CFPXCYRf.mjs";
8
+ import { I as Un } from "./IconSelection-Bs00CxIF.mjs";
9
9
  import { g as Xe } from "./_commonjsHelpers-DaMA6jEr.mjs";
10
10
  import { v as Va } from "./index-ClxLs_jS.mjs";
11
11
  var Ft = { exports: {} }, Kn = Ft.exports, _a;
@@ -4242,7 +4242,7 @@ const Tl = Wa(_l), Ol = { slot: "body" }, Yl = { class: "select-wrapper" }, Il =
4242
4242
  },
4243
4243
  emits: ["closeWindow", "createUpdateAnnotation"],
4244
4244
  setup(n, { emit: l }) {
4245
- const a = Fn(() => import("./BFButton-CI70UW6L.mjs")), t = n, d = X(!1);
4245
+ const a = Fn(() => import("./BFLibraryButton-Cogtl8Vh.mjs")), t = n, d = X(!1);
4246
4246
  De(() => t.visible, (_) => {
4247
4247
  if (d.value = _, !_) return;
4248
4248
  const M = u.value.start / 1e3, O = u.value.end / 1e3;
@@ -4423,7 +4423,7 @@ const Tl = Wa(_l), Ol = { slot: "body" }, Yl = { class: "select-wrapper" }, Il =
4423
4423
  }, 8, ["title", "modelValue"]);
4424
4424
  };
4425
4425
  }
4426
- }, Jl = /* @__PURE__ */ En(Ll, [["__scopeId", "data-v-a198e09b"]]);
4426
+ }, Jl = /* @__PURE__ */ En(Ll, [["__scopeId", "data-v-af090f6f"]]);
4427
4427
  export {
4428
4428
  Jl as default
4429
4429
  };
@@ -1,14 +1,14 @@
1
1
  import "./base-CIy5gWpu.mjs";
2
2
  import { E as F } from "./el-overlay-_Fd7WVZL.mjs";
3
- import { I as g } from "./IconSelection-CFPXCYRf.mjs";
3
+ import { I as g } from "./IconSelection-Bs00CxIF.mjs";
4
4
  import { a as y, b as k } from "./el-input-DNjlHApm.mjs";
5
5
  import { E as S } from "./el-input-number-CAzspsnM.mjs";
6
6
  import { resolveComponent as P, createBlock as u, openBlock as o, withCtx as i, createElementVNode as s, createVNode as r, createElementBlock as a, toDisplayString as c, createTextVNode as d, createCommentVNode as p, Fragment as _, renderList as v } from "vue";
7
- import { g as N } from "./index-knEI45_O.mjs";
7
+ import { g as N } from "./index-BXlfFRwy.mjs";
8
8
  const H = {
9
9
  name: "TimeseriesFilterModal",
10
10
  components: {
11
- "bf-button": () => import("./BFButton-CI70UW6L.mjs"),
11
+ "bf-library-button": () => import("./BFLibraryButton-Cogtl8Vh.mjs"),
12
12
  IconSelection: g
13
13
  },
14
14
  mixins: [],
@@ -140,7 +140,7 @@ const H = {
140
140
  class: "filter-input-wrapper"
141
141
  }, O = { slot: "footer" }, U = { class: "button-wrapper" }, q = { class: "channels-selected" }, L = { key: 0 }, T = { key: 1 }, A = { class: "buttons" };
142
142
  function D(t, l, h, M, W, n) {
143
- const m = k, f = y, b = S, C = g, V = P("bf-button"), w = F;
143
+ const m = k, f = y, b = S, C = g, V = P("bf-library-button"), w = F;
144
144
  return o(), u(w, {
145
145
  class: "timeseries-filter-modal",
146
146
  ref: "filter-modal",
@@ -232,7 +232,7 @@ function D(t, l, h, M, W, n) {
232
232
  _: 1
233
233
  }, 8, ["modelValue", "onClose"]);
234
234
  }
235
- const Y = /* @__PURE__ */ N(H, [["render", D], ["__scopeId", "data-v-99d3adec"]]);
235
+ const Y = /* @__PURE__ */ N(H, [["render", D], ["__scopeId", "data-v-718cdb9b"]]);
236
236
  export {
237
237
  Y as default
238
238
  };
@@ -1,5 +1,5 @@
1
1
  import { ref as v, computed as N, watch as U, nextTick as E, onMounted as Ne, createElementBlock as Ie, openBlock as $e, createElementVNode as x, toDisplayString as K, normalizeStyle as Q } from "vue";
2
- import { _ as ve, a as Se, b as Y, c as Ue, d as ge, e as Ve, f as Oe, k as Le, g as Xe, u as je, h as de, i as fe, j as he } from "./index-knEI45_O.mjs";
2
+ import { _ as ve, a as Se, b as Y, c as Ue, d as ge, e as Ve, f as Oe, k as Le, g as Xe, u as je, h as de, i as fe, j as he } from "./index-BXlfFRwy.mjs";
3
3
  function me(g, c, l) {
4
4
  return function() {
5
5
  for (var t = [], p = 0, u = g, k = 0; k < c.length || p < arguments.length; ) {
@@ -60,7 +60,7 @@ const Ge = { class: "timeseries-scrubber" }, Je = { class: "dateWrap" }, Ke = {
60
60
  },
61
61
  emits: ["setStart"],
62
62
  setup(g, { expose: c, emit: l }) {
63
- const t = g, p = l, u = je(), k = v(null), W = v(null), H = v(null), T = v(null), f = v(1), Z = v(28), C = v(30), V = v(!1), I = v(""), O = v("point"), ee = v(null), D = v([]), w = v([]), y = v([]), L = v(!1), te = v(0), ne = v(0), R = v(0), X = v(0), pe = N(() => oe(t.ts_start)), be = N(() => oe(t.ts_end)), _e = N(() => {
63
+ const t = g, p = l, u = je(), k = v(null), W = v(null), H = v(null), w = v(null), d = v(1), Z = v(28), T = v(30), V = v(!1), I = v(""), O = v("point"), ee = v(null), D = v([]), _ = v([]), C = v([]), L = v(!1), te = v(0), ne = v(0), R = v(0), X = v(0), pe = N(() => oe(t.ts_start)), be = N(() => oe(t.ts_end)), _e = N(() => {
64
64
  if (I.value !== "")
65
65
  return I.value;
66
66
  if (t.start > 0) {
@@ -87,25 +87,25 @@ const Ge = { class: "timeseries-scrubber" }, Je = { class: "dateWrap" }, Ke = {
87
87
  B(), L.value = !1;
88
88
  }) : L.value = !1);
89
89
  }, { deep: !0 }), U(() => u.viewerChannels, (n, e) => {
90
- var a, s;
91
- n && n.length > 0 && !L.value && (!e || n.length !== e.length || ((a = n[0]) == null ? void 0 : a.id) !== ((s = e[0]) == null ? void 0 : s.id)) && (console.log("TSScrubber: Viewer channels changed, re-initializing segments"), z(), E(() => {
90
+ var a, r;
91
+ n && n.length > 0 && !L.value && (!e || n.length !== e.length || ((a = n[0]) == null ? void 0 : a.id) !== ((r = e[0]) == null ? void 0 : r.id)) && (console.log("TSScrubber: Viewer channels changed, re-initializing segments"), z(), E(() => {
92
92
  ie();
93
93
  }));
94
94
  }, { deep: !0 }), U(() => u.viewerAnnotations, (n, e) => {
95
- var a, s;
95
+ var a;
96
96
  n && n !== e && !L.value ? (console.log("TSScrubber: Viewer annotations changed independently, re-fetching annotations"), E(() => {
97
97
  B();
98
- })) : n && n.length > 0 && !e && ((s = (a = t.activeViewer) == null ? void 0 : a.content) != null && s.id) && (console.log("TSScrubber: Annotation layers now available, fetching annotations"), E(() => {
98
+ })) : n && n.length > 0 && !e && ((a = t.activeViewer) != null && a.content.id) && (console.log("TSScrubber: Annotation layers now available, fetching annotations"), E(() => {
99
99
  B();
100
100
  }));
101
101
  }, { deep: !0 });
102
102
  const se = () => {
103
103
  console.log("TSScrubber: Resetting component state"), D.value = [], z(), V.value = !1, I.value = "", O.value = "point", re();
104
104
  }, z = () => {
105
- console.log("TSScrubber: Resetting segment state"), y.value = new Array(5e3), y.value = y.value.fill(0, 0, 4999), w.value = [];
105
+ console.log("TSScrubber: Resetting segment state"), C.value = new Array(5e3), C.value = C.value.fill(0, 0, 4999), _.value = [];
106
106
  }, re = () => {
107
107
  E(() => {
108
- [W.value, H.value, T.value].forEach((e) => {
108
+ [W.value, H.value, w.value].forEach((e) => {
109
109
  if (e) {
110
110
  const a = e.getContext("2d");
111
111
  a && a.clearRect(0, 0, e.width, e.height);
@@ -113,31 +113,31 @@ const Ge = { class: "timeseries-scrubber" }, Je = { class: "dateWrap" }, Ke = {
113
113
  });
114
114
  });
115
115
  }, $ = (n, e, a) => e * (n + a), ye = () => {
116
- const n = T.value.getContext("2d"), e = window.devicePixelRatio || 1, a = n.webkitBackingStorePixelRatio || n.mozBackingStorePixelRatio || n.msBackingStorePixelRatio || n.oBackingStorePixelRatio || n.backingStorePixelRatio || 1;
116
+ const n = w.value.getContext("2d"), e = window.devicePixelRatio || 1, a = n.webkitBackingStorePixelRatio || n.mozBackingStorePixelRatio || n.msBackingStorePixelRatio || n.oBackingStorePixelRatio || n.backingStorePixelRatio || 1;
117
117
  return e / a;
118
118
  }, oe = (n) => {
119
119
  if (n > 0)
120
120
  return n = n / 1e3, n = new Date(n), ("0" + n.getUTCHours()).slice(-2) + ":" + ("0" + n.getUTCMinutes()).slice(-2) + ":" + ("0" + n.getUTCSeconds()).slice(-2);
121
121
  }, xe = (n) => {
122
122
  if (V.value) {
123
- const a = (n.clientX - te.value) / t.cWidth * (t.ts_end - t.ts_start), s = ne.value + a;
124
- p("setStart", s);
125
- const r = new Date((a + t.ts_start) / 1e3);
126
- I.value = r.toUTCString();
123
+ const a = (n.clientX - te.value) / t.cWidth * (t.ts_end - t.ts_start), r = ne.value + a;
124
+ p("setStart", r);
125
+ const s = new Date((a + t.ts_start) / 1e3);
126
+ I.value = s.toUTCString();
127
127
  } else {
128
- const e = T.value.getBoundingClientRect(), a = n.clientX - e.left, s = R.value + X.value, r = O.value;
129
- a > R.value - 10 && a < s + 10 ? (O.value = "drag", T.value.setAttribute("dragme", !0), T.value.removeAttribute("resizeme")) : (O.value = "point", T.value.removeAttribute("dragme"), T.value.removeAttribute("resizeme"));
130
- const o = a / t.cWidth * (t.ts_end - t.ts_start) + t.ts_start, S = new Date(o / 1e3).toUTCString();
131
- I.value = S.substring(0, S.length - 3), r !== O.value && A();
128
+ const e = w.value.getBoundingClientRect(), a = n.clientX - e.left, r = R.value + X.value, s = O.value;
129
+ a > R.value - 10 && a < r + 10 ? (O.value = "drag", w.value.setAttribute("dragme", !0), w.value.removeAttribute("resizeme")) : (O.value = "point", w.value.removeAttribute("dragme"), w.value.removeAttribute("resizeme"));
130
+ const o = a / t.cWidth * (t.ts_end - t.ts_start) + t.ts_start, b = new Date(o / 1e3).toUTCString();
131
+ I.value = b.substring(0, b.length - 3), s !== O.value && A();
132
132
  }
133
133
  }, ke = () => {
134
134
  V.value = !1;
135
135
  }, We = (n) => {
136
136
  V.value = !0;
137
- const e = T.value.getBoundingClientRect(), a = n.clientX - e.left;
137
+ const e = w.value.getBoundingClientRect(), a = n.clientX - e.left;
138
138
  te.value = n.clientX;
139
- const s = a / Te.value * (t.ts_end - t.ts_start);
140
- p("setStart", s + t.ts_start), ne.value = s + t.ts_start;
139
+ const r = a / Te.value * (t.ts_end - t.ts_start);
140
+ p("setStart", r + t.ts_start), ne.value = r + t.ts_start;
141
141
  }, Re = () => {
142
142
  V.value = !1;
143
143
  }, Ae = () => {
@@ -158,9 +158,9 @@ const Ge = { class: "timeseries-scrubber" }, Je = { class: "dateWrap" }, Ke = {
158
158
  }
159
159
  console.log(`TSScrubber: Initializing segment spans for ${u.viewerChannels.length} channels`), z();
160
160
  const n = Math.min(t.constants.SEGMENTSPAN, t.ts_end - t.ts_start), e = u.viewerChannels;
161
- for (let s = 0; s < e.length; s++)
162
- le(e[s].id, s, t.ts_start, t.ts_start + n, 0);
163
- }, le = async (n, e, a, s, r) => {
161
+ for (let r = 0; r < e.length; r++)
162
+ le(e[r].id, r, t.ts_start, t.ts_start + n, 0);
163
+ }, le = async (n, e, a, r, s) => {
164
164
  var o;
165
165
  const i = t.constants.MAXRECURSION;
166
166
  if (!((o = u.config) != null && o.timeSeriesApi)) {
@@ -172,47 +172,47 @@ const Ge = { class: "timeseries-scrubber" }, Je = { class: "dateWrap" }, Ke = {
172
172
  return;
173
173
  }
174
174
  try {
175
- const S = await de(), _ = `${u.config.timeSeriesApi}/ts/retrieve/segments?session=${S}&channel=${n}&start=${a}&end=${s}`;
175
+ const b = await de(), f = `${u.config.timeSeriesApi}/ts/retrieve/segments?session=${b}&channel=${n}&start=${a}&end=${r}`;
176
176
  console.log(`TSScrubber: Fetching segments for channel ${n} (${e})`);
177
- const b = await fe(_);
177
+ const S = await fe(f);
178
178
  if (!u.viewerChannels[e] || u.viewerChannels[e].id !== n) {
179
179
  console.warn("TSScrubber: Channel mismatch detected, ignoring segment response (likely package switched)");
180
180
  return;
181
181
  }
182
- let h = new Array(b.length * 2), d = 0;
183
- for (let M = 0; M < b.length; M++) {
184
- h[d] = b[M][0], h[d + 1] = b[M][1], d = d + 2;
185
- const J = Math.floor((b[M][0] - t.ts_start) / (t.ts_end - t.ts_start) * 5e3), De = Math.ceil((b[M][1] - t.ts_start) / (t.ts_end - t.ts_start) * 5e3);
186
- y.value.fill(1, J, De);
182
+ let h = new Array(S.length * 2), m = 0;
183
+ for (let M = 0; M < S.length; M++) {
184
+ h[m] = S[M][0], h[m + 1] = S[M][1], m = m + 2;
185
+ const J = Math.floor((S[M][0] - t.ts_start) / (t.ts_end - t.ts_start) * 5e3), De = Math.ceil((S[M][1] - t.ts_start) / (t.ts_end - t.ts_start) * 5e3);
186
+ C.value.fill(1, J, De);
187
187
  }
188
- let m = 0, j = !1, G = 0;
189
- for (w.value = []; m < y.value.length - 1; ) {
190
- if (!y.value[m] && !j) {
191
- m++;
188
+ let y = 0, j = !1, G = 0;
189
+ for (_.value = []; y < C.value.length - 1; ) {
190
+ if (!C.value[y] && !j) {
191
+ y++;
192
192
  continue;
193
- } else y.value[m] ? j || (G = m, j = !0) : (w.value = w.value.concat([G, m]), j = !1);
194
- m++;
193
+ } else C.value[y] ? j || (G = y, j = !0) : (_.value = _.value.concat([G, y]), j = !1);
194
+ y++;
195
195
  }
196
- j && (w.value = w.value.concat([G, m])), w.value = w.value.concat([5e3]);
196
+ j && (_.value = _.value.concat([G, y])), _.value = _.value.concat([5e3]);
197
197
  let Ee = h[0], P = u.viewerChannels[e];
198
198
  if (!P || P.id !== n) {
199
199
  console.warn("TSScrubber: Channel configuration mismatch, skipping update");
200
200
  return;
201
201
  }
202
202
  Ee < P.dataSegments[P.dataSegments.length - 1] && (h.shift(), h.shift()), P.dataSegments = P.dataSegments.concat(h.sort((M, J) => M - J)), u.updateChannelProperty(P.id, "dataSegments", P.dataSegments);
203
- let ue = s - a;
204
- a + ue < t.ts_end && r < i ? le(n, e, s, s + ue, r + 1) : F();
205
- } catch (S) {
206
- console.error(`TSScrubber: Error fetching segments for channel ${n}:`, S), he(S);
203
+ let ue = r - a;
204
+ a + ue < t.ts_end && s < i ? le(n, e, r, r + ue, s + 1) : F();
205
+ } catch (b) {
206
+ console.error(`TSScrubber: Error fetching segments for channel ${n}:`, b), he(b);
207
207
  }
208
208
  }, B = async () => {
209
- var e, a, s, r, i;
210
- const n = (a = (e = t.activeViewer) == null ? void 0 : e.content) == null ? void 0 : a.id;
209
+ var e, a, r;
210
+ const n = (e = t.activeViewer) == null ? void 0 : e.content.id;
211
211
  if (!n) {
212
212
  console.warn("TSScrubber: Cannot get annotations - no active viewer ID"), D.value = [];
213
213
  return;
214
214
  }
215
- if (!((s = u.config) != null && s.apiUrl)) {
215
+ if (!((a = u.config) != null && a.apiUrl)) {
216
216
  console.warn("TSScrubber: Cannot get annotations - no API URL configured"), D.value = [];
217
217
  return;
218
218
  }
@@ -221,21 +221,21 @@ const Ge = { class: "timeseries-scrubber" }, Je = { class: "dateWrap" }, Ke = {
221
221
  return;
222
222
  }
223
223
  try {
224
- const o = await de(), S = Fe((m) => m.id, u.viewerAnnotations), _ = t.ts_end;
225
- let h = `${u.config.apiUrl}/timeseries/${n}/annotations/window` + `?api_key=${o}&aggregation=count&start=${t.ts_start}&end=${t.ts_end}&period=${Ce.value}&mergePeriods=true`;
226
- for (let m in S)
227
- h = h + `&layerIds=${S[m]}`;
224
+ const s = await de(), i = Fe((h) => h.id, u.viewerAnnotations), o = t.ts_end;
225
+ let f = `${u.config.apiUrl}/timeseries/${n}/annotations/window` + `?api_key=${s}&aggregation=count&start=${t.ts_start}&end=${t.ts_end}&period=${Ce.value}&mergePeriods=true`;
226
+ for (let h in i)
227
+ f = f + `&layerIds=${i[h]}`;
228
228
  console.log(`TSScrubber: Fetching annotations for viewer ${n}`);
229
- const d = await fe(h);
230
- ((i = (r = t.activeViewer) == null ? void 0 : r.content) == null ? void 0 : i.id) === n ? (D.value = d, A()) : console.log("TSScrubber: Ignoring annotation response - viewer changed during fetch");
231
- } catch (o) {
232
- console.error("TSScrubber: Error fetching annotations:", o), D.value = [], he(o), A();
229
+ const S = await fe(f);
230
+ ((r = t.activeViewer) == null ? void 0 : r.content.id) === n ? (D.value = S, A()) : console.log("TSScrubber: Ignoring annotation response - viewer changed during fetch");
231
+ } catch (s) {
232
+ console.error("TSScrubber: Error fetching annotations:", s), D.value = [], he(s), A();
233
233
  }
234
234
  }, A = () => {
235
235
  q(), ce(), F();
236
236
  }, q = () => {
237
237
  E(() => {
238
- const n = T.value;
238
+ const n = w.value;
239
239
  if (!n) {
240
240
  console.warn("iCanvas ref is missing, skipping render");
241
241
  return;
@@ -245,9 +245,9 @@ const Ge = { class: "timeseries-scrubber" }, Je = { class: "dateWrap" }, Ke = {
245
245
  console.warn("2D context is not available");
246
246
  return;
247
247
  }
248
- e.setTransform(f.value, 0, 0, f.value, 0, 0), e.clearRect(0, 0, t.cWidth, C.value), R.value = (t.start - t.ts_start) / (t.ts_end - t.ts_start) * t.cWidth + 0.5 | 0, X.value = t.duration / (t.ts_end - t.ts_start) * t.cWidth + 0.5 | 0, e.fillStyle = "rgb(80,80,80)", e.strokeStyle = "rgb(80,80,80)", e.strokeRect(R.value + 0.5, 0.5, X.value, C.value - 1), e.fillRect(R.value - 2, C.value / 2 - 5 | 0, 2, 10), e.fillRect(R.value + X.value + 1, C.value / 2 - 5 | 0, 2, 10);
248
+ e.setTransform(d.value, 0, 0, d.value, 0, 0), e.clearRect(0, 0, t.cWidth, T.value), R.value = (t.start - t.ts_start) / (t.ts_end - t.ts_start) * t.cWidth + 0.5 | 0, X.value = t.duration / (t.ts_end - t.ts_start) * t.cWidth + 0.5 | 0, e.fillStyle = "rgb(80,80,80)", e.strokeStyle = "rgb(80,80,80)", e.strokeRect(R.value + 0.5, 0.5, X.value, T.value - 1), e.fillRect(R.value - 2, T.value / 2 - 5 | 0, 2, 10), e.fillRect(R.value + X.value + 1, T.value / 2 - 5 | 0, 2, 10);
249
249
  const a = R.value + t.cursorLoc * X.value;
250
- a > R.value + 0.5 && (e.strokeStyle = "red", e.beginPath(), e.moveTo(a, 0), e.lineTo(a, C.value - 1), e.stroke());
250
+ a > R.value + 0.5 && (e.strokeStyle = "red", e.beginPath(), e.moveTo(a, 0), e.lineTo(a, T.value - 1), e.stroke());
251
251
  });
252
252
  }, F = () => {
253
253
  E(() => {
@@ -261,10 +261,10 @@ const Ge = { class: "timeseries-scrubber" }, Je = { class: "dateWrap" }, Ke = {
261
261
  console.warn("Unable to get 2D context for segmentsCanvas, skipping renderSegments");
262
262
  return;
263
263
  }
264
- e.setTransform(f.value, 0, 0, f.value, 0, 0), e.fillStyle = e.createPattern(ee.value, "repeat"), e.clearRect(0, 0, t.cWidth, C.value);
265
- for (let a = 1; a < w.value.length; a += 2) {
266
- const s = t.cWidth * w.value[a] / 5e3, r = t.cWidth * w.value[a + 1] / 5e3;
267
- e.fillRect(s, 2, r - s, C.value - 6);
264
+ e.setTransform(d.value, 0, 0, d.value, 0, 0), e.fillStyle = e.createPattern(ee.value, "repeat"), e.clearRect(0, 0, t.cWidth, T.value);
265
+ for (let a = 1; a < _.value.length; a += 2) {
266
+ const r = t.cWidth * _.value[a] / 5e3, s = t.cWidth * _.value[a + 1] / 5e3;
267
+ e.fillRect(r, 2, s - r, T.value - 6);
268
268
  }
269
269
  });
270
270
  }, ce = () => {
@@ -278,38 +278,38 @@ const Ge = { class: "timeseries-scrubber" }, Je = { class: "dateWrap" }, Ke = {
278
278
  console.warn("Unable to get 2D context for annotationCanvas, skipping renderTimelimeLine");
279
279
  return;
280
280
  }
281
- e.setTransform(f.value, 0, 0, f.value, 0, 0), e.clearRect(0, 0, t.cWidth, Z.value);
282
- const a = t.ts_start, s = t.ts_end, r = D.value;
281
+ e.setTransform(d.value, 0, 0, d.value, 0, 0), e.clearRect(0, 0, t.cWidth, Z.value);
282
+ const a = t.ts_start, r = t.ts_end, s = D.value;
283
283
  let i = 0;
284
- const o = 0, S = Math.floor((Z.value - 2) / Object.keys(r).length - o), _ = u.viewerAnnotations;
285
- let b = "rgb(0,0,0)";
286
- for (const h in r)
287
- if (r.hasOwnProperty(h)) {
288
- for (let d = 0; d < _.length; d++)
289
- if (_[d].id === parseInt(h)) {
290
- i = d, b = _[d].color;
284
+ const o = 0, b = Math.floor((Z.value - 2) / Object.keys(s).length - o), f = u.viewerAnnotations;
285
+ let S = "rgb(0,0,0)";
286
+ for (const h in s)
287
+ if (s.hasOwnProperty(h)) {
288
+ for (let m = 0; m < f.length; m++)
289
+ if (f[m].id === parseInt(h)) {
290
+ i = m, S = f[m].color;
291
291
  break;
292
292
  }
293
- Pe(e, a, s, o, S, r[h], i, b);
293
+ Pe(e, a, r, o, b, s[h], i, S);
294
294
  }
295
- }, Pe = (n, e, a, s, r, i, o, S) => {
295
+ }, Pe = (n, e, a, r, s, i, o, b) => {
296
296
  E(() => {
297
- n.setTransform(f.value, 0, 0, f.value, 0, 0), n.fillStyle = S;
298
- for (let _ = 0; _ < i.length; _++)
299
- if (i[_].value > 0) {
300
- const b = (i[_].start - e) / (a - e) * t.cWidth;
301
- let d = (i[_].end - e) / (a - e) * t.cWidth - b;
302
- d < 1 && (d = 1);
303
- const m = 1 + o * (r - 1 + s) + o;
304
- n.fillRect(b, m, d, r);
297
+ n.setTransform(d.value, 0, 0, d.value, 0, 0), n.fillStyle = b;
298
+ for (let f = 0; f < i.length; f++)
299
+ if (i[f].value > 0) {
300
+ const S = (i[f].start - e) / (a - e) * t.cWidth;
301
+ let m = (i[f].end - e) / (a - e) * t.cWidth - S;
302
+ m < 1 && (m = 1);
303
+ const y = 1 + o * (s - 1 + r) + o;
304
+ n.fillRect(S, y, m, s);
305
305
  }
306
306
  });
307
307
  }, Me = () => {
308
- const n = document.createElement("canvas"), e = n.getContext("2d", { antialias: !0 }), a = "rgb(220,220,220)", s = 5, r = s, i = s, o = 10;
309
- return n.width = r, n.height = i, e.fillStyle = a, e.beginPath(), e.moveTo(0, i * (1 / o)), e.lineTo(r * (1 / o), 0), e.lineTo(0, 0), e.lineTo(0, i * (1 / o)), e.fill(), e.beginPath(), e.moveTo(r, i * (1 / o)), e.lineTo(r * (1 / o), i), e.lineTo(0, i), e.lineTo(0, i * ((o - 1) / o)), e.lineTo(r * ((o - 1) / o), 0), e.lineTo(r, 0), e.lineTo(r, i * (1 / o)), e.fill(), e.beginPath(), e.moveTo(r, i * ((o - 1) / o)), e.lineTo(r * ((o - 1) / o), i), e.lineTo(r, i), e.lineTo(r, i * ((o - 1) / o)), e.fill(), n;
308
+ const n = document.createElement("canvas"), e = n.getContext("2d", { antialias: !0 }), a = "rgb(220,220,220)", r = 5, s = r, i = r, o = 10;
309
+ return n.width = s, n.height = i, e.fillStyle = a, e.beginPath(), e.moveTo(0, i * (1 / o)), e.lineTo(s * (1 / o), 0), e.lineTo(0, 0), e.lineTo(0, i * (1 / o)), e.fill(), e.beginPath(), e.moveTo(s, i * (1 / o)), e.lineTo(s * (1 / o), i), e.lineTo(0, i), e.lineTo(0, i * ((o - 1) / o)), e.lineTo(s * ((o - 1) / o), 0), e.lineTo(s, 0), e.lineTo(s, i * (1 / o)), e.fill(), e.beginPath(), e.moveTo(s, i * ((o - 1) / o)), e.lineTo(s * ((o - 1) / o), i), e.lineTo(s, i), e.lineTo(s, i * ((o - 1) / o)), e.fill(), n;
310
310
  };
311
311
  return Ne(() => {
312
- y.value = new Array(5e3), y.value = y.value.fill(0, 0, 4999), f.value = ye(), ee.value = Me(), q();
312
+ C.value = new Array(5e3), C.value = C.value.fill(0, 0, 4999), d.value = ye(), ee.value = Me(), q();
313
313
  }), c({
314
314
  getAnnotations: B,
315
315
  initSegmentSpans: ie,
@@ -338,8 +338,8 @@ const Ge = { class: "timeseries-scrubber" }, Je = { class: "dateWrap" }, Ke = {
338
338
  class: "canvas",
339
339
  ref_key: "segmentsCanvas",
340
340
  ref: W,
341
- width: $(g.cWidth, f.value, 0),
342
- height: $(C.value - 2, f.value, 0),
341
+ width: $(g.cWidth, d.value, 0),
342
+ height: $(T.value - 2, d.value, 0),
343
343
  style: Q(ae.value)
344
344
  }, null, 12, Ye),
345
345
  x("canvas", {
@@ -347,17 +347,17 @@ const Ge = { class: "timeseries-scrubber" }, Je = { class: "dateWrap" }, Ke = {
347
347
  class: "canvas",
348
348
  ref_key: "annotationCanvas",
349
349
  ref: H,
350
- width: $(g.cWidth, f.value, 0),
351
- height: $(C.value - 2, f.value, 0),
350
+ width: $(g.cWidth, d.value, 0),
351
+ height: $(T.value - 2, d.value, 0),
352
352
  style: Q(ae.value)
353
353
  }, null, 12, Ze),
354
354
  x("canvas", {
355
355
  id: "iCanvas",
356
356
  class: "canvas",
357
357
  ref_key: "iCanvas",
358
- ref: T,
359
- width: $(g.cWidth, f.value, 0),
360
- height: $(C.value, f.value, 0),
358
+ ref: w,
359
+ width: $(g.cWidth, d.value, 0),
360
+ height: $(T.value, d.value, 0),
361
361
  onClick: e[0] || (e[0] = (...a) => n._onTap && n._onTap(...a)),
362
362
  onMousemove: xe,
363
363
  onMousedown: We,
@@ -371,7 +371,7 @@ const Ge = { class: "timeseries-scrubber" }, Je = { class: "dateWrap" }, Ke = {
371
371
  ])
372
372
  ]));
373
373
  }
374
- }, st = /* @__PURE__ */ Xe(tt, [["__scopeId", "data-v-881659ce"]]);
374
+ }, st = /* @__PURE__ */ Xe(tt, [["__scopeId", "data-v-8618a902"]]);
375
375
  export {
376
376
  st as default
377
377
  };