@pennsieve-viz/tsviewer 1.1.1 → 1.1.2

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.
Files changed (35) hide show
  1. package/dist/{BFLibraryButton-zWDUe3E8.cjs → BFLibraryButton-ClRfrYOf.cjs} +1 -1
  2. package/dist/{BFLibraryButton-DEY9t1Is.js → BFLibraryButton-DzzWe3Ya.js} +1 -1
  3. package/dist/{IconSelection-IJR6hdts.js → IconSelection-Bnm4c-Az.js} +1 -1
  4. package/dist/{IconSelection-DsOecTVD.cjs → IconSelection-CYX2jlGW.cjs} +1 -1
  5. package/dist/TSAnnotationCanvas-BCu7PmSh.cjs +1 -0
  6. package/dist/TSAnnotationCanvas-Cua-lW6X.js +704 -0
  7. package/dist/{TSAnnotationModal-DpLHrHfV.js → TSAnnotationModal-7GxnJomu.js} +3 -3
  8. package/dist/{TSAnnotationModal-DkLaOB7u.cjs → TSAnnotationModal-BVDkiUQ1.cjs} +1 -1
  9. package/dist/{TSFilterModal-C1-o1zyF.js → TSFilterModal-1E2UWL8T.js} +3 -3
  10. package/dist/{TSFilterModal-DsVcUoIk.cjs → TSFilterModal-BVfwi0tb.cjs} +1 -1
  11. package/dist/TSScrubber-CBKcwuMb.js +374 -0
  12. package/dist/TSScrubber-DBWjIhSE.cjs +1 -0
  13. package/dist/{TSViewerCanvas-A6HgBZ4E.js → TSViewerCanvas-D_RaJ4Mj.js} +1865 -1931
  14. package/dist/TSViewerCanvas-gjfcQXDY.cjs +11 -0
  15. package/dist/{TSViewerLayerWindow-Dnij6c3F.js → TSViewerLayerWindow-COWXfHNB.js} +2 -2
  16. package/dist/{TSViewerLayerWindow-Cu8yQKRU.cjs → TSViewerLayerWindow-D5j3_B1E.cjs} +1 -1
  17. package/dist/{TSViewerToolbar-CO68rvXF.js → TSViewerToolbar-Cb2W7W6J.js} +1 -1
  18. package/dist/{TSViewerToolbar-_NqUlS08.cjs → TSViewerToolbar-ep_lZr6h.cjs} +1 -1
  19. package/dist/{TsAnnotationDeleteDialog-D9eQGzqE.js → TsAnnotationDeleteDialog-B9pQMYZo.js} +3 -3
  20. package/dist/{TsAnnotationDeleteDialog-fM5Y7SRB.cjs → TsAnnotationDeleteDialog-BRIgCXxU.cjs} +1 -1
  21. package/dist/index-BU6e_1Ww.js +1414 -0
  22. package/dist/index-C-i9Taq7.cjs +1 -0
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.js +1 -1
  25. package/dist/{pathOr-DKv8SMY9.cjs → pathOr-BQgOyNsu.cjs} +1 -1
  26. package/dist/{pathOr-kR7j_Y-C.js → pathOr-Dr8GvKXg.js} +1 -1
  27. package/dist/style.css +1 -1
  28. package/package.json +1 -1
  29. package/dist/TSAnnotationCanvas-B0b_EheO.js +0 -730
  30. package/dist/TSAnnotationCanvas-Bfxc75PD.cjs +0 -1
  31. package/dist/TSScrubber-9ABMW6b2.js +0 -377
  32. package/dist/TSScrubber-BlHHGh3F.cjs +0 -1
  33. package/dist/TSViewerCanvas-DBpG0Erk.cjs +0 -11
  34. package/dist/index-CMJlEiLT.cjs +0 -1
  35. package/dist/index-CgKUmS0K.js +0 -1459
@@ -1,14 +1,14 @@
1
1
  import "./base-VCnLhxie.js";
2
2
  import { E as F } from "./el-overlay-BMUWCEw_.js";
3
- import { I as g } from "./IconSelection-IJR6hdts.js";
3
+ import { I as g } from "./IconSelection-Bnm4c-Az.js";
4
4
  import { a as y, b as k } from "./el-input-DQtvBLS6.js";
