@pennsieve-viz/tsviewer 1.1.12 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BFLibraryButton-Bw2bCACx.cjs → BFLibraryButton-B_TaDdTw.cjs} +1 -1
- package/dist/{BFLibraryButton-BJ7iV-SK.js → BFLibraryButton-DTcYY6VD.js} +1 -1
- package/dist/{IconSelection-DD-Nr7PN.cjs → IconSelection-BPTLv8Go.cjs} +1 -1
- package/dist/{IconSelection-DijIWZHa.js → IconSelection-BocyglLO.js} +1 -1
- package/dist/{TSAnnotationCanvas-UV4pQEcl.js → TSAnnotationCanvas-DErBDH0Y.js} +2 -2
- package/dist/{TSAnnotationCanvas-Cco4wSGV.cjs → TSAnnotationCanvas-DaDdtIB4.cjs} +1 -1
- package/dist/{TSAnnotationModal-CcWNjBv6.js → TSAnnotationModal-B3OSl05U.js} +3 -3
- package/dist/{TSAnnotationModal-5CjROnsz.cjs → TSAnnotationModal-DevUUWys.cjs} +1 -1
- package/dist/{TSFilterModal-B9JkIYGi.js → TSFilterModal-DHBpbDNp.js} +3 -3
- package/dist/{TSFilterModal-CvberIKd.cjs → TSFilterModal-DoqvKSUT.cjs} +1 -1
- package/dist/{TSScrubber-Dq0E_KWP.cjs → TSScrubber-E03DDcMn.cjs} +1 -1
- package/dist/{TSScrubber-Dajtd-ud.js → TSScrubber-hN5JY-DA.js} +1 -1
- package/dist/{TSViewerCanvas-XWBUIuF1.js → TSViewerCanvas-2Jz9ZgqW.js} +2 -2
- package/dist/{TSViewerCanvas-D-2XBXEV.cjs → TSViewerCanvas-Dc5cwQzK.cjs} +2 -2
- package/dist/{TSViewerLayerWindow-D6IXVgCL.js → TSViewerLayerWindow-CalBmhT6.js} +2 -2
- package/dist/{TSViewerLayerWindow-ChsFJLvq.cjs → TSViewerLayerWindow-PAfR31ZO.cjs} +1 -1
- package/dist/{TSViewerToolbar-fwS3Y99W.cjs → TSViewerToolbar-C1wTQDPC.cjs} +1 -1
- package/dist/{TSViewerToolbar-BvDdoOiz.js → TSViewerToolbar-DL9XKYbV.js} +1 -1
- package/dist/{TsAnnotationDeleteDialog-D19Ynkd4.cjs → TsAnnotationDeleteDialog-Cv3z3dFh.cjs} +1 -1
- package/dist/{TsAnnotationDeleteDialog-BnN0eMFf.js → TsAnnotationDeleteDialog-DXgN07Wj.js} +2 -2
- package/dist/{index-Ch_7-EbG.js → index-BsH36ax4.js} +291 -290
- package/dist/index-yiwCKzNX.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +6 -6
- package/dist/index-DRsmx8uY.cjs +0 -1
|
@@ -2,12 +2,12 @@ import { reactive as Ht, ref as m, computed as H, inject as Zt, onMounted as yt,
|
|
|
2
2
|
import { defineStore as Kt, storeToRefs as Fe } from "pinia";
|
|
3
3
|
import { fetchAuthSession as Qt } from "aws-amplify/auth";
|
|
4
4
|
import { ElMessage as en } from "element-plus";
|
|
5
|
-
function
|
|
5
|
+
function E(t) {
|
|
6
6
|
return t != null && typeof t == "object" && t["@@functional/placeholder"] === !0;
|
|
7
7
|
}
|
|
8
8
|
function R(t) {
|
|
9
9
|
return function e(n) {
|
|
10
|
-
return arguments.length === 0 ||
|
|
10
|
+
return arguments.length === 0 || E(n) ? e : t.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
function D(t) {
|
|
@@ -16,13 +16,13 @@ function D(t) {
|
|
|
16
16
|
case 0:
|
|
17
17
|
return e;
|
|
18
18
|
case 1:
|
|
19
|
-
return
|
|
19
|
+
return E(n) ? e : R(function(a) {
|
|
20
20
|
return t(n, a);
|
|
21
21
|
});
|
|
22
22
|
default:
|
|
23
|
-
return
|
|
23
|
+
return E(n) && E(r) ? e : E(n) ? R(function(a) {
|
|
24
24
|
return t(a, r);
|
|
25
|
-
}) :
|
|
25
|
+
}) : E(r) ? R(function(a) {
|
|
26
26
|
return t(n, a);
|
|
27
27
|
}) : t(n, r);
|
|
28
28
|
}
|
|
@@ -30,12 +30,12 @@ function D(t) {
|
|
|
30
30
|
}
|
|
31
31
|
function tn(t, e) {
|
|
32
32
|
t = t || [], e = e || [];
|
|
33
|
-
var n, r = t.length, a = e.length,
|
|
33
|
+
var n, r = t.length, a = e.length, s = [];
|
|
34
34
|
for (n = 0; n < r; )
|
|
35
|
-
|
|
35
|
+
s[s.length] = t[n], n += 1;
|
|
36
36
|
for (n = 0; n < a; )
|
|
37
|
-
|
|
38
|
-
return
|
|
37
|
+
s[s.length] = e[n], n += 1;
|
|
38
|
+
return s;
|
|
39
39
|
}
|
|
40
40
|
function We(t, e) {
|
|
41
41
|
switch (t) {
|
|
@@ -56,31 +56,31 @@ function We(t, e) {
|
|
|
56
56
|
return e.apply(this, arguments);
|
|
57
57
|
};
|
|
58
58
|
case 4:
|
|
59
|
-
return function(n, r, a,
|
|
59
|
+
return function(n, r, a, s) {
|
|
60
60
|
return e.apply(this, arguments);
|
|
61
61
|
};
|
|
62
62
|
case 5:
|
|
63
|
-
return function(n, r, a,
|
|
63
|
+
return function(n, r, a, s, c) {
|
|
64
64
|
return e.apply(this, arguments);
|
|
65
65
|
};
|
|
66
66
|
case 6:
|
|
67
|
-
return function(n, r, a,
|
|
67
|
+
return function(n, r, a, s, c, A) {
|
|
68
68
|
return e.apply(this, arguments);
|
|
69
69
|
};
|
|
70
70
|
case 7:
|
|
71
|
-
return function(n, r, a,
|
|
71
|
+
return function(n, r, a, s, c, A, I) {
|
|
72
72
|
return e.apply(this, arguments);
|
|
73
73
|
};
|
|
74
74
|
case 8:
|
|
75
|
-
return function(n, r, a,
|
|
75
|
+
return function(n, r, a, s, c, A, I, h) {
|
|
76
76
|
return e.apply(this, arguments);
|
|
77
77
|
};
|
|
78
78
|
case 9:
|
|
79
|
-
return function(n, r, a,
|
|
79
|
+
return function(n, r, a, s, c, A, I, h, l) {
|
|
80
80
|
return e.apply(this, arguments);
|
|
81
81
|
};
|
|
82
82
|
case 10:
|
|
83
|
-
return function(n, r, a,
|
|
83
|
+
return function(n, r, a, s, c, A, I, h, l, g) {
|
|
84
84
|
return e.apply(this, arguments);
|
|
85
85
|
};
|
|
86
86
|
default:
|
|
@@ -93,30 +93,30 @@ function Ae(t) {
|
|
|
93
93
|
case 0:
|
|
94
94
|
return e;
|
|
95
95
|
case 1:
|
|
96
|
-
return
|
|
97
|
-
return t(n,
|
|
96
|
+
return E(n) ? e : D(function(s, c) {
|
|
97
|
+
return t(n, s, c);
|
|
98
98
|
});
|
|
99
99
|
case 2:
|
|
100
|
-
return
|
|
101
|
-
return t(
|
|
102
|
-
}) :
|
|
103
|
-
return t(n,
|
|
104
|
-
}) : R(function(
|
|
105
|
-
return t(n, r,
|
|
100
|
+
return E(n) && E(r) ? e : E(n) ? D(function(s, c) {
|
|
101
|
+
return t(s, r, c);
|
|
102
|
+
}) : E(r) ? D(function(s, c) {
|
|
103
|
+
return t(n, s, c);
|
|
104
|
+
}) : R(function(s) {
|
|
105
|
+
return t(n, r, s);
|
|
106
106
|
});
|
|
107
107
|
default:
|
|
108
|
-
return
|
|
109
|
-
return t(
|
|
110
|
-
}) :
|
|
111
|
-
return t(
|
|
112
|
-
}) :
|
|
113
|
-
return t(n,
|
|
114
|
-
}) :
|
|
115
|
-
return t(
|
|
116
|
-
}) :
|
|
117
|
-
return t(n,
|
|
118
|
-
}) :
|
|
119
|
-
return t(n, r,
|
|
108
|
+
return E(n) && E(r) && E(a) ? e : E(n) && E(r) ? D(function(s, c) {
|
|
109
|
+
return t(s, c, a);
|
|
110
|
+
}) : E(n) && E(a) ? D(function(s, c) {
|
|
111
|
+
return t(s, r, c);
|
|
112
|
+
}) : E(r) && E(a) ? D(function(s, c) {
|
|
113
|
+
return t(n, s, c);
|
|
114
|
+
}) : E(n) ? R(function(s) {
|
|
115
|
+
return t(s, r, a);
|
|
116
|
+
}) : E(r) ? R(function(s) {
|
|
117
|
+
return t(n, s, a);
|
|
118
|
+
}) : E(a) ? R(function(s) {
|
|
119
|
+
return t(n, r, s);
|
|
120
120
|
}) : t(n, r, a);
|
|
121
121
|
}
|
|
122
122
|
};
|
|
@@ -139,8 +139,8 @@ function rn(t, e, n) {
|
|
|
139
139
|
a += 1;
|
|
140
140
|
}
|
|
141
141
|
if (nn(r)) {
|
|
142
|
-
var
|
|
143
|
-
return
|
|
142
|
+
var s = e.apply(null, Array.prototype.slice.call(arguments, 0, -1));
|
|
143
|
+
return s(r);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
return n.apply(this, arguments);
|
|
@@ -247,9 +247,9 @@ var rt = Object.prototype.toString, wt = /* @__PURE__ */ (function() {
|
|
|
247
247
|
} : function(e) {
|
|
248
248
|
if (Object(e) !== e)
|
|
249
249
|
return [];
|
|
250
|
-
var n, r, a = [],
|
|
250
|
+
var n, r, a = [], s = ot && wt(e);
|
|
251
251
|
for (n in e)
|
|
252
|
-
_e(n, e) && (!
|
|
252
|
+
_e(n, e) && (!s || n !== "length") && (a[a.length] = n);
|
|
253
253
|
if (vn)
|
|
254
254
|
for (r = at.length - 1; r >= 0; )
|
|
255
255
|
n = at[r], _e(n, e) && !pn(a, n) && (a[a.length] = n), r -= 1;
|
|
@@ -326,13 +326,13 @@ function Sn(t, e) {
|
|
|
326
326
|
}
|
|
327
327
|
const Ue = typeof Object.is == "function" ? Object.is : Sn;
|
|
328
328
|
function dt(t, e, n, r) {
|
|
329
|
-
var a = ut(t),
|
|
329
|
+
var a = ut(t), s = ut(e);
|
|
330
330
|
function c(A, I) {
|
|
331
331
|
return qe(A, I, n.slice(), r.slice());
|
|
332
332
|
}
|
|
333
333
|
return !ct(function(A, I) {
|
|
334
334
|
return !ct(c, I, A);
|
|
335
|
-
},
|
|
335
|
+
}, s, a);
|
|
336
336
|
}
|
|
337
337
|
function qe(t, e, n, r) {
|
|
338
338
|
if (Ue(t, e))
|
|
@@ -368,10 +368,10 @@ function qe(t, e, n, r) {
|
|
|
368
368
|
return !1;
|
|
369
369
|
break;
|
|
370
370
|
}
|
|
371
|
-
for (var
|
|
372
|
-
if (n[
|
|
373
|
-
return r[
|
|
374
|
-
|
|
371
|
+
for (var s = n.length - 1; s >= 0; ) {
|
|
372
|
+
if (n[s] === t)
|
|
373
|
+
return r[s] === e;
|
|
374
|
+
s -= 1;
|
|
375
375
|
}
|
|
376
376
|
switch (a) {
|
|
377
377
|
case "Map":
|
|
@@ -405,11 +405,11 @@ function qe(t, e, n, r) {
|
|
|
405
405
|
if (c.length !== it(e).length)
|
|
406
406
|
return !1;
|
|
407
407
|
var A = n.concat([t]), I = r.concat([e]);
|
|
408
|
-
for (
|
|
409
|
-
var
|
|
410
|
-
if (!(_e(
|
|
408
|
+
for (s = c.length - 1; s >= 0; ) {
|
|
409
|
+
var h = c[s];
|
|
410
|
+
if (!(_e(h, e) && qe(e[h], t[h], A, I)))
|
|
411
411
|
return !1;
|
|
412
|
-
|
|
412
|
+
s -= 1;
|
|
413
413
|
}
|
|
414
414
|
return !0;
|
|
415
415
|
}
|
|
@@ -422,14 +422,14 @@ function bn(t) {
|
|
|
422
422
|
var we = /* @__PURE__ */ D(function(e, n) {
|
|
423
423
|
return n == null || n !== n ? e : n;
|
|
424
424
|
});
|
|
425
|
-
function
|
|
425
|
+
function Tn(t) {
|
|
426
426
|
var e = Object.prototype.toString.call(t);
|
|
427
427
|
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]";
|
|
428
428
|
}
|
|
429
|
-
var
|
|
429
|
+
var In = /* @__PURE__ */ R(function(e) {
|
|
430
430
|
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() : Oe(e) ? [] : Le(e) ? "" : bn(e) ? {} : wt(e) ? /* @__PURE__ */ (function() {
|
|
431
431
|
return arguments;
|
|
432
|
-
})() :
|
|
432
|
+
})() : Tn(e) ? e.constructor.from("") : void 0;
|
|
433
433
|
}), En = /* @__PURE__ */ (function() {
|
|
434
434
|
function t(e, n) {
|
|
435
435
|
this.xf = n, this.f = e, this.idx = -1, this.found = !1;
|
|
@@ -451,13 +451,13 @@ var Tn = /* @__PURE__ */ R(function(e) {
|
|
|
451
451
|
return -1;
|
|
452
452
|
})
|
|
453
453
|
), On = /* @__PURE__ */ R(function(e) {
|
|
454
|
-
return e != null && St(e,
|
|
454
|
+
return e != null && St(e, In(e));
|
|
455
455
|
}), Ln = /* @__PURE__ */ D(function(e, n) {
|
|
456
456
|
return e.map(function(r) {
|
|
457
|
-
for (var a = n,
|
|
457
|
+
for (var a = n, s = 0, c; s < r.length; ) {
|
|
458
458
|
if (a == null)
|
|
459
459
|
return;
|
|
460
|
-
c = r[
|
|
460
|
+
c = r[s], a = mt(c) ? At(c, a) : a[c], s += 1;
|
|
461
461
|
}
|
|
462
462
|
return a;
|
|
463
463
|
});
|
|
@@ -491,19 +491,20 @@ async function Ee() {
|
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
493
|
const jn = () => ({
|
|
494
|
-
openConnection: async (e, n, r, a = "viewerAsset") => await new Promise((
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
494
|
+
openConnection: async (e, n, r, a = "viewerAsset", s = null) => await new Promise((I, h) => {
|
|
495
|
+
let l = e + "?session=" + r + "&" + a + "=" + n;
|
|
496
|
+
s && a !== "package" && (l += "&package=" + s);
|
|
497
|
+
let g = null;
|
|
498
|
+
const w = new WebSocket(l);
|
|
499
|
+
w.onopen = () => {
|
|
500
|
+
const b = { montage: "NOT_MONTAGED", packageId: n };
|
|
501
|
+
w.send(JSON.stringify(b));
|
|
502
|
+
}, w.onclose = () => {
|
|
503
|
+
g && g.channelDetails ? I({ res: g.channelDetails, status: "websocket closed" }) : I({ res: null, status: "websocket closed without data" });
|
|
504
|
+
}, w.onmessage = (b) => {
|
|
505
|
+
g = JSON.parse(b.data), w.close();
|
|
506
|
+
}, w.onerror = (b) => {
|
|
507
|
+
console.error("WebSocket error:", b), h(b);
|
|
507
508
|
};
|
|
508
509
|
})
|
|
509
510
|
}), K = /* @__PURE__ */ new Map();
|
|
@@ -514,22 +515,22 @@ function Ve(t = "default") {
|
|
|
514
515
|
)), K.has(t))
|
|
515
516
|
return K.get(t)();
|
|
516
517
|
const e = Kt(`tsviewer-${t}`, () => {
|
|
517
|
-
const n = Ht({}), r = m([]), a = m("NOT_MONTAGED"),
|
|
518
|
-
const o =
|
|
519
|
-
return o || (console.warn("No active layer found, available layers:",
|
|
518
|
+
const n = Ht({}), r = m([]), a = m("NOT_MONTAGED"), s = m({}), c = m([]), A = m(null), I = m(null), h = m({}), l = m([]), g = m({}), w = m({}), b = m("pointer"), { openConnection: U } = jn(), x = H(() => (o) => c.value.find((u) => u.name === o)), O = H(() => r.value.filter((o) => o.selected)), k = H(() => () => {
|
|
519
|
+
const o = l.value.find((u) => u.selected);
|
|
520
|
+
return o || (console.warn("No active layer found, available layers:", l.value), l.value.length > 0 ? l.value[0] : null);
|
|
520
521
|
}), L = () => {
|
|
521
522
|
let o = !1;
|
|
522
|
-
return
|
|
523
|
-
!u.id && u.id !== 0 && (console.error(`Layer at index ${
|
|
524
|
-
}), o && console.error("Annotation layer validation failed. Layers:",
|
|
525
|
-
}, q = H(() => (o) =>
|
|
526
|
-
|
|
523
|
+
return l.value.forEach((u, p) => {
|
|
524
|
+
!u.id && u.id !== 0 && (console.error(`Layer at index ${p} missing ID:`, u), o = !0), u.annotations || (console.warn(`Layer at index ${p} missing annotations array:`, u), u.annotations = []);
|
|
525
|
+
}), o && console.error("Annotation layer validation failed. Layers:", l.value), !o;
|
|
526
|
+
}, q = H(() => (o) => l.value.flatMap((p) => p.annotations || []).find((p) => p.id === o)), f = (o) => {
|
|
527
|
+
h.value = o;
|
|
527
528
|
}, V = (o) => {
|
|
528
529
|
r.value = o;
|
|
529
|
-
},
|
|
530
|
+
}, _ = (o) => {
|
|
530
531
|
a.value = o;
|
|
531
532
|
}, j = (o) => {
|
|
532
|
-
|
|
533
|
+
s.value = o;
|
|
533
534
|
}, N = (o) => {
|
|
534
535
|
c.value = o;
|
|
535
536
|
}, M = (o) => {
|
|
@@ -539,39 +540,39 @@ function Ve(t = "default") {
|
|
|
539
540
|
}, F = (o) => {
|
|
540
541
|
Object.assign(n, o);
|
|
541
542
|
}, W = async (o) => {
|
|
542
|
-
const u = o.viewerAssetId || null,
|
|
543
|
+
const u = o.viewerAssetId || null, p = o.packageId || null, P = u || p, ce = u ? "viewerAsset" : "package", De = await Ee();
|
|
543
544
|
let Me = n.timeseriesDiscoverApi, Ce = null;
|
|
544
|
-
Ce = await U(Me, P, De, ce), f({ channels: Ce.res, content: { id: P, idType: ce } });
|
|
545
|
+
Ce = await U(Me, P, De, ce, u ? p : null), f({ channels: Ce.res, content: { id: P, idType: ce } });
|
|
545
546
|
}, Y = () => (o) => {
|
|
546
|
-
var
|
|
547
|
-
return ((
|
|
547
|
+
var p;
|
|
548
|
+
return ((p = o == null ? void 0 : o.content) == null ? void 0 : p.state) === "READY";
|
|
548
549
|
}, Q = (o) => {
|
|
549
|
-
const u = o.map((
|
|
550
|
-
|
|
550
|
+
const u = o.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));
|
|
551
|
+
l.value = u;
|
|
551
552
|
}, le = (o) => {
|
|
552
553
|
if (!o && o !== 0) {
|
|
553
554
|
console.error("setActiveAnnotationLayer called with invalid layerId:", o);
|
|
554
555
|
return;
|
|
555
556
|
}
|
|
556
|
-
|
|
557
|
-
const u = G(z("id", o),
|
|
558
|
-
u >= 0 ?
|
|
557
|
+
g.value = o, l.value.forEach((p) => p.selected = !1);
|
|
558
|
+
const u = G(z("id", o), l.value);
|
|
559
|
+
u >= 0 ? l.value[u].selected = !0 : console.error("Layer with ID not found:", o, "Available layers:", l.value);
|
|
559
560
|
}, $ = (o) => {
|
|
560
|
-
if (
|
|
561
|
+
if (l.value.forEach(
|
|
561
562
|
(u) => {
|
|
562
|
-
var
|
|
563
|
-
return (
|
|
563
|
+
var p;
|
|
564
|
+
return (p = u.annotations) == null ? void 0 : p.forEach((P) => P.selected = !1);
|
|
564
565
|
}
|
|
565
566
|
), o.id) {
|
|
566
|
-
const u = G(z("id", o.layer_id),
|
|
567
|
+
const u = G(z("id", o.layer_id), l.value);
|
|
567
568
|
if (u >= 0) {
|
|
568
|
-
const
|
|
569
|
-
|
|
569
|
+
const p = G(z("id", o.id), l.value[u].annotations);
|
|
570
|
+
p >= 0 && (l.value[u].annotations[p].selected = !0);
|
|
570
571
|
}
|
|
571
572
|
}
|
|
572
573
|
w.value = o;
|
|
573
574
|
}, ee = (o) => {
|
|
574
|
-
|
|
575
|
+
b.value = o;
|
|
575
576
|
}, B = (o) => {
|
|
576
577
|
if (!o.id && o.id !== 0) {
|
|
577
578
|
console.error("Cannot create layer without ID:", o);
|
|
@@ -592,48 +593,48 @@ function Ve(t = "default") {
|
|
|
592
593
|
...o
|
|
593
594
|
// Spread any additional properties
|
|
594
595
|
};
|
|
595
|
-
|
|
596
|
+
l.value.push(u);
|
|
596
597
|
}, ue = (o) => {
|
|
597
|
-
const u = G(z("id", o.id),
|
|
598
|
+
const u = G(z("id", o.id), l.value);
|
|
598
599
|
if (u >= 0) {
|
|
599
|
-
const
|
|
600
|
-
|
|
600
|
+
const p = Object.assign(l.value[u], o);
|
|
601
|
+
l.value[u] = p;
|
|
601
602
|
}
|
|
602
603
|
}, ve = (o) => {
|
|
603
|
-
const u = G(z("id", o.id),
|
|
604
|
-
u >= 0 &&
|
|
604
|
+
const u = G(z("id", o.id), l.value);
|
|
605
|
+
u >= 0 && l.value.splice(u, 1);
|
|
605
606
|
}, te = (o) => {
|
|
606
|
-
const u = G(z("id", o.layer_id),
|
|
607
|
-
u >= 0 && (
|
|
607
|
+
const u = G(z("id", o.layer_id), l.value);
|
|
608
|
+
u >= 0 && (l.value[u].annotations || (l.value[u].annotations = []), l.value[u].annotations.push(o), $(o));
|
|
608
609
|
}, ne = (o) => {
|
|
609
|
-
const u = G(z("id", o.layer_id),
|
|
610
|
+
const u = G(z("id", o.layer_id), l.value);
|
|
610
611
|
if (u >= 0) {
|
|
611
|
-
const
|
|
612
|
-
P >= 0 && (
|
|
612
|
+
const p = l.value[u].annotations, P = G(z("id", o.id), p);
|
|
613
|
+
P >= 0 && (p[P] = o);
|
|
613
614
|
}
|
|
614
|
-
},
|
|
615
|
-
const u = G(z("id", o.layer_id),
|
|
615
|
+
}, y = (o) => {
|
|
616
|
+
const u = G(z("id", o.layer_id), l.value);
|
|
616
617
|
if (u >= 0) {
|
|
617
|
-
const
|
|
618
|
-
P >= 0 &&
|
|
618
|
+
const p = l.value[u].annotations, P = G(z("id", o.id), p);
|
|
619
|
+
P >= 0 && p.splice(P, 1);
|
|
619
620
|
}
|
|
620
|
-
},
|
|
621
|
+
}, T = (o, u, p) => {
|
|
621
622
|
const P = r.value.find((ce) => ce.id === o);
|
|
622
|
-
P && (P[u] =
|
|
623
|
+
P && (P[u] = p);
|
|
623
624
|
};
|
|
624
625
|
return {
|
|
625
626
|
// State
|
|
626
627
|
viewerChannels: r,
|
|
627
628
|
viewerMontageScheme: a,
|
|
628
|
-
customMontageMap:
|
|
629
|
+
customMontageMap: s,
|
|
629
630
|
workspaceMontages: c,
|
|
630
631
|
viewerErrors: A,
|
|
631
632
|
needsRerender: I,
|
|
632
|
-
viewerAnnotations:
|
|
633
|
-
activeAnnotationLayer:
|
|
633
|
+
viewerAnnotations: l,
|
|
634
|
+
activeAnnotationLayer: g,
|
|
634
635
|
activeAnnotation: w,
|
|
635
|
-
activeViewer:
|
|
636
|
-
viewerActiveTool:
|
|
636
|
+
activeViewer: h,
|
|
637
|
+
viewerActiveTool: b,
|
|
637
638
|
config: n,
|
|
638
639
|
// Getters
|
|
639
640
|
getMontageMessageByName: x,
|
|
@@ -642,7 +643,7 @@ function Ve(t = "default") {
|
|
|
642
643
|
getAnnotationById: q,
|
|
643
644
|
// Actions
|
|
644
645
|
setChannels: V,
|
|
645
|
-
setViewerMontageScheme:
|
|
646
|
+
setViewerMontageScheme: _,
|
|
646
647
|
setCustomMontageMap: j,
|
|
647
648
|
setWorkspaceMontages: N,
|
|
648
649
|
setViewerErrors: M,
|
|
@@ -655,20 +656,20 @@ function Ve(t = "default") {
|
|
|
655
656
|
deleteLayer: ve,
|
|
656
657
|
createAnnotation: te,
|
|
657
658
|
updateAnnotation: ne,
|
|
658
|
-
deleteAnnotation:
|
|
659
|
-
updateChannelProperty:
|
|
659
|
+
deleteAnnotation: y,
|
|
660
|
+
updateChannelProperty: T,
|
|
660
661
|
updateChannelVisibility: (o, u) => {
|
|
661
|
-
|
|
662
|
+
T(o, "visible", u);
|
|
662
663
|
},
|
|
663
664
|
updateChannelSelection: (o, u) => {
|
|
664
|
-
|
|
665
|
+
T(o, "selected", u);
|
|
665
666
|
},
|
|
666
667
|
updateChannelFilter: (o, u) => {
|
|
667
|
-
|
|
668
|
+
T(o, "filter", u);
|
|
668
669
|
},
|
|
669
670
|
validateAnnotationLayers: L,
|
|
670
671
|
resetViewer: () => {
|
|
671
|
-
r.value = [], a.value = "NOT_MONTAGED",
|
|
672
|
+
r.value = [], a.value = "NOT_MONTAGED", s.value = {}, c.value = [], A.value = null, l.value = [], g.value = {}, w.value = {}, b.value = "pointer", h.value = {}, Object.keys(n).forEach((o) => {
|
|
672
673
|
delete n[o];
|
|
673
674
|
});
|
|
674
675
|
},
|
|
@@ -713,9 +714,9 @@ var nr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
713
714
|
function Pn(t) {
|
|
714
715
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
715
716
|
}
|
|
716
|
-
var
|
|
717
|
+
var Te = { exports: {} }, pt;
|
|
717
718
|
function Rn() {
|
|
718
|
-
if (pt) return
|
|
719
|
+
if (pt) return Te.exports;
|
|
719
720
|
pt = 1;
|
|
720
721
|
function t() {
|
|
721
722
|
}
|
|
@@ -729,25 +730,25 @@ function Rn() {
|
|
|
729
730
|
},
|
|
730
731
|
once: function(e, n, r) {
|
|
731
732
|
var a = this;
|
|
732
|
-
function
|
|
733
|
-
a.off(e,
|
|
733
|
+
function s() {
|
|
734
|
+
a.off(e, s), n.apply(r, arguments);
|
|
734
735
|
}
|
|
735
|
-
return
|
|
736
|
+
return s._ = n, this.on(e, s, r);
|
|
736
737
|
},
|
|
737
738
|
emit: function(e) {
|
|
738
|
-
var n = [].slice.call(arguments, 1), r = ((this.e || (this.e = {}))[e] || []).slice(), a = 0,
|
|
739
|
-
for (a; a <
|
|
739
|
+
var n = [].slice.call(arguments, 1), r = ((this.e || (this.e = {}))[e] || []).slice(), a = 0, s = r.length;
|
|
740
|
+
for (a; a < s; a++)
|
|
740
741
|
r[a].fn.apply(r[a].ctx, n);
|
|
741
742
|
return this;
|
|
742
743
|
},
|
|
743
744
|
off: function(e, n) {
|
|
744
|
-
var r = this.e || (this.e = {}), a = r[e],
|
|
745
|
+
var r = this.e || (this.e = {}), a = r[e], s = [];
|
|
745
746
|
if (a && n)
|
|
746
747
|
for (var c = 0, A = a.length; c < A; c++)
|
|
747
|
-
a[c].fn !== n && a[c].fn._ !== n &&
|
|
748
|
-
return
|
|
748
|
+
a[c].fn !== n && a[c].fn._ !== n && s.push(a[c]);
|
|
749
|
+
return s.length ? r[e] = s : delete r[e], this;
|
|
749
750
|
}
|
|
750
|
-
},
|
|
751
|
+
}, Te.exports = t, Te.exports.TinyEmitter = t, Te.exports;
|
|
751
752
|
}
|
|
752
753
|
var xe, ht;
|
|
753
754
|
function Nn() {
|
|
@@ -757,11 +758,11 @@ function Nn() {
|
|
|
757
758
|
return xe = new t(), xe;
|
|
758
759
|
}
|
|
759
760
|
var Un = Nn();
|
|
760
|
-
const
|
|
761
|
-
$emit: (...t) =>
|
|
762
|
-
$on: (...t) =>
|
|
763
|
-
$off: (...t) =>
|
|
764
|
-
$once: (...t) =>
|
|
761
|
+
const Ie = /* @__PURE__ */ Pn(Un), ie = {
|
|
762
|
+
$emit: (...t) => Ie.emit(...t),
|
|
763
|
+
$on: (...t) => Ie.on(...t),
|
|
764
|
+
$off: (...t) => Ie.off(...t),
|
|
765
|
+
$once: (...t) => Ie.once(...t)
|
|
765
766
|
}, xn = (t) => Object.prototype.toString.call(t) === "[object String]", $n = (t) => {
|
|
766
767
|
Object.keys(t).forEach((e) => {
|
|
767
768
|
xn(t[e]) && (t[e] = t[e].trim());
|
|
@@ -770,11 +771,11 @@ const Te = /* @__PURE__ */ Pn(Un), ie = {
|
|
|
770
771
|
function rr(t, e) {
|
|
771
772
|
if (!t)
|
|
772
773
|
return Promise.reject({ status: 400, message: "Url is missing!" });
|
|
773
|
-
const n = me("GET", "method", e), r = me({}, "header", e), a = Object.assign({}, { "Content-type": "application/json" }, r),
|
|
774
|
+
const n = me("GET", "method", e), r = me({}, "header", e), a = Object.assign({}, { "Content-type": "application/json" }, r), s = se("body", e);
|
|
774
775
|
let c = { headers: a, method: n };
|
|
775
|
-
if (
|
|
776
|
-
typeof
|
|
777
|
-
const A = JSON.stringify(
|
|
776
|
+
if (s) {
|
|
777
|
+
typeof s == "object" && $n(s);
|
|
778
|
+
const A = JSON.stringify(s);
|
|
778
779
|
c = Object.assign({}, c, { body: A });
|
|
779
780
|
}
|
|
780
781
|
return fetch(t, c).then((A) => A.status >= 400 ? Promise.reject(A) : A.json().catch(() => A));
|
|
@@ -789,7 +790,7 @@ function $e(t) {
|
|
|
789
790
|
n = t.status;
|
|
790
791
|
if (n === 400 && t.body)
|
|
791
792
|
t.body.getReader().read().then(({ done: r, value: a }) => {
|
|
792
|
-
const
|
|
793
|
+
const s = a instanceof Uint8Array ? String.fromCharCode.apply(null, a) : a, c = lt(we(s), kn(lt(se("message"), JSON.parse), (A, I) => I))(s);
|
|
793
794
|
ie.$emit("ajaxError", {
|
|
794
795
|
detail: {
|
|
795
796
|
type: "error",
|
|
@@ -820,9 +821,9 @@ function $e(t) {
|
|
|
820
821
|
}
|
|
821
822
|
}
|
|
822
823
|
function Fn(t = null) {
|
|
823
|
-
const e = t || Zt("viewerStore", null) || Ve("default"), { viewerChannels: n, viewerAnnotations: r } = Fe(e), a = (
|
|
824
|
-
|
|
825
|
-
return
|
|
824
|
+
const e = t || Zt("viewerStore", null) || Ve("default"), { viewerChannels: n, viewerAnnotations: r } = Fe(e), a = (h) => h.id || "", s = (h) => {
|
|
825
|
+
h.sort(function(g, w) {
|
|
826
|
+
return g.start < w.start ? -1 : g.start > w.start ? 1 : 0;
|
|
826
827
|
});
|
|
827
828
|
};
|
|
828
829
|
return {
|
|
@@ -832,42 +833,42 @@ function Fn(t = null) {
|
|
|
832
833
|
viewerAnnotations: r,
|
|
833
834
|
// Now from Pinia
|
|
834
835
|
// Methods
|
|
835
|
-
addAnnotation: async (
|
|
836
|
-
const
|
|
837
|
-
if (!
|
|
838
|
-
throw new TypeError("Missing annotation data or layer_id",
|
|
839
|
-
if (
|
|
840
|
-
throw new TypeError("Trying to create an annotation that already exists",
|
|
841
|
-
let
|
|
842
|
-
const
|
|
843
|
-
if (!
|
|
836
|
+
addAnnotation: async (h = null) => {
|
|
837
|
+
const l = h || activeAnnotation.value;
|
|
838
|
+
if (!l || !l.layer_id)
|
|
839
|
+
throw new TypeError("Missing annotation data or layer_id", l);
|
|
840
|
+
if (l.id)
|
|
841
|
+
throw new TypeError("Trying to create an annotation that already exists", l.id);
|
|
842
|
+
let g = l.start, w = l.duration || l.end - l.start;
|
|
843
|
+
const b = l.label, U = l.description, x = l.layer_id;
|
|
844
|
+
if (!b)
|
|
844
845
|
throw new Error("Annotation label is required");
|
|
845
|
-
if (
|
|
846
|
+
if (g == null)
|
|
846
847
|
throw new Error("Annotation start time is required");
|
|
847
|
-
w < 0 && (w = -w,
|
|
848
|
+
w < 0 && (w = -w, g = g - w);
|
|
848
849
|
let O = [];
|
|
849
|
-
if (
|
|
850
|
+
if (l.allChannels) {
|
|
850
851
|
const f = e.activeViewer.channels;
|
|
851
852
|
for (let V = 0; V < f.length; V++) {
|
|
852
|
-
const
|
|
853
|
+
const _ = f[V], j = a(_);
|
|
853
854
|
O.push(j);
|
|
854
855
|
}
|
|
855
|
-
} else if (
|
|
856
|
-
O =
|
|
856
|
+
} else if (l.channelIds && Array.isArray(l.channelIds) && l.channelIds.length > 0)
|
|
857
|
+
O = l.channelIds;
|
|
857
858
|
else
|
|
858
859
|
for (let f = 0; f < n.value.length; f++) {
|
|
859
860
|
const V = n.value[f];
|
|
860
861
|
if (V.selected && V.visible) {
|
|
861
|
-
const
|
|
862
|
-
O.push(
|
|
862
|
+
const _ = a(V);
|
|
863
|
+
O.push(_);
|
|
863
864
|
}
|
|
864
865
|
}
|
|
865
866
|
const k = {
|
|
866
|
-
label:
|
|
867
|
-
name:
|
|
867
|
+
label: b,
|
|
868
|
+
name: b,
|
|
868
869
|
description: U || "",
|
|
869
|
-
start: Math.floor(
|
|
870
|
-
end: Math.floor(
|
|
870
|
+
start: Math.floor(g),
|
|
871
|
+
end: Math.floor(g + w),
|
|
871
872
|
channelIds: O
|
|
872
873
|
}, L = e.activeViewer.content.id, q = `${e.config.apiUrl}/timeseries/${L}/layers/${x}/annotations`;
|
|
873
874
|
try {
|
|
@@ -883,51 +884,51 @@ function Fn(t = null) {
|
|
|
883
884
|
const M = await V.text();
|
|
884
885
|
throw new Error(`HTTP ${V.status}: ${M}`);
|
|
885
886
|
}
|
|
886
|
-
const
|
|
887
|
+
const _ = await V.json(), j = {
|
|
887
888
|
name: "",
|
|
888
|
-
id:
|
|
889
|
-
label:
|
|
890
|
-
description:
|
|
891
|
-
start:
|
|
892
|
-
duration:
|
|
893
|
-
end:
|
|
889
|
+
id: _.id,
|
|
890
|
+
label: _.label,
|
|
891
|
+
description: _.description,
|
|
892
|
+
start: _.start,
|
|
893
|
+
duration: _.end - _.start,
|
|
894
|
+
end: _.end,
|
|
894
895
|
cStart: null,
|
|
895
896
|
cEnd: null,
|
|
896
897
|
selected: !0,
|
|
897
|
-
channelIds:
|
|
898
|
+
channelIds: _.channelIds || O,
|
|
898
899
|
allChannels: O.length === 0 || O.length >= n.value.length,
|
|
899
900
|
// Use Pinia
|
|
900
901
|
layer_id: x,
|
|
901
|
-
userId:
|
|
902
|
+
userId: _.userId
|
|
902
903
|
};
|
|
903
|
-
|
|
904
|
+
_.linkedPackage && (j.linkedPackage = _.linkedPackage);
|
|
904
905
|
let N = 0;
|
|
905
906
|
for (let M = 0; M < r.value.length; M++)
|
|
906
907
|
if (r.value[M].id === x) {
|
|
907
908
|
N = M;
|
|
908
909
|
break;
|
|
909
910
|
}
|
|
910
|
-
return e.createAnnotation(j), r.value[N] && r.value[N].annotations &&
|
|
911
|
+
return e.createAnnotation(j), r.value[N] && r.value[N].annotations && s(r.value[N].annotations), j;
|
|
911
912
|
} catch (f) {
|
|
912
913
|
throw console.error("🔧 useTsAnnotation: Error creating annotation:", f), $e(f), f;
|
|
913
914
|
}
|
|
914
915
|
},
|
|
915
|
-
updateAnnotation: async (
|
|
916
|
-
const
|
|
917
|
-
if (!
|
|
918
|
-
throw new TypeError("Trying to update an annotation that doesn't exist on server",
|
|
919
|
-
if (!
|
|
920
|
-
throw new TypeError("Missing layer_id for annotation update",
|
|
921
|
-
let
|
|
922
|
-
w < 0 && (w = -w,
|
|
923
|
-
const
|
|
924
|
-
name:
|
|
925
|
-
label:
|
|
926
|
-
description:
|
|
927
|
-
start: Math.floor(
|
|
928
|
-
end: Math.floor(
|
|
929
|
-
channelIds:
|
|
930
|
-
}, U = e.activeViewer.content.id, x = `${e.config.apiUrl}/timeseries/${U}/layers/${
|
|
916
|
+
updateAnnotation: async (h = null) => {
|
|
917
|
+
const l = h || activeAnnotation.value;
|
|
918
|
+
if (!l.id)
|
|
919
|
+
throw new TypeError("Trying to update an annotation that doesn't exist on server", l.id);
|
|
920
|
+
if (!l.layer_id)
|
|
921
|
+
throw new TypeError("Missing layer_id for annotation update", l);
|
|
922
|
+
let g = l.start, w = l.duration || l.end - l.start;
|
|
923
|
+
w < 0 && (w = -w, g = g - w);
|
|
924
|
+
const b = {
|
|
925
|
+
name: l.label,
|
|
926
|
+
label: l.label,
|
|
927
|
+
description: l.description || "",
|
|
928
|
+
start: Math.floor(g),
|
|
929
|
+
end: Math.floor(g + w),
|
|
930
|
+
channelIds: l.channelIds || []
|
|
931
|
+
}, U = e.activeViewer.content.id, x = `${e.config.apiUrl}/timeseries/${U}/layers/${l.layer_id}/annotations/${l.id}`;
|
|
931
932
|
try {
|
|
932
933
|
const O = await Ee(), k = await fetch(`${x}?api_key=${O}`, {
|
|
933
934
|
method: "PUT",
|
|
@@ -935,14 +936,14 @@ function Fn(t = null) {
|
|
|
935
936
|
"Content-Type": "application/json",
|
|
936
937
|
Accept: "application/json"
|
|
937
938
|
},
|
|
938
|
-
body: JSON.stringify(
|
|
939
|
+
body: JSON.stringify(b)
|
|
939
940
|
});
|
|
940
941
|
if (!k.ok) {
|
|
941
942
|
const f = await k.text();
|
|
942
943
|
throw new Error(`HTTP ${k.status}: ${f}`);
|
|
943
944
|
}
|
|
944
945
|
const L = await k.json(), q = {
|
|
945
|
-
...
|
|
946
|
+
...l,
|
|
946
947
|
...L,
|
|
947
948
|
duration: L.end - L.start
|
|
948
949
|
};
|
|
@@ -951,15 +952,15 @@ function Fn(t = null) {
|
|
|
951
952
|
throw console.error("🔧 useTsAnnotation: Error updating annotation:", O), $e(O), O;
|
|
952
953
|
}
|
|
953
954
|
},
|
|
954
|
-
removeAnnotation: async (
|
|
955
|
-
if (!
|
|
956
|
-
throw new TypeError("Invalid annotation for deletion",
|
|
957
|
-
let
|
|
958
|
-
if (
|
|
959
|
-
throw new TypeError("Missing layer_id for annotation deletion",
|
|
960
|
-
const
|
|
955
|
+
removeAnnotation: async (h) => {
|
|
956
|
+
if (!h || !h.id)
|
|
957
|
+
throw new TypeError("Invalid annotation for deletion", h);
|
|
958
|
+
let l = "";
|
|
959
|
+
if (h.layer ? l = h.layer.id : l = h.layer_id, !l)
|
|
960
|
+
throw new TypeError("Missing layer_id for annotation deletion", h);
|
|
961
|
+
const g = e.activeViewer.content.id, w = `${e.config.apiUrl}/timeseries/${g}/layers/${l}/annotations/${h.id}`;
|
|
961
962
|
try {
|
|
962
|
-
const
|
|
963
|
+
const b = await Ee(), U = await fetch(`${w}?api_key=${b}`, {
|
|
963
964
|
method: "DELETE",
|
|
964
965
|
headers: {
|
|
965
966
|
Accept: "application/json"
|
|
@@ -969,24 +970,24 @@ function Fn(t = null) {
|
|
|
969
970
|
const x = await U.text();
|
|
970
971
|
throw new Error(`HTTP ${U.status}: ${x}`);
|
|
971
972
|
}
|
|
972
|
-
return e.deleteAnnotation(
|
|
973
|
-
} catch (
|
|
974
|
-
throw console.error("🔧 useTsAnnotation: Error deleting annotation:",
|
|
973
|
+
return e.deleteAnnotation(h), !0;
|
|
974
|
+
} catch (b) {
|
|
975
|
+
throw console.error("🔧 useTsAnnotation: Error deleting annotation:", b), $e(b), b;
|
|
975
976
|
}
|
|
976
977
|
},
|
|
977
|
-
sortAnns:
|
|
978
|
+
sortAnns: s,
|
|
978
979
|
getChannelId: a
|
|
979
980
|
};
|
|
980
981
|
}
|
|
981
982
|
function Wn() {
|
|
982
983
|
const t = (e) => {
|
|
983
|
-
const n = be("", ["detail", "msg"], e), r = me(n, "msg", e), a = be("info", ["detail", "type"], e).toLowerCase(),
|
|
984
|
+
const n = be("", ["detail", "msg"], e), r = me(n, "msg", e), a = be("info", ["detail", "type"], e).toLowerCase(), s = be(!1, ["detail", "showClose"], e), c = be(3e3, ["detail", "duration"], e);
|
|
984
985
|
r && en({
|
|
985
986
|
message: r,
|
|
986
987
|
type: a,
|
|
987
988
|
center: !0,
|
|
988
989
|
duration: c,
|
|
989
|
-
showClose:
|
|
990
|
+
showClose: s,
|
|
990
991
|
dangerouslyUseHTMLString: !0
|
|
991
992
|
});
|
|
992
993
|
};
|
|
@@ -1028,7 +1029,7 @@ const qn = (t, e) => {
|
|
|
1028
1029
|
}
|
|
1029
1030
|
},
|
|
1030
1031
|
setup(t, { expose: e }) {
|
|
1031
|
-
const n = re(() => import("./TSScrubber-
|
|
1032
|
+
const n = re(() => import("./TSScrubber-hN5JY-DA.js")), r = re(() => import("./TSViewerCanvas-2Jz9ZgqW.js").then((i) => i.T)), a = re(() => import("./TSViewerToolbar-DL9XKYbV.js")), s = re(() => import("./TSFilterModal-DHBpbDNp.js")), c = re(() => import("./TSAnnotationModal-B3OSl05U.js")), A = re(() => import("./TsAnnotationDeleteDialog-DXgN07Wj.js")), I = re(() => import("./TSViewerLayerWindow-CalBmhT6.js")), h = {
|
|
1032
1033
|
TIMEUNIT: "microSeconds",
|
|
1033
1034
|
// Basis for time
|
|
1034
1035
|
XOFFSET: 0,
|
|
@@ -1065,16 +1066,16 @@ const qn = (t, e) => {
|
|
|
1065
1066
|
// Maximum duration window (5min)
|
|
1066
1067
|
INITDURATION: 15e6
|
|
1067
1068
|
// Initial duration window (15sec)
|
|
1068
|
-
},
|
|
1069
|
-
Je("viewerStore",
|
|
1069
|
+
}, l = t, g = Ve(l.instanceId), { viewerChannels: w, needsRerender: b } = Fe(g);
|
|
1070
|
+
Je("viewerStore", g), Je("viewerInstanceId", l.instanceId), Wn();
|
|
1070
1071
|
const {
|
|
1071
1072
|
addAnnotation: U,
|
|
1072
1073
|
updateAnnotation: x,
|
|
1073
1074
|
removeAnnotation: O
|
|
1074
|
-
} = Fn(
|
|
1075
|
+
} = Fn(g), k = m(null), L = m(null), q = m(null), f = m(null), V = m(null), _ = m(null), j = m(null), N = m(null), M = m(0), J = m(0), F = m(0), W = m(0), Y = m(0), Q = m(0), le = m(0), $ = m(1), ee = m(1 / 10), B = m(!1), ue = m(!1), ve = m(null), te = m(!1), ne = m(!1), y = H(() => g.activeViewer), T = H(() => w.value.map((i) => ({
|
|
1075
1076
|
...i,
|
|
1076
1077
|
selected: !!i.selected
|
|
1077
|
-
}))), X = H(() =>
|
|
1078
|
+
}))), X = H(() => T.value.filter((i) => i.visible)), Z = H(() => {
|
|
1078
1079
|
let i = !1;
|
|
1079
1080
|
return Q.value / ke.value < 30 && (i = !0), i;
|
|
1080
1081
|
}), ke = H(() => X.value.length), pe = async () => {
|
|
@@ -1083,12 +1084,12 @@ const qn = (t, e) => {
|
|
|
1083
1084
|
const i = document.getElementById("ts_viewer");
|
|
1084
1085
|
if (!i)
|
|
1085
1086
|
return;
|
|
1086
|
-
const d = window.getComputedStyle(i, null), v = parseInt(d.getPropertyValue("height")), C =
|
|
1087
|
+
const d = window.getComputedStyle(i, null), v = parseInt(d.getPropertyValue("height")), C = l.isPreview ? 0 : 100;
|
|
1087
1088
|
M.value = v - C, await fe(), J.value = k.value.offsetWidth;
|
|
1088
1089
|
const S = q.value;
|
|
1089
1090
|
S && (le.value = S.clientWidth, Y.value = J.value - S.clientWidth - 16, Q.value = M.value - 40);
|
|
1090
1091
|
};
|
|
1091
|
-
Pe(() =>
|
|
1092
|
+
Pe(() => y.value, async (i, d) => {
|
|
1092
1093
|
var v, C, S;
|
|
1093
1094
|
(v = L.value) != null && v.resetComponentState && L.value.resetComponentState(), i && i.channels && i.channels.length > 0 && He(), Ze(), await fe(), (C = L.value) != null && C.initSegmentSpans && L.value.initSegmentSpans(), (S = L.value) != null && S.getAnnotations && L.value.getAnnotations();
|
|
1094
1095
|
}, { immediate: !1, deep: !0 }), Pe(ke, (i, d) => {
|
|
@@ -1098,16 +1099,16 @@ const qn = (t, e) => {
|
|
|
1098
1099
|
}, 20);
|
|
1099
1100
|
});
|
|
1100
1101
|
const je = (i) => {
|
|
1101
|
-
|
|
1102
|
+
g.setActiveAnnotation(i), f.value.renderAnnotationCanvas(), B.value = !0;
|
|
1102
1103
|
};
|
|
1103
|
-
Pe(
|
|
1104
|
+
Pe(b, (i) => {
|
|
1104
1105
|
i && (fe(() => {
|
|
1105
1106
|
var d;
|
|
1106
1107
|
i.cause === "channel-visibility" ? setTimeout(() => {
|
|
1107
1108
|
var v;
|
|
1108
1109
|
pe(), (v = f.value) != null && v.renderAll && f.value.renderAll();
|
|
1109
1110
|
}, 10) : (d = f.value) != null && d.renderAll && f.value.renderAll();
|
|
1110
|
-
}),
|
|
1111
|
+
}), g.resetRerenderTrigger(null));
|
|
1111
1112
|
}, { deep: !0 });
|
|
1112
1113
|
const Be = (i) => {
|
|
1113
1114
|
je(i);
|
|
@@ -1128,7 +1129,7 @@ const qn = (t, e) => {
|
|
|
1128
1129
|
}
|
|
1129
1130
|
}, u = () => {
|
|
1130
1131
|
f.value.renderAnnotationCanvas();
|
|
1131
|
-
},
|
|
1132
|
+
}, p = (i) => {
|
|
1132
1133
|
ve.value = i, te.value = !0;
|
|
1133
1134
|
}, P = async (i) => {
|
|
1134
1135
|
te.value = !1;
|
|
@@ -1144,7 +1145,7 @@ const qn = (t, e) => {
|
|
|
1144
1145
|
console.error("Invalid layer provided to onAddAnnotation:", Se);
|
|
1145
1146
|
return;
|
|
1146
1147
|
}
|
|
1147
|
-
const Bt =
|
|
1148
|
+
const Bt = g.viewerSelectedChannels || [], Xt = v ? [] : Bt.map((zt) => zt.id), Gt = {
|
|
1148
1149
|
id: null,
|
|
1149
1150
|
label: C || "Event",
|
|
1150
1151
|
description: S || "",
|
|
@@ -1157,7 +1158,7 @@ const qn = (t, e) => {
|
|
|
1157
1158
|
selected: !0,
|
|
1158
1159
|
userId: null
|
|
1159
1160
|
};
|
|
1160
|
-
|
|
1161
|
+
g.setActiveAnnotation(Gt), B.value = !0;
|
|
1161
1162
|
}, Me = () => {
|
|
1162
1163
|
f.value.renderAnnotationCanvas();
|
|
1163
1164
|
}, Ce = (i) => {
|
|
@@ -1166,9 +1167,9 @@ const qn = (t, e) => {
|
|
|
1166
1167
|
ue.value = !1;
|
|
1167
1168
|
}, bt = () => {
|
|
1168
1169
|
f.value.resetFocusedAnnotation(), f.value.renderAnnotationCanvas(), B.value = !1;
|
|
1169
|
-
},
|
|
1170
|
+
}, Tt = () => {
|
|
1170
1171
|
ne.value = !1;
|
|
1171
|
-
},
|
|
1172
|
+
}, It = (i) => {
|
|
1172
1173
|
i.stopPropagation(), i.preventDefault();
|
|
1173
1174
|
const d = i.detail.sourceEvent.metaKey;
|
|
1174
1175
|
Ge({ channelId: i.currentTarget.dataset.id, append: d }), f.value.renderAll();
|
|
@@ -1205,7 +1206,7 @@ const qn = (t, e) => {
|
|
|
1205
1206
|
});
|
|
1206
1207
|
}, Pt = (i) => {
|
|
1207
1208
|
let d = f.value.rsPeriod;
|
|
1208
|
-
de(i.annotation.start - (ee.value * Y.value -
|
|
1209
|
+
de(i.annotation.start - (ee.value * Y.value - h.CURSOROFFSET) * d), fe(() => {
|
|
1209
1210
|
var v;
|
|
1210
1211
|
(v = f.value) == null || v.renderAll();
|
|
1211
1212
|
});
|
|
@@ -1214,10 +1215,10 @@ const qn = (t, e) => {
|
|
|
1214
1215
|
const C = v.selected;
|
|
1215
1216
|
return i.append === !1 && (v.selected = !1), i.channelId === v.id && (v.selected = !C), v;
|
|
1216
1217
|
});
|
|
1217
|
-
|
|
1218
|
+
g.setChannels(d);
|
|
1218
1219
|
}, Rt = (i, d) => {
|
|
1219
1220
|
const v = w.value.map((C) => (d === !1 && (C.selected = !1), C.id in i && (C.selected = !0), C));
|
|
1220
|
-
|
|
1221
|
+
g.setChannels(v);
|
|
1221
1222
|
}, de = (i) => {
|
|
1222
1223
|
F.value = i;
|
|
1223
1224
|
}, Nt = (i) => {
|
|
@@ -1225,10 +1226,10 @@ const qn = (t, e) => {
|
|
|
1225
1226
|
}, Ut = (i) => {
|
|
1226
1227
|
$.value = i;
|
|
1227
1228
|
}, ze = (i) => {
|
|
1228
|
-
i >
|
|
1229
|
-
}, xt = (i, d, v) => (
|
|
1229
|
+
i > h.MAXDURATION ? W.value = h.MAXDURATION : W.value = i;
|
|
1230
|
+
}, xt = (i, d, v) => (h.DEFAULTDPI * window.devicePixelRatio / (d * v) / 25.4).toFixed(1) + " " + i.unit + "/mm", He = () => {
|
|
1230
1231
|
var d;
|
|
1231
|
-
const i = (d =
|
|
1232
|
+
const i = (d = y.value) == null ? void 0 : d.channels;
|
|
1232
1233
|
if (i && i.length > 0) {
|
|
1233
1234
|
j.value = i[0].start, N.value = i[0].end;
|
|
1234
1235
|
for (let v = 1; v < i.length; v++)
|
|
@@ -1256,15 +1257,15 @@ const qn = (t, e) => {
|
|
|
1256
1257
|
return;
|
|
1257
1258
|
}
|
|
1258
1259
|
var d = window.getComputedStyle(i, null);
|
|
1259
|
-
const v = parseInt(d.getPropertyValue("height")), C =
|
|
1260
|
+
const v = parseInt(d.getPropertyValue("height")), C = l.isPreview ? 0 : 100;
|
|
1260
1261
|
M.value = v - C, k.value && (J.value = k.value.offsetWidth), window.addEventListener("resize", pe);
|
|
1261
1262
|
const S = q.value;
|
|
1262
|
-
S && (le.value = S.clientWidth, Y.value = J.value - S.clientWidth - 5 - 10, Q.value = M.value - 88), W.value =
|
|
1263
|
+
S && (le.value = S.clientWidth, Y.value = J.value - S.clientWidth - 5 - 10, Q.value = M.value - 88), W.value = h.INITDURATION, Ze();
|
|
1263
1264
|
}), gt(() => {
|
|
1264
|
-
window.removeEventListener("resize", pe), Dn(
|
|
1265
|
+
window.removeEventListener("resize", pe), Dn(l.instanceId);
|
|
1265
1266
|
}), e({
|
|
1266
1267
|
openEditAnnotationDialog: je,
|
|
1267
|
-
confirmDeleteAnnotation:
|
|
1268
|
+
confirmDeleteAnnotation: p,
|
|
1268
1269
|
selectAnnotation: Pt,
|
|
1269
1270
|
selectChannel: Ge,
|
|
1270
1271
|
selectChannels: Rt,
|
|
@@ -1289,8 +1290,8 @@ const qn = (t, e) => {
|
|
|
1289
1290
|
"cursor-loc": ee.value,
|
|
1290
1291
|
start: F.value,
|
|
1291
1292
|
duration: W.value,
|
|
1292
|
-
constants:
|
|
1293
|
-
"active-viewer":
|
|
1293
|
+
constants: h,
|
|
1294
|
+
"active-viewer": y.value,
|
|
1294
1295
|
onSetStart: de
|
|
1295
1296
|
}, null, 8, ["ts_start", "ts_end", "c-width", "label-width", "cursor-loc", "start", "duration", "active-viewer"]),
|
|
1296
1297
|
ge("div", Bn, [
|
|
@@ -1303,7 +1304,7 @@ const qn = (t, e) => {
|
|
|
1303
1304
|
key: S.displayName,
|
|
1304
1305
|
class: "chLabelWrap",
|
|
1305
1306
|
"data-id": S.id,
|
|
1306
|
-
onTap:
|
|
1307
|
+
onTap: It
|
|
1307
1308
|
}, [
|
|
1308
1309
|
ge("div", {
|
|
1309
1310
|
class: Ne([S.selected ? "labelDiv selected" : "labelDiv"])
|
|
@@ -1319,7 +1320,7 @@ const qn = (t, e) => {
|
|
|
1319
1320
|
], 10, Gn)
|
|
1320
1321
|
], 40, Xn))), 128))
|
|
1321
1322
|
], 512),
|
|
1322
|
-
(C = (v =
|
|
1323
|
+
(C = (v = y.value) == null ? void 0 : v.content) != null && C.id ? (he(), Ye(ae(r), {
|
|
1323
1324
|
key: 0,
|
|
1324
1325
|
ref_key: "viewerCanvas",
|
|
1325
1326
|
ref: f,
|
|
@@ -1329,12 +1330,12 @@ const qn = (t, e) => {
|
|
|
1329
1330
|
start: F.value,
|
|
1330
1331
|
"c-width": Y.value,
|
|
1331
1332
|
"c-height": Q.value,
|
|
1332
|
-
constants:
|
|
1333
|
+
constants: h,
|
|
1333
1334
|
"ts-start": j.value,
|
|
1334
1335
|
"ts-end": N.value,
|
|
1335
1336
|
"cursor-loc": ee.value,
|
|
1336
1337
|
"global-zoom-mult": $.value,
|
|
1337
|
-
"active-viewer":
|
|
1338
|
+
"active-viewer": y.value,
|
|
1338
1339
|
onSetStart: de,
|
|
1339
1340
|
onSetCursor: Nt,
|
|
1340
1341
|
onSetGlobalZoom: Ut,
|
|
@@ -1348,7 +1349,7 @@ const qn = (t, e) => {
|
|
|
1348
1349
|
]),
|
|
1349
1350
|
t.isPreview ? Ke("", !0) : (he(), Ye(ae(a), {
|
|
1350
1351
|
key: 0,
|
|
1351
|
-
constants:
|
|
1352
|
+
constants: h,
|
|
1352
1353
|
duration: W.value,
|
|
1353
1354
|
start: F.value,
|
|
1354
1355
|
globalZoomMult: $.value,
|
|
@@ -1362,16 +1363,16 @@ const qn = (t, e) => {
|
|
|
1362
1363
|
onPreviousAnnotation: _t,
|
|
1363
1364
|
onSetStart: de
|
|
1364
1365
|
}, null, 8, ["duration", "start", "globalZoomMult"])),
|
|
1365
|
-
ye(ae(
|
|
1366
|
+
ye(ae(s), {
|
|
1366
1367
|
ref_key: "filterWindow",
|
|
1367
1368
|
ref: V,
|
|
1368
1369
|
visible: ne.value,
|
|
1369
1370
|
"onUpdate:visible": d[1] || (d[1] = (S) => ne.value = S),
|
|
1370
|
-
onCloseWindow:
|
|
1371
|
+
onCloseWindow: Tt
|
|
1371
1372
|
}, null, 8, ["visible"]),
|
|
1372
1373
|
ye(ae(c), {
|
|
1373
1374
|
ref_key: "annotationModal",
|
|
1374
|
-
ref:
|
|
1375
|
+
ref: _,
|
|
1375
1376
|
visible: B.value,
|
|
1376
1377
|
"onUpdate:visible": d[2] || (d[2] = (S) => B.value = S),
|
|
1377
1378
|
onCloseWindow: bt,
|
|
@@ -1397,18 +1398,18 @@ function ar(t = "default") {
|
|
|
1397
1398
|
viewerChannels: n,
|
|
1398
1399
|
viewerAnnotations: r,
|
|
1399
1400
|
viewerActiveTool: a,
|
|
1400
|
-
viewerSelectedChannels:
|
|
1401
|
+
viewerSelectedChannels: s,
|
|
1401
1402
|
activeAnnotation: c,
|
|
1402
1403
|
activeAnnotationLayer: A,
|
|
1403
1404
|
viewerMontageScheme: I,
|
|
1404
|
-
viewerErrors:
|
|
1405
|
-
config:
|
|
1406
|
-
activeViewer:
|
|
1407
|
-
} = Fe(e), w = oe(n),
|
|
1405
|
+
viewerErrors: h,
|
|
1406
|
+
config: l,
|
|
1407
|
+
activeViewer: g
|
|
1408
|
+
} = Fe(e), w = oe(n), b = H(() => s.value), U = oe(r), x = oe(a), O = oe(I), k = oe(h), L = oe(l), q = oe(g);
|
|
1408
1409
|
return {
|
|
1409
1410
|
// Readonly state
|
|
1410
1411
|
channels: w,
|
|
1411
|
-
selectedChannels:
|
|
1412
|
+
selectedChannels: b,
|
|
1412
1413
|
annotations: U,
|
|
1413
1414
|
activeTool: x,
|
|
1414
1415
|
montageScheme: O,
|
|
@@ -1416,78 +1417,78 @@ function ar(t = "default") {
|
|
|
1416
1417
|
viewerConfig: L,
|
|
1417
1418
|
viewer: q,
|
|
1418
1419
|
// State queries
|
|
1419
|
-
getChannel: (
|
|
1420
|
-
getAnnotation: (
|
|
1420
|
+
getChannel: (y) => n.value.find((T) => T.id === y),
|
|
1421
|
+
getAnnotation: (y) => e.getAnnotationById(y),
|
|
1421
1422
|
getActiveLayer: () => e.getViewerActiveLayer(),
|
|
1422
|
-
getVisibleChannels: () => n.value.filter((
|
|
1423
|
+
getVisibleChannels: () => n.value.filter((y) => y.visible),
|
|
1423
1424
|
getState: () => ({
|
|
1424
1425
|
channels: n.value,
|
|
1425
|
-
selectedChannels:
|
|
1426
|
+
selectedChannels: s.value,
|
|
1426
1427
|
annotations: r.value,
|
|
1427
1428
|
activeLayer: e.getViewerActiveLayer(),
|
|
1428
1429
|
activeTool: a.value,
|
|
1429
1430
|
montageScheme: I.value,
|
|
1430
|
-
errors:
|
|
1431
|
+
errors: h.value
|
|
1431
1432
|
}),
|
|
1432
1433
|
// Channel controls
|
|
1433
|
-
selectChannels: (
|
|
1434
|
+
selectChannels: (y, T = !1) => {
|
|
1434
1435
|
const X = n.value.map((Z) => ({
|
|
1435
1436
|
...Z,
|
|
1436
|
-
selected:
|
|
1437
|
+
selected: T ? Z.selected : !1
|
|
1437
1438
|
}));
|
|
1438
1439
|
X.forEach((Z) => {
|
|
1439
|
-
|
|
1440
|
+
y.includes(Z.id) && (Z.selected = !0);
|
|
1440
1441
|
}), e.setChannels(X);
|
|
1441
1442
|
},
|
|
1442
1443
|
clearChannelSelection: () => {
|
|
1443
|
-
const
|
|
1444
|
-
...
|
|
1444
|
+
const y = n.value.map((T) => ({
|
|
1445
|
+
...T,
|
|
1445
1446
|
selected: !1
|
|
1446
1447
|
}));
|
|
1447
|
-
e.setChannels(
|
|
1448
|
+
e.setChannels(y);
|
|
1448
1449
|
},
|
|
1449
|
-
toggleChannelVisibility: (
|
|
1450
|
-
const
|
|
1451
|
-
|
|
1450
|
+
toggleChannelVisibility: (y) => {
|
|
1451
|
+
const T = n.value.find((X) => X.id === y);
|
|
1452
|
+
T && (e.updateChannelVisibility(y, !T.visible), e.triggerRerender("channel-visibility"));
|
|
1452
1453
|
},
|
|
1453
|
-
setChannelVisibility: (
|
|
1454
|
-
e.updateChannelVisibility(
|
|
1454
|
+
setChannelVisibility: (y, T) => {
|
|
1455
|
+
e.updateChannelVisibility(y, T), e.triggerRerender("channel-visibility");
|
|
1455
1456
|
},
|
|
1456
1457
|
showAllChannels: () => {
|
|
1457
|
-
n.value.forEach((
|
|
1458
|
-
e.updateChannelVisibility(
|
|
1458
|
+
n.value.forEach((y) => {
|
|
1459
|
+
e.updateChannelVisibility(y.id, !0);
|
|
1459
1460
|
}), e.triggerRerender("channel-visibility");
|
|
1460
1461
|
},
|
|
1461
1462
|
hideAllChannels: () => {
|
|
1462
|
-
n.value.forEach((
|
|
1463
|
-
e.updateChannelVisibility(
|
|
1463
|
+
n.value.forEach((y) => {
|
|
1464
|
+
e.updateChannelVisibility(y.id, !1);
|
|
1464
1465
|
}), e.triggerRerender("channel-visibility");
|
|
1465
1466
|
},
|
|
1466
1467
|
// Annotation controls
|
|
1467
|
-
selectAnnotation: (
|
|
1468
|
-
const
|
|
1469
|
-
|
|
1468
|
+
selectAnnotation: (y) => {
|
|
1469
|
+
const T = e.getAnnotationById(y);
|
|
1470
|
+
T && e.setActiveAnnotation(T);
|
|
1470
1471
|
},
|
|
1471
|
-
setActiveLayer: (
|
|
1472
|
-
e.setActiveAnnotationLayer(
|
|
1472
|
+
setActiveLayer: (y) => {
|
|
1473
|
+
e.setActiveAnnotationLayer(y);
|
|
1473
1474
|
},
|
|
1474
|
-
toggleLayerVisibility: (
|
|
1475
|
-
const
|
|
1476
|
-
|
|
1475
|
+
toggleLayerVisibility: (y) => {
|
|
1476
|
+
const T = r.value.find((X) => X.id === y);
|
|
1477
|
+
T && (T.visible = !T.visible, e.updateLayer(T), e.triggerRerender("layer-visibility"));
|
|
1477
1478
|
},
|
|
1478
1479
|
// Tool controls
|
|
1479
|
-
setActiveTool: (
|
|
1480
|
-
e.setActiveTool(
|
|
1480
|
+
setActiveTool: (y) => {
|
|
1481
|
+
e.setActiveTool(y);
|
|
1481
1482
|
},
|
|
1482
1483
|
// Viewer controls
|
|
1483
|
-
setConfig: (
|
|
1484
|
-
e.setViewerConfig(
|
|
1484
|
+
setConfig: (y) => {
|
|
1485
|
+
e.setViewerConfig(y);
|
|
1485
1486
|
},
|
|
1486
|
-
setActiveViewer: (
|
|
1487
|
-
e.setActiveViewer(
|
|
1487
|
+
setActiveViewer: (y) => {
|
|
1488
|
+
e.setActiveViewer(y);
|
|
1488
1489
|
},
|
|
1489
|
-
triggerRerender: (
|
|
1490
|
-
e.triggerRerender(
|
|
1490
|
+
triggerRerender: (y = "external") => {
|
|
1491
|
+
e.triggerRerender(y);
|
|
1491
1492
|
},
|
|
1492
1493
|
reset: () => {
|
|
1493
1494
|
e.resetViewer();
|
|
@@ -1504,7 +1505,7 @@ const or = {
|
|
|
1504
1505
|
export {
|
|
1505
1506
|
ie as E,
|
|
1506
1507
|
Zn as T,
|
|
1507
|
-
|
|
1508
|
+
E as _,
|
|
1508
1509
|
We as a,
|
|
1509
1510
|
D as b,
|
|
1510
1511
|
R as c,
|