5
5
  import { E as S } from "./el-input-number-DXCID3jJ.js";
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-CgKUmS0K.js";
7
+ import { g as N } from "./index-BU6e_1Ww.js";
8
8
  const H = {
9
9
  name: "TimeseriesFilterModal",
10
10
  components: {
11
- "bf-library-button": () => import("./BFLibraryButton-DEY9t1Is.js"),
11
+ "bf-library-button": () => import("./BFLibraryButton-DzzWe3Ya.js"),
12
12
  IconSelection: g
13
13
  },
14
14
  mixins: [],
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./base-BQSnEcNP.cjs");const m=require("./el-overlay-D192MFpl.cjs"),u=require("./IconSelection-DsOecTVD.cjs"),c=require("./el-input-CwVmeiqs.cjs"),f=require("./el-input-number-Cxwc3-EL.cjs"),e=require("vue"),b=require("./index-CMJlEiLT.cjs"),V={name:"TimeseriesFilterModal",components:{"bf-library-button":()=>Promise.resolve().then(()=>require("./BFLibraryButton-zWDUe3E8.cjs")),IconSelection:u.IconSelection},mixins:[],watch:{},computed:{computeVisible0:function(){switch(this.selectedFilter){case"lowpass":return!0;case"highpass":return!0;case"bandpass":return!0;default:return!1}},onSingleChannel:function(){return this.onChannels.length==1},selectedChannels:function(){return this.onChannels.length},computeVisible1:function(){switch(this.selectedFilter){case"lowpass":return!1;case"highpass":return!1;case"bandpass":return!0;default:return!1}},computeVisible2:function(){switch(this.selectedFilter){case"bandstop":return!0;default:return!1}},computePlaceholder1:function(l){switch(this.selectedFilter){case"lowpass":return"Low Pass Cutoff Frequency (Hz)";case"highpass":return"High Pass Cutoff Frequency (Hz)";case"bandpass":return"Low Pass Cutoff Frequency (Hz)";default:return""}},computePlaceholder2:function(l){switch(this.selectedFilter){case"bandpass":return"High Pass Cutoff Frequency (Hz)";default:return""}}},props:{visible:{type:Boolean,default:!1}},data:function(){return{selectedFilter:null,filterOptions:[{label:"No Filter",value:"clear"},{label:"Low Pass",value:"lowpass"},{label:"High Pass",value:"highpass"},{label:"Band Pass",value:"bandpass"},{label:"Notch",value:"bandstop"}],selectedNotch:null,notchOptions:[{label:"50Hz",value:50},{label:"60Hz",value:60}],input0:null,input1:null,onChannels:[]}},methods:{close:function(){this.$emit("closeWindow")},handleChange:function(){},onButtonClick:function(){},submitForm:function(l){this.$emit("closeWindow")}}},v={slot:"body"},g={class:"select-wrapper"},C={key:0,class:"filter-input-wrapper"},_={key:1,class:"filter-input-wrapper"},k={slot:"footer"},w={class:"button-wrapper"},N={class:"channels-selected"},B={key:0},y={key:1},F={class:"buttons"};function S(l,n,s,P,q,o){const a=c.ElOption,r=c.ElSelect,i=f.ElInputNumber,d=u.IconSelection,p=e.resolveComponent("bf-library-button"),h=m.ElDialog;return e.openBlock(),e.createBlock(h,{class:"timeseries-filter-modal",ref:"filter-modal",title:"Set Filter",modelValue:s.visible,"onUpdate:modelValue":n[4]||(n[4]=t=>s.visible=t),onClose:o.close},{default:e.withCtx(()=>[e.createElementVNode("div",v,[e.createElementVNode("div",g,[e.createVNode(r,{modelValue:l.selectedFilter,"onUpdate:modelValue":n[0]||(n[0]=t=>l.selectedFilter=t),placeholder:"Select"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.filterOptions,t=>(e.openBlock(),e.createBlock(a,{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),o.computeVisible0?(e.openBlock(),e.createElementBlock("div",C,[e.createTextVNode(e.toDisplayString(o.computePlaceholder1)+" ",1),e.createVNode(i,{class:"filterInput",modelValue:l.input0,"onUpdate:modelValue":n[1]||(n[1]=t=>l.input0=t),"controls-position":"right",precision:2,onChange:o.handleChange},null,8,["modelValue","onChange"])])):e.createCommentVNode("",!0),o.computeVisible1?(e.openBlock(),e.createElementBlock("div",_,[e.createTextVNode(e.toDisplayString(o.computePlaceholder2)+" ",1),e.createVNode(i,{class:"filterInput",modelValue:l.input1,"onUpdate:modelValue":n[2]||(n[2]=t=>l.input1=t),"controls-position":"right",precision:2,onChange:o.handleChange},null,8,["modelValue","onChange"])])):e.createCommentVNode("",!0),o.computeVisible2?(e.openBlock(),e.createBlock(r,{key:2,modelValue:l.selectedNotch,"onUpdate:modelValue":n[3]||(n[3]=t=>l.selectedNotch=t),placeholder:"Select",class:"filter-input-wrapper"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.notchOptions,t=>(e.openBlock(),e.createBlock(a,{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0)])])]),footer:e.withCtx(()=>[e.createElementVNode("div",k,[e.createElementVNode("div",w,[e.createElementVNode("div",N,[e.createVNode(d,{height:24,width:24}),o.onSingleChannel?(e.openBlock(),e.createElementBlock("div",B," Adding to single channel ")):(e.openBlock(),e.createElementBlock("div",y," Adding to "+e.toDisplayString(o.selectedChannels)+" Selected Channels ",1))]),e.createElementVNode("div",F,[e.createVNode(p,{onClick:o.submitForm},{default:e.withCtx(()=>[...n[5]||(n[5]=[e.createTextVNode("Set Filter ",-1)])]),_:1},8,["onClick"])])])])]),_:1},8,["modelValue","onClose"])}const E=b._export_sfc(V,[["render",S],["__scopeId","data-v-7546755f"]]);exports.default=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./base-BQSnEcNP.cjs");const m=require("./el-overlay-D192MFpl.cjs"),u=require("./IconSelection-CYX2jlGW.cjs"),c=require("./el-input-CwVmeiqs.cjs"),f=require("./el-input-number-Cxwc3-EL.cjs"),e=require("vue"),b=require("./index-C-i9Taq7.cjs"),V={name:"TimeseriesFilterModal",components:{"bf-library-button":()=>Promise.resolve().then(()=>require("./BFLibraryButton-ClRfrYOf.cjs")),IconSelection:u.IconSelection},mixins:[],watch:{},computed:{computeVisible0:function(){switch(this.selectedFilter){case"lowpass":return!0;case"highpass":return!0;case"bandpass":return!0;default:return!1}},onSingleChannel:function(){return this.onChannels.length==1},selectedChannels:function(){return this.onChannels.length},computeVisible1:function(){switch(this.selectedFilter){case"lowpass":return!1;case"highpass":return!1;case"bandpass":return!0;default:return!1}},computeVisible2:function(){switch(this.selectedFilter){case"bandstop":return!0;default:return!1}},computePlaceholder1:function(l){switch(this.selectedFilter){case"lowpass":return"Low Pass Cutoff Frequency (Hz)";case"highpass":return"High Pass Cutoff Frequency (Hz)";case"bandpass":return"Low Pass Cutoff Frequency (Hz)";default:return""}},computePlaceholder2:function(l){switch(this.selectedFilter){case"bandpass":return"High Pass Cutoff Frequency (Hz)";default:return""}}},props:{visible:{type:Boolean,default:!1}},data:function(){return{selectedFilter:null,filterOptions:[{label:"No Filter",value:"clear"},{label:"Low Pass",value:"lowpass"},{label:"High Pass",value:"highpass"},{label:"Band Pass",value:"bandpass"},{label:"Notch",value:"bandstop"}],selectedNotch:null,notchOptions:[{label:"50Hz",value:50},{label:"60Hz",value:60}],input0:null,input1:null,onChannels:[]}},methods:{close:function(){this.$emit("closeWindow")},handleChange:function(){},onButtonClick:function(){},submitForm:function(l){this.$emit("closeWindow")}}},v={slot:"body"},g={class:"select-wrapper"},C={key:0,class:"filter-input-wrapper"},_={key:1,class:"filter-input-wrapper"},k={slot:"footer"},w={class:"button-wrapper"},N={class:"channels-selected"},B={key:0},y={key:1},F={class:"buttons"};function S(l,n,s,P,q,o){const a=c.ElOption,r=c.ElSelect,i=f.ElInputNumber,d=u.IconSelection,p=e.resolveComponent("bf-library-button"),h=m.ElDialog;return e.openBlock(),e.createBlock(h,{class:"timeseries-filter-modal",ref:"filter-modal",title:"Set Filter",modelValue:s.visible,"onUpdate:modelValue":n[4]||(n[4]=t=>s.visible=t),onClose:o.close},{default:e.withCtx(()=>[e.createElementVNode("div",v,[e.createElementVNode("div",g,[e.createVNode(r,{modelValue:l.selectedFilter,"onUpdate:modelValue":n[0]||(n[0]=t=>l.selectedFilter=t),placeholder:"Select"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.filterOptions,t=>(e.openBlock(),e.createBlock(a,{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),o.computeVisible0?(e.openBlock(),e.createElementBlock("div",C,[e.createTextVNode(e.toDisplayString(o.computePlaceholder1)+" ",1),e.createVNode(i,{class:"filterInput",modelValue:l.input0,"onUpdate:modelValue":n[1]||(n[1]=t=>l.input0=t),"controls-position":"right",precision:2,onChange:o.handleChange},null,8,["modelValue","onChange"])])):e.createCommentVNode("",!0),o.computeVisible1?(e.openBlock(),e.createElementBlock("div",_,[e.createTextVNode(e.toDisplayString(o.computePlaceholder2)+" ",1),e.createVNode(i,{class:"filterInput",modelValue:l.input1,"onUpdate:modelValue":n[2]||(n[2]=t=>l.input1=t),"controls-position":"right",precision:2,onChange:o.handleChange},null,8,["modelValue","onChange"])])):e.createCommentVNode("",!0),o.computeVisible2?(e.openBlock(),e.createBlock(r,{key:2,modelValue:l.selectedNotch,"onUpdate:modelValue":n[3]||(n[3]=t=>l.selectedNotch=t),placeholder:"Select",class:"filter-input-wrapper"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.notchOptions,t=>(e.openBlock(),e.createBlock(a,{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0)])])]),footer:e.withCtx(()=>[e.createElementVNode("div",k,[e.createElementVNode("div",w,[e.createElementVNode("div",N,[e.createVNode(d,{height:24,width:24}),o.onSingleChannel?(e.openBlock(),e.createElementBlock("div",B," Adding to single channel ")):(e.openBlock(),e.createElementBlock("div",y," Adding to "+e.toDisplayString(o.selectedChannels)+" Selected Channels ",1))]),e.createElementVNode("div",F,[e.createVNode(p,{onClick:o.submitForm},{default:e.withCtx(()=>[...n[5]||(n[5]=[e.createTextVNode("Set Filter ",-1)])]),_:1},8,["onClick"])])])])]),_:1},8,["modelValue","onClose"])}const E=b._export_sfc(V,[["render",S],["__scopeId","data-v-7546755f"]]);exports.default=E;
@@ -0,0 +1,374 @@
1
+ import { inject as Ne, ref as v, computed as N, watch as $, nextTick as E, onMounted as Ie, createElementBlock as Ue, openBlock as $e, createElementVNode as x, toDisplayString as K, normalizeStyle as Q } from "vue";
2
+ import { _ as ve, a as me, b as Y, c as Oe, d as de, e as je, f as Le, k as Ve, g as Xe, h as Be, u as ge, i as fe, j as he } from "./index-BU6e_1Ww.js";
3
+ function pe(d, c, l) {
4
+ return function() {
5
+ for (var t = [], S = 0, u = d, k = 0; k < c.length || S < arguments.length; ) {
6
+ var W;
7
+ k < c.length && (!ve(c[k]) || S >= arguments.length) ? W = c[k] : (W = arguments[S], S += 1), t[k] = W, ve(W) || (u -= 1), k += 1;
8
+ }
9
+ return u <= 0 ? l.apply(this, t) : me(u, pe(d, t, l));
10
+ };
11
+ }
12
+ var He = /* @__PURE__ */ Y(function(c, l) {
13
+ return c === 1 ? Oe(l) : me(c, pe(c, [], l));
14
+ });
15
+ function ze(d, c) {
16
+ for (var l = 0, t = c.length, S = Array(t); l < t; )
17
+ S[l] = d(c[l]), l += 1;
18
+ return S;
19
+ }
20
+ var qe = /* @__PURE__ */ (function() {
21
+ function d(c, l) {
22
+ this.xf = l, this.f = c;
23
+ }
24
+ return d.prototype["@@transducer/init"] = de.init, d.prototype["@@transducer/result"] = de.result, d.prototype["@@transducer/step"] = function(c, l) {
25
+ return this.xf["@@transducer/step"](c, this.f(l));
26
+ }, d;
27
+ })(), Ge = /* @__PURE__ */ Y(function(c, l) {
28
+ return new qe(c, l);
29
+ }), Fe = /* @__PURE__ */ Y(
30
+ /* @__PURE__ */ je(["fantasy-land/map", "map"], Ge, function(c, l) {
31
+ switch (Object.prototype.toString.call(l)) {
32
+ case "[object Function]":
33
+ return He(l.length, function() {
34
+ return c.call(this, l.apply(this, arguments));
35
+ });
36
+ case "[object Object]":
37
+ return Le(function(t, S) {
38
+ return t[S] = c(l[S]), t;
39
+ }, {}, Ve(l));
40
+ default:
41
+ return ze(c, l);
42
+ }
43
+ })
44
+ );
45
+ const Je = { class: "timeseries-scrubber" }, Ke = { class: "dateWrap" }, Qe = { class: "noselect" }, Ye = {
46
+ id: "scrubber",
47
+ noselect: ""
48
+ }, Ze = ["width", "height"], et = ["width", "height"], tt = ["width", "height"], nt = {
49
+ __name: "TSScrubber",
50
+ props: {
51
+ ts_start: Number,
52
+ ts_end: Number,
53
+ cWidth: Number,
54
+ constants: Object,
55
+ start: Number,
56
+ duration: Number,
57
+ cursorLoc: Number,
58
+ labelWidth: Number,
59
+ activeViewer: Object
60
+ },
61
+ emits: ["setStart"],
62
+ setup(d, { expose: c, emit: l }) {
63
+ const t = d, S = l, u = Ne("viewerStore", () => Be("default"), !0), k = v(null), W = v(null), z = v(null), w = v(null), g = v(1), Z = v(28), C = v(30), O = v(!1), I = v(""), j = v("point"), ee = v(null), D = v([]), b = v([]), T = v([]), L = v(!1), te = v(0), ne = v(0), P = v(0), V = v(0), Se = N(() => ie(t.ts_start)), _e = N(() => ie(t.ts_end)), be = N(() => {
64
+ if (I.value !== "")
65
+ return I.value;
66
+ if (t.start > 0) {
67
+ const n = new Date(t.start / 1e3).toUTCString();
68
+ return n.substring(0, n.length - 3);
69
+ }
70
+ return "";
71
+ }), ae = N(() => ({
72
+ width: t.labelWidth + t.cWidth - 8 + 5 + "px",
73
+ height: "28px"
74
+ })), we = N(() => ({
75
+ width: t.labelWidth + t.cWidth - 8 + 5 + "px",
76
+ height: "30px"
77
+ })), Ce = N(() => t.cWidth + t.labelWidth - 8 + 5), Te = N(() => Math.floor((t.ts_end - t.ts_start) / t.cWidth));
78
+ $(() => t.start, () => {
79
+ M();
80
+ }), $(() => t.duration, () => {
81
+ M();
82
+ }), $(() => t.cWidth, () => {
83
+ M();
84
+ }), $(() => t.activeViewer, (n, e) => {
85
+ var a;
86
+ n && n !== e && (L.value = !0, se(), (a = n.content) != null && a.id ? E(() => {
87
+ H(), L.value = !1;
88
+ }) : L.value = !1);
89
+ }, { deep: !0 }), $(() => u.viewerChannels, (n, 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)) && (B(), E(() => {
92
+ oe();
93
+ }));
94
+ }, { deep: !0 }), $(() => u.viewerAnnotations, (n, e) => {
95
+ var a;
96
+ n && n !== e && !L.value ? E(() => {
97
+ H();
98
+ }) : n && n.length > 0 && !e && ((a = t.activeViewer) != null && a.content.id) && E(() => {
99
+ H();
100
+ });
101
+ }, { deep: !0 });
102
+ const se = () => {
103
+ D.value = [], B(), O.value = !1, I.value = "", j.value = "point", re();
104
+ }, B = () => {
105
+ T.value = new Array(5e3), T.value = T.value.fill(0, 0, 4999), b.value = [];
106
+ }, re = () => {
107
+ E(() => {
108
+ [W.value, z.value, w.value].forEach((e) => {
109
+ if (e) {
110
+ const a = e.getContext("2d");
111
+ a && a.clearRect(0, 0, e.width, e.height);
112
+ }
113
+ });
114
+ });
115
+ }, U = (n, e, a) => e * (n + a), ye = () => {
116
+ const n = w.value.getContext("2d"), e = window.devicePixelRatio || 1, a = n.webkitBackingStorePixelRatio || n.mozBackingStorePixelRatio || n.msBackingStorePixelRatio || n.oBackingStorePixelRatio || n.backingStorePixelRatio || 1;
117
+ return e / a;
118
+ }, ie = (n) => {
119
+ if (n > 0)
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
+ }, xe = (n) => {
122
+ if (O.value) {
123
+ const a = (n.clientX - te.value) / t.cWidth * (t.ts_end - t.ts_start), r = ne.value + a;
124
+ S("setStart", r);
125
+ const s = new Date((a + t.ts_start) / 1e3);
126
+ I.value = s.toUTCString();
127
+ } else {
128
+ const e = w.value.getBoundingClientRect(), a = n.clientX - e.left, r = P.value + V.value, s = j.value;
129
+ a > P.value - 10 && a < r + 10 ? (j.value = "drag", w.value.setAttribute("dragme", !0), w.value.removeAttribute("resizeme")) : (j.value = "point", w.value.removeAttribute("dragme"), w.value.removeAttribute("resizeme"));
130
+ const i = a / t.cWidth * (t.ts_end - t.ts_start) + t.ts_start, _ = new Date(i / 1e3).toUTCString();
131
+ I.value = _.substring(0, _.length - 3), s !== j.value && M();
132
+ }
133
+ }, ke = () => {
134
+ O.value = !1;
135
+ }, We = (n) => {
136
+ O.value = !0;
137
+ const e = w.value.getBoundingClientRect(), a = n.clientX - e.left;
138
+ te.value = n.clientX;
139
+ const r = a / Ce.value * (t.ts_end - t.ts_start);
140
+ S("setStart", r + t.ts_start), ne.value = r + t.ts_start;
141
+ }, Pe = () => {
142
+ O.value = !1;
143
+ }, Me = () => {
144
+ I.value = "";
145
+ }, oe = () => {
146
+ var a;
147
+ if (!u.viewerChannels || u.viewerChannels.length === 0) {
148
+ console.warn("TSScrubber: Cannot init segment spans - no viewer channels available");
149
+ return;
150
+ }
151
+ if (!t.ts_start || !t.ts_end) {
152
+ console.warn("TSScrubber: Cannot init segment spans - invalid time range");
153
+ return;
154
+ }
155
+ if (!((a = u.config) != null && a.timeSeriesApi)) {
156
+ console.warn("TSScrubber: Cannot init segment spans - no timeSeriesApi configured");
157
+ return;
158
+ }
159
+ B();
160
+ const n = Math.min(t.constants.SEGMENTSPAN, t.ts_end - t.ts_start), e = u.viewerChannels;
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
+ var i;
165
+ const o = t.constants.MAXRECURSION;
166
+ if (!((i = u.config) != null && i.timeSeriesApi)) {
167
+ console.warn("TSScrubber: Cannot request segment span - no timeSeriesApi configured");
168
+ return;
169
+ }
170
+ if (!n) {
171
+ console.warn("TSScrubber: Cannot request segment span - no channel ID provided");
172
+ return;
173
+ }
174
+ try {
175
+ const _ = await ge(), f = `${u.config.timeSeriesApi}/ts/retrieve/segments?session=${_}&channel=${n}&start=${a}&end=${r}`, m = await fe(f);
176
+ if (!u.viewerChannels[e] || u.viewerChannels[e].id !== n) {
177
+ console.warn("TSScrubber: Channel mismatch detected, ignoring segment response (likely package switched)");
178
+ return;
179
+ }
180
+ let h = new Array(m.length * 2), p = 0;
181
+ for (let A = 0; A < m.length; A++) {
182
+ h[p] = m[A][0], h[p + 1] = m[A][1], p = p + 2;
183
+ const J = Math.floor((m[A][0] - t.ts_start) / (t.ts_end - t.ts_start) * 5e3), De = Math.ceil((m[A][1] - t.ts_start) / (t.ts_end - t.ts_start) * 5e3);
184
+ T.value.fill(1, J, De);
185
+ }
186
+ let y = 0, X = !1, F = 0;
187
+ for (b.value = []; y < T.value.length - 1; ) {
188
+ if (!T.value[y] && !X) {
189
+ y++;
190
+ continue;
191
+ } else T.value[y] ? X || (F = y, X = !0) : (b.value = b.value.concat([F, y]), X = !1);
192
+ y++;
193
+ }
194
+ X && (b.value = b.value.concat([F, y])), b.value = b.value.concat([5e3]);
195
+ let Ee = h[0], R = u.viewerChannels[e];
196
+ if (!R || R.id !== n) {
197
+ console.warn("TSScrubber: Channel configuration mismatch, skipping update");
198
+ return;
199
+ }
200
+ Ee < R.dataSegments[R.dataSegments.length - 1] && (h.shift(), h.shift()), R.dataSegments = R.dataSegments.concat(h.sort((A, J) => A - J)), u.updateChannelProperty(R.id, "dataSegments", R.dataSegments);
201
+ let ue = r - a;
202
+ a + ue < t.ts_end && s < o ? le(n, e, r, r + ue, s + 1) : G();
203
+ } catch (_) {
204
+ console.error(`TSScrubber: Error fetching segments for channel ${n}:`, _), he(_);
205
+ }
206
+ }, H = async () => {
207
+ var e, a, r;
208
+ const n = (e = t.activeViewer) == null ? void 0 : e.content.id;
209
+ if (!n) {
210
+ console.warn("TSScrubber: Cannot get annotations - no active viewer ID"), D.value = [];
211
+ return;
212
+ }
213
+ if (!((a = u.config) != null && a.apiUrl)) {
214
+ console.warn("TSScrubber: Cannot get annotations - no API URL configured"), D.value = [];
215
+ return;
216
+ }
217
+ if (!u.viewerAnnotations || u.viewerAnnotations.length === 0) {
218
+ D.value = [], M();
219
+ return;
220
+ }
221
+ try {
222
+ const s = await ge(), o = Fe((h) => h.id, u.viewerAnnotations), i = t.ts_end;
223
+ let f = `${u.config.apiUrl}/timeseries/${n}/annotations/window` + `?api_key=${s}&aggregation=count&start=${t.ts_start}&end=${t.ts_end}&period=${Te.value}&mergePeriods=true`;
224
+ for (let h in o)
225
+ f = f + `&layerIds=${o[h]}`;
226
+ const m = await fe(f);
227
+ ((r = t.activeViewer) == null ? void 0 : r.content.id) === n && (D.value = m, M());
228
+ } catch (s) {
229
+ console.error("TSScrubber: Error fetching annotations:", s), D.value = [], he(s), M();
230
+ }
231
+ }, M = () => {
232
+ q(), ce(), G();
233
+ }, q = () => {
234
+ E(() => {
235
+ const n = w.value;
236
+ if (!n) {
237
+ console.warn("iCanvas ref is missing, skipping render");
238
+ return;
239
+ }
240
+ const e = n.getContext("2d");
241
+ if (!e) {
242
+ console.warn("2D context is not available");
243
+ return;
244
+ }
245
+ e.setTransform(g.value, 0, 0, g.value, 0, 0), e.clearRect(0, 0, t.cWidth, C.value), P.value = (t.start - t.ts_start) / (t.ts_end - t.ts_start) * t.cWidth + 0.5 | 0, V.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(P.value + 0.5, 0.5, V.value, C.value - 1), e.fillRect(P.value - 2, C.value / 2 - 5 | 0, 2, 10), e.fillRect(P.value + V.value + 1, C.value / 2 - 5 | 0, 2, 10);
246
+ const a = P.value + t.cursorLoc * V.value;
247
+ a > P.value + 0.5 && (e.strokeStyle = "red", e.beginPath(), e.moveTo(a, 0), e.lineTo(a, C.value - 1), e.stroke());
248
+ });
249
+ }, G = () => {
250
+ E(() => {
251
+ const n = W.value;
252
+ if (!n) {
253
+ console.warn("segmentsCanvas ref is missing, skipping renderSegments");
254
+ return;
255
+ }
256
+ const e = n.getContext("2d");
257
+ if (!e) {
258
+ console.warn("Unable to get 2D context for segmentsCanvas, skipping renderSegments");
259
+ return;
260
+ }
261
+ e.setTransform(g.value, 0, 0, g.value, 0, 0), e.fillStyle = e.createPattern(ee.value, "repeat"), e.clearRect(0, 0, t.cWidth, C.value);
262
+ for (let a = 1; a < b.value.length; a += 2) {
263
+ const r = t.cWidth * b.value[a] / 5e3, s = t.cWidth * b.value[a + 1] / 5e3;
264
+ e.fillRect(r, 2, s - r, C.value - 6);
265
+ }
266
+ });
267
+ }, ce = () => {
268
+ const n = z.value;
269
+ if (!n) {
270
+ console.warn("annotationCanvas ref is missing, skipping renderTimelimeLine");
271
+ return;
272
+ }
273
+ const e = n.getContext("2d");
274
+ if (!e) {
275
+ console.warn("Unable to get 2D context for annotationCanvas, skipping renderTimelimeLine");
276
+ return;
277
+ }
278
+ e.setTransform(g.value, 0, 0, g.value, 0, 0), e.clearRect(0, 0, t.cWidth, Z.value);
279
+ const a = t.ts_start, r = t.ts_end, s = D.value;
280
+ let o = 0;
281
+ const i = 0, _ = Math.floor((Z.value - 2) / Object.keys(s).length - i), f = u.viewerAnnotations;
282
+ let m = "rgb(0,0,0)";
283
+ for (const h in s)
284
+ if (s.hasOwnProperty(h)) {
285
+ for (let p = 0; p < f.length; p++)
286
+ if (f[p].id === parseInt(h)) {
287
+ o = p, m = f[p].color;
288
+ break;
289
+ }
290
+ Re(e, a, r, i, _, s[h], o, m);
291
+ }
292
+ }, Re = (n, e, a, r, s, o, i, _) => {
293
+ E(() => {
294
+ n.setTransform(g.value, 0, 0, g.value, 0, 0), n.fillStyle = _;
295
+ for (let f = 0; f < o.length; f++)
296
+ if (o[f].value > 0) {
297
+ const m = (o[f].start - e) / (a - e) * t.cWidth;
298
+ let p = (o[f].end - e) / (a - e) * t.cWidth - m;
299
+ p < 1 && (p = 1);
300
+ const y = 1 + i * (s - 1 + r) + i;
301
+ n.fillRect(m, y, p, s);
302
+ }
303
+ });
304
+ }, Ae = () => {
305
+ const n = document.createElement("canvas"), e = n.getContext("2d", { antialias: !0 }), a = "rgb(220,220,220)", r = 5, s = r, o = r, i = 10;
306
+ return n.width = s, n.height = o, e.fillStyle = a, e.beginPath(), e.moveTo(0, o * (1 / i)), e.lineTo(s * (1 / i), 0), e.lineTo(0, 0), e.lineTo(0, o * (1 / i)), e.fill(), e.beginPath(), e.moveTo(s, o * (1 / i)), e.lineTo(s * (1 / i), o), e.lineTo(0, o), e.lineTo(0, o * ((i - 1) / i)), e.lineTo(s * ((i - 1) / i), 0), e.lineTo(s, 0), e.lineTo(s, o * (1 / i)), e.fill(), e.beginPath(), e.moveTo(s, o * ((i - 1) / i)), e.lineTo(s * ((i - 1) / i), o), e.lineTo(s, o), e.lineTo(s, o * ((i - 1) / i)), e.fill(), n;
307
+ };
308
+ return Ie(() => {
309
+ T.value = new Array(5e3), T.value = T.value.fill(0, 0, 4999), g.value = ye(), ee.value = Ae(), q();
310
+ }), c({
311
+ getAnnotations: H,
312
+ initSegmentSpans: oe,
313
+ render: M,
314
+ renderViewPort: q,
315
+ renderSegments: G,
316
+ renderTimelimeLine: ce,
317
+ resetComponentState: se,
318
+ resetSegmentState: B,
319
+ clearCanvases: re
320
+ }), (n, e) => ($e(), Ue("div", Je, [
321
+ x("div", Ke, [
322
+ x("div", null, K(Se.value), 1),
323
+ x("div", null, K(be.value), 1),
324
+ x("div", null, K(_e.value), 1)
325
+ ]),
326
+ x("div", Qe, [
327
+ x("div", Ye, [
328
+ x("div", {
329
+ id: "canvasWrap",
330
+ ref_key: "canvasWrap",
331
+ ref: k
332
+ }, [
333
+ x("canvas", {
334
+ id: "segmentsCanvas",
335
+ class: "canvas",
336
+ ref_key: "segmentsCanvas",
337
+ ref: W,
338
+ width: U(d.cWidth, g.value, 0),
339
+ height: U(C.value - 2, g.value, 0),
340
+ style: Q(ae.value)
341
+ }, null, 12, Ze),
342
+ x("canvas", {
343
+ id: "annotationCanvas",
344
+ class: "canvas",
345
+ ref_key: "annotationCanvas",
346
+ ref: z,
347
+ width: U(d.cWidth, g.value, 0),
348
+ height: U(C.value - 2, g.value, 0),
349
+ style: Q(ae.value)
350
+ }, null, 12, et),
351
+ x("canvas", {
352
+ id: "iCanvas",
353
+ class: "canvas",
354
+ ref_key: "iCanvas",
355
+ ref: w,
356
+ width: U(d.cWidth, g.value, 0),
357
+ height: U(C.value, g.value, 0),
358
+ onClick: e[0] || (e[0] = (...a) => n._onTap && n._onTap(...a)),
359
+ onMousemove: xe,
360
+ onMousedown: We,
361
+ onMouseup: ke,
362
+ onMouseenter: Pe,
363
+ onMouseout: Me,
364
+ style: Q(we.value)
365
+ }, null, 44, tt)
366
+ ], 512)
367
+ ])
368
+ ])
369
+ ]));
370
+ }
371
+ }, rt = /* @__PURE__ */ Xe(nt, [["__scopeId", "data-v-4336befc"]]);
372
+ export {
373
+ rt as default
374
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),d=require("./index-C-i9Taq7.cjs");function se(f,u,c){return function(){for(var t=[],_=0,v=f,k=0;k<u.length||_<arguments.length;){var W;k<u.length&&(!d._isPlaceholder(u[k])||_>=arguments.length)?W=u[k]:(W=arguments[_],_+=1),t[k]=W,d._isPlaceholder(W)||(v-=1),k+=1}return v<=0?c.apply(this,t):d._arity(v,se(f,t,c))}}var Te=d._curry2(function(u,c){return u===1?d._curry1(c):d._arity(u,se(u,[],c))});function Ce(f,u){for(var c=0,t=u.length,_=Array(t);c<t;)_[c]=f(u[c]),c+=1;return _}var ye=(function(){function f(u,c){this.xf=c,this.f=u}return f.prototype["@@transducer/init"]=d._xfBase.init,f.prototype["@@transducer/result"]=d._xfBase.result,f.prototype["@@transducer/step"]=function(u,c){return this.xf["@@transducer/step"](u,this.f(c))},f})(),xe=d._curry2(function(u,c){return new ye(u,c)}),ke=d._curry2(d._dispatchable(["fantasy-land/map","map"],xe,function(u,c){switch(Object.prototype.toString.call(c)){case"[object Function]":return Te(c.length,function(){return u.call(this,c.apply(this,arguments))});case"[object Object]":return d._reduce(function(t,_){return t[_]=u(c[_]),t},{},d.keys(c));default:return Ce(u,c)}}));const We={class:"timeseries-scrubber"},Ee={class:"dateWrap"},Pe={class:"noselect"},Ne={id:"scrubber",noselect:""},Me=["width","height"],Re=["width","height"],Ae=["width","height"],De={__name:"TSScrubber",props:{ts_start:Number,ts_end:Number,cWidth:Number,constants:Object,start:Number,duration:Number,cursorLoc:Number,labelWidth:Number,activeViewer:Object},emits:["setStart"],setup(f,{expose:u,emit:c}){const t=f,_=c,v=a.inject("viewerStore",()=>d.createViewerStore("default"),!0),k=a.ref(null),W=a.ref(null),B=a.ref(null),T=a.ref(null),g=a.ref(1),G=a.ref(28),C=a.ref(30),V=a.ref(!1),A=a.ref(""),I=a.ref("point"),F=a.ref(null),R=a.ref([]),w=a.ref([]),y=a.ref([]),U=a.ref(!1),J=a.ref(0),K=a.ref(0),E=a.ref(0),$=a.ref(0),ie=a.computed(()=>ee(t.ts_start)),oe=a.computed(()=>ee(t.ts_end)),le=a.computed(()=>{if(A.value!=="")return A.value;if(t.start>0){const n=new Date(t.start/1e3).toUTCString();return n.substring(0,n.length-3)}return""}),Q=a.computed(()=>({width:t.labelWidth+t.cWidth-8+5+"px",height:"28px"})),ce=a.computed(()=>({width:t.labelWidth+t.cWidth-8+5+"px",height:"30px"})),ue=a.computed(()=>t.cWidth+t.labelWidth-8+5),ve=a.computed(()=>Math.floor((t.ts_end-t.ts_start)/t.cWidth));a.watch(()=>t.start,()=>{P()}),a.watch(()=>t.duration,()=>{P()}),a.watch(()=>t.cWidth,()=>{P()}),a.watch(()=>t.activeViewer,(n,e)=>{var r;n&&n!==e&&(U.value=!0,Y(),(r=n.content)!=null&&r.id?a.nextTick(()=>{j(),U.value=!1}):U.value=!1)},{deep:!0}),a.watch(()=>v.viewerChannels,(n,e)=>{var r,i;n&&n.length>0&&!U.value&&(!e||n.length!==e.length||((r=n[0])==null?void 0:r.id)!==((i=e[0])==null?void 0:i.id))&&(X(),a.nextTick(()=>{te()}))},{deep:!0}),a.watch(()=>v.viewerAnnotations,(n,e)=>{var r;n&&n!==e&&!U.value?a.nextTick(()=>{j()}):n&&n.length>0&&!e&&((r=t.activeViewer)!=null&&r.content.id)&&a.nextTick(()=>{j()})},{deep:!0});const Y=()=>{R.value=[],X(),V.value=!1,A.value="",I.value="point",Z()},X=()=>{y.value=new Array(5e3),y.value=y.value.fill(0,0,4999),w.value=[]},Z=()=>{a.nextTick(()=>{[W.value,B.value,T.value].forEach(e=>{if(e){const r=e.getContext("2d");r&&r.clearRect(0,0,e.width,e.height)}})})},D=(n,e,r)=>e*(n+r),de=()=>{const n=T.value.getContext("2d"),e=window.devicePixelRatio||1,r=n.webkitBackingStorePixelRatio||n.mozBackingStorePixelRatio||n.msBackingStorePixelRatio||n.oBackingStorePixelRatio||n.backingStorePixelRatio||1;return e/r},ee=n=>{if(n>0)return n=n/1e3,n=new Date(n),("0"+n.getUTCHours()).slice(-2)+":"+("0"+n.getUTCMinutes()).slice(-2)+":"+("0"+n.getUTCSeconds()).slice(-2)},fe=n=>{if(V.value){const r=(n.clientX-J.value)/t.cWidth*(t.ts_end-t.ts_start),i=K.value+r;_("setStart",i);const s=new Date((r+t.ts_start)/1e3);A.value=s.toUTCString()}else{const e=T.value.getBoundingClientRect(),r=n.clientX-e.left,i=E.value+$.value,s=I.value;r>E.value-10&&r<i+10?(I.value="drag",T.value.setAttribute("dragme",!0),T.value.removeAttribute("resizeme")):(I.value="point",T.value.removeAttribute("dragme"),T.value.removeAttribute("resizeme"));const o=r/t.cWidth*(t.ts_end-t.ts_start)+t.ts_start,b=new Date(o/1e3).toUTCString();A.value=b.substring(0,b.length-3),s!==I.value&&P()}},ge=()=>{V.value=!1},he=n=>{V.value=!0;const e=T.value.getBoundingClientRect(),r=n.clientX-e.left;J.value=n.clientX;const i=r/ue.value*(t.ts_end-t.ts_start);_("setStart",i+t.ts_start),K.value=i+t.ts_start},me=()=>{V.value=!1},pe=()=>{A.value=""},te=()=>{var r;if(!v.viewerChannels||v.viewerChannels.length===0){console.warn("TSScrubber: Cannot init segment spans - no viewer channels available");return}if(!t.ts_start||!t.ts_end){console.warn("TSScrubber: Cannot init segment spans - invalid time range");return}if(!((r=v.config)!=null&&r.timeSeriesApi)){console.warn("TSScrubber: Cannot init segment spans - no timeSeriesApi configured");return}X();const n=Math.min(t.constants.SEGMENTSPAN,t.ts_end-t.ts_start),e=v.viewerChannels;for(let i=0;i<e.length;i++)ne(e[i].id,i,t.ts_start,t.ts_start+n,0)},ne=async(n,e,r,i,s)=>{var o;const l=t.constants.MAXRECURSION;if(!((o=v.config)!=null&&o.timeSeriesApi)){console.warn("TSScrubber: Cannot request segment span - no timeSeriesApi configured");return}if(!n){console.warn("TSScrubber: Cannot request segment span - no channel ID provided");return}try{const b=await d.useToken(),h=`${v.config.timeSeriesApi}/ts/retrieve/segments?session=${b}&channel=${n}&start=${r}&end=${i}`,p=await d.useSendXhr(h);if(!v.viewerChannels[e]||v.viewerChannels[e].id!==n){console.warn("TSScrubber: Channel mismatch detected, ignoring segment response (likely package switched)");return}let m=new Array(p.length*2),S=0;for(let M=0;M<p.length;M++){m[S]=p[M][0],m[S+1]=p[M][1],S=S+2;const q=Math.floor((p[M][0]-t.ts_start)/(t.ts_end-t.ts_start)*5e3),we=Math.ceil((p[M][1]-t.ts_start)/(t.ts_end-t.ts_start)*5e3);y.value.fill(1,q,we)}let x=0,O=!1,z=0;for(w.value=[];x<y.value.length-1;){if(!y.value[x]&&!O){x++;continue}else y.value[x]?O||(z=x,O=!0):(w.value=w.value.concat([z,x]),O=!1);x++}O&&(w.value=w.value.concat([z,x])),w.value=w.value.concat([5e3]);let be=m[0],N=v.viewerChannels[e];if(!N||N.id!==n){console.warn("TSScrubber: Channel configuration mismatch, skipping update");return}be<N.dataSegments[N.dataSegments.length-1]&&(m.shift(),m.shift()),N.dataSegments=N.dataSegments.concat(m.sort((M,q)=>M-q)),v.updateChannelProperty(N.id,"dataSegments",N.dataSegments);let re=i-r;r+re<t.ts_end&&s<l?ne(n,e,i,i+re,s+1):L()}catch(b){console.error(`TSScrubber: Error fetching segments for channel ${n}:`,b),d.useHandleXhrError(b)}},j=async()=>{var e,r,i;const n=(e=t.activeViewer)==null?void 0:e.content.id;if(!n){console.warn("TSScrubber: Cannot get annotations - no active viewer ID"),R.value=[];return}if(!((r=v.config)!=null&&r.apiUrl)){console.warn("TSScrubber: Cannot get annotations - no API URL configured"),R.value=[];return}if(!v.viewerAnnotations||v.viewerAnnotations.length===0){R.value=[],P();return}try{const s=await d.useToken(),l=ke(m=>m.id,v.viewerAnnotations),o=t.ts_end;let h=`${v.config.apiUrl}/timeseries/${n}/annotations/window`+`?api_key=${s}&aggregation=count&start=${t.ts_start}&end=${t.ts_end}&period=${ve.value}&mergePeriods=true`;for(let m in l)h=h+`&layerIds=${l[m]}`;const p=await d.useSendXhr(h);((i=t.activeViewer)==null?void 0:i.content.id)===n&&(R.value=p,P())}catch(s){console.error("TSScrubber: Error fetching annotations:",s),R.value=[],d.useHandleXhrError(s),P()}},P=()=>{H(),ae(),L()},H=()=>{a.nextTick(()=>{const n=T.value;if(!n){console.warn("iCanvas ref is missing, skipping render");return}const e=n.getContext("2d");if(!e){console.warn("2D context is not available");return}e.setTransform(g.value,0,0,g.value,0,0),e.clearRect(0,0,t.cWidth,C.value),E.value=(t.start-t.ts_start)/(t.ts_end-t.ts_start)*t.cWidth+.5|0,$.value=t.duration/(t.ts_end-t.ts_start)*t.cWidth+.5|0,e.fillStyle="rgb(80,80,80)",e.strokeStyle="rgb(80,80,80)",e.strokeRect(E.value+.5,.5,$.value,C.value-1),e.fillRect(E.value-2,C.value/2-5|0,2,10),e.fillRect(E.value+$.value+1,C.value/2-5|0,2,10);const r=E.value+t.cursorLoc*$.value;r>E.value+.5&&(e.strokeStyle="red",e.beginPath(),e.moveTo(r,0),e.lineTo(r,C.value-1),e.stroke())})},L=()=>{a.nextTick(()=>{const n=W.value;if(!n){console.warn("segmentsCanvas ref is missing, skipping renderSegments");return}const e=n.getContext("2d");if(!e){console.warn("Unable to get 2D context for segmentsCanvas, skipping renderSegments");return}e.setTransform(g.value,0,0,g.value,0,0),e.fillStyle=e.createPattern(F.value,"repeat"),e.clearRect(0,0,t.cWidth,C.value);for(let r=1;r<w.value.length;r+=2){const i=t.cWidth*w.value[r]/5e3,s=t.cWidth*w.value[r+1]/5e3;e.fillRect(i,2,s-i,C.value-6)}})},ae=()=>{const n=B.value;if(!n){console.warn("annotationCanvas ref is missing, skipping renderTimelimeLine");return}const e=n.getContext("2d");if(!e){console.warn("Unable to get 2D context for annotationCanvas, skipping renderTimelimeLine");return}e.setTransform(g.value,0,0,g.value,0,0),e.clearRect(0,0,t.cWidth,G.value);const r=t.ts_start,i=t.ts_end,s=R.value;let l=0;const o=0,b=Math.floor((G.value-2)/Object.keys(s).length-o),h=v.viewerAnnotations;let p="rgb(0,0,0)";for(const m in s)if(s.hasOwnProperty(m)){for(let S=0;S<h.length;S++)if(h[S].id===parseInt(m)){l=S,p=h[S].color;break}Se(e,r,i,o,b,s[m],l,p)}},Se=(n,e,r,i,s,l,o,b)=>{a.nextTick(()=>{n.setTransform(g.value,0,0,g.value,0,0),n.fillStyle=b;for(let h=0;h<l.length;h++)if(l[h].value>0){const p=(l[h].start-e)/(r-e)*t.cWidth;let S=(l[h].end-e)/(r-e)*t.cWidth-p;S<1&&(S=1);const x=1+o*(s-1+i)+o;n.fillRect(p,x,S,s)}})},_e=()=>{const n=document.createElement("canvas"),e=n.getContext("2d",{antialias:!0}),r="rgb(220,220,220)",i=5,s=i,l=i,o=10;return n.width=s,n.height=l,e.fillStyle=r,e.beginPath(),e.moveTo(0,l*(1/o)),e.lineTo(s*(1/o),0),e.lineTo(0,0),e.lineTo(0,l*(1/o)),e.fill(),e.beginPath(),e.moveTo(s,l*(1/o)),e.lineTo(s*(1/o),l),e.lineTo(0,l),e.lineTo(0,l*((o-1)/o)),e.lineTo(s*((o-1)/o),0),e.lineTo(s,0),e.lineTo(s,l*(1/o)),e.fill(),e.beginPath(),e.moveTo(s,l*((o-1)/o)),e.lineTo(s*((o-1)/o),l),e.lineTo(s,l),e.lineTo(s,l*((o-1)/o)),e.fill(),n};return a.onMounted(()=>{y.value=new Array(5e3),y.value=y.value.fill(0,0,4999),g.value=de(),F.value=_e(),H()}),u({getAnnotations:j,initSegmentSpans:te,render:P,renderViewPort:H,renderSegments:L,renderTimelimeLine:ae,resetComponentState:Y,resetSegmentState:X,clearCanvases:Z}),(n,e)=>(a.openBlock(),a.createElementBlock("div",We,[a.createElementVNode("div",Ee,[a.createElementVNode("div",null,a.toDisplayString(ie.value),1),a.createElementVNode("div",null,a.toDisplayString(le.value),1),a.createElementVNode("div",null,a.toDisplayString(oe.value),1)]),a.createElementVNode("div",Pe,[a.createElementVNode("div",Ne,[a.createElementVNode("div",{id:"canvasWrap",ref_key:"canvasWrap",ref:k},[a.createElementVNode("canvas",{id:"segmentsCanvas",class:"canvas",ref_key:"segmentsCanvas",ref:W,width:D(f.cWidth,g.value,0),height:D(C.value-2,g.value,0),style:a.normalizeStyle(Q.value)},null,12,Me),a.createElementVNode("canvas",{id:"annotationCanvas",class:"canvas",ref_key:"annotationCanvas",ref:B,width:D(f.cWidth,g.value,0),height:D(C.value-2,g.value,0),style:a.normalizeStyle(Q.value)},null,12,Re),a.createElementVNode("canvas",{id:"iCanvas",class:"canvas",ref_key:"iCanvas",ref:T,width:D(f.cWidth,g.value,0),height:D(C.value,g.value,0),onClick:e[0]||(e[0]=(...r)=>n._onTap&&n._onTap(...r)),onMousemove:fe,onMousedown:he,onMouseup:ge,onMouseenter:me,onMouseout:pe,style:a.normalizeStyle(ce.value)},null,44,Ae)],512)])])]))}},Ve=d._export_sfc(De,[["__scopeId","data-v-4336befc"]]);exports.default=Ve